text
stringlengths
2
99.9k
meta
dict
/* jquery.jspanel.css version 2.5.3 - 2015-05-16 22:21 */ @font-face { font-family: 'jsglyphregular'; src: url('fonts/jsglyph.eot'); src: url('fonts/jsglyph.eot?#iefix') format('embedded-opentype'), url('fonts/jsglyph.woff2') format('woff2'), url('fonts/jsglyph.woff') format('woff'), url('fonts/jsglyph.ttf') format('truetype'), url('fonts/jsglyph.svg#jsglyphregular') format('svg'); font-weight: normal; font-style: normal; } .jsglyph{ font-family: "jsglyphregular"; } .jsglyph-minimize:before{ content: "\e001"; } /* unicode &#xe001; */ .jsglyph-maximize:before{ content: "\e002"; } .jsglyph-chevron-up:before{ content: "\e003"; } .jsglyph-chevron-down:before{ content: "\e004"; } .jsglyph-normalize:before{ content: "\e005"; } .jsglyph-tick:before{ content: "\e006"; } .jsglyph-remove:before{ content: "\e007"; } .jsglyph-chevron-right:before{ content: "\e008"; } .jsglyph-chevron-left:before{ content: "\e009"; } .jsglyph-plus:before{ content: "\e00a"; } .jsglyph-minus:before{ content: "\e00b"; } .jsglyph-trashcan:before{ content: "\e00c"; } .jsglyph-square-info:before{ content: "\e00d"; } .jsglyph-square-exclamationmark:before{ content: "\e00e"; } .jsglyph-delete:before{ content: "\e00f"; } .jsglyph-mail:before{ content: "\e010"; } .jsglyph-envelope:before{ content: "\e011"; } .jsglyph-play:before{ content: "\e012"; } .jsglyph-forward:before{ content: "\e013"; } .jsglyph-backward:before{ content: "\e014"; } .jsglyph-step-forward:before{ content: "\e015"; } .jsglyph-step-backward:before{ content: "\e016"; } .jsglyph-fast-forward:before{ content: "\e017"; } .jsglyph-fast-backward:before{ content: "\e018"; } .jsglyph-eject:before{ content: "\e019"; } .jsglyph-stop:before{ content: "\e01a"; } .jsglyph-pause:before{ content: "\e01b"; } .jsglyph-arrow-right:before{ content: "\e01c"; } .jsglyph-arrow-left:before{ content: "\e01d"; } .jsglyph-arrow-up:before{ content: "\e01e"; } .jsglyph-arrow-down:before{ content: "\e01f"; } .jsglyph-star-halffull:before{ content: "\e020"; } .jsglyph-star:before{ content: "\e021"; } .jsglyph-star-empty:before{ content: "\e022"; } .jsglyph-arrow-right-hollow:before{ content: "\e023"; } .jsglyph-arrow-left-hollow:before{ content: "\e024"; } .jsglyph-arrow-up-hollow:before{ content: "\e025"; } .jsglyph-arrow-down-hollow:before{ content: "\e026"; } .jsglyph-square-questionmark:before{ content: "\e027"; } .jsglyph-circle-info:before{ content: "\e028"; } .jsglyph-circle-exclamationmark:before{ content: "\e029"; } .jsglyph-circle-questionmark:before{ content: "\e02a"; } .jsglyph-circle2-info:before{ content: "\e02b"; } .jsglyph-circle2-exclamationmark:before{ content: "\e02c"; } .jsglyph-circle2-questionmark:before{ content: "\e02d"; } .jsglyph-resize-handle:before{ content: "\e02e"; } .jsglyph-resize-handle-2:before{ content: "\e02f"; } .jsglyph-pencil:before{ content: "\e030"; } .jsglyph-refresh:before{ content: "\e031"; } .jsglyph-volume-off:before{ content: "\e032"; } .jsglyph-volume-up:before{ content: "\e033"; } .jsglyph-volume-down:before{ content: "\e034"; } .jsglyph-link:before{ content: "\e035"; } .jsglyph-eye-open:before{ content: "\e036"; } .jsglyph-eye-slash:before{ content: "\e037"; } .jsglyph-power-on:before{ content: "\e038"; } .jsglyph-cog:before{ content: "\e039"; } .jsglyph-cog2:before{ content: "\e03a"; } .jsglyph-torso:before{ content: "\e03b"; } .jsglyph-people:before{ content: "\e03c"; } .jsglyph-torso-female:before{ content: "\e03d"; } .jsglyph-people-female:before{ content: "\e03e"; } .jsglyph-torso-male-female:before{ content: "\e03f"; } .jsglyph-torso-female-male:before{ content: "\e040"; } .jsglyph-torso-hollow:before{ content: "\e041"; } .jsglyph-cog3:before{ content: "\e042"; } .jsglyph-tools:before{ content: "\e043"; } .jsglyph-home:before{ content: "\e044"; } .jsglyph-login:before{ content: "\e045"; } .jsglyph-logout:before{ content: "\e046"; } .jsglyph-download:before{ content: "\e047"; } .jsglyph-upload:before{ content: "\e048"; } .jsglyph-reload:before{ content: "\e049"; } .jsglyph-lock:before{ content: "\e04a"; } .jsglyph-unlock:before{ content: "\e04b"; } .jsglyph-save:before{ content: "\e04c"; } .jsglyph-wrench:before{ content: "\e04d"; } .jsglyph-search:before{ content: "\e04e"; } .jsglyph-zoom-in:before{ content: "\e04f"; } .jsglyph-zoom-out:before{ content: "\e050"; } .jsglyph-bars:before{ content: "\e051"; } .jsglyph-marker:before{ content: "\e052"; } .jsglyph-resize-handle-left:before{ content: "\e053"; } .jsglyph-resize-handle-2-left:before{ content: "\e054"; } .jsglyph-edit:before{ content: "\e055"; } .jsPanel, .jsPanel-hdr-r, .jsPanel-hdr-l, .jsPanel-hdr-r span img, .jsPanel-content{ margin: 0; padding: 0; border: 0; font-size: 100%; line-height: 1.5em; vertical-align: baseline; } .jsPanel{ box-sizing: border-box; overflow: hidden; position: absolute; border-radius: 3px; z-index: 100; } .jsPanel-hdr{ box-sizing: border-box; min-height: 26px; padding: 2px 0 4px 2px; } .jsPanel-hdr *{ font-size: 16px; } .jsPanel-hdr-r{ position: absolute; top: 0; right: 0; } h3.jsPanel-title{ float: left; width: calc(100% - 90px); white-space: nowrap; overflow: hidden; text-align: left; text-overflow: ellipsis; margin: 0; font-variant: small-caps; font-weight: normal; cursor: move; min-height: 20px; padding: 0 5px; } .jsPanel-hdr-r div{ float: right; cursor: pointer; margin-left: 1px; width: auto; height: auto; min-width: 20px; min-height: 20px; overflow: hidden; } .jsPanel-btn-close{ background: url("images/icon-sprite-20x20.jpg") 20px 0 repeat no-repeat; } .jsPanel-btn-max{ background: url("images/icon-sprite-20x20.jpg") 40px 0 repeat no-repeat; } .jsPanel-btn-norm{ background: url("images/icon-sprite-20x20.jpg") 60px 0 repeat no-repeat; display: none; } .jsPanel-btn-min{ background: url("images/icon-sprite-20x20.jpg") 80px 0 repeat no-repeat; } .jsPanel-btn-small{ background: url("images/icon-sprite-20x20.jpg") 100px 0 repeat no-repeat; } .jsPanel-btn-smallrev{ background: url("images/icon-sprite-20x20.jpg") 120px 0 repeat no-repeat; display: none; } .jsPanel-hdr-toolbar { box-sizing: border-box; clear: both; font-size: 16px; margin-top: 23px; height: auto; padding: 0 5px; width: auto; } .jsPanel-hdr-toolbar img{ cursor: pointer; margin-bottom: 4px; margin-right: 5px; } .jsPanel-content { font-size: 12px; position: relative; width: 100%; overflow: hidden; box-sizing: border-box; } .jsPanel-ftr{ box-sizing: border-box; cursor: move; display: none; font-size: 12px; height: auto; padding: 2px 2px 2px 5px; text-align: right; } .jsPanel-ftr button{ margin: 5px; } /* clearfix */ .jsPanel-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } /* container that takes the minified jsPanels */ #jsPanel-min-container{ position:fixed; left:0; bottom:0; width:auto; height:28px; background:transparent; z-index:9999; } /* css for the modal backdrop --------------------------- */ .jsPanel-backdrop{ position:absolute; top:0; left:0; z-index:10000; width:100%; background:rgba(0,0,0,0.7); } .jsPanel-backdrop-inner{ position:absolute; width:100%; } /* THEMES ------------------------------------------------------------------------- */ /* default ------------------------------------------- */ .jsPanel.jsPanel-theme-default{ background: none repeat scroll 0 0 #fff; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-default{ color: #000; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; } .jsPanel-hdr.jsPanel-theme-default h3{ color: #000; } .jsPanel-hdr.jsPanel-theme-default h3 small{ color: #000; font-size: 65%; } .jsPanel-content.jsPanel-theme-default{ background: none repeat scroll 0 0 #FFFFFF; color: #000; font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-default{ font-size: 12px; height: auto; padding: 2px 2px 2px 5px; text-align: right; } .jsPanel-theme-default .ui-icon-gripsmall-diagonal-se{ color: #000; } /* light ------------------------------------------- */ .jsPanel.jsPanel-theme-light{ background: #f1f1f1; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-light{ color: #000; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #f1f1f1; } .jsPanel-hdr.jsPanel-theme-light h3{ color: #000; } .jsPanel-hdr.jsPanel-theme-light h3 small{ color: #000; font-size: 65%; } .jsPanel-content.jsPanel-theme-light { background: none repeat scroll 0 0 #FFFFFF; color: #000; font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-light{ color: #000; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #f1f1f1; } .jsPanel-theme-light .ui-icon-gripsmall-diagonal-se{ color: #000; } /* medium -------------------------------------------- */ .jsPanel.jsPanel-theme-medium{ background: #c2c2c2; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-medium{ color: #000; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #c2c2c2; } .jsPanel-hdr.jsPanel-theme-medium h3{ color: #000; } .jsPanel-hdr.jsPanel-theme-medium h3 small{ color: #000; font-size: 65%; } .jsPanel-content.jsPanel-theme-medium { background: none repeat scroll 0 0 #fff; color: #000; font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-medium{ color: #000; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #c2c2c2; } .jsPanel-theme-medium .ui-icon-gripsmall-diagonal-se{ color: #000; } /* dark ---------------------------------------------- */ .jsPanel.jsPanel-theme-dark{ background: #828282; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-dark{ color: #fff; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #828282; } .jsPanel-hdr.jsPanel-theme-dark h3{ color: #fff; } .jsPanel-hdr.jsPanel-theme-dark h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-dark { background: none repeat scroll 0 0 #fff; color: #000; font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-dark{ color: #fff; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #828282; } .jsPanel-theme-dark .ui-icon-gripsmall-diagonal-se{ color: #000; } /* black ---------------------------------------------- */ .jsPanel.jsPanel-theme-black{ background: linear-gradient(#4a4a4a 0px, black 100%) repeat scroll 0 0 #4a4a4a; background: -ms-linear-gradient(#4a4a4a 0px, black 100%) repeat scroll 0 0 #4a4a4a; box-shadow: 0 0 3px #333; } .jsPanel-hdr.jsPanel-theme-black{ color: #fff; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: transparent; } .jsPanel-hdr.jsPanel-theme-black h3{ color: #fff; } .jsPanel-hdr.jsPanel-theme-black h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-black { background: transparent; color: #c3c3c3; } .jsPanel-ftr.jsPanel-theme-black{ color: #fff; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: transparent; } .jsPanel-theme-black .ui-icon-gripsmall-diagonal-se{ color: #fff; } /* primary ---------------------------------------------- */ .jsPanel.jsPanel-theme-primary{ background: none repeat scroll 0 0 #fff; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-primary{ color: #ffffff; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #2FA4E7; } .jsPanel-hdr.jsPanel-theme-primary h3{ color: #fff; } .jsPanel-hdr.jsPanel-theme-primary h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-primary { background: none repeat scroll 0 0 #ffffff; color: #000000; font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-primary{} .jsPanel-theme-primary .ui-icon-gripsmall-diagonal-se{ color: #000; } /* success --------------------------------------------- */ .jsPanel.jsPanel-theme-success{ background: none repeat scroll 0 0 #fff; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-success{ color: #fff; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #73A839; } .jsPanel-hdr.jsPanel-theme-success h3{ color: #fff; } .jsPanel-hdr.jsPanel-theme-success h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-success { background: none repeat scroll 0 0 #ffffff; color: #000000; font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-success{} .jsPanel-theme-successt .ui-icon-gripsmall-diagonal-se{ color: #000; } /* info ---------------------------------------------- */ .jsPanel.jsPanel-theme-info{ background: none repeat scroll 0 0 #fff; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-info{ color: #fff; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #033C73; } .jsPanel-hdr.jsPanel-theme-info h3{ color: #fff; } .jsPanel-hdr.jsPanel-theme-info h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-info { background: none repeat scroll 0 0 #ffffff; color: #000000; font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-info{} .jsPanel-theme-info .ui-icon-gripsmall-diagonal-se{ color: #000; } /* warning ----------------------------------------------- */ .jsPanel.jsPanel-theme-warning{ background: none repeat scroll 0 0 #fff; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-warning{ color: #fff; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #DD5600; } .jsPanel-hdr.jsPanel-theme-warning h3{ color: #fff; } .jsPanel-hdr.jsPanel-theme-warning h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-warning { background: none repeat scroll 0 0 #fff; color: #000; font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-warning{} .jsPanel-theme-warning .ui-icon-gripsmall-diagonal-se{ color: #000; } /* danger ----------------------------------------------- */ .jsPanel.jsPanel-theme-danger{ background: none repeat scroll 0 0 #fff; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-danger{ color: #fff; font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: #C71C22; } .jsPanel-hdr.jsPanel-theme-danger h3{ color: #fff; } .jsPanel-hdr.jsPanel-theme-danger h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-danger { background: none repeat scroll 0 0 #ffffff; color: #000000; font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-danger{} .jsPanel-theme-danger .ui-icon-gripsmall-diagonal-se{ color: #000; } /* autumngreen ------------------------------------------- */ .jsPanel.jsPanel-theme-autumngreen{ background: none repeat scroll 0 0 #eee; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-autumngreen{ color: rgb(196, 189, 142); font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: rgb(125, 126, 81); } .jsPanel-hdr.jsPanel-theme-autumngreen h3{ color: rgb(196, 189, 142); } .jsPanel-hdr.jsPanel-theme-autumngreen h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-autumngreen { background: none repeat scroll 0 0 #FFFFFF; color: rgb(110, 100, 73); font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-autumngreen{ background: linear-gradient(to bottom, rgba(125, 126, 81,0.65) 0%,rgba(0,0,0,0) 100%); background: -ms-linear-gradient(top, rgba(125, 126, 81,0.65) 0%,rgba(0,0,0,0) 100%); color: rgb(110, 100, 73); } .jsPanel-theme-autumngreen .ui-icon-gripsmall-diagonal-se{ color: #000; } /* autumnbrown ------------------------------------------- */ .jsPanel.jsPanel-theme-autumnbrown{ background: none repeat scroll 0 0 #eee; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-autumnbrown{ color: rgb(233, 206, 135); font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: rgb(138, 91, 51); } .jsPanel-hdr.jsPanel-theme-autumnbrown h3{ color: rgb(233, 206, 135); } .jsPanel-hdr.jsPanel-theme-autumnbrown h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-autumnbrown { background: none repeat scroll 0 0 #FFFFFF; color: rgb(110, 100, 73); font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-autumnbrown{ background: linear-gradient(to bottom, rgba(138, 91, 51,0.65) 0%,rgba(0,0,0,0) 100%); background: -ms-linear-gradient(top, rgba(138, 91, 51,0.65) 0%,rgba(0,0,0,0) 100%); color: rgb(110, 100, 73); } .jsPanel-theme-autumnbrown .ui-icon-gripsmall-diagonal-se{ color: #000; } /* autumnred ------------------------------------------- */ .jsPanel.jsPanel-theme-autumnred{ background: none repeat scroll 0 0 #eee; box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } .jsPanel-hdr.jsPanel-theme-autumnred{ color: rgb(233, 206, 135); font-family: tahoma,arial,verdana,sans-serif; font-weight: normal; background: rgb(198, 113, 10); } .jsPanel-hdr.jsPanel-theme-autumnred h3{ color: rgb(233, 206, 135); } .jsPanel-hdr.jsPanel-theme-autumnred h3 small{ color: #fff; font-size: 65%; } .jsPanel-content.jsPanel-theme-autumnred { background: none repeat scroll 0 0 #FFFFFF; color: rgb(110, 100, 73); font-family: tahoma,arial,verdana,sans-serif; outline: 1px solid #bbb; } .jsPanel-ftr.jsPanel-theme-autumnred{ background: linear-gradient(to bottom, rgba(198, 113, 10,0.65) 0%,rgba(0,0,0,0) 100%); background: -ms-linear-gradient(top, rgba(198, 113, 10,0.65) 0%,rgba(0,0,0,0) 100%); color: rgb(110, 100, 73); } .jsPanel-theme-autumnred .ui-icon-gripsmall-diagonal-se{ color: #000; } /* bootstrap adjustments */ .jsPanel.panel-default, .jsPanel.panel-primary, .jsPanel.panel-info, .jsPanel.panel-success, .jsPanel.panel-warning, .jsPanel.panel-danger{ box-shadow: 0 0 6px rgba(0, 33, 50, 0.1), 0 7px 25px rgba(17, 38, 60, 0.4); } /* jQuery-UI adjustments */ .ui-icon-gripsmall-diagonal-se { background: none repeat scroll 0 0 rgba(0, 0, 0, 0); color: #000; font-family: jsglyphregular; font-size: 16px; line-height: 16px; } .ui-icon-gripsmall-diagonal-se:before { content: "\e02f"; } .ui-resizable-handle.ui-resizable-se.ui-icon.ui-icon-gripsmall-diagonal-se{ text-indent: 0; bottom: 2px; } /* uncomment to show a lower left resize icon .ui-resizable-handle.ui-resizable-sw{ background: none repeat scroll 0 0 rgba(0, 0, 0, 0); color: #000; font-family: jsglyphregular; font-size: 16px; line-height: 16px; text-indent: 7px; bottom: 2px; width: 16px; height: 16px; } .ui-resizable-handle.ui-resizable-sw:before{ content: "\e054"; } */ /* css for the tooltip wrapper ---------------------------- */ .jsPanel-tooltip-wrapper{ position: relative; display: inline-block; /* do not change !!! inline würde gehen -> offsets neu berechnen */ margin: 0; padding: 0; border: none; background: transparent; } .jsPanel-tooltip-wrapper .jsPanel{ border-radius: 4px; } /* css for tooltip corners */ .jsPanel-corner-top, .jsPanel-corner-right, .jsPanel-corner-bottom, .jsPanel-corner-left{ width: 0; height: 0; border: 12px solid transparent; position: absolute; } .jsPanel-corner-top{ border-top-width: 10px; } .jsPanel-corner-right{ border-right-width: 10px; } .jsPanel-corner-bottom{ border-bottom-width: 10px; } .jsPanel-corner-left{ border-left-width: 10px; } /* css for the hints ----------------------------------------------------------- */ .jsPanel-hint{ margin-bottom: 4px; } .jsPanel-hint-close{ float: right; font-size: 1.5em; margin: 4px 5px 0 0; cursor: pointer; } .jsPanel-hint-content.jsPanel-hint-default{ background: #fff none repeat scroll 0 0; border: 2px solid #222; color: #222; text-shadow: 1px 1px 1px #789; } .jsPanel-hint-content.jsPanel-hint-light{ background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(250,250,250,0.65) 100%); background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(250,250,250,0.65) 100%); color: #000; } .jsPanel-hint-content.jsPanel-hint-medium{ background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(130, 130, 130, 1) 100%); background: -ms-linear-gradient(top, rgba(0, 0, 0, 0) 0%, rgba(130, 130, 130, 1) 100%); color: #fff; } .jsPanel-hint-content.jsPanel-hint-dark{ background: linear-gradient(to bottom, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%); background: -ms-linear-gradient(top, rgba(181,189,200,1) 0%,rgba(130,140,149,1) 36%,rgba(40,52,59,1) 100%); color: #fff; } .jsPanel-hint-content.jsPanel-hint-autumngreen{ background: linear-gradient(to bottom, rgba(125, 126, 81,0.65) 0%,rgba(0,0,0,0) 100%); background: -ms-linear-gradient(top, rgba(125, 126, 81,0.65) 0%,rgba(0,0,0,0) 100%); color: #fff; } .jsPanel-hint-content.jsPanel-hint-autumnbrown{ background: linear-gradient(to bottom, rgba(138, 91, 51,0.65) 0%,rgba(0,0,0,0) 100%); background: -ms-linear-gradient(top, rgba(138, 91, 51,0.65) 0%,rgba(0,0,0,0) 100%); color: #fff; } .jsPanel-hint-content.jsPanel-hint-autumnred{ background: linear-gradient(to bottom, rgba(198, 113, 10,0.65) 0%,rgba(0,0,0,0) 100%); background: -ms-linear-gradient(top, rgba(198, 113, 10,0.65) 0%,rgba(0,0,0,0) 100%); color: #fff; } .jsPanel-hint-content.jsPanel-hint-primary{ background: #82C8F1 none repeat scroll 0 0; border: 5px solid #02436A; color: #02436A; text-shadow: 2px 2px 2px #fff; } .jsPanel-hint-content.jsPanel-hint-info{ background: #4594c3 none repeat scroll 0 0; border: 5px solid #033c73; color: #fff; text-shadow: 2px 2px 2px #033c73; } .jsPanel-hint-content.jsPanel-hint-success{ background: #C3EA99 none repeat scroll 0 0; border: 5px solid #034E26; color: #356304; text-shadow: 2px 2px 2px #aaa; } .jsPanel-hint-content.jsPanel-hint-warning{ background: #FFC7A3 none repeat scroll 0 0; border: 5px solid #DD5600; color: #AD6537; text-shadow: 2px 2px 2px #fff; } .jsPanel-hint-content.jsPanel-hint-danger{ background: #fc7073 none repeat scroll 0 0; border: 5px solid #c71c22; color: #fff; text-shadow: 2px 2px 2px #c71c22; } /** * CSS3 Tips v1.0.1 * A stylesheet for creating tooltips without using anything other than CSS3. * created by c.bavota released under GPL v2 March 21st, 2014 * HTML example code for the tooltip * http://cbavota.bitbucket.org/css3-tips/ * <a href="http://bavotasan.com" class="top-tip" data-tips="Go to bavotasan.com">bavotasan.com</a> */ [data-tips] { position: relative; text-decoration: none; } [data-tips]:after, [data-tips]:before { position: absolute; z-index: 100; opacity: 0; } [data-tips]:after { content: attr(data-tips); height: 25px; line-height: 25px; padding: 0 10px; font-size: 12px; text-align: center; color: #fff; background: #3276B1; border-radius: 4px; /*text-shadow: 0 0 5px #000;*/ -moz-box-shadow: 0 0 5px rgba(0,0,0,0.3); -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.3); box-shadow: 0 0 5px rgba(0,0,0,0.3); white-space: nowrap; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } [data-tips]:before { content: ""; width: 0; height: 0; border-width: 6px; border-style: solid; } [data-tips]:hover:after, [data-tips]:hover:before { opacity: 1; } /* Top tips */ [data-tips].top-tip:after, [data-tips].top-tip:before { -webkit-transition: bottom 0.25s ease-in-out, opacity 0.25s ease-in-out; -moz-transition: bottom 0.25s ease-in-out, opacity 0.25s ease-in-out; transition: bottom 0.25s ease-in-out, opacity 0.25s ease-in-out; bottom: 90%; left: -9999px; margin-bottom: 12px; } [data-tips].top-tip:before { border-color: #3276B1 transparent transparent transparent; margin-bottom: 0; } [data-tips].top-tip:hover:after, [data-tips].top-tip:hover:before { bottom: 100%; left: 0; } [data-tips].top-tip:hover:before { left: 15px; } /* Bottom tip */ [data-tips].bottom-tip:after, [data-tips].bottom-tip:before { -webkit-transition: top 0.25s ease-in-out, opacity 0.25s ease-in-out; -moz-transition: top 0.25s ease-in-out, opacity 0.25s ease-in-out; transition: top 0.25s ease-in-out, opacity 0.25s ease-in-out; top: 90%; left: -9999px; margin-top: 12px; } [data-tips].bottom-tip:before { border-color: transparent transparent #3276B1 transparent; margin-top: 0; } [data-tips].bottom-tip:hover:after, [data-tips].bottom-tip:hover:before { top: 100%; left: 0; } [data-tips].bottom-tip:hover:before { left: 15px; } /* Right tip */ [data-tips].right-tip:after, [data-tips].right-tip:before { -webkit-transition: left 0.25s ease-in-out, opacity 0.25s ease-in-out; -moz-transition: left 0.25s ease-in-out, opacity 0.25s ease-in-out; transition: left 0.25s ease-in-out, opacity 0.25s ease-in-out; top: -9999px; left: 96%; margin-left: 12px; } [data-tips].right-tip:before { border-color: transparent #3276B1 transparent transparent; margin-left: 0; } [data-tips].right-tip:hover:after, [data-tips].right-tip:hover:before { left: 100%; top: 0; } [data-tips].right-tip:hover:before { top: 7px; } /* Left tip */ [data-tips].left-tip:after, [data-tips].left-tip:before { -webkit-transition: right 0.25s ease-in-out, opacity 0.25s ease-in-out; -moz-transition: right 0.25s ease-in-out, opacity 0.25s ease-in-out; transition: right 0.25s ease-in-out, opacity 0.25s ease-in-out; top: -9999px; right: 96%; margin-right: 12px; } [data-tips].left-tip:before { border-color: transparent transparent transparent #3276B1; margin-right: 0; } [data-tips].left-tip:hover:after, [data-tips].left-tip:hover:before { right: 100%; top: 0; } [data-tips].left-tip:hover:before { top: 7px; }
{ "pile_set_name": "Github" }
<?php /** * Exception for 409 Conflict responses * * @package Requests */ /** * Exception for 409 Conflict responses * * @package Requests */ class Requests_Exception_HTTP_409 extends Requests_Exception_HTTP { /** * HTTP status code * * @var integer */ protected $code = 409; /** * Reason phrase * * @var string */ protected $reason = 'Conflict'; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <dependencies> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> <!--View Controller--> <scene sceneID="EHf-IW-A2E"> <objects> <viewController id="01J-lp-oVM" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/> <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="53" y="375"/> </scene> </scenes> </document>
{ "pile_set_name": "Github" }
using Bit.Core.Models; using Bit.Owin.Contracts; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; namespace Bit.Owin.Middlewares { public class AspNetCoreStaticFilesMiddlewareConfiguration : IAspNetCoreMiddlewareConfiguration { public virtual MiddlewarePosition MiddlewarePosition => MiddlewarePosition.BeforeOwinMiddlewares; public virtual AppEnvironment AppEnvironment { get; set; } = default!; public virtual IWebHostEnvironment HostingEnvironment { get; set; } = default!; public virtual void Configure(IApplicationBuilder aspNetCoreApp) { FileServerOptions options = new FileServerOptions { EnableDirectoryBrowsing = AppEnvironment.DebugMode, EnableDefaultFiles = false }; options.DefaultFilesOptions.DefaultFileNames.Clear(); options.FileProvider = HostingEnvironment.WebRootFileProvider; string path = $@"/Files/V{AppEnvironment.AppInfo.Version}"; aspNetCoreApp.Map(path, innerApp => { if (AppEnvironment.DebugMode == true) innerApp.UseMiddleware<AspNetCoreNoCacheResponseMiddleware>(); else innerApp.UseMiddleware<AspNetCoreCacheResponseMiddleware>(); innerApp.UseXContentTypeOptions(); innerApp.UseXDownloadOptions(); innerApp.UseFileServer(options); }); aspNetCoreApp.Map("/Files", innerApp => { innerApp.UseMiddleware<AspNetCoreNoCacheResponseMiddleware>(); innerApp.UseXContentTypeOptions(); innerApp.UseXDownloadOptions(); innerApp.UseFileServer(options); }); } } }
{ "pile_set_name": "Github" }
//===--- Editor.h - Output Of Text ------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the text manipulation ("editing") interface. // // Axel Naumann <axel@cern.ch>, 2011-05-12 //===----------------------------------------------------------------------===// #ifndef TEXTINPUT_EDITOR_H #define TEXTINPUT_EDITOR_H #include <deque> #include <cstddef> // for size_t #include <string> // for string #include <utility> // for pair #include "textinput/Text.h" #include "textinput/Range.h" namespace textinput { class TextInputContext; // Text manipulation. class Editor { public: // Kind of editor command enum ECommandKind { kCKError, // general unhappiness kCKCommand, // a real editing command kCKChar, // character input kCKMove, // cursor movement kCKControl // control character not translated to kCKCommand }; // Editing command enum ECommandID { kCmdDel, // delete the char at the cursor position kCmdDelLeft, // delete char left of cursor, move there (backspace) // Cutting means: erase and store in paste buf kCmdCutToEnd, // cut text from cursor to end of line kCmdCutToFront, // cut text from cursor to front kCmdCutPrevWord, // cut text from cursor to beginning of word kCmdCutNextWord, // cut text from cursor to end of word kCmdPaste, // past from all subsequent, same direction cut kCmdSwapThisAndLeftThenMoveRight, kCmdWordToUpper, kCmdWordToLower, kCmdToUpperMoveNextWord, kCmdReverseSearch, kCmdHistOlder, kCmdHistNewer, kCmdHistReplay, kCmdHistComplete, kCmdComplete, // TAB - fires a callback. kCmd_END_TEXT_MODIFYING_CMDS, kCmdEnter, // Usually end of line kCmdInsertMode, kCmdOverwiteMode, kCmdToggleOverwriteMode, kCmdClearScreen, kCmdWindowResize, kCmdUndo, kCmdEsc, kCmdIgnore // ignore this command, e.g. because it was already processed }; enum EMoveID { kMoveLeft, kMoveRight, //kMoveUp, - that's history //kMoveDown, - that's history kMoveFront, kMoveEnd, kMoveNextWord, kMovePrevWord }; // Whether the editing command was successful enum EProcessResult { kPRError, kPRSuccess }; // A compound editing command. class Command { public: Command(ECommandID C): fKind(kCKCommand), fCmd(C) {} Command(EMoveID M): fKind(kCKMove), fMove(M) {} Command(char C, ECommandKind k = kCKChar): fKind(k), fChar(C) {} ECommandKind GetKind() const { return fKind; } ECommandID GetCommandID() const { return fCmd;} EMoveID GetMoveID() const { return fMove;} char GetChar() const { return fChar;} bool isCtrlD() const { return fKind == kCKControl && (fChar == 'd'-0x60); } private: ECommandKind fKind; // discriminator for union union { ECommandID fCmd; // editor command value EMoveID fMove; // move value char fChar; // character input value }; }; Editor(TextInputContext* C): fContext(C), fCurHistEntry((size_t)-1), fReplayHistEntry((size_t)-1), fMode(kInputMode), fOverwrite(false), fCutDirection(0) {} ~Editor() {} Range ResetText(); EProcessResult Process(Command Cmd, EditorRange& R); const Text& GetEditorPrompt() const { return fEditorPrompt; } void SetEditorPrompt(const Text& EP) { fEditorPrompt = EP; } void CancelSpecialInputMode(Range& DisplayR); void CancelAndRevertSpecialInputMode(EditorRange& R); private: EProcessResult ProcessChar(char C, EditorRange& R); EProcessResult ProcessMove(EMoveID M, EditorRange& R); EProcessResult ProcessCommand(ECommandID M, EditorRange& R); size_t FindWordBoundary(int Direction); void PushUndo(); void AddToPasteBuf(int Dir, const std::string& T); void AddToPasteBuf(int Dir, char T); void ClearPasteBuf() { fCutDirection = 0; } void SetReverseHistSearchPrompt(Range& RDisplay); bool UpdateHistSearch(EditorRange& R); // The editor can be in special modes, e.g. when searching // in history. enum EEditMode { kInputMode, // regular input mode kHistSearchMode, // searching in history kNumEditModes }; TextInputContext* fContext; // Context object Text fEditorPrompt; // for special modes, e.g. reverse search std::string fLineNotInHist; // current input line, not pushed to hist yet std::string fPasteBuf; // cut strings that can be pasted std::string fSearch; // for backward hist search size_t fCurHistEntry; // the current line stems from a hist entry, -1 if not size_t fReplayHistEntry; // set next line to this hist entry, kCmdHistReplay EEditMode fMode; // current input mode bool fOverwrite; // Insert of overwrite int fCutDirection; // cutting forward or wackward - change clears pastbuf std::deque<std::pair<Text /*Line*/, size_t /*Cursor*/> > fUndoBuf; // undos }; } #endif // TEXTINPUT_EDITOR_H
{ "pile_set_name": "Github" }
/*- * Copyright (c) 2004 The FreeBSD Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD: release/9.1.0/sys/kern/subr_kdb.c 235741 2012-05-21 21:14:09Z jhb $"); #include "opt_kdb.h" #include "opt_stack.h" #include <sys/param.h> #include <sys/systm.h> #include <sys/cons.h> #include <sys/kdb.h> #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/pcpu.h> #include <sys/proc.h> #include <sys/sbuf.h> #include <sys/smp.h> #include <sys/stack.h> #include <sys/sysctl.h> #include <machine/kdb.h> #include <machine/pcb.h> #ifdef SMP #include <machine/smp.h> #endif int kdb_active = 0; static void *kdb_jmpbufp = NULL; struct kdb_dbbe *kdb_dbbe = NULL; static struct pcb kdb_pcb; struct pcb *kdb_thrctx = NULL; struct thread *kdb_thread = NULL; struct trapframe *kdb_frame = NULL; #ifdef BREAK_TO_DEBUGGER #define KDB_BREAK_TO_DEBUGGER 1 #else #define KDB_BREAK_TO_DEBUGGER 0 #endif #ifdef ALT_BREAK_TO_DEBUGGER #define KDB_ALT_BREAK_TO_DEBUGGER 1 #else #define KDB_ALT_BREAK_TO_DEBUGGER 0 #endif static int kdb_break_to_debugger = KDB_BREAK_TO_DEBUGGER; static int kdb_alt_break_to_debugger = KDB_ALT_BREAK_TO_DEBUGGER; KDB_BACKEND(null, NULL, NULL, NULL, NULL); SET_DECLARE(kdb_dbbe_set, struct kdb_dbbe); static int kdb_sysctl_available(SYSCTL_HANDLER_ARGS); static int kdb_sysctl_current(SYSCTL_HANDLER_ARGS); static int kdb_sysctl_enter(SYSCTL_HANDLER_ARGS); static int kdb_sysctl_panic(SYSCTL_HANDLER_ARGS); static int kdb_sysctl_trap(SYSCTL_HANDLER_ARGS); static int kdb_sysctl_trap_code(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_debug, OID_AUTO, kdb, CTLFLAG_RW, NULL, "KDB nodes"); SYSCTL_PROC(_debug_kdb, OID_AUTO, available, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, kdb_sysctl_available, "A", "list of available KDB backends"); SYSCTL_PROC(_debug_kdb, OID_AUTO, current, CTLTYPE_STRING | CTLFLAG_RW, NULL, 0, kdb_sysctl_current, "A", "currently selected KDB backend"); SYSCTL_PROC(_debug_kdb, OID_AUTO, enter, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, kdb_sysctl_enter, "I", "set to enter the debugger"); SYSCTL_PROC(_debug_kdb, OID_AUTO, panic, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, kdb_sysctl_panic, "I", "set to panic the kernel"); SYSCTL_PROC(_debug_kdb, OID_AUTO, trap, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, kdb_sysctl_trap, "I", "set to cause a page fault via data access"); SYSCTL_PROC(_debug_kdb, OID_AUTO, trap_code, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, kdb_sysctl_trap_code, "I", "set to cause a page fault via code access"); SYSCTL_INT(_debug_kdb, OID_AUTO, break_to_debugger, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_TUN, &kdb_break_to_debugger, 0, "Enable break to debugger"); TUNABLE_INT("debug.kdb.break_to_debugger", &kdb_break_to_debugger); SYSCTL_INT(_debug_kdb, OID_AUTO, alt_break_to_debugger, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_TUN, &kdb_alt_break_to_debugger, 0, "Enable alternative break to debugger"); TUNABLE_INT("debug.kdb.alt_break_to_debugger", &kdb_alt_break_to_debugger); /* * Flag to indicate to debuggers why the debugger was entered. */ const char * volatile kdb_why = KDB_WHY_UNSET; static int kdb_sysctl_available(SYSCTL_HANDLER_ARGS) { struct kdb_dbbe **iter; struct sbuf sbuf; int error; sbuf_new_for_sysctl(&sbuf, NULL, 64, req); SET_FOREACH(iter, kdb_dbbe_set) { if ((*iter)->dbbe_active == 0) sbuf_printf(&sbuf, "%s ", (*iter)->dbbe_name); } error = sbuf_finish(&sbuf); sbuf_delete(&sbuf); return (error); } static int kdb_sysctl_current(SYSCTL_HANDLER_ARGS) { char buf[16]; int error; if (kdb_dbbe != NULL) strlcpy(buf, kdb_dbbe->dbbe_name, sizeof(buf)); else *buf = '\0'; error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) return (error); if (kdb_active) return (EBUSY); return (kdb_dbbe_select(buf)); } static int kdb_sysctl_enter(SYSCTL_HANDLER_ARGS) { int error, i; error = sysctl_wire_old_buffer(req, sizeof(int)); if (error == 0) { i = 0; error = sysctl_handle_int(oidp, &i, 0, req); } if (error != 0 || req->newptr == NULL) return (error); if (kdb_active) return (EBUSY); kdb_enter(KDB_WHY_SYSCTL, "sysctl debug.kdb.enter"); return (0); } static int kdb_sysctl_panic(SYSCTL_HANDLER_ARGS) { int error, i; error = sysctl_wire_old_buffer(req, sizeof(int)); if (error == 0) { i = 0; error = sysctl_handle_int(oidp, &i, 0, req); } if (error != 0 || req->newptr == NULL) return (error); panic("kdb_sysctl_panic"); return (0); } static int kdb_sysctl_trap(SYSCTL_HANDLER_ARGS) { int error, i; int *addr = (int *)0x10; error = sysctl_wire_old_buffer(req, sizeof(int)); if (error == 0) { i = 0; error = sysctl_handle_int(oidp, &i, 0, req); } if (error != 0 || req->newptr == NULL) return (error); return (*addr); } static int kdb_sysctl_trap_code(SYSCTL_HANDLER_ARGS) { int error, i; void (*fp)(u_int, u_int, u_int) = (void *)0xdeadc0de; error = sysctl_wire_old_buffer(req, sizeof(int)); if (error == 0) { i = 0; error = sysctl_handle_int(oidp, &i, 0, req); } if (error != 0 || req->newptr == NULL) return (error); (*fp)(0x11111111, 0x22222222, 0x33333333); return (0); } void kdb_panic(const char *msg) { printf("KDB: panic\n"); panic("%s", msg); } void kdb_reboot(void) { printf("KDB: reboot requested\n"); shutdown_nice(0); } /* * Solaris implements a new BREAK which is initiated by a character sequence * CR ~ ^b which is similar to a familiar pattern used on Sun servers by the * Remote Console. * * Note that this function may be called from almost anywhere, with interrupts * disabled and with unknown locks held, so it must not access data other than * its arguments. Its up to the caller to ensure that the state variable is * consistent. */ #define KEY_CR 13 /* CR '\r' */ #define KEY_TILDE 126 /* ~ */ #define KEY_CRTLB 2 /* ^B */ #define KEY_CRTLP 16 /* ^P */ #define KEY_CRTLR 18 /* ^R */ /* States of th KDB "alternate break sequence" detecting state machine. */ enum { KDB_ALT_BREAK_SEEN_NONE, KDB_ALT_BREAK_SEEN_CR, KDB_ALT_BREAK_SEEN_CR_TILDE, }; int kdb_break(void) { if (!kdb_break_to_debugger) return (0); kdb_enter(KDB_WHY_BREAK, "Break to debugger"); return (KDB_REQ_DEBUGGER); } static int kdb_alt_break_state(int key, int *state) { int brk; /* All states transition to KDB_ALT_BREAK_SEEN_CR on a CR. */ if (key == KEY_CR) { *state = KDB_ALT_BREAK_SEEN_CR; return (0); } brk = 0; switch (*state) { case KDB_ALT_BREAK_SEEN_CR: *state = KDB_ALT_BREAK_SEEN_NONE; if (key == KEY_TILDE) *state = KDB_ALT_BREAK_SEEN_CR_TILDE; break; case KDB_ALT_BREAK_SEEN_CR_TILDE: *state = KDB_ALT_BREAK_SEEN_NONE; if (key == KEY_CRTLB) brk = KDB_REQ_DEBUGGER; else if (key == KEY_CRTLP) brk = KDB_REQ_PANIC; else if (key == KEY_CRTLR) brk = KDB_REQ_REBOOT; break; case KDB_ALT_BREAK_SEEN_NONE: default: *state = KDB_ALT_BREAK_SEEN_NONE; break; } return (brk); } static int kdb_alt_break_internal(int key, int *state, int force_gdb) { int brk; if (!kdb_alt_break_to_debugger) return (0); brk = kdb_alt_break_state(key, state); switch (brk) { case KDB_REQ_DEBUGGER: if (force_gdb) kdb_dbbe_select("gdb"); kdb_enter(KDB_WHY_BREAK, "Break to debugger"); break; case KDB_REQ_PANIC: if (force_gdb) kdb_dbbe_select("gdb"); kdb_panic("Panic sequence on console"); break; case KDB_REQ_REBOOT: kdb_reboot(); break; } return (0); } int kdb_alt_break(int key, int *state) { return (kdb_alt_break_internal(key, state, 0)); } /* * This variation on kdb_alt_break() is used only by dcons, which has its own * configuration flag to force GDB use regardless of the global KDB * configuration. */ int kdb_alt_break_gdb(int key, int *state) { return (kdb_alt_break_internal(key, state, 1)); } /* * Print a backtrace of the calling thread. The backtrace is generated by * the selected debugger, provided it supports backtraces. If no debugger * is selected or the current debugger does not support backtraces, this * function silently returns. */ void kdb_backtrace(void) { if (kdb_dbbe != NULL && kdb_dbbe->dbbe_trace != NULL) { printf("KDB: stack backtrace:\n"); kdb_dbbe->dbbe_trace(); } #ifdef STACK else { struct stack st; printf("KDB: stack backtrace:\n"); stack_zero(&st); stack_save(&st); stack_print_ddb(&st); } #endif } /* * Similar to kdb_backtrace() except that it prints a backtrace of an * arbitrary thread rather than the calling thread. */ void kdb_backtrace_thread(struct thread *td) { if (kdb_dbbe != NULL && kdb_dbbe->dbbe_trace_thread != NULL) { printf("KDB: stack backtrace of thread %d:\n", td->td_tid); kdb_dbbe->dbbe_trace_thread(td); } #ifdef STACK else { struct stack st; printf("KDB: stack backtrace of thread %d:\n", td->td_tid); stack_zero(&st); stack_save_td(&st, td); stack_print_ddb(&st); } #endif } /* * Set/change the current backend. */ int kdb_dbbe_select(const char *name) { struct kdb_dbbe *be, **iter; SET_FOREACH(iter, kdb_dbbe_set) { be = *iter; if (be->dbbe_active == 0 && strcmp(be->dbbe_name, name) == 0) { kdb_dbbe = be; return (0); } } return (EINVAL); } /* * Enter the currently selected debugger. If a message has been provided, * it is printed first. If the debugger does not support the enter method, * it is entered by using breakpoint(), which enters the debugger through * kdb_trap(). The 'why' argument will contain a more mechanically usable * string than 'msg', and is relied upon by DDB scripting to identify the * reason for entering the debugger so that the right script can be run. */ void kdb_enter(const char *why, const char *msg) { if (kdb_dbbe != NULL && kdb_active == 0) { if (msg != NULL) printf("KDB: enter: %s\n", msg); kdb_why = why; breakpoint(); kdb_why = KDB_WHY_UNSET; } } /* * Initialize the kernel debugger interface. */ void kdb_init(void) { struct kdb_dbbe *be, **iter; int cur_pri, pri; kdb_active = 0; kdb_dbbe = NULL; cur_pri = -1; SET_FOREACH(iter, kdb_dbbe_set) { be = *iter; pri = (be->dbbe_init != NULL) ? be->dbbe_init() : -1; be->dbbe_active = (pri >= 0) ? 0 : -1; if (pri > cur_pri) { cur_pri = pri; kdb_dbbe = be; } } if (kdb_dbbe != NULL) { printf("KDB: debugger backends:"); SET_FOREACH(iter, kdb_dbbe_set) { be = *iter; if (be->dbbe_active == 0) printf(" %s", be->dbbe_name); } printf("\n"); printf("KDB: current backend: %s\n", kdb_dbbe->dbbe_name); } } /* * Handle contexts. */ void * kdb_jmpbuf(jmp_buf new) { void *old; old = kdb_jmpbufp; kdb_jmpbufp = new; return (old); } void kdb_reenter(void) { if (!kdb_active || kdb_jmpbufp == NULL) return; longjmp(kdb_jmpbufp, 1); /* NOTREACHED */ } /* * Thread related support functions. */ struct pcb * kdb_thr_ctx(struct thread *thr) { #if defined(SMP) && defined(KDB_STOPPEDPCB) struct pcpu *pc; #endif if (thr == curthread) return (&kdb_pcb); #if defined(SMP) && defined(KDB_STOPPEDPCB) STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { if (pc->pc_curthread == thr && CPU_ISSET(pc->pc_cpuid, &stopped_cpus)) return (KDB_STOPPEDPCB(pc)); } #endif return (thr->td_pcb); } struct thread * kdb_thr_first(void) { struct proc *p; struct thread *thr; p = LIST_FIRST(&allproc); while (p != NULL) { if (p->p_flag & P_INMEM) { thr = FIRST_THREAD_IN_PROC(p); if (thr != NULL) return (thr); } p = LIST_NEXT(p, p_list); } return (NULL); } struct thread * kdb_thr_from_pid(pid_t pid) { struct proc *p; p = LIST_FIRST(&allproc); while (p != NULL) { if (p->p_flag & P_INMEM && p->p_pid == pid) return (FIRST_THREAD_IN_PROC(p)); p = LIST_NEXT(p, p_list); } return (NULL); } struct thread * kdb_thr_lookup(lwpid_t tid) { struct thread *thr; thr = kdb_thr_first(); while (thr != NULL && thr->td_tid != tid) thr = kdb_thr_next(thr); return (thr); } struct thread * kdb_thr_next(struct thread *thr) { struct proc *p; p = thr->td_proc; thr = TAILQ_NEXT(thr, td_plist); do { if (thr != NULL) return (thr); p = LIST_NEXT(p, p_list); if (p != NULL && (p->p_flag & P_INMEM)) thr = FIRST_THREAD_IN_PROC(p); } while (p != NULL); return (NULL); } int kdb_thr_select(struct thread *thr) { if (thr == NULL) return (EINVAL); kdb_thread = thr; kdb_thrctx = kdb_thr_ctx(thr); return (0); } /* * Enter the debugger due to a trap. */ int kdb_trap(int type, int code, struct trapframe *tf) { #ifdef SMP cpuset_t other_cpus; #endif struct kdb_dbbe *be; register_t intr; int handled; #ifdef SMP int did_stop_cpus; #endif be = kdb_dbbe; if (be == NULL || be->dbbe_trap == NULL) return (0); /* We reenter the debugger through kdb_reenter(). */ if (kdb_active) return (0); intr = intr_disable(); #ifdef SMP if (!SCHEDULER_STOPPED()) { other_cpus = all_cpus; CPU_CLR(PCPU_GET(cpuid), &other_cpus); stop_cpus_hard(other_cpus); did_stop_cpus = 1; } else did_stop_cpus = 0; #endif kdb_active++; kdb_frame = tf; /* Let MD code do its thing first... */ kdb_cpu_trap(type, code); makectx(tf, &kdb_pcb); kdb_thr_select(curthread); cngrab(); for (;;) { handled = be->dbbe_trap(type, code); if (be == kdb_dbbe) break; be = kdb_dbbe; if (be == NULL || be->dbbe_trap == NULL) break; printf("Switching to %s back-end\n", be->dbbe_name); } cnungrab(); kdb_active--; #ifdef SMP if (did_stop_cpus) restart_cpus(stopped_cpus); #endif intr_restore(intr); return (handled); }
{ "pile_set_name": "Github" }
2.4.1 / 2017-11-06 ================== * fix bad merge w/ 2.4.0 2.4.0 / 2017-11-06 ================== UNPUBLISHED * update `package.engines.node` to be more strict * update `fresh@^0.5.2` * fix: `inspect()` no longer crashes `context` * fix: gated `res.statusMessage` for HTTP/2 * added: `app.handleRequest()` is exposed 2.3.0 / 2017-06-20 ================== * fix: use `Buffer.from()` * test on node 7 & 8 * add `package-lock.json` to `.gitignore` * run `lint --fix` * add `request.header` in addition to `request.headers` * add IPv6 hostname support 2.2.0 / 2017-03-14 ================== * fix: drop `package.engines.node` requirement to >= 6.0.0 * this fixes `yarn`, which errors when this semver range is not satisfied * bump `cookies@~0.7.0` * bump `fresh@^0.5.0` 2.1.0 / 2017-03-07 ================== * added: return middleware chain promise from `callback()` #848 * added: node v7.7+ `res.getHeaderNames()` support #930 * added: `err.headerSent` in error handling #919 * added: lots of docs! 2.0.1 / 2017-02-25 ================== NOTE: we hit a versioning snafu. `v2.0.0` was previously released, so `v2.0.1` is released as the first `v2.x` with a `latest` tag. * upgrade mocha #900 * add names to `application`'s request and response handlers #805 * breaking: remove unused `app.name` #899 * breaking: drop official support for node < 7.6 2.0.0 / ?????????? ================== * Fix malformed content-type header causing exception on charset get (#898) * fix: subdomains should be [] if the host is an ip (#808) * don't pre-bound onerror [breaking change] (#800) * fix `ctx.flushHeaders()` to use `res.flushHeaders()` instead of `res.writeHead()` (#795) * fix(response): correct response.writable logic (#782) * merge v1.1.2 and v1.2.0 changes * include `koa-convert` so that generator functions still work * NOTE: generator functions are deprecated in v2 and will be removed in v3 * improve linting * improve docs 2.0.0-alpha.8 / 2017-02-13 ================== * Fix malformed content-type header causing exception on charset get (#898) 2.0.0-alpha.7 / 2016-09-07 ================== * fix: subdomains should be [] if the host is an ip (#808) 2.0.0-alpha.6 / 2016-08-29 ================== * don't pre-bound onerror [breaking change] 2.0.0-alpha.5 / 2016-08-10 ================== * fix `ctx.flushHeaders()` to use `res.flushHeaders()` instead of `res.writeHead()` 2.0.0-alpha.4 / 2016-07-23 ================== * fix `response.writeable` during pipelined requests 1.2.0 / 2016-03-03 ================== * add support for `err.headers` in `ctx.onerror()` - see: https://github.com/koajs/koa/pull/668 - note: you should set these headers in your custom error handlers as well - docs: https://github.com/koajs/koa/blob/master/docs/error-handling.md * fix `cookies`' detection of http/https - see: https://github.com/koajs/koa/pull/614 * deprecate `app.experimental = true`. Koa v2 does not use this signature. * add a code of conduct * test against the latest version of node * add a lot of docs 1.1.2 / 2015-11-05 ================== * ensure parseurl always working as expected * fix Application.inspect() – missing .proxy value. 2.0.0-alpha.3 / 2015-11-05 ================== * ensure parseurl always working as expected. #586 * fix Application.inspect() – missing .proxy value. Closes #563 2.0.0-alpha.2 / 2015-10-27 ================== * remove `co` and generator support completely * improved documentation * more refactoring into ES6 2.0.0-alpha.1 / 2015-10-22 ================== * change the middleware signature to `async (ctx, next) => await next()` * drop node < 4 support and rewrite the codebase in ES6 1.1.1 / 2015-10-22 ================== * do not send a content-type when the type is unknown #536 1.1.0 / 2015-10-11 ================== * add `app.silent=<Boolean>` to toggle error logging @tejasmanohar #486 * add `ctx.origin` @chentsulin #480 * various refactoring - add `use strict` everywhere 1.0.0 / 2015-08-22 ================== * add `this.req` check for `querystring()` * don't log errors with `err.expose` * `koa` now follows semver! 0.21.0 / 2015-05-23 ================== * empty `request.query` objects are now always the same instance * bump `fresh@0.3.0` 0.20.0 / 2015-04-30 ================== Breaking change if you're using `this.get('ua') === undefined` etc. For more details please checkout [#438](https://github.com/koajs/koa/pull/438). * make sure helpers return strict string * feat: alias response.headers to response.header 0.19.1 / 2015-04-14 ================== * non-error thrown, fixed #432 0.19.0 / 2015-04-05 ================== * `req.host` and `req.hostname` now always return a string (semi-breaking change) * improved test coverage 0.18.1 / 2015-03-01 ================== * move babel to `devDependencies` 0.18.0 / 2015-02-14 ================== * experimental es7 async function support via `app.experimental = true` * use `content-type` instead of `media-typer` 0.17.0 / 2015-02-05 ================== Breaking change if you're using an old version of node v0.11! Otherwise, you should have no trouble upgrading. * official iojs support * drop support for node.js `>= 0.11.0 < 0.11.16` * use `Object.setPrototypeOf()` instead of `__proto__` * update dependencies 0.16.0 / 2015-01-27 ================== * add `res.append()` * fix path usage for node@0.11.15 0.15.0 / 2015-01-18 ================== * add `this.href` 0.14.0 / 2014-12-15 ================== * remove `x-powered-by` response header * fix the content type on plain-text redirects * add ctx.state * bump `co@4` * bump dependencies 0.13.0 / 2014-10-17 ================== * add this.message * custom status support via `statuses` 0.12.2 / 2014-09-28 ================== * use wider semver ranges for dependencies koa maintainers also maintain 0.12.1 / 2014-09-21 ================== * bump content-disposition * bump statuses 0.12.0 / 2014-09-20 ================== * add this.assert() * use content-disposition 0.11.0 / 2014-09-08 ================== * fix app.use() assertion #337 * bump a lot of dependencies 0.10.0 / 2014-08-12 ================== * add `ctx.throw(err, object)` support * add `ctx.throw(err, status, object)` support 0.9.0 / 2014-08-07 ================== * add: do not set `err.expose` to true when err.status not a valid http status code * add: alias `request.headers` as `request.header` * add context.inspect(), cleanup app.inspect() * update cookies * fix `err.status` invalid lead to uncaughtException * fix middleware gif, close #322 0.8.2 / 2014-07-27 ================== * bump co * bump parseurl 0.8.1 / 2014-06-24 ================== * bump type-is 0.8.0 / 2014-06-13 ================== * add `this.response.is()`` * remove `.status=string` and `res.statusString` #298 0.7.0 / 2014-06-07 ================== * add `this.lastModified` and `this.etag` as both getters and setters for ubiquity #292. See koajs/koa@4065bf7 for an explanation. * refactor `this.response.vary()` to use [vary](https://github.com/expressjs/vary) #291 * remove `this.response.append()` #291 0.6.3 / 2014-06-06 ================== * fix res.type= when the extension is unknown * assert when non-error is passed to app.onerror #287 * bump finished 0.6.2 / 2014-06-03 ================== * switch from set-type to mime-types 0.6.1 / 2014-05-11 ================== * bump type-is * bump koa-compose 0.6.0 / 2014-05-01 ================== * add nicer error formatting * add: assert object type in ctx.onerror * change .status default to 404. Closes #263 * remove .outputErrors, suppress output when handled by the dev. Closes #272 * fix content-length when body is re-assigned. Closes #267 0.5.5 / 2014-04-14 ================== * fix length when .body is missing * fix: make sure all intermediate stream bodies will be destroyed 0.5.4 / 2014-04-12 ================== * fix header stripping in a few cases 0.5.3 / 2014-04-09 ================== * change res.type= to always default charset. Closes #252 * remove ctx.inspect() implementation. Closes #164 0.5.2 / 2014-03-23 ================== * fix: inspection of `app` and `app.toJSON()` * fix: let `this.throw`n errors provide their own status * fix: overwriting of `content-type` w/ `HEAD` requests * refactor: use statuses * refactor: use escape-html * bump dev deps 0.5.1 / 2014-03-06 ================== * add request.hostname(getter). Closes #224 * remove response.charset and ctx.charset (too confusing in relation to ctx.type) [breaking change] * fix a debug() name 0.5.0 / 2014-02-19 ================== * add context.charset * add context.charset= * add request.charset * add response.charset * add response.charset= * fix response.body= html content sniffing * change ctx.length and ctx.type to always delegate to response object [breaking change] 0.4.0 / 2014-02-11 ================== * remove app.jsonSpaces settings - moved to [koa-json](https://github.com/koajs/json) * add this.response=false to bypass koa's response handling * fix response handling after body has been sent * changed ctx.throw() to no longer .expose 5xx errors * remove app.keys getter/setter, update cookies, and remove keygrip deps * update fresh * update koa-compose 0.3.0 / 2014-01-17 ================== * add ctx.host= delegate * add req.host= * add: context.throw supports Error instances * update co * update cookies 0.2.1 / 2013-12-30 ================== * add better 404 handling * add check for fn._name in debug() output * add explicit .toJSON() calls to ctx.toJSON() 0.2.0 / 2013-12-28 ================== * add support for .throw(status, msg). Closes #130 * add GeneratorFunction assertion for app.use(). Closes #120 * refactor: move `.is()` to `type-is` * refactor: move content negotiation to "accepts" * refactor: allow any streams with .pipe method * remove `next` in callback for now 0.1.2 / 2013-12-21 ================== * update co, koa-compose, keygrip * use on-socket-error * add throw(status, msg) support * assert middleware is GeneratorFunction * ducktype stream checks * remove `next` is `app.callback()` 0.1.1 / 2013-12-19 ================== * fix: cleanup socker error handler on response
{ "pile_set_name": "Github" }
/* * Copyright (c) 2000-2017 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * Copyright (c) 1980, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. * * @(#)route.h 8.3 (Berkeley) 4/19/94 * $FreeBSD: src/sys/net/route.h,v 1.36.2.1 2000/08/16 06:14:23 jayanth Exp $ */ #ifndef _NET_ROUTE_H_ #define _NET_ROUTE_H_ #include <sys/appleapiopts.h> #include <stdint.h> #include <sys/types.h> #include <sys/socket.h> /* * These numbers are used by reliable protocols for determining * retransmission behavior and are included in the routing structure. */ struct rt_metrics { u_int32_t rmx_locks; /* Kernel leaves these values alone */ u_int32_t rmx_mtu; /* MTU for this path */ u_int32_t rmx_hopcount; /* max hops expected */ int32_t rmx_expire; /* lifetime for route, e.g. redirect */ u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */ u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */ u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */ u_int32_t rmx_rtt; /* estimated round trip time */ u_int32_t rmx_rttvar; /* estimated rtt variance */ u_int32_t rmx_pksent; /* packets sent using this route */ u_int32_t rmx_state; /* route state */ u_int32_t rmx_filler[3]; /* will be used for T/TCP later */ }; /* * rmx_rtt and rmx_rttvar are stored as microseconds; */ #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ #ifdef PRIVATE struct route_old { void *ro_rt; uint32_t ro_flags; struct sockaddr ro_dst; }; #endif /* PRIVATE */ #ifdef BSD_KERNEL_PRIVATE #include <kern/locks.h> #include <net/radix.h> #include <net/if_llatbl.h> #include <sys/eventhandler.h> #include <net/if_dl.h> /* * Kernel resident routing tables. * * The routing tables are initialized when interface addresses * are set by making entries for all directly connected interfaces. */ /* forward declarations */ struct ifnet_llreach_info; struct rt_reach_info; /* * IP route structure * * A route consists of a destination address and a reference * to a routing entry. These are often held by protocols * in their control blocks, e.g. inpcb. */ struct route { /* * N.B: struct route must begin with ro_{rt, lle, srcia, flags} * because the code does some casts of a 'struct route_in6 *' * to a 'struct route *'. */ struct rtentry *ro_rt; struct llentry *ro_lle; struct ifaddr *ro_srcia; uint32_t ro_flags; /* route flags (see below) */ struct sockaddr ro_dst; }; #define ROF_SRCIF_SELECTED 0x0001 /* source interface was selected */ #if 0 /* XXX These will be used in the changes coming in later */ #define ROF_NORTREF 0x0002 /* doesn't hold reference on ro_rt */ #define ROF_L2_ME 0x0004 /* dst L2 addr is our address */ #define ROF_MAY_LOOP 0x0008 /* dst may require loop copy */ #define ROF_HAS_HEADER 0x0010 /* mbuf already have its header prepended */ #define ROF_REJECT 0x0020 /* Destination is reject */ #define ROF_BLACKHOLE 0x0040 /* Destination is blackhole */ #define ROF_HAS_GW 0x0080 /* Destination has GW */ #endif #define ROF_LLE_CACHE 0x0100 /* Cache link layer */ #define ROUTE_UNUSABLE(_ro) \ ((_ro)->ro_rt == NULL || \ ((_ro)->ro_rt->rt_flags & (RTF_UP|RTF_CONDEMNED)) != RTF_UP || \ RT_GENID_OUTOFSYNC((_ro)->ro_rt)) #define _ROUTE_RELEASE_COMMON(_ro, _rnh_locked) do { \ if ((_ro)->ro_rt != NULL) { \ RT_LOCK_ASSERT_NOTHELD((_ro)->ro_rt); \ if (_rnh_locked) \ rtfree_locked((_ro)->ro_rt); \ else \ rtfree((_ro)->ro_rt); \ (_ro)->ro_rt = NULL; \ } \ if ((_ro)->ro_srcia != NULL) { \ IFA_REMREF((_ro)->ro_srcia); \ (_ro)->ro_srcia = NULL; \ (_ro)->ro_flags &= ~ROF_SRCIF_SELECTED; \ } \ if ((_ro)->ro_lle != NULL) { \ LLE_REMREF((_ro)->ro_lle); \ (_ro)->ro_lle = NULL; \ (_ro)->ro_flags &= ~ROF_LLE_CACHE; \ } \ } while (0) #define ROUTE_RELEASE_LOCKED(_ro) _ROUTE_RELEASE_COMMON(_ro, TRUE) #define ROUTE_RELEASE(_ro) _ROUTE_RELEASE_COMMON(_ro, FALSE) /* * We distinguish between routes to hosts and routes to networks, * preferring the former if available. For each route we infer * the interface to use from the gateway address supplied when * the route was entered. Routes that forward packets through * gateways are marked so that the output routines know to address the * gateway rather than the ultimate destination. */ #define NRTT_HIST 10 /* * Kernel routing entry structure. */ struct rtentry { struct radix_node rt_nodes[2]; /* tree glue, and other values */ #define rt_key(r) (SA((r)->rt_nodes->rn_key)) #define rt_mask(r) (SA((r)->rt_nodes->rn_mask)) /* * See bsd/net/route.c for synchronization notes. */ decl_lck_mtx_data(, rt_lock); /* lock for routing entry */ uint32_t rt_refcnt; /* # held references */ uint32_t rt_flags; /* up/down?, host/net */ uint32_t rt_genid; /* route generation id */ struct sockaddr *rt_gateway; /* value */ struct ifnet *rt_ifp; /* the answer: interface to use */ struct ifaddr *rt_ifa; /* the answer: interface addr to use */ struct sockaddr *rt_genmask; /* for generation of cloned routes */ void *rt_llinfo; /* pointer to link level info cache */ void (*rt_llinfo_get_ri) /* llinfo get reachability info fn */ (struct rtentry *, struct rt_reach_info *); void (*rt_llinfo_get_iflri) /* ifnet llinfo get reach. info fn */ (struct rtentry *, struct ifnet_llreach_info *); void (*rt_llinfo_purge)(struct rtentry *); /* llinfo purge fn */ void (*rt_llinfo_free)(void *); /* link level info free function */ void (*rt_llinfo_refresh) (struct rtentry *); /* expedite llinfo refresh */ struct rt_metrics rt_rmx; /* metrics used by rx'ing protocols */ #define rt_use rt_rmx.rmx_pksent struct rtentry *rt_gwroute; /* implied entry for gatewayed routes */ struct rtentry *rt_parent; /* cloning parent of this route */ struct nstat_counts *rt_stats; /* route stats */ void (*rt_if_ref_fn)(struct ifnet *, int); /* interface ref func */ uint32_t *rt_tree_genid; /* ptr to per-tree route_genid */ uint64_t rt_expire; /* expiration time in uptime seconds */ uint64_t base_calendartime; /* calendar time upon entry creation */ uint64_t base_uptime; /* uptime upon entry creation */ u_int32_t rtt_hist[NRTT_HIST]; /* RTT history sample by TCP connections */ u_int32_t rtt_min; /* minimum RTT computed from history */ u_int32_t rtt_expire_ts; /* RTT history expire timestamp */ u_int8_t rtt_index; /* Index into RTT history */ /* Event handler context for the rtentrt */ struct eventhandler_lists_ctxt rt_evhdlr_ctxt; }; enum { ROUTE_STATUS_UPDATE = 1, ROUTE_ENTRY_REFRESH, ROUTE_ENTRY_DELETED, ROUTE_LLENTRY_RESOLVED, ROUTE_LLENTRY_UNREACH, ROUTE_LLENTRY_CHANGED, ROUTE_LLENTRY_STALE, ROUTE_LLENTRY_TIMEDOUT, ROUTE_LLENTRY_DELETED, ROUTE_LLENTRY_EXPIRED, ROUTE_LLENTRY_PROBED, ROUTE_EVHDLR_DEREGISTER, }; extern const char * route_event2str(int route_event); typedef void (*route_event_fn) (struct eventhandler_entry_arg, struct sockaddr *, int, struct sockaddr *, int); EVENTHANDLER_DECLARE(route_event, route_event_fn); /* * Synchronize route entry's generation ID with the tree's. */ #define RT_GENID_SYNC(_rt) do { \ if ((_rt)->rt_tree_genid != NULL) \ (_rt)->rt_genid = *(_rt)->rt_tree_genid; \ } while (0) /* * Indicates whether or not the route entry's generation ID is stale. */ #define RT_GENID_OUTOFSYNC(_rt) \ ((_rt)->rt_tree_genid != NULL && \ *(_rt)->rt_tree_genid != (_rt)->rt_genid) enum { ROUTE_OP_READ, ROUTE_OP_WRITE, }; extern int route_op_entitlement_check(struct socket *, kauth_cred_t, int, boolean_t); #endif /* BSD_KERNEL_PRIVATE */ #define RTF_UP 0x1 /* route usable */ #define RTF_GATEWAY 0x2 /* destination is a gateway */ #define RTF_HOST 0x4 /* host entry (net otherwise) */ #define RTF_REJECT 0x8 /* host or net unreachable */ #define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ #define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ #define RTF_DONE 0x40 /* message confirmed */ #define RTF_DELCLONE 0x80 /* delete cloned route */ #define RTF_CLONING 0x100 /* generate new routes on use */ #define RTF_XRESOLVE 0x200 /* external daemon resolves name */ #define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward compatibility */ #define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */ #define RTF_STATIC 0x800 /* manually added */ #define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ #define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */ #define RTF_PROTO2 0x4000 /* protocol specific routing flag */ #define RTF_PROTO1 0x8000 /* protocol specific routing flag */ #define RTF_PRCLONING 0x10000 /* protocol requires cloning */ #define RTF_WASCLONED 0x20000 /* route generated through cloning */ #define RTF_PROTO3 0x40000 /* protocol specific routing flag */ /* 0x80000 unused */ #define RTF_PINNED 0x100000 /* future use */ #define RTF_LOCAL 0x200000 /* route represents a local address */ #define RTF_BROADCAST 0x400000 /* route represents a bcast address */ #define RTF_MULTICAST 0x800000 /* route represents a mcast address */ #define RTF_IFSCOPE 0x1000000 /* has valid interface scope */ #define RTF_CONDEMNED 0x2000000 /* defunct; no longer modifiable */ #define RTF_IFREF 0x4000000 /* route holds a ref to interface */ #define RTF_PROXY 0x8000000 /* proxying, no interface scope */ #define RTF_ROUTER 0x10000000 /* host is a router */ #define RTF_DEAD 0x20000000 /* Route entry is being freed */ /* 0x40000000 and up unassigned */ #define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */ #define RTF_BITS \ "\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \ "\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \ "\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \ "\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \ "\33IFREF\34PROXY\35ROUTER" #define IS_DIRECT_HOSTROUTE(rt) \ (((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST) /* * Routing statistics. */ struct rtstat { short rts_badredirect; /* bogus redirect calls */ short rts_dynamic; /* routes created by redirects */ short rts_newgateway; /* routes modified by redirects */ short rts_unreach; /* lookups which failed */ short rts_wildcard; /* lookups satisfied by a wildcard */ short rts_badrtgwroute; /* route to gateway is not direct */ }; /* * Structures for routing messages. */ struct rt_msghdr { u_short rtm_msglen; /* to skip over non-understood messages */ u_char rtm_version; /* future binary compatibility */ u_char rtm_type; /* message type */ u_short rtm_index; /* index for associated ifp */ int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ int rtm_addrs; /* bitmask identifying sockaddrs in msg */ pid_t rtm_pid; /* identify sender */ int rtm_seq; /* for sender to identify action */ int rtm_errno; /* why failed */ int rtm_use; /* from rtentry */ u_int32_t rtm_inits; /* which metrics we are initializing */ struct rt_metrics rtm_rmx; /* metrics themselves */ }; struct rt_msghdr2 { u_short rtm_msglen; /* to skip over non-understood messages */ u_char rtm_version; /* future binary compatibility */ u_char rtm_type; /* message type */ u_short rtm_index; /* index for associated ifp */ int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ int rtm_addrs; /* bitmask identifying sockaddrs in msg */ int32_t rtm_refcnt; /* reference count */ int rtm_parentflags; /* flags of the parent route */ int rtm_reserved; /* reserved field set to 0 */ int rtm_use; /* from rtentry */ u_int32_t rtm_inits; /* which metrics we are initializing */ struct rt_metrics rtm_rmx; /* metrics themselves */ }; #ifdef PRIVATE struct kev_netevent_apnfallbk_data { pid_t epid; /* effective PID */ uuid_t euuid; /* effective UUID */ }; /* * Route reachability info. */ struct rt_reach_info { u_int32_t ri_refcnt; /* reference count */ u_int32_t ri_probes; /* total # of probes */ u_int64_t ri_snd_expire; /* tx expiration (calendar) time */ u_int64_t ri_rcv_expire; /* rx expiration (calendar) time */ int32_t ri_rssi; /* received signal strength */ int32_t ri_lqm; /* link quality metric */ int32_t ri_npm; /* node proximity metric */ }; /* * Extended routing message header (private). */ struct rt_msghdr_ext { u_short rtm_msglen; /* to skip over non-understood messages */ u_char rtm_version; /* future binary compatibility */ u_char rtm_type; /* message type */ u_int32_t rtm_index; /* index for associated ifp */ u_int32_t rtm_flags; /* flags, incl. kern & message, e.g. DONE */ u_int32_t rtm_reserved; /* for future use */ u_int32_t rtm_addrs; /* bitmask identifying sockaddrs in msg */ pid_t rtm_pid; /* identify sender */ int rtm_seq; /* for sender to identify action */ int rtm_errno; /* why failed */ u_int32_t rtm_use; /* from rtentry */ u_int32_t rtm_inits; /* which metrics we are initializing */ struct rt_metrics rtm_rmx; /* metrics themselves */ struct rt_reach_info rtm_ri; /* route reachability info */ }; #endif /* PRIVATE */ #define RTM_VERSION 5 /* Up the ante and ignore older versions */ /* * Message types. */ #define RTM_ADD 0x1 /* Add Route */ #define RTM_DELETE 0x2 /* Delete Route */ #define RTM_CHANGE 0x3 /* Change Metrics or flags */ #define RTM_GET 0x4 /* Report Metrics */ #define RTM_LOSING 0x5 /* RTM_LOSING is no longer generated by xnu and is deprecated */ #define RTM_REDIRECT 0x6 /* Told to use different route */ #define RTM_MISS 0x7 /* Lookup failed on this address */ #define RTM_LOCK 0x8 /* fix specified metrics */ #define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ #define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ #define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ #define RTM_NEWADDR 0xc /* address being added to iface */ #define RTM_DELADDR 0xd /* address being removed from iface */ #define RTM_IFINFO 0xe /* iface going up/down etc. */ #define RTM_NEWMADDR 0xf /* mcast group membership being added to if */ #define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ #ifdef PRIVATE #define RTM_GET_SILENT 0x11 #endif /* PRIVATE */ #define RTM_IFINFO2 0x12 /* */ #define RTM_NEWMADDR2 0x13 /* */ #define RTM_GET2 0x14 /* */ #ifdef PRIVATE #define RTM_GET_EXT 0x15 #endif /* PRIVATE */ /* * Bitmask values for rtm_inits and rmx_locks. */ #define RTV_MTU 0x1 /* init or lock _mtu */ #define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ #define RTV_EXPIRE 0x4 /* init or lock _expire */ #define RTV_RPIPE 0x8 /* init or lock _recvpipe */ #define RTV_SPIPE 0x10 /* init or lock _sendpipe */ #define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ #define RTV_RTT 0x40 /* init or lock _rtt */ #define RTV_RTTVAR 0x80 /* init or lock _rttvar */ #ifdef PRIVATE #define RTV_REFRESH_HOST 0x100 /* init host route to expedite refresh */ #endif /* * Bitmask values for rtm_addrs. */ #define RTA_DST 0x1 /* destination sockaddr present */ #define RTA_GATEWAY 0x2 /* gateway sockaddr present */ #define RTA_NETMASK 0x4 /* netmask sockaddr present */ #define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ #define RTA_IFP 0x10 /* interface name sockaddr present */ #define RTA_IFA 0x20 /* interface addr sockaddr present */ #define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ #define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ /* * Index offsets for sockaddr array for alternate internal encoding. */ #define RTAX_DST 0 /* destination sockaddr present */ #define RTAX_GATEWAY 1 /* gateway sockaddr present */ #define RTAX_NETMASK 2 /* netmask sockaddr present */ #define RTAX_GENMASK 3 /* cloning mask sockaddr present */ #define RTAX_IFP 4 /* interface name sockaddr present */ #define RTAX_IFA 5 /* interface addr sockaddr present */ #define RTAX_AUTHOR 6 /* sockaddr for author of redirect */ #define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ #define RTAX_MAX 8 /* size of array to allocate */ struct rt_addrinfo { int rti_addrs; struct sockaddr *rti_info[RTAX_MAX]; }; #ifdef PRIVATE /* * For scoped routing; a zero interface scope value means nil/no scope. */ #define IFSCOPE_NONE 0 #endif /* PRIVATE */ #ifdef BSD_KERNEL_PRIVATE /* * Generic call trace used by some subsystems (e.g. route, ifaddr) */ #define CTRACE_STACK_SIZE 8 /* depth of stack trace */ #define CTRACE_HIST_SIZE 4 /* refcnt history size */ typedef struct ctrace { void *th; /* thread ptr */ void *pc[CTRACE_STACK_SIZE]; /* PC stack trace */ } ctrace_t; extern void ctrace_record(ctrace_t *); #define RT_LOCK_ASSERT_HELD(_rt) \ LCK_MTX_ASSERT(&(_rt)->rt_lock, LCK_MTX_ASSERT_OWNED) #define RT_LOCK_ASSERT_NOTHELD(_rt) \ LCK_MTX_ASSERT(&(_rt)->rt_lock, LCK_MTX_ASSERT_NOTOWNED) #define RT_LOCK(_rt) do { \ rt_lock(_rt, FALSE); \ } while (0) #define RT_LOCK_SPIN(_rt) do { \ rt_lock(_rt, TRUE); \ } while (0) #define RT_CONVERT_LOCK(_rt) do { \ RT_LOCK_ASSERT_HELD(_rt); \ lck_mtx_convert_spin(&(_rt)->rt_lock); \ } while (0) #define RT_UNLOCK(_rt) do { \ rt_unlock(_rt); \ } while (0) #define RT_ADDREF_LOCKED(_rt) do { \ rtref(_rt); \ } while (0) /* * Spin variant mutex is used here; caller is responsible for * converting any previously-held similar lock to full mutex. */ #define RT_ADDREF(_rt) do { \ RT_LOCK_SPIN(_rt); \ RT_ADDREF_LOCKED(_rt); \ RT_UNLOCK(_rt); \ } while (0) #define RT_REMREF_LOCKED(_rt) do { \ (void) rtunref(_rt); \ } while (0) /* * Spin variant mutex is used here; caller is responsible for * converting any previously-held similar lock to full mutex. */ #define RT_REMREF(_rt) do { \ RT_LOCK_SPIN(_rt); \ RT_REMREF_LOCKED(_rt); \ RT_UNLOCK(_rt); \ } while (0) /* * This macro calculates skew in wall clock, just in case the user changes the * system time. This skew adjustment is required because we now keep the * expiration times in uptime terms in the kernel, but the userland still * expects expiration times in terms of calendar times. This is used when * reporting rt_expire, ln_expire, etc. values to user space. */ #define NET_CALCULATE_CLOCKSKEW(cc, ic, cu, iu) \ ((cc.tv_sec - ic) - (cu - iu)) extern unsigned int rt_verbose; extern struct radix_node_head *rt_tables[AF_MAX+1]; extern lck_mtx_t *rnh_lock; extern uint32_t route_genid_inet; /* INET route generation count */ #if INET6 extern uint32_t route_genid_inet6; /* INET6 route generation count */ #endif /* INET6 */ extern int rttrash; extern unsigned int rte_debug; struct ifmultiaddr; struct proc; extern void route_init(void); extern void routegenid_update(void); extern void routegenid_inet_update(void); extern void routegenid_inet6_update(void); extern void rt_ifmsg(struct ifnet *); extern void rt_missmsg(int, struct rt_addrinfo *, int, int); extern void rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *); extern void rt_newmaddrmsg(int, struct ifmultiaddr *); extern int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *); extern void set_primary_ifscope(int, unsigned int); extern unsigned int get_primary_ifscope(int); extern boolean_t rt_primary_default(struct rtentry *, struct sockaddr *); extern struct rtentry *rt_lookup(boolean_t, struct sockaddr *, struct sockaddr *, struct radix_node_head *, unsigned int); extern struct rtentry *rt_lookup_coarse(boolean_t, struct sockaddr *, struct sockaddr *, struct radix_node_head *); extern void rtalloc(struct route *); extern void rtalloc_scoped(struct route *, unsigned int); extern void rtalloc_ign(struct route *, uint32_t); extern void rtalloc_scoped_ign(struct route *, uint32_t, unsigned int); extern struct rtentry *rtalloc1(struct sockaddr *, int, uint32_t); extern struct rtentry *rtalloc1_scoped(struct sockaddr *, int, uint32_t, unsigned int); extern struct rtentry *rtalloc1_scoped_locked(struct sockaddr *, int, uint32_t, unsigned int); extern void rtfree_locked(struct rtentry *); extern void rtfree(struct rtentry *); extern void rtref(struct rtentry *); /* * rtunref will decrement the refcount, rtfree will decrement and free if * the refcount has reached zero and the route is not up. * Unless you have good reason to do otherwise, use rtfree. */ extern int rtunref(struct rtentry *); extern void rtsetifa(struct rtentry *, struct ifaddr *); extern int rtinit(struct ifaddr *, int, int); extern int rtinit_locked(struct ifaddr *, int, int); extern int rtioctl(unsigned long, caddr_t, struct proc *); extern void rtredirect(struct ifnet *, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct sockaddr *, struct rtentry **); extern int rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **); extern int rtrequest_scoped(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, unsigned int); extern int rtrequest_locked(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **); extern int rtrequest_scoped_locked(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, unsigned int); extern void sin_set_ifscope(struct sockaddr *, unsigned int); extern unsigned int sin_get_ifscope(struct sockaddr *); extern unsigned int sin6_get_ifscope(struct sockaddr *); extern void rt_lock(struct rtentry *, boolean_t); extern void rt_unlock(struct rtentry *); extern struct sockaddr *rtm_scrub(int, int, struct sockaddr *, struct sockaddr *, void *, uint32_t, kauth_cred_t *); extern boolean_t rt_validate(struct rtentry *); extern void rt_set_proxy(struct rtentry *, boolean_t); extern void rt_set_gwroute(struct rtentry *, struct sockaddr *, struct rtentry *); extern void rt_revalidate_gwroute(struct rtentry *, struct rtentry *); extern errno_t route_to_gwroute(const struct sockaddr *, struct rtentry *, struct rtentry **); extern void rt_setexpire(struct rtentry *, uint64_t); extern void rt_str(struct rtentry *, char *, uint32_t, char *, uint32_t); extern const char *rtm2str(int); extern void route_copyin(struct route *, struct route *, size_t); extern void route_copyout(struct route *, const struct route *, size_t); extern boolean_t rt_ifa_is_dst(struct sockaddr *, struct ifaddr *); extern struct sockaddr *sa_copy(struct sockaddr *, struct sockaddr_storage *, unsigned int *); /* * The following is used to enqueue work items for route events * and also used to pass route event while walking the tree */ struct route_event { struct rtentry *rt; /* * There's no reference taken on gwrt. * We only use it to check whether we should * point to rt_gateway or the embedded rt_addr * structure. */ struct rtentry *gwrt; union { union sockaddr_in_4_6 _rtev_ipaddr; struct sockaddr_dl _rtev_lladdr; char _rtev_addr_bytes[DLIL_SDLMAXLEN]; } rt_addr; uint32_t route_event_code; eventhandler_tag evtag; }; #define rtev_ipaddr rt_addr._rtev_ipaddr #define rtev_lladdr rt_addr._rtev_lladdr #define rtev_addr_bytes rt_addr._rtev_addr_bytes extern void route_event_init(struct route_event *p_route_ev, struct rtentry *rt, struct rtentry *gwrt, int route_ev_code); extern int route_event_walktree(struct radix_node *rn, void *arg); extern void route_event_enqueue_nwk_wq_entry(struct rtentry *, struct rtentry *, uint32_t, eventhandler_tag, boolean_t); #endif /* BSD_KERNEL_PRIVATE */ #endif /* _NET_ROUTE_H_ */
{ "pile_set_name": "Github" }
using UnityEngine; using System.Collections.Generic; using System.Linq; namespace Keiwando.Evolution { public class CreatureBuilder { /// <summary> /// A counter used to assign a unique id to each body component created with this CreatureBuilder. /// Needs to be incremented after each use. Can be reset if needed. Starts at 0. /// This needs to be updated when a creature design is loaded! /// </summary> private int idCounter = 0; public string Name { get; set; } = "Unnamed"; /// <summary> /// The joints of the creature that have been placed in the scene. /// </summary> private List<Joint> joints = new List<Joint>(); /// <summary> /// The bones that have been placed in the scene. /// </summary> private List<Bone> bones = new List<Bone>(); /// <summary> /// The muscles that have been placed in the scene. /// </summary> private List<Muscle> muscles = new List<Muscle>(); /// <summary> /// The Bone that is currently being placed. /// </summary> private Bone currentBone; /// <summary> /// The Muscle that is currently being placed. /// </summary> private Muscle currentMuscle; /// <summary> /// The minimum distance between two joints when they are placed /// (Can be moved closer together using "Move"). /// </summary> private float jointNonOverlapRadius = 0.6f; /// <summary> /// The bone thickness. /// </summary> public static float CONNECTION_WIDTH = 0.5f; public CreatureBuilder() {} public CreatureBuilder(CreatureDesign design) { this.Name = design.Name; foreach (var jointData in design.Joints) { this.joints.Add(Joint.CreateFromData(jointData)); } foreach (var boneData in design.Bones) { CreateBoneFromData(boneData); } foreach (var muscleData in design.Muscles) { CreateMuscleFromData(muscleData); } // Update the idCounter int maxJointID = design.Joints.Count > 0 ? design.Joints.Max(data => data.id) : 0; int maxBoneID = design.Bones.Count > 0 ? design.Bones.Max(data => data.id) : 0; int maxMuscleID = design.Muscles.Count > 0 ? design.Muscles.Max(data => data.id) : 0; idCounter = Mathf.Max(Mathf.Max(maxJointID, maxBoneID), maxMuscleID) + 1; } #region Joint Placement /// <summary> /// Attempts to place a joint at the specified world position. /// </summary> /// <remarks>Returns whether a joint was placed.</remarks> public bool TryPlacingJoint(Vector3 position) { // Make sure the joint doesn't overlap another one bool noOverlap = true; foreach (var joint in joints) { if ((joint.center - position).magnitude < jointNonOverlapRadius) { noOverlap = false; break; } } if (noOverlap) { PlaceJoint(position); } return noOverlap; } /// <summary> /// Places a new joint at the specified point. /// </summary> private void PlaceJoint(Vector3 position) { var jointData = new JointData(idCounter++, position, 1f); joints.Add(Joint.CreateFromData(jointData)); } #endregion #region Bone Placement /// <summary> /// Attempts to place a bone beginning at the current position. /// </summary> public void TryStartingBone(Joint joint) { if (joint != null) { CreateBoneFromJoint(joint); PlaceConnectionBetweenPoints(currentBone.gameObject, joint.center, joint.center, CONNECTION_WIDTH); } } /// <summary> /// Instantiates a bone at the specified point. /// </summary> private void CreateBoneFromJoint(Joint joint){ var boneData = new BoneData(idCounter++, joint.JointData.id, joint.JointData.id, 1f); currentBone = Bone.CreateAtPoint(joint.center, boneData); currentBone.startingJoint = joint; } private void CreateBoneFromData(BoneData data) { // Find the connecting joints var startingJoint = FindJointWithId(data.startJointID); var endingJoint = FindJointWithId(data.endJointID); if (startingJoint == null || endingJoint == null) { Debug.Log(string.Format("The connecting joints for bone {0} were not found!", data.id)); return; } var bone = CreateBoneBetween(startingJoint, endingJoint, data); bone.ConnectToJoints(); bones.Add(bone); } private Bone CreateBoneBetween(Joint startingJoint, Joint endingJoint, BoneData data) { var bone = Bone.CreateAtPoint(startingJoint.center, data); PlaceConnectionBetweenPoints(bone.gameObject, startingJoint.center, endingJoint.center, CONNECTION_WIDTH); bone.startingJoint = startingJoint; bone.endingJoint = endingJoint; return bone; } /// <summary> /// Updates the bone that is currently being placed to end at the /// current mouse/touch position. /// </summary> public void UpdateCurrentBoneEnd(Vector3 position, Joint hoveringJoint) { if (currentBone != null) { // check if user is hovering over an ending joint which is not the same as the starting // joint of the currentBone var endPoint = position; if (hoveringJoint != null && !hoveringJoint.Equals(currentBone.startingJoint)) { endPoint = hoveringJoint.center; currentBone.endingJoint = hoveringJoint; var oldData = currentBone.BoneData; var newData = new BoneData(oldData.id, oldData.startJointID, hoveringJoint.JointData.id, oldData.weight); currentBone.BoneData = newData; } PlaceConnectionBetweenPoints(currentBone.gameObject, currentBone.startingPoint, endPoint, CONNECTION_WIDTH); } } /// <summary> /// Transforms the given gameObject between the specified points. /// (Points are flattened to 2D). /// </summary> /// <param name="connection">The object to place as between the start and end point</param> /// <param name="width">The thickness of the connection.</param> public static void PlaceConnectionBetweenPoints(GameObject connection, Vector3 start, Vector3 end, float width) { // flatten the vectors to 2D start.z = 0; end.z = 0; Vector3 offset = end - start; Vector3 scale = new Vector3(width, offset.magnitude / 2.0f, width); Vector3 position = start + (offset / 2.0f); connection.transform.position = position; connection.transform.up = offset; connection.transform.localScale = scale; } /// <summary> /// Checks to see if the current bone is valid (attached to two joints) and if so /// adds it to the list of bones. /// </summary> /// <returns>Returns whether the current bone was placed.</returns> public bool PlaceCurrentBone() { if (currentBone == null) return false; if (currentBone.endingJoint == null || currentBone.endingJoint.Equals(currentBone.startingJoint)) { // The connection has no connected ending -> Destroy UnityEngine.Object.Destroy(currentBone.gameObject); currentBone = null; return false; } else { currentBone.ConnectToJoints(); bones.Add(currentBone); currentBone = null; // The creature was modified return true; } } public void CancelCurrentBone() { if (currentBone == null) return; UnityEngine.Object.Destroy(currentBone.gameObject); currentBone = null; } #endregion #region Muscle Placement /// <summary> /// Attempts to place a muscle starting at the specified position. /// </summary> public void TryStartingMuscle(Bone bone) { if (bone != null) { CreateMuscleFromBone(bone); var startPos = bone.Center; currentMuscle.SetLinePoints(startPos, startPos); } } /// <summary> /// Instantiates a muscle at the specified point. /// </summary> private void CreateMuscleFromBone(Bone bone) { var muscleData = new MuscleData(idCounter++, bone.BoneData.id, bone.BoneData.id, Muscle.Defaults.MaxForce, true); currentMuscle = Muscle.CreateFromData(muscleData); currentMuscle.startingBone = bone; currentMuscle.SetLinePoints(bone.Center, bone.Center); } /// <summary> /// Updates the muscle that is currently being placed to end at the /// specified position /// </summary> public void UpdateCurrentMuscleEnd(Vector3 endPoint, Bone hoveringBone) { if (currentMuscle != null) { // Check if user is hovering over an ending joint which is not the same as the starting // joint of the currentMuscle var endingPoint = endPoint; if (hoveringBone != null) { if (!hoveringBone.Equals(currentMuscle.startingBone)) { endingPoint = hoveringBone.Center; currentMuscle.endingBone = hoveringBone; var oldData = currentMuscle.MuscleData; var newData = new MuscleData( oldData.id, oldData.startBoneID, hoveringBone.BoneData.id, oldData.strength, oldData.canExpand ); currentMuscle.MuscleData = newData; } else { currentMuscle.endingBone = null; } } else { currentMuscle.endingBone = null; } currentMuscle.SetLinePoints(currentMuscle.startingBone.Center, endingPoint); } } /// <summary> /// Checks to see if the current muscle is valid (attached to two joints) and if so /// adds it to the list of muscles. /// </summary> /// <returns>Returns whether the current muscle was placed</returns> public bool PlaceCurrentMuscle() { if (currentMuscle == null) return false; if (currentMuscle.endingBone == null) { // The connection has no connected ending -> Destroy UnityEngine.Object.Destroy(currentMuscle.gameObject); currentMuscle = null; return false; } else { // Validate the muscle doesn't exist already foreach (Muscle muscle in muscles) { if (muscle.Equals(currentMuscle)) { UnityEngine.Object.Destroy(currentMuscle.gameObject); currentMuscle = null; return false; } } currentMuscle.ConnectToJoints(); currentMuscle.AddCollider(); muscles.Add(currentMuscle); currentMuscle = null; // The creature was modified return true; } } public void CancelCurrentMuscle() { if (currentMuscle == null) return; UnityEngine.Object.Destroy(currentMuscle.gameObject); currentMuscle = null; } private void CreateMuscleFromData(MuscleData data) { // Find the connecting joints var startingBone = FindBoneWithId(data.startBoneID); var endingBone = FindBoneWithId(data.endBoneID); if (startingBone == null || endingBone == null) { Debug.Log(string.Format("The connecting joints for bone {0} were not found!", data.id)); return; } var muscle = CreateMuscleBetween(startingBone, endingBone, data); muscle.ConnectToJoints(); muscle.AddCollider(); muscles.Add(muscle); } private Muscle CreateMuscleBetween(Bone startingBone, Bone endingBone, MuscleData data) { var muscle = Muscle.CreateFromData(data); muscle.startingBone = startingBone; muscle.endingBone = endingBone; muscle.SetLinePoints(startingBone.Center, endingBone.Center); return muscle; } #endregion #region Move /// <summary> /// Moves the currently selected components to the specified position. /// </summary> public void MoveSelection(ICollection<Joint> jointsToMove, Vector3 movement) { foreach (var joint in jointsToMove) { var newPosition = joint.transform.position + movement; joint.MoveTo(newPosition); } } /// <summary> /// Resets all properties used while moving a body component. /// </summary> /// <returns>Returns whether the creature design was changed.</returns> public bool MoveEnded(ICollection<Joint> jointsToMove) { if (jointsToMove == null) return false; var didChange = jointsToMove.Count > 0; if (didChange) { foreach (var joint in jointsToMove) { var oldData = joint.JointData; var newData = new JointData(oldData.id, joint.center, oldData.weight); joint.JointData = newData; } } return didChange; } #endregion public void Reset() { DeleteAll(); Name = "Unnamed"; idCounter = 0; } /// <summary> /// Deletes all body components placed with this builder. /// </summary> public void DeleteAll() { // Deleting joints will recursively delete all connected // body parts as well foreach (var joint in joints) { joint.Delete(); } RemoveDeletedObjects(); idCounter = 0; } public void Delete(List<BodyComponent> selection) { for (int i = 0; i < selection.Count; i++) { var item = selection[i]; if (item == null) continue; item.Delete(); } RemoveDeletedObjects(); } public void SetBodyComponents(List<Joint> joints, List<Bone> bones, List<Muscle> muscles) { this.joints = joints; this.bones = bones; this.muscles = muscles; } /// <summary> /// Creates a Creature object from the currently placed bodyparts. /// </summary> public Creature Build() { GameObject creatureObj = new GameObject(); creatureObj.name = "Creature"; Creature creature = creatureObj.AddComponent<Creature>(); foreach (Joint joint in joints) { joint.transform.SetParent(creatureObj.transform); } foreach (Bone connection in bones) { connection.transform.SetParent(creatureObj.transform); } foreach (Muscle muscle in muscles) { muscle.transform.SetParent(creatureObj.transform); } creature.joints = joints; creature.bones = bones; creature.muscles = muscles; return creature; } /// <summary> /// Returns a CreatureDesign representation of the currently placed /// body parts /// </summary> public CreatureDesign GetDesign() { var name = this.Name; var jointData = this.joints.Select(j => j.JointData).ToList(); var boneData = this.bones.Select(b => b.BoneData).ToList(); var muscleData = this.muscles.Select(m => m.MuscleData).ToList(); return new CreatureDesign(name, jointData, boneData, muscleData); } #region Hover Configuration public void RefreshMuscleColliders() { foreach (Muscle muscle in muscles) { muscle.RemoveCollider(); muscle.AddCollider(); } } #endregion #region Utils private Joint FindJointWithId(int id) { foreach (var joint in joints) { if (joint.JointData.id == id) { return joint; } } return null; } private Bone FindBoneWithId(int id) { foreach (var bone in bones) { if (bone.BoneData.id == id) { return bone; } } return null; } /// <summary> /// Removes the already destroyed object that are still left in the lists. /// </summary> private void RemoveDeletedObjects() { bones = BodyComponent.RemoveDeletedObjects<Bone>(bones); joints = BodyComponent.RemoveDeletedObjects<Joint>(joints); muscles = BodyComponent.RemoveDeletedObjects<Muscle>(muscles); } #endregion /// <summary> /// Cancels any temporary body part that has not been placed yet. /// </summary> public void CancelTemporaryBodyParts() { CancelCurrentBone(); CancelCurrentMuscle(); } } }
{ "pile_set_name": "Github" }
""" Copyright Hugh Perkins 2014, 2015 hughperkins at gmail This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. simply import this module in your header file like: // [[[cog // import cog_addheaders // cog_addheaders.add() // ]]] // [[[end]]] ... and run cog on the header file, to generate the header declarations """ import cog def add(classname=''): # debug = open('debug.txt', 'a') # debug.write('foo\n') # debug.write('infile [' + cog.inFile + ']\n') infile = cog.inFile splitinfile = infile.replace('\\','/').split('/') infilename = splitinfile[ len(splitinfile) - 1 ] if classname == '': classname = infilename.replace('.h','') cppfile = infile.replace('.h','.cpp') # cog.outl('// classname: ' + classname) # cog.outl('// cppfile: ' + infilename.replace('.h','.cpp')) f = open(cppfile, 'r') in_multiline_comment = False in_header = False; line = f.readline() cog.outl('// generated, using cog:') while(line != ''): # cog.outl(line) if(line.strip().find("/*") >= 0): in_multiline_comment = True if(line.strip().find("*/") >= 0): in_multiline_comment = False if not in_multiline_comment: if(in_header or (line.find(' ' + classname + '::') >= 0 or line.find('\r' + classname + '::') >= 0 or line.find('\n' + classname + '::') >= 0 or line.find(classname + '::') == 0 or line.find('*' + classname + '::') >= 0 or line.find('&' + classname + '::') >= 0) and line.find("(") >= 0 and line.strip().find("//") != 0) and line.find(";") < 0: in_header = True fnheader = line.replace(classname + '::', '') fnheader = fnheader.replace('{', '') fnheader = fnheader.replace(') :', ')') if fnheader.find(")") >= 0: in_header = False fnheader = fnheader.strip().replace(')', ');') fnheader = fnheader.strip().replace(';const', 'const;') fnheader = fnheader.strip().replace('; const', ' const;') cog.outl(fnheader); line = f.readline() f.close() cog.outl('') def add_templated(): # debug = open('debug.txt', 'a') # debug.write('foo\n') # debug.write('infile [' + cog.inFile + ']\n') infile = cog.inFile cppfile = infile.replace('.h','.cpp') splitinfile = infile.replace('\\','/').split('/') infilename = splitinfile[ len(splitinfile) - 1 ] classname = infilename.replace('.h','') # cog.outl('// classname: ' + classname) # cog.outl('// cppfile: ' + infilename.replace('.h','.cpp')) f = open(cppfile, 'r') in_multiline_comment = False in_header = False; line = f.readline() cog.outl('// generated, using cog:') while(line != ''): # cog.outl(line) if(line.strip().find("/*") >= 0): in_multiline_comment = True if(line.strip().find("*/") >= 0): in_multiline_comment = False if not in_multiline_comment: if(in_header or line.find(classname + '<T>::') >= 0 and line.find("(") >= 0 and line.strip().find("//") != 0) and line.find(";") < 0: in_header = True fnheader = line.replace('template< typename T >', '').replace(classname + '<T>::', '') fnheader = fnheader.replace('{', '') fnheader = fnheader.replace(') :', ')') if fnheader.find(")") >= 0: in_header = False fnheader = fnheader.strip().replace(')', ');') fnheader = fnheader.strip().replace(';const', 'const;') fnheader = fnheader.strip().replace('; const', ' const;') cog.outl(fnheader); line = f.readline() f.close() cog.outl('') # compared to `add`, this handles access declarations like PUBLIC, PRIVATE, PROTECTED def addv2(classname = '', default_access='private'): infile = cog.inFile splitinfile = infile.replace('\\','/').split('/') infilename = splitinfile[ len(splitinfile) - 1 ] if classname == '': classname = infilename.replace('.h','') cppfile = infile.replace('.h','.cpp') f = open(cppfile, 'r') in_multiline_comment = False in_header = False; line = f.readline() decs_by_acc = {} decs_by_acc['public'] = [] decs_by_acc['private'] = [] decs_by_acc['protected'] = [] thisdec = '' thisaccess = default_access while(line != ''): # cog.outl(line) if(line.strip().find("/*") >= 0): in_multiline_comment = True if(line.strip().find("*/") >= 0): in_multiline_comment = False if not in_multiline_comment: if(in_header or (line.find(' ' + classname + '::') >= 0 or line.find('\r' + classname + '::') >= 0 or line.find('\n' + classname + '::') >= 0 or line.find(classname + '::') == 0 or line.find('*' + classname + '::') >= 0 or line.find('&' + classname + '::') >= 0) and line.find("(") >= 0 and line.strip().find("//") != 0) and line.find(";") < 0: in_header = True fnheader = line.replace(classname + '::', '') fnheader = fnheader.replace('{', '') fnheader = fnheader.replace(') :', ')') if "PUBLIC " in fnheader: thisaccess = 'public' if "PROTECTED " in fnheader: thisaccess = 'protected' if "PRIVATE " in fnheader: thisaccess = 'private' fnheader = fnheader.replace(thisaccess.upper() + ' ', '') got_all_header = False if fnheader.find(")") >= 0: in_header = False got_all_header = True fnheader = fnheader.strip().replace(')', ');') fnheader = fnheader.strip().replace(';const', 'const;') fnheader = fnheader.strip().replace('; const', ' const;') # cog.outl(fnheader); thisdec += fnheader + '\n' if got_all_header: decs_by_acc[thisaccess].append(thisdec) thisdec = '' thisaccess = default_access line = f.readline() f.close() cog.outl('// generated, using cog:') for accessor in ['public', 'protected', 'private']: decs = decs_by_acc[accessor] if len(decs) > 0: cog.outl('') cog.outl('{accessor}:'.format(accessor=accessor)) for dec in decs: cog.out(dec) cog.outl('')
{ "pile_set_name": "Github" }
// Copyright (c) 2012-present The upper.io/db authors. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. package postgresql import ( "github.com/upper/db/v4/internal/adapter" "github.com/upper/db/v4/internal/cache" "github.com/upper/db/v4/internal/sqladapter/exql" ) const ( adapterColumnSeparator = `.` adapterIdentifierSeparator = `, ` adapterIdentifierQuote = `"{{.Value}}"` adapterValueSeparator = `, ` adapterValueQuote = `'{{.}}'` adapterAndKeyword = `AND` adapterOrKeyword = `OR` adapterDescKeyword = `DESC` adapterAscKeyword = `ASC` adapterAssignmentOperator = `=` adapterClauseGroup = `({{.}})` adapterClauseOperator = ` {{.}} ` adapterColumnValue = `{{.Column}} {{.Operator}} {{.Value}}` adapterTableAliasLayout = `{{.Name}}{{if .Alias}} AS {{.Alias}}{{end}}` adapterColumnAliasLayout = `{{.Name}}{{if .Alias}} AS {{.Alias}}{{end}}` adapterSortByColumnLayout = `{{.Column}} {{.Order}}` adapterOrderByLayout = ` {{if .SortColumns}} ORDER BY {{.SortColumns}} {{end}} ` adapterWhereLayout = ` {{if .Conds}} WHERE {{.Conds}} {{end}} ` adapterUsingLayout = ` {{if .Columns}} USING ({{.Columns}}) {{end}} ` adapterJoinLayout = ` {{if .Table}} {{ if .On }} {{.Type}} JOIN {{.Table}} {{.On}} {{ else if .Using }} {{.Type}} JOIN {{.Table}} {{.Using}} {{ else if .Type | eq "CROSS" }} {{.Type}} JOIN {{.Table}} {{else}} NATURAL {{.Type}} JOIN {{.Table}} {{end}} {{end}} ` adapterOnLayout = ` {{if .Conds}} ON {{.Conds}} {{end}} ` adapterSelectLayout = ` SELECT {{if .Distinct}} DISTINCT {{end}} {{if defined .Columns}} {{.Columns | compile}} {{else}} * {{end}} {{if defined .Table}} FROM {{.Table | compile}} {{end}} {{.Joins | compile}} {{.Where | compile}} {{if defined .GroupBy}} {{.GroupBy | compile}} {{end}} {{.OrderBy | compile}} {{if .Limit}} LIMIT {{.Limit}} {{end}} {{if .Offset}} OFFSET {{.Offset}} {{end}} ` adapterDeleteLayout = ` DELETE FROM {{.Table | compile}} {{.Where | compile}} ` adapterUpdateLayout = ` UPDATE {{.Table | compile}} SET {{.ColumnValues | compile}} {{.Where | compile}} ` adapterSelectCountLayout = ` SELECT COUNT(1) AS _t FROM {{.Table | compile}} {{.Where | compile}} ` adapterInsertLayout = ` INSERT INTO {{.Table | compile}} {{if defined .Columns}}({{.Columns | compile}}){{end}} VALUES {{if defined .Values}} {{.Values | compile}} {{else}} (default) {{end}} {{if defined .Returning}} RETURNING {{.Returning | compile}} {{end}} ` adapterTruncateLayout = ` TRUNCATE TABLE {{.Table | compile}} RESTART IDENTITY ` adapterDropDatabaseLayout = ` DROP DATABASE {{.Database | compile}} ` adapterDropTableLayout = ` DROP TABLE {{.Table | compile}} ` adapterGroupByLayout = ` {{if .GroupColumns}} GROUP BY {{.GroupColumns}} {{end}} ` ) var template = &exql.Template{ ColumnSeparator: adapterColumnSeparator, IdentifierSeparator: adapterIdentifierSeparator, IdentifierQuote: adapterIdentifierQuote, ValueSeparator: adapterValueSeparator, ValueQuote: adapterValueQuote, AndKeyword: adapterAndKeyword, OrKeyword: adapterOrKeyword, DescKeyword: adapterDescKeyword, AscKeyword: adapterAscKeyword, AssignmentOperator: adapterAssignmentOperator, ClauseGroup: adapterClauseGroup, ClauseOperator: adapterClauseOperator, ColumnValue: adapterColumnValue, TableAliasLayout: adapterTableAliasLayout, ColumnAliasLayout: adapterColumnAliasLayout, SortByColumnLayout: adapterSortByColumnLayout, WhereLayout: adapterWhereLayout, JoinLayout: adapterJoinLayout, OnLayout: adapterOnLayout, UsingLayout: adapterUsingLayout, OrderByLayout: adapterOrderByLayout, InsertLayout: adapterInsertLayout, SelectLayout: adapterSelectLayout, UpdateLayout: adapterUpdateLayout, DeleteLayout: adapterDeleteLayout, TruncateLayout: adapterTruncateLayout, DropDatabaseLayout: adapterDropDatabaseLayout, DropTableLayout: adapterDropTableLayout, CountLayout: adapterSelectCountLayout, GroupByLayout: adapterGroupByLayout, Cache: cache.NewCache(), ComparisonOperator: map[adapter.ComparisonOperator]string{ adapter.ComparisonOperatorRegExp: "~", adapter.ComparisonOperatorNotRegExp: "!~", }, }
{ "pile_set_name": "Github" }
<?php 1.2 + 3 ?>
{ "pile_set_name": "Github" }
function New-KeePassDatabase { <# .SYNOPSIS Function to create a keepass database. .DESCRIPTION This function creates a new keepass database .PARAMETER DatabasePath Path to the Keepass database (.kdbx file) .PARAMETER KeyPath Not yet implemented .PARAMETER UseNetworkAccount Specify of you want the database to use windows authentication .PARAMETER MasterKey The masterkey that provides access to the database .INPUTS String SecureString .OUTPUTS $null #> [CmdletBinding()] param ( [Parameter(Position = 0)] [ValidateNotNullOrEmpty()] [String] $DatabasePath, [Parameter(Position = 1, Mandatory, ParameterSetName = 'Key')] [Parameter(Position = 1, Mandatory, ParameterSetName = 'KeyAndMaster')] [ValidateNotNullOrEmpty()] [ValidateScript({Test-Path $_})] [String] $KeyPath, [Parameter(Position = 2, ParameterSetName = 'Key')] [Parameter(Position = 2, ParameterSetName = 'Master')] [Parameter(Position = 2, Mandatory, ParameterSetName = 'Network')] [Switch] $UseNetworkAccount, [Parameter(Position = 3, Mandatory, ParameterSetName = 'Master')] [Parameter(Position = 3, Mandatory, ParameterSetName = 'KeyAndMaster')] [PSCredential] $MasterKey ) begin { if($KeyPath) { throw "KeyPath is not implemented yet" } } process { if(Test-Path -Path $DatabasePath) { throw ('The specified Database Path already exists: {0}.' -f $DatabasePath) } else { try { $DatabaseObject = New-Object -TypeName KeepassLib.PWDatabase -ErrorAction Stop } catch { Import-KPLibrary $DatabaseObject = New-Object -TypeName KeepassLib.PWDatabase -ErrorAction Stop } $CompositeKey = New-Object -TypeName KeepassLib.Keys.CompositeKey if($MasterKey) { $KcpPassword = New-Object -TypeName KeePassLib.Keys.KcpPassword($MasterKey.GetNetworkCredential().Password) $CompositeKey.AddUserKey($KcpPassword) } if($UseNetworkAccount) { $CompositeKey.AddUserKey((New-Object KeepassLib.Keys.KcpUserAccount)) } $IOInfo = New-Object KeepassLib.Serialization.IOConnectionInfo $IOInfo.Path = $DatabasePath $IStatusLogger = New-Object KeePassLib.Interfaces.NullStatusLogger $DatabaseObject.New($IOInfo, $CompositeKey) | Out-Null $DatabaseObject.Save($IStatusLogger) } } }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2018 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _navi14_ip_offset_HEADER #define _navi14_ip_offset_HEADER #define MAX_INSTANCE 7 #define MAX_SEGMENT 5 struct IP_BASE_INSTANCE { unsigned int segment[MAX_SEGMENT]; }; struct IP_BASE { struct IP_BASE_INSTANCE instance[MAX_INSTANCE]; }; static const struct IP_BASE ATHUB_BASE ={ { { { 0x00000C00, 0x02408C00, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE CLK_BASE ={ { { { 0x00016C00, 0x02401800, 0, 0, 0 } }, { { 0x00016E00, 0x02401C00, 0, 0, 0 } }, { { 0x00017000, 0x02402000, 0, 0, 0 } }, { { 0x00017200, 0x02402400, 0, 0, 0 } }, { { 0x0001B000, 0x0242D800, 0, 0, 0 } }, { { 0x00017E00, 0x0240BC00, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE DF_BASE ={ { { { 0x00007000, 0x0240B800, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE DIO_BASE ={ { { { 0x02404000, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE DMU_BASE ={ { { { 0x00000012, 0x000000C0, 0x000034C0, 0x00009000, 0x02403C00 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE DPCS_BASE ={ { { { 0x00000012, 0x000000C0, 0x000034C0, 0x00009000, 0x02403C00 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE FUSE_BASE ={ { { { 0x00017400, 0x02401400, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE GC_BASE ={ { { { 0x00001260, 0x0000A000, 0x02402C00, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE HDA_BASE ={ { { { 0x004C0000, 0x02404800, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE HDP_BASE ={ { { { 0x00000F20, 0x0240A400, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE MMHUB_BASE ={ { { { 0x0001A000, 0x02408800, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE MP0_BASE ={ { { { 0x00016000, 0x00DC0000, 0x00E00000, 0x00E40000, 0x0243FC00 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE MP1_BASE ={ { { { 0x00016000, 0x00DC0000, 0x00E00000, 0x00E40000, 0x0243FC00 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE NBIF0_BASE ={ { { { 0x00000000, 0x00000014, 0x00000D20, 0x00010400, 0x0241B000 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE OSSSYS_BASE ={ { { { 0x000010A0, 0x0240A000, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE PCIE0_BASE ={ { { { 0x00000000, 0x00000014, 0x00000D20, 0x00010400, 0x0241B000 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE SDMA_BASE ={ { { { 0x00001260, 0x0000A000, 0x02402C00, 0, 0 } }, { { 0x00001260, 0x0000A000, 0x02402C00, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE SMUIO_BASE ={ { { { 0x00016800, 0x00016A00, 0x00440000, 0x02401000, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE THM_BASE ={ { { { 0x00016600, 0x02400C00, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE UMC_BASE ={ { { { 0x00014000, 0x02425800, 0, 0, 0 } }, { { 0x00054000, 0x02425C00, 0, 0, 0 } }, { { 0x00094000, 0x02426000, 0, 0, 0 } }, { { 0x000D4000, 0x02426400, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE USB0_BASE ={ { { { 0x0242A800, 0x05B00000, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; static const struct IP_BASE UVD0_BASE ={ { { { 0x00007800, 0x00007E00, 0x02403000, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } }, { { 0, 0, 0, 0, 0 } } } }; #define ATHUB_BASE__INST0_SEG0 0x00000C00 #define ATHUB_BASE__INST0_SEG1 0x02408C00 #define ATHUB_BASE__INST0_SEG2 0 #define ATHUB_BASE__INST0_SEG3 0 #define ATHUB_BASE__INST0_SEG4 0 #define ATHUB_BASE__INST1_SEG0 0 #define ATHUB_BASE__INST1_SEG1 0 #define ATHUB_BASE__INST1_SEG2 0 #define ATHUB_BASE__INST1_SEG3 0 #define ATHUB_BASE__INST1_SEG4 0 #define ATHUB_BASE__INST2_SEG0 0 #define ATHUB_BASE__INST2_SEG1 0 #define ATHUB_BASE__INST2_SEG2 0 #define ATHUB_BASE__INST2_SEG3 0 #define ATHUB_BASE__INST2_SEG4 0 #define ATHUB_BASE__INST3_SEG0 0 #define ATHUB_BASE__INST3_SEG1 0 #define ATHUB_BASE__INST3_SEG2 0 #define ATHUB_BASE__INST3_SEG3 0 #define ATHUB_BASE__INST3_SEG4 0 #define ATHUB_BASE__INST4_SEG0 0 #define ATHUB_BASE__INST4_SEG1 0 #define ATHUB_BASE__INST4_SEG2 0 #define ATHUB_BASE__INST4_SEG3 0 #define ATHUB_BASE__INST4_SEG4 0 #define ATHUB_BASE__INST5_SEG0 0 #define ATHUB_BASE__INST5_SEG1 0 #define ATHUB_BASE__INST5_SEG2 0 #define ATHUB_BASE__INST5_SEG3 0 #define ATHUB_BASE__INST5_SEG4 0 #define ATHUB_BASE__INST6_SEG0 0 #define ATHUB_BASE__INST6_SEG1 0 #define ATHUB_BASE__INST6_SEG2 0 #define ATHUB_BASE__INST6_SEG3 0 #define ATHUB_BASE__INST6_SEG4 0 #define CLK_BASE__INST0_SEG0 0x00016C00 #define CLK_BASE__INST0_SEG1 0x02401800 #define CLK_BASE__INST0_SEG2 0 #define CLK_BASE__INST0_SEG3 0 #define CLK_BASE__INST0_SEG4 0 #define CLK_BASE__INST1_SEG0 0x00016E00 #define CLK_BASE__INST1_SEG1 0x02401C00 #define CLK_BASE__INST1_SEG2 0 #define CLK_BASE__INST1_SEG3 0 #define CLK_BASE__INST1_SEG4 0 #define CLK_BASE__INST2_SEG0 0x00017000 #define CLK_BASE__INST2_SEG1 0x02402000 #define CLK_BASE__INST2_SEG2 0 #define CLK_BASE__INST2_SEG3 0 #define CLK_BASE__INST2_SEG4 0 #define CLK_BASE__INST3_SEG0 0x00017200 #define CLK_BASE__INST3_SEG1 0x02402400 #define CLK_BASE__INST3_SEG2 0 #define CLK_BASE__INST3_SEG3 0 #define CLK_BASE__INST3_SEG4 0 #define CLK_BASE__INST4_SEG0 0x0001B000 #define CLK_BASE__INST4_SEG1 0x0242D800 #define CLK_BASE__INST4_SEG2 0 #define CLK_BASE__INST4_SEG3 0 #define CLK_BASE__INST4_SEG4 0 #define CLK_BASE__INST5_SEG0 0x00017E00 #define CLK_BASE__INST5_SEG1 0x0240BC00 #define CLK_BASE__INST5_SEG2 0 #define CLK_BASE__INST5_SEG3 0 #define CLK_BASE__INST5_SEG4 0 #define CLK_BASE__INST6_SEG0 0 #define CLK_BASE__INST6_SEG1 0 #define CLK_BASE__INST6_SEG2 0 #define CLK_BASE__INST6_SEG3 0 #define CLK_BASE__INST6_SEG4 0 #define DF_BASE__INST0_SEG0 0x00007000 #define DF_BASE__INST0_SEG1 0x0240B800 #define DF_BASE__INST0_SEG2 0 #define DF_BASE__INST0_SEG3 0 #define DF_BASE__INST0_SEG4 0 #define DF_BASE__INST1_SEG0 0 #define DF_BASE__INST1_SEG1 0 #define DF_BASE__INST1_SEG2 0 #define DF_BASE__INST1_SEG3 0 #define DF_BASE__INST1_SEG4 0 #define DF_BASE__INST2_SEG0 0 #define DF_BASE__INST2_SEG1 0 #define DF_BASE__INST2_SEG2 0 #define DF_BASE__INST2_SEG3 0 #define DF_BASE__INST2_SEG4 0 #define DF_BASE__INST3_SEG0 0 #define DF_BASE__INST3_SEG1 0 #define DF_BASE__INST3_SEG2 0 #define DF_BASE__INST3_SEG3 0 #define DF_BASE__INST3_SEG4 0 #define DF_BASE__INST4_SEG0 0 #define DF_BASE__INST4_SEG1 0 #define DF_BASE__INST4_SEG2 0 #define DF_BASE__INST4_SEG3 0 #define DF_BASE__INST4_SEG4 0 #define DF_BASE__INST5_SEG0 0 #define DF_BASE__INST5_SEG1 0 #define DF_BASE__INST5_SEG2 0 #define DF_BASE__INST5_SEG3 0 #define DF_BASE__INST5_SEG4 0 #define DF_BASE__INST6_SEG0 0 #define DF_BASE__INST6_SEG1 0 #define DF_BASE__INST6_SEG2 0 #define DF_BASE__INST6_SEG3 0 #define DF_BASE__INST6_SEG4 0 #define DIO_BASE__INST0_SEG0 0x02404000 #define DIO_BASE__INST0_SEG1 0 #define DIO_BASE__INST0_SEG2 0 #define DIO_BASE__INST0_SEG3 0 #define DIO_BASE__INST0_SEG4 0 #define DIO_BASE__INST1_SEG0 0 #define DIO_BASE__INST1_SEG1 0 #define DIO_BASE__INST1_SEG2 0 #define DIO_BASE__INST1_SEG3 0 #define DIO_BASE__INST1_SEG4 0 #define DIO_BASE__INST2_SEG0 0 #define DIO_BASE__INST2_SEG1 0 #define DIO_BASE__INST2_SEG2 0 #define DIO_BASE__INST2_SEG3 0 #define DIO_BASE__INST2_SEG4 0 #define DIO_BASE__INST3_SEG0 0 #define DIO_BASE__INST3_SEG1 0 #define DIO_BASE__INST3_SEG2 0 #define DIO_BASE__INST3_SEG3 0 #define DIO_BASE__INST3_SEG4 0 #define DIO_BASE__INST4_SEG0 0 #define DIO_BASE__INST4_SEG1 0 #define DIO_BASE__INST4_SEG2 0 #define DIO_BASE__INST4_SEG3 0 #define DIO_BASE__INST4_SEG4 0 #define DIO_BASE__INST5_SEG0 0 #define DIO_BASE__INST5_SEG1 0 #define DIO_BASE__INST5_SEG2 0 #define DIO_BASE__INST5_SEG3 0 #define DIO_BASE__INST5_SEG4 0 #define DIO_BASE__INST6_SEG0 0 #define DIO_BASE__INST6_SEG1 0 #define DIO_BASE__INST6_SEG2 0 #define DIO_BASE__INST6_SEG3 0 #define DIO_BASE__INST6_SEG4 0 #define DMU_BASE__INST0_SEG0 0x00000012 #define DMU_BASE__INST0_SEG1 0x000000C0 #define DMU_BASE__INST0_SEG2 0x000034C0 #define DMU_BASE__INST0_SEG3 0x00009000 #define DMU_BASE__INST0_SEG4 0x02403C00 #define DMU_BASE__INST1_SEG0 0 #define DMU_BASE__INST1_SEG1 0 #define DMU_BASE__INST1_SEG2 0 #define DMU_BASE__INST1_SEG3 0 #define DMU_BASE__INST1_SEG4 0 #define DMU_BASE__INST2_SEG0 0 #define DMU_BASE__INST2_SEG1 0 #define DMU_BASE__INST2_SEG2 0 #define DMU_BASE__INST2_SEG3 0 #define DMU_BASE__INST2_SEG4 0 #define DMU_BASE__INST3_SEG0 0 #define DMU_BASE__INST3_SEG1 0 #define DMU_BASE__INST3_SEG2 0 #define DMU_BASE__INST3_SEG3 0 #define DMU_BASE__INST3_SEG4 0 #define DMU_BASE__INST4_SEG0 0 #define DMU_BASE__INST4_SEG1 0 #define DMU_BASE__INST4_SEG2 0 #define DMU_BASE__INST4_SEG3 0 #define DMU_BASE__INST4_SEG4 0 #define DMU_BASE__INST5_SEG0 0 #define DMU_BASE__INST5_SEG1 0 #define DMU_BASE__INST5_SEG2 0 #define DMU_BASE__INST5_SEG3 0 #define DMU_BASE__INST5_SEG4 0 #define DMU_BASE__INST6_SEG0 0 #define DMU_BASE__INST6_SEG1 0 #define DMU_BASE__INST6_SEG2 0 #define DMU_BASE__INST6_SEG3 0 #define DMU_BASE__INST6_SEG4 0 #define DPCS_BASE__INST0_SEG0 0x00000012 #define DPCS_BASE__INST0_SEG1 0x000000C0 #define DPCS_BASE__INST0_SEG2 0x000034C0 #define DPCS_BASE__INST0_SEG3 0x00009000 #define DPCS_BASE__INST0_SEG4 0x02403C00 #define DPCS_BASE__INST1_SEG0 0 #define DPCS_BASE__INST1_SEG1 0 #define DPCS_BASE__INST1_SEG2 0 #define DPCS_BASE__INST1_SEG3 0 #define DPCS_BASE__INST1_SEG4 0 #define DPCS_BASE__INST2_SEG0 0 #define DPCS_BASE__INST2_SEG1 0 #define DPCS_BASE__INST2_SEG2 0 #define DPCS_BASE__INST2_SEG3 0 #define DPCS_BASE__INST2_SEG4 0 #define DPCS_BASE__INST3_SEG0 0 #define DPCS_BASE__INST3_SEG1 0 #define DPCS_BASE__INST3_SEG2 0 #define DPCS_BASE__INST3_SEG3 0 #define DPCS_BASE__INST3_SEG4 0 #define DPCS_BASE__INST4_SEG0 0 #define DPCS_BASE__INST4_SEG1 0 #define DPCS_BASE__INST4_SEG2 0 #define DPCS_BASE__INST4_SEG3 0 #define DPCS_BASE__INST4_SEG4 0 #define DPCS_BASE__INST5_SEG0 0 #define DPCS_BASE__INST5_SEG1 0 #define DPCS_BASE__INST5_SEG2 0 #define DPCS_BASE__INST5_SEG3 0 #define DPCS_BASE__INST5_SEG4 0 #define DPCS_BASE__INST6_SEG0 0 #define DPCS_BASE__INST6_SEG1 0 #define DPCS_BASE__INST6_SEG2 0 #define DPCS_BASE__INST6_SEG3 0 #define DPCS_BASE__INST6_SEG4 0 #define FUSE_BASE__INST0_SEG0 0x00017400 #define FUSE_BASE__INST0_SEG1 0x02401400 #define FUSE_BASE__INST0_SEG2 0 #define FUSE_BASE__INST0_SEG3 0 #define FUSE_BASE__INST0_SEG4 0 #define FUSE_BASE__INST1_SEG0 0 #define FUSE_BASE__INST1_SEG1 0 #define FUSE_BASE__INST1_SEG2 0 #define FUSE_BASE__INST1_SEG3 0 #define FUSE_BASE__INST1_SEG4 0 #define FUSE_BASE__INST2_SEG0 0 #define FUSE_BASE__INST2_SEG1 0 #define FUSE_BASE__INST2_SEG2 0 #define FUSE_BASE__INST2_SEG3 0 #define FUSE_BASE__INST2_SEG4 0 #define FUSE_BASE__INST3_SEG0 0 #define FUSE_BASE__INST3_SEG1 0 #define FUSE_BASE__INST3_SEG2 0 #define FUSE_BASE__INST3_SEG3 0 #define FUSE_BASE__INST3_SEG4 0 #define FUSE_BASE__INST4_SEG0 0 #define FUSE_BASE__INST4_SEG1 0 #define FUSE_BASE__INST4_SEG2 0 #define FUSE_BASE__INST4_SEG3 0 #define FUSE_BASE__INST4_SEG4 0 #define FUSE_BASE__INST5_SEG0 0 #define FUSE_BASE__INST5_SEG1 0 #define FUSE_BASE__INST5_SEG2 0 #define FUSE_BASE__INST5_SEG3 0 #define FUSE_BASE__INST5_SEG4 0 #define FUSE_BASE__INST6_SEG0 0 #define FUSE_BASE__INST6_SEG1 0 #define FUSE_BASE__INST6_SEG2 0 #define FUSE_BASE__INST6_SEG3 0 #define FUSE_BASE__INST6_SEG4 0 #define GC_BASE__INST0_SEG0 0x00001260 #define GC_BASE__INST0_SEG1 0x0000A000 #define GC_BASE__INST0_SEG2 0x02402C00 #define GC_BASE__INST0_SEG3 0 #define GC_BASE__INST0_SEG4 0 #define GC_BASE__INST1_SEG0 0 #define GC_BASE__INST1_SEG1 0 #define GC_BASE__INST1_SEG2 0 #define GC_BASE__INST1_SEG3 0 #define GC_BASE__INST1_SEG4 0 #define GC_BASE__INST2_SEG0 0 #define GC_BASE__INST2_SEG1 0 #define GC_BASE__INST2_SEG2 0 #define GC_BASE__INST2_SEG3 0 #define GC_BASE__INST2_SEG4 0 #define GC_BASE__INST3_SEG0 0 #define GC_BASE__INST3_SEG1 0 #define GC_BASE__INST3_SEG2 0 #define GC_BASE__INST3_SEG3 0 #define GC_BASE__INST3_SEG4 0 #define GC_BASE__INST4_SEG0 0 #define GC_BASE__INST4_SEG1 0 #define GC_BASE__INST4_SEG2 0 #define GC_BASE__INST4_SEG3 0 #define GC_BASE__INST4_SEG4 0 #define GC_BASE__INST5_SEG0 0 #define GC_BASE__INST5_SEG1 0 #define GC_BASE__INST5_SEG2 0 #define GC_BASE__INST5_SEG3 0 #define GC_BASE__INST5_SEG4 0 #define GC_BASE__INST6_SEG0 0 #define GC_BASE__INST6_SEG1 0 #define GC_BASE__INST6_SEG2 0 #define GC_BASE__INST6_SEG3 0 #define GC_BASE__INST6_SEG4 0 #define HDA_BASE__INST0_SEG0 0x004C0000 #define HDA_BASE__INST0_SEG1 0x02404800 #define HDA_BASE__INST0_SEG2 0 #define HDA_BASE__INST0_SEG3 0 #define HDA_BASE__INST0_SEG4 0 #define HDA_BASE__INST1_SEG0 0 #define HDA_BASE__INST1_SEG1 0 #define HDA_BASE__INST1_SEG2 0 #define HDA_BASE__INST1_SEG3 0 #define HDA_BASE__INST1_SEG4 0 #define HDA_BASE__INST2_SEG0 0 #define HDA_BASE__INST2_SEG1 0 #define HDA_BASE__INST2_SEG2 0 #define HDA_BASE__INST2_SEG3 0 #define HDA_BASE__INST2_SEG4 0 #define HDA_BASE__INST3_SEG0 0 #define HDA_BASE__INST3_SEG1 0 #define HDA_BASE__INST3_SEG2 0 #define HDA_BASE__INST3_SEG3 0 #define HDA_BASE__INST3_SEG4 0 #define HDA_BASE__INST4_SEG0 0 #define HDA_BASE__INST4_SEG1 0 #define HDA_BASE__INST4_SEG2 0 #define HDA_BASE__INST4_SEG3 0 #define HDA_BASE__INST4_SEG4 0 #define HDA_BASE__INST5_SEG0 0 #define HDA_BASE__INST5_SEG1 0 #define HDA_BASE__INST5_SEG2 0 #define HDA_BASE__INST5_SEG3 0 #define HDA_BASE__INST5_SEG4 0 #define HDA_BASE__INST6_SEG0 0 #define HDA_BASE__INST6_SEG1 0 #define HDA_BASE__INST6_SEG2 0 #define HDA_BASE__INST6_SEG3 0 #define HDA_BASE__INST6_SEG4 0 #define HDP_BASE__INST0_SEG0 0x00000F20 #define HDP_BASE__INST0_SEG1 0x0240A400 #define HDP_BASE__INST0_SEG2 0 #define HDP_BASE__INST0_SEG3 0 #define HDP_BASE__INST0_SEG4 0 #define HDP_BASE__INST1_SEG0 0 #define HDP_BASE__INST1_SEG1 0 #define HDP_BASE__INST1_SEG2 0 #define HDP_BASE__INST1_SEG3 0 #define HDP_BASE__INST1_SEG4 0 #define HDP_BASE__INST2_SEG0 0 #define HDP_BASE__INST2_SEG1 0 #define HDP_BASE__INST2_SEG2 0 #define HDP_BASE__INST2_SEG3 0 #define HDP_BASE__INST2_SEG4 0 #define HDP_BASE__INST3_SEG0 0 #define HDP_BASE__INST3_SEG1 0 #define HDP_BASE__INST3_SEG2 0 #define HDP_BASE__INST3_SEG3 0 #define HDP_BASE__INST3_SEG4 0 #define HDP_BASE__INST4_SEG0 0 #define HDP_BASE__INST4_SEG1 0 #define HDP_BASE__INST4_SEG2 0 #define HDP_BASE__INST4_SEG3 0 #define HDP_BASE__INST4_SEG4 0 #define HDP_BASE__INST5_SEG0 0 #define HDP_BASE__INST5_SEG1 0 #define HDP_BASE__INST5_SEG2 0 #define HDP_BASE__INST5_SEG3 0 #define HDP_BASE__INST5_SEG4 0 #define HDP_BASE__INST6_SEG0 0 #define HDP_BASE__INST6_SEG1 0 #define HDP_BASE__INST6_SEG2 0 #define HDP_BASE__INST6_SEG3 0 #define HDP_BASE__INST6_SEG4 0 #define MMHUB_BASE__INST0_SEG0 0x0001A000 #define MMHUB_BASE__INST0_SEG1 0x02408800 #define MMHUB_BASE__INST0_SEG2 0 #define MMHUB_BASE__INST0_SEG3 0 #define MMHUB_BASE__INST0_SEG4 0 #define MMHUB_BASE__INST1_SEG0 0 #define MMHUB_BASE__INST1_SEG1 0 #define MMHUB_BASE__INST1_SEG2 0 #define MMHUB_BASE__INST1_SEG3 0 #define MMHUB_BASE__INST1_SEG4 0 #define MMHUB_BASE__INST2_SEG0 0 #define MMHUB_BASE__INST2_SEG1 0 #define MMHUB_BASE__INST2_SEG2 0 #define MMHUB_BASE__INST2_SEG3 0 #define MMHUB_BASE__INST2_SEG4 0 #define MMHUB_BASE__INST3_SEG0 0 #define MMHUB_BASE__INST3_SEG1 0 #define MMHUB_BASE__INST3_SEG2 0 #define MMHUB_BASE__INST3_SEG3 0 #define MMHUB_BASE__INST3_SEG4 0 #define MMHUB_BASE__INST4_SEG0 0 #define MMHUB_BASE__INST4_SEG1 0 #define MMHUB_BASE__INST4_SEG2 0 #define MMHUB_BASE__INST4_SEG3 0 #define MMHUB_BASE__INST4_SEG4 0 #define MMHUB_BASE__INST5_SEG0 0 #define MMHUB_BASE__INST5_SEG1 0 #define MMHUB_BASE__INST5_SEG2 0 #define MMHUB_BASE__INST5_SEG3 0 #define MMHUB_BASE__INST5_SEG4 0 #define MMHUB_BASE__INST6_SEG0 0 #define MMHUB_BASE__INST6_SEG1 0 #define MMHUB_BASE__INST6_SEG2 0 #define MMHUB_BASE__INST6_SEG3 0 #define MMHUB_BASE__INST6_SEG4 0 #define MP0_BASE__INST0_SEG0 0x00016000 #define MP0_BASE__INST0_SEG1 0x00DC0000 #define MP0_BASE__INST0_SEG2 0x00E00000 #define MP0_BASE__INST0_SEG3 0x00E40000 #define MP0_BASE__INST0_SEG4 0x0243FC00 #define MP0_BASE__INST1_SEG0 0 #define MP0_BASE__INST1_SEG1 0 #define MP0_BASE__INST1_SEG2 0 #define MP0_BASE__INST1_SEG3 0 #define MP0_BASE__INST1_SEG4 0 #define MP0_BASE__INST2_SEG0 0 #define MP0_BASE__INST2_SEG1 0 #define MP0_BASE__INST2_SEG2 0 #define MP0_BASE__INST2_SEG3 0 #define MP0_BASE__INST2_SEG4 0 #define MP0_BASE__INST3_SEG0 0 #define MP0_BASE__INST3_SEG1 0 #define MP0_BASE__INST3_SEG2 0 #define MP0_BASE__INST3_SEG3 0 #define MP0_BASE__INST3_SEG4 0 #define MP0_BASE__INST4_SEG0 0 #define MP0_BASE__INST4_SEG1 0 #define MP0_BASE__INST4_SEG2 0 #define MP0_BASE__INST4_SEG3 0 #define MP0_BASE__INST4_SEG4 0 #define MP0_BASE__INST5_SEG0 0 #define MP0_BASE__INST5_SEG1 0 #define MP0_BASE__INST5_SEG2 0 #define MP0_BASE__INST5_SEG3 0 #define MP0_BASE__INST5_SEG4 0 #define MP0_BASE__INST6_SEG0 0 #define MP0_BASE__INST6_SEG1 0 #define MP0_BASE__INST6_SEG2 0 #define MP0_BASE__INST6_SEG3 0 #define MP0_BASE__INST6_SEG4 0 #define MP1_BASE__INST0_SEG0 0x00016000 #define MP1_BASE__INST0_SEG1 0x00DC0000 #define MP1_BASE__INST0_SEG2 0x00E00000 #define MP1_BASE__INST0_SEG3 0x00E40000 #define MP1_BASE__INST0_SEG4 0x0243FC00 #define MP1_BASE__INST1_SEG0 0 #define MP1_BASE__INST1_SEG1 0 #define MP1_BASE__INST1_SEG2 0 #define MP1_BASE__INST1_SEG3 0 #define MP1_BASE__INST1_SEG4 0 #define MP1_BASE__INST2_SEG0 0 #define MP1_BASE__INST2_SEG1 0 #define MP1_BASE__INST2_SEG2 0 #define MP1_BASE__INST2_SEG3 0 #define MP1_BASE__INST2_SEG4 0 #define MP1_BASE__INST3_SEG0 0 #define MP1_BASE__INST3_SEG1 0 #define MP1_BASE__INST3_SEG2 0 #define MP1_BASE__INST3_SEG3 0 #define MP1_BASE__INST3_SEG4 0 #define MP1_BASE__INST4_SEG0 0 #define MP1_BASE__INST4_SEG1 0 #define MP1_BASE__INST4_SEG2 0 #define MP1_BASE__INST4_SEG3 0 #define MP1_BASE__INST4_SEG4 0 #define MP1_BASE__INST5_SEG0 0 #define MP1_BASE__INST5_SEG1 0 #define MP1_BASE__INST5_SEG2 0 #define MP1_BASE__INST5_SEG3 0 #define MP1_BASE__INST5_SEG4 0 #define MP1_BASE__INST6_SEG0 0 #define MP1_BASE__INST6_SEG1 0 #define MP1_BASE__INST6_SEG2 0 #define MP1_BASE__INST6_SEG3 0 #define MP1_BASE__INST6_SEG4 0 #define NBIF0_BASE__INST0_SEG0 0x00000000 #define NBIF0_BASE__INST0_SEG1 0x00000014 #define NBIF0_BASE__INST0_SEG2 0x00000D20 #define NBIF0_BASE__INST0_SEG3 0x00010400 #define NBIF0_BASE__INST0_SEG4 0x0241B000 #define NBIF0_BASE__INST1_SEG0 0 #define NBIF0_BASE__INST1_SEG1 0 #define NBIF0_BASE__INST1_SEG2 0 #define NBIF0_BASE__INST1_SEG3 0 #define NBIF0_BASE__INST1_SEG4 0 #define NBIF0_BASE__INST2_SEG0 0 #define NBIF0_BASE__INST2_SEG1 0 #define NBIF0_BASE__INST2_SEG2 0 #define NBIF0_BASE__INST2_SEG3 0 #define NBIF0_BASE__INST2_SEG4 0 #define NBIF0_BASE__INST3_SEG0 0 #define NBIF0_BASE__INST3_SEG1 0 #define NBIF0_BASE__INST3_SEG2 0 #define NBIF0_BASE__INST3_SEG3 0 #define NBIF0_BASE__INST3_SEG4 0 #define NBIF0_BASE__INST4_SEG0 0 #define NBIF0_BASE__INST4_SEG1 0 #define NBIF0_BASE__INST4_SEG2 0 #define NBIF0_BASE__INST4_SEG3 0 #define NBIF0_BASE__INST4_SEG4 0 #define NBIF0_BASE__INST5_SEG0 0 #define NBIF0_BASE__INST5_SEG1 0 #define NBIF0_BASE__INST5_SEG2 0 #define NBIF0_BASE__INST5_SEG3 0 #define NBIF0_BASE__INST5_SEG4 0 #define NBIF0_BASE__INST6_SEG0 0 #define NBIF0_BASE__INST6_SEG1 0 #define NBIF0_BASE__INST6_SEG2 0 #define NBIF0_BASE__INST6_SEG3 0 #define NBIF0_BASE__INST6_SEG4 0 #define OSSSYS_BASE__INST0_SEG0 0x000010A0 #define OSSSYS_BASE__INST0_SEG1 0x0240A000 #define OSSSYS_BASE__INST0_SEG2 0 #define OSSSYS_BASE__INST0_SEG3 0 #define OSSSYS_BASE__INST0_SEG4 0 #define OSSSYS_BASE__INST1_SEG0 0 #define OSSSYS_BASE__INST1_SEG1 0 #define OSSSYS_BASE__INST1_SEG2 0 #define OSSSYS_BASE__INST1_SEG3 0 #define OSSSYS_BASE__INST1_SEG4 0 #define OSSSYS_BASE__INST2_SEG0 0 #define OSSSYS_BASE__INST2_SEG1 0 #define OSSSYS_BASE__INST2_SEG2 0 #define OSSSYS_BASE__INST2_SEG3 0 #define OSSSYS_BASE__INST2_SEG4 0 #define OSSSYS_BASE__INST3_SEG0 0 #define OSSSYS_BASE__INST3_SEG1 0 #define OSSSYS_BASE__INST3_SEG2 0 #define OSSSYS_BASE__INST3_SEG3 0 #define OSSSYS_BASE__INST3_SEG4 0 #define OSSSYS_BASE__INST4_SEG0 0 #define OSSSYS_BASE__INST4_SEG1 0 #define OSSSYS_BASE__INST4_SEG2 0 #define OSSSYS_BASE__INST4_SEG3 0 #define OSSSYS_BASE__INST4_SEG4 0 #define OSSSYS_BASE__INST5_SEG0 0 #define OSSSYS_BASE__INST5_SEG1 0 #define OSSSYS_BASE__INST5_SEG2 0 #define OSSSYS_BASE__INST5_SEG3 0 #define OSSSYS_BASE__INST5_SEG4 0 #define OSSSYS_BASE__INST6_SEG0 0 #define OSSSYS_BASE__INST6_SEG1 0 #define OSSSYS_BASE__INST6_SEG2 0 #define OSSSYS_BASE__INST6_SEG3 0 #define OSSSYS_BASE__INST6_SEG4 0 #define PCIE0_BASE__INST0_SEG0 0x00000000 #define PCIE0_BASE__INST0_SEG1 0x00000014 #define PCIE0_BASE__INST0_SEG2 0x00000D20 #define PCIE0_BASE__INST0_SEG3 0x00010400 #define PCIE0_BASE__INST0_SEG4 0x0241B000 #define PCIE0_BASE__INST1_SEG0 0 #define PCIE0_BASE__INST1_SEG1 0 #define PCIE0_BASE__INST1_SEG2 0 #define PCIE0_BASE__INST1_SEG3 0 #define PCIE0_BASE__INST1_SEG4 0 #define PCIE0_BASE__INST2_SEG0 0 #define PCIE0_BASE__INST2_SEG1 0 #define PCIE0_BASE__INST2_SEG2 0 #define PCIE0_BASE__INST2_SEG3 0 #define PCIE0_BASE__INST2_SEG4 0 #define PCIE0_BASE__INST3_SEG0 0 #define PCIE0_BASE__INST3_SEG1 0 #define PCIE0_BASE__INST3_SEG2 0 #define PCIE0_BASE__INST3_SEG3 0 #define PCIE0_BASE__INST3_SEG4 0 #define PCIE0_BASE__INST4_SEG0 0 #define PCIE0_BASE__INST4_SEG1 0 #define PCIE0_BASE__INST4_SEG2 0 #define PCIE0_BASE__INST4_SEG3 0 #define PCIE0_BASE__INST4_SEG4 0 #define PCIE0_BASE__INST5_SEG0 0 #define PCIE0_BASE__INST5_SEG1 0 #define PCIE0_BASE__INST5_SEG2 0 #define PCIE0_BASE__INST5_SEG3 0 #define PCIE0_BASE__INST5_SEG4 0 #define PCIE0_BASE__INST6_SEG0 0 #define PCIE0_BASE__INST6_SEG1 0 #define PCIE0_BASE__INST6_SEG2 0 #define PCIE0_BASE__INST6_SEG3 0 #define PCIE0_BASE__INST6_SEG4 0 #define SDMA_BASE__INST0_SEG0 0x00001260 #define SDMA_BASE__INST0_SEG1 0x0000A000 #define SDMA_BASE__INST0_SEG2 0x02402C00 #define SDMA_BASE__INST0_SEG3 0 #define SDMA_BASE__INST0_SEG4 0 #define SDMA_BASE__INST1_SEG0 0x00001260 #define SDMA_BASE__INST1_SEG1 0x0000A000 #define SDMA_BASE__INST1_SEG2 0x02402C00 #define SDMA_BASE__INST1_SEG3 0 #define SDMA_BASE__INST1_SEG4 0 #define SDMA_BASE__INST2_SEG0 0 #define SDMA_BASE__INST2_SEG1 0 #define SDMA_BASE__INST2_SEG2 0 #define SDMA_BASE__INST2_SEG3 0 #define SDMA_BASE__INST2_SEG4 0 #define SDMA_BASE__INST3_SEG0 0 #define SDMA_BASE__INST3_SEG1 0 #define SDMA_BASE__INST3_SEG2 0 #define SDMA_BASE__INST3_SEG3 0 #define SDMA_BASE__INST3_SEG4 0 #define SDMA_BASE__INST4_SEG0 0 #define SDMA_BASE__INST4_SEG1 0 #define SDMA_BASE__INST4_SEG2 0 #define SDMA_BASE__INST4_SEG3 0 #define SDMA_BASE__INST4_SEG4 0 #define SDMA_BASE__INST5_SEG0 0 #define SDMA_BASE__INST5_SEG1 0 #define SDMA_BASE__INST5_SEG2 0 #define SDMA_BASE__INST5_SEG3 0 #define SDMA_BASE__INST5_SEG4 0 #define SDMA_BASE__INST6_SEG0 0 #define SDMA_BASE__INST6_SEG1 0 #define SDMA_BASE__INST6_SEG2 0 #define SDMA_BASE__INST6_SEG3 0 #define SDMA_BASE__INST6_SEG4 0 #define SMUIO_BASE__INST0_SEG0 0x00016800 #define SMUIO_BASE__INST0_SEG1 0x00016A00 #define SMUIO_BASE__INST0_SEG2 0x00440000 #define SMUIO_BASE__INST0_SEG3 0x02401000 #define SMUIO_BASE__INST0_SEG4 0 #define SMUIO_BASE__INST1_SEG0 0 #define SMUIO_BASE__INST1_SEG1 0 #define SMUIO_BASE__INST1_SEG2 0 #define SMUIO_BASE__INST1_SEG3 0 #define SMUIO_BASE__INST1_SEG4 0 #define SMUIO_BASE__INST2_SEG0 0 #define SMUIO_BASE__INST2_SEG1 0 #define SMUIO_BASE__INST2_SEG2 0 #define SMUIO_BASE__INST2_SEG3 0 #define SMUIO_BASE__INST2_SEG4 0 #define SMUIO_BASE__INST3_SEG0 0 #define SMUIO_BASE__INST3_SEG1 0 #define SMUIO_BASE__INST3_SEG2 0 #define SMUIO_BASE__INST3_SEG3 0 #define SMUIO_BASE__INST3_SEG4 0 #define SMUIO_BASE__INST4_SEG0 0 #define SMUIO_BASE__INST4_SEG1 0 #define SMUIO_BASE__INST4_SEG2 0 #define SMUIO_BASE__INST4_SEG3 0 #define SMUIO_BASE__INST4_SEG4 0 #define SMUIO_BASE__INST5_SEG0 0 #define SMUIO_BASE__INST5_SEG1 0 #define SMUIO_BASE__INST5_SEG2 0 #define SMUIO_BASE__INST5_SEG3 0 #define SMUIO_BASE__INST5_SEG4 0 #define SMUIO_BASE__INST6_SEG0 0 #define SMUIO_BASE__INST6_SEG1 0 #define SMUIO_BASE__INST6_SEG2 0 #define SMUIO_BASE__INST6_SEG3 0 #define SMUIO_BASE__INST6_SEG4 0 #define THM_BASE__INST0_SEG0 0x00016600 #define THM_BASE__INST0_SEG1 0x02400C00 #define THM_BASE__INST0_SEG2 0 #define THM_BASE__INST0_SEG3 0 #define THM_BASE__INST0_SEG4 0 #define THM_BASE__INST1_SEG0 0 #define THM_BASE__INST1_SEG1 0 #define THM_BASE__INST1_SEG2 0 #define THM_BASE__INST1_SEG3 0 #define THM_BASE__INST1_SEG4 0 #define THM_BASE__INST2_SEG0 0 #define THM_BASE__INST2_SEG1 0 #define THM_BASE__INST2_SEG2 0 #define THM_BASE__INST2_SEG3 0 #define THM_BASE__INST2_SEG4 0 #define THM_BASE__INST3_SEG0 0 #define THM_BASE__INST3_SEG1 0 #define THM_BASE__INST3_SEG2 0 #define THM_BASE__INST3_SEG3 0 #define THM_BASE__INST3_SEG4 0 #define THM_BASE__INST4_SEG0 0 #define THM_BASE__INST4_SEG1 0 #define THM_BASE__INST4_SEG2 0 #define THM_BASE__INST4_SEG3 0 #define THM_BASE__INST4_SEG4 0 #define THM_BASE__INST5_SEG0 0 #define THM_BASE__INST5_SEG1 0 #define THM_BASE__INST5_SEG2 0 #define THM_BASE__INST5_SEG3 0 #define THM_BASE__INST5_SEG4 0 #define THM_BASE__INST6_SEG0 0 #define THM_BASE__INST6_SEG1 0 #define THM_BASE__INST6_SEG2 0 #define THM_BASE__INST6_SEG3 0 #define THM_BASE__INST6_SEG4 0 #define UMC_BASE__INST0_SEG0 0x00014000 #define UMC_BASE__INST0_SEG1 0x02425800 #define UMC_BASE__INST0_SEG2 0 #define UMC_BASE__INST0_SEG3 0 #define UMC_BASE__INST0_SEG4 0 #define UMC_BASE__INST1_SEG0 0x00054000 #define UMC_BASE__INST1_SEG1 0x02425C00 #define UMC_BASE__INST1_SEG2 0 #define UMC_BASE__INST1_SEG3 0 #define UMC_BASE__INST1_SEG4 0 #define UMC_BASE__INST2_SEG0 0x00094000 #define UMC_BASE__INST2_SEG1 0x02426000 #define UMC_BASE__INST2_SEG2 0 #define UMC_BASE__INST2_SEG3 0 #define UMC_BASE__INST2_SEG4 0 #define UMC_BASE__INST3_SEG0 0x000D4000 #define UMC_BASE__INST3_SEG1 0x02426400 #define UMC_BASE__INST3_SEG2 0 #define UMC_BASE__INST3_SEG3 0 #define UMC_BASE__INST3_SEG4 0 #define UMC_BASE__INST4_SEG0 0 #define UMC_BASE__INST4_SEG1 0 #define UMC_BASE__INST4_SEG2 0 #define UMC_BASE__INST4_SEG3 0 #define UMC_BASE__INST4_SEG4 0 #define UMC_BASE__INST5_SEG0 0 #define UMC_BASE__INST5_SEG1 0 #define UMC_BASE__INST5_SEG2 0 #define UMC_BASE__INST5_SEG3 0 #define UMC_BASE__INST5_SEG4 0 #define UMC_BASE__INST6_SEG0 0 #define UMC_BASE__INST6_SEG1 0 #define UMC_BASE__INST6_SEG2 0 #define UMC_BASE__INST6_SEG3 0 #define UMC_BASE__INST6_SEG4 0 #define USB0_BASE__INST0_SEG0 0x0242A800 #define USB0_BASE__INST0_SEG1 0x05B00000 #define USB0_BASE__INST0_SEG2 0 #define USB0_BASE__INST0_SEG3 0 #define USB0_BASE__INST0_SEG4 0 #define USB0_BASE__INST1_SEG0 0 #define USB0_BASE__INST1_SEG1 0 #define USB0_BASE__INST1_SEG2 0 #define USB0_BASE__INST1_SEG3 0 #define USB0_BASE__INST1_SEG4 0 #define USB0_BASE__INST2_SEG0 0 #define USB0_BASE__INST2_SEG1 0 #define USB0_BASE__INST2_SEG2 0 #define USB0_BASE__INST2_SEG3 0 #define USB0_BASE__INST2_SEG4 0 #define USB0_BASE__INST3_SEG0 0 #define USB0_BASE__INST3_SEG1 0 #define USB0_BASE__INST3_SEG2 0 #define USB0_BASE__INST3_SEG3 0 #define USB0_BASE__INST3_SEG4 0 #define USB0_BASE__INST4_SEG0 0 #define USB0_BASE__INST4_SEG1 0 #define USB0_BASE__INST4_SEG2 0 #define USB0_BASE__INST4_SEG3 0 #define USB0_BASE__INST4_SEG4 0 #define USB0_BASE__INST5_SEG0 0 #define USB0_BASE__INST5_SEG1 0 #define USB0_BASE__INST5_SEG2 0 #define USB0_BASE__INST5_SEG3 0 #define USB0_BASE__INST5_SEG4 0 #define USB0_BASE__INST6_SEG0 0 #define USB0_BASE__INST6_SEG1 0 #define USB0_BASE__INST6_SEG2 0 #define USB0_BASE__INST6_SEG3 0 #define USB0_BASE__INST6_SEG4 0 #define UVD0_BASE__INST0_SEG0 0x00007800 #define UVD0_BASE__INST0_SEG1 0x00007E00 #define UVD0_BASE__INST0_SEG2 0x02403000 #define UVD0_BASE__INST0_SEG3 0 #define UVD0_BASE__INST0_SEG4 0 #define UVD0_BASE__INST1_SEG0 0 #define UVD0_BASE__INST1_SEG1 0 #define UVD0_BASE__INST1_SEG2 0 #define UVD0_BASE__INST1_SEG3 0 #define UVD0_BASE__INST1_SEG4 0 #define UVD0_BASE__INST2_SEG0 0 #define UVD0_BASE__INST2_SEG1 0 #define UVD0_BASE__INST2_SEG2 0 #define UVD0_BASE__INST2_SEG3 0 #define UVD0_BASE__INST2_SEG4 0 #define UVD0_BASE__INST3_SEG0 0 #define UVD0_BASE__INST3_SEG1 0 #define UVD0_BASE__INST3_SEG2 0 #define UVD0_BASE__INST3_SEG3 0 #define UVD0_BASE__INST3_SEG4 0 #define UVD0_BASE__INST4_SEG0 0 #define UVD0_BASE__INST4_SEG1 0 #define UVD0_BASE__INST4_SEG2 0 #define UVD0_BASE__INST4_SEG3 0 #define UVD0_BASE__INST4_SEG4 0 #define UVD0_BASE__INST5_SEG0 0 #define UVD0_BASE__INST5_SEG1 0 #define UVD0_BASE__INST5_SEG2 0 #define UVD0_BASE__INST5_SEG3 0 #define UVD0_BASE__INST5_SEG4 0 #define UVD0_BASE__INST6_SEG0 0 #define UVD0_BASE__INST6_SEG1 0 #define UVD0_BASE__INST6_SEG2 0 #define UVD0_BASE__INST6_SEG3 0 #define UVD0_BASE__INST6_SEG4 0 #endif
{ "pile_set_name": "Github" }
# Copyright (c) 2011 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import abc from oslo_log import log as logging from oslo_serialization import jsonutils import routes import webob import webtest from tacker.api import extensions from tacker.common import config from tacker.plugins.common import constants from tacker.tests import base from tacker.tests.unit import extension_stubs as ext_stubs import tacker.tests.unit.extensions from tacker.tests.unit import testlib_api from tacker import wsgi LOG = logging.getLogger(__name__) extensions_path = ':'.join(tacker.tests.unit.extensions.__path__) class ExtensionsTestApp(wsgi.Router): def __init__(self, options={}): mapper = routes.Mapper() controller = ext_stubs.StubBaseAppController() mapper.resource("dummy_resource", "/dummy_resources", controller=controller) super(ExtensionsTestApp, self).__init__(mapper) class PluginInterfaceTest(base.BaseTestCase): def test_issubclass_hook(self): class A(object): def f(self): pass class B(extensions.PluginInterface): @abc.abstractmethod def f(self): pass self.assertTrue(issubclass(A, B)) def test_issubclass_hook_class_without_abstract_methods(self): class A(object): def f(self): pass class B(extensions.PluginInterface): def f(self): pass self.assertFalse(issubclass(A, B)) def test_issubclass_hook_not_all_methods_implemented(self): class A(object): def f(self): pass class B(extensions.PluginInterface): @abc.abstractmethod def f(self): pass @abc.abstractmethod def g(self): pass self.assertFalse(issubclass(A, B)) class ResourceExtensionTest(base.BaseTestCase): class ResourceExtensionController(wsgi.Controller): def index(self, request): return "resource index" def show(self, request, id): return {'data': {'id': id}} def notimplemented_function(self, request, id): return webob.exc.HTTPNotImplemented() def custom_member_action(self, request, id): return {'member_action': 'value'} def custom_collection_action(self, request, **kwargs): return {'collection': 'value'} class DummySvcPlugin(wsgi.Controller): def get_plugin_type(self): return constants.DUMMY def index(self, request, **kwargs): return "resource index" def custom_member_action(self, request, **kwargs): return {'member_action': 'value'} def collection_action(self, request, **kwargs): return {'collection': 'value'} def show(self, request, id): return {'data': {'id': id}} def test_exceptions_notimplemented(self): controller = self.ResourceExtensionController() member = {'notimplemented_function': "GET"} res_ext = extensions.ResourceExtension('tweedles', controller, member_actions=member) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) # Ideally we would check for a 501 code here but webtest doesn't take # anything that is below 200 or above 400 so we can't actually check # it. It throws webtest.AppError instead. try: test_app.get("/tweedles/some_id/notimplemented_function") # Shouldn't be reached self.assertTrue(False) except webtest.AppError as e: self.assertIn('501', str(e)) def test_resource_can_be_added_as_extension(self): res_ext = extensions.ResourceExtension( 'tweedles', self.ResourceExtensionController()) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) index_response = test_app.get("/tweedles") self.assertEqual(200, index_response.status_int) self.assertEqual(b"resource index", index_response.body) show_response = test_app.get("/tweedles/25266") self.assertEqual({'data': {'id': "25266"}}, show_response.json) def test_resource_gets_prefix_of_plugin(self): class DummySvcPlugin(wsgi.Controller): def index(self, request): return "" def get_plugin_type(self): return constants.DUMMY res_ext = extensions.ResourceExtension( 'tweedles', DummySvcPlugin(), path_prefix="/dummy_svc") test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) index_response = test_app.get("/dummy_svc/tweedles") self.assertEqual(200, index_response.status_int) def test_resource_extension_with_custom_member_action(self): controller = self.ResourceExtensionController() member = {'custom_member_action': "GET"} res_ext = extensions.ResourceExtension('tweedles', controller, member_actions=member) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) response = test_app.get("/tweedles/some_id/custom_member_action") self.assertEqual(200, response.status_int) self.assertEqual("value", jsonutils.loads(response.body)['member_action']) def test_resource_ext_with_custom_member_action_gets_plugin_prefix(self): controller = self.DummySvcPlugin() member = {'custom_member_action': "GET"} collections = {'collection_action': "GET"} res_ext = extensions.ResourceExtension('tweedles', controller, path_prefix="/dummy_svc", member_actions=member, collection_actions=collections) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) response = test_app.get("/dummy_svc/tweedles/1/custom_member_action") self.assertEqual(200, response.status_int) self.assertEqual("value", jsonutils.loads(response.body)['member_action']) response = test_app.get("/dummy_svc/tweedles/collection_action") self.assertEqual(200, response.status_int) self.assertEqual("value", jsonutils.loads(response.body)['collection']) def test_plugin_prefix_with_parent_resource(self): controller = self.DummySvcPlugin() parent = dict(member_name="tenant", collection_name="tenants") member = {'custom_member_action': "GET"} collections = {'collection_action': "GET"} res_ext = extensions.ResourceExtension('tweedles', controller, parent, path_prefix="/dummy_svc", member_actions=member, collection_actions=collections) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) index_response = test_app.get("/dummy_svc/tenants/1/tweedles") self.assertEqual(200, index_response.status_int) response = test_app.get("/dummy_svc/tenants/1/" "tweedles/1/custom_member_action") self.assertEqual(200, response.status_int) self.assertEqual(jsonutils.loads(response.body)['member_action'], "value") response = test_app.get("/dummy_svc/tenants/2/" "tweedles/collection_action") self.assertEqual(200, response.status_int) self.assertEqual("value", jsonutils.loads(response.body)['collection']) def test_resource_extension_for_get_custom_collection_action(self): controller = self.ResourceExtensionController() collections = {'custom_collection_action': "GET"} res_ext = extensions.ResourceExtension('tweedles', controller, collection_actions=collections) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) response = test_app.get("/tweedles/custom_collection_action") self.assertEqual(200, response.status_int) LOG.debug(jsonutils.loads(response.body)) self.assertEqual("value", jsonutils.loads(response.body)['collection']) def test_resource_extension_for_put_custom_collection_action(self): controller = self.ResourceExtensionController() collections = {'custom_collection_action': "PUT"} res_ext = extensions.ResourceExtension('tweedles', controller, collection_actions=collections) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) response = test_app.put("/tweedles/custom_collection_action") self.assertEqual(200, response.status_int) self.assertEqual('value', jsonutils.loads(response.body)['collection']) def test_resource_extension_for_post_custom_collection_action(self): controller = self.ResourceExtensionController() collections = {'custom_collection_action': "POST"} res_ext = extensions.ResourceExtension('tweedles', controller, collection_actions=collections) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) response = test_app.post("/tweedles/custom_collection_action") self.assertEqual(200, response.status_int) self.assertEqual('value', jsonutils.loads(response.body)['collection']) def test_resource_extension_for_delete_custom_collection_action(self): controller = self.ResourceExtensionController() collections = {'custom_collection_action': "DELETE"} res_ext = extensions.ResourceExtension('tweedles', controller, collection_actions=collections) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) response = test_app.delete("/tweedles/custom_collection_action") self.assertEqual(200, response.status_int) self.assertEqual('value', jsonutils.loads(response.body)['collection']) def test_resource_ext_for_formatted_req_on_custom_collection_action(self): controller = self.ResourceExtensionController() collections = {'custom_collection_action': "GET"} res_ext = extensions.ResourceExtension('tweedles', controller, collection_actions=collections) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) response = test_app.get("/tweedles/custom_collection_action.json") self.assertEqual(200, response.status_int) self.assertEqual('value', jsonutils.loads(response.body)['collection']) def test_resource_ext_for_nested_resource_custom_collection_action(self): controller = self.ResourceExtensionController() collections = {'custom_collection_action': "GET"} parent = dict(collection_name='beetles', member_name='beetle') res_ext = extensions.ResourceExtension('tweedles', controller, collection_actions=collections, parent=parent) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) response = test_app.get("/beetles/beetle_id" "/tweedles/custom_collection_action") self.assertEqual(200, response.status_int) self.assertEqual('value', jsonutils.loads(response.body)['collection']) def test_resource_extension_with_custom_member_action_and_attr_map(self): controller = self.ResourceExtensionController() member = {'custom_member_action': "GET"} params = { 'tweedles': { 'id': {'allow_post': False, 'allow_put': False, 'validate': {'type:uuid': None}, 'is_visible': True}, 'name': {'allow_post': True, 'allow_put': True, 'validate': {'type:string': None}, 'default': '', 'is_visible': True}, } } res_ext = extensions.ResourceExtension('tweedles', controller, member_actions=member, attr_map=params) test_app = _setup_extensions_test_app(SimpleExtensionManager(res_ext)) response = test_app.get("/tweedles/some_id/custom_member_action") self.assertEqual(200, response.status_int) self.assertEqual('value', jsonutils.loads(response.body)['member_action']) def test_returns_404_for_non_existent_extension(self): test_app = _setup_extensions_test_app(SimpleExtensionManager(None)) response = test_app.get("/non_extistant_extension", status='*') self.assertEqual(404, response.status_int) class ActionExtensionTest(base.BaseTestCase): def setUp(self): super(ActionExtensionTest, self).setUp() self.skip("Not ready yet") self.extension_app = _setup_extensions_test_app() def test_extended_action_for_adding_extra_data(self): action_name = 'FOXNSOX:add_tweedle' action_params = dict(name='Beetle') req_body = jsonutils.dump_as_bytes({action_name: action_params}) response = self.extension_app.post('/dummy_resources/1/action', req_body, content_type='application/json') self.assertEqual("Tweedle Beetle Added.", response.body) def test_extended_action_for_deleting_extra_data(self): action_name = 'FOXNSOX:delete_tweedle' action_params = dict(name='Bailey') req_body = jsonutils.dump_as_bytes({action_name: action_params}) response = self.extension_app.post("/dummy_resources/1/action", req_body, content_type='application/json') self.assertEqual("Tweedle Bailey Deleted.", response.body) def test_returns_404_for_non_existent_action(self): non_existent_action = 'blah_action' action_params = dict(name="test") req_body = jsonutils.dump_as_bytes( {non_existent_action: action_params}) response = self.extension_app.post("/dummy_resources/1/action", req_body, content_type='application/json', status='*') self.assertEqual(404, response.status_int) def test_returns_404_for_non_existent_resource(self): action_name = 'add_tweedle' action_params = dict(name='Beetle') req_body = jsonutils.dump_as_bytes({action_name: action_params}) response = self.extension_app.post("/asdf/1/action", req_body, content_type='application/json', status='*') self.assertEqual(404, response.status_int) class RequestExtensionTest(base.BaseTestCase): def test_headers_can_be_extended(self): def extend_headers(req, res): assert req.headers['X-NEW-REQUEST-HEADER'] == "sox" res.headers['X-NEW-RESPONSE-HEADER'] = "response_header_data" return res app = self._setup_app_with_request_handler(extend_headers, 'GET') response = app.get("/dummy_resources/1", headers={'X-NEW-REQUEST-HEADER': "sox"}) self.assertEqual("response_header_data", response.headers['X-NEW-RESPONSE-HEADER']) def test_extend_get_resource_response(self): def extend_response_data(req, res): data = jsonutils.loads(res.body) data['FOXNSOX:extended_key'] = req.GET.get('extended_key') res.body = jsonutils.dump_as_bytes(data) return res app = self._setup_app_with_request_handler(extend_response_data, 'GET') response = app.get("/dummy_resources/1?extended_key=extended_data") self.assertEqual(200, response.status_int) response_data = jsonutils.loads(response.body) self.assertEqual('extended_data', response_data['FOXNSOX:extended_key']) self.assertEqual('knox', response_data['fort']) def test_get_resources(self): self.skip("Not ready yet") app = _setup_extensions_test_app() response = app.get("/dummy_resources/1?chewing=newblue") response_data = jsonutils.loads(response.body) self.assertEqual('newblue', response_data['FOXNSOX:googoose']) self.assertEqual("Pig Bands!", response_data['FOXNSOX:big_bands']) def test_edit_previously_uneditable_field(self): def _update_handler(req, res): data = jsonutils.loads(res.body) data['uneditable'] = req.params['uneditable'] res.body = jsonutils.dump_as_bytes(data) return res base_app = webtest.TestApp(setup_base_app(self)) response = base_app.put("/dummy_resources/1", {'uneditable': "new_value"}) self.assertEqual("original_value", response.json['uneditable']) ext_app = self._setup_app_with_request_handler(_update_handler, 'PUT') ext_response = ext_app.put("/dummy_resources/1", {'uneditable': "new_value"}) self.assertEqual("new_value", ext_response.json['uneditable']) def _setup_app_with_request_handler(self, handler, verb): req_ext = extensions.RequestExtension(verb, '/dummy_resources/:(id)', handler) manager = SimpleExtensionManager(None, None, req_ext) return _setup_extensions_test_app(manager) class ExtensionManagerTest(base.BaseTestCase): def test_invalid_extensions_are_not_registered(self): class InvalidExtension(object): """Invalid extension. This Extension doesn't implement extension methods : get_name, get_description, get_namespace and get_updated """ def get_alias(self): return "invalid_extension" ext_mgr = extensions.ExtensionManager('') ext_mgr.add_extension(InvalidExtension()) ext_mgr.add_extension(ext_stubs.StubExtension("valid_extension")) self.assertIn('valid_extension', ext_mgr.extensions) self.assertNotIn('invalid_extension', ext_mgr.extensions) class ExtensionControllerTest(testlib_api.WebTestCase): def setUp(self): super(ExtensionControllerTest, self).setUp() self.skip("Not ready yet") self.test_app = _setup_extensions_test_app() def test_index_gets_all_registerd_extensions(self): response = self.test_app.get("/extensions." + self.fmt) res_body = self.deserialize(response) foxnsox = res_body["extensions"][0] self.assertEqual("FOXNSOX", foxnsox["alias"]) self.assertEqual("http://www.fox.in.socks/api/ext/pie/v1.0", foxnsox["namespace"]) def test_extension_can_be_accessed_by_alias(self): response = self.test_app.get("/extensions/FOXNSOX." + self.fmt) foxnsox_extension = self.deserialize(response) foxnsox_extension = foxnsox_extension['extension'] self.assertEqual("FOXNSOX", foxnsox_extension["alias"]) self.assertEqual("http://www.fox.in.socks/api/ext/pie/v1.0", foxnsox_extension["namespace"]) def test_show_returns_not_found_for_non_existent_extension(self): response = self.test_app.get("/extensions/non_existent" + self.fmt, status="*") self.assertEqual(404, response.status_int) def app_factory(global_conf, **local_conf): conf = global_conf.copy() conf.update(local_conf) return ExtensionsTestApp(conf) def setup_base_app(test): base.BaseTestCase.config_parse() app = config.load_paste_app('extensions_test_app') return app def setup_extensions_middleware(extension_manager=None): extension_manager = (extension_manager or extensions.ExtensionManager(extensions_path)) base.BaseTestCase.config_parse() app = config.load_paste_app('extensions_test_app') return extensions.ExtensionMiddleware(app, ext_mgr=extension_manager) def _setup_extensions_test_app(extension_manager=None): return webtest.TestApp(setup_extensions_middleware(extension_manager)) class SimpleExtensionManager(object): def __init__(self, resource_ext=None, action_ext=None, request_ext=None): self.resource_ext = resource_ext self.action_ext = action_ext self.request_ext = request_ext def get_resources(self): resource_exts = [] if self.resource_ext: resource_exts.append(self.resource_ext) return resource_exts def get_actions(self): action_exts = [] if self.action_ext: action_exts.append(self.action_ext) return action_exts def get_request_extensions(self): request_extensions = [] if self.request_ext: request_extensions.append(self.request_ext) return request_extensions
{ "pile_set_name": "Github" }
<?php namespace Model; /** * Repository of Model\SequenceIdGeneratorDescending document. */ class SequenceIdGeneratorDescendingRepository extends \Model\Base\SequenceIdGeneratorDescendingRepository { }
{ "pile_set_name": "Github" }
<?php namespace AppBundle\Entity\Model; use AppBundle\Entity\Tag; use AppBundle\Service\TagManager; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Util\ClassUtils; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\SerializedName; trait TaggableTrait { protected $tags; protected $tagManager; protected $tagsFast; /** * {@inheritdoc} */ public function getTaggableResourceClass() { return ClassUtils::getClass($this); } /** * {@inheritdoc} */ public function getTags() { if ($this->tags === null) { $this->tags = new ArrayCollection(); if ($this->tagManager) { foreach ($this->tagManager->getTags($this) as $tag) { $this->tags->add($tag); } } } return $this->tags; } /** * @SerializedName("tags") * @Groups({"task"}) */ public function getTagsFast() { if ($this->tagsFast === null) { $this->tagsFast = new ArrayCollection(); if ($this->tagManager) { foreach ($this->tagManager->getTags($this, [ 'cache' => true ]) as $tag) { $this->tagsFast->add($tag); } } } return $this->tagsFast; } public function setTags($tags) { $newTags = null; if (is_object($tags) && $tags instanceof ArrayCollection) { $newTags = $tags; } elseif (is_array($tags)) { $newTags = new ArrayCollection($tags); } else { throw new \InvalidArgumentException('Parameter should be of type array or ArrayCollection'); } if (null !== $this->getId() && null !== $this->tagManager) { $originalTags = $this->getTags(); foreach ($originalTags as $originalTag) { if (!$newTags->contains($originalTag)) { $this->tagManager->removeTag($this, $originalTag); } } foreach ($newTags as $newTag) { if (!$originalTags->contains($newTag)) { $this->tagManager->addTag($this, $newTag); } } } $this->tags = $newTags; } public function setTagManager(TagManager $tagManager) { $this->tagManager = $tagManager; return $this; } }
{ "pile_set_name": "Github" }
import shop shopName = 'the Berkeley Bowl' fruitPrices = {'apples': 1.00, 'oranges': 1.50, 'pears': 1.75} berkeleyShop = shop.FruitShop(shopName, fruitPrices) applePrice = berkeleyShop.getCostPerPound('apples') print(applePrice) print('Apples cost $%.2f at %s.' % (applePrice, shopName)) otherName = 'the Stanford Mall' otherFruitPrices = {'kiwis': 6.00, 'apples': 4.50, 'peaches': 8.75} otherFruitShop = shop.FruitShop(otherName, otherFruitPrices) otherPrice = otherFruitShop.getCostPerPound('apples') print(otherPrice) print('Apples cost $%.2f at %s.' % (otherPrice, otherName)) print("My, that's expensive!")
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>Newtonsoft.Json</id> <version>4.5.11</version> <title>Json.NET</title> <authors>James Newton-King</authors> <owners>James Newton-King</owners> <licenseUrl>http://json.codeplex.com/license</licenseUrl> <projectUrl>http://james.newtonking.com/projects/json-net.aspx</projectUrl> <requireLicenseAcceptance>false</requireLicenseAcceptance> <description>Json.NET is a popular high-performance JSON framework for .NET</description> <language>en-US</language> <tags>json</tags> <references /> </metadata> </package>
{ "pile_set_name": "Github" }
/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */ /*<!--match-->*/ .cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; } .cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; } /*<!--activeline-->*/ .cm-s-midnight .CodeMirror-activeline-background { background: #253540; } .cm-s-midnight.CodeMirror { background: #0F192A; color: #D1EDFF; } .cm-s-midnight.CodeMirror { border-top: 1px solid black; border-bottom: 1px solid black; } .cm-s-midnight div.CodeMirror-selected { background: #314D67; } .cm-s-midnight .CodeMirror-line::selection, .cm-s-midnight .CodeMirror-line > span::selection, .cm-s-midnight .CodeMirror-line > span > span::selection { background: rgba(49, 77, 103, .99); } .cm-s-midnight .CodeMirror-line::-moz-selection, .cm-s-midnight .CodeMirror-line > span::-moz-selection, .cm-s-midnight .CodeMirror-line > span > span::-moz-selection { background: rgba(49, 77, 103, .99); } .cm-s-midnight .CodeMirror-gutters { background: #0F192A; border-right: 1px solid; } .cm-s-midnight .CodeMirror-guttermarker { color: white; } .cm-s-midnight .CodeMirror-guttermarker-subtle { color: #d0d0d0; } .cm-s-midnight .CodeMirror-linenumber { color: #D0D0D0; } .cm-s-midnight .CodeMirror-cursor { border-left: 1px solid #F8F8F0; } .cm-s-midnight span.cm-comment { color: #428BDD; } .cm-s-midnight span.cm-atom { color: #AE81FF; } .cm-s-midnight span.cm-number { color: #D1EDFF; } .cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute { color: #A6E22E; } .cm-s-midnight span.cm-keyword { color: #E83737; } .cm-s-midnight span.cm-string { color: #1DC116; } .cm-s-midnight span.cm-variable { color: #FFAA3E; } .cm-s-midnight span.cm-variable-2 { color: #FFAA3E; } .cm-s-midnight span.cm-def { color: #4DD; } .cm-s-midnight span.cm-bracket { color: #D1EDFF; } .cm-s-midnight span.cm-tag { color: #449; } .cm-s-midnight span.cm-link { color: #AE81FF; } .cm-s-midnight span.cm-error { background: #F92672; color: #F8F8F0; } .cm-s-midnight .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
{ "pile_set_name": "Github" }
# Prometheus Ksonnet A set of extensible configs for running Prometheus on Kubernetes. Usage: - Make sure you have [Tanka](https://tanka.dev/install) and [jsonnet-bundler](https://tanka.dev/install#jsonnet-bundler) installed: - In your config repo, init Tanka and point it at your Kubernetes cluster: ```bash $ tk init # point at cluster $ export CONTEXT=$(kubectl config current-context) $ tk env set environments/default --server-from-context=$CONTEXT ``` - Vendor this package using jsonnet-bundler: ```bash $ jb install github.com/grafana/jsonnet-libs/prometheus-ksonnet ``` - Assuming you want to run in the default namespace ('environment' in Tanka parlance), add the following to the file `environments/default/main.jsonnet`: ```jsonnet local prometheus = import "prometheus-ksonnet/prometheus-ksonnet.libsonnet"; prometheus { _config+:: { cluster_name: "cluster1", namespace: "default", }, } ``` - Apply your config: ```bash $ tk apply environments/default ``` # Kops If you made your Kubernetes cluster with [Kops](https://github.com/kubernetes/kops), add the Kops mixin to your config to scrape the Kubernetes system components: ```jsonnet local prometheus = import "prometheus-ksonnet/prometheus-ksonnet.libsonnet"; local kops = import "prometheus-ksonnet/lib/prometheus-config-kops.libsonnet"; prometheus + kops { _config+:: { namespace: "default", insecureSkipVerify: true, }, } ``` # Customising and Extending. The choice of Tanka for configuring these jobs was intentional; it allows users to easily override setting in these configurations to suit their needs, without having to fork or modify this library. For instance, to override the resource requests and limits for the Prometheus container, you would: ```jsonnet local prometheus = import "prometheus-ksonnet/prometheus-ksonnet.libsonnet"; prometheus { prometheus_container+:: $.util.resourcesRequests("1", "2Gi") + $.util.resourcesLimits("2", "4Gi"), } ``` We sometimes specify config options in a `_config` dict; there are two situations under which we do this: - When you must provide a value for the parameter (such as `namesapce`). - When the parameter get referenced in multiple places, and overriding it using the technique above would be cumbersome and error prone (such as with `cluster_dns_suffix`). We use these two guidelines for when to put parameters in `_config` as otherwise the config field would just become the same as the jobs it declares - and lets not forget, this whole thing is config - so its completely acceptable to override pretty much any of it.
{ "pile_set_name": "Github" }
#' Edit a Data Frame. #' #' Interactively edit a \code{data.frame} or \code{data.table}. The resulting #' code will be emitted as a call to reload the data from a temp RDS file. #' #' This addin can be used to interactively edit. #' The intended way to use this is as follows: #' #' 1. Highlight a symbol naming a \code{data.frame} or \code{data.table} #' in your R session, e.g. \code{mtcars}. #' 2. Execute this addin, to interactively edit it. #' #' When you're done, the code performing this operation will be emitted #' at the cursor position. #' #' This function borrows heavily from \href{rstudio/addinexamples/subsetAddin}{https://github.com/rstudio/addinexamples/blob/master/R/subsetAddin.R} #' #' @export editAddin <- function() { # Get the document context. context <- rstudioapi::getActiveDocumentContext() # Set the default data to use based on the selection. text <- context$selection[[1]]$text defaultData <- text # create a temp file fname = gsub("\\\\", "/", tempfile()) # Generate UI for the gadget. ui <- miniUI::miniPage( miniUI::gadgetTitleBar("Edit a data.frame"), miniUI::miniContentPanel( stableColumnLayout( shiny::textInput("data", "Data", value = defaultData), shiny::radioButtons("outType", "Output type", choices = c("Update original data" = "update", "Print updates to script (no update)" = "print") ) ), shiny::uiOutput("pending"), rHandsontableOutput("hot") ) ) # Server code for the gadget. server <- function(input, output, session) { values = shiny::reactiveValues() setHot = function(x) values[["hot"]] = x reactiveData <- shiny::reactive({ # Collect inputs. dataString <- input$data # Check to see if there is data called 'data', # and access it if possible. if (!nzchar(dataString)) return(errorMessage("data", "No dataset available.")) if (!exists(dataString, envir = .GlobalEnv)) return(errorMessage("data", paste("No dataset named '", dataString, "' available."))) data <- get(dataString, envir = .GlobalEnv) data }) output$pending <- shiny::renderUI({ data <- reactiveData() if (isErrorMessage(data)) htmltools::h4(style = "color: #AA7732;", data$message) }) output$hot <- renderRHandsontable({ data <- reactiveData() if (isErrorMessage(data)) return(NULL) if (is.null(input$hot)) DF = data else DF = hot_to_r(input$hot) setHot(DF) rhandsontable(DF) %>% hot_table(highlightCol = TRUE, highlightRow = TRUE) }) # Listen for 'done'. shiny::observeEvent(input$done, { if (input$outType == "print") { rslt <- capture.output(dput(values[["hot"]])) rstudioapi::insertText(Inf, paste0(input$data, " = ", paste(rslt, collapse = "\n"))) } else { if (nzchar(input$data) && !is.null(values[["hot"]])) { saveRDS(values[["hot"]], fname) code <- paste(input$data, " = readRDS('", fname, "')", sep = "") rstudioapi::sendToConsole(code) } } invisible(shiny::stopApp()) }) } # Use a modal dialog as a viewr. viewer <- shiny::dialogViewer("Edit", width = 1000, height = 800) shiny::runGadget(ui, server, viewer = viewer) } # these functions come from rstudio/addinexamples stableColumnLayout <- function(...) { dots <- list(...) n <- length(dots) width <- 12 / n class <- sprintf("col-xs-%s col-md-%s", width, width) shiny::fluidRow( lapply(dots, function(el) { shiny::div(class = class, el) }) ) } isErrorMessage <- function(object) { inherits(object, "error_message") } errorMessage <- function(type, message) { structure( list(type = type, message = message), class = "error_message" ) }
{ "pile_set_name": "Github" }
settb=1/1000, setpts=1/(35*TB) * (N + 0.05 * sin(N*2*PI/25))
{ "pile_set_name": "Github" }
/* Derby - Class org.apache.derby.iapi.store.raw.AuxObject 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.derby.iapi.store.raw; /** The interface of objects which can be associated with a page while it's in cache. @see Page#setAuxObject */ public interface AuxObject { /** This method is called by the page manager when it's about to evict a page which is holding an aux object, or when a rollback occurred on the page. The aux object should release its resources. The aux object can assume that no one else has access to it via the raw store during this method call. After this method returns the raw store throws away any reference to this object. */ public void auxObjectInvalidated(); }
{ "pile_set_name": "Github" }
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // Dart test for testing access to private fields. part of PrivateTest.dart; String _private2() { return "private2"; } const String _private2Field = "private2Field"; accessFieldA2(_A a) { return a.fieldA; } accessFieldB2(B b) { return b._fieldB; }
{ "pile_set_name": "Github" }
// 26.1.8 Reflect.getPrototypeOf(target) var $export = require('./_export') , getProto = require('./_object-gpo') , anObject = require('./_an-object'); $export($export.S, 'Reflect', { getPrototypeOf: function getPrototypeOf(target){ return getProto(anObject(target)); } });
{ "pile_set_name": "Github" }
// // LKDBProperty+KeyMapping.m // LKDBHelper // // Created by LJH on 13-6-17. // Copyright (c) 2013年 ljh. All rights reserved. // #import "LKDB+Mapping.h" #import "NSObject+LKModel.h" @interface LKModelInfos () { __strong NSMutableDictionary* _proNameDic; __strong NSMutableDictionary* _sqlNameDic; __strong NSArray* _primaryKeys; } - (void)removeWithColumnName:(NSString*)columnName; - (void)addDBPropertyWithType:(NSString*)type cname:(NSString*)column_name ctype:(NSString*)ctype pname:(NSString*)pname ptype:(NSString*)ptype; - (void)updateProperty:(LKDBProperty*)property sqlColumnName:(NSString*)columnName; - (void)updateProperty:(LKDBProperty*)property propertyName:(NSString*)propertyName; @end #pragma mark - 声明属性 @interface LKDBProperty () @property (copy, nonatomic) NSString* type; @property (copy, nonatomic) NSString* sqlColumnName; @property (copy, nonatomic) NSString* sqlColumnType; @property (copy, nonatomic) NSString* propertyName; @property (copy, nonatomic) NSString* propertyType; - (id)initWithType:(NSString*)type cname:(NSString*)cname ctype:(NSString*)ctype pname:(NSString*)pname ptype:(NSString*)ptype; @end #pragma mark - LKDBProperty @implementation LKDBProperty - (id)initWithType:(NSString*)type cname:(NSString*)cname ctype:(NSString*)ctype pname:(NSString*)pname ptype:(NSString*)ptype { self = [super init]; if (self) { _type = [type copy]; _sqlColumnName = [cname copy]; _sqlColumnType = [ctype copy]; _propertyName = [pname copy]; _propertyType = [ptype copy]; } return self; } - (void)enableUserCalculate { _type = LKSQL_Mapping_UserCalculate; } - (BOOL)isUserCalculate { return ([_type isEqualToString:LKSQL_Mapping_UserCalculate] || _propertyName == nil || [_propertyName isEqualToString:LKSQL_Mapping_UserCalculate]); } @end #pragma mark - NSObject - TableMapping @implementation NSObject (TableMapping) + (NSDictionary*)getTableMapping { return nil; } + (void)setUserCalculateForCN:(NSString*)columnName { if ([LKDBUtils checkStringIsEmpty:columnName]) { LKErrorLog(@"columnName is null"); return; } LKModelInfos* infos = [self getModelInfos]; LKDBProperty* property = [infos objectWithSqlColumnName:columnName]; if (property) { [property enableUserCalculate]; } else { [infos addDBPropertyWithType:LKSQL_Mapping_UserCalculate cname:columnName ctype:LKSQL_Type_Text pname:columnName ptype:@"NSString"]; } } + (void)setUserCalculateForPTN:(NSString*)propertyTypeName { if ([LKDBUtils checkStringIsEmpty:propertyTypeName]) { LKErrorLog(@"propertyTypeName is null"); return; } Class clazz = NSClassFromString(propertyTypeName); LKModelInfos* infos = [self getModelInfos]; for (NSInteger i = 0; i < infos.count; i++) { LKDBProperty* property = [infos objectWithIndex:i]; Class p_cls = NSClassFromString(property.propertyType); BOOL isSubClass = ((p_cls && clazz) && [p_cls isSubclassOfClass:clazz]); BOOL isNameEqual = [property.propertyType isEqualToString:propertyTypeName]; if (isSubClass || isNameEqual) { [property enableUserCalculate]; } } } + (void)setTableColumnName:(NSString*)columnName bindingPropertyName:(NSString*)propertyName { if ([LKDBUtils checkStringIsEmpty:columnName] || [LKDBUtils checkStringIsEmpty:propertyName]) return; LKModelInfos* infos = [self getModelInfos]; LKDBProperty* property = [infos objectWithPropertyName:propertyName]; if (property == nil) { return; } LKDBProperty* column = [infos objectWithSqlColumnName:columnName]; if (column) { [infos updateProperty:column propertyName:propertyName]; column.propertyType = property.propertyType; } else if ([property.sqlColumnName isEqualToString:property.propertyName]) { [infos updateProperty:property sqlColumnName:columnName]; } else { [infos addDBPropertyWithType:LKSQL_Mapping_Binding cname:columnName ctype:LKSQL_Type_Text pname:propertyName ptype:property.propertyType]; } } + (void)removePropertyWithColumnNameArray:(NSArray*)columnNameArray { LKModelInfos* infos = [self getModelInfos]; for (NSString* columnName in columnNameArray) { [infos removeWithColumnName:columnName]; } } + (void)removePropertyWithColumnName:(NSString*)columnName { [[self getModelInfos] removeWithColumnName:columnName]; } @end #pragma mark - LKModelInfos @implementation LKModelInfos - (id)initWithKeyMapping:(NSDictionary*)keyMapping propertyNames:(NSArray*)propertyNames propertyType:(NSArray*)propertyType primaryKeys:(NSArray*)primaryKeys { self = [super init]; if (self) { _primaryKeys = [NSArray arrayWithArray:primaryKeys]; _proNameDic = [[NSMutableDictionary alloc] init]; _sqlNameDic = [[NSMutableDictionary alloc] init]; NSString *type, *column_name, *column_type, *property_name, *property_type; if (keyMapping.count > 0) { NSArray* sql_names = keyMapping.allKeys; for (NSInteger i = 0; i < sql_names.count; i++) { type = column_name = column_type = property_name = property_type = nil; column_name = [sql_names objectAtIndex:i]; NSString* mappingValue = [keyMapping objectForKey:column_name]; //如果 设置的 属性名 是空白的 自动转成 使用ColumnName if ([LKDBUtils checkStringIsEmpty:mappingValue]) { NSLog(@"#ERROR sql column name %@ mapping value is empty,automatically converted LKDBInherit", column_name); mappingValue = LKSQL_Mapping_Inherit; } if ([mappingValue isEqualToString:LKSQL_Mapping_UserCalculate]) { type = LKSQL_Mapping_UserCalculate; column_type = LKSQL_Type_Text; } else { if ([mappingValue isEqualToString:LKSQL_Mapping_Inherit] || [mappingValue isEqualToString:LKSQL_Mapping_Binding]) { type = LKSQL_Mapping_Inherit; property_name = column_name; } else { type = LKSQL_Mapping_Binding; property_name = mappingValue; } NSUInteger index = [propertyNames indexOfObject:property_name]; NSAssert(index != NSNotFound, @"#ERROR TableMapping SQL column name %@ not fount %@ property name", column_name, property_name); property_type = [propertyType objectAtIndex:index]; column_type = LKSQLTypeFromObjcType(property_type); } [self addDBPropertyWithType:type cname:column_name ctype:column_type pname:property_name ptype:property_type]; } } else { for (NSInteger i = 0; i < propertyNames.count; i++) { type = LKSQL_Mapping_Inherit; property_name = [propertyNames objectAtIndex:i]; column_name = property_name; property_type = [propertyType objectAtIndex:i]; column_type = LKSQLTypeFromObjcType(property_type); [self addDBPropertyWithType:type cname:column_name ctype:column_type pname:property_name ptype:property_type]; } } if (_primaryKeys.count == 0) { _primaryKeys = [NSArray arrayWithObject:@"rowid"]; } for (NSString* pkname in _primaryKeys) { if ([pkname.lowercaseString isEqualToString:@"rowid"]) { if ([self objectWithSqlColumnName:pkname] == nil) { [self addDBPropertyWithType:LKSQL_Mapping_Inherit cname:pkname ctype:LKSQL_Type_Int pname:pkname ptype:@"int"]; } } } } return self; } - (void)addDBPropertyWithType:(NSString*)type cname:(NSString*)column_name ctype:(NSString*)ctype pname:(NSString*)pname ptype:(NSString*)ptype { LKDBProperty* db_property = [[LKDBProperty alloc] initWithType:type cname:column_name ctype:ctype pname:pname ptype:ptype]; if (db_property.propertyName) { [_proNameDic setObject:db_property forKey:db_property.propertyName]; } if (db_property.sqlColumnName) { [_sqlNameDic setObject:db_property forKey:db_property.sqlColumnName]; } } - (NSArray*)primaryKeys { return _primaryKeys; } - (NSUInteger)count { return _sqlNameDic.count; } - (LKDBProperty*)objectWithIndex:(NSInteger)index { if (index < _sqlNameDic.count) { id key = [_sqlNameDic.allKeys objectAtIndex:index]; return [_sqlNameDic objectForKey:key]; } return nil; } - (LKDBProperty*)objectWithPropertyName:(NSString*)propertyName { return [_proNameDic objectForKey:propertyName]; } - (LKDBProperty*)objectWithSqlColumnName:(NSString*)columnName { return [_sqlNameDic objectForKey:columnName]; } - (void)updateProperty:(LKDBProperty*)property propertyName:(NSString*)propertyName { [_proNameDic removeObjectForKey:property.propertyName]; property.propertyName = propertyName; [_proNameDic setObject:property forKey:propertyName]; } - (void)updateProperty:(LKDBProperty*)property sqlColumnName:(NSString*)columnName { [_sqlNameDic removeObjectForKey:property.sqlColumnName]; property.sqlColumnName = columnName; [_sqlNameDic setObject:property forKey:columnName]; } - (void)removeWithColumnName:(NSString*)columnName { if ([LKDBUtils checkStringIsEmpty:columnName]) return; LKDBProperty* property = [_sqlNameDic objectForKey:columnName]; if (property.propertyName) { [_proNameDic removeObjectForKey:property.propertyName]; } [_sqlNameDic removeObjectForKey:columnName]; } @end
{ "pile_set_name": "Github" }
{ "description": "Checks that tethering internet initialized and answers for AT commands", "nodes": [ { "id": "B1xhXPIHU", "position": { "units": "slots", "x": 1, "y": 1 }, "type": "xod/patch-nodes/not-implemented-in-xod" }, { "description": "Pulses when answer received", "id": "H10rNPLH8", "label": "OK", "position": { "units": "slots", "x": 1, "y": 2 }, "type": "xod/patch-nodes/output-pulse" }, { "boundLiterals": { "__out__": "On Boot" }, "description": "Perform the check", "id": "HyciQvUSU", "label": "KICK", "position": { "units": "slots", "x": 3, "y": 0 }, "type": "xod/patch-nodes/input-pulse" }, { "id": "HylC-CP0SI", "position": { "units": "slots", "x": 3, "y": 1 }, "type": "xod/patch-nodes/utility" }, { "description": "A tethering internet", "id": "rJac7vUHI", "label": "INET", "position": { "units": "slots", "x": 1, "y": 0 }, "type": "@/input-tethering-inet" } ] }
{ "pile_set_name": "Github" }
<?php /** * Admin Maintenance Controller * * PHP version 7 * * Copyright (C) Villanova University 2010. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org Main Site */ namespace VuFindAdmin\Controller; /** * Class helps maintain database * * @category VuFind * @package Controller * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org Main Site */ class MaintenanceController extends AbstractAdmin { /** * System Maintenance * * @return \Laminas\View\Model\ViewModel */ public function homeAction() { $view = $this->createViewModel(); $view->caches = $this->serviceLocator->get(\VuFind\Cache\Manager::class) ->getCacheList(); $view->setTemplate('admin/maintenance/home'); return $view; } /** * Clear cache(s). * * @return mixed */ public function clearcacheAction() { $cacheManager = $this->serviceLocator->get(\VuFind\Cache\Manager::class); foreach ($this->params()->fromQuery('cache', []) as $cache) { $cacheManager->getCache($cache)->flush(); } // If cache is unset, we didn't go through the loop above, so no message // needs to be displayed. if (isset($cache)) { $this->flashMessenger()->addMessage('Cache(s) cleared.', 'success'); } return $this->forwardTo('AdminMaintenance', 'Home'); } /** * Delete expired searches. * * @return mixed */ public function deleteexpiredsearchesAction() { // Delete the expired searches--this cleans up any junk left in the // database from old search histories that were not caught by the // session garbage collector. return $this->expire( 'Search', '%%count%% expired searches deleted.', 'No expired searches to delete.' ); } /** * Delete expired sessions. * * @return mixed */ public function deleteexpiredsessionsAction() { // Delete the expired sessions--this cleans up any junk left in the // database by the session garbage collector. return $this->expire( 'Session', '%%count%% expired sessions deleted.', 'No expired sessions to delete.' ); } /** * Abstract delete method. * * @param string $table Table to operate on. * @param string $successString String for reporting success. * @param string $failString String for reporting failure. * @param int $minAge Minimum age allowed for expiration (also used * as default value). * * @return mixed */ protected function expire($table, $successString, $failString, $minAge = 2) { $daysOld = intval($this->params()->fromQuery('daysOld', $minAge)); if ($daysOld < $minAge) { $this->flashMessenger()->addMessage( str_replace( '%%age%%', $minAge, 'Expiration age must be at least %%age%% days.' ), 'error' ); } else { $search = $this->getTable($table); if (!method_exists($search, 'getExpiredQuery')) { throw new \Exception($table . ' does not support getExpiredQuery()'); } $query = $search->getExpiredQuery($daysOld); if (($count = count($search->select($query))) == 0) { $msg = $failString; } else { $search->delete($query); $msg = str_replace('%%count%%', $count, $successString); } $this->flashMessenger()->addMessage($msg, 'success'); } return $this->forwardTo('AdminMaintenance', 'Home'); } }
{ "pile_set_name": "Github" }
//System Includes #include <thread> #include <memory> #include <functional> //Project Includes #include <restbed> //External Includes #include <catch.hpp> //System Namespaces using std::thread; using std::shared_ptr; using std::make_shared; //Project Namespaces using namespace restbed; //External Namespaces void get_handler( const shared_ptr< Session > session ) { session->close( 200 ); } TEST_CASE( "content length present on empty response body", "[response]" ) { auto resource = make_shared< Resource >( ); resource->set_path( "test" ); resource->set_method_handler( "GET", get_handler ); auto settings = make_shared< Settings >( ); settings->set_port( 1984 ); shared_ptr< thread > worker = nullptr; Service service; service.publish( resource ); service.set_ready_handler( [ &worker ]( Service & service ) { worker = make_shared< thread >( [ &service ] ( ) { auto request = make_shared< Request >( ); request->set_method( "GET" ); request->set_port( 1984 ); request->set_host( "localhost" ); request->set_path( "/test" ); auto response = Http::sync( request ); REQUIRE( 200 == response->get_status_code( ) ); auto headers = response->get_headers( ); REQUIRE( headers.end( ) == headers.find( "Content-Length" ) ); service.stop( ); } ); } ); service.start( settings ); worker->join( ); }
{ "pile_set_name": "Github" }
<?php defined('IN_PHPCMS') or exit('No permission resources.'); pc_base::load_sys_class('model', '', 0); class admin_model extends model { public function __construct() { $this->db_config = pc_base::load_config('database'); $this->db_setting = 'default'; $this->table_name = 'admin'; parent::__construct(); } } ?>
{ "pile_set_name": "Github" }
websocket
{ "pile_set_name": "Github" }
// Copyright (c) 2011 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. // Streams classes. // // These memory-resident streams are used for serializing data into a sequential // region of memory. // Streams are divided into SourceStreams for reading and SinkStreams for // writing. Streams are aggregated into Sets which allows several streams to be // used at once. Example: we can write A1, B1, A2, B2 but achieve the memory // layout A1 A2 B1 B2 by writing 'A's to one stream and 'B's to another. #ifndef COURGETTE_STREAMS_H_ #define COURGETTE_STREAMS_H_ #include <stdio.h> // for FILE* #include <string> #include "base/basictypes.h" #include "base/compiler_specific.h" #include "courgette/memory_allocator.h" #include "courgette/region.h" namespace courgette { class SourceStream; class SinkStream; // Maximum number of streams in a stream set. static const unsigned int kMaxStreams = 10; // A SourceStream allows a region of memory to be scanned by a sequence of Read // operations. The stream does not own the memory. class SourceStream { public: SourceStream() : start_(NULL), end_(NULL), current_(NULL) {} // Initializes the SourceStream to yield the bytes at |pointer|. The caller // still owns the memory at |pointer| and should free the memory only after // the last use of the stream. void Init(const void* pointer, size_t length) { start_ = static_cast<const uint8*>(pointer); end_ = start_ + length; current_ = start_; } // Initializes the SourceStream to yield the bytes in |region|. The caller // still owns the memory at |region| and should free the memory only after // the last use of the stream. void Init(const Region& region) { Init(region.start(), region.length()); } // Initializes the SourceStream to yield the bytes in |string|. The caller // still owns the memory at |string| and should free the memory only after // the last use of the stream. void Init(const std::string& string) { Init(string.c_str(), string.size()); } // Initializes the SourceStream to yield the bytes written to |sink|. |sink| // still owns the memory, so needs to outlive |this|. |sink| should not be // written to after |this| is initialized. void Init(const SinkStream& sink); // Returns number of bytes remaining to be read from stream. size_t Remaining() const { return end_ - current_; } // Returns initial length of stream before any data consumed by reading. size_t OriginalLength() const { return end_ - start_; } const uint8* Buffer() const { return current_; } bool Empty() const { return current_ == end_; } // Copies bytes from stream to memory at |destination|. Returns 'false' if // insufficient data to satisfy request. bool Read(void* destination, size_t byte_count); // Reads a varint formatted unsigned integer from stream. Returns 'false' if // the read failed due to insufficient data or malformed Varint32. bool ReadVarint32(uint32* output_value); // Reads a varint formatted signed integer from stream. Returns 'false' if // the read failed due to insufficient data or malformed Varint32. bool ReadVarint32Signed(int32* output_value); // Initializes |substream| to yield |length| bytes from |this| stream, // starting at |offset| bytes from the current position. Returns 'false' if // there are insufficient bytes in |this| stream. bool ShareSubstream(size_t offset, size_t length, SourceStream* substream); // Initializes |substream| to yield |length| bytes from |this| stream, // starting at the current position. Returns 'false' if there are // insufficient bytes in |this| stream. bool ShareSubstream(size_t length, SourceStream* substream) { return ShareSubstream(0, length, substream); } // Reads |length| bytes from |this| stream. Initializes |substream| to yield // the bytes. Returns 'false' if there are insufficient bytes in |this| // stream. bool ReadSubstream(size_t length, SourceStream* substream); // Skips over bytes. Returns 'false' if insufficient data to satisfy request. bool Skip(size_t byte_count); private: const uint8* start_; // Points to start of buffer. const uint8* end_; // Points to first location after buffer. const uint8* current_; // Points into buffer at current read location. DISALLOW_COPY_AND_ASSIGN(SourceStream); }; // A SinkStream accumulates writes into a buffer that it owns. The stream is // initially in an 'accumulating' state where writes are permitted. Accessing // the buffer moves the stream into a 'locked' state where no more writes are // permitted. The stream may also be in a 'retired' state where the buffer // contents are no longer available. class SinkStream { public: SinkStream() {} ~SinkStream() {} // Appends |byte_count| bytes from |data| to the stream. CheckBool Write(const void* data, size_t byte_count) WARN_UNUSED_RESULT; // Appends the 'varint32' encoding of |value| to the stream. CheckBool WriteVarint32(uint32 value) WARN_UNUSED_RESULT; // Appends the 'varint32' encoding of |value| to the stream. CheckBool WriteVarint32Signed(int32 value) WARN_UNUSED_RESULT; // Appends the 'varint32' encoding of |value| to the stream. // On platforms where sizeof(size_t) != sizeof(int32), do a safety check. CheckBool WriteSizeVarint32(size_t value) WARN_UNUSED_RESULT; // Contents of |other| are appended to |this| stream. The |other| stream // becomes retired. CheckBool Append(SinkStream* other) WARN_UNUSED_RESULT; // Returns the number of bytes in this SinkStream size_t Length() const { return buffer_.size(); } // Returns a pointer to contiguously allocated Length() bytes in the stream. // Writing to the stream invalidates the pointer. The SinkStream continues to // own the memory. const uint8* Buffer() const { return reinterpret_cast<const uint8*>(buffer_.data()); } // Hints that the stream will grow by an additional |length| bytes. // Caller must be prepared to handle memory allocation problems. CheckBool Reserve(size_t length) WARN_UNUSED_RESULT { return buffer_.reserve(length + buffer_.size()); } // Finished with this stream and any storage it has. void Retire(); private: NoThrowBuffer<char> buffer_; DISALLOW_COPY_AND_ASSIGN(SinkStream); }; // A SourceStreamSet is a set of SourceStreams. class SourceStreamSet { public: SourceStreamSet(); ~SourceStreamSet(); // Initializes the SourceStreamSet with the stream data in memory at |source|. // The caller continues to own the memory and should not modify or free the // memory until the SourceStreamSet destructor has been called. // // The layout of the streams are as written by SinkStreamSet::CopyTo. // Init returns 'false' if the layout is inconsistent with |byte_count|. bool Init(const void* source, size_t byte_count); // Initializes |this| from |source|. The caller continues to own the memory // because it continues to be owned by |source|. bool Init(SourceStream* source); // Returns a pointer to one of the sub-streams. SourceStream* stream(size_t id) { return id < count_ ? &streams_[id] : NULL; } // Initialize |set| from |this|. bool ReadSet(SourceStreamSet* set); // Returns 'true' if all streams are completely consumed. bool Empty() const; private: size_t count_; SourceStream streams_[kMaxStreams]; DISALLOW_COPY_AND_ASSIGN(SourceStreamSet); }; // A SinkStreamSet is a set of SinkStreams. Data is collected by writing to the // component streams. When data collection is complete, it is destructively // transferred, either by flattening into one stream (CopyTo), or transfering // data pairwise into another SinkStreamSet by calling that SinkStreamSet's // WriteSet method. class SinkStreamSet { public: SinkStreamSet(); ~SinkStreamSet(); // Initializes the SinkStreamSet to have |stream_index_limit| streams. Must // be <= kMaxStreams. If Init is not called the default is has kMaxStream. void Init(size_t stream_index_limit); // Returns a pointer to a substream. SinkStream* stream(size_t id) { return id < count_ ? &streams_[id] : NULL; } // CopyTo serializes the streams in this SinkStreamSet into a single target // stream. The serialized format may be re-read by initializing a // SourceStreamSet with a buffer containing the data. CheckBool CopyTo(SinkStream* combined_stream) WARN_UNUSED_RESULT; // Writes the streams of |set| into the corresponding streams of |this|. // Stream zero first has some metadata written to it. |set| becomes retired. // Partner to SourceStreamSet::ReadSet. CheckBool WriteSet(SinkStreamSet* set) WARN_UNUSED_RESULT; private: CheckBool CopyHeaderTo(SinkStream* stream) WARN_UNUSED_RESULT; size_t count_; SinkStream streams_[kMaxStreams]; DISALLOW_COPY_AND_ASSIGN(SinkStreamSet); }; } // namespace #endif // COURGETTE_STREAMS_H_
{ "pile_set_name": "Github" }
<#-- 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. --> <html> <head> <title>FreeMarker: Number Literal Test</title> </head> <body> <#assign hash = {"1" : "one", "12" : "twelve", "2one" : "two-one", "one2" : "one-two"} list = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve"], foo = "bar", one = "one", "1" = "one", "12" = "twelve", "2one" = "two-one", "one2" = "one-two", call = "freemarker.test.templatesuite.models.SimpleTestMethod"?new() > <p>A simple test follows:</p> <p>${message}</p> <p>Now perform a number assignment:</p> #{1.300000?double} <#assign mynumber = 1.8, USA="en_US" /> <#assign myfloat = mynumber?float /> My number is: ${mynumber} <#setting locale="en_US"> My float is: #{myfloat ; m6} The int part is: ${myfloat?int} <#assign mymessage = mynumber?string> ${mymessage + 3} <p>Now use numbers in assignment</p> <#assign mymessage = 1 + 5> ${mymessage} <#assign mymessage = mymessage + 2> #{mymessage} <p>Try numbers in tests</p> <#if (mymessage == 152)> MyMessage is 152 <#else> MyMessage is not 152, its: ${mymessage}. </#if > <if (mymessage > 5)> MyMessage is greater than five. </if <#switch mymessage> <#case 1> MyMessage is one <#break> <#case 15> MyMessage is fifteen <#break> <#case 152> MyMessage is one-five-two <#break> <#default> MyMessage is: ${mymessage}. <#break> </#switch> <p>Now for numbers in dynamic keys:</p> <#assign one = 1> <#assign two = 2> ${list[ 1 ]} ${list[ 1 + 2 ]} <p>Numbers in hashes:</p> ${hash[ 1 + "2" ]} ${hash[ "1" + 2 ]} ${hash[ "1" + two ]} <p>Numbers in method calls:</p> ${call( 1 )} ${call( one )} ${call( one + "2" )} ${call( one + 2 )} ${call( 1 + 2 )} </body> </html>
{ "pile_set_name": "Github" }
WEBVTT 00:00:19.419 --> 00:00:24.925 <c.magenta>制作现代化Cocoa应用</c> 00:00:35.235 --> 00:00:38.071 <c.magenta>大家好 欢迎来到</c> <c.magenta>“制作现代化Cocoa应用”</c> 00:00:38.438 --> 00:00:39.473 <c.magenta>我是Corbin Dunn</c> 00:00:39.540 --> 00:00:41.975 <c.magenta>我将和同事Jeff一起来做本次演讲</c> 00:00:42.042 --> 00:00:43.977 <c.magenta>我们都是AppKit的软件工程师</c> 00:00:44.545 --> 00:00:47.080 <c.magenta>让我们直入正题</c> <c.magenta>今天我们将会讨论什么呢?</c> 00:00:47.147 --> 00:00:49.082 <c.magenta>我们将涉及一大捆的话题</c> 00:00:49.149 --> 00:00:51.251 <c.magenta>我们来谈论下</c> <c.magenta>创建一个现代化外观</c> 00:00:51.318 --> 00:00:55.455 <c.magenta>如何正确拖放</c> <c.magenta>容器视图控制 表视图</c> 00:00:55.989 --> 00:00:59.293 <c.magenta>使用系统外观</c> <c.magenta>storyboard设计</c> 00:00:59.359 --> 00:01:01.161 <c.magenta>和其他一些酷酷的Mac特性</c> 00:00:59.359 --> 00:01:01.161 <c.magenta>和其他一些酷酷的Mac特性</c> 00:01:01.361 --> 00:01:02.429 <c.magenta>非常多的东西</c> 00:01:02.796 --> 00:01:05.232 <c.magenta>我们快速通过一个演示应用来强调</c> 00:01:05.299 --> 00:01:06.800 <c.magenta>就像我们看到的这个截图</c> 00:01:07.267 --> 00:01:10.337 <c.magenta>它如何使用新特性或者</c> <c.magenta>如何使用已存在的特性</c> 00:01:11.772 --> 00:01:13.874 <c.magenta>所有的这些技术</c> 00:01:14.107 --> 00:01:18.345 <c.magenta>大多数你早已可在MacOSX 10.10</c> <c.magenta>或10.11使用了</c> 00:01:18.612 --> 00:01:22.749 <c.magenta>10.12中的</c> <c.magenta>任何新技术我们都会重点指出</c> 00:01:23.217 --> 00:01:25.619 <c.magenta>关于这个演示应用</c> <c.magenta>我们希望你能下载</c> 00:01:25.686 --> 00:01:27.988 <c.magenta>尽管这个应用还不能下载</c> <c.magenta>不过很快就可以</c> 00:01:28.055 --> 00:01:29.723 <c.magenta>并且该应用和这次演讲有关联</c> 00:01:31.058 --> 00:01:32.626 <c.magenta>让我们进入正题</c> 00:01:32.693 --> 00:01:35.829 <c.magenta>讨论一下如何用现代化视图</c> 00:01:35.896 --> 00:01:38.232 <c.magenta>构建一个现代化外观并且你可以做什么</c> 00:01:39.733 --> 00:01:43.504 <c.magenta>现代化外观意味着现代化窗口</c> <c.magenta>和现代化工具栏</c> 00:01:43.737 --> 00:01:45.606 <c.magenta>就像这里展示的演示应用</c> 00:01:46.640 --> 00:01:50.777 <c.magenta>其中一个你需要做的是</c> <c.magenta>使用全尺寸内容视图</c> 00:01:51.345 --> 00:01:53.046 <c.magenta>这个全尺寸内容视图</c> 00:01:53.514 --> 00:01:55.482 <c.magenta>允许你的内容视图进行延伸</c> 00:01:55.749 --> 00:01:59.286 <c.magenta>在工具栏下面的区域</c> <c.magenta>这里我用白色标记强调</c> 00:01:59.686 --> 00:02:03.257 <c.magenta>这意味着全尺寸内容视图</c> 00:01:59.686 --> 00:02:03.257 <c.magenta>这意味着全尺寸内容视图</c> 00:02:03.323 --> 00:02:06.093 <c.magenta>自动地在工具栏和标题栏旁模糊</c> 00:02:06.226 --> 00:02:07.928 <c.magenta>不需要你做任何事</c> 00:02:09.463 --> 00:02:11.832 <c.magenta>使用全尺寸内容视图非常简单</c> 00:02:12.032 --> 00:02:13.600 <c.magenta>只是一个窗口样式的掩码</c> 00:02:13.667 --> 00:02:17.137 <c.magenta>你可以使用.fullSizeContentView位</c> <c.magenta>设置它</c> 00:02:18.005 --> 00:02:19.806 <c.magenta>或若你使用</c> <c.magenta>Interface Builder</c> 00:02:19.873 --> 00:02:23.210 <c.magenta>你可直接在勾选框中的</c> <c.magenta>全尺寸内容视图上打勾 就可应用它了</c> 00:02:24.912 --> 00:02:27.181 <c.magenta>所以如果你要使用全尺寸内容视图</c> 00:02:27.681 --> 00:02:31.552 <c.magenta>你可能需要抵消在它下面的内容</c> 00:02:32.286 --> 00:02:33.954 <c.magenta>例如 假如说</c> 00:02:34.655 --> 00:02:37.524 <c.magenta>我们想让一些东西在工具栏</c> <c.magenta>或者标题栏下面</c> 00:02:38.392 --> 00:02:40.394 <c.magenta>我们可能会</c> 00:02:41.195 --> 00:02:42.429 <c.magenta>在那里放一个标签或什么</c> 00:02:43.797 --> 00:02:45.666 <c.magenta>若我们想把标签放那里</c> <c.magenta>如何来完成</c> 00:02:45.866 --> 00:02:47.734 <c.magenta>在工具栏或标题栏下面</c> 00:02:47.801 --> 00:02:50.737 <c.magenta>如果有 比如</c> <c.magenta>动态高度改变</c> 00:02:51.572 --> 00:02:55.309 <c.magenta>并且我们不想让这个标签拥有</c> <c.magenta>一个写死的Y位移</c> 00:02:55.375 --> 00:02:57.544 <c.magenta>因为写死的位移</c> <c.magenta>实在是太糟糕了</c> 00:02:58.612 --> 00:03:00.247 <c.magenta>所以我们要的是</c> 00:02:58.612 --> 00:03:00.247 <c.magenta>所以我们要的是</c> 00:03:00.447 --> 00:03:02.616 <c.magenta>NSWindow的</c> <c.magenta>contentLayoutRect属性</c> 00:03:03.116 --> 00:03:06.553 <c.magenta>这是一个可观测的键值</c> <c.magenta>一个可观测的KVO属性</c> 00:03:07.020 --> 00:03:09.756 <c.magenta>任何时候你可用它发现</c> <c.magenta>contentLayoutRect</c> 00:03:09.823 --> 00:03:11.658 <c.magenta>蓝绿色的区域改变</c> 00:03:12.192 --> 00:03:14.228 <c.magenta>在这基础上 你可以把你的视图</c> 00:03:14.294 --> 00:03:16.129 <c.magenta>直接放到标题栏或工具栏下面</c> 00:03:18.165 --> 00:03:20.734 <c.magenta>但是我们也鼓励使用自动布局</c> 00:03:20.801 --> 00:03:22.236 <c.magenta>并且如果你使用自动布局</c> 00:03:22.736 --> 00:03:26.507 <c.magenta>你可以使用contentLayoutGuide</c> <c.magenta>一个NSWindow上的属性</c> 00:03:27.574 --> 00:03:30.844 <c.magenta>例如 在NSViewController子类里</c> 00:03:30.911 --> 00:03:33.680 <c.magenta>你可能重写updateViewConstraints</c> 00:03:34.281 --> 00:03:35.883 <c.magenta>并且你想创建一个约束</c> 00:03:36.049 --> 00:03:38.318 <c.magenta>你得到window的</c> <c.magenta>contentLayoutGuide</c> 00:03:39.219 --> 00:03:42.289 <c.magenta>为它标记上锚点</c> <c.magenta>并且你会得到一个文本区域</c> 00:03:42.756 --> 00:03:45.425 <c.magenta>然后应该创建了一个约束</c> 00:03:45.592 --> 00:03:49.229 <c.magenta>在这个文本区域的顶部锚点</c> <c.magenta>并且激活它</c> 00:03:49.796 --> 00:03:50.964 <c.magenta>如果你这样做</c> 00:03:51.031 --> 00:03:54.635 <c.magenta>在文本视图会自动</c> <c.magenta>在标题栏或者工具栏下面的区域</c> 00:03:54.902 --> 00:03:56.436 <c.magenta>不用你做任何事</c> 00:03:56.837 --> 00:03:58.005 <c.magenta>十分容易</c> 00:03:59.773 --> 00:04:04.611 <c.magenta>接下来 关于现代化的应用</c> <c.magenta>你该用一个流线型工具栏</c> 00:03:59.773 --> 00:04:04.611 <c.magenta>接下来 关于现代化的应用</c> <c.magenta>你该用一个流线型工具栏</c> 00:04:05.145 --> 00:04:07.648 <c.magenta>这是一个常规应用的截图</c> 00:04:08.182 --> 00:04:11.451 <c.magenta>值得注意的是这里有一个明显标题栏</c> 00:04:11.652 --> 00:04:14.388 <c.magenta>或者 抱歉</c> <c.magenta>它在顶部有一个明显的标题</c> 00:04:14.855 --> 00:04:16.490 <c.magenta>并且在那应该有一个图标</c> 00:04:16.557 --> 00:04:18.725 <c.magenta>若这个应用确实有一个</c> <c.magenta>关于这个文档的图标</c> 00:04:19.593 --> 00:04:23.530 <c.magenta>如果使用一个流线型的工具栏</c> <c.magenta>那个标题会消失</c> 00:04:24.464 --> 00:04:26.500 <c.magenta>这个工具栏将会向上移动一点</c> 00:04:27.201 --> 00:04:30.003 <c.magenta>并且窗口按钮 关闭按钮等等</c> 00:04:30.737 --> 00:04:33.373 <c.magenta>会和标题栏或者工具栏区域</c> <c.magenta>在一条直线上</c> 00:04:34.675 --> 00:04:37.010 <c.magenta>做到这些十分容易</c> 00:04:37.277 --> 00:04:40.714 <c.magenta>你需要做的仅仅是设置一下标题的</c> <c.magenta>visibility属性</c> 00:04:40.981 --> 00:04:41.915 <c.magenta>为.hidden</c> 00:04:42.349 --> 00:04:43.717 <c.magenta>那么标题将会被隐藏</c> 00:04:43.984 --> 00:04:46.687 <c.magenta>工具栏将会被向上推</c> <c.magenta>并且所有的东西都会在一条线上</c> 00:04:47.054 --> 00:04:47.888 <c.magenta>你何时想做这些?</c> 00:04:47.955 --> 00:04:51.325 <c.magenta>你可能想为应用做这些</c> <c.magenta>例如shoebox应用</c> 00:04:51.391 --> 00:04:53.760 <c.magenta>例如地图 日历</c> 00:04:53.961 --> 00:04:56.864 <c.magenta>系统设置 具有这类属性</c> 00:04:56.930 --> 00:05:00.934 <c.magenta>像是这些一个窗口的应用</c> <c.magenta>都非常适用这种风格</c> 00:04:56.930 --> 00:05:00.934 <c.magenta>像是这些一个窗口的应用</c> <c.magenta>都非常适用这种风格</c> 00:05:03.670 --> 00:05:08.742 <c.magenta>还有其他的事可以做吗?</c> <c.magenta>好吧 你也许想完善</c> 00:05:08.909 --> 00:05:10.644 <c.magenta>标题栏或工具栏的区域</c> 00:05:10.711 --> 00:05:12.679 <c.magenta>用辅助视图控制器</c> 00:05:13.347 --> 00:05:14.214 <c.magenta>例如</c> 00:05:14.748 --> 00:05:17.084 <c.magenta>你可能想有一个辅助视图控制器</c> 00:05:17.150 --> 00:05:18.952 <c.magenta>就在标题栏下面</c> 00:05:19.586 --> 00:05:22.623 <c.magenta>通过这样做你想让它自动变模糊</c> 00:05:22.689 --> 00:05:24.224 <c.magenta>你不用做任何事</c> 00:05:24.725 --> 00:05:27.861 <c.magenta>尺寸将会跟随窗口的尺寸自动改变</c> 00:05:28.629 --> 00:05:31.064 <c.magenta>不需要你做任何事</c> <c.magenta>如何做到这些?</c> 00:05:32.132 --> 00:05:35.002 <c.magenta>这十分简单</c> <c.magenta>我们有一个视图控制器子类</c> 00:05:35.169 --> 00:05:37.871 <c.magenta>叫做NSTitlebar</c> <c.magenta>AccessoryViewController</c> 00:05:38.472 --> 00:05:40.440 <c.magenta>你可以给这个视图控制器</c> <c.magenta>设置视图</c> 00:05:40.807 --> 00:05:43.076 <c.magenta>除此之外</c> <c.magenta>它还暴露了一个布局属性</c> 00:05:43.577 --> 00:05:46.780 <c.magenta>所以布局属性可被</c> <c.magenta>设置为.bottom 意思是</c> 00:05:46.847 --> 00:05:50.317 <c.magenta>这个辅助将会在标题区域的底部</c> 00:05:51.084 --> 00:05:53.620 <c.magenta>注意出现在它下面的文本因为</c> 00:05:53.687 --> 00:05:57.191 <c.magenta>我们使用符合内容布局指导的</c> <c.magenta>合适的内容布局</c> 00:05:57.424 --> 00:05:58.792 <c.magenta>不需要做任何事</c> 00:06:00.427 --> 00:06:01.662 <c.magenta>除了设置在底部</c> 00:06:02.429 --> 00:06:05.666 <c.magenta>布局属性还可以设置在leading</c> <c.magenta>或者trailing</c> 00:06:06.166 --> 00:06:10.637 <c.magenta>意思是你可以有一个</c> <c.magenta>辅助视图控制器在标题区域上面</c> 00:06:10.971 --> 00:06:13.140 <c.magenta>例如一个注册按钮</c> 00:06:13.207 --> 00:06:15.275 <c.magenta>或者其它你想添加的</c> 00:06:15.976 --> 00:06:19.780 <c.magenta>macOS X 10.12上的新特性是</c> <c.magenta>使用leading和trailing的能力</c> 00:06:20.180 --> 00:06:23.317 <c.magenta>和之前发布的</c> <c.magenta>left和right相反</c> 00:06:24.017 --> 00:06:27.921 <c.magenta>我们更推荐你使用leading和trailing</c> <c.magenta>因为它让你窗口运作得更好</c> 00:06:28.155 --> 00:06:30.757 <c.magenta>当你使用从右到左的本地化</c> 00:06:31.191 --> 00:06:32.059 <c.magenta>这样 例如</c> 00:06:32.125 --> 00:06:34.828 <c.magenta>如果我仅仅</c> <c.magenta>在从右向左的模式下运行</c> 00:06:35.262 --> 00:06:38.832 <c.magenta>你可以看到辅助视图控制器自动反转</c> 00:06:38.899 --> 00:06:41.134 <c.magenta>到另一边</c> <c.magenta>什么都不用做的情况下</c> 00:06:43.737 --> 00:06:45.739 <c.magenta>接下来我们 系统</c> 00:06:45.806 --> 00:06:49.409 <c.magenta>可能添加我们的</c> <c.magenta>辅助视图控制器到你的窗口</c> 00:06:49.676 --> 00:06:53.180 <c.magenta>例如 我们可能为了</c> <c.magenta>创造标签窗口而使用它</c> 00:06:53.247 --> 00:06:54.882 <c.magenta>我们聚集多个窗口</c> 00:06:55.182 --> 00:06:56.984 <c.magenta>到一个类似虚拟窗口</c> 00:06:58.318 --> 00:07:01.555 <c.magenta>我们如何实现窗口分页</c> <c.magenta>并且你作为一个开发者应做什么?</c> 00:06:58.318 --> 00:07:01.555 <c.magenta>我们如何实现窗口分页</c> <c.magenta>并且你作为一个开发者应做什么?</c> 00:07:01.989 --> 00:07:03.423 <c.magenta>你不需要做任何事情</c> 00:07:03.490 --> 00:07:05.158 <c.magenta>若你命令一个窗口前</c> 00:07:05.626 --> 00:07:08.862 <c.magenta>我们做的是寻找和那个窗口</c> <c.magenta>相似的窗口</c> 00:07:09.429 --> 00:07:12.999 <c.magenta>相似是说寻找</c> <c.magenta>tabbing identifier属性</c> 00:07:13.500 --> 00:07:15.335 <c.magenta>如果它有相同的</c> <c.magenta>tabbing identifier</c> 00:07:15.502 --> 00:07:17.504 <c.magenta>我们优先聚集起这些窗口</c> 00:07:17.571 --> 00:07:19.273 <c.magenta>到一个单独被做了标签的窗口</c> 00:07:20.374 --> 00:07:22.209 <c.magenta>这些窗口都被认为是可视的</c> 00:07:22.276 --> 00:07:23.977 <c.magenta>即使它可能是一个隐藏的标签</c> 00:07:24.378 --> 00:07:26.880 <c.magenta>但我们实际将它们隐藏</c> <c.magenta>在核心图像中</c> 00:07:27.614 --> 00:07:30.684 <c.magenta>若你使用NSDocument</c> <c.magenta>大量的东西 如plus按钮</c> 00:07:30.817 --> 00:07:34.321 <c.magenta>在标签栏里面的将会自动工作</c> <c.magenta>不需要你的任何支持</c> 00:07:34.922 --> 00:07:38.392 <c.magenta>但若你不使用NSDocument</c> <c.magenta>你可以实现一个响应链方法</c> 00:07:38.458 --> 00:07:40.961 <c.magenta>新标签窗口来创建一个新文档</c> 00:07:41.028 --> 00:07:42.596 <c.magenta>或在plus按钮上的新窗口</c> 00:07:43.664 --> 00:07:46.433 <c.magenta>欲知更多信息</c> <c.magenta>请观看“Cocoa的新特性”</c> 00:07:46.967 --> 00:07:48.569 <c.magenta>来了解更多的细节</c> 00:07:51.939 --> 00:07:53.674 <c.magenta>关于标题栏的更多信息</c> 00:07:53.807 --> 00:07:57.411 <c.magenta>关于辅助视图控制器</c> <c.magenta>及它们怎么和全屏幕交互的</c> 00:07:57.644 --> 00:08:00.080 <c.magenta>我强烈推荐你们去</c> <c.magenta>看一下2015年的演讲</c> 00:07:57.644 --> 00:08:00.080 <c.magenta>我强烈推荐你们去</c> <c.magenta>看一下2015年的演讲</c> 00:08:00.380 --> 00:08:02.549 <c.magenta>“改善全屏幕窗口体验”</c> 00:08:05.118 --> 00:08:08.488 <c.magenta>接下来我们会谈论下</c> <c.magenta>核心动画</c> 00:08:09.256 --> 00:08:10.624 <c.magenta>什么是核心动画?</c> 00:08:10.724 --> 00:08:14.695 <c.magenta>它是一个图形渲染引擎</c> 00:08:14.761 --> 00:08:17.431 <c.magenta>在GPU上做大量工作</c> <c.magenta>而不是在CPU上</c> 00:08:17.831 --> 00:08:21.568 <c.magenta>所以任何东西都可以非常快地</c> <c.magenta>滚动</c> 00:08:22.269 --> 00:08:24.404 <c.magenta>所以我们可以很快并且很流畅的动画</c> 00:08:25.506 --> 00:08:27.875 <c.magenta>它的一个基础结构</c> <c.magenta>是一个CA layer</c> 00:08:29.510 --> 00:08:34.280 <c.magenta>我们实际上是怎么</c> <c.magenta>使用图层创建布局和视图的</c> 00:08:34.581 --> 00:08:35.749 <c.magenta>或者视图本身呢</c> 00:08:36.216 --> 00:08:40.621 <c.magenta>这是一个你可能用到背景图层的</c> <c.magenta>动画实例</c> 00:08:40.687 --> 00:08:43.690 <c.magenta>一个中间的图层 再来一个前面的图层</c> <c.magenta>做一个动画</c> 00:08:44.424 --> 00:08:47.160 <c.magenta>你想用多个子视图中合成你的视图</c> 00:08:47.661 --> 00:08:48.829 <c.magenta>来创造一个最终的画面</c> 00:08:50.931 --> 00:08:53.400 <c.magenta>让我们看一下核心动画的属性</c> 00:08:53.467 --> 00:08:58.138 <c.magenta>CALayer允许你创建</c> <c.magenta>你可以在屏幕上看到的内容</c> 00:08:59.506 --> 00:09:02.009 <c.magenta>说到内容 CALayer</c> <c.magenta>有一个contents属性</c> 00:08:59.506 --> 00:09:02.009 <c.magenta>说到内容 CALayer</c> <c.magenta>有一个contents属性</c> 00:09:02.376 --> 00:09:05.812 <c.magenta>这个contents属性可以是NSImage</c> <c.magenta>或CGImageRef</c> 00:09:06.213 --> 00:09:07.915 <c.magenta>恰好呈现出你所看到的</c> 00:09:08.515 --> 00:09:09.917 <c.magenta>在那个层的contents里</c> 00:09:10.350 --> 00:09:12.619 <c.magenta>但你也可以</c> <c.magenta>在CALayer上设置其它属性</c> 00:09:12.686 --> 00:09:14.721 <c.magenta>比如背景颜色</c> 00:09:14.788 --> 00:09:16.456 <c.magenta>比如边框的颜色 边框的宽度</c> 00:09:16.623 --> 00:09:18.125 <c.magenta>比如圆角弧度</c> 00:09:18.458 --> 00:09:20.827 <c.magenta>你还可以在CALayer上</c> <c.magenta>发现更多的属性</c> 00:09:20.894 --> 00:09:23.697 <c.magenta>看到其他可操作东西</c> <c.magenta>并且学会如何来操作</c> 00:09:24.231 --> 00:09:26.200 <c.magenta>这有些基础的方式</c> 00:09:26.567 --> 00:09:29.536 <c.magenta>用来创建一个CALayer的外观</c> 00:09:29.903 --> 00:09:32.673 <c.magenta>对此 我们稍后再谈</c> 00:09:34.474 --> 00:09:37.878 <c.magenta>你应该使用一个置为底层的视图</c> 00:09:38.579 --> 00:09:40.347 <c.magenta>所以你将会用NSViews</c> 00:09:41.148 --> 00:09:42.616 <c.magenta>仅需设置层为“是”</c> 00:09:43.016 --> 00:09:44.785 <c.magenta>接下来我将为你们演示如何操作</c> 00:09:45.385 --> 00:09:47.554 <c.magenta>它将会为你隐式创建一个层</c> 00:09:48.422 --> 00:09:51.758 <c.magenta>意思是你可以通过draw方法</c> <c.magenta>提供层的内容</c> 00:09:52.759 --> 00:09:56.163 <c.magenta>但如果你要使用层</c> <c.magenta>我们有两个更重要的方法</c> 00:09:56.230 --> 00:09:58.365 <c.magenta>updateLayer和</c> <c.magenta>wantsUpdateLayer</c> 00:09:58.932 --> 00:10:01.268 <c.magenta>接下来我将告诉你这些如何实现</c> 00:09:58.932 --> 00:10:01.268 <c.magenta>接下来我将告诉你这些如何实现</c> 00:10:01.335 --> 00:10:02.836 <c.magenta>何时你想使用它们</c> 00:10:04.137 --> 00:10:07.040 <c.magenta>我们用核心动画来做什么</c> 00:10:07.107 --> 00:10:09.576 <c.magenta>该何时用核心动画</c> <c.magenta>和置为底层?</c> 00:10:09.776 --> 00:10:13.013 <c.magenta>我们建议你将</c> <c.magenta>窗口内容视图置为底层</c> 00:10:13.881 --> 00:10:15.983 <c.magenta>当你将某特定视图置为底层时</c> 00:10:16.049 --> 00:10:19.486 <c.magenta>所有子层也将自动变为底层</c> 00:10:19.753 --> 00:10:23.790 <c.magenta>不用你为每一个子视图选择一个层</c> 00:10:25.392 --> 00:10:27.094 <c.magenta>我们推荐你将视图置为底层</c> 00:10:27.561 --> 00:10:30.898 <c.magenta>并且不要直接把CALayer</c> <c.magenta>作为子层添加</c> 00:10:31.265 --> 00:10:34.034 <c.magenta>因为它自动为你做事</c> 00:10:34.568 --> 00:10:38.472 <c.magenta>例如当在一个层</c> <c.magenta>在视网膜显示屏上显示时</c> 00:10:38.772 --> 00:10:41.408 <c.magenta>我们将会做更多的设置</c> <c.magenta>来完成这个工作</c> 00:10:44.478 --> 00:10:46.380 <c.magenta>打开“置为底层”非常简单</c> 00:10:46.880 --> 00:10:50.350 <c.magenta>在窗口的内容视图 可将</c> <c.magenta>wants layer设为真并编码</c> 00:10:51.151 --> 00:10:54.021 <c.magenta>或者 当然你可以在界面文件夹里</c> 00:10:54.087 --> 00:10:56.456 <c.magenta>勾选CoreAnimationLayer</c> 00:10:56.723 --> 00:10:57.591 <c.magenta>在最顶部的视图上</c> 00:11:00.460 --> 00:11:02.496 <c.magenta>所以 一个重要的属性</c> 00:11:02.796 --> 00:11:07.201 <c.magenta>置底层视图属性是</c> <c.magenta>layerContentsRedrawPolicy</c> 00:11:07.835 --> 00:11:11.238 <c.magenta>你可以设置值为.onSetNeedsDisplay</c> 00:11:11.805 --> 00:11:14.208 <c.magenta>它并不是NSView的默认值</c> 00:11:15.075 --> 00:11:17.978 <c.magenta>意思是 作为一个开发者的你无论何时</c> 00:11:18.045 --> 00:11:21.114 <c.magenta>想改变层中的</c> <c.magenta>内容或改变视图</c> 00:11:21.748 --> 00:11:23.283 <c.magenta>你都得调用</c> <c.magenta>SetNeedsDisplay</c> 00:11:24.151 --> 00:11:27.421 <c.magenta>这与普通的视图工作方式在语意上</c> <c.magenta>稍微不同</c> 00:11:27.654 --> 00:11:30.524 <c.magenta>当它们移动时它们可能会重新显示</c> <c.magenta>在那里</c> 00:11:31.925 --> 00:11:33.026 <c.magenta>改变框架的原点</c> 00:11:34.261 --> 00:11:36.463 <c.magenta>这是一些你需要明确选择的</c> 00:11:36.530 --> 00:11:39.266 <c.magenta>这尤其可以让动画效果更出色</c> 00:11:41.635 --> 00:11:44.037 <c.magenta>所以如何使内容放到层呢?</c> 00:11:44.872 --> 00:11:46.240 <c.magenta>你的视图是需要刷新的</c> 00:11:46.373 --> 00:11:47.574 <c.magenta>你标记为</c> <c.magenta>setNeedsDisplay</c> 00:11:48.242 --> 00:11:49.076 <c.magenta>并且</c> 00:11:49.409 --> 00:11:52.112 <c.magenta>我们问你的视图 嘿</c> 00:11:52.479 --> 00:11:54.248 <c.magenta>你为wantsUpdateLayer</c> <c.magenta>做了什么?</c> 00:11:54.314 --> 00:11:56.517 <c.magenta>给wantsUpdateLayer</c> <c.magenta>的答案是什么?</c> 00:11:56.850 --> 00:11:57.851 <c.magenta>在这里出现分支</c> 00:11:57.918 --> 00:12:00.020 <c.magenta>若wantsUpdateLayer为是</c> 00:11:57.918 --> 00:12:00.020 <c.magenta>若wantsUpdateLayer为是</c> 00:12:00.187 --> 00:12:02.289 <c.magenta>我们会调用</c> <c.magenta>wantsUpdateLayer</c> 00:12:03.257 --> 00:12:05.792 <c.magenta>若回答否</c> <c.magenta>我们会调用drawRect</c> 00:12:06.059 --> 00:12:07.427 <c.magenta>所以这是一个完整的分支</c> 00:12:07.661 --> 00:12:08.595 <c.magenta>必须要二选一</c> 00:12:10.497 --> 00:12:12.232 <c.magenta>然后你可能会奇怪</c> 00:12:12.633 --> 00:12:16.136 <c.magenta>“好吧 何时该选择updateLayer</c> <c.magenta>或drawRect呢”</c> 00:12:17.304 --> 00:12:21.375 <c.magenta>这回到我给你们演示核心动画</c> <c.magenta>和NSLayer属性的位置</c> 00:12:21.942 --> 00:12:25.879 <c.magenta>所以如果你可以代表你视图的表现</c> 00:12:26.246 --> 00:12:28.715 <c.magenta>直接通过设置CALayer属性</c> 00:12:29.116 --> 00:12:31.218 <c.magenta>这时你该使用updateLayer</c> 00:12:31.485 --> 00:12:33.053 <c.magenta>这将会更高效</c> 00:12:33.353 --> 00:12:35.222 <c.magenta>若你可以设置分层内容</c> 00:12:35.489 --> 00:12:37.591 <c.magenta>层背景颜色 更倾向于做这些</c> 00:12:38.325 --> 00:12:39.293 <c.magenta>如果不可以</c> 00:12:39.359 --> 00:12:43.030 <c.magenta>这里你该重写draw</c> <c.magenta>或者drawRect</c> 00:12:43.697 --> 00:12:47.734 <c.magenta>在子类里做手动绘制</c> 00:12:48.335 --> 00:12:51.438 <c.magenta>每一个实现drawRect的事件</c> 00:12:51.505 --> 00:12:55.442 <c.magenta>将有它们自己特有的backing score</c> <c.magenta>你可把其看作图片</c> 00:12:55.676 --> 00:12:58.345 <c.magenta>因此如果这种东西太多</c> 00:12:58.412 --> 00:12:59.680 <c.magenta>它将会占用太多内存</c> 00:13:02.983 --> 00:13:04.685 <c.magenta>让我们快速看一个例子</c> 00:13:04.751 --> 00:13:06.820 <c.magenta>用updateLayer</c> <c.magenta>你如何使用它</c> 00:13:07.754 --> 00:13:10.023 <c.magenta>首先 你将重写</c> <c.magenta>wantsUpdateLayer</c> 00:13:10.257 --> 00:13:11.291 <c.magenta>你会有一个</c> 00:13:11.625 --> 00:13:14.528 <c.magenta>updateLayer回调</c> <c.magenta>通过返回真</c> 00:13:15.295 --> 00:13:17.297 <c.magenta>然后将得到一个</c> <c.magenta>updateLayer回调</c> 00:13:17.364 --> 00:13:19.166 <c.magenta>你可以设置层属性</c> 00:13:19.233 --> 00:13:22.302 <c.magenta>所以我们得到视图的属性</c> <c.magenta>self.layer内容</c> 00:13:22.703 --> 00:13:24.171 <c.magenta>还有self.layer</c> <c.magenta>backgroundColor</c> 00:13:24.238 --> 00:13:27.374 <c.magenta>或者任何其他的你想设置的东西</c> <c.magenta>这次你可以设置</c> 00:13:31.178 --> 00:13:33.247 <c.magenta>我们再谈论一下现代视图</c> 00:13:33.313 --> 00:13:35.849 <c.magenta>和如何为标题栏和工具栏</c> <c.magenta>创建一个现代化的外观</c> 00:13:36.183 --> 00:13:39.419 <c.magenta>来说一下拖放和</c> <c.magenta>来做一些事件跟踪</c> 00:13:40.888 --> 00:13:42.422 <c.magenta>对于现代化的拖放</c> 00:13:43.357 --> 00:13:46.260 <c.magenta>你需要采用的是</c> <c.magenta>drag flocking</c> 00:13:46.326 --> 00:13:47.794 <c.magenta>像视频中展示的这样</c> 00:13:48.262 --> 00:13:50.664 <c.magenta>Drag flocking</c> <c.magenta>是每一个独立的项目</c> 00:13:50.998 --> 00:13:55.002 <c.magenta>独立的移动</c> <c.magenta>但是会聚集在一起或同时散开</c> 00:13:55.702 --> 00:13:57.004 <c.magenta>当你将鼠标放开以后</c> 00:13:57.070 --> 00:14:00.207 <c.magenta>它们将会散回到初始的位置</c> 00:13:57.070 --> 00:14:00.207 <c.magenta>它们将会散回到初始的位置</c> 00:14:01.708 --> 00:14:05.145 <c.magenta>你只需要使用NSView的方法</c> <c.magenta>来用drag flocking</c> 00:14:05.512 --> 00:14:06.747 <c.magenta>beginDraggingSession</c> 00:14:07.147 --> 00:14:08.382 <c.magenta>当传递一个数组</c> 00:14:08.715 --> 00:14:11.818 <c.magenta>包含实际你想拖拽的项目</c> 00:14:12.786 --> 00:14:13.854 <c.magenta>这十分简单</c> 00:14:15.822 --> 00:14:18.458 <c.magenta>关于更多的复合控制</c> <c.magenta>像一个表视图</c> 00:14:18.959 --> 00:14:22.429 <c.magenta>对集合视图</c> <c.magenta>我们提供代理方法供你使用</c> 00:14:22.829 --> 00:14:25.966 <c.magenta>对于表视图你应该优先使用代理方法</c> 00:14:26.400 --> 00:14:28.468 <c.magenta>tableView pasteboardWriterForRow</c> 00:14:28.969 --> 00:14:32.539 <c.magenta>可提供一独立</c> <c.magenta>NSPasteboard编辑项目</c> 00:14:32.906 --> 00:14:35.209 <c.magenta>为表视图的每一个被拖动的项目</c> 00:14:35.676 --> 00:14:39.279 <c.magenta>与老方法相反</c> <c.magenta>tableView writeRowsWith</c> 00:14:39.646 --> 00:14:40.480 <c.magenta>到一粘贴板</c> 00:14:40.714 --> 00:14:43.717 <c.magenta>你编辑的所有东西将会在一块到</c> <c.magenta>粘贴板上</c> 00:14:45.953 --> 00:14:48.021 <c.magenta>同样 集合视图</c> 00:14:49.356 --> 00:14:51.859 <c.magenta>有两个代理方法和这个非常相似</c> 00:14:51.992 --> 00:14:53.894 <c.magenta>对于集合视图</c> <c.magenta>你该优先使用</c> 00:14:53.961 --> 00:14:57.965 <c.magenta>pasteboardWriter ForItemAt版本</c> <c.magenta>而非其它版本</c> 00:15:00.300 --> 00:15:01.702 <c.magenta>对于drag flocking</c> 00:15:01.869 --> 00:15:05.606 <c.magenta>macOS X 10.12上的新功能是</c> <c.magenta>对drag file promises的支持</c> 00:15:06.106 --> 00:15:09.443 <c.magenta>这就是你现在才用</c> <c.magenta>drag flocking的原因</c> 00:15:10.010 --> 00:15:13.881 <c.magenta>并且你可以用NSFile PromiseReceiver</c> <c.magenta>和NSFile PromiseProvider</c> 00:15:13.947 --> 00:15:15.983 <c.magenta>来读和写文件promises</c> 00:15:16.717 --> 00:15:17.718 <c.magenta>看下这次的演讲</c> 00:15:17.784 --> 00:15:20.821 <c.magenta>“Cocoa的新特性”</c> <c.magenta>了解更多信息和细节</c> 00:15:23.624 --> 00:15:25.826 <c.magenta>让我们看一下事件跟踪</c> 00:15:25.926 --> 00:15:27.661 <c.magenta>假如你有一个窗口</c> 00:15:28.061 --> 00:15:30.130 <c.magenta>并且顶部有一个按钮</c> 00:15:30.864 --> 00:15:31.932 <c.magenta>所以你有这个按钮</c> 00:15:32.332 --> 00:15:33.600 <c.magenta>你想让它发生的是</c> 00:15:33.901 --> 00:15:36.370 <c.magenta>当你点击这个按钮时</c> 00:15:36.970 --> 00:15:38.939 <c.magenta>从上到下它都像常规按钮一样工作</c> 00:15:39.006 --> 00:15:41.375 <c.magenta>你将做什么来表现一个弹出</c> 00:15:42.743 --> 00:15:45.879 <c.magenta>但是你也想弄清楚你点击的按钮</c> 00:15:46.146 --> 00:15:49.349 <c.magenta>并且如果你拖动鼠标拖拽一个窗口</c> 00:15:50.017 --> 00:15:52.019 <c.magenta>所以怎样使这些行为聚到一块呢</c> 00:15:52.286 --> 00:15:55.989 <c.magenta>在现代系统上新特性中</c> <c.magenta>以恰当现代的方法?</c> 00:15:57.724 --> 00:15:59.493 <c.magenta>好吧 让我们讨论一下</c> <c.magenta>事件追踪</c> 00:15:59.560 --> 00:16:01.261 <c.magenta>和如何追踪事件来做到这个</c> 00:15:59.560 --> 00:16:01.261 <c.magenta>和如何追踪事件来做到这个</c> 00:16:02.062 --> 00:16:04.998 <c.magenta>这个窗口有个方法</c> <c.magenta>跟踪事件匹配掩码</c> 00:16:05.065 --> 00:16:06.633 <c.magenta>用一个超时模式处理器</c> 00:16:07.167 --> 00:16:09.102 <c.magenta>并且这个处理器是一个块回调</c> 00:16:10.070 --> 00:16:12.806 <c.magenta>我们更希望你用这个方法</c> <c.magenta>而不是用老方法</c> 00:16:12.873 --> 00:16:13.874 <c.magenta>在NSApplication</c> 00:16:14.641 --> 00:16:16.944 <c.magenta>它是nextEvent</c> <c.magenta>matchingMask</c> 00:16:17.578 --> 00:16:19.913 <c.magenta>用过去的方法你创建自己的循环</c> 00:16:20.380 --> 00:16:23.650 <c.magenta>在新的方法中你仅需使用一个块</c> <c.magenta>回调就可以完成工作了</c> 00:16:26.220 --> 00:16:29.022 <c.magenta>看下这块回调</c> <c.magenta>比如在那个按钮中</c> 00:16:29.223 --> 00:16:31.525 <c.magenta>我们将mouseDown</c> <c.magenta>分成子类并重写</c> 00:16:33.393 --> 00:16:35.829 <c.magenta>首先我们应在mouseDown做的</c> 00:16:35.963 --> 00:16:38.031 <c.magenta>是调用窗口跟踪事件</c> 00:16:38.265 --> 00:16:41.902 <c.magenta>我们想为drag和</c> <c.magenta>leftMouseUp追踪所有事件</c> 00:16:44.271 --> 00:16:46.740 <c.magenta>如果用户点击 然后后退</c> 00:16:47.174 --> 00:16:49.610 <c.magenta>我们需要停止</c> 00:16:49.877 --> 00:16:51.078 <c.magenta>我们会说</c> 00:16:51.311 --> 00:16:53.180 <c.magenta>我们需要调用super</c> 00:16:53.380 --> 00:16:56.183 <c.magenta>因为通过那方式 每件事都会像</c> <c.magenta>NSButton一样正常工作</c> 00:16:56.917 --> 00:16:58.218 <c.magenta>但这有额外的部分</c> 00:16:58.519 --> 00:17:00.554 <c.magenta>比如 你点击并拖拽</c> 00:16:58.519 --> 00:17:00.554 <c.magenta>比如 你点击并拖拽</c> 00:17:00.888 --> 00:17:02.823 <c.magenta>并且如果在按钮里点击和拖拽</c> 00:17:03.156 --> 00:17:05.259 <c.magenta>我们会判断你是否拖拽得足够远</c> 00:17:05.492 --> 00:17:06.560 <c.magenta>如果拖拽得足够远</c> 00:17:07.261 --> 00:17:10.830 <c.magenta>将不再只作为一个窗口而是去</c> <c.magenta>完成一个performDrag</c> 00:17:12.366 --> 00:17:13.967 <c.magenta>意思是</c> 00:17:14.268 --> 00:17:17.069 <c.magenta>当你传递窗口</c> <c.magenta>performDrag时</c> 00:17:17.471 --> 00:17:21.040 <c.magenta>窗口和系统将会在那一点</c> <c.magenta>接替这个拖拽窗口</c> 00:17:21.974 --> 00:17:24.211 <c.magenta>不能拖拽和移动窗口</c> 00:17:24.278 --> 00:17:26.547 <c.magenta>通过在窗口一次次</c> <c.magenta>调用set frame</c> 00:17:27.681 --> 00:17:29.016 <c.magenta>如果你传递给系统</c> 00:17:29.349 --> 00:17:30.684 <c.magenta>一旦你传递</c> 00:17:30.951 --> 00:17:32.219 <c.magenta>如果你的应用卡住了</c> 00:17:32.719 --> 00:17:33.554 <c.magenta>然后</c> 00:17:33.620 --> 00:17:35.956 <c.magenta>这个窗口将继续可被移动</c> 00:17:36.523 --> 00:17:38.225 <c.magenta>即使应用正在运行</c> 00:17:38.892 --> 00:17:40.894 <c.magenta>除此之外 其它系统特性将运行</c> 00:17:41.428 --> 00:17:42.963 <c.magenta>像空间切换</c> 00:17:43.297 --> 00:17:46.200 <c.magenta>当你移动到窗口顶端</c> <c.magenta>空白栏将会向下移动</c> 00:17:46.500 --> 00:17:48.135 <c.magenta>窗口捕捉 窗口对齐</c> 00:17:48.702 --> 00:17:50.304 <c.magenta>任何其它新加入的系统特性</c> 00:17:50.370 --> 00:17:53.974 <c.magenta>在窗口的移动下会自动工作</c> <c.magenta>不需要你做任何事</c> 00:17:54.374 --> 00:17:55.943 <c.magenta>所以我们希望你向下传给系统</c> 00:17:56.510 --> 00:17:58.512 <c.magenta>通过调用performDrag</c> 00:18:01.715 --> 00:18:04.751 <c.magenta>刚才讨论了拖拽和事件处理</c> 00:18:04.818 --> 00:18:07.187 <c.magenta>让我们谈论一下</c> <c.magenta>容器试图控制</c> 00:18:07.588 --> 00:18:09.056 <c.magenta>和如何适当的使用这些</c> 00:18:10.057 --> 00:18:11.959 <c.magenta>容器视图控制</c> <c.magenta>我们应该使用</c> 00:18:12.025 --> 00:18:13.760 <c.magenta>基于表视图的视图</c> 00:18:14.061 --> 00:18:17.197 <c.magenta>你通过使用代理方法tableView</c> <c.magenta>viewFor: row: 来做这些</c> 00:18:17.598 --> 00:18:21.001 <c.magenta>或者你可以在Interface</c> <c.magenta>Builder里设置一些东西</c> 00:18:21.535 --> 00:18:23.270 <c.magenta>直接通过Interface</c> <c.magenta>Builder本身</c> 00:18:25.405 --> 00:18:28.175 <c.magenta>这样做的原因是你可以像视频中</c> <c.magenta>我们看到的那样</c> 00:18:28.275 --> 00:18:30.344 <c.magenta>新特性 例如滑动删除</c> 00:18:30.577 --> 00:18:32.779 <c.magenta>这仅仅存在于基于表视图的视图里</c> 00:18:34.348 --> 00:18:36.183 <c.magenta>通过滑动来删除非常简单的</c> 00:18:36.583 --> 00:18:37.918 <c.magenta>这有一个表视图方法</c> 00:18:38.418 --> 00:18:39.520 <c.magenta>rowActionsForRow</c> 00:18:40.020 --> 00:18:40.988 <c.magenta>在一个特殊的边缘</c> 00:18:41.054 --> 00:18:43.824 <c.magenta>在左边或右边的边缘 抱歉</c> <c.magenta>应该是在顶部和底部的边缘</c> 00:18:44.758 --> 00:18:48.495 <c.magenta>并且你可以返回一个数组一个或多个</c> <c.magenta>或没有或更多行的操作</c> 00:18:49.062 --> 00:18:51.231 <c.magenta>在NSTableView的行操作中</c> 00:18:52.032 --> 00:18:56.637 <c.magenta>允许你给按钮的标题创造一个字符串值</c> 00:18:57.237 --> 00:18:59.606 <c.magenta>和一个处理方法</c> 00:19:00.073 --> 00:19:02.342 <c.magenta>当用户点击时才触发的代码</c> 00:19:02.476 --> 00:19:04.411 <c.magenta>或者滑动屏幕足够远才触发的代码</c> 00:19:07.714 --> 00:19:11.585 <c.magenta>接着我们谈论下滚动视图</c> <c.magenta>和它的复合控制</c> 00:19:11.985 --> 00:19:14.454 <c.magenta>到目前为止我们谈论的技术</c> 00:19:15.055 --> 00:19:18.759 <c.magenta>例如滚动视图...</c> <c.magenta>比如我们获取窗口</c> 00:19:19.259 --> 00:19:22.930 <c.magenta>和设置窗口</c> <c.magenta>标题栏显示透明</c> 00:19:23.263 --> 00:19:25.332 <c.magenta>它使标题栏看上去透明</c> 00:19:25.432 --> 00:19:27.701 <c.magenta>如Messages这类应用</c> <c.magenta>充分利用该特性</c> 00:19:28.435 --> 00:19:30.304 <c.magenta>允许内容在下部显示</c> 00:19:30.370 --> 00:19:32.306 <c.magenta>我们来看一下发生了什么</c> 00:19:32.372 --> 00:19:37.477 <c.magenta>在一边的滚动视图显示</c> 00:19:37.544 --> 00:19:40.914 <c.magenta>在标题栏/工具栏下部区域的内容</c> <c.magenta>并会自动将其变模糊</c> 00:19:41.348 --> 00:19:42.816 <c.magenta>但是这呈现出两难处境</c> 00:19:43.550 --> 00:19:46.887 <c.magenta>如何使滚动视图被自动插入</c> 00:19:47.287 --> 00:19:49.590 <c.magenta>以致你不需要添加一个空行</c> 00:19:49.656 --> 00:19:50.924 <c.magenta>或其他什么奇怪东西?</c> 00:19:52.292 --> 00:19:54.194 <c.magenta>做这些十分方便和简单</c> 00:19:54.261 --> 00:19:55.662 <c.magenta>滚动视图有个方法</c> 00:19:55.896 --> 00:19:57.965 <c.magenta>或属性</c> <c.magenta>叫contentInsets</c> 00:19:58.365 --> 00:20:01.168 <c.magenta>允许你将内容稍微向下移动一点</c> 00:19:58.365 --> 00:20:01.168 <c.magenta>允许你将内容稍微向下移动一点</c> 00:20:01.969 --> 00:20:03.737 <c.magenta>实际上 我们让它自动实现</c> 00:20:04.071 --> 00:20:06.707 <c.magenta>我们有个属性</c> <c.magenta>automaticallyAdjust ContentInsets</c> 00:20:07.241 --> 00:20:08.642 <c.magenta>如果你设置它为真</c> 00:20:08.876 --> 00:20:11.411 <c.magenta>然后我们</c> <c.magenta>让滚动视图使用KVO</c> 00:20:11.478 --> 00:20:14.381 <c.magenta>之前说的跟踪</c> <c.magenta>contentLayoutRect</c> 00:20:14.848 --> 00:20:16.750 <c.magenta>自动设置</c> <c.magenta>内容插图</c> 00:20:16.950 --> 00:20:18.552 <c.magenta>为一个合适的值</c> 00:20:20.554 --> 00:20:24.224 <c.magenta>但作为开发者 你可能想更自由控制</c> <c.magenta>内容插图</c> 00:20:24.691 --> 00:20:26.560 <c.magenta>你可能想让它更向下</c> 00:20:26.827 --> 00:20:28.462 <c.magenta>来添加一切其他的帮助控件</c> 00:20:28.529 --> 00:20:30.731 <c.magenta>比如一个搜索区域或者其它东西</c> 00:20:31.632 --> 00:20:34.134 <c.magenta>在我们的系统中的一个例子是</c> 00:20:34.401 --> 00:20:37.671 <c.magenta>Mail向下了一点</c> <c.magenta>添加了排序指示器</c> 00:20:38.772 --> 00:20:41.909 <c.magenta>这就是我们在系统应用中的使用方式</c> 00:20:43.977 --> 00:20:45.979 <c.magenta>下面说说自动布局</c> 00:20:46.813 --> 00:20:48.248 <c.magenta>你应该使用自动布局</c> 00:20:48.582 --> 00:20:50.551 <c.magenta>你也应该使用</c> <c.magenta>base localization</c> 00:20:51.385 --> 00:20:54.288 <c.magenta>你所有的nymphs都</c> <c.magenta>该在base.lproj中</c> 00:20:54.354 --> 00:20:58.325 <c.magenta>除了使用多个不同文件夹和本地化副本</c> 00:20:58.959 --> 00:21:00.994 <c.magenta>你不应该使用固定写法</c> 00:20:58.959 --> 00:21:00.994 <c.magenta>你不应该使用固定写法</c> 00:21:01.395 --> 00:21:05.032 <c.magenta>你想用控制去得到内在的内容大小</c> 00:21:05.532 --> 00:21:06.867 <c.magenta>而不是写死大小</c> 00:21:07.601 --> 00:21:08.902 <c.magenta>优先使用堆视图</c> 00:21:09.303 --> 00:21:12.306 <c.magenta>使用leading和</c> <c.magenta>trailing属性 这些都正确</c> 00:21:12.372 --> 00:21:14.441 <c.magenta>对于创建一个合理的本地化应用</c> 00:21:15.709 --> 00:21:18.579 <c.magenta>我们看一下IB中的本地化选项</c> 00:21:19.313 --> 00:21:22.716 <c.magenta>尤其文本方向、</c> <c.magenta>布局和镜像部分</c> 00:21:23.784 --> 00:21:26.286 <c.magenta>文本方向有三个值</c> 00:21:26.687 --> 00:21:29.389 <c.magenta>自然的 从左到右 从右到左</c> 00:21:30.057 --> 00:21:31.425 <c.magenta>自然的意思是</c> 00:21:31.959 --> 00:21:34.862 <c.magenta>实际的控制器将根据字符串值</c> 00:21:34.928 --> 00:21:38.131 <c.magenta>你给你这个控制器设置的 如文本域</c> <c.magenta>根据字符串值</c> 00:21:38.732 --> 00:21:41.435 <c.magenta>如果字符串是从右向左的</c> 00:21:42.236 --> 00:21:45.205 <c.magenta>我们将实际把方向设置为从右向左</c> 00:21:45.639 --> 00:21:48.175 <c.magenta>如果是从左到右的字符串</c> <c.magenta>我们将设置为从左到右</c> 00:21:49.276 --> 00:21:52.880 <c.magenta>或者你可以手动设置为</c> <c.magenta>从左到右或者从右到左</c> 00:21:54.147 --> 00:21:57.150 <c.magenta>下一个属性是</c> <c.magenta>userInterface LayoutDirection</c> 00:21:58.085 --> 00:21:59.453 <c.magenta>对于布局非常重要</c> 00:22:00.354 --> 00:22:02.422 <c.magenta>它可以从左到右或者从右到左</c> 00:22:03.757 --> 00:22:06.326 <c.magenta>系统控制如表视图要参考这个属性</c> 00:22:06.393 --> 00:22:09.263 <c.magenta>还可能做自动反转表的列之类的事</c> 00:22:09.329 --> 00:22:10.664 <c.magenta>当设置为从右向左时</c> 00:22:11.865 --> 00:22:13.867 <c.magenta>默认值根据应用值来定</c> 00:22:14.902 --> 00:22:18.138 <c.magenta>有趣的是镜像属性</c> 00:22:18.205 --> 00:22:19.673 <c.magenta>因为它有点迷惑</c> 00:22:19.973 --> 00:22:21.975 <c.magenta>若一个镜像被设为自动</c> 00:22:22.276 --> 00:22:24.244 <c.magenta>然后userInterface</c> <c.magenta>LayoutDirection</c> 00:22:24.311 --> 00:22:25.979 <c.magenta>刚才我们看的最后一个属性</c> 00:22:26.513 --> 00:22:29.183 <c.magenta>会自动由从左到右变为从右到左</c> 00:22:29.650 --> 00:22:31.518 <c.magenta>当它是从右到左的本地化</c> 00:22:32.219 --> 00:22:33.053 <c.magenta>反之亦然</c> 00:22:34.855 --> 00:22:37.457 <c.magenta>它还会反转自动其他属性</c> 00:22:37.591 --> 00:22:39.793 <c.magenta>像按钮单元图像的位置</c> 00:22:40.093 --> 00:22:42.829 <c.magenta>按钮的图像在左面 我们会反转它</c> 00:22:42.896 --> 00:22:44.898 <c.magenta>会自动放到右面</c> 00:22:45.999 --> 00:22:49.136 <c.magenta>我们不会反转的一个属性是文本对齐</c> 00:22:49.469 --> 00:22:51.471 <c.magenta>若你设为居中</c> <c.magenta>两端对齐或自然</c> 00:22:51.538 --> 00:22:54.541 <c.magenta>反转它们没有意义所以我们不会反转</c> 00:22:55.375 --> 00:22:57.211 <c.magenta>你可能会想</c> 00:22:57.277 --> 00:22:59.880 <c.magenta>“我什么时候不需要设置镜像?”</c> 00:23:00.013 --> 00:23:03.050 <c.magenta>你可能想设置镜像为否</c> 00:23:03.116 --> 00:23:06.353 <c.magenta>在你想要一个控制器</c> <c.magenta>有一个非常实际的代表</c> 00:23:06.420 --> 00:23:09.356 <c.magenta>像一个播放按钮 快进按钮或快退按钮</c> 00:23:11.225 --> 00:23:12.059 <c.magenta>然后</c> 00:23:12.392 --> 00:23:15.996 <c.magenta>这些是关于Interface Builder的</c> <c.magenta>那么在代码里你该怎么做?</c> 00:23:16.430 --> 00:23:19.533 <c.magenta>在代码里你必须参考控制器值</c> 00:23:19.600 --> 00:23:22.936 <c.magenta>关于userInterfaceLayoutDirection</c> <c.magenta>如果它设置为从左向右</c> 00:23:23.237 --> 00:23:25.038 <c.magenta>你必须说“嘿 按钮</c> 00:23:25.205 --> 00:23:29.276 <c.magenta>我想让图片在左面</c> <c.magenta>当从左到右本地化时</c> 00:23:29.476 --> 00:23:32.846 <c.magenta>我想设置图像在右面</c> <c.magenta>当从右向左本地化”</c> 00:23:32.913 --> 00:23:34.615 <c.magenta>你必须手动完成设置它</c> 00:23:36.517 --> 00:23:38.652 <c.magenta>在10.12中 这个更容易了些</c> 00:23:39.086 --> 00:23:41.021 <c.magenta>我们给按钮添加了一个快捷方法</c> 00:23:41.088 --> 00:23:44.291 <c.magenta>一个初始化方法可以传入一个字符串</c> 00:23:44.358 --> 00:23:46.860 <c.magenta>一个图片 一个目标和一个动作</c> 00:23:46.927 --> 00:23:49.530 <c.magenta>还有自动反转</c> 00:23:52.432 --> 00:23:54.968 <c.magenta>这是我讲的第一部分</c> 00:23:55.035 --> 00:23:56.870 <c.magenta>下面让Jeff讲讲外观</c> 00:23:56.937 --> 00:23:59.039 <c.magenta>storyboards和</c> <c.magenta>其他一些Mac特性</c> 00:23:59.106 --> 00:23:59.940 <c.magenta>谢谢大家</c> 00:24:05.279 --> 00:24:06.480 <c.magenta>好的 谢谢 Corbin</c> 00:24:06.780 --> 00:24:09.183 <c.magenta>在这个课程我们有大量的内容去讲</c> 00:24:09.249 --> 00:24:11.618 <c.magenta>所以现在我说说系统外观</c> 00:24:12.986 --> 00:24:13.987 <c.magenta>这里是我们的应用</c> 00:24:14.421 --> 00:24:16.256 <c.magenta>我们刚才已经看了一会儿</c> 00:24:16.323 --> 00:24:19.560 <c.magenta>我们想提升下我们的UI</c> 00:24:20.227 --> 00:24:23.797 <c.magenta>我们已经决定采用这个花哨的黑色外观</c> 00:24:25.065 --> 00:24:27.401 <c.magenta>这通常是高级应用的外观</c> 00:24:27.734 --> 00:24:30.737 <c.magenta>我们要对我们这个小演示程序有点野心</c> 00:24:32.172 --> 00:24:34.374 <c.magenta>但看看这个</c> <c.magenta>这个看起来确实很复杂</c> 00:24:34.441 --> 00:24:37.811 <c.magenta>我们有一个完全不同的系统</c> <c.magenta>Window Chrome</c> 00:24:38.178 --> 00:24:42.549 <c.magenta>我们要所有控制器artwork改变</c> <c.magenta>片段控制器 按钮 滑块</c> 00:24:43.116 --> 00:24:44.885 <c.magenta>所有的文本标签</c> 00:24:45.185 --> 00:24:47.921 <c.magenta>需要从黑色字体变为浅色字体</c> 00:24:49.089 --> 00:24:50.591 <c.magenta>看起来有很多工作</c> 00:24:50.657 --> 00:24:54.294 <c.magenta>但实际上饿哦们可以用一行代码实现</c> <c.magenta>通过使用NSAppearance</c> 00:24:55.095 --> 00:24:58.098 <c.magenta>我们需要做的是创建一个系统外观</c> 00:24:58.165 --> 00:24:59.099 <c.magenta>赋值给窗口</c> 00:24:59.166 --> 00:25:01.568 <c.magenta>会自动的应用所有的工作</c> 00:24:59.166 --> 00:25:01.568 <c.magenta>会自动的应用所有的工作</c> 00:25:01.969 --> 00:25:05.472 <c.magenta>你可以认为外观是一种颜色调节盘</c> 00:25:05.839 --> 00:25:07.074 <c.magenta>我们用来解决</c> 00:25:07.140 --> 00:25:09.977 <c.magenta>绘制所有的标准系统控制器</c> 00:25:10.043 --> 00:25:12.179 <c.magenta>还包括所有我们命名的颜色</c> 00:25:12.246 --> 00:25:14.748 <c.magenta>像标签颜色 控制器颜色</c> 00:25:15.382 --> 00:25:19.086 <c.magenta>由于这个原因</c> <c.magenta>适时使用这些颜色很重要</c> 00:25:19.152 --> 00:25:22.289 <c.magenta>不仅更适合整个系统主题</c> 00:25:22.656 --> 00:25:25.259 <c.magenta>同时 如果以后主题变了</c> <c.magenta>仍然适合</c> 00:25:25.325 --> 00:25:27.394 <c.magenta>或者以后你改变了你的外观</c> 00:25:28.428 --> 00:25:29.630 <c.magenta>我们仔细的看看</c> 00:25:30.097 --> 00:25:30.964 <c.magenta>这里有个面板</c> 00:25:31.031 --> 00:25:33.667 <c.magenta>有许多很棒的标签</c> <c.magenta>控制器等等在上面</c> 00:25:34.635 --> 00:25:36.870 <c.magenta>我们只需应用暗色外观</c> 00:25:36.937 --> 00:25:38.605 <c.magenta>我们看到了相当戏剧性的变化</c> 00:25:38.972 --> 00:25:40.507 <c.magenta>控制器artwork变了</c> 00:25:40.574 --> 00:25:43.477 <c.magenta>当然其他所有的标签由深色到浅色转变</c> 00:25:44.478 --> 00:25:46.213 <c.magenta>我们可以再进一步</c> 00:25:46.280 --> 00:25:48.348 <c.magenta>应用这些很酷的活力效果</c> 00:25:48.982 --> 00:25:50.450 <c.magenta>你刚可能已注意到一个幻灯片</c> 00:25:50.517 --> 00:25:53.053 <c.magenta>那个我们应用过的外观叫做活力黑</c> 00:25:53.120 --> 00:25:55.422 <c.magenta>不是说你有义务使用“活力”</c> 00:25:55.489 --> 00:25:58.692 <c.magenta>而是说artwork在充满活力的</c> <c.magenta>上下文中看起来很棒</c> 00:25:59.126 --> 00:26:00.994 <c.magenta>想要这种外观 你只需要</c> 00:25:59.126 --> 00:26:00.994 <c.magenta>想要这种外观 你只需要</c> 00:26:01.195 --> 00:26:04.798 <c.magenta>添加你所有控制器</c> <c.magenta>作为NSVisualEffectView的子视图</c> 00:26:05.299 --> 00:26:07.467 <c.magenta>你会自动获得这个</c> <c.magenta>很棒的窗口后模糊</c> 00:26:07.534 --> 00:26:10.237 <c.magenta>还有在这上面所有的</c> <c.magenta>很酷的渲染效果</c> 00:26:11.471 --> 00:26:13.574 <c.magenta>现在 你可能认为这很棒</c> 00:26:13.674 --> 00:26:16.210 <c.magenta>但我的设计师有很酷的</c> 00:26:16.276 --> 00:26:18.679 <c.magenta>特定颜色针对我们的文本标签</c> 00:26:19.012 --> 00:26:20.714 <c.magenta>所以我不会使用标签颜色</c> 00:26:21.248 --> 00:26:24.818 <c.magenta>我也不会把其从暗变浅或者反过来</c> 00:26:24.885 --> 00:26:26.119 <c.magenta>我很好 是的 我很安全</c> 00:26:27.154 --> 00:26:29.056 <c.magenta>我们加点东西</c> 00:26:30.123 --> 00:26:33.594 <c.magenta>我们检查下</c> <c.magenta>可访性面板</c> 00:26:33.660 --> 00:26:36.597 <c.magenta>我们会打开中间叫做</c> <c.magenta>增加对比度的设置</c> 00:26:36.663 --> 00:26:38.565 <c.magenta>看看会对UI带来什么影响</c> 00:26:39.733 --> 00:26:42.069 <c.magenta>在左面我们有标准的面板</c> 00:26:42.636 --> 00:26:43.637 <c.magenta>但是右面我们有</c> 00:26:44.071 --> 00:26:46.139 <c.magenta>增加对比度开启的面板</c> 00:26:46.740 --> 00:26:49.309 <c.magenta>虽然我们没有反转所有颜色</c> 00:26:49.376 --> 00:26:51.512 <c.magenta>这个转换很像</c> 00:26:51.879 --> 00:26:53.780 <c.magenta>有浅变深的转换</c> 00:26:54.281 --> 00:26:57.150 <c.magenta>你可以看到窗口背景色变浅了</c> 00:26:57.317 --> 00:26:58.986 <c.magenta>在每一个层级文本都变暗了</c> 00:26:59.286 --> 00:27:01.788 <c.magenta>我们的控制器有很棒的加粗轮廓</c> 00:26:59.286 --> 00:27:01.788 <c.magenta>我们的控制器有很棒的加粗轮廓</c> 00:27:02.356 --> 00:27:04.424 <c.magenta>让它和背景区分更明显 更立体</c> 00:27:04.958 --> 00:27:07.227 <c.magenta>现在 当你用一个写死的颜色值</c> 00:27:07.628 --> 00:27:10.964 <c.magenta>我们就不能猜测</c> <c.magenta>我们不能像这样调整设置</c> 00:27:11.498 --> 00:27:12.332 <c.magenta>所以</c> 00:27:13.133 --> 00:27:16.003 <c.magenta>如果你没有像标签颜色</c> 00:27:16.069 --> 00:27:18.772 <c.magenta>第二选择标签颜色</c> <c.magenta>你可能在帮倒忙</c> 00:27:18.839 --> 00:27:22.543 <c.magenta>对想要在他们Mac上设置</c> <c.magenta>像增加对比度的用户</c> 00:27:24.144 --> 00:27:27.347 <c.magenta>现在说我刚暗示的视觉效果和活力</c> 00:27:27.814 --> 00:27:30.417 <c.magenta>我们现在不会深入那个API</c> 00:27:30.484 --> 00:27:32.819 <c.magenta>但是你可以参考我们2014年的演讲</c> 00:27:33.120 --> 00:27:36.390 <c.magenta>“采用OS X Yosemite</c> <c.magenta>新UI的高级特性”</c> 00:27:37.558 --> 00:27:38.659 <c.magenta>那是外观</c> 00:27:38.725 --> 00:27:40.827 <c.magenta>是设置你应用主题的简单方式</c> 00:27:41.128 --> 00:27:44.464 <c.magenta>同时能和整个运作系统的外观保持和谐</c> 00:27:45.465 --> 00:27:46.500 <c.magenta>下一个话题storyboards</c> 00:27:48.268 --> 00:27:50.871 <c.magenta>Storyboards</c> <c.magenta>是一种可以让你设计</c> 00:27:50.971 --> 00:27:52.639 <c.magenta>不仅是单个组件的技术</c> 00:27:52.706 --> 00:27:54.975 <c.magenta>和构成你应用的其他视图</c> 00:27:55.042 --> 00:27:58.278 <c.magenta>并且在视觉上设计这些组件间的关系</c> 00:27:59.146 --> 00:28:00.781 <c.magenta>在这个例子中 当我说部件时</c> 00:27:59.146 --> 00:28:00.781 <c.magenta>在这个例子中 当我说部件时</c> 00:28:00.848 --> 00:28:02.683 <c.magenta>storyboards操作的控制器</c> 00:28:02.749 --> 00:28:05.285 <c.magenta>是我们的窗口控制器和视图控制器</c> 00:28:05.586 --> 00:28:07.921 <c.magenta>我们用这些segues把它们连起来</c> 00:28:07.988 --> 00:28:10.057 <c.magenta>在我的截图上的那些箭头</c> 00:28:10.524 --> 00:28:12.993 <c.magenta>segues抽象所有的胶水代码</c> 00:28:13.493 --> 00:28:15.229 <c.magenta>让这些部件放在一起</c> 00:28:15.295 --> 00:28:18.031 <c.magenta>就像添加子视图 添加约束</c> 00:28:18.398 --> 00:28:20.901 <c.magenta>创建弹出框一样方便</c> 00:28:24.571 --> 00:28:25.405 <c.magenta>现在</c> 00:28:25.873 --> 00:28:29.510 <c.magenta>一个我们需要考虑的</c> <c.magenta>关于storyboards的是</c> 00:28:30.143 --> 00:28:31.979 <c.magenta>当我们有可分离的组件时</c> <c.magenta>如这些</c> 00:28:32.045 --> 00:28:35.115 <c.magenta>我有一个拆分视图</c> <c.magenta>storyboard创建的</c> 00:28:35.182 --> 00:28:37.384 <c.magenta>所有这些小组件做它们自己的事</c> 00:28:38.352 --> 00:28:42.022 <c.magenta>每一部分UI都有些数据需要用</c> 00:28:42.256 --> 00:28:43.490 <c.magenta>或者修改</c> 00:28:43.824 --> 00:28:48.529 <c.magenta>我们不能仅从一个到另一个场景</c> <c.magenta>拖拽outlets或actions</c> 00:28:48.595 --> 00:28:49.863 <c.magenta>当然 如果我们这么做了</c> 00:28:50.130 --> 00:28:51.765 <c.magenta>它们就不是可分离的组件了</c> 00:28:51.832 --> 00:28:54.635 <c.magenta>然后我们就破坏这件事的本来目的</c> 00:28:56.136 --> 00:28:57.671 <c.magenta>有时 我们用的数据</c> 00:28:57.738 --> 00:29:00.307 <c.magenta>不是呈锥形存在于场景中</c> 00:28:57.738 --> 00:29:00.307 <c.magenta>不是呈锥形存在于场景中</c> 00:29:00.374 --> 00:29:02.176 <c.magenta>在下面的叶子节点</c> 00:29:02.376 --> 00:29:05.445 <c.magenta>有时它可能存在在窗口或者文档中</c> 00:29:05.779 --> 00:29:07.247 <c.magenta>所以我们如何传递数据</c> 00:29:07.481 --> 00:29:10.584 <c.magenta>从上直到叶子节点?</c> 00:29:12.319 --> 00:29:14.054 <c.magenta>好的 我们有几个经验法则</c> 00:29:14.288 --> 00:29:15.489 <c.magenta>不是硬性的规则</c> 00:29:15.856 --> 00:29:19.159 <c.magenta>仅是几个主意</c> <c.magenta>我们认为对处理这个有帮助</c> 00:29:20.260 --> 00:29:21.094 <c.magenta>第一个</c> 00:29:21.395 --> 00:29:23.830 <c.magenta>依赖应该大体级联向下</c> 00:29:24.231 --> 00:29:25.332 <c.magenta>如果你想</c> 00:29:25.399 --> 00:29:27.134 <c.magenta>如果你需要某些法则</c> 00:29:27.201 --> 00:29:29.469 <c.magenta>在segues中跟随箭头</c> 00:29:30.470 --> 00:29:31.805 <c.magenta>如果没有其它</c> <c.magenta>这让你</c> 00:29:31.872 --> 00:29:34.641 <c.magenta>在应用中有很好的单向信息流</c> 00:29:34.875 --> 00:29:36.877 <c.magenta>这让人很容易理解</c> 00:29:38.312 --> 00:29:41.515 <c.magenta>另一个是尽量减少UI结构的假设</c> 00:29:41.582 --> 00:29:43.917 <c.magenta>你写死到代码里的</c> 00:29:44.751 --> 00:29:47.955 <c.magenta>你设计完UI和storyboard</c> 00:29:48.589 --> 00:29:49.957 <c.magenta>若你在代码里写死了一些假设</c> 00:29:50.023 --> 00:29:52.426 <c.magenta>关于结构是如何放到一起的</c> 00:29:52.559 --> 00:29:54.895 <c.magenta>当你想要改变storyboard时</c> 00:29:54.962 --> 00:29:55.863 <c.magenta>你得来来回回</c> 00:29:55.929 --> 00:29:57.531 <c.magenta>修改代码和storyboard</c> 00:29:57.598 --> 00:29:59.266 <c.magenta>现在你和自己过不去</c> 00:29:59.333 --> 00:30:00.234 <c.magenta>我们不要那么做</c> 00:29:59.333 --> 00:30:00.234 <c.magenta>我们不要那么做</c> 00:30:00.400 --> 00:30:02.469 <c.magenta>让我们把代码集中在数据上</c> 00:30:02.936 --> 00:30:05.639 <c.magenta>集中在设计界面和Interface Builder上</c> 00:30:06.507 --> 00:30:08.909 <c.magenta>一个我们可以用来解决该问题的技巧是</c> 00:30:09.109 --> 00:30:12.913 <c.magenta>使用符合协议贯穿UI</c> 00:30:14.414 --> 00:30:15.415 <c.magenta>这里有个例子</c> 00:30:15.716 --> 00:30:18.619 <c.magenta>假设有一个属性</c> <c.magenta>在窗口控制器上</c> 00:30:18.685 --> 00:30:20.954 <c.magenta>我们想自动提供那个属性</c> 00:30:21.121 --> 00:30:23.557 <c.magenta>给我们视图阶梯中理解它的任何东西</c> 00:30:24.024 --> 00:30:24.858 <c.magenta>在didSet中</c> 00:30:25.425 --> 00:30:27.528 <c.magenta>我们会调用propagate方法</c> 00:30:27.995 --> 00:30:29.930 <c.magenta>我们得到了在屏幕外</c> <c.magenta>定义的协议</c> 00:30:29.997 --> 00:30:31.698 <c.magenta>叫作photoControllerConsumer</c> 00:30:32.266 --> 00:30:35.335 <c.magenta>这代表我知道如何使用</c> <c.magenta>photoController</c> 00:30:36.603 --> 00:30:39.006 <c.magenta>且若我们看看</c> <c.magenta>childViewController</c> 00:30:39.072 --> 00:30:41.942 <c.magenta>会发现它遵守了</c> <c.magenta>我们可以设置属性的协议</c> 00:30:42.442 --> 00:30:46.513 <c.magenta>同时我们自动递归传递给其所有子项</c> 00:30:49.616 --> 00:30:50.651 <c.magenta>但是像</c> 00:30:51.685 --> 00:30:54.621 <c.magenta>弹出或者表单展示</c> 00:30:54.688 --> 00:30:56.156 <c.magenta>这些必须吗?</c> 00:30:56.657 --> 00:30:59.726 <c.magenta>当你设置这样的属性的时候</c> <c.magenta>这些可能不存在</c> 00:31:00.160 --> 00:31:02.563 <c.magenta>我们根据需要来给</c> <c.magenta>他们提供数据</c> 00:31:03.130 --> 00:31:04.498 <c.magenta>在他们出现在屏幕之前</c> 00:31:05.132 --> 00:31:07.768 <c.magenta>即prepare for</c> <c.magenta>segue方法的作用</c> 00:31:08.435 --> 00:31:11.738 <c.magenta>它会在展示视图控制器或</c> <c.magenta>窗口控制器的时候被调用</c> 00:31:11.805 --> 00:31:13.674 <c.magenta>当展示发生时</c> 00:31:14.174 --> 00:31:15.008 <c.magenta>在这个例子中</c> 00:31:15.409 --> 00:31:19.413 <c.magenta>除了做像检查或者segue标识符</c> 00:31:19.479 --> 00:31:22.816 <c.magenta>强制转换成我们希望的控制器类</c> 00:31:22.883 --> 00:31:24.785 <c.magenta>然后做些特定的设置</c> 00:31:25.052 --> 00:31:26.954 <c.magenta>这里我们做相同的事情</c> 00:31:27.387 --> 00:31:29.556 <c.magenta>我们检查什么协议被遵守</c> 00:31:29.723 --> 00:31:31.792 <c.magenta>然后设置合适的属性</c> 00:31:32.159 --> 00:31:33.694 <c.magenta>此举是</c> 00:31:33.760 --> 00:31:36.096 <c.magenta>它改变我们的逻辑从严格聚焦</c> 00:31:36.163 --> 00:31:39.466 <c.magenta>身份变为能力</c> 00:31:39.533 --> 00:31:41.134 <c.magenta>我们说我有这方面的知识</c> 00:31:41.301 --> 00:31:43.003 <c.magenta>任何展现给我的</c> 00:31:43.070 --> 00:31:45.405 <c.magenta>可以潜在自动获得那个知识</c> 00:31:45.472 --> 00:31:46.974 <c.magenta>通过一个一致的协议</c> 00:31:47.040 --> 00:31:47.975 <c.magenta>这真的很方便</c> 00:31:49.610 --> 00:31:50.577 <c.magenta>再讲讲“动作”</c> 00:31:51.311 --> 00:31:52.513 <c.magenta>那很常见</c> 00:31:52.913 --> 00:31:56.083 <c.magenta>UI中触发的处理动作的最佳对象</c> 00:31:56.350 --> 00:31:58.285 <c.magenta>实际上并没有在同一个场景</c> 00:31:58.785 --> 00:32:00.654 <c.magenta>那个控制器定义的地方</c> 00:31:58.785 --> 00:32:00.654 <c.magenta>那个控制器定义的地方</c> 00:32:01.154 --> 00:32:04.458 <c.magenta>这被它们自己的小场景中</c> <c.magenta>菜单单元证明了</c> 00:32:05.158 --> 00:32:06.894 <c.magenta>完全从你的UI断开</c> 00:32:07.895 --> 00:32:08.729 <c.magenta>同时</c> 00:32:08.862 --> 00:32:11.732 <c.magenta>幸运的是我们有一个很棒的机制</c> <c.magenta>来处理这种情况</c> 00:32:11.798 --> 00:32:13.300 <c.magenta>就是事件响应链</c> 00:32:13.667 --> 00:32:15.569 <c.magenta>如果你来自iOS平台</c> 00:32:15.636 --> 00:32:18.906 <c.magenta>你可能不会使用太多的事件响应链</c> 00:32:18.972 --> 00:32:21.008 <c.magenta>就是那个小的橘黄色立方体</c> 00:32:21.074 --> 00:32:23.177 <c.magenta>在每个storyboard场景上面</c> 00:32:23.243 --> 00:32:25.012 <c.magenta>它是第一个相应者的代理</c> 00:32:25.612 --> 00:32:29.616 <c.magenta>如果你关联了一个</c> <c.magenta>控制器的动作到代理上</c> 00:32:29.850 --> 00:32:32.186 <c.magenta>它会自动的发送给响应链</c> 00:32:32.252 --> 00:32:33.520 <c.magenta>当控制器被触发</c> 00:32:34.788 --> 00:32:37.624 <c.magenta>如果在响应链中没有对象处理方法</c> <c.magenta>怎么办?</c> 00:32:38.325 --> 00:32:40.694 <c.magenta>或者在放大的情况下</c> 00:32:41.061 --> 00:32:43.230 <c.magenta>发送动作不总是很恰当怎么办?</c> 00:32:43.697 --> 00:32:46.066 <c.magenta>例如</c> <c.magenta>我们在最大化缩放层级</c> 00:32:46.133 --> 00:32:49.002 <c.magenta>我们不想让放大按钮不起作用</c> 00:32:49.369 --> 00:32:51.972 <c.magenta>在我们动作之前我们可以看到</c> 00:32:52.639 --> 00:32:54.274 <c.magenta>这就是UI验证的作用</c> 00:32:56.210 --> 00:33:00.047 <c.magenta>我们看看一段代码</c> <c.magenta>会自己审查验证UI</c> 00:32:56.210 --> 00:33:00.047 <c.magenta>我们看看一段代码</c> <c.magenta>会自己审查验证UI</c> 00:33:00.147 --> 00:33:02.149 <c.magenta>来判断一个控制器是否是可操作的</c> 00:33:02.916 --> 00:33:05.352 <c.magenta>第一步我们需要做的是</c> <c.magenta>请求NSApp</c> 00:33:05.419 --> 00:33:08.522 <c.magenta>获得一个控制器的目标动作</c> 00:33:09.389 --> 00:33:12.059 <c.magenta>这会自动遍历响应链</c> 00:33:12.125 --> 00:33:14.962 <c.magenta>寻找实现那个动作的某个对象</c> 00:33:15.295 --> 00:33:18.665 <c.magenta>或者可能没有发现任何动作</c> <c.magenta>甚至没有发现任何对象</c> 00:33:20.834 --> 00:33:23.237 <c.magenta>我们想要看的第一个例子的结果</c> 00:33:23.303 --> 00:33:27.374 <c.magenta>是实现NSUserInterface</c> <c.magenta>验证协议的任何对象</c> 00:33:27.875 --> 00:33:30.277 <c.magenta>这意味着你可以主动请求</c> 00:33:30.344 --> 00:33:31.478 <c.magenta>一个控制器是否有效</c> 00:33:31.979 --> 00:33:33.847 <c.magenta>如果你在等式的另一边</c> 00:33:33.914 --> 00:33:37.184 <c.magenta>并且你有一个控制器某些条件下有效</c> 00:33:37.251 --> 00:33:38.752 <c.magenta>你可以实现这个方法</c> 00:33:38.952 --> 00:33:41.288 <c.magenta>像NSMenuItem控制器</c> <c.magenta>和工具条单元</c> 00:33:41.355 --> 00:33:43.724 <c.magenta>会自动验证那个方法</c> 00:33:43.824 --> 00:33:45.392 <c.magenta>所以我们可以请求那个方法</c> 00:33:46.026 --> 00:33:48.595 <c.magenta>然后 当然 有些情况下</c> <c.magenta>某个对象</c> 00:33:48.662 --> 00:33:50.831 <c.magenta>无条件处理了那个方法</c> 00:33:50.998 --> 00:33:54.935 <c.magenta>或者一个对象也没有</c> <c.magenta>意味着我们没有准备好处理那个动作</c> 00:33:56.570 --> 00:33:58.639 <c.magenta>这是些专门应对</c> <c.magenta>storyboards的技巧</c> 00:33:59.273 --> 00:34:01.041 <c.magenta>现在我们已经讨论了很多关于</c> 00:33:59.273 --> 00:34:01.041 <c.magenta>现在我们已经讨论了很多关于</c> 00:34:01.341 --> 00:34:05.812 <c.magenta>创建应用程序设计时间方面的事情</c> 00:34:06.046 --> 00:34:07.848 <c.magenta>我们看看一些面向用户的特性</c> 00:34:07.915 --> 00:34:10.449 <c.magenta>可以帮助你充分利用我们的平台</c> 00:34:11.217 --> 00:34:13.587 <c.magenta>首先是用户活动</c> 00:34:14.955 --> 00:34:16.889 <c.magenta>NSUserActivity</c> <c.magenta>是这个对象</c> 00:34:17.123 --> 00:34:20.594 <c.magenta>描述了你的应用现正在做什么</c> 00:34:20.928 --> 00:34:22.728 <c.magenta>在看什么 在编辑什么</c> 00:34:23.130 --> 00:34:23.964 <c.magenta>等等</c> 00:34:24.565 --> 00:34:25.399 <c.magenta>并且</c> 00:34:25.465 --> 00:34:29.436 <c.magenta>Handoff使用这个对象使</c> <c.magenta>这些活动在各设备间移动</c> 00:34:29.503 --> 00:34:32.239 <c.magenta>有点类似把你的整个上下文</c> <c.magenta>在它们之间移动</c> 00:34:34.608 --> 00:34:37.610 <c.magenta>我没时间来深入看整个的API</c> 00:34:37.678 --> 00:34:40.480 <c.magenta>我想说这个对象确实比较简单</c> 00:34:41.348 --> 00:34:43.150 <c.magenta>你可用activityType</c> <c.magenta>构造它</c> 00:34:43.250 --> 00:34:46.753 <c.magenta>它是描述你正做的</c> <c.magenta>活动的唯一标识符</c> 00:34:46.853 --> 00:34:49.790 <c.magenta>同时也有一个密钥需要</c> <c.magenta>放到info plist中</c> 00:34:49.857 --> 00:34:53.393 <c.magenta>声明我是个好应用</c> <c.magenta>在其他设备上选择该活动</c> 00:34:54.561 --> 00:34:57.397 <c.magenta>然后你填充一些基本的配置信息</c> 00:34:57.464 --> 00:34:58.999 <c.magenta>来描述你的活动</c> 00:34:59.633 --> 00:35:02.636 <c.magenta>一个好的面向用户的标题</c> <c.magenta>或者一些用户信息</c> 00:34:59.633 --> 00:35:02.636 <c.magenta>一个好的面向用户的标题</c> <c.magenta>或者一些用户信息</c> 00:35:03.504 --> 00:35:07.007 <c.magenta>基本上只是基本的必需数据</c> 00:35:07.174 --> 00:35:09.643 <c.magenta>稍后跳回到那个任务</c> 00:35:10.244 --> 00:35:13.647 <c.magenta>我们想让这个字典一直保持较小</c> <c.magenta>因为它需要频繁无线传送</c> 00:35:13.714 --> 00:35:16.316 <c.magenta>我们也想让handoff交互快一点</c> 00:35:17.885 --> 00:35:19.753 <c.magenta>我们也需要在代理中</c> 00:35:20.087 --> 00:35:23.657 <c.magenta>添加关于上下文的绝对最新信息</c> 00:35:23.891 --> 00:35:27.127 <c.magenta>在我们执行handoff之前</c> <c.magenta>或前一刻</c> 00:35:27.694 --> 00:35:29.630 <c.magenta>它会被调用</c> 00:35:29.696 --> 00:35:31.532 <c.magenta>在你标记一个活动来保存后</c> 00:35:31.598 --> 00:35:34.701 <c.magenta>我们替你调用这个方法</c> <c.magenta>这样你可以填上最新数据</c> 00:35:37.471 --> 00:35:40.274 <c.magenta>我们如何确定哪个活动</c> <c.magenta>是当前活动?</c> 00:35:40.340 --> 00:35:42.709 <c.magenta>因为 当然 我们当然需要决定</c> 00:35:42.776 --> 00:35:44.545 <c.magenta>现在我们在看什么</c> 00:35:45.078 --> 00:35:47.548 <c.magenta>你可通过becomeCurrent</c> <c.magenta>手动管理</c> 00:35:47.614 --> 00:35:49.950 <c.magenta>和NSUserActivity上的</c> <c.magenta>resignCurrent方法</c> 00:35:50.551 --> 00:35:53.220 <c.magenta>就是说你可能需要跟踪你的用户</c> 00:35:53.287 --> 00:35:56.256 <c.magenta>在你的应用上</c> <c.magenta>搞清楚他们点击了什么</c> 00:35:56.323 --> 00:35:58.125 <c.magenta>并尝试搞清楚他们在做什么</c> 00:35:58.325 --> 00:35:59.826 <c.magenta>AppKit让这些变更简单</c> 00:36:00.661 --> 00:36:02.729 <c.magenta>通过让你附上活动</c> 00:36:02.796 --> 00:36:05.032 <c.magenta>到响应链可以自动管理</c> 00:36:06.466 --> 00:36:07.367 <c.magenta>比如</c> 00:36:07.434 --> 00:36:11.171 <c.magenta>假如我们创建了一个日历应用</c> <c.magenta>看起来就像我们的日历应用</c> 00:36:11.805 --> 00:36:15.342 <c.magenta>我们有两个活动</c> <c.magenta>想要放到响应链</c> 00:36:15.776 --> 00:36:19.479 <c.magenta>我们有该视图更高级</c> <c.magenta>的活动</c> 00:36:19.546 --> 00:36:21.448 <c.magenta>这整个</c> <c.magenta>这里的这个日视图</c> 00:36:21.515 --> 00:36:24.818 <c.magenta>然后我们有一个更具体的</c> <c.magenta>活动对这个具体的事件</c> 00:36:24.952 --> 00:36:27.754 <c.magenta>我们在这里看到</c> 00:36:29.256 --> 00:36:31.258 <c.magenta>通过添加这个到响应链</c> 00:36:31.325 --> 00:36:33.861 <c.magenta>当我们点击的那个事件</c> <c.magenta>让它成为第一个响应者</c> 00:36:34.127 --> 00:36:36.029 <c.magenta>那个活动变成了最近的一个</c> 00:36:36.196 --> 00:36:38.665 <c.magenta>在响应链中通过第一响应者</c> 00:36:38.966 --> 00:36:40.701 <c.magenta>它自动变成了当前的</c> 00:36:42.135 --> 00:36:42.970 <c.magenta>现在</c> 00:36:43.537 --> 00:36:47.708 <c.magenta>你之前可能没考虑使用Handoff</c> <c.magenta>或NSUserActivity API</c> 00:36:48.008 --> 00:36:50.177 <c.magenta>你可能没有iOS配套应用</c> 00:36:50.244 --> 00:36:53.514 <c.magenta>或者你不认为</c> <c.magenta>Handoff特别引人注目</c> 00:36:53.714 --> 00:36:55.782 <c.magenta>对你的应用和你的特定的需求</c> 00:36:56.216 --> 00:36:58.652 <c.magenta>但活动不仅</c> <c.magenta>Handoff使用</c> 00:36:59.353 --> 00:37:01.288 <c.magenta>Sierra新特性中</c> <c.magenta>我们在Mac上引入了Siri</c> 00:36:59.353 --> 00:37:01.288 <c.magenta>Sierra新特性中</c> <c.magenta>我们在Mac上引入了Siri</c> 00:37:01.655 --> 00:37:05.325 <c.magenta>Siri使用当前活动</c> <c.magenta>提供上下文命令</c> 00:37:06.093 --> 00:37:09.429 <c.magenta>例如 若你说</c> <c.magenta>在某个日期提醒我这事</c> 00:37:10.197 --> 00:37:12.733 <c.magenta>Siri会推断这个</c> <c.magenta>是指当前活动</c> 00:37:13.033 --> 00:37:15.536 <c.magenta>其实它甚至会用</c> <c.magenta>这个活动并把它嵌入</c> 00:37:15.769 --> 00:37:18.705 <c.magenta>到你的提醒里</c> <c.magenta>然后你可以在未来找到它</c> 00:37:19.206 --> 00:37:21.408 <c.magenta>所以我们认为</c> <c.magenta>活动是一种通用机制</c> 00:37:21.475 --> 00:37:24.478 <c.magenta>为了描述这一类信息</c> <c.magenta>不仅仅是为了Handoff</c> 00:37:26.079 --> 00:37:28.081 <c.magenta>现在</c> <c.magenta>关于Handoff API的信息</c> 00:37:28.148 --> 00:37:30.217 <c.magenta>我推荐大家看看2014的讲座</c> 00:37:30.484 --> 00:37:32.586 <c.magenta>“在OS X与iOS中</c> <c.magenta>采用Handoff”</c> 00:37:33.820 --> 00:37:35.856 <c.magenta>它涉及到许多高级话题</c> 00:37:35.923 --> 00:37:39.560 <c.magenta>像持续流可以让你在设备间</c> <c.magenta>传递更多数据</c> 00:37:42.696 --> 00:37:44.231 <c.magenta>下一个特性 恢复</c> 00:37:44.531 --> 00:37:46.500 <c.magenta>我们有时叫状态恢复</c> 00:37:46.934 --> 00:37:50.070 <c.magenta>它是Mac最棒的特性之一</c> <c.magenta>当你退出一个应用</c> 00:37:50.137 --> 00:37:53.407 <c.magenta>然后重新启动它</c> <c.magenta>它会回到你离开它时候的样子</c> 00:37:54.041 --> 00:37:55.342 <c.magenta>实际上 这个也会恢复</c> 00:37:55.676 --> 00:37:57.678 <c.magenta>如果你的应用崩溃或者重启了机器</c> 00:37:57.744 --> 00:38:00.180 <c.magenta>所有的东西恢复到之前的样子</c> 00:37:57.744 --> 00:38:00.180 <c.magenta>所有的东西恢复到之前的样子</c> 00:38:00.948 --> 00:38:02.683 <c.magenta>现在 实现这个效果</c> 00:38:04.184 --> 00:38:05.018 <c.magenta>我们需要</c> 00:38:06.286 --> 00:38:07.721 <c.magenta>保存所有的UI状态</c> 00:38:08.088 --> 00:38:09.156 <c.magenta>随着时间的推移积累</c> 00:38:09.756 --> 00:38:11.758 <c.magenta>然后恢复它</c> <c.magenta>当应用重新启动时</c> 00:38:12.759 --> 00:38:14.895 <c.magenta>明确说我们不想在模型里保存状态</c> 00:38:14.962 --> 00:38:16.530 <c.magenta>它并不真正属于那里</c> 00:38:17.564 --> 00:38:20.067 <c.magenta>所以一个状态恢复API给你</c> 00:38:20.133 --> 00:38:22.903 <c.magenta>一个明确的地方单独保存UI状态</c> 00:38:22.970 --> 00:38:26.373 <c.magenta>它给你一个好的地方恢复那个状态</c> <c.magenta>当你启动应用时</c> 00:38:26.673 --> 00:38:28.675 <c.magenta>但是在你的UI在屏幕上展示出来之前</c> 00:38:29.776 --> 00:38:31.311 <c.magenta>基本上你可在每个窗口启用它</c> 00:38:31.645 --> 00:38:34.081 <c.magenta>那相当简单</c> <c.magenta>设置isRestorable为真</c> 00:38:34.715 --> 00:38:36.683 <c.magenta>然后你提供一个恢复类</c> 00:38:37.050 --> 00:38:40.888 <c.magenta>处理创建你窗口的事件</c> 00:38:41.255 --> 00:38:42.489 <c.magenta>从编码的数据中</c> 00:38:42.956 --> 00:38:46.426 <c.magenta>好消息是若你用NSDocument</c> <c.magenta>NSDocument会处理这些</c> 00:38:48.262 --> 00:38:49.997 <c.magenta>我们想要恢复什么样的状态?</c> 00:38:50.597 --> 00:38:52.666 <c.magenta>我们可能选择保存</c> 00:38:53.066 --> 00:38:55.536 <c.magenta>当前应用中激活的工具</c> 00:38:56.436 --> 00:38:59.439 <c.magenta>我们还可能想保存侧边栏的状态</c> 00:38:59.506 --> 00:39:01.942 <c.magenta>我们选择了什么 我们滑动了多少位移</c> 00:38:59.506 --> 00:39:01.942 <c.magenta>我们选择了什么 我们滑动了多少位移</c> 00:39:03.410 --> 00:39:04.244 <c.magenta>我们如何来做?</c> 00:39:04.978 --> 00:39:08.382 <c.magenta>好吧 若你之前用过NSCoding</c> <c.magenta>那是非常非常简单</c> 00:39:09.550 --> 00:39:13.387 <c.magenta>第一个方法</c> <c.magenta>带有编码器的encodeRestorableState</c> 00:39:14.221 --> 00:39:16.423 <c.magenta>你可以在任何</c> <c.magenta>NSResponder方法上实现</c> 00:39:16.490 --> 00:39:19.927 <c.magenta>并且就像使用NSCoding一样</c> <c.magenta>但是这是为了控制器的高效率</c> 00:39:22.629 --> 00:39:25.666 <c.magenta>另一个重要的调用是</c> <c.magenta>invalidateRestorableState</c> 00:39:26.466 --> 00:39:29.136 <c.magenta>这就是说无论如何我的</c> <c.magenta>支持数据是什么</c> 00:39:29.570 --> 00:39:32.406 <c.magenta>对encodeRestorableState</c> <c.magenta>已经在某种程度上改变了</c> 00:39:33.040 --> 00:39:35.442 <c.magenta>我们将安排确保再一次保存状态</c> 00:39:35.509 --> 00:39:36.610 <c.magenta>在未来的某时</c> 00:39:38.512 --> 00:39:40.214 <c.magenta>并且最终简单的恢复</c> 00:39:40.280 --> 00:39:43.183 <c.magenta>这确实像你想的一样</c> <c.magenta>非常像initWithCoder</c> 00:39:43.951 --> 00:39:45.352 <c.magenta>你只需调用super</c> 00:39:45.686 --> 00:39:48.422 <c.magenta>解码您已编码的所有已编码的数据</c> 00:39:48.856 --> 00:39:52.025 <c.magenta>然后根据你已编码的信息</c> <c.magenta>设置你的UI</c> 00:39:54.328 --> 00:39:57.397 <c.magenta>现在 这太容易了</c> <c.magenta>但是可以使它变得更容易</c> 00:39:57.998 --> 00:40:01.635 <c.magenta>你只需实现一个类方法</c> <c.magenta>restorableState KeyPaths</c> 00:39:57.998 --> 00:40:01.635 <c.magenta>你只需实现一个类方法</c> <c.magenta>restorableState KeyPaths</c> 00:40:02.169 --> 00:40:04.671 <c.magenta>请求一下super</c> <c.magenta>因为这是有礼貌的行为</c> 00:40:04.738 --> 00:40:06.974 <c.magenta>但接着</c> <c.magenta>也得添加我们的关键路径</c> 00:40:07.441 --> 00:40:10.410 <c.magenta>并且这是你希望的可以自动恢复的属性</c> 00:40:10.677 --> 00:40:13.180 <c.magenta>或者通过系统存储和恢复</c> 00:40:13.714 --> 00:40:15.182 <c.magenta>这些属性需为KVC</c> 00:40:15.415 --> 00:40:18.452 <c.magenta>这些键值编码可以访问</c> <c.magenta>就像我们通过关键路径访问</c> 00:40:18.519 --> 00:40:21.421 <c.magenta>并且它们也需要有可观察性</c> <c.magenta>以便于我们可以随时观察它们</c> 00:40:21.855 --> 00:40:23.824 <c.magenta>当它们变得无效或者状态改变时</c> 00:40:25.692 --> 00:40:27.060 <c.magenta>这是状态恢复</c> 00:40:27.928 --> 00:40:31.131 <c.magenta>我们接下来看第三个和最后一个技术</c> <c.magenta>在云端的文件</c> 00:40:32.165 --> 00:40:33.667 <c.magenta>很久以前</c> 00:40:34.168 --> 00:40:35.769 <c.magenta>在云端选择文件</c> 00:40:35.836 --> 00:40:38.605 <c.magenta>不得不主动选择并创建一个容器</c> 00:40:39.106 --> 00:40:42.342 <c.magenta>但伴随着iCloud Drive</c> <c.magenta>尤其现iCloud Desktop</c> 00:40:42.409 --> 00:40:43.777 <c.magenta>和文档的发展</c> 00:40:44.111 --> 00:40:46.613 <c.magenta>很可能你的应用正使用文档</c> 00:40:46.680 --> 00:40:47.648 <c.magenta>存于云端</c> 00:40:48.515 --> 00:40:50.617 <c.magenta>这很重要</c> <c.magenta>因为10.12版本新特性中</c> 00:40:51.151 --> 00:40:54.188 <c.magenta>本地的文件可能因为要腾出空间</c> <c.magenta>而被移除</c> 00:40:54.555 --> 00:40:57.257 <c.magenta>这意味着你可能会正在使用一些</c> 00:40:57.558 --> 00:40:59.359 <c.magenta>并不是真的在本地硬盘上的文件</c> 00:41:00.761 --> 00:41:02.930 <c.magenta>我们如何处理这问题呢?</c> <c.magenta>这看起来非常可怕</c> 00:41:04.331 --> 00:41:06.400 <c.magenta>幸运的是</c> <c.magenta>若你使用NSDocument</c> 00:41:06.466 --> 00:41:08.902 <c.magenta>它将为你处理一切因此</c> <c.magenta>你无需担心</c> 00:41:09.736 --> 00:41:12.739 <c.magenta>如果你没有使用</c> <c.magenta>你需要确定你正使用文件协调器</c> 00:41:13.240 --> 00:41:15.709 <c.magenta>若你将自己注册为</c> <c.magenta>文件演示者</c> 00:41:15.776 --> 00:41:17.144 <c.magenta>通过文件协调器API</c> 00:41:17.511 --> 00:41:20.514 <c.magenta>我们将确认文件没有被程序移除</c> 00:41:20.914 --> 00:41:21.882 <c.magenta>这是一件好事</c> 00:41:22.583 --> 00:41:24.484 <c.magenta>接下来如果你使用文件协调器</c> 00:41:24.785 --> 00:41:27.421 <c.magenta>来协调文件IO</c> 00:41:27.821 --> 00:41:31.525 <c.magenta>我们将会确保方便安排你的IO</c> 00:41:31.658 --> 00:41:33.827 <c.magenta>当这个文件被完全下载以后</c> 00:41:35.729 --> 00:41:37.264 <c.magenta>这些在云里的文件</c> 00:41:37.664 --> 00:41:40.400 <c.magenta>这有一些技术我们没有时间详细论述</c> 00:41:40.467 --> 00:41:42.436 <c.magenta>但是我确实想要给你们一个提示</c> 00:41:42.669 --> 00:41:44.271 <c.magenta>首先是资源目录</c> 00:41:44.705 --> 00:41:47.608 <c.magenta>比在你包里松散资源更快更小</c> 00:41:47.908 --> 00:41:51.044 <c.magenta>它们也可以帮助你</c> <c.magenta>比如广色域和从右向左</c> 00:41:51.745 --> 00:41:54.147 <c.magenta>可访问性 十分重要</c> 00:41:54.515 --> 00:41:57.184 <c.magenta>Cocoa搭载了功能确实强大的</c> <c.magenta>可访问性技术</c> 00:41:57.251 --> 00:41:59.353 <c.magenta>你的应用轻松拥有的技术</c> 00:41:59.586 --> 00:42:02.389 <c.magenta>你得确保</c> 00:41:59.586 --> 00:42:02.389 <c.magenta>你得确保</c> 00:42:02.456 --> 00:42:05.559 <c.magenta>学着使用voice over和</c> <c.magenta>所有这些可访问技术十分重要</c> 00:42:05.626 --> 00:42:07.661 <c.magenta>确保你的应用做正确的事情</c> 00:42:07.794 --> 00:42:11.098 <c.magenta>你永远不应该发布一个</c> <c.magenta>用户界面有问题的应用</c> 00:42:11.164 --> 00:42:15.002 <c.magenta>所以不要让一个UI有问题的应用上市</c> 00:42:16.670 --> 00:42:19.439 <c.magenta>沙盒和XPC服务</c> 00:42:20.007 --> 00:42:22.476 <c.magenta>两个不同的但有关连的技术</c> 00:42:22.676 --> 00:42:24.444 <c.magenta>这两个技术可以帮你隔离代码</c> 00:42:24.511 --> 00:42:26.947 <c.magenta>从系统的其他部分和其他进程中</c> 00:42:27.047 --> 00:42:29.816 <c.magenta>沙盒对于Mac</c> <c.magenta>App Store是强制性的</c> 00:42:29.883 --> 00:42:31.818 <c.magenta>但它对每一个应用都是合适的</c> 00:42:32.786 --> 00:42:35.489 <c.magenta>XPC服务 可以帮助你分离出代码</c> 00:42:35.556 --> 00:42:36.990 <c.magenta>到分离的进程中</c> 00:42:38.158 --> 00:42:39.993 <c.magenta>这是非常棒的对一些事 如</c> 00:42:40.060 --> 00:42:43.363 <c.magenta>处理一些不可信网络的数据</c> 00:42:43.430 --> 00:42:45.465 <c.magenta>或者做一些分析工作</c> 00:42:46.667 --> 00:42:49.136 <c.magenta>我们都认为我们的代码是最棒的</c> 00:42:49.369 --> 00:42:51.271 <c.magenta>但是如我们开车时系安全带</c> 00:42:51.572 --> 00:42:54.541 <c.magenta>这样在发生问题时我们会有保障</c> 00:42:56.844 --> 00:43:01.114 <c.magenta>我们在短短的时间内讲了大量的内容</c> 00:42:56.844 --> 00:43:01.114 <c.magenta>我们在短短的时间内讲了大量的内容</c> 00:43:01.181 --> 00:43:04.151 <c.magenta>所以我想带你们重温一下重点内容</c> <c.magenta>确保你们都还记得</c> 00:43:04.418 --> 00:43:05.686 <c.magenta>就像我们刚刚谈论的</c> 00:43:06.353 --> 00:43:09.623 <c.magenta>我们以创造一个“现代化外观”开始</c> 00:43:10.224 --> 00:43:12.359 <c.magenta>通过我们的现代化视图与窗口管道</c> 00:43:12.426 --> 00:43:14.828 <c.magenta>确保你可以做出流畅的动画</c> 00:43:15.095 --> 00:43:17.698 <c.magenta>接下来我们讲了拖放与事件追踪</c> 00:43:17.764 --> 00:43:20.901 <c.magenta>确保你得到一个非常酷的拖动群集效果</c> 00:43:20.968 --> 00:43:22.669 <c.magenta>现代化拖动</c> <c.magenta>file promises</c> 00:43:23.370 --> 00:43:26.340 <c.magenta>接着我们讲了容器视图</c> <c.magenta>像是滚动视图和表视图</c> 00:43:26.406 --> 00:43:28.509 <c.magenta>并且确保可以正确将其本地化</c> 00:43:29.910 --> 00:43:32.813 <c.magenta>然后我们讲了系统的外观</c> <c.magenta>storyboards</c> 00:43:33.013 --> 00:43:35.616 <c.magenta>还有一些现代的Mac特性</c> 00:43:35.682 --> 00:43:38.519 <c.magenta>使Mac平台炫目 并且确实有益</c> 00:43:39.219 --> 00:43:42.923 <c.magenta>这有我们演讲的永久链接</c> <c.magenta>你应该可以从这里找到相关资源</c> 00:43:42.990 --> 00:43:45.692 <c.magenta>包括我们的演示应用下载</c> 00:43:45.759 --> 00:43:47.327 <c.magenta>一旦该应用就绪</c> 00:43:48.462 --> 00:43:50.030 <c.magenta>所有相关演讲已结束</c> 00:43:50.097 --> 00:43:51.431 <c.magenta>我希望你出席了那些演讲</c> 00:43:51.498 --> 00:43:54.601 <c.magenta>如果没有</c> <c.magenta>希望你一定要在线观看视频</c> 00:43:55.802 --> 00:43:57.404 <c.magenta>就这样</c> <c.magenta>谢谢大家的参与</c>
{ "pile_set_name": "Github" }
package org.hisp.dhis.common.adapter; /* * Copyright (c) 2004-2020, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * Neither the name of the HISP project 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. */ import java.io.IOException; import org.hisp.dhis.period.Period; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; /** * @author Morten Olav Hansen <mortenoh@gmail.com> */ public class JacksonPeriodSerializer extends JsonSerializer<Period> { @Override public void serialize( Period value, JsonGenerator jgen, SerializerProvider provider ) throws IOException { if ( value != null && value.getIsoDate() != null ) { jgen.writeStartObject(); jgen.writeStringField( "id", value.getIsoDate() ); if ( value.getName() != null ) { jgen.writeStringField( "name", value.getName() ); } jgen.writeEndObject(); } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleIdentifier</key> <string>com.apple.xcode.dsym.BinaryDelta</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>dSYM</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleVersion</key> <string>1</string> </dict> </plist>
{ "pile_set_name": "Github" }
<!-- masthead --> <div class="ui masthead segment blue-round-gradient"> <div class="ui page grid"> <div class="column"> {% include menu.html %} </div> </div> </div> <!-- /masthead -->
{ "pile_set_name": "Github" }
stop <- function(..., call. = FALSE){ base::stop(..., call. = FALSE) }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>ExampleTests</key> <dict> <key>BundleIdentifiersForCrashReportEmphasis</key> <array> <string>org.openbakery.test.Example.watchkitapp</string> <string>org.openbakery.test.Example.watchkitapp.watchkitextension</string> <string>org.openbakery.test.Example</string> <string>org.openbakery.test.ExampleTests</string> <string>org.openbakery.test.Example.Widget</string> </array> <key>ClangProfileDataGenerationFilePath</key> <string>__DERIVEDDATA__/Build/Intermediates/CodeCoverage/ProfileData</string> <key>ClangProfileFilePath</key> <string>__DERIVEDDATA__/Build/Intermediates/CodeCoverage/Coverage.profdata</string> <key>CommandLineArguments</key> <array/> <key>DependentProductPaths</key> <array> <string>__TESTROOT__/Test-watchsimulator/Example WatchKit Extension.appex</string> <string>__TESTROOT__/Test-iphonesimulator/Example.app/PlugIns/ExampleTests.xctest</string> <string>__TESTROOT__/Test-iphonesimulator/Example.app</string> <string>__TESTROOT__/Test-iphonesimulator/ExampleTodayWidget.appex</string> <string>__TESTROOT__/Test-watchsimulator/Example WatchKit App.app</string> </array> <key>EnvironmentVariables</key> <dict> <key>DYLD_FRAMEWORK_PATH</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> <key>DYLD_LIBRARY_PATH</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> <key>OS_ACTIVITY_DT_MODE</key> <string>YES</string> <key>__XCODE_BUILT_PRODUCTS_DIR_PATHS</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> <key>__XPC_DYLD_FRAMEWORK_PATH</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> <key>__XPC_DYLD_LIBRARY_PATH</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> </dict> <key>IsAppHostedTestBundle</key> <true/> <key>ProductModuleName</key> <string>ExampleTests</string> <key>TestBundlePath</key> <string>__TESTHOST__/PlugIns/ExampleTests.xctest</string> <key>TestHostBundleIdentifier</key> <string>org.openbakery.test.Example</string> <key>TestHostPath</key> <string>__TESTROOT__/Test-iphonesimulator/Example.app</string> <key>TestingEnvironmentVariables</key> <dict> <key>DTX_CONNECTION_SERVICES_PATH</key> <string>__PLATFORMS__/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Developer/Library/PrivateFrameworks/DTXConnectionServices.framework</string> <key>DYLD_FRAMEWORK_PATH</key> <string>__TESTROOT__/Test-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/Frameworks</string> <key>DYLD_INSERT_LIBRARIES</key> <string>__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection</string> <key>DYLD_LIBRARY_PATH</key> <string>__TESTROOT__/Test-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/Frameworks</string> <key>XCInjectBundleInto</key> <string>__TESTHOST__/Example</string> <key>XCODE_DBG_XPC_EXCLUSIONS</key> <string>com.apple.dt.xctestSymbolicator</string> </dict> <key>ToolchainsSettingValue</key> <array/> </dict> <key>SecondExampleTests</key> <dict> <key>BundleIdentifiersForCrashReportEmphasis</key> <array> <string>org.openbakery.test.Example.watchkitapp</string> <string>org.openbakery.test.Example.watchkitapp.watchkitextension</string> <string>org.openbakery.test.Example</string> <string>org.openbakery.test.ExampleTests</string> <string>org.openbakery.test.Example.Widget</string> </array> <key>ClangProfileDataGenerationFilePath</key> <string>__DERIVEDDATA__/Build/Intermediates/CodeCoverage/ProfileData</string> <key>ClangProfileFilePath</key> <string>__DERIVEDDATA__/Build/Intermediates/CodeCoverage/Coverage.profdata</string> <key>CommandLineArguments</key> <array/> <key>DependentProductPaths</key> <array> <string>__TESTROOT__/Test-watchsimulator/Example WatchKit Extension.appex</string> <string>__TESTROOT__/Test-iphonesimulator/Example.app/PlugIns/ExampleTests.xctest</string> <string>__TESTROOT__/Test-iphonesimulator/Example.app</string> <string>__TESTROOT__/Test-iphonesimulator/ExampleTodayWidget.appex</string> <string>__TESTROOT__/Test-watchsimulator/Example WatchKit App.app</string> </array> <key>EnvironmentVariables</key> <dict> <key>DYLD_FRAMEWORK_PATH</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> <key>DYLD_LIBRARY_PATH</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> <key>OS_ACTIVITY_DT_MODE</key> <string>YES</string> <key>__XCODE_BUILT_PRODUCTS_DIR_PATHS</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> <key>__XPC_DYLD_FRAMEWORK_PATH</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> <key>__XPC_DYLD_LIBRARY_PATH</key> <string>/Users/jondoe/workspace/iOS/Example/build/sym/Test-iphonesimulator:/Users/jondoe/workspace/iOS/Example/build/sym/Test-watchsimulator</string> </dict> <key>IsAppHostedTestBundle</key> <true/> <key>ProductModuleName</key> <string>ExampleTests</string> <key>TestBundlePath</key> <string>__TESTHOST__/PlugIns/ExampleTests.xctest</string> <key>TestHostBundleIdentifier</key> <string>org.openbakery.test.Example</string> <key>TestHostPath</key> <string>__TESTROOT__/Test-iphonesimulator/Example.app</string> <key>TestingEnvironmentVariables</key> <dict> <key>DTX_CONNECTION_SERVICES_PATH</key> <string>__PLATFORMS__/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Developer/Library/PrivateFrameworks/DTXConnectionServices.framework</string> <key>DYLD_FRAMEWORK_PATH</key> <string>__TESTROOT__/Test-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/Frameworks</string> <key>DYLD_INSERT_LIBRARIES</key> <string>__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection</string> <key>DYLD_LIBRARY_PATH</key> <string>__TESTROOT__/Test-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/Frameworks</string> <key>XCInjectBundleInto</key> <string>__TESTHOST__/Example</string> <key>XCODE_DBG_XPC_EXCLUSIONS</key> <string>com.apple.dt.xctestSymbolicator</string> </dict> <key>ToolchainsSettingValue</key> <array/> </dict> </dict> </plist>
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #pragma mark - // // File: /Applications/Xcode-7GM.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/IMDaemonCore.framework/IMDaemonCore // UUID: 6609B634-92BE-31E4-933B-7BB28CA7E8CB // // Arch: x86_64 // Current version: 800.0.0 // Compatibility version: 1.0.0 // Source version: 1511.7.3.0.0 // Minimum iOS version: 9.0.0 // SDK version: 9.0.0 // // // This file does not contain any Objective-C runtime information. //
{ "pile_set_name": "Github" }
# urllib2 work-alike interface # ...from urllib2... from urllib2 import \ URLError, \ HTTPError, \ BaseHandler, \ UnknownHandler, \ FTPHandler, \ CacheFTPHandler # ...and from mechanize from _auth import \ HTTPPasswordMgr, \ HTTPPasswordMgrWithDefaultRealm, \ AbstractBasicAuthHandler, \ AbstractDigestAuthHandler, \ HTTPProxyPasswordMgr, \ ProxyHandler, \ ProxyBasicAuthHandler, \ ProxyDigestAuthHandler, \ HTTPBasicAuthHandler, \ HTTPDigestAuthHandler, \ HTTPSClientCertMgr from _debug import \ HTTPResponseDebugProcessor, \ HTTPRedirectDebugProcessor from _file import \ FileHandler # crap ATM ## from _gzip import \ ## HTTPGzipProcessor from _http import \ HTTPHandler, \ HTTPDefaultErrorHandler, \ HTTPRedirectHandler, \ HTTPEquivProcessor, \ HTTPCookieProcessor, \ HTTPRefererProcessor, \ HTTPRefreshProcessor, \ HTTPErrorProcessor, \ HTTPRobotRulesProcessor, \ RobotExclusionError import httplib if hasattr(httplib, 'HTTPS'): from _http import HTTPSHandler del httplib from _opener import OpenerDirector, \ SeekableResponseOpener, \ build_opener, install_opener, urlopen from _request import \ Request from _seek import \ SeekableProcessor from _upgrade import \ HTTPRequestUpgradeProcessor, \ ResponseUpgradeProcessor
{ "pile_set_name": "Github" }
DEFINED_PHASES=install postinst prepare DEPEND=X? ( >=x11-apps/mkfontscale-1.2.0 ) sys-libs/ncurses:0= >=app-portage/elt-patches-20170815 || ( >=sys-devel/automake-1.16.1:1.16 >=sys-devel/automake-1.15.1:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4 DESCRIPTION=An ncurses based app to show a scrolling screen from the Matrix EAPI=6 HOMEPAGE=https://sourceforge.net/projects/cmatrix/ IUSE=X KEYWORDS=~alpha amd64 hppa ppc ppc64 sparc x86 LICENSE=GPL-2 RDEPEND=X? ( >=x11-apps/mkfontscale-1.2.0 ) sys-libs/ncurses:0= SLOT=0 SRC_URI=mirror://sourceforge/cmatrix/cmatrix-1.2a.tar.gz _eclasses_=autotools 7d999b62b8749fad43fff00620cedf47 libtool f143db5a74ccd9ca28c1234deffede96 multilib 98584e405e2b0264d37e8f728327fed1 toolchain-funcs 605c126bed8d87e4378d5ff1645330cb _md5_=49af8d8881e131f4ab1c7093e272dbda
{ "pile_set_name": "Github" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: serializedVersion: 6 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Agent_VisorHappy_Mat m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _EMISSION m_LightmapFlags: 1 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: serializedVersion: 3 m_TexEnvs: - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailMask: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailNormalMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _EmissionMap: m_Texture: {fileID: 2800000, guid: 4309789647c8adf4a964e77c4526dde7, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: m_Texture: {fileID: 2800000, guid: fe914632ae5be154f94563fd6252622b, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - _BumpScale: 1 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - _DstBlend: 0 - _GlossMapScale: 1 - _Glossiness: 0 - _GlossyReflections: 1 - _Metallic: 0 - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - _UVSec: 0 - _ZWrite: 1 m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0.632288, g: 0.990566, b: 0.5934051, a: 1}
{ "pile_set_name": "Github" }
\chapter{Various} \section{Dynamic programming} When doing DP on intervals: $a[i][j] = \min_{i < k < j}(a[i][k] + a[k][j]) + f(i, j)$, where the (minimal) optimal $k$ increases with both $i$ and $j$, \begin{itemize} \item one can solve intervals in increasing order of length, and search $k = p[i][j]$ for $a[i][j]$ only between $p[i][j-1]$ and $p[i+1][j]$. \item This is known as Knuth DP. Sufficient criteria for this are if $f(b,c) \le f(a,d)$ and $f(a,c) + f(b,d) \le f(a,d) + f(b,c)$ for all $a \le b \le c \le d$. \item Consider also: LineContainer (ch. Data structures), monotone queues, ternary search. \end{itemize} \kactlimport{CircLCS.h} \kactlimport{SMAWK.h} \section{Debugging tricks} \begin{itemize} \item \texttt{signal(SIGSEGV, [](int) \{ \_Exit(0); \});} converts segfaults into Wrong Answers. Similarly one can catch SIGABRT (assertion failures) and SIGFPE (zero divisions). \texttt{\_GLIBCXX\_DEBUG} violations generate SIGABRT (or SIGSEGV on gcc 5.4.0 apparently). \item \texttt{feenableexcept(29);} kills the program on NaNs (\texttt 1), 0-divs (\texttt 4), infinities (\texttt 8) and denormals (\texttt{16}). \end{itemize} \section{Optimization tricks} \subsection{Bit hacks} \begin{itemize} \item \texttt{x \& -x} is the least bit in \texttt{x}. \item \texttt{for (int x = m; x; ) \{ --x \&= m; ... \}} loops over all subset masks of \texttt{m} (except \texttt{m} itself). \item \texttt{c = x\&-x, r = x+c; (((r\^{}x) >> 2)/c) | r} is the next number after \texttt{x} with the same number of bits set. \item \texttt{ F0R(b,k) F0R(i,1<<K) if (i\&1<<b) D[i] += D[i\^{}(1<<b)]; } computes all sums of subsets. \end{itemize} \subsection{Pragmas} \begin{itemize} \item \lstinline{#pragma GCC optimize ("Ofast")} will make GCC auto-vectorize for loops and optimizes floating points better (assumes associativity and turns off denormals). \item \lstinline{#pragma GCC target ("avx,avx2")} can double performance of vectorized code, but causes crashes on old machines. Also consider older \lstinline{#pragma GCC target ("sse4")}. \item \lstinline{#pragma GCC optimize ("trapv")} kills the program on integer overflows (but is really slow). \end{itemize} \kactlimport{BumpAllocator.h} \kactlimport{SmallPtr.h} % \kactlimport{BumpAllocatorSTL.h} \kactlimport{FastIO.h} \section{Other languages} % \kactlimport{Main.java} \kactlimport{Python3.py} \kactlimport{Kotlin.kt}
{ "pile_set_name": "Github" }
// All of these formats are defined in this specification: http://json-schema.org/latest/json-schema-validation.html#rfc.section.8.3 interface MyObject { /** * @TJS-format date-time */ dateTime: string; /** * @TJS-format email */ email: string; /** * @TJS-format hostname */ hostname: string; /** * @TJS-format ipv4 */ ipv4: string; /** * @TJS-format ipv6 */ ipv6: string; /** * @TJS-format uri */ uri: string; /** * @TJS-format uri-reference */ uriReference: string; /** * @TJS-format uri-template */ uriTemplate: string; /** * @TJS-format json-pointer */ jsonPointer: string; /** * @TJS-pattern ^[a-zA-Z0-9]{4}-abc_123$ */ regexPattern: string; /** * @TJS-pattern ^[a-zA-Z0-9]{4}-abc_123$ */ regexPatternWithWhitespace: string; /** * @TJS-minimum 5 */ oneCharacter: number; /** * @TJS-examples ["foo", 1] */ examples: string; /** * @TJS-hide */ booleanAnnotationDefaultValue: string; /** * @TJS-hide true */ booleanAnnotationWithTrue: string; /** * @TJS-hide false */ booleanAnnotationWithFalse: string; }
{ "pile_set_name": "Github" }
class CreateCommunityPaymentGateways < ActiveRecord::Migration def change create_table :community_payment_gateways do |t| t.integer :community_id t.integer :payment_gateway_id t.string :braintree_merchant_id t.string :braintree_master_merchant_id t.string :braintree_public_key t.string :braintree_private_key t.timestamps end end end
{ "pile_set_name": "Github" }
require 'idaclient' require 'metasm' # load in metasm the same binary as currently loaded in IDA # from IDA, get all xrefs to the function under the cursor # retrieve the address of each function for each xref # disassemble these functions in metasm # backtrace the 'ebx' argument value for each xref # update IDA with a comment at the call sites with the values found ida = IdaClient.new # retrieve preliminary info from IDA puts "loading binary in metasm" cur_binary = ida.get_input_path dasm = Metasm::AutoExe.decode_file(cur_binary).disassembler target_func = ida.get_cursor_pos backtrace_expr = dasm.cpu.size == 32 ? :ebx : :rbx # retrieve all xrefs, and the associated function start / function blocks all_blocks = [] all_xrefs = [] seen_func = {} ida.batch { ida.get_xrefs_to(target_func) { |xrs| xrs.each { |xr| all_xrefs << xr ida.get_function_name(xr) { |xr_func_name| next if seen_func[xr_func_name] seen_func[xr_func_name] = true ida.resolve_label(xr_func_name) { |xr_func_addr| # ensure we dasm from func entry first all_blocks << xr_func_addr # retrieve all blocks from the function as seen by IDA (to handle jmp tables, exception routines etc) ida.get_function_blocks(xr_func_addr) { |blk| all_blocks.concat blk } } } } } } # disassemble these in metasm, dont dasm subfunctions puts "disassemble #{all_blocks.length} blocks" all_blocks.each { |f| dasm.disassemble_fast(f) } # make backtracking over ignored subfunctions work dasm.each_instructionblock { |b| if b.to_subfuncret and b.to_subfuncret != [] b.each_to_normal { |t| dasm.function[t] ||= dasm.function[:default] } end } # backtrace comments = {} all_xrefs.each { |xr| bt = dasm.backtrace(backtrace_expr, xr) # keep only values that we could resolve to a numeric value values = bt.map { |val| dasm.normalize(val) }.grep(::Integer) next if values.empty? values_cmt = values.map { |val| '%x' % val }.join('/') comments[xr] = "#{backtrace_expr}=#{values_cmt}" puts "#{dasm.di_at(xr)} ; #{comments[xr]}" } # add comments to the IDB ida.batch { comments.each { |xr, cmt| ida.set_comment(xr, cmt) } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package p1; public class C extends A { }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="../style/style.css" /> <title>Liberation: x86 Instruction Set Reference</title> <link rel="icon" type="image/ico" href="../icon/siyobik.ico" /> <meta name="keywords" content="assembly,asm,programming,optimization,optimisation,c,c++,x86,pastebin,opcode,opcodes,dictionary,intel,amd,download,downloads,tutorial" /> <meta name="description" content="x86 assembly tutorials, x86 opcode reference, programming, pastebin with syntax highlighting" /> <meta name="robots" content="index, follow" /> </head> <body> <div class="main_container"><h1>x86 Instruction Set Reference</h1> <script type="text/javascript"> //<![CDATA[ document.title = "CALL: Call Procedure (x86 Instruction Set Reference)"; //]]> </script> <h1>CALL</h1> <h2>Call Procedure</h2> <object> <table class="box"> <tr> <th>Opcode</th> <th>Mnemonic</th> <th>Description</th> </tr> <tr> <td class="grid"><code>E8 cw</code></td> <td class="grid"><code>CALL rel16</code></td> <td class="grid">Call near, relative, displacement relative to next instruction</td> </tr> <tr> <td class="grid"><code>E8 cd</code></td> <td class="grid"><code>CALL rel32</code></td> <td class="grid">Call near, relative, displacement relative to next instruction</td> </tr> <tr> <td class="grid"><code>FF /2</code></td> <td class="grid"><code>CALL r/m16</code></td> <td class="grid">Call near, absolute indirect, address given in r/m16</td> </tr> <tr> <td class="grid"><code>FF /2</code></td> <td class="grid"><code>CALL r/m32</code></td> <td class="grid">Call near, absolute indirect, address given in r/m32</td> </tr> <tr> <td class="grid"><code>9A cd</code></td> <td class="grid"><code>CALL ptr16:16</code></td> <td class="grid">Call far, absolute, address given in operand</td> </tr> <tr> <td class="grid"><code>9A cp</code></td> <td class="grid"><code>CALL ptr16:32</code></td> <td class="grid">Call far, absolute, address given in operand</td> </tr> <tr> <td class="grid"><code>FF /3</code></td> <td class="grid"><code>CALL m16:16</code></td> <td class="grid">Call far, absolute indirect, address given in m16:16</td> </tr> <tr> <td class="grid"><code>FF /3</code></td> <td class="grid"><code>CALL m16:32</code></td> <td class="grid">Call far, absolute indirect, address given in m16:32</td> </tr> </table> </object> <object> <table class="box"> <tr> <th>Description</th> </tr> <tr> <td class="instruction_set_reference_box"> <p>Saves procedure linking information on the stack and branches to the procedure (called procedure) specified with the destination (target) operand. The target operand specifies the address of the first instruction in the called procedure. This operand can be an immediate value, a generalpurpose register, or a memory location.</p> <p>This instruction can be used to execute four different types of calls:</p> <dl> <dt>Near call</dt> <dd>A call to a procedure within the current code segment (the segment currently pointed to by the CS register), sometimes referred to as an intrasegment call.</dd> <dt>Far call</dt> <dd>A call to a procedure located in a different segment than the current code segment, sometimes referred to as an intersegment call.</dd> <dt>Inter-privilege-level far call</dt> <dd>A far call to a procedure in a segment at a different privilege level than that of the currently executing program or procedure.</dd> <dt>Task switch</dt> <dd>A call to a procedure located in a different task.</dd> </dl> <p>The latter two call types (inter-privilege-level call and task switch) can only be executed in protected mode. See the section titled &quot;Calling Procedures Using Call and RET&quot; in Chapter 6 of the IA-32 Intel Architecture Software Developer's Manual, Volume 1, for additional information on near, far, and inter-privilege-level calls. See Chapter 6, Task Management, in the IA-32 Intel Architecture Software Developer's Manual, Volume 3, for information on performing task switches with the CALL instruction.</p> <h3>Near Call</h3><p>When executing a near call, the processor pushes the value of the EIP register (which contains the offset of the instruction following the CALL instruction) onto the stack (for use later as a return-instruction pointer). The processor then branches to the address in the current code segment specified with the target operand. The target operand specifies either an absolute offset in the code segment (that is an offset from the base of the code segment) or a relative offset (a signed displacement relative to the current value of the instruction pointer in the EIP register, which points to the instruction following the CALL instruction). The CS register is not changed on near calls.</p> <p>For a near call, an absolute offset is specified indirectly in a general-purpose register or a memory location (r/m16 or r/m32). The operand-size attribute determines the size of the target operand (16 or 32 bits). Absolute offsets are loaded directly into the EIP register. If the operandsize attribute is 16, the upper two bytes of the EIP register are cleared, resulting in a maximum instruction pointer size of 16 bits. (When accessing an absolute offset indirectly using the stack pointer [ESP] as a base register, the base value used is the value of the ESP before the instruction executes.) A relative offset (rel16 or rel32) is generally specified as a label in assembly code, but at the machine code level, it is encoded as a signed, 16- or 32-bit immediate value. This value is added to the value in the EIP register. As with absolute offsets, the operand-size attribute determines the size of the target operand (16 or 32 bits).</p> <h3>Far Calls in Real-Address or Virtual-8086 Mode</h3><p>When executing a far call in realaddress or virtual-8086 mode, the processor pushes the current value of both the CS and EIP registers onto the stack for use as a return-instruction pointer. The processor then performs a &quot;far branch&quot; to the code segment and offset specified with the target operand for the called procedure.</p> <p>Here the target operand specifies an absolute far address either directly with a pointer (ptr16:16 or ptr16:32) or indirectly with a memory location (m16:16 or m16:32). With the pointer method, the segment and offset of the called procedure is encoded in the instruction, using a 4-byte (16-bit operand size) or 6-byte (32-bit operand size) far address immediate. With the indirect method, the target operand specifies a memory location that contains a 4-byte (16-bit operand size) or 6-byte (32-bit operand size) far address. The operand-size attribute determines the size of the offset (16 or 32 bits) in the far address. The far address is loaded directly into the CS and EIP registers. If the operand-size attribute is 16, the upper two bytes of the EIP register are cleared.</p> <h3>Far Calls in Protected Mode</h3><p>When the processor is operating in protected mode, the CALL instruction can be used to perform the following three types of far calls: o Far call to the same privilege level o Far call to a different privilege level (inter-privilege level call) o Task switch (far call to another task) In protected mode, the processor always uses the segment selector part of the far address to access the corresponding descriptor in the GDT or LDT. The descriptor type (code segment, call gate, task gate, or TSS) and access rights determine the type of call operation to be performed.</p> <p>If the selected descriptor is for a code segment, a far call to a code segment at the same privilege level is performed. (If the selected code segment is at a different privilege level and the code segment is non-conforming, a general-protection exception is generated.) A far call to the same privilege level in protected mode is very similar to one carried out in real-address or virtual-8086 mode. The target operand specifies an absolute far address either directly with a pointer (ptr16:16 or ptr16:32) or indirectly with a memory location (m16:16 or m16:32). The operandsize attribute determines the size of the offset (16 or 32 bits) in the far address. The new code segment selector and its descriptor are loaded into CS register, and the offset from the instruction is loaded into the EIP register.</p> <p>Note that a call gate (described in the next paragraph) can also be used to perform a far call to a code segment at the same privilege level. Using this mechanism provides an extra level of indirection and is the preferred method of making calls between 16-bit and 32-bit code segments.</p> <p>When executing an inter-privilege-level far call, the code segment for the procedure being called must be accessed through a call gate. The segment selector specified by the target operand identifies the call gate. Here again, the target operand can specify the call gate segment selector either directly with a pointer (ptr16:16 or ptr16:32) or indirectly with a memory location (m16:16 or m16:32). The processor obtains the segment selector for the new code segment and the new instruction pointer (offset) from the call gate descriptor. (The offset from the target operand is ignored when a call gate is used.) On inter-privilege-level calls, the processor switches to the stack for the privilege level of the called procedure. The segment selector for the new stack segment is specified in the TSS for the currently running task. The branch to the new code segment occurs after the stack switch. (Note that when using a call gate to perform a far call to a segment at the same privilege level, no stack switch occurs.) On the new stack, the processor pushes the segment selector and stack pointer for the calling procedure's stack, an (optional) set of parameters from the calling procedures stack, and the segment selector and instruction pointer for the calling procedure's code segment. (A value in the call gate descriptor determines how many parameters to copy to the new stack.) Finally, the processor branches to the address of the procedure being called within the new code segment.</p> <p>Executing a task switch with the CALL instruction, is somewhat similar to executing a call through a call gate. Here the target operand specifies the segment selector of the task gate for the task being switched to (and the offset in the target operand is ignored.) The task gate in turn points to the TSS for the task, which contains the segment selectors for the task's code and stack segments. The TSS also contains the EIP value for the next instruction that was to be executed before the task was suspended. This instruction pointer value is loaded into the EIP register so that the task begins executing again at this next instruction.</p> <p>The CALL instruction can also specify the segment selector of the TSS directly, which eliminates the indirection of the task gate. See Chapter 6, Task Management, in the IA-32 Intel Architecture Software Developer's Manual, Volume 3, for detailed information on the mechanics of a task switch.</p> <p>Note that when you execute at task switch with a CALL instruction, the nested task flag (NT) is set in the EFLAGS register and the new TSS's previous task link field is loaded with the old tasks TSS selector. Code is expected to suspend this nested task by executing an IRET instruction, which, because the NT flag is set, will automatically use the previous task link to return to the calling task. (See &quot;Task Linking&quot; in Chapter 6 of the IA-32 Intel Architecture Software Developer's Manual, Volume 3, for more information on nested tasks.) Switching tasks with the CALL instruction differs in this regard from the JMP instruction which does not set the NT flag and therefore does not expect an IRET instruction to suspend the task.</p> <h3>Mixing 16-Bit and 32-Bit Calls</h3><p>When making far calls between 16-bit and 32-bit code segments, the calls should be made through a call gate. If the far call is from a 32-bit code segment to a 16-bit code segment, the call should be made from the first 64 KBytes of the 32- bit code segment. This is because the operand-size attribute of the instruction is set to 16, so only a 16-bit return address offset is saved. Also, the call should be made using a 16-bit call gate so that 16-bit values will be pushed on the stack. See Chapter 17, Mixing 17-Bit and 32-Bit Code, in IA-32 Intel Architecture Software Developer's Manual, Volume 3 for more information.</p> </td> </tr> </table> </object> <object> <table class="box"> <tr> <th>Operation</th> </tr> <tr> <td class="instruction_set_reference_box"> <pre><span class="keyword">if</span><span class="operator">(</span>IsNearCall<span class="operator">(</span>Call<span class="operator">)</span><span class="operator">)</span> { <span class="keyword">if</span><span class="operator">(</span>IsRelativeCall<span class="operator">(</span>Call<span class="operator">)</span><span class="operator">)</span> { <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>InCodeSegmentLimits<span class="operator">(</span>InstructionPointer<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>OperandSize <span class="operator">==</span> <span class="number">32</span><span class="operator">)</span> { If<span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">4</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>IP<span class="operator">)</span><span class="operator">;</span> EIP <span class="operator">=</span> EIP <span class="operator">+</span> Destination<span class="operator">;</span> <span class="comment">//Destination is rel32</span> } <span class="keyword">else</span> { <span class="comment">//OperandSize == 16</span> <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">2</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>IP<span class="operator">)</span><span class="operator">;</span> EIP <span class="operator">=</span> <span class="operator">(</span>EIP <span class="operator">+</span> Destination<span class="operator">)</span> <span class="operator">&amp;</span> <span class="number">0xFFFF</span><span class="operator">;</span> <span class="comment">//Destination is rel16</span> } } <span class="keyword">else</span> { <span class="comment">//near absolute call</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>InCodeSegmentLimits<span class="operator">(</span>InstructionPointer<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>OperandSize <span class="operator">==</span> <span class="number">32</span><span class="operator">)</span> { If<span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">4</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>EIP<span class="operator">)</span><span class="operator">;</span> EIP <span class="operator">=</span> Destination<span class="operator">;</span> <span class="comment">//Destination is r/m32</span> } <span class="keyword">else</span> { <span class="comment">//OperandSize == 16</span> <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">2</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>IP<span class="operator">)</span><span class="operator">;</span> EIP <span class="operator">=</span> Destination <span class="operator">&amp;</span> <span class="number">0xFFFF</span><span class="operator">;</span> <span class="comment">//Destination is r/m16</span> } } } <span class="keyword">if</span><span class="operator">(</span>IsFarCall<span class="operator">(</span>Call<span class="operator">)</span> <span class="operator">&amp;&amp;</span> <span class="operator">(</span>PE <span class="operator">==</span> <span class="number">0</span> <span class="operator">||</span> <span class="operator">(</span>PE <span class="operator">==</span> <span class="number">1</span> <span class="operator">&amp;&amp;</span> VM <span class="operator">==</span> <span class="number">1</span><span class="operator">)</span><span class="operator">)</span><span class="operator">)</span> { <span class="comment">//real-address or virtual-8086 mode</span> <span class="keyword">if</span><span class="operator">(</span>OperandSize <span class="operator">==</span> <span class="number">32</span><span class="operator">)</span> { <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">6</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>InCodeSegmentLimits<span class="operator">(</span>InstructionPointer<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>CS<span class="operator">)</span><span class="operator">;</span> <span class="comment">//padded with 16 high-order bits</span> Push<span class="operator">(</span>EIP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//Destination is ptr16:32 or [m16:32]</span> CS <span class="operator">=</span> Destination<span class="operator">[</span><span class="number">32..47</span><span class="operator">]</span><span class="operator">;</span> EIP <span class="operator">=</span> Destination<span class="operator">[</span><span class="number">0..31</span><span class="operator">]</span><span class="operator">;</span> } <span class="keyword">else</span> { <span class="comment">//OperandSize == 16</span> <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">4</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>InCodeSegmentLimits<span class="operator">(</span>InstructionPointer<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>CS<span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>IP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//Destination is ptr16:16 or [m16:16]</span> CS <span class="operator">=</span> Destination<span class="operator">[</span><span class="number">31..16</span><span class="operator">]</span><span class="operator">;</span> EIP <span class="operator">=</span> Destination<span class="operator">[</span><span class="number">15..0</span><span class="operator">]</span><span class="operator">;</span> EIP <span class="operator">=</span> EIP <span class="operator">&amp;</span> <span class="number">0xFFFF</span><span class="operator">;</span> <span class="comment">//clear upper 16 bits</span> } } <span class="keyword">if</span><span class="operator">(</span>IsFarCall<span class="operator">(</span>Call<span class="operator">)</span> <span class="operator">&amp;&amp;</span> <span class="operator">(</span>PE <span class="operator">==</span> <span class="number">1</span> <span class="operator">&amp;&amp;</span> VM <span class="operator">==</span> <span class="number">0</span><span class="operator">)</span><span class="operator">)</span> { <span class="comment">//Protected mode, not virtual-8086 mode</span> <span class="keyword">if</span><span class="operator">(</span>TargetOperand<span class="operator">.</span>SegmentSelector <span class="operator">==</span> <span class="number">0</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>InDescriptorTableLimits<span class="operator">(</span>TargetOperand<span class="operator">.</span>SegmentSelector<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>NewCodeSegmentSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> SegmentDescriptorType <span class="operator">=</span> ReadSegmentDescriptorType<span class="operator">(</span><span class="operator">)</span><span class="operator">;</span> SegmentDescriptorAccessRights <span class="operator">=</span> ReadSegmentDescriptorAccessRights<span class="operator">(</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">switch</span><span class="operator">(</span>SegmentDescriptorType<span class="operator">)</span> { <span class="keyword">case</span> ConformingCodeSegment<span class="operator">:</span> <span class="keyword">if</span><span class="operator">(</span>DPL <span class="operator">&gt;</span> CPL<span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>NewCodeSegmentSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>SegementIsPresent<span class="operator">(</span>SegmentSelector<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>NP<span class="operator">(</span>NewCodeSegmentSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>OperandSize <span class="operator">==</span> <span class="number">32</span><span class="operator">)</span> { <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">6</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>InCodeSegmentLimits<span class="operator">(</span>InstructionPointer<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>CS<span class="operator">)</span><span class="operator">;</span> <span class="comment">//padded with 16 high-order bits</span> Push<span class="operator">(</span>EIP<span class="operator">)</span><span class="operator">;</span> CS <span class="operator">=</span> Destination<span class="operator">[</span>NewCodeSegmentSelector<span class="operator">]</span><span class="operator">;</span> <span class="comment">//segment descriptor information also loaded</span> CS<span class="operator">.</span>RPL <span class="operator">=</span> CPL<span class="operator">;</span> EIP <span class="operator">=</span> Destination<span class="operator">.</span>Offset<span class="operator">;</span> } <span class="keyword">else</span> { <span class="comment">//OperandSize == 16</span> <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">4</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>InCodeSegmentLimits<span class="operator">(</span>InstructionPointer<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>CS<span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>IP<span class="operator">)</span><span class="operator">;</span> CS <span class="operator">=</span> Destination<span class="operator">[</span>NewCodeSegmentSelector<span class="operator">]</span><span class="operator">;</span> <span class="comment">//segment descriptor information also loaded</span> CS<span class="operator">.</span>RPL <span class="operator">=</span> CPL<span class="operator">;</span> EIP <span class="operator">=</span> Destination<span class="operator">.</span>Offset <span class="operator">&amp;</span> <span class="number">0xFFFF</span><span class="operator">;</span> <span class="comment">//clear upper 16 bits</span> } <span class="keyword">break</span><span class="operator">;</span> <span class="keyword">case</span> NonConformingCodeSegment<span class="operator">:</span> <span class="keyword">if</span><span class="operator">(</span>RPL <span class="operator">&gt;</span> CPL <span class="operator">||</span> DPL <span class="operator">!=</span> CPL<span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>NewCodeSegmentSelector<span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>SegementIsPresent<span class="operator">(</span>SegmentSelector<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>NP<span class="operator">(</span>NewCodeSegmentSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> ReturnAddress<span class="operator">.</span>Size<span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> TemporaryEIP <span class="operator">=</span> Destination<span class="operator">.</span>Offset<span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>OperandSize <span class="operator">==</span> <span class="number">16</span><span class="operator">)</span> TemporaryEIP <span class="operator">=</span> TemporaryEIP <span class="operator">&amp;</span> <span class="number">0xFFFF</span><span class="operator">;</span> <span class="comment">//clear upper 16 bits</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>InCodeSegmentLimits<span class="operator">(</span>TemporaryEIP<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>OperandSize <span class="operator">==</span> <span class="number">32</span><span class="operator">)</span> { Push<span class="operator">(</span>CS<span class="operator">)</span><span class="operator">;</span> <span class="comment">//padded with 16 high-order bits</span> Push<span class="operator">(</span>EIP<span class="operator">)</span><span class="operator">;</span> CS <span class="operator">=</span> Destination<span class="operator">.</span>NewCodeSegmentSelector<span class="operator">;</span> <span class="comment">//segment descriptor information also loaded</span> CS<span class="operator">.</span>RPL <span class="operator">=</span> CPL<span class="operator">;</span> EIP <span class="operator">=</span> TemporaryEIP<span class="operator">;</span> } <span class="keyword">else</span> { <span class="comment">//OperandSize == 16</span> Push<span class="operator">(</span>CS<span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>IP<span class="operator">)</span><span class="operator">;</span> CS <span class="operator">=</span> Destination<span class="operator">.</span>NewCodeSegmentSelector<span class="operator">;</span> <span class="comment">//segment descriptor information also loaded.</span> CS<span class="operator">.</span>RPL <span class="operator">=</span> CPL<span class="operator">;</span> EIP <span class="operator">=</span> TemporaryEIP<span class="operator">;</span> } <span class="keyword">break</span><span class="operator">;</span> <span class="keyword">case</span> CallGate<span class="operator">:</span> <span class="keyword">if</span><span class="operator">(</span>CallGate<span class="operator">.</span>DPL <span class="operator">&lt;</span> CPL <span class="operator">||</span> CallGate<span class="operator">.</span>DPL <span class="operator">&lt;</span> RPL<span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>CallGateSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsPresent<span class="operator">(</span>CallGate<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>NP<span class="operator">(</span>CallGateSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>CallGateCodeSegmentSelector <span class="operator">==</span> <span class="number">0</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>InDescriptorTableLimits<span class="operator">(</span>CallGateCodeSegmentSelector<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>CodeSegmentSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> CodeSegmentDescriptor <span class="operator">=</span> ReadCodeSegmentDescriptor<span class="operator">(</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IndicatesCodeSegment<span class="operator">(</span>CodeSegmentDescriptor<span class="operator">)</span> <span class="operator">||</span> CodeSegmentDescriptor<span class="operator">.</span>DPL <span class="operator">&gt;</span> CPL<span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>CodeSegmentSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsPresent<span class="operator">(</span>CodeSegment<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>NP<span class="operator">(</span>NewCodeSegmentSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>IsNonConformingCodeSegment<span class="operator">(</span>CodeSegment<span class="operator">)</span> <span class="operator">&amp;&amp;</span> DPL <span class="operator">&lt;</span> CPL<span class="operator">)</span> { <span class="comment">//More privilege</span> <span class="keyword">if</span><span class="operator">(</span>Is32BitTSS<span class="operator">(</span>CurrenTSS<span class="operator">)</span><span class="operator">)</span> { TSSStackAddress <span class="operator">=</span> NewCodeSegment<span class="operator">(</span>DPL <span class="operator">*</span> <span class="number">8</span><span class="operator">)</span> <span class="operator">+</span> <span class="number">4</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>TSSStackAddress <span class="operator">+</span> <span class="number">7</span> <span class="operator">&gt;</span> TSSLimit<span class="operator">)</span> Exception<span class="operator">(</span>TS<span class="operator">(</span>CurrenTSSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> NewSS <span class="operator">=</span> TSSStackAddress <span class="operator">+</span> <span class="number">4</span><span class="operator">;</span> NewESP <span class="operator">=</span> StackAddress<span class="operator">;</span> } <span class="keyword">else</span> { <span class="comment">//TSS is 16-bit</span> <span class="keyword">if</span><span class="operator">(</span>TSSStackAddress <span class="operator">+</span> <span class="number">4</span> <span class="operator">&gt;</span> TSSLimit<span class="operator">)</span> Exception<span class="operator">(</span>TS<span class="operator">(</span>CurrenTSSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> NewESP <span class="operator">=</span> TSSStackAddress<span class="operator">;</span> NewSS <span class="operator">=</span> TSSStackAddress <span class="operator">+</span> <span class="number">2</span><span class="operator">;</span> } <span class="keyword">if</span><span class="operator">(</span>StackSegmentSelector <span class="operator">==</span> <span class="number">0</span><span class="operator">)</span> Exception<span class="operator">(</span>TS<span class="operator">(</span>StackSegmentSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsWithinDescriptorTableLimits<span class="operator">(</span>StackSegmentSelector<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>TS<span class="operator">(</span>SSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> CodeSegmentDescriptor <span class="operator">=</span> ReadCodeSegmentDescriptor<span class="operator">(</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>StackSegmentSelectorData<span class="operator">.</span>RPL <span class="operator">!=</span> CodeSegmentDescriptor<span class="operator">.</span>DPL <span class="operator">||</span> StackSegment<span class="operator">.</span>DPL <span class="operator">!=</span> CodeSegment<span class="operator">.</span>DPL <span class="operator">||</span> <span class="operator">!</span>IsWritableDataSegment<span class="operator">(</span>StackSegment<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>TS<span class="operator">(</span>SSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsPresent<span class="operator">(</span>StackSegment<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span>SSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>CallGate<span class="operator">.</span>Size <span class="operator">==</span> <span class="number">32</span><span class="operator">)</span> { <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> Parameters<span class="operator">.</span>Size <span class="operator">+</span> <span class="number">16</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span>SSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsWithinCodeSegmentLimit<span class="operator">(</span>CallGate<span class="operator">.</span>InstructionPointer<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> SS <span class="operator">=</span> NewSS<span class="operator">;</span> <span class="comment">//segment descriptor information also loaded;</span> ESP <span class="operator">=</span> NewESP<span class="operator">;</span> CS<span class="operator">:</span>EIP <span class="operator">=</span> CallGate<span class="operator">(</span>CS<span class="operator">:</span>InstructionPointer<span class="operator">)</span><span class="operator">;</span> <span class="comment">//segment descriptor information also loaded</span> Push<span class="operator">(</span>oldSS<span class="operator">:</span>oldESP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//from calling procedure</span> Temporary <span class="operator">=</span> MaskTo5Bits<span class="operator">(</span>Parameters<span class="operator">.</span>Count<span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>Parameters<span class="operator">,</span> Temporary<span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>oldCS<span class="operator">:</span>oldEIP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//return address to calling procedure</span> } <span class="keyword">else</span> { <span class="comment">//CallGate.Size == 16</span> <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> Parameters<span class="operator">.</span>Size <span class="operator">+</span> <span class="number">8</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span>SSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsWithinCodeSegmentLimit<span class="operator">(</span>CallGate<span class="operator">.</span>InstructionPointer <span class="operator">&amp;</span> <span class="number">0xFFFF</span><span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> SS <span class="operator">=</span> NewSS<span class="operator">;</span> <span class="comment">//segment descriptor information also loaded;</span> ESP <span class="operator">=</span> NewESP<span class="operator">;</span> CS<span class="operator">:</span>IP <span class="operator">=</span> CallGate<span class="operator">(</span>CS<span class="operator">:</span>InstructionPointer<span class="operator">)</span><span class="operator">;</span> <span class="comment">//segment descriptor information also loaded</span> Push<span class="operator">(</span>oldSS<span class="operator">:</span>oldESP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//from calling procedure</span> Temporary <span class="operator">=</span> MaskTo5Bits<span class="operator">(</span>Parameters<span class="operator">.</span>Count<span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>Parameters<span class="operator">,</span> Temporary<span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>oldCS<span class="operator">:</span>oldEIP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//return address to calling procedure</span> <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> Parameters<span class="operator">.</span>Size <span class="operator">+</span> <span class="number">16</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span>SSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsWithinCodeSegmentLimit<span class="operator">(</span>CallGate<span class="operator">.</span>InstructionPointer<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> SS <span class="operator">=</span> NewSS<span class="operator">;</span> <span class="comment">//segment descriptor information also loaded;</span> ESP <span class="operator">=</span> NewESP<span class="operator">;</span> CS<span class="operator">:</span>EIP <span class="operator">=</span> CallGate<span class="operator">(</span>CS<span class="operator">:</span>InstructionPointer<span class="operator">)</span><span class="operator">;</span> <span class="comment">//segment descriptor information also loaded</span> Push<span class="operator">(</span>oldSS<span class="operator">:</span>oldESP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//from calling procedure</span> Temporary <span class="operator">=</span> MaskTo5Bits<span class="operator">(</span>Parameters<span class="operator">.</span>Count<span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>Parameters<span class="operator">,</span> Temporary<span class="operator">)</span><span class="operator">;</span> Push<span class="operator">(</span>oldCS<span class="operator">:</span>oldEIP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//return address to calling procedure</span> } CPL <span class="operator">=</span> CodeSegment<span class="operator">.</span>DPL CS<span class="operator">.</span>RPL <span class="operator">=</span> CPL<span class="operator">;</span> } <span class="comment">//Same privilege</span> <span class="keyword">else</span> { <span class="keyword">if</span><span class="operator">(</span>CallGate<span class="operator">.</span>Size <span class="operator">==</span> <span class="number">32</span><span class="operator">)</span> { <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">8</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsWithinCodeSegmentLimit<span class="operator">(</span>EIP<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> CS<span class="operator">:</span>EIP <span class="operator">=</span> CallGate<span class="operator">(</span>CS<span class="operator">:</span>EIP<span class="operator">)</span> <span class="comment">//segment descriptor information also loaded</span> Push<span class="operator">(</span>oldCS<span class="operator">:</span>oldEIP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//return address to calling procedure</span> } <span class="keyword">else</span> { <span class="comment">//CallGate.Size == 16</span> <span class="keyword">if</span><span class="operator">(</span>GetStackSpace<span class="operator">(</span><span class="operator">)</span> <span class="operator">&lt;</span> <span class="number">4</span><span class="operator">)</span> Exception<span class="operator">(</span>SS<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsWithinCodeSegmentLimit<span class="operator">(</span>IP<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> CS<span class="operator">:</span>IP <span class="operator">=</span> CallGate<span class="operator">(</span>CS<span class="operator">:</span>IP<span class="operator">)</span> <span class="comment">//segment descriptor information also loaded</span> Push<span class="operator">(</span>oldCS<span class="operator">:</span>oldIP<span class="operator">)</span><span class="operator">;</span> <span class="comment">//return address to calling procedure</span> } CS<span class="operator">.</span>RPL <span class="operator">=</span> CPL<span class="operator">;</span> } <span class="keyword">break</span><span class="operator">;</span> <span class="keyword">case</span> TaskGate<span class="operator">:</span> <span class="keyword">if</span><span class="operator">(</span>TaskGate<span class="operator">.</span>DPL <span class="operator">&lt;</span> CPL <span class="operator">||</span> TaskGate<span class="operator">.</span>DPL <span class="operator">&lt;</span> RPL<span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>TaskGateSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsPresent<span class="operator">(</span>TaskGate<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>NP<span class="operator">(</span>TaskGateSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> TaskGateDescriptor <span class="operator">=</span> ReadTSSegmentSelector<span class="operator">(</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>IsLocal<span class="operator">(</span>TSSegmentSelector<span class="operator">)</span> <span class="operator">||</span> <span class="operator">!</span>IsWithinGDTLimits<span class="operator">(</span>Index<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>TSSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> Access<span class="operator">(</span>GDT<span class="operator">.</span>TSSDescriptor<span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span>TSSDescriptor <span class="operator">&amp;</span> <span class="number">0x1F</span> <span class="operator">==</span> <span class="number">1</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>TSSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="comment">//TSS is busy</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsPresent<span class="operator">(</span>TSS<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>NP<span class="operator">(</span>TSSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> SwitchTasks<span class="operator">(</span>TSS<span class="operator">)</span><span class="operator">;</span> <span class="comment">//switch tasks to TSS (with nesting)</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsWithinCodeSegmentLimits<span class="operator">(</span>EIP<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">break</span><span class="operator">;</span> <span class="keyword">case</span> TaskStateSegment<span class="operator">:</span> <span class="keyword">if</span><span class="operator">(</span>TSS<span class="operator">.</span>DPL <span class="operator">&lt;</span> CPL <span class="operator">||</span> TSS<span class="operator">.</span>DPL <span class="operator">&lt;</span> RPL <span class="operator">||</span> <span class="operator">!</span>IsTSSAvailable<span class="operator">(</span>TSSDescriptor<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>TSSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsPresent<span class="operator">(</span>TSS<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>NP<span class="operator">(</span>TSSSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> SwitchTasks<span class="operator">(</span>TSS<span class="operator">)</span><span class="operator">;</span> <span class="comment">//switch tasks to TSS (with nesting)</span> <span class="keyword">if</span><span class="operator">(</span><span class="operator">!</span>IsWithinCodeSegmentLimits<span class="operator">(</span>EIP<span class="operator">)</span><span class="operator">)</span> Exception<span class="operator">(</span>GP<span class="operator">(</span><span class="number">0</span><span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> <span class="keyword">break</span><span class="operator">;</span> <span class="keyword">default</span><span class="operator">:</span> Exception<span class="operator">(</span>GP<span class="operator">(</span>SegmentSelector<span class="operator">)</span><span class="operator">)</span><span class="operator">;</span> } } </pre> </td> </tr> </table> </object> <object> <table class="box"> <tr> <th>Flags affected</th> </tr> <tr> <td class="instruction_set_reference_box"> <p>All flags are affected if a task switch occurs; no flags are affected if a task switch does not occur. </p> </td> </tr> </table> </object> <object> <table class="box"> <tr> <th>Real-Address Mode Exceptions</th> </tr> <tr> <td class="instruction_set_reference_box"> <div> <table class="operations_table"> <tr><td><code>#GP</code></td><td>If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit. If the target offset is beyond the code segment limit.</td></tr> </table> </div> </td> </tr> </table> </object> <object> <table class="box"> <tr> <th>Virtual-8086 Mode Exceptions</th> </tr> <tr> <td class="instruction_set_reference_box"> <div> <table class="operations_table"> <tr><td><code>#GP(0)</code></td><td>If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit. If the target offset is beyond the code segment limit.</td></tr> <tr><td><code>#GP(0)</code></td><td>If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit. If the target offset is beyond the code segment limit.</td></tr> <tr><td><code>#PF(fault-code)</code></td><td>If a page fault occurs.</td></tr> </table> </div> </td> </tr> </table> </object> <object> <table class="box"> <tr> <th>Instruction</th> <th>Latency</th> <th>Throughput</th> <th>Execution Unit</th> </tr> <tr><td class="grid"><code>CPUID</code></td><td class="grid">0F3n/0F2n/069n</td><td class="grid">0F3n/0F2n/069n</td><td class="grid">0F2n</td></tr> <tr><td class="grid"><code>CALL</code></td><td class="grid">5</td><td class="grid">1</td><td class="grid">ALU MEM_STORE</td></tr> </table> </object> </div> </body> </html>
{ "pile_set_name": "Github" }
--- title: "Plan your conferencing topology for Skype for Business Server" ms.reviewer: ms.author: v-lanac author: lanachin manager: serdars audience: ITPro ms.topic: conceptual ms.prod: skype-for-business-itpro f1.keywords: - NOCSH localization_priority: Normal ms.assetid: 7392dfa7-791a-4723-88ff-0ef8a9ef11c8 description: "Summary: Read this topic to learn about planning your conferencing topology in Skype for Business Server." --- # Plan your conferencing topology for Skype for Business Server **Summary:** Read this topic to learn about planning your conferencing topology in Skype for Business Server. This topic describes topology basics for conferencing in Skype for Business Server: - Supported topologies - Dial-in conferencing considerations - Web conferencing considerations - Requirements for large meetings For more information about hardware and software requirements, see [Hardware and software requirements for conferencing in Skype for Business Server](hardware-and-software-requirements.md). ## Supported topologies In Skype for Business Server, the server running conferencing services is always collocated with the Front End Servers or Standard Edition servers. When you deploy Skype for Business Server, IM conferencing capabilities are automatically deployed. You can specify whether to deploy web, audio and video (A/V), and dial-in conferencing by using the Topology Builder. You can also use Topology Builder to add conferencing to an existing deployment. For details about topology basics and collocation scenarios, see [Topology Basics for Skype for Business Server](../../plan-your-deployment/topology-basics/topology-basics.md). You can deploy conferencing in the following topologies and configurations: - Skype for Business Server Standard Edition - Skype for Business Server Enterprise Edition - With or without Enterprise Voice ## Dial-in conferencing considerations If you are deploying dial-in conferencing, you must consider the following: - Dial-in conferencing requires a Mediation Server to translate signaling (and media in some configurations) between Skype for Business Server and the PSTN gateway, and a PSTN gateway to translate signaling and media between the Mediation Server and the PSTN gateway. Before you can configure dial-in conferencing, you need to deploy either Enterprise Voice or a Mediation Server and at least one of the following: - PSTN gateway - IP-PBX - Session Border Controller (SBC) (for an Internet telephony service provider to which you connect by configuring a SIP trunk) - You can deploy the Application service, Conferencing Attendant application, and Conferencing Announcement application in a central site, but not in a branch site. - You must deploy dial-in conferencing in every pool where you deploy Skype for Business Server conferencing. You do not need to assign access numbers in every pool, but you must deploy the dial-in conferencing feature in every pool. This requirement supports the recorded name feature when a user calls an access number from one pool to join a Skype for Business Server conference in a different pool. For more information, see [Plan for dial-in conferencing in Skype for Business Server](dial-in-conferencing.md). ## Web conferencing considerations Web conferencing requires the following: - Access to the file store, which is used for storing web conferencing content. - Integration with Office Web Apps Server/Office Online Server, which is necessary in order to share PowerPoint files during a conference. > [!NOTE] > The latest iteration of Office Web Apps Server is named Office Online Server, which is supported by Skype for Business Server. For more detail, refer to the [Office Online Server documentation](https://technet.microsoft.com/library/jj219456%28v=office.16%29.aspx). Skype for Business Server provides the following ways to configure Office Web Apps Server/Office Online Server. Depending on your needs you can: - **Install both Skype for Business Server and Office Web Apps Server/Office Online Server on-premises behind your organization's firewall, and in the same network zone.** With this topology, external access to Office Web Apps Server/Office Online Server will be provided through your reverse proxy server. Ideally, you should install Office Web Apps Server/Office Online Server in the same network zone as Skype for Business Server. External Skype for Business clients can connect to Skype for Business Server and to Office Web Apps Server/Office Online Server by using a reverse proxy server, which is a server that takes requests from the Internet and forwards them to the internal network. (Internal clients do not need to use the reverse proxy server because they can connect to Office Web Apps Server/Office Online Server directly.) This topology works best if you want to use a dedicated Office Web Apps Server/Office Online Server farm that is only used by Skype for Business Server. - **Use an externally deployed Office Web Apps Server/Office Online Server.** In this topology, Skype for Business Server is deployed on-premises, and uses an Office Web Apps Server/Office Online Server that is deployed outside of the Skype for Business Server network zone. This may happen when Office Web Apps Server/Office Online Server is shared across multiple applications in the corporation and is deployed in a network requiring Skype for Business Server to use the external interface of Office Web Apps Server/Office Online Server and vice versa. You do not need to install a reverse proxy server; instead, all the requests from the Office Web Apps Server/Office Online Server to Skype for Business Server are routed through your Edge Server. Both your internal and your external Skype for Business clients connect to Office Web Apps Server/Office Online Server using the external URL. If the Office Web Apps Server/Office Online Server is deployed outside your internal firewall, then select the option **Office Web Apps Server is deployed in an external network** (that is, perimeter/Internet) in Topology Builder. For more information, see [Configure integration with Office Web Apps Server in Skype for Business Server](../../deploy/deploy-conferencing/office-web-app-server.md). Regardless of the topology you select, it is critical that the correct firewall ports be opened. You must make sure that DNS names, IP addresses, and ports are not blocked by firewalls on the Office Web Apps Server/Office Online Server, the load balancer, or Skype for Business Server. > [!NOTE] > Another option for providing external access to Office Web Apps Server/Office Online Server is to deploy the server in the perimeter network. If you elect to do this, keep in mind that Office Web Apps Server/Office Online Server setup requires the server computer to be a member of your Active Directory domain. Unless your network policy allows computers in the perimeter network to be Active Directory domain members, it is recommended that you do not install Office Web Apps Server/Office Online Server in the perimeter network. Instead, you should install Office Web Apps Server/Office Online Server in the internal network and provide external user access through your reverse proxy server. ## Topology requirements for large meetings A single large meeting requires at least one Front End Server and one Back End Server. However, to provide high availability, we recommend a two Front End Server pool with mirrored Back End Servers as shown in the following diagram: **Large meeting topology** ![Large meeting topology](../../media/06858900-a262-4a47-96d0-51abd6827064.png) The user who hosts the large meetings must have their user account homed in Front End pool. However, we do not recommend that you host other user accounts in this pool. Instead, use it only for the large meetings. The best practice is to create a special user account in this pool to be used only to host large meetings. Since the large meeting setting is optimized for performance, using it as a normal user could have problems such as the inability to promote a P2P session to a meeting when a PSTN endpoint is involved. Managing a pool with exactly two Front End Servers requires some special considerations. For more information, see [Topology Basics for Skype for Business Server 2015](../../plan-your-deployment/topology-basics/topology-basics.md) and [Reference topologies for Skype for Business Server 2015](../../plan-your-deployment/topology-basics/reference-topologies.md). Additionally, if you want to optionally provide disaster recovery backup and failover for the pool used for large meetings, you can pair it with a similarly set up dedicated pool in a different data center. For details, see [Plan for high availability and disaster recovery in Skype for Business Server](../../plan-your-deployment/high-availability-and-disaster-recovery/high-availability-and-disaster-recovery.md). Additional notes about the topology include: - A file share is required for storing meeting content and, if Archiving Server is deployed and enabled, for storing the archiving files. The file share can be dedicated to the pool or can be the same file share used by another pool at the site in which the pool is deployed. For details about configuring the file share, see [Create a file share in Skype for Business Server 2015](../../deploy/install/create-a-file-share.md). - An Office Web Apps Server/Office Online Server is required for enabling the PowerPoint presentation functionality in large meetings. The Office Web Apps Server/Office Online Server can be dedicated to the large meeting pool or, it can be the same Office Web Apps Server/Office Online Server used by other pools at the site in which the dedicated pool is deployed. For more information, see [Configure integration with Office Web Apps Server in Skype for Business Server](../../deploy/deploy-conferencing/office-web-app-server.md). - Load balancing of the Front End Servers requires hardware load balancing for the HTTP traffic (such as meeting content download). DNS load balancing is recommended for SIP traffic. For details see [Load balancing requirements for Skype for Business](../../plan-your-deployment/network-requirements/load-balancing.md). - If you want to use Monitoring Server for the dedicated large-meeting pool, we recommend using the Monitoring Server and its database that are shared across all of the Front End Server pools in your Skype for Business Server deployment. For more information, see [Plan for monitoring in Skype for Business Server](../../plan-your-deployment/monitoring.md).
{ "pile_set_name": "Github" }
module github.com/urfave/cli go 1.12 require ( github.com/BurntSushi/toml v0.3.1 gopkg.in/yaml.v2 v2.2.2 )
{ "pile_set_name": "Github" }
<!DOCTYPE html> <!-- saved from url=(0014)about:internet --> <html> <head> <meta charset="UTF-8" /> <title>Avatar 2.0</title> <meta name="Description" content="" /> <meta name="Keywords" content="" /> <meta http-equiv="X-UA-Compatible" content="IE=11" /> <meta http-equiv="Pragma" content="no-cache"> <link rel="shortcut icon" href="favicon.ico"> <style> * { margin: 0; padding: 0; border: 0; /*-webkit-user-select: none; -khtml-user-select: none; -moz-user-select: -moz-none; -o-user-select: none; box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box; user-select: none;*/ } body { font-family: Consolas, Monaco, monospace; font-size: 11px; color:#000; background: #232323; /*overflow:hidden; */ } #container{ position:absolute; width:100%; height:100%; } </style> <script src="src/libs/three.js"></script> <script src="src/libs/sea3d.js"></script> <script src="src/libs/tween.js"></script> <script src="src/libs/uil.js"></script> <script src="src/libs/capture/CCapture.js"></script> <script src="src/libs/capture/Whammy.js"></script> <script src="src/libs/capture/download.js"></script> <script src="src/controls/OrbitControls.js"></script> <script src="src/controls/TransformControls.js"></script> <!-- <script src="src/shaders/BleachBypassShader.js"></script> <script src="src/shaders/ConvolutionShader.js"></script> <script src="src/shaders/CopyShader.js"></script> <script src="src/postprocessing/EffectComposer.js"></script> <script src="src/postprocessing/SSAARenderPass.js"></script> <script src="src/postprocessing/RenderPass.js"></script> <script src="src/postprocessing/BloomPass.js"></script> <script src="src/postprocessing/TexturePass.js"></script> <script src="src/postprocessing/ShaderPass.js"></script> <script src="src/postprocessing/MaskPass.js"></script> --> <script src="src/loaders/BVHLoader.js"></script> <script src="src/loaders/BVHLoaderAdd.js"></script> <!--<script src="src/BVHLoader.js"></script>--> <script src="src/Model.js"></script> <script src="src/math.js"></script> <script src="src/pool.js"></script> <script src="src/shader.js"></script> <script src="src/skeleton.js"></script> <script src="src/view.js"></script> <script src="src/gui.js"></script> <script src="src/main.js"></script> </head> <body> <div id='container'></div> <script> var container = document.getElementById('container'); main.init( container ); </script> </body> </html>
{ "pile_set_name": "Github" }
{ "name": "KMI - IRM", "displayName": "KMI - IRM", "properties": [ "meteo.be" ], "prevalence": { "tracking": 0, "nonTracking": 0.0000147, "total": 0.0000147 } }
{ "pile_set_name": "Github" }
package org.mafagafogigante.dungeon.entity; import org.mafagafogigante.dungeon.io.Version; import org.mafagafogigante.dungeon.logging.DungeonLogger; import com.eclipsesource.json.JsonArray; import com.eclipsesource.json.JsonValue; import org.jetbrains.annotations.NotNull; import java.io.Serializable; import java.util.EnumSet; import java.util.Set; /** * A set of Tags. */ public class TagSet<E extends Enum<E>> implements Serializable { private static final long serialVersionUID = Version.MAJOR; private final Set<E> set; private TagSet(Set<E> set) { this.set = set; } /** * Returns an empty TagSet. * * @param enumClass the Class of the Enum type * @param <E> an Enum type * @return a new TagSet */ public static <E extends Enum<E>> TagSet<E> makeEmptyTagSet(Class<E> enumClass) { return new TagSet<>(EnumSet.noneOf(enumClass)); } /** * Returns a copy of the specified TagSet such that Tags can be added without affecting the original TagSet. * * @param tagSet the original TagSet * @param <E> an Enum type * @return a new TagSet */ public static <E extends Enum<E>> TagSet<E> copyTagSet(TagSet<E> tagSet) { return new TagSet<>(EnumSet.copyOf(tagSet.set)); } /** * Creates a TagSet from a JSON array. * * @param enumClass the Class of the enum, not null * @param array a JsonArray object, not null * @param <E> an Enum type * @return a TagSet */ public static <E extends Enum<E>> TagSet<E> fromJsonArray(@NotNull JsonArray array, @NotNull Class<E> enumClass) { TagSet<E> tagSet = makeEmptyTagSet(enumClass); for (JsonValue value : array) { try { tagSet.addTag(Enum.valueOf(enumClass, value.asString())); } catch (IllegalArgumentException fatal) { throw new InvalidTagException("invalid tag '" + value.asString() + "' found.", fatal); } } return tagSet; } /** * Checks if this TagSet has a specified Tag. * * @param tag the Tag object * @return true if this set contains the specified Tag */ public boolean hasTag(E tag) { return set.contains(tag); } /** * Adds a Tag to this TagSet. */ public void addTag(E tag) { if (!set.add(tag)) { DungeonLogger.warning("Tried to add a Tag that was already in the TagSet."); } } @Override public String toString() { return "TagSet{" + "set=" + set + '}'; } public static class InvalidTagException extends IllegalArgumentException { public InvalidTagException(String message) { super(message); } public InvalidTagException(String message, Throwable cause) { super(message, cause); } } }
{ "pile_set_name": "Github" }
/* File: PVRTexture.h Abstract: The PVRTexture class is responsible for loading .pvr files. Version: 1.0 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (C) 2008 Apple Inc. All Rights Reserved. */ #import <Foundation/Foundation.h> #import "Platforms/CCGL.h" #import "CCTexture2D.h" #pragma mark - #pragma mark CCTexturePVR struct CCPVRMipmap { unsigned char *address; unsigned int len; }; enum { CC_PVRMIPMAP_MAX = 16, }; /** CCTexturePVR Object that loads PVR images. Supported PVR formats: - RGBA8888 - BGRA8888 - RGBA4444 - RGBA5551 - RGB565 - A8 - I8 - AI88 - PVRTC 4BPP - PVRTC 2BPP Limitations: Pre-generated mipmaps, such as PVR textures with mipmap levels embedded in file, are only supported if all individual sprites are of _square_ size. To use mipmaps with non-square textures, instead call CCTexture2D#generateMipmap on the sheet texture itself (and to save space, save the PVR sprite sheet without mip maps included). */ @interface CCTexturePVR : NSObject { struct CCPVRMipmap mipmaps_[CC_PVRMIPMAP_MAX]; // pointer to mipmap images int numberOfMipmaps_; // number of mipmap used unsigned int tableFormatIndex_; uint32_t width_, height_; GLuint name_; BOOL hasAlpha_; // cocos2d integration BOOL retainName_; CCTexture2DPixelFormat format_; } /** initializes a CCTexturePVR with a path */ - (id)initWithContentsOfFile:(NSString *)path; /** initializes a CCTexturePVR with an URL */ - (id)initWithContentsOfURL:(NSURL *)url; /** creates and initializes a CCTexturePVR with a path */ + (id)pvrTextureWithContentsOfFile:(NSString *)path; /** creates and initializes a CCTexturePVR with an URL */ + (id)pvrTextureWithContentsOfURL:(NSURL *)url; /** texture id name */ @property (nonatomic,readonly) GLuint name; /** texture width */ @property (nonatomic,readonly) uint32_t width; /** texture height */ @property (nonatomic,readonly) uint32_t height; /** whether or not the texture has alpha */ @property (nonatomic,readonly) BOOL hasAlpha; // cocos2d integration @property (nonatomic,readwrite) BOOL retainName; @property (nonatomic,readonly) CCTexture2DPixelFormat format; @end
{ "pile_set_name": "Github" }
<form action="{{ $action }}" method="post" @if(isset($inline) && $inline) class="inline-block" @endif > @csrf <button type="submit" class="{{ $class ?? '' }}" style="{{ $style ?? null }}" > {{ $slot }} </button> </form>
{ "pile_set_name": "Github" }
using Microsoft.EntityFrameworkCore; namespace EhTagTranslatorClient.Model { internal class TranslateDb : DbContext { public DbSet<Record> Table { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlite("Data Source=EhTagTranslatorClient.v2.db"); } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<Record>() .HasKey(r => new { r.Namespace, r.Original }); modelBuilder.Entity<Record>() .Property(r => r.Namespace) .ValueGeneratedNever(); modelBuilder.Entity<Record>() .Property(r => r.Original) .ValueGeneratedNever(); } } }
{ "pile_set_name": "Github" }
import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; import InfoIcon from '@material-ui/icons/Info'; import Snackbar from '@material-ui/core/Snackbar'; import { SnackbarContent } from '@material-ui/core'; import useRoomState from '../../hooks/useRoomState/useRoomState'; const useStyles = makeStyles({ snackbar: { backgroundColor: '#6db1ff', }, message: { display: 'flex', alignItems: 'center', }, icon: { marginRight: '0.8em', }, }); export default function ReconnectingNotification() { const classes = useStyles(); const roomState = useRoomState(); return ( <Snackbar anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }} open={roomState === 'reconnecting'}> <SnackbarContent className={classes.snackbar} message={ <span className={classes.message}> <InfoIcon className={classes.icon} /> Reconnecting&hellip; </span> } /> </Snackbar> ); }
{ "pile_set_name": "Github" }
<div class="col-xs-9"> <!-- Tab panes --> <div class="tab-content"> <div class="tab-pane active" id="usage-tab-doors-list"> <div class="interactive_screenshot"> <div id="screenshot_doors_title" class="click_area" title="{{_('Title')}}"></div> <div id="screenshot_doors_status" class="click_area" title="{{_('Status')}}"></div> <div id="screenshot_doors_graph" class="click_area" title="{{_('History graph')}}"></div> <img src="static/images/documentation/doors_status.png" alt="{{_('Doors overview screenshot')}}" /> </div> </div> <div class="tab-pane" id="usage-tab-doors-title"> <h3 class="lead">{{_('Title')}}</h3> <p>{{_('Per door the title holds shows some values and options.')}}</p> <div class="x_panel"> <div class="x_title"> <h2> <span aria-hidden="true" class="glyphicon glyphicon-lock"></span> <span class="title">{{_('Door')}} '{{_('Name')}}'</span> <small class="total_usage">...</small> <span class="badge bg-red">{{_('warning')}}</span> </h2> <ul class="nav navbar-right panel_toolbox"> <li> <a class="collapse-link"><i class="fa fa-chevron-up"></i></a> </li> <li class="dropdown"> <a aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown" href="javascript:;" role="button"><i class="fa fa-calendar" title="{{_('Period')}}"></i></a> <ul class="dropdown-menu period" role="menu"> <li> <a href="javascript:;" >{{_('Day')}}</a> </li> <li> <a href="javascript:;" >{{_('Week')}}</a> </li> <li> <a href="javascript:;" >{{_('Month')}}</a> </li> <li> <a href="javascript:;" >{{_('Year')}}</a> </li> </ul> </li> <li class="dropdown"> <a aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown" href="javascript:;" role="button"><i class="fa fa-wrench" title="{{_('Options')}}"></i></a> <ul class="dropdown-menu" role="menu"> <li> <a href="javascript:;">{{_('Settings')}}</a> </li> </ul> </li> <li> <a class="close-link" href="javascript:;"><i class="fa fa-close" title="{{_('Close')}}"></i></a> </li> </ul> <div class="clearfix"></div> </div> </div> <h4>{{_('Left side')}} <small>({{_('values')}})</small></h4> <ul> <li>{{_('The configured name')}}</li> <li>{{_('The total time the door has been open')}}</li> <li>{{_('Warning badge when the door is open')}}</li> </ul> <h4>{{_('Right side')}} <small>({{_('Options')}})</small></h4> <ul> <li><i class="fa fa-chevron-up"></i>: {{_('Show or hide the door')}}</li> <li><i class="fa fa-calendar" title="{{_('Period')}}"></i>: {{_('Select history graph period')}}</li> <li><i class="fa fa-wrench" title="{{_('Options')}}"></i>: {{_('Options menu')}}</li> <li><i class="fa fa-close" title="{{_('Close')}}"></i>: {{_('Close')}}</li> </ul> </div> <div class="tab-pane" id="usage-tab-doors-status"> <h3 class="lead">{{_('Status')}}</h3> <i class="fa fa-lock big red alignright" title="{{_('Door is open')}}"></i> <i class="fa fa-lock big green alignright" title="{{_('Door is closed')}}"></i> <p>{{_('On the door page there is a list of door sensors that show the current status of the doors. There can be as much doors added to the system as needed.')}}</p> <p>{{_('The list is also updating when a door is opened by hand. The state off the door is shown here in real time.')}}</p> <h4>{{_('Status')}}</h4> <ul> <li><i class="fa fa-lock red"></i>: {{_('Door is open')}}</li> <li><i class="fa fa-lock green"></i>: {{_('Door is closed')}}</li> </ul> </div> <div class="tab-pane" id="usage-tab-doors-graph"> <h3 class="lead">{{_('History graph')}}</h3> <img src="static/images/documentation/history_graph_door.png" alt="{{_('Door history graph')}}" class="img-thumbnail" /><br /><br /> <p>{{_('The history graph will shows when a door was opened.')}}</p> <p>{{!_('Use the calendar icon %s in the title to select the period for the history graph.') % '<i class="fa fa-calendar"></i>'}}</p> </div> <div class="tab-pane" id="usage-tab-doors-settings"> <h3 class="lead">{{_('Settings')}}</h3> <p>{{!_('On the door settings page you can configure all needed doors. Click on %s button to add a new door. And empty form like below is shown and has to be filled in. Make sure the right values are filled in. All fields with a %s are required.') % ('<button type="button" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>','<span class="required">*</span>',)}}</p> <div class="row"> <div class="x_panel"> <div class="x_content"> <div class="col-md-4 col-sm-4 col-xs-12 form-group"> <label for="door_[nr]_hardwaretype">{{_('Hardware')}} <span class="required">*</span></label> <div class="form-group" data-toggle="tooltip" data-placement="top" title="" data-original-title="{{!translations.get_translation('door_field_hardware')}}"> <select class="form-control" name="door_[nr]_hardwaretype" tabindex="-1" placeholder="{{_('Select an option')}}" required="required"> <option value="gpio">{{_('GPIO')}}</option> </select> </div> </div> <div class="col-md-3 col-sm-3 col-xs-12 form-group"> <label for="door_[nr]_address">{{_('Address')}}</label> <span class="required">*</span> <input class="form-control" name="door_[nr]_address" placeholder="{{_('Address')}}" required="required" type="text" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="{{translations.get_translation('door_field_address')}}"> <input class="form-control" name="door_[nr]_id" placeholder="{{_('ID')}}" readonly="readonly" type="hidden"> </div> <div class="col-md-5 col-sm-5 col-xs-12 form-group"> <label for="door_[nr]_name">{{_('Name')}}</label> <span class="required">*</span> <input class="form-control" name="door_[nr]_name" placeholder="{{_('Name')}}" required="required" type="text" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="{{translations.get_translation('door_field_name')}}"> </div> </div> </div> </div> <ul> <li> <strong>{{_('Hardware')}}</strong>: {{!translations.get_translation('door_field_hardware')}} </li> <li> <strong>{{_('Address')}}</strong>: {{!translations.get_translation('door_field_address')}} </li> <li> <strong>{{_('Name')}}</strong>: {{translations.get_translation('door_field_name')}} </li> </ul> </div> </div> </div> <div class="col-xs-3"> <!-- required for floating --> <!-- Nav tabs --> <ul class="nav nav-tabs tabs-right"> <li class="active"> <a data-toggle="tab" href="#usage-tab-doors-list" title="{{_('Overview')}}">{{_('Overview')}}</a> </li> <li> <a data-toggle="tab" href="#usage-tab-doors-title" title="{{_('Title')}}">{{_('Title')}}</a> </li> <li> <a data-toggle="tab" href="#usage-tab-doors-status" title="{{_('Status')}}">{{_('Status')}}</a> </li> <li> <a data-toggle="tab" href="#usage-tab-doors-graph" title="{{_('Graph')}}">{{_('Graph')}}</a> </li> <li> <a data-toggle="tab" href="#usage-tab-doors-settings" title="{{_('Settings')}}">{{_('Settings')}}</a> </li> </ul> </div> <script type="text/javascript"> $('.total_usage').text('{{_('Total open for')}}: ' + moment.duration(30).humanize()); </script>
{ "pile_set_name": "Github" }
/* Certificate request creation. Demonstrates some request related * operations. */ #include <stdio.h> #include <stdlib.h> #include <openssl/pem.h> #include <openssl/conf.h> #include <openssl/x509v3.h> #ifndef OPENSSL_NO_ENGINE #include <openssl/engine.h> #endif int mkreq(X509_REQ **x509p, EVP_PKEY **pkeyp, int bits, int serial, int days); int add_ext(STACK_OF(X509_REQUEST) *sk, int nid, char *value); int main(int argc, char **argv) { BIO *bio_err; X509_REQ *req=NULL; EVP_PKEY *pkey=NULL; CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); bio_err=BIO_new_fp(stderr, BIO_NOCLOSE); mkreq(&req,&pkey,512,0,365); RSA_print_fp(stdout,pkey->pkey.rsa,0); X509_REQ_print_fp(stdout,req); PEM_write_X509_REQ(stdout,req); X509_REQ_free(req); EVP_PKEY_free(pkey); #ifndef OPENSSL_NO_ENGINE ENGINE_cleanup(); #endif CRYPTO_cleanup_all_ex_data(); CRYPTO_mem_leaks(bio_err); BIO_free(bio_err); return(0); } static void callback(int p, int n, void *arg) { char c='B'; if (p == 0) c='.'; if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; fputc(c,stderr); } int mkreq(X509_REQ **req, EVP_PKEY **pkeyp, int bits, int serial, int days) { X509_REQ *x; EVP_PKEY *pk; RSA *rsa; X509_NAME *name=NULL; STACK_OF(X509_EXTENSION) *exts = NULL; if ((pk=EVP_PKEY_new()) == NULL) goto err; if ((x=X509_REQ_new()) == NULL) goto err; rsa=RSA_generate_key(bits,RSA_F4,callback,NULL); if (!EVP_PKEY_assign_RSA(pk,rsa)) goto err; rsa=NULL; X509_REQ_set_pubkey(x,pk); name=X509_REQ_get_subject_name(x); /* This function creates and adds the entry, working out the * correct string type and performing checks on its length. * Normally we'd check the return value for errors... */ X509_NAME_add_entry_by_txt(name,"C", MBSTRING_ASC, "UK", -1, -1, 0); X509_NAME_add_entry_by_txt(name,"CN", MBSTRING_ASC, "OpenSSL Group", -1, -1, 0); #ifdef REQUEST_EXTENSIONS /* Certificate requests can contain extensions, which can be used * to indicate the extensions the requestor would like added to * their certificate. CAs might ignore them however or even choke * if they are present. */ /* For request extensions they are all packed in a single attribute. * We save them in a STACK and add them all at once later... */ exts = sk_X509_EXTENSION_new_null(); /* Standard extenions */ add_ext(exts, NID_key_usage, "critical,digitalSignature,keyEncipherment"); /* This is a typical use for request extensions: requesting a value for * subject alternative name. */ add_ext(exts, NID_subject_alt_name, "email:steve@openssl.org"); /* Some Netscape specific extensions */ add_ext(exts, NID_netscape_cert_type, "client,email"); #ifdef CUSTOM_EXT /* Maybe even add our own extension based on existing */ { int nid; nid = OBJ_create("1.2.3.4", "MyAlias", "My Test Alias Extension"); X509V3_EXT_add_alias(nid, NID_netscape_comment); add_ext(x, nid, "example comment alias"); } #endif /* Now we've created the extensions we add them to the request */ X509_REQ_add_extensions(x, exts); sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); #endif if (!X509_REQ_sign(x,pk,EVP_sha1())) goto err; *req=x; *pkeyp=pk; return(1); err: return(0); } /* Add extension using V3 code: we can set the config file as NULL * because we wont reference any other sections. */ int add_ext(STACK_OF(X509_REQUEST) *sk, int nid, char *value) { X509_EXTENSION *ex; ex = X509V3_EXT_conf_nid(NULL, NULL, nid, value); if (!ex) return 0; sk_X509_EXTENSION_push(sk, ex); return 1; }
{ "pile_set_name": "Github" }
[package] name = "thar-be-settings" version = "0.1.0" authors = ["Zac Mrowicki <mrowicki@amazon.com>"] license = "Apache-2.0 OR MIT" edition = "2018" publish = false build = "build.rs" # Don't rebuild crate just because of changes to README. exclude = ["README.md"] [dependencies] apiclient = { path = "../apiclient" } handlebars = "3.0" http = "0.2" itertools = "0.9" log = "0.4" models = { path = "../../models" } schnauzer = { path = "../schnauzer" } serde_json = "1" simplelog = "0.8" snafu = "0.6" [build-dependencies] cargo-readme = "3.1" [dev-dependencies] maplit = "1.0"
{ "pile_set_name": "Github" }
/* ------------------------------------------------------------------ * Copyright (C) 1998-2009 PacketVideo * * 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. * ------------------------------------------------------------------- */ /**************************************************************************************** Portions of this file are derived from the following 3GPP standard: 3GPP TS 26.073 ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec Available from http://www.3gpp.org (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) Permission to distribute, modify and use this file under the standard license terms listed above has been obtained from the copyright holder. ****************************************************************************************/ /* Filename: gains_tbl.cpp ------------------------------------------------------------------------------ MODULE DESCRIPTION ------------------------------------------------------------------------------ */ /*---------------------------------------------------------------------------- ; INCLUDES ----------------------------------------------------------------------------*/ #include "typedef.h" /*--------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" { #endif /*---------------------------------------------------------------------------- ; MACROS ; [Define module specific macros here] ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; DEFINES ; [Include all pre-processor statements here. Include conditional ; compile variables also.] ----------------------------------------------------------------------------*/ #define NB_QUA_PITCH 16 #define NB_QUA_CODE 32 /*---------------------------------------------------------------------------- ; LOCAL FUNCTION DEFINITIONS ; [List function prototypes here] ----------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- ; LOCAL VARIABLE DEFINITIONS ; [Variable declaration - defined here and used outside this module] ----------------------------------------------------------------------------*/ extern const Word16 qua_gain_pitch[]; const Word16 qua_gain_pitch[NB_QUA_PITCH] = { 0, 3277, 6556, 8192, 9830, 11469, 12288, 13107, 13926, 14746, 15565, 16384, 17203, 18022, 18842, 19661 }; extern const Word16 qua_gain_code[]; const Word16 qua_gain_code[(NB_QUA_CODE+1)*3] = { /* gain factor (g_fac) and quantized energy error (qua_ener_MR122, qua_ener) * are stored: * * qua_ener_MR122 = log2(g_fac) (not the rounded floating point value, but * the value the original EFR algorithm * calculates from g_fac [using Log2]) * qua_ener = 20*log10(g_fac); (rounded floating point value) * * * g_fac (Q11), qua_ener_MR122 (Q10), qua_ener (Q10) */ 159, -3776, -22731, 206, -3394, -20428, 268, -3005, -18088, 349, -2615, -15739, 419, -2345, -14113, 482, -2138, -12867, 554, -1932, -11629, 637, -1726, -10387, 733, -1518, -9139, 842, -1314, -7906, 969, -1106, -6656, 1114, -900, -5416, 1281, -694, -4173, 1473, -487, -2931, 1694, -281, -1688, 1948, -75, -445, 2241, 133, 801, 2577, 339, 2044, 2963, 545, 3285, 3408, 752, 4530, 3919, 958, 5772, 4507, 1165, 7016, 5183, 1371, 8259, 5960, 1577, 9501, 6855, 1784, 10745, 7883, 1991, 11988, 9065, 2197, 13231, 10425, 2404, 14474, 12510, 2673, 16096, 16263, 3060, 18429, 21142, 3448, 20763, 27485, 3836, 23097, 27485, 3836, 23097 }; /*--------------------------------------------------------------------------*/ #ifdef __cplusplus } #endif /* ------------------------------------------------------------------------------ FUNCTION NAME: ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS Inputs: None Outputs: None Returns: None Global Variables Used: None Local Variables Needed: None ------------------------------------------------------------------------------ FUNCTION DESCRIPTION None ------------------------------------------------------------------------------ REQUIREMENTS None ------------------------------------------------------------------------------ REFERENCES [1] gains.tab, UMTS GSM AMR speech codec, R99 - Version 3.2.0, March 2, 2001 ------------------------------------------------------------------------------ PSEUDO-CODE ------------------------------------------------------------------------------ CAUTION [optional] [State any special notes, constraints or cautions for users of this function] ------------------------------------------------------------------------------ */ /*---------------------------------------------------------------------------- ; FUNCTION CODE ----------------------------------------------------------------------------*/
{ "pile_set_name": "Github" }
.umb-user-details-avatar { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid @gray-8; } div.umb-user-details-actions > div { margin-bottom: 20px; } .umb-user-details-actions .umb-button { margin-bottom: 20px; } .umb-user-details-view-title { font-size: 20px; font-weight: bold; color: @black; margin-bottom: 30px; } .umb-user-details-view-wrapper { padding: 20px 60px; } @media (max-width: 768px) { .umb-user-details-view-wrapper { padding: 0; } } .umb-user-details-section { margin-bottom: 40px; } .umb-user-details-details { display: flex; } a.umb-user-details-details__back-link { font-weight: bold; color: @black; } .umb-user-details-details__back-link:hover { color: @gray-4; text-decoration: none; } @sidebarwidth: 350px; // Width of sidebar. Ugly hack because of old version of Less .umb-user-details-details__main-content { flex: 1 1 auto; margin-right: 30px; width: calc(~'100%' - ~'@{sidebarwidth}' - ~'30px'); // Make sure that the main content area doesn't gets affected by inline styling } .umb-user-details-details__main-content .umb-node-preview-add { max-width: 100%; } .umb-user-details-details__sidebar { flex: 0 0 @sidebarwidth; .umb-button{ margin-left:0px; } } @media (max-width: 768px) { .umb-user-details-details { flex-direction: column; } .umb-user-details-details__main-content { flex: 1 1 auto; width: 100%; margin-bottom: 30px; margin-right: 0; } .umb-user-details-details__sidebar { flex: 1 1 auto; width: 100%; } } .umb-user-details-details__section-title { font-size: 17px; font-weight: bold; color: @black; margin-top: 0; margin-bottom: 15px; } .umb-user-details-details__section-description { font-size: 12px; line-height: 1.6em; margin-bottom: 15px; } .umb-user-details-details__information-item { margin-bottom: 10px; font-size: 13px; margin-top:10px; } .umb-user-details-details__information-item-label { color: @black; font-weight: bold; } .umb-user-details-details__information-item-content { word-break: break-word; }
{ "pile_set_name": "Github" }
// P_4_3_4_01_emoji_icon_analyser // // Generative Gestaltung – Creative Coding im Web // ISBN: 978-3-87439-902-9, First Edition, Hermann Schmidt, Mainz, 2018 // Benedikt Groß, Hartmut Bohnacker, Julia Laub, Claudius Lazzeroni // with contributions by Joey Lee and Niels Poldervaart // Copyright 2018 // // http://www.generative-gestaltung.de // // 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. /** * Analyses RGB pixel values of emoji icons to deduce the average colors. * The results are written in a json file. */ 'use strict'; var emojiNames; var counter = 0; var imgSize = 72; var results = {}; // You will have to download the emoji files first // Please see https://github.com/generative-design/Code-Package-p5.js/tree/master/data var emojisPath = '../../data/twemoji/'; function preload() { emojiNames = loadTable('data/emoji-names.csv', 'csv', 'header'); } function setup() { createCanvas(imgSize, imgSize); print(emojiNames.getRowCount()); } function draw() { if (counter >= emojiNames.getRowCount()) { saveJSON(results, 'emoji-average-colors.json'); print('done'); noLoop(); return; } noLoop(); var currentEmoji = emojiNames.getString(counter, 0); print(currentEmoji); loadImage(emojisPath + '72x72/' + currentEmoji + '.png', function(img) { clear(); image(img, 0, 0); loadPixels(); var rgb = {r: 0, g: 0, b: 0}; var pixCounter = 0; for (var i = 0; i < pixels.length; i += 4) { if (pixels[i + 3] === 0) continue; // skip if alpha == 0 rgb.r += pixels[i]; rgb.g += pixels[i + 1]; rgb.b += pixels[i + 2]; pixCounter++; } // ~~ used to floor values rgb.r = ~~(rgb.r / pixCounter); rgb.g = ~~(rgb.g / pixCounter); rgb.b = ~~(rgb.b / pixCounter); results[currentEmoji] = {}; results[currentEmoji].averageColor = rgb; // noStroke(); // fill(rgb.r, rgb.g, rgb.b); // ellipse(width/2, height/2, 30, 30); counter++; loop(); }); }
{ "pile_set_name": "Github" }
From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> Date: Fri, 21 Jun 2019 14:08:38 +0200 Subject: [PATCH] include version number Including it allows multiple lua versions to coexist. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> --- diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ PLAT= none # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h. INSTALL_TOP= /usr/local INSTALL_BIN= $(INSTALL_TOP)/bin -INSTALL_INC= $(INSTALL_TOP)/include +INSTALL_INC= $(INSTALL_TOP)/include/lua$V INSTALL_LIB= $(INSTALL_TOP)/lib INSTALL_MAN= $(INSTALL_TOP)/man/man1 INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V @@ -39,10 +39,10 @@ RM= rm -f PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris # What to install. -TO_BIN= lua luac +TO_BIN= lua$V luac$V TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp -TO_LIB= liblua.a -TO_MAN= lua.1 luac.1 +TO_LIB= liblua$V.a +TO_MAN= lua$V.1 luac$V.1 # Lua version and release. V= 5.3 @@ -52,7 +52,7 @@ R= $V.4 all: $(PLAT) $(PLATS) clean: - cd src && $(MAKE) $@ + cd src && $(MAKE) $@ V=$V test: dummy src/lua -v diff --git a/doc/lua.1 b/doc/lua5.3.1 rename from doc/lua.1 rename to doc/lua5.3.1 diff --git a/doc/luac.1 b/doc/luac5.3.1 rename from doc/luac.1 rename to doc/luac5.3.1 diff --git a/src/Makefile b/src/Makefile --- a/src/Makefile +++ b/src/Makefile @@ -28,7 +28,7 @@ MYOBJS= PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris -LUA_A= liblua.a +LUA_A= liblua$V.a CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \ ltm.o lundump.o lvm.o lzio.o @@ -36,10 +36,10 @@ LIB_O= lauxlib.o lbaselib.o lbitlib.o lc lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) -LUA_T= lua +LUA_T= lua$V LUA_O= lua.o -LUAC_T= luac +LUAC_T= luac$V LUAC_O= luac.o ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
{ "pile_set_name": "Github" }
package com.github.zhangkaitao.shiro.chapter11.service; import com.github.zhangkaitao.shiro.chapter11.dao.UserDao; import com.github.zhangkaitao.shiro.chapter11.dao.UserDaoImpl; import com.github.zhangkaitao.shiro.chapter11.entity.User; import java.util.Set; /** * <p>User: Zhang Kaitao * <p>Date: 14-1-28 * <p>Version: 1.0 */ public class UserServiceImpl implements UserService { private UserDao userDao = new UserDaoImpl(); private PasswordHelper passwordHelper = new PasswordHelper(); /** * 创建用户 * @param user */ public User createUser(User user) { //加密密码 passwordHelper.encryptPassword(user); return userDao.createUser(user); } /** * 修改密码 * @param userId * @param newPassword */ public void changePassword(Long userId, String newPassword) { User user =userDao.findOne(userId); user.setPassword(newPassword); passwordHelper.encryptPassword(user); userDao.updateUser(user); } /** * 添加用户-角色关系 * @param userId * @param roleIds */ public void correlationRoles(Long userId, Long... roleIds) { userDao.correlationRoles(userId, roleIds); } /** * 移除用户-角色关系 * @param userId * @param roleIds */ public void uncorrelationRoles(Long userId, Long... roleIds) { userDao.uncorrelationRoles(userId, roleIds); } /** * 根据用户名查找用户 * @param username * @return */ public User findByUsername(String username) { return userDao.findByUsername(username); } /** * 根据用户名查找其角色 * @param username * @return */ public Set<String> findRoles(String username) { return userDao.findRoles(username); } /** * 根据用户名查找其权限 * @param username * @return */ public Set<String> findPermissions(String username) { return userDao.findPermissions(username); } }
{ "pile_set_name": "Github" }
import { VssueAPI } from 'vssue'; import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; import { buildQuery, buildURL, concatURL, getCleanURL, parseQuery, } from '@vssue/utils'; import { normalizeUser, normalizeIssue, normalizeComment, normalizeReactions, mapReactionName, } from './utils'; import { ResponseUser, ResponseIssue, ResponseComment, ResponseReaction, ResponseMarkdown, } from './types'; /** * GitLab API V4 * * @see https://docs.gitlab.com/ce/api/ * @see https://docs.gitlab.com/ce/api/oauth2.html */ export default class GitlabV4 implements VssueAPI.Instance { baseURL: string; owner: string; repo: string; labels: Array<string>; clientId: string; state: string; $http: AxiosInstance; private _encodedRepo: string; constructor({ baseURL = 'https://gitlab.com', owner, repo, labels, clientId, state, }: VssueAPI.Options) { this.baseURL = baseURL; this.owner = owner; this.repo = repo; this.labels = labels; this.clientId = clientId; this.state = state; // @see https://docs.gitlab.com/ce/api/README.html#namespaced-path-encoding this._encodedRepo = encodeURIComponent(`${this.owner}/${this.repo}`); this.$http = axios.create({ baseURL: concatURL(baseURL, 'api/v4'), headers: { Accept: 'application/json', }, }); } /** * The platform api info */ get platform(): VssueAPI.Platform { return { name: 'GitLab', link: this.baseURL, version: 'v4', meta: { reactable: true, sortable: true, }, }; } /** * Redirect to the authorization page of platform. * * @see https://docs.gitlab.com/ce/api/oauth2.html#1-requesting-authorization-code */ redirectAuth(): void { window.location.href = buildURL( concatURL(this.baseURL, 'oauth/authorize'), { client_id: this.clientId, redirect_uri: window.location.href, response_type: 'token', state: this.state, } ); } /** * Handle authorization. * * @see https://docs.gitlab.com/ce/api/oauth2.html#implicit-grant-flow * * @remarks * If the `access_token` and `state` exist in the query, and the `state` matches, remove them from query, and return the access token. */ async handleAuth(): Promise<VssueAPI.AccessToken> { const hash = parseQuery(window.location.hash.slice(1)); if (!hash.access_token || hash.state !== this.state) { return null; } const accessToken = hash.access_token; delete hash.access_token; delete hash.token_type; delete hash.expires_in; delete hash.state; const hashString = buildQuery(hash); const newHash = hashString ? `#${hashString}` : ''; const replaceURL = `${getCleanURL(window.location.href)}${ window.location.search }${newHash}`; window.history.replaceState(null, '', replaceURL); return accessToken; } /** * Get the logged-in user with access token. */ async getUser({ accessToken, }: { accessToken: VssueAPI.AccessToken; }): Promise<VssueAPI.User> { const { data } = await this.$http.get<ResponseUser>('user', { headers: { Authorization: `Bearer ${accessToken}` }, }); return normalizeUser(data); } /** * Get issue of this page according to the issue id or the issue title * * @see https://docs.gitlab.com/ce/api/issues.html#single-issue * @see https://docs.gitlab.com/ce/api/issues.html#list-issues * @see https://docs.gitlab.com/ce/api/README.html#pagination */ async getIssue({ accessToken, issueId, issueTitle, }: { accessToken: VssueAPI.AccessToken; issueId?: string | number; issueTitle?: string; }): Promise<VssueAPI.Issue | null> { const options: AxiosRequestConfig = {}; if (accessToken) { options.headers = { Authorization: `Bearer ${accessToken}`, }; } if (issueId) { try { const { data } = await this.$http.get<ResponseIssue>( `projects/${this._encodedRepo}/issues/${issueId}`, options ); return normalizeIssue(data); } catch (e) { if (e.response && e.response.status === 404) { return null; } else { throw e; } } } else { options.params = { labels: this.labels.join(','), order_by: 'created_at', sort: 'asc', search: issueTitle, }; const { data } = await this.$http.get<ResponseIssue[]>( `projects/${this._encodedRepo}/issues`, options ); const issue = data .map(normalizeIssue) .find(item => item.title === issueTitle); return issue || null; } } /** * Create a new issue * * @see https://docs.gitlab.com/ce/api/issues.html#new-issue */ async postIssue({ accessToken, title, content, }: { accessToken: VssueAPI.AccessToken; title: string; content: string; }): Promise<VssueAPI.Issue> { const { data } = await this.$http.post<ResponseIssue>( `projects/${this._encodedRepo}/issues`, { title, description: content, labels: this.labels.join(','), }, { headers: { Authorization: `Bearer ${accessToken}` }, } ); return normalizeIssue(data); } /** * Get comments of this page according to the issue id * * @see https://docs.gitlab.com/ce/api/notes.html#list-project-issue-notes * @see https://docs.gitlab.com/ce/api/README.html#pagination * * @remarks * Cannot get the HTML content and the reactions (award_emoji) here. * So have to request them via `markdown` and `award_emoji` API. */ async getComments({ accessToken, issueId, query: { page = 1, perPage = 10, sort = 'desc' } = {}, }: { accessToken: VssueAPI.AccessToken; issueId: string | number; query?: Partial<VssueAPI.Query>; }): Promise<VssueAPI.Comments> { const options: AxiosRequestConfig = { params: { // pagination page: page, per_page: perPage, order_by: 'created_at', sort: sort, }, }; if (accessToken) { options.headers = { Authorization: `Bearer ${accessToken}`, }; } const response = await this.$http.get<ResponseComment[]>( `projects/${this._encodedRepo}/issues/${issueId}/notes`, options ); const commentsRaw = response.data; // gitlab api v4 should get parsed markdown content and reactions by other api // this is potentially to cause 429 Too Many Requests const getCommentsMeta: Array<Promise<void>> = []; for (const comment of commentsRaw) { getCommentsMeta.push( (async (): Promise<void> => { comment.body_html = await this.getMarkdownContent({ accessToken: accessToken, contentRaw: comment.body, }); })() ); getCommentsMeta.push( (async (): Promise<void> => { comment.reactions = await this.getCommentReactions({ accessToken: accessToken, issueId: issueId, commentId: comment.id, }); })() ); } await Promise.all(getCommentsMeta); return { count: Number(response.headers['x-total']), page: Number(response.headers['x-page']), perPage: Number(response.headers['x-per-page']), data: commentsRaw.map(normalizeComment), }; } /** * Create a new comment * * @see https://docs.gitlab.com/ce/api/notes.html#create-new-issue-note */ async postComment({ accessToken, issueId, content, }: { accessToken: VssueAPI.AccessToken; issueId: string | number; content: string; }): Promise<VssueAPI.Comment> { const { data } = await this.$http.post<ResponseComment>( `projects/${this._encodedRepo}/issues/${issueId}/notes`, { body: content, }, { headers: { Authorization: `Bearer ${accessToken}` }, } ); return normalizeComment(data); } /** * Edit a comment * * @see https://docs.gitlab.com/ce/api/notes.html#modify-existing-issue-note */ async putComment({ accessToken, issueId, commentId, content, }: { accessToken: VssueAPI.AccessToken; issueId: string | number; commentId: string | number; content: string; }): Promise<VssueAPI.Comment> { const { data } = await this.$http.put<ResponseComment>( `projects/${this._encodedRepo}/issues/${issueId}/notes/${commentId}`, { body: content, }, { headers: { Authorization: `Bearer ${accessToken}` }, } ); const [contentHTML, reactions] = await Promise.all([ this.getMarkdownContent({ accessToken: accessToken, contentRaw: data.body, }), this.getCommentReactions({ accessToken: accessToken, issueId: issueId, commentId: data.id, }), ]); data.body_html = contentHTML; data.reactions = reactions; return normalizeComment(data); } /** * Delete a comment * * @see https://docs.gitlab.com/ce/api/notes.html#delete-an-issue-note */ async deleteComment({ accessToken, issueId, commentId, }: { accessToken: VssueAPI.AccessToken; issueId: string | number; commentId: string | number; }): Promise<boolean> { const { status } = await this.$http.delete( `projects/${this._encodedRepo}/issues/${issueId}/notes/${commentId}`, { headers: { Authorization: `Bearer ${accessToken}` }, } ); return status === 204; } /** * Get reactions of a comment * * @see https://docs.gitlab.com/ce/api/award_emoji.html#list-an-awardables-award-emoji */ async getCommentReactions({ accessToken, issueId, commentId, }: { accessToken: VssueAPI.AccessToken; issueId: string | number; commentId: string | number; }): Promise<VssueAPI.Reactions> { const { data } = await this.$http.get<ResponseReaction[]>( `projects/${this._encodedRepo}/issues/${issueId}/notes/${commentId}/award_emoji`, { headers: { Authorization: `Bearer ${accessToken}` }, } ); return normalizeReactions(data); } /** * Create a new reaction of a comment * * @see https://docs.gitlab.com/ce/api/award_emoji.html#award-a-new-emoji */ async postCommentReaction({ issueId, commentId, reaction, accessToken, }: { accessToken: VssueAPI.AccessToken; issueId: string | number; commentId: string | number; reaction: keyof VssueAPI.Reactions; }): Promise<boolean> { try { const response = await this.$http.post( `projects/${this._encodedRepo}/issues/${issueId}/notes/${commentId}/award_emoji`, { name: mapReactionName(reaction), }, { headers: { Authorization: `Bearer ${accessToken}`, }, } ); return response.status === 201; } catch (e) { // it could be a bug of gitlab // if a reaction (award emoji) has already existed, it returns a 404 response with a buggy message // have submitted an issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/56147 /* istanbul ignore next */ if (e.response && e.response.status === 404) { return false; } else { throw e; } } } /** * Get the parse HTML of markdown content * * @see https://docs.gitlab.com/ce/api/markdown.html */ async getMarkdownContent({ accessToken, contentRaw, }: { accessToken?: string | null; contentRaw: string; }): Promise<string> { const options: AxiosRequestConfig = {}; if (accessToken) { options.headers = { Authorization: `Bearer ${accessToken}`, }; } const { data } = await this.$http.post<ResponseMarkdown>( `markdown`, { text: contentRaw, gfm: true, }, options ); return data.html; } }
{ "pile_set_name": "Github" }
/********************************************************************************/ /* */ /* Project : P A P Y R U S Toolkit */ /* File : PapyEnumImageGroups3.h */ /* Function : contains the declarations of the groups names and of the */ /* elements names */ /********************************************************************************/ #ifndef PapyEnumImageGroups3H #define PapyEnumImageGroups3H /* Group2 */ enum { papGroupLength, papFileMetaInformationVersionGr, papMediaStorageSOPClassUIDGr, papMediaStorageSOPInstanceUIDGr, papTransferSyntaxUIDGr, papImplementationClassUIDGr, papImplementationVersionNameGr, papSourceApplicationEntityTitleGr, papPrivateInformationCreatorUIDGr, papPrivateInformationGr, papEndGroup2 }; /* Group4 */ enum { papFilesetIDGr = 1, papFileIDofFilesetDescriptorFileGr, papFormatofFilesetDescriptorFileGr, papOffsetofTheFirstDirectoryRecordGr, papOffsetofTheLastDirectoryRecordGr, papFilesetConsistencyFlagGr, papDirectoryRecordSequenceGr, papOffsetofNextDirectoryRecordGr, papRecordInuseGr, papOffsetofReferencedLowerLevelDirectoryEntityGr, papDirectoryRecordTypeGr, papPrivateRecordUIDGr, papReferencedFileIDGr, papMRDRDirectoryRecordOffsetGr, papReferencedSOPClassUIDinFileGr, papReferencedSOPInstanceUIDinFileGr, papReferencedTransferSyntaxUIDinFileGr, papNumberOfReferencesGr, papEndGroup4 }; /* Group8 */ enum { papLengthtoEndGr = 1, papSpecificCharacterSetGr, papImageTypeGr, papRecognitionCodeGr, papInstanceCreationDateGr, papInstanceCreationTimeGr, papInstanceCreatorUIDGr, papSOPClassUIDGr, papSOPInstanceUIDGr, papStudyDateGr, papSeriesDateGr, papAcquisitionDateGr, papImageDateGr, papOverlayDateGr, papCurveDateGr, papAcquisitionDatetimeGr, papStudyTimeGr, papSeriesTimeGr, papAcquisitionTimeGr, papImageTimeGr, papOverlayTimeGr, papCurveTimeGr, papDataSetTypeGr, papDataSetSubtypeGr, papNuclearMedicineSeriesTypeGr, papAccessionNumberGr, papQueryRetrieveLevelGr, papRetrieveAETitleGr, papInstanceAvailabilityGr, papFailedSOPInstanceUIDListGr, papModalityGr, papModalitiesInStudyGr, papConversionTypeGr, papPresentationIndentTypeGr, papManufacturerGr, papInstitutionNameGr, papInstitutionAddressGr, papInstitutionCodeSequenceGr, papReferringPhysiciansNameGr, papReferringPhysiciansAddressGr, papReferringPhysiciansTelephoneNumbersGr, papCodeValueGr, papCodingSchemeDesignatorGr, papCodingSchemeVersionGr, papCodeMeaningGr, papMappingResourceGr, papContextGroupVersionGr, papContextgroupLocalVersionGr, papCodeSetExtensionFlagGr, papPrivateCodingSchemeCreatorUIDGr, papCodeSetExtensionCreatorUIDGr, papContextIdentifierGr, papTimezoneOffsetFromUTCGr, papNetworkIDGr, papStationNameGr, papStudyDescriptionGr, papProcedureCodeSequenceGr, papSeriesDescriptionGr, papInstitutionalDepartmentNameGr, papPhysiciansOfRecordGr, papPerformingPhysiciansNameGr, papNameofPhysiciansReadingStudyGr, papOperatorsNameGr, papAdmittingDiagnosesDescriptionGr, papAdmittingDiagnosisCodeSequenceGr, papManufacturersModelNameGr, papReferencedResultsSequenceGr, papReferencedStudySequenceGr, papReferencedStudyComponentSequenceGr, papReferencedSeriesSequenceGr, papReferencedPatientSequenceGr, papReferencedVisitSequenceGr, papReferencedOverlaySequenceGr, papReferencedImageSequenceGr, papReferencedCurveSequenceGr, papReferencedSOPClassUID8Gr, papReferencedSOPInstanceUID8Gr, papSOPClassesSupporedGr, papReferencedFrameNumberGr, papReferencedCalibrationSequenceGr, papTransactionUIDGr, papFailureReasonGr, papFailedSOPSequenceGr, papReferencedSOPSequenceGr, papLossyImageCompression8Gr, papDerivationDescriptionGr, papSourceImageSequenceGr, papStageNameGr, papStageNumberGr, papNumberofStagesGr, papViewNameGr, papViewNumberGr, papNumberofEventTimersGr, papNumberofViewsinStageGr, papEventElapsedTimesGr, papEventTimerNamesGr, papStartTrimGr, papStopTrimGr, papRecommendedDisplayFrameRateGr, papTransducerPositionGr, papTransducerOrientationGr, papAnatomicStructureGr, papAnatomicRegionSequenceGr, papAnatomicRegionModifierSequenceGr, papPrimaryAnatomicStructureSequenceGr, papAnatomicStructureSpaceOrRegionSequenceGr, papPrimaryAnatomicStructureModifierSequenceGr, papTransducerPositionSequenceGr, papTransducerPositionModifierSequenceGr, papTransducerOrientationSequenceGr, papTransducerOrientationModifierSequenceGr, papComments8Gr, papFrameType, papReferencedRawDataSequence, papCreatorVersionUID, papDerivationImageSequence, papReferringImageEvidenceSequence, papSourceImageEvidenceSequence, papPixelPresentation, papVolumetricProperties, papVolumeBasedCalculationTechnique, papComplexImageComponent, papAcquisitionContrast, papDerivationCodeSequence, papReferencedGrayscalePresentationStateSequence, papEndGroup8 }; /* Group10 */ enum { papPatientsNameGr = 1, papPatientIDGr, papIssuerofPatientIDGr, papPatientsBirthDateGr, papPatientsBirthTimeGr, papPatientsSexGr, papPatientsInsurancePlanCodeSequenceGr, papOtherPatientIDsGr, papOtherPatientNamesGr, papPatientsBirthNameGr, papPatientsAgeGr, papPatientsSizeGr, papPatientsWeightGr, papPatientsAddressGr, papInsurancePlanIdentificationGr, papPatientsMothersBirthNameGr, papMilitaryRankGr, papBranchofServiceGr, papMedicalRecordLocatorGr, papMedicalAlertsGr, papContrastAllergiesGr, papCountryofResidenceGr, papRegionofResidenceGr, papPatientsTelephoneNumbersGr, papEthnicGroupGr, papOccupationGr, papSmokingStatusGr, papAdditionalPatientHistoryGr, papPregnancyStatusGr, papLastMenstrualDateGr, papPatientsReligiousPreferenceGr, papPatientCommentsGr, papEndGroup10 }; /* Group18 */ enum { papContrastBolusAgentGr = 1, papContrastBolusAgentSequenceGr, papContrastBolusAdministrationRouteSequenceGr, papBodyPartExaminedGr, papScanningSequenceGr, papSequenceVariantGr, papScanOptionsGr, papMRAcquisitionTypeGr, papSequenceNameGr, papAngioFlagGr, papInterventionDrugInformationSequenceGr, papInterventionDrugStopTimeGr, papInterventionDrugDoseGr, papInterventionDrugCodeSequenceGr, papAdditionalDrugSequenceGr, papRadionuclideGr, papRadiopharmaceuticalGr, papEnergyWindowCenterlineGr, papEnergyWindowTotalWidthGr, papInterventionDrugNameGr, papInterventionDrugStartTimeGr, papInterventionalTherapySequenceGr, papTherapyTypeGr, papInterventionalStatusGr, papTherapyDescriptionGr, papCineRateGr, papSliceThicknessGr, papKVPGr, papCountsAccumulatedGr, papAcquisitionTerminationConditionGr, papEffectiveSeriesDurationGr, papAcquisitionStartConditionGr, papAcquisitionStartConditionDataGr, papAcquisitionTerminationConditionDataGr, papRepetitionTimeGr, papEchoTimeGr, papInversionTimeGr, papNumberofAveragesGr, papImagingFrequencyGr, papImagedNucleusGr, papEchoNumbersGr, papMagneticFieldStrengthGr, papSpacingBetweenSlicesGr, papNumberofPhaseEncodingStepsGr, papDataCollectionDiameterGr, papEchoTrainLengthGr, papPercentSamplingGr, papPercentPhaseFieldofViewGr, papPixelBandwidthGr, papDeviceSerialNumberGr, papPlateIDGr, papSecondaryCaptureDeviceIDGr, papHardcopyCreationDeviceIDGr, papDateofSecondaryCaptureGr, papTimeofSecondaryCaptureGr, papSecondaryCaptureDeviceManufacturerGr, papHardcopyDeviceManufacturerGr, papSecondaryCaptureDeviceManufacturersModelNameGr, papSecondaryCaptureDeviceSoftwareVersionsGr, papHardcopyDeviceSoftwareVersionsGr, papHardcopyDeviceManufacturersModelNameGr, papSoftwareVersionsGr, papVideoImageFormatAcquiredGr, papDigitalImageFormatAcquiredGr, papProtocolNameGr, papContrastBolusRouteGr, papContrastBolusVolumeGr, papContrastBolusStartTimeGr, papContrastBolusStopTimeGr, papContrastBolusTotalDoseGr, papSyringecountsGr, papContrastFlowRatesGr, papContrastFlowDurationsGr, papContrastBolusIngredientGr, papContrastBolusIngredientConcentrationGr, papSpatialResolutionGr, papTriggerTimeGr, papTriggerSourceorTypeGr, papNominalIntervalGr, papFrameTimeGr, papFramingTypeGr, papFrameTimeVectorGr, papFrameDelayGr, papImageTriggerDelayGr, papMultiplexgroupTimeOffsetGr, papTriggerTimeOffsetGr, papSynchronizationTriggerGr, papSynchronizationChannelGr, papTriggerSamplePositionGr, papRadiopharmaceuticalRouteGr, papRadiopharmaceuticalVolumeGr, papRadiopharmaceuticalStartTimeGr, papRadiopharmaceuticalStopTimeGr, papRadionuclideTotalDoseGr, papRadionuclideHalfLifeGr, papRadionuclidePositronFractionGr, papRadiopharmaceuticalSpecificactivityGr, papBeatRejectionFlagGr, papLowRRValueGr, papHighRRValueGr, papIntervalsAcquiredGr, papIntervalsRejectedGr, papPVCRejectionGr, papSkipBeatsGr, papHeartRateGr, papCardiacNumberofImagesGr, papTriggerWindowGr, papReconstructionDiameterGr, papDistanceSourcetoDetectorGr, papDistanceSourcetoPatientGr, papEstimatedRadiographicMagnificationFactorGr, papGantryDetectorTiltGr, papGantryDetectorSlewGr, papTableHeightGr, papTableTraverseGr, papTableMotionGr, papTableVerticalIncrementGr, papTableLateralIncrementGr, papTableLongitudinalIncrementGr, papTableAngleGr, papTableTypeGr, papRotationDirectionGr, papAngularPositionGr, papRadialPositionGr, papScanArcGr, papAngularStepGr, papCenterofRotationOffsetGr, papRotationOffsetGr, papFieldofViewShapeGr, papFieldofViewDimensionsGr, papExposureTimeGr, papXrayTubeCurrentGr, papExposureGr, papExposureinmAsGr, papAveragePulseWidthGr, papRadiationSettingGr, papRectificationTypeGr, papRadiationModeGr, papImageAreaDoseProductGr, papFilterTypeGr, papTypeofFiltersGr, papIntensifierSizeGr, papImagerPixelSpacingGr, papGridGr, papGeneratorPowerGr, papCollimatorgridNameGr, papCollimatorTypeGr, papFocalDistanceGr, papXFocusCenterGr, papYFocusCenterGr, papFocalSpotsGr, papAnodeTargetMaterialGr, papBodyPartThicknessGr, papCompressionForceGr, papDateofLastCalibrationGr, papTimeofLastCalibrationGr, papConvolutionKernelGr, papUpperLowerPixelValuesGr, papActualFrameDurationGr, papCountRateGr, papPreferredPlaybackSequencingGr, papReceivingCoilGr, papTransmittingCoilGr, papPlateTypeGr, papPhosphorTypeGr, papScanVelocityGr, papWholeBodyTechniqueGr, papScanLengthGr, papAcquisitionMatrixGr, papPhaseEncodingDirectionGr, papFlipAngleGr, papVariableFlipAngleFlagGr, papSARGr, papdBdtGr, papAcquisitionDeviceProcessingDescriptionGr, papAcquisitionDeviceProcessingCodeGr, papCassetteOrientationGr, papCassetteSizeGr, papExposuresonPlateGr, papRelativeXrayExposureGr, papColumnAngulationGr, papTornoLayerHeightGr, papTornoAngleGr, papTornoTimeGr, papTornoTypeGr, papTornoClassGr, papNumberofTornosynthesisSourceImagesGr, papPositionerMotionGr, papPositionerTypeGr, papPositionerPrimaryAngleGr, papPositionerSecondaryAngleGr, papPositionerPrimaryAngleIncrementGr, papPositionerSecondaryAngleIncrementGr, papDetectorPrimaryAngleGr, papDetectorSecondaryAngleGr, papShutterShapeGr, papShutterLeftVerticalEdgeGr, papShutterRightVerticalEdgeGr, papShutterUpperHorizontalEdgeGr, papShutterLowerHorizontalEdgeGr, papCenterofCircularShutterGr, papRadiusofCircularShutterGr, papVerticesofthePolygonalShutterGr, papShutterPaddingValueGr, papShutterOverlayGroupGr, papCollimatorShapeGr, papCollimatorLeftVerticalEdgeGr, papCollimatorRightVerticalEdgeGr, papCollimatorUpperHorizontalEdgeGr, papCollimatorLowerHorizontalEdgeGr, papCenterofCircularCollimatorGr, papRadiusofCircularCollimatorGr, papVerticesofthePolygonalCollimatorGr, papAcquisitionTimeSynchronizedGr, papTimeSourceGr, papTimeDistributionProtocolGr, papPageNumberVectorGr, papFrameLabelVectorGr, papFramePrimaryAngleVectorGr, papFrameSecondaryAngleVectorGr, papSliceLocationVectorGr, papDisplayWindowLabelVectorGr, papNominalScannedPixelSpacingGr, papDigitizingDeviceTransportDirectionGr, papRotationOfScannedFilmGr, papComments18Gr, papOutputPowerGr, papTransducerDataGr, papFocusDepthGr, papPreprocessingFunctionGr, papPostprocessingFunctionGr, papMechanicalIndexGr, papThermalIndexGr, papCranialThermalIndexGr, papSoftTissueThermalIndexGr, papSoftTissuefocusThermalIndexGr, papSoftTissuesurfaceThermalIndexGr, papDynamicRangeGr, papTotalGainGr, papDepthofScanFieldGr, papPatientPositionGr, papViewPositionGr, papProjectionEponymousNameCodeSequenceGr, papImageTransformationMatrixGr, papImageTranslationVectorGr, papSensitivityGr, papSequenceofUltrasoundRegionsGr, papRegionSpatialFormatGr, papRegionDataTypeGr, papRegionFlagsGr, papRegionLocationMinX0Gr, papRegionLocationMinY0Gr, papRegionLocationMaxX1Gr, papRegionLocationMaxY1Gr, papReferencePixelX0Gr, papReferencePixelY0Gr, papPhysicalUnitsXDirectionGr, papPhysicalUnitsYDirectionGr, papReferencePixelPhysicalValueXGr, papReferencePixelPhysicalValueYGr, papPhysicalDeltaXGr, papPhysicalDeltaYGr, papTransducerFrequencyGr, papTransducerTypeGr, papPulseRepetitionFrequencyGr, papDopplerCorrectionAngleGr, papSterringAngleGr, papDopplerSampleVolumeXPositionGr, papDopplerSampleVolumeYPositionGr, papTMLinePositionX0Gr, papTMLinePositionY0Gr, papTMLinePositionX1Gr, papTMLinePositionY1Gr, papPixelComponentOrganizationGr, papPixelComponentMaskGr, papPixelComponentRangeStartGr, papPixelComponentRangeStopGr, papPixelComponentPhysicalUnitsGr, papPixelComponentDataTypeGr, papNumberofTableBreakPointsGr, papTableofXBreakPointsGr, papTableofYBreakPointsGr, papNumberofTableEntriesGr, papTableofPixelValuesGr, papTableofParameterValuesGr, papDetectorConditionsNominalFlagGr, papDetectorTemperatureGr, papDetectorTypeGr, papDetectorConfigurationGr, papDetectorDescriptionGr, papDetectorModeGr, papDetectorIDGr, papDateofLastDetectorCalibrationGr, papTimeofLastDetectorCalibrationGr, papExposuresonDetectorSinceLastCalibrationGr, papExposuresonDetectorSinceManufacturedGr, papDetectorTimeSinceLastExposureGr, papDetectorActiveTimeGr, papDetectorActivationOffsetFromExposureGr, papDetectorBinningGr, papDetectorElementPhysicalSizeGr, papDetectorElementSpacingGr, papDetectorActiveShapeGr, papDetectorActiveDimensionsGr, papDetectorActiveOriginGr, papFieldofViewOriginGr, papFieldofViewRotationGr, papFieldofViewHorizontalFlipGr, papGridAbsorbingMaterialGr, papGridSpacingMaterialGr, papGridThicknessGr, papGridPitchGr, papGridAspectRatioGr, papGridPeriodGr, papGridFocalDistanceGr, papFilterMaterialGr, papFilterThicknessMinimumGr, papFilterThicknessMaximumGr, papExposureControlModeGr, papExposureControlModeDescriptionGr, papExposureStatusGr, papPhototimerSettingGr, papExposureTimeInMSGr, papXRayTubeCurrentInMAGr, papContentQualification, papPulseSequenceName, papMRImagingModifierSequence, papEchoPulseSequence, papInversionRecovery, papFlowCompensation, papMultipleSpinEcho, papMultiPlanarExcitation, papPhaseContrast, papTimeOfFlightContrast, papSpoiling, papSteadyStatePulseSequence, papEchoPlanarPulseSequence, papTagAngleFirstAxis, papMagnetizationTransfer, papT2Preparation, papBloodSignalNulling, papSaturationRecovery, papSpectrallySelectedSuppression, papSpectrallySelectedExcitation, papSpatialPreSaturation, papTagging, papOversamplingPhase, papTagSpacingFirstDimension, papGeometryOfKSpaceTraversal, papSegmentedKSpaceTraversal, papRectilinearPhaseEncodeReordering, papTagThickness, papPartialFourierDirection, papGatingSynchronizationTechnique, papReceiveCoilManufacturerName, papMRReceiveCoilSequence, papReceiveCoilType, papQuadratureReceiveCoil, papMultiCoilDefinitionSequence, papMultiCoilConfiguration, papMultiCoilElementName, papMultiCoilElementUsed, papMRTransmitCoilSequence, papTransmitCoilManufacturerName, papTransmitCoilType, papSpectralWidth, papChemicalShiftReference, papVolumeLocalizationTechnique, papMRAcquisitionFrequencyEncodingSteps, papDecoupling, papDecoupledNucleus, papDecouplingFrequency, papDecouplingMethod, papDecouplingChemicalShiftReference, papKSpaceFiltering, papTimeDomainFiltering, papNumberOfZeroFills, papBaselineCorrection, papCardiacRRIntervalSpecified, papAcquisitionDuration, papFrameAcquisitionDatetime, papDiffusionDirectionality, papDiffusionGradientDirectionSequence, papParallelAcquisition, papParallelAcquisitionTechnique, papInversionTimes, papMetaboliteMapDescription, papPartialFourier, papEffectiveEchoTime, papChemicalShiftSequence, papCardiacSignalSource, papDiffusionBValue, papDiffusionGradientOrientation, papVelocityEncodingDirection, papVelocityEncodingMinimumValue, papNumberOfKSpaceTrajectories, papCoverageOfKSpace, papSpectroscopyAcquisitionPhaseRows, papParallelReductionFactorInPlane, papTransmitterFrequency, papResonantNucleus, papFrequencyCorrection, papMRSpectroscopyFOVGeometrySequence, papSlabThickness, papSlabOrientation, papMidSlabPosition, papMRSpatialSaturationSequence, papMRTimingAndRelatedParametersSequence, papMREchoSequence, papMRModifierSequence, papMRDiffusionSequence, papCardiacTriggerSequence, papMRAveragesSequence, papMRFOVGeometrySequence, papSpectroscopyAcquisitionDataColumns, papVolumeLocalizationSequence, papDiffusionAnisotropyType, papFrameReferenceDatetime, papMetaboliteMapSequence, papParallelReductionFactorOutOfPlane, papSpectroscopyAcquisitionOutOfPlanePhaseSteps, papBulkMotionStatus, papParallelReductionFactorSecondInPlane, papCardiacBeatRejectionTechnique, papRespiratoryMotionCompensation, papRespiratorySignalSource, papBulkMotionCompensationTechnique, papBulkMotionSignal, papApplicableSafetyStandardAgency, papApplicableSafetyStandardVersion, papOperationModeSequence, papOperatingModeType, papOperationMode, papSpecificAbsorptionRateDefinition, papGradientOutputType, papSpecificAbsorptionRateValue, papGradientOutput, papFlowCompensationDirection, papTaggingDelay, papChemicalShiftsMinimumIntegrationLimit, papChemicalShiftsMaximumIntegrationLimit, papMRVelocityEncodingSequence, papFirstOrderPhaseCorrection, papWaterReferencedPhaseCorrection, papMRSpectroscopyAcquisitionType, papRespiratoryMotionStatus, papVelocityEncodingMaximumValue, papTagSpacingSecondDimension, papTagAngleSecondAxis, papFrameAcquisitionDuration, papMRImageFrameTypeSequence, papMRSpectroscopyFrameTypeSequence, papMRAcquisitionPhaseEncodingStepsInPlane, papMRAcquisitionPhaseEncodingStepsOutOfPlane, papSpectroscopyAcquisitionPhaseColumns, papCardiacMotionStatus, papSpecificAbsorptionRateSequence, papRevolutionTime, papSingleCollimationWidth, papTotalCollimationWidth, papTableSpeed, papTableFeedPerRotation, papSpiralPitchFactor, papEndGroup18 }; /* Group20 */ enum { papStudyInstanceUIDGr = 1, papSeriesInstanceUIDGr, papStudyIDGr, papSeriesNumberGr, papAcquisitionNumberGr, papImageNumberGr, papIsotopeNumberGr, papPhaseNumberGr, papIntervalNumberGr, papTimeSlotNumberGr, papAngleNumberGr, papItemNumberGr, papPatientOrientationGr, papOverlayNumberGr, papCurveNumberGr, papLUTNumberGr, papImagePosition20Gr, papImagePositionPatientGr, papImageOrientationGr, papImageOrientationPatientGr, papLocationGr, papFrameofReferenceUIDGr, papLateralityGr, papImageLateralityGr, papImageGeometryTypeGr, papMaskingImageGr, papTemporalPositionIdentifierGr, papNumberofTemporalPositionsGr, papTemporalResolutionGr, papSeriesinStudyGr, papAcquisitionsinSeriesGr, papImagesinAcquisitionGr, papImagesinSeriesGr, papAcquisitioninStudyGr, papImagesinStudyGr, papReferenceGr, papPositionReferenceIndicatorGr, papSliceLocationGr, papOtherStudyNumbersGr, papNumberofPatientRelatedStudiesGr, papNumberofPatientRelatedSeriesGr, papNumberofPatientRelatedImagesGr, papNumberofStudyRelatedSeriesGr, papNumberofStudyRelatedImagesGr, papNumberofSeriesRelatedImagesGr, papSourceImageIDsGr, papModifyingDeviceIDGr, papModifiedImageIDGr, papModifiedImageDateGr, papModifyingDeviceManufacturerGr, papModifiedImageTimeGr, papModifiedImageDescriptionGr, papImageCommentsGr, papOriginalImageIdentificationGr, papOriginalImageIdentificationNomenclatureGr, papStackID, papInStackPositionNumber, papFrameAnatomySequence, papFrameLaterality, papFrameContentSequence, papPlanePositionSequence, papPlaneOrientationSequence, papTemporalPositionIndex, papTriggerDelayTime, papFrameAcquisitionNumber, papDimensionIndexValues, papFrameComments, papConcatenationUID, papInConcatenationNumber, papInConcatenationTotalNumber, papDimensionOrganizationUID, papDimensionIndexPointer, papFunctionalGroupSequencePointer, papDimensionIndexPrivateCreator, papDimensionOrganizationSequence, papDimensionSequence, papConcatenationFrameOffsetNumber, papFunctionalGroupPrivateCreator, papImagePositionVolumeGr, papImageOrientationVolumeGr, papPlanePositionVolumeSequence, papEndGroup20 }; /* Group28 */ enum { papSamplesperPixelGr = 1, papPhotometricInterpretationGr, papImageDimensionsGr, papPlanarConfigurationGr, papNumberofFramesGr, papFrameIncrementPointerGr, papRowsGr, papColumnsGr, papPlanesGr, papUltrasoundColorDataPresentGr, papPixelSpacingGr, papZoomFactorGr, papZoomCenterGr, papPixelAspectRatioGr, papImageFormatGr, papManipulatedImageGr, papCorrectedImageGr, papCompressionCodeGr, papBitsAllocatedGr, papBitsStoredGr, papHighBitGr, papPixelRepresentationGr, papSmallestValidPixelValueGr, papLargestValidPixelValueGr, papSmallestImagePixelValueGr, papLargestImagePixelValueGr, papSmallestPixelValueinSeriesGr, papLargestPixelValueinSeriesGr, papSmallestImagePixelValueinPlaneGr, papLargestImagePixelValueinPlaneGr, papPixelPaddingValueGr, papImageLocationGr, papQualityControlImageGr, papBurnedInAnnotationGr, papPixelIntensityRelationshipGr, papPixelIntensityRelationshipSignGr, papWindowCenterGr, papWindowWidthGr, papRescaleInterceptGr, papRescaleSlopeGr, papRescaleTypeGr, papWindowCenterWidthExplanationGr, papGrayScaleGr, papRecommendedViewingModeGr, papGrayLookupTableDescriptorGr, papRedPaletteColorLookupTableDescriptorGr, papGreenPaletteColorLookupTableDescriptorGr, papBluePaletteColorLookupTableDescriptorGr, papPaletteColorLookupTableUIDGr, papGrayLookupTableDataGr, papRedPaletteCLUTDataGr, papGreenPaletteCLUTDataGr, papBluePaletteCLUTDataGr, papSegmentedRedPaletteColorLookupTableDataGr, papSegmentedGreenPaletteColorLookupTableDataGr, papSegmentedBluePaletteColorLookupTableDataGr, papImplantPresentGr, papPartialViewGr, papPartialViewDescriptionGr, papLossyImageCompressionGr, papLossyImageCompressionRatioGr, papModalityLUTSequenceGr, papLUTDescriptorGr, papLUTExplanationGr, papModalityLUTTypeGr, papLUTDataGr, papVOILUTSequenceGr, papSoftcopyVOILUTSequenceGr, papComments28Gr, papBiPlaneAcquisitionSequenceGr, papRepresentativeFrameNumberGr, papFrameNumbersofInterestGr, papFramesofInterestDescriptionGr, papMaskPointersGr, papRWavePointerGr, papMaskSubtractionSequenceGr, papMaskOperationGr, papApplicableFrameRangeGr, papMaskFrameNumbersGr, papContrastFrameAveragingGr, papMaskSubpixelShiftGr, papTIDOffsetGr, papMaskOperationExplanationGr, papDataPointRows, papDataPointColumns, papSignalDomain, papLargestMonochromePixelValue, papDataRepresentation, papPixelMatrixSequence, papFrameVOILUTSequence, papPixelValueTransformationSequence, papSignalDomainRows, papEndGroup28 }; /* Group32 */ enum { papStudyStatusIDGr = 1, papStudyPriorityIDGr, papStudyIDIssuerGr, papStudyVerifiedDateGr, papStudyVerifiedTimeGr, papStudyReadDateGr, papStudyReadTimeGr, papScheduledStudyStartDateGr, papScheduledStudyStartTimeGr, papScheduledStudyStopDateGr, papScheduledStudyStopTimeGr, papScheduledStudyLocationGr, papScheduledStudyLocationAETitlesGr, papReasonforStudyGr, papRequestingPhysicianGr, papRequestingServiceGr, papStudyArrivalDateGr, papStudyArrivalTimeGr, papStudyCompletionDateGr, papStudyCompletionTimeGr, papStudyComponentStatusIDGr, papRequestedProcedureDescriptionGr, papRequestedProcedureCodeSequenceGr, papRequestedContrastAgentGr, papStudyCommentsGr, papEndGroup32 }; /* Group38 */ enum { papReferencedPatientAliasSequenceGr = 1, papVisitStatusIDGr, papAdmissionIDGr, papIssuerofAdmissionIDGr, papRouteofAdmissionsGr, papScheduledAdmissionDateGr, papScheduledAdmissionTimeGr, papScheduledDischargeDateGr, papScheduledDischargeTimeGr, papScheduledPatientInstitutionResidenceGr, papAdmittingDateGr, papAdmittingTimeGr, papDischargeDateGr, papDischargeTimeGr, papDischargeDiagnosisDescriptionGr, papDischargeDiagnosisCodeSequenceGr, papSpecialNeedsGr, papCurrentPatientLocationGr, papPatientsInstitutionResidenceGr, papPatientStateGr, papVisitCommentsGr, papEndGroup38 }; /* Group3A */ enum { papWaveformOriginalityGr = 1, papNumberOfWaveformChannelsGr, papNumberOfWaveformSamplesGr, papSamplingFrequencyGr, papMultiplexGroupLabelGr, papChannelDefinitionSequenceGr, papWaveformChannelNumberGr, papChannelLabelGr, papChannelStatusGr, papChannelSourceSequenceGr, papChannelSourceModifiersSequenceGr, papSourceWaveformSequenceGr, papChannelDerivationDescriptionGr, papChannelSensitivityGr, papChannelSensitivityUnitsSequenceGr, papChannelSensitivityCorrectionFactorGr, papChannelBaselineGr, papChannelTimeSkewGr, papChannelSampleSkewGr, papChannelOffsetGr, papWaveformBitsStoredGr, papFilterLowFrequencyGr, papFilterHighFrequencyGr, papNotchFilterFrequencyGr, papNotchFilterBandwidthGr, papEndGroup3A }; /* Group40 */ enum { papScheduledStationAETitleGr = 1, papScheduledProcedureStepStartDateGr, papScheduledProcedureStepStartTimeGr, papScheduledProcedureStepEndDateGr, papScheduledProcedureStepEndTimeGr, papScheduledPerformingPhysiciansNameGr, papScheduledProcedureStepDescriptionGr, papScheduledActionItemCodeSequenceGr, papScheduledProcedureStepIDGr, papStageCodeSequenceGr, papScheduledStationNameGr, papScheduledProcedureStepLocationGr, papPreMedicationGr, papScheduledProcedureStepStatusGr, papScheduledProcedureStepSequenceGr, papReferencedStandaloneSOPInstanceSequenceGr, papPerformedStationAETitleGr, papPerformedStationNameGr, papPerformedLocationGr, papPerformedProcedureStepStartDateGr, papPerformedProcedureStepStartTimeGr, papPerformedProcedureStepEndDateGr, papPerformedProcedureStepEndTimeGr, papPerformedProcedureStepStatusGr, papPerformedProcedureStepIDGr, papPerformedProcedureStepDescriptionGr, papPerformedProcedureStepTypeGr, papPerformedActionItemSequenceGr, papScheduledStepAttributesSequenceGr, papRequestedAttributesSequenceGr, papCommentsOnThePerformedProcedureStepsGr, papQuantitySequenceGr, papQuantityGr, papMeasuringUnitsSequenceGr, papBillingItemSequenceGr, papTotalTimeOfFluoroscopyGr, papTotalNumberOfExposuresGr, papEntranceDoseGr, papExposedAreaGr, papDistanceSourcetoEntranceGr, papDistanceSourcetoSupportGr, papCommentsonRadiationDoseGr, papXRayOutputGr, papHalfValueLayerGr, papOrganDoseGr, papOrganExposedGr, papBillingProcedureStepSequenceGr, papFilmConsumptionSequenceGr, papBillingSuppliesAndDevicesSequenceGr, papReferencedProcedureStepSequenceGr, papPerformedSeriesSequenceGr, papCommentsontheScheduledProcedureStepGr, papSpecimenAccessionNumberGr, papSpecimenSequenceGr, papSpecimenIdentifierGr, papAcquisitionContextSequenceGr, papAcquisitionContextDescriptionGr, papSpecimenTypeCodeSequenceGr, papSlideIdentifierGr, papImageCenterPointCoordinatesSequenceGr, papXOffsetInSlideCoordinateSystemGr, papYOffsetInSlideCoordinateSystemGr, papZOffsetInSlideCoordinateSystemGr, papPixelSpacingSequenceGr, papCoordinateSystemAxisCodeSequenceGr, papMeasurementUnitsCodeSequenceGr, papRequestedProcedureIDGr, papReasonfortheRequestedProcedureGr, papRequestedProcedurePriorityGr, papPatientTransportArrangementsGr, papRequestedProcedureLocationGr, papPlacerOrderNumberProcedureGr, papFillerOrderNumberProcedureGr, papConfidentialityCodeGr, papReportingPriorityGr, papNamesofIntendedRecipientsofResultsGr, papRequestedProcedureCommentsGr, papReasonfortheImagingServiceRequestGr, papIssueDateofImagingServiceRequestGr, papIssueTimeofImagingServiceRequestGr, papPlacerOrderNumberImagingServiceRequestGr, papFillerOrderNumberImagingServiceRequestGr, papOrderEnteredByGr, papOrderEnterersLocationGr, papOrderCallbackPhoneNumberGr, papImagingServiceRequestCommentsGr, papConfidentialityConstraintonPatientDataDescriptionGr, papEntranceDoseInMyGyGr, papRelationshipTypeGr, papVerifyingOrganizationGr, papVerificationDateTimeGr, papObservationDateTimeGr, papValueTypeGr, papConceptNameCodeSequenceGr, papContinuityOfContentGr, papVerifyingObserverSequenceGr, papVerifyingObserverNameGr, papVerifyingObserverIdentificationCodeSequenceGr, papReferencedWaveformChannelsGr, papDateTimeGr, papDateGr, papTimeGr, papPersonNameGr, papUIDGr, papTemporalRangeTypeGr, papReferencedSamplePositionsGr, papReferencesFrameNumbersGr, papReferencedTimeOffsetsGr, papReferencedDatetimeGr, papTextValueGr, papConceptCodeSequenceGr, papAnnotationGroupNumberGr, papModifierCodeSequenceGr, papMeasuredValueSequenceGr, papNumericValueGr, papPredecessorDocumentsSequenceGr, papReferencedRequestSequenceGr, papPerformedProcedureCodeSequenceGr, papCurentRequestedProcedureEvidenceSequenceGr, papPertinentOtherEvidenceSequenceGr, papCompletionFlagGr, papCompletionFlagDescriptionGr, papVerificationFlagGr, papContentTemplateSequenceGr, papIdenticalDocumentsSequenceGr, papContentSequenceGr, papAnnotationSequenceGr, papTemplateIdentifierGr, papTemplateVersionGr, papTemplateLocalVersionGr, papTemplateExtensionFlagGr, paptemplateExtensionOrganizationUIDGr, paptemplateExtensionCreatorUIDGr, papReferencedContentItemIdentifierGr, papRealWorldValueMappingSequence, papLUTLabel, papRealWorldValueLUTLastValueMapped, papRealWorldValueLUTData, papRealWorldValueLUTFirstValueMapped, papRealWorldValueIntercept, papRealWorldValueSlope, papEndGroup40 }; /* Group41 */ enum { papOwnerIDGr = 1, papComments41Gr, papPointerSequenceGr, papImagePointerGr, papPixelOffsetGr, papImageIdentifierSequenceGr, papExternalPAPYRUSFileReferenceSequenceGr, papNumberofimagesGr, papReferencedSOPClassUID41Gr, papReferencedSOPInstanceUID41Gr, papReferencedFileNameGr, papReferencedFilePathGr, papReferencedImageSOPClassUIDGr, papReferencedImageSOPInstanceUIDGr, papImageSequenceGr, papEndGroup41 }; /* Group42 */ enum { papDocumentTitleGr = 1, papEncapsulatedDocumentGr, papMIMETypeOfEncapsulatedDocumentGr, papSourceInstanceSequenceGr, papEndGroup42 }; /* Group50 */ enum { papCalibrationObjectGr = 1, papDeviceSequenceGr, papDeviceLengthGr, papDeviceDiameterGr, papDeviceDiameterUnitsGr, papDeviceVolumeGr, papIntermarkerDistanceGr, papDeviceDescriptionGr, papEndGroup50 }; /* Group54 */ enum { papEnergyWindowVectorGr = 1, papNumberofEnergyWindowsGr, papEnergyWindowInformationSequenceGr, papEnergyWindowRangeSequenceGr, papEnergyWindowLowerLimitGr, papEnergyWindowUpperLimitGr, papRadiopharmaceuticalInformationSequenceGr, papResidualSyringeCountsGr, papEnergyWindowNameGr, papDetectorVectorGr, papNumberofDetectorsGr, papDetectorInformationSequenceGr, papPhaseVectorGr, papNumberofPhasesGr, papPhaseInformationSequenceGr, papNumberofFramesinPhaseGr, papPhaseDelayGr, papPauseBetweenFramesGr, papRotationVectorGr, papNumberofRotationsGr, papRotationInformationSequenceGr, papNumberofFramesinRotationGr, papRRIntervalVectorGr, papNumberofRRIntervalsGr, papGatedInformationSequenceGr, papDataInformationSequenceGr, papTimeSlotVectorGr, papNumberofTimeSlotsGr, papTimeSlotInformationSequenceGr, papTimeSlotTimeGr, papSliceVectorGr, papNumberofSlicesGr, papAngularViewVectorGr, papTimeSliceVectorGr, papNumberOfTimeSlicesGr, papStartAngleGr, papTypeofDetectorMotionGr, papTriggerVectorGr, papNumberofTriggersinPhaseGr, papViewCodeSequenceGr, papViewModifierCodeSequenceGr, papRadionuclideCodeSequenceGr, papAdministrationRouteCodeSequenceGr, papRadiopharmaceuticalCodeSequenceGr, papCalibrationDataSequenceGr, papEnergyWindowNumberGr, papImageIDGr, papPatientOrientationCodeSequenceGr, papPatientOrientationModifierCodeSequenceGr, papPatientGantryRelationshipCodeSequenceGr, papSeriesTypeGr, papUnitsGr, papCountsSourceGr, papReprojectionMethodGr, papRandomsCorrectionMethodGr, papAttenuationCorrectionMethodGr, papDecayCorrectionGr, papReconstructionMethodGr, papDetectorLinesOfResponseUsedGr, papScatterCorrectionMethodGr, papAxialAcceptanceGr, papAxialMashGr, papTransverseMashGr, papDetectorElementSizeGr, papCoincidenceWindowWidthGr, papSecondaryCountsTypeGr, papFrameReferenceTimeGr, papPrimaryCountsAccumulatedGr, papSecondaryCountsAccumulatedGr, papSliceSensitivityFactorGr, papDecayFactorGr, papDoseCalibrationFactorGr, papScatterFractionFactorGr, papDeadTimeFactorGr, papImageIndexGr, papCountsIncludedGr, papDeadTimeCorrectionFlagGr, papEndGroup54 }; /* Group60 */ enum { papHistogramSequenceGr = 1, papHistogramNumberofBinsGr, papHistogramFirstBinValueGr, papHistogramLastBinValueGr, papHistogramBinWidthGr, papHistogramExplanationGr, papHistogramDataGr, papEndGroup60 }; /* Group70 */ enum { papGraphicAnnotationSequenceGr = 1, papGraphicLayerGr, papBoundingBoxAnnotationUnitsGr, papAnchorPointAnnotationUnitsGr, papGraphicAnnotationUnitsGr, papUnformattedTexValueGr, papTextObjectSequenceGr, papBoundingBoxTopLeftHandCornerGr, papBoundingBoxBottomRightHandCornerGr, papBoundingBoxTextHorizontalJustificationGr, papAnchorPoint70Gr, papAnchorPointVisibilityGr, papGraphicDimensionsGr, papNumberOfGraphicPointsGr, papGraphicDataGr, papGraphicTypeGr, papGraphicFilledGr, papImageHorizontalFlipGr, papImageRotationGr, papDisplayedAreaTopLeftHandCornerGr, papDisplayedAreaBottomRightHandCornerGr, papDisplayedAreaSelectionSequenceGr, papGraphicLayerSequenceGr, papGraphicLayerOrderGr, papGraphicLayerRecommendedDisplayGrayscaleValueGr, papGraphicLayerRecommendedDisplayRGBValueGr, papGraphicLayerDescriptionGr, papPresentationLabelGr, papPresentationDescriptionGr, papPresentationCreationDateGr, papPresentationCreationTimeGr, papPresentationCreatorsNameGr, papPresentationSizeModeGr, papPresentationPixelSpacingGr, papPresentationPixelAspectRationGr, papPresentationPixelMagnificationRatioGr, papEndGroup70 }; /* Group88 */ enum { papStorageMediaFilesetIDGr = 1, papStorageMediaFilesetUIDGr, papIconImageSequenceGr, papTopicTitleGr, papTopicSubjectGr, papTopicAuthorGr, papTopicKeyWordsGr, papEndGroup88 }; /* Group100 */ enum { papSOPInstanceStatusGr = 1, papSOPAuthorizationDateAndTimeGr, papSOPAuthorizationCommentGr, papAuthorizationEquipmentCertificationNumberGr, papEndGroup100 }; /* Group2000 */ enum { papNumberOfCopiesGr = 1, papPrinterConfigurationSequenceGr, papPrintPriorityGr, papMediumTypeGr, papFilmDestinationGr, papFilmSessionLabelGr, papMemoryAllocationGr, papMaximumMemoryAllocationGr, papColorImagePrintingFlagGr, papCollationFlagGr, papAnnotationFlagGr, papImageOverlayFlagGr, papPresentationLUTFlagGr, papImageBoxPresentationLUTFlagGr, papMemoryBitDepthGr, papPrintingBitDepthGr, papMediaInstalledSequenceGr, papOtherMediaInstalledSequenceGr, papSupportedImageDisplayFormatsSequenceGr, papReferencedFilmBoxSequenceGr, papReferencedStoredPrintSequenceGr, papEndGroup2000 }; /* Group2001 */ enum { pap2001CineIndexGr = 1, pap2001PositionIndexGr, papEndGroup2001 }; /* Group2010 */ enum { papImageDisplayFormatGr = 1, papAnnotationDisplayFormatIDGr, papFilmOrientationGr, papFilmSizeIDGr, papMagnificationTypeGr, papSmoothingTypeGr, papDefaultMagnificationTypeGr, papOtherMagnificationTypesAvailableGr, papDefaultSmoothingTypeGr, papOtherSmoothingTypesAvailableGr, papBorderDensityGr, papEmptyImageDensityGr, papMinDensityGr, papMaxDensityGr, papTrimGr, papConfigurationInformationGr, papConfigurationInformationDescriptionGr, papMaximumCollatedFilmsGr, papIlluminationGr, papReflectedAmbientLightGr, papPrinterPixelSpacingGr, papReferencedFilmSessionSequenceGr, papReferencedImageBoxSequence2010Gr, papReferencedBasicAnnotationBoxSequenceGr, papEndGroup2010 }; /* Group2020 */ enum { papImagePosition2020Gr = 1, papPolarityGr, papRequestedImageSizeGr, papRequestedDecimateCropBehaviorGr, papRequestedResolutionIDGr, papRequestedImageSizeFlagGr, papDecimateCropResultGr, papPreformattedGrayscaleImageSequenceGr, papPreformattedColorImageSequenceGr, papReferencedImageOverlayBoxSequenceGr, papReferencedVOILUTBoxSequenceGr, papEndGroup2020 }; /* Group2030 */ enum { papAnnotationPositionGr = 1, papTextStringGr, papEndGroup2030 }; /* Group2040 */ enum { papReferencedOverlayPlaneSequenceGr = 1, papOverlayPixelDataSequenceGr, papReferencedOverlayPlaneGroupsGr, papOverlayMagnificationTypeGr, papOverlayMagnificationGr, papOverlaySmoothingTypeGr, papOverlayOrImageMagnificationGr, papMagnifyToNumberOfColumnsGr, papOverlayForegroundDensityGr, papOverlayBackgroundDensityGr, papOverlayModeGr, papThresholdDensityGr, papReferencedImageBoxSequence2040Gr, papEndGroup2040 }; /* Group2050 */ enum { papPresentationLUTSequenceGr, papPresentationLUTShapeGr, papReferencedPresentationLUTSequenceGr, papEndGroup2050 }; /* Group2100 */ enum { papExecutionStatusGr = 1, papExecutionStatusInfoGr, papCreationDateGr, papCreationTimeGr, papOriginatorGr, papDestinationAEGr, papReferencedPrintJobSequenceGr, papNumberOfFilmsGr, papEndGroup2100 }; /* Group2110 */ enum { papPrinterStatusGr = 1, papPrinterStatusInfoGr, papPrinterNameGr, papPrintQueueIDGr, papEndGroup2110 }; /* Group2120 */ enum { papQueueStatusGr = 1, papPrintJobDescriptionSequenceGr, papreferencedPrintJobSequenceGr, papEndGroup2120 }; /* Group2130 */ enum { papPrintManagementCapabilitiesSequenceGr = 1, papPrintCharacteristicsSequenceGr, papFilmBoxContentSequenceGr, papImageBoxContentSequenceGr, papAnnotationContentSequenceGr, papImageOverlayBoxContentSequenceGr, papPresentationLUTContentSequenceGr, papProposedStudySequenceGr, papOrigianlImageSequenceGr, papEndGroup2130 }; /* Group3002 */ enum { papRTImageLabelGr, papRTImageNameGr, papRTImageDescriptionGr, papReportedValuesOriginGr, papRTImagePlaneGr, papXRayImageReceptortranslationGr, papXRayImageReceptorAngleGr, papRTImageOrientationGr, papImagePlanePixelSpacingGr, papRTImagePositionGr, papRadiationMachineNameGr, papRadiationMachineSADGr, papRadiationMachineSSDGr, papRTImageSIDGr, papSourcetoReferenceObjectDistanceGr, papFractionNumberGr, papExposureSequenceGr, papMetersetExposureGr, papDiaphragmPositionGr, papEndGroup3002 }; /* Group3004 */ enum { papDVHTypeGr, papDoseUnitsGr, papDoseTypeGr, papDoseCommentGr, papNormalizationPointGr, papDoseSummationTypeGr, papGridFrameOffsetVectorGr, papDoseGridScalingGr, papRTDoseROISequenceGr, papDoseValueGr, papDVHNormalizationPointGr, papDVHNormalizationDoseValueGr, papDVHSequenceGr, papDVHDoseScalingGr, papDVHVolumeUnitsGr, papDVHNumberofBinsGr, papDVHDataGr, papDVHReferencedROISequenceGr, papDVHROIContributionTypeGr, papDVHMinimumDoseGr, papDVHMaximumDoseGr, papDVHMeanDoseGr, papEndGroup3004 }; /* Group3006 */ enum { papStructureSetLabelGr, papStructureSetNameGr, papStructureSetDescriptionGr, papStructureSetDateGr, papStructureSetTimeGr, papReferencedFrameofReferenceSequenceGr, papRTReferencedStudySequenceGr, papRTReferencedSeriesSequenceGr, papContourImageSequenceGr, papStructureSetROISequenceGr, papROINumberGr, papReferencedFrameofReferenceUIDGr, papROINameGr, papROIDescriptionGr, papROIDisplayColorGr, papROIVolumeGr, papRTRelatedROISequenceGr, papRTROIRelationshipGr, papROIGenerationAlgorithmGr, papROIGenerationDescriptionGr, papROIContourSequenceGr, papContourSequenceGr, papContourGeometricTypeGr, papContourSlabThicknessGr, papContourOffsetVectorGr, papNumberofContourPointsGr, papContourNumberGr, papAttachedContoursGr, papContourDataGr, papRTROIObservationsSequenceGr, papObservationNumberGr, papReferencedROINumberGr, papROIObservationLabelGr, papRTROIIdentificationCodeSequenceGr, papROIObservationDescriptionGr, papRelatedRTROIObservationsSequenceGr, papRTROIInterpretedTypeGr, papROIInterpreterGr, papROIPhysicalPropertiesSequenceGr, papROIPhysicalPropertyGr, papROIPhysicalPropertyValueGr, papFrameofReferenceRelationshipSequenceGr, papRelatedFrameofReferenceUIDGr, papFrameofReferenceTransformationTypeGr, papFrameofReferenceTransformationMatrixGr, papFrameofReferenceTransformationCommentGr, papEndGroup3006 }; /* Group3008 */ enum { papMeasuredDoseReferenceSequenceGr = 1, papMeasuredDoseDescriptionGr, papMeasuredDoseTypeGr, papMeasuredDoseValueGr, papTreatmentSessionBeamSequenceGr, papCurrentFractionNumberGr, papTreatmentControlPointDateGr, papTreatmentControlPointTimeGr, papTreatmentControlTerminationStatusGr, papTreatmentControlTerminationCodeGr, papTreatmentVerificationStatusGr, papReferencedTreatmentRecordSequenceGr, papSpecifiedPrimaryMetersetGr, papSpecifiedSecondaryMetersetGr, papDeliveredPrimaryMetersetGr, papDeliveredSecondaryMetersetGr, papSpecifiedTreatmentTimeGr, papDeliveredTreatmentTimeGr, papControlPointDeliverySequenceGr, papSpecifiedMetersetGr, papDeliveredMetersetGr, papDoseRateDeliveredGr, papTreatmentSummaryCalculatedDoseReferenceSequenceGr, papCumulativeDoseToDoseReferenceGr, papFirstTreatmentDateGr, papMostRecentTreatmentDateGr, papNumberOfFractionsDeliveredGr, papOverrideSequenceGr, papOverrideParameterPointerGr, papMeasuredDoseReferenceNumberGr, papOverrideReasonGr, papCalculatedDoseReferenceSequenceGr, papCalculatedDoseReferenceNumberGr, papCalculatedDoseReferenceDescriptionGr, papCalculatedDoseReferenceDoseValueGr, papStartMetersetGr, papEndMetersetGr, papReferencedMeasuredDoseReferenceSequenceGr, papReferencedMeasuredDoseReferenceNumberGr, papReferencedCalculatedDoseReferenceSequenceGr, papReferencedCalculatedDoseReferenceNumberGr, papBeamLimitingDeviceLeafPairsSequenceGr, papRecordedWedgeSequenceGr, papRecordedCompensatorSequenceGr, papRecordedBlockSequenceGr, papRecordedSourceSequenceGr, papSourceSerialNumberGr, papTreatmentSessionApplicationSetupSequenceGr, papApplicationSetupCheckGr, papRecordedBrachyAccessoryDeviceSequenceGr, papreferencedBrachyAccessoryDeviceNumberGr, papRecordedChannelSequenceGr, papSpecifiedChannelTotalTimeGr, papDeliveredChannelTotalTimeGr, papSpecifiedNumberOfPulsesGr, papDeliveredNumberOfPulsesGr, papSpecifiedPulseRepetitionIntervalGr, papDeliveredPulseRepetitionIntervalGr, papRecordedSourceApplicatorSequenceGr, papReferencedSourceApplicatorNumberGr, papRecordedChannelShieldSequenceGr, papReferencedCahnnelShieldNumberGr, papBrachyControlPointDeliveredSequenceGr, papSafePositionExitDateGr, papSafePositionExitTimeGr, papSafePositionReturnDateGr, papSafePositionReturnTimeGr, papCurrentTreatmentStatusGr, papTreatmentStatusCommentGr, papFractionGropSummarySequenceGr, papReferencedFractionNumberGr, papFractionGroupTypeGr, papBeamStopperPositionGr, papFractionStatusSummarySequenceGr, papTreatmentDateGr, papTreatmentTimeGr, papEndGroup3008 }; /* Group300A */ enum { papRTPlanLabelGr = 1, papRTPlanNameGr, papRTPlanDescriptionGr, papRTPlanDateGr, papRTPlanTimeGr, papTreatmentProtocolsGr, papTreatmentIntentGr, papTreatmentSitesGr, papRTPlanGeometryGr, papPrescriptionDescriptionGr, papDoseReferenceSequenceGr, papDoseReferenceNumberGr, papDoseReferenceStructureTypeGr, papNominalBeamEnergyUnitGr, papDoseReferenceDescriptionGr, papDoseReferencePointCoordinatesGr, papNominalPriorDoseGr, papDoseReferenceTypeGr, papConstraintWeightGr, papDeliveryWarningDoseGr, papDeliveryMaximumDoseGr, papTargetMinimumDoseGr, papTargetPrescriptionDoseGr, papTargetMaximumDoseGr, papTargetUnderdoseVolumeFractionGr, papOrganatRiskFullvolumeDoseGr, papOrganatRiskLimitDoseGr, papOrganatRiskMaximumDoseGr, papOrganatRiskOverdoseVolumeFractionGr, papToleranceTableSequenceGr, papToleranceTableNumberGr, papToleranceTableLabelGr, papGantryAngleToleranceGr, papBeamLimitingDeviceAngleToleranceGr, papBeamLimitingDeviceToleranceSequenceGr, papBeamLimitingDevicePositionToleranceGr, papPatientSupportAngleToleranceGr, papTableTopEccentricAngleToleranceGr, papTableTopVerticalPositionToleranceGr, papTableTopLongitudinalPositionToleranceGr, papTableTopLateralPositionToleranceGr, papRTPlanRelationshipGr, papFractionGroupSequenceGr, papFractionGroupNumberGr, papNumberofFractionsPlannedGr, papNumberofFractionsPerDayGr, papRepeatFractionCycleLengthGr, papFractionPatternGr, papNumberofBeamsGr, papBeamDoseSpecificationPointGr, papBeamDoseGr, papBeamMetersetGr, papNumberofBrachyApplicationSetupsGr, papBrachyApplicationSetupDoseSpecificationPointGr, papBrachyApplicationSetupDoseGr, papBeamSequenceGr, papTreatmentMachineNameGr, papPrimaryDosimeterUnitGr, papSourceAxisDistanceGr, papBeamLimitingDeviceSequenceGr, papRTBeamLimitingDeviceTypeGr, papSourcetoBeamLimitingDeviceDistanceGr, papNumberofLeafJawPairsGr, papLeafPositionBoundariesGr, papBeamNumberGr, papBeamNameGr, papBeamDescriptionGr, papBeamTypeGr, papRadiationTypeGr, papHighDoseTechniqueTypeGr, papReferenceImageNumberGr, papPlannedVerificationImageSequenceGr, papImagingDeviceSpecificAcquisitionParametersGr, papTreatmentDeliveryTypeGr, papNumberofWedgesGr, papWedgeSequenceGr, papWedgeNumberGr, papWedgeTypeGr, papWedgeIDGr, papWedgeAngleGr, papWedgeFactorGr, papWedgeOrientationGr, papSourcetoWedgeTrayDistanceGr, papNumberofCompensatorsGr, papMaterialIDGr, papTotalCompensatorTrayFactorGr, papCompensatorSequenceGr, papCompensatorNumberGr, papCompensatorIDGr, papSourcetoCompensatorTrayDistanceGr, papCompensatorRowsGr, papCompensatorColumnsGr, papCompensatorPixelSpacingGr, papCompensatorPositionGr, papCompensatorTransmissionDataGr, papCompensatorThicknessDataGr, papNumberofBoliGr, papCompensatorTypeGr, papNumberofBlocksGr, papTotalBlockTrayFactorGr, papBlockSequenceGr, papBlockTrayIDGr, papSourcetoBlockTrayDistanceGr, papBlockTypeGr, papBlockDivergenceGr, papBlockNumberGr, papBlockNameGr, papBlockThicknessGr, papBlockTransmissionGr, papBlockNumberofPointsGr, papBlockDataGr, papApplicatorSequenceGr, papApplicatorIDGr, papApplicatorTypeGr, papApplicatorDescriptionGr, papCumulativeDoseReferenceCoefficientGr, papFinalCumulativeMetersetWeightGr, papNumberofControlPointsGr, papControlPointSequenceGr, papControlPointIndexGr, papNominalBeamEnergyGr, papDoseRateSetGr, papWedgePositionSequenceGr, papWedgePositionGr, papBeamLimitingDevicePositionSequenceGr, papLeafJawPositionsGr, papGantryAngleGr, papGantryRotationDirectionGr, papBeamLimitingDeviceAngleGr, papBeamLimitingDeviceRotationDirectionGr, papPatientSupportAngleGr, papPatientSupportRotationDirectionGr, papTableTopEccentricAxisDistanceGr, papTableTopEccentricAngleGr, papTableTopEccentricRotationDirectionGr, papTableTopVerticalPositionGr, papTableTopLongitudinalPositionGr, papTableTopLateralPositionGr, papIsocenterPositionGr, papSurfaceEntryPointGr, papSourcetoSurfaceDistanceGr, papCumulativeMetersetWeightGr, papPatientSetupSequenceGr, papPatientSetupNumberGr, papPatientAdditionalPositionGr, papFixationDeviceSequenceGr, papFixationDeviceTypeGr, papFixationDeviceLabelGr, papFixationDeviceDescriptionGr, papFixationDevicePositionGr, papShieldingDeviceSequenceGr, papShieldingDeviceTypeGr, papShieldingDeviceLabelGr, papShieldingDeviceDescriptionGr, papShieldingDevicePositionGr, papSetupTechniqueGr, papSetupTechniqueDescriptionGr, papSetupDeviceSequenceGr, papSetupDeviceTypeGr, papSetupDeviceLabelGr, papSetupDeviceDescriptionGr, papSetupDeviceParameterGr, papSetupReferenceDescriptionGr, papTableTopVerticalSetupDisplacementGr, papTableTopLongitudinalSetupDisplacementGr, papTableTopLateralSetupDisplacementGr, papBrachyTreatmentTechniqueGr, papBrachyTreatmentTypeGr, papTreatmentMachineSequenceGr, papSourceSequenceGr, papSourceNumberGr, papSourceTypeGr, papSourceManufacturerGr, papActiveSourceDiameterGr, papActiveSourceLengthGr, papSourceEncapsulationNominalThicknessGr, papSourceEncapsulationNominalTransmissionGr, papSourceIsotopeNameGr, papSourceIsotopeHalfLifeGr, papReferenceAirKermaRateGr, papAirKermaRateReferenceDateGr, papAirKermaRateReferenceTimeGr, papApplicationSetupSequenceGr, papApplicationSetupTypeGr, papApplicationSetupNumberGr, papApplicationSetupNameGr, papApplicationSetupManufacturerGr, papTemplateNumberGr, papTemplateTypeGr, papTemplateNameGr, papTotalReferenceAirKermaGr, papBrachyAccessoryDeviceSequenceGr, papBrachyAccessoryDeviceNumberGr, papBrachyAccessoryDeviceIDGr, papBrachyAccessoryDeviceTypeGr, papBrachyAccessoryDeviceNameGr, papBrachyAccessoryDeviceNominalThicknessGr, papBrachyAccessoryDeviceNominalTransmissionGr, papChannelSequenceGr, papChannelNumberGr, papChannelLengthGr, papChannelTotalTimeGr, papSourceMovementTypeGr, papNumberofPulsesGr, papPulseRepetitionIntervalGr, papSourceApplicatorNumberGr, papSourceApplicatorIDGr, papSourceApplicatorTypeGr, papSourceApplicatorNameGr, papSourceApplicatorLengthGr, papSourceApplicatorManufacturerGr, papSourceApplicatorWallNominalThicknessGr, papSourceApplicatorWallNominalTransmissionGr, papSourceApplicatorStepSizeGr, papTransferTubeNumberGr, papTransferTubeLengthGr, papChannelShieldSequenceGr, papChannelShieldNumberGr, papChannelShieldIDGr, papChannelShieldNameGr, papChannelShieldNominalThicknessGr, papChannelShieldNominalTransmissionGr, papFinalCumulativeTimeWeightGr, papBrachyControlPointSequenceGr, papControlPointRelativePositionGr, papControlPoint3DPositionGr, papCumulativeTimeWeightGr, papEndGroup300A }; /* Group300C */ enum { papReferencedRTPlanSequenceGr, papReferencedBeamSequenceGr, papReferencedBeamNumberGr, papReferencedReferenceImageNumberGr, papStartCumulativeMetersetWeightGr, papEndCumulativeMetersetWeightGr, papReferencedBrachyApplicationSetupSequenceGr, papReferencedBrachyApplicationSetupNumberGr, papReferencedSourceNumberGr, papReferencedFractionGroupSequenceGr, papReferencedFractionGroupNumberGr, papReferencedVerificationImageSequenceGr, papReferencedReferenceImageSequenceGr, papReferencedDoseReferenceSequenceGr, papReferencedDoseReferenceNumberGr, papBrachyReferencedDoseReferenceSequenceGr, papReferencedStructureSetSequenceGr, papReferencedPatientSetupNumberGr, papReferencedDoseSequenceGr, papReferencedToleranceTableNumberGr, papReferencedBolusSequenceGr, papReferencedWedgeNumberGr, papReferencedCompensatorNumberGr, papReferencedBlockNumberGr, papReferencedControlPointIndexGr, papEndGroup300C }; /* Group300E */ enum { papApprovalStatusGr, papReviewDateGr, papReviewTimeGr, papReviewerNameGr, papEndGroup300E }; /* Group4000 */ enum { papArbitraryGr = 1, papCommentsGr, papEndGroup4000 }; /* Group4008 */ enum { papResultsIDGr = 1, papResultsIDIssuerGr, papReferencedInterpretationSequenceGr, papInterpretationRecordedDateGr, papInterpretationRecordedTimeGr, papInterpretationRecorderGr, papReferencetoRecordedSoundGr, papInterpretationTranscriptionDateGr, papInterpretationTranscriptionTimeGr, papInterpretationTranscriberGr, papInterpretationTextGr, papInterpretationAuthorGr, papInterpretationApproverSequenceGr, papInterpretationApprovalDateGr, papInterpretationApprovalTimeGr, papPhysicianApprovingInterpretationGr, papInterpretationDiagnosisDescriptionGr, papDiagnosisCodeSequenceGr, papResultsDistributionListSequenceGr, papDistributionNameGr, papDistributionAddressGr, papInterpretationIDGr, papInterpretationIDIssuerGr, papInterpretationTypeIDGr, papInterpretationStatusIDGr, papImpressionsGr, papResultsCommentsGr, papEndGroup4008 }; /* Group5000 */ enum { papCurveDimensionsGr = 1, papNumberofPointsGr, papTypeofDataGr, papCurveDescriptionGr, papAxisUnitsGr, papAxisLabelsGr, papDataValueRepresentationGr, papMinimumCoordinateValueGr, papMaximumCoordinateValueGr, papCurveRangeGr, papCurveDataDescriptorGr, papCoordinateStartValueGr, papCoordinateStepValueGr, papCurveActivationLayerGr, papAudioTypeGr, papAudioSampleFormatGr, papNumberofChannelsGr, papNumberofSamplesGr, papSampleRateGr, papTotalTimeGr, papAudioSampleDataGr, papAudioCommentsGr, papCurveLabelGr, papReferencedOverlaySequence5000Gr, papReferencedOverlayGroupGr, papCurveDataGr, papEndGroup5000 }; /* Group5200 */ enum { papSharedFunctionalGroupsSequence = 1, papPerFrameFunctionalGroupsSequence, papEndGroup5200 }; /* Group5400 */ enum { papWaveformSequenceGr = 1, papChannelMinimumValueGr, papChannelMaximumValueGr, papWaveformBitsAllocatedGr, papWaveformSampleInterpretationGr, papWaveformPaddingValueGr, papWaveformDataGr, papEndGroup5400 }; /* Group6000 */ enum { papOverlayRows6000Gr = 1, papOverlayColumns6000Gr, papOverlayPlanesGr, papNumberofFramesinOverlayGr, papOverlayDescriptionGr, papOverlayTypeGr, papOverlaySubtypeGr, papOriginGr, papImageFrameOriginGr, papOverlayPlaneOriginGr, papCompressionCode6000Gr, papOverlayBitsAllocatedGr, papBitPositionGr, papOverlayFormatGr, papOverlayLocationGr, papOverlayActivationLayerGr, papOverlayDescriptorGrayGr, papOverlayDescriptorRedGr, papOverlayDescriptorGreenGr, papOverlayDescriptorBlueGr, papOverlaysGrayGr, papOverlaysRedGr, papOverlaysGreenGr, papOverlaysBlueGr, papROIAreaGr, papROIMeanGr, papROIStandardDeviationGr, papOverlayLabelGr, papOverlayDataGr, papComments6000Gr, papEndGroup6000 }; /* UINOVERLAY Group 6XXX (odd) */ enum { /* papGroupLength */ /* papOwnerId */ papOverlayIdGr = 2, papLinkedOverlaysGr, papOverlayRowsGr, papOverlayColumnsGr, papUINOverlayTypeGr, papOverlayOriginGr, papEditableGr, papOverlayFontGr, papOverlayStyleGr, papOverlayFontSizeGr, papOverlayColorGr, papShadowSizeGr, papFillPatternGr, papOverlayPenSizeGr, papLabelGr, papPostItTextGr, papAnchorPointGr, papRoiTypeGr, papAttachedAnnotationGr, papContourPointsGr, papInfoIntGr, papInfoFloatGr, papMaskDataGr, papUINOverlaySequenceGr, papEndUINOverlay }; /* 7053 Group 7053 */ enum { /* papGroupLength */ papSUVFactor7053Gr = 1, papEndGroup7053 }; /* Group7FE0 */ enum { papPixelDataGr = 1, papEndGroup7FE0 }; #endif
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <SAObjects/SAUISnippet.h> @interface SAUISnippet (Translation) - (id)translatedSnippet; @end
{ "pile_set_name": "Github" }
package sp.phone.util; import android.content.Context; import android.content.SharedPreferences; import gov.anzong.androidnga.R; import sp.phone.common.ApplicationContextHolder; import gov.anzong.androidnga.common.PreferenceKey; /** * Created by Justwen on 2018/7/2. */ public class ForumUtils { public static String getAvailableDomain() { Context context = ApplicationContextHolder.getContext(); SharedPreferences sp = context.getSharedPreferences(PreferenceKey.PERFERENCE, Context.MODE_PRIVATE); int index = Integer.parseInt(sp.getString(PreferenceKey.KEY_NGA_DOMAIN, "1")); return context.getResources().getStringArray(R.array.nga_domain)[index]; } public static String getAvailableDomainNoHttp() { Context context = ApplicationContextHolder.getContext(); SharedPreferences sp = context.getSharedPreferences(PreferenceKey.PERFERENCE, Context.MODE_PRIVATE); int index = Integer.parseInt(sp.getString(PreferenceKey.KEY_NGA_DOMAIN, "1")); return context.getResources().getStringArray(R.array.nga_domain_no_http)[index]; } /** * @param statusCode * @return 返回子板块是否被订阅 */ public static boolean isBoardSubscribed(int statusCode) { // 3,810 返回false return statusCode == 7 || statusCode == 558 || statusCode == 542 || statusCode == 2606; } }
{ "pile_set_name": "Github" }
<?php /** * `SET` keyword parser. */ declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Components; use PhpMyAdmin\SqlParser\Component; use PhpMyAdmin\SqlParser\Parser; use PhpMyAdmin\SqlParser\Token; use PhpMyAdmin\SqlParser\TokensList; use function implode; use function is_array; use function trim; /** * `SET` keyword parser. */ class SetOperation extends Component { /** * The name of the column that is being updated. * * @var string */ public $column; /** * The new value. * * @var string */ public $value; /** * @param string $column Field's name.. * @param string $value new value */ public function __construct($column = '', $value = '') { $this->column = $column; $this->value = $value; } /** * @param Parser $parser the parser that serves as context * @param TokensList $list the list of tokens that are being parsed * @param array $options parameters for parsing * * @return SetOperation[] */ public static function parse(Parser $parser, TokensList $list, array $options = []) { $ret = []; $expr = new static(); /** * The state of the parser. * * Below are the states of the parser. * * 0 ---------------------[ col_name ]--------------------> 0 * 0 ------------------------[ = ]------------------------> 1 * 1 -----------------------[ value ]---------------------> 1 * 1 ------------------------[ , ]------------------------> 0 * * @var int */ $state = 0; /** * Token when the parser has seen the latest comma * * @var Token */ $commaLastSeenAt = null; for (; $list->idx < $list->count; ++$list->idx) { /** * Token parsed at this moment. * * @var Token */ $token = $list->tokens[$list->idx]; // End of statement. if ($token->type === Token::TYPE_DELIMITER) { break; } // Skipping whitespaces and comments. if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { continue; } // No keyword is expected. if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED) && ($state === 0) ) { break; } if ($state === 0) { if ($token->token === '=') { $state = 1; } elseif ($token->value !== ',') { $expr->column .= $token->token; } elseif ($token->value === ',') { $commaLastSeenAt = $token; } } elseif ($state === 1) { $tmp = Expression::parse( $parser, $list, ['breakOnAlias' => true] ); if ($tmp === null) { $parser->error('Missing expression.', $token); break; } $expr->column = trim($expr->column); $expr->value = $tmp->expr; $ret[] = $expr; $expr = new static(); $state = 0; $commaLastSeenAt = null; } } --$list->idx; // We saw a comma, but didn't see a column-value pair after it if ($commaLastSeenAt !== null) { $parser->error('Unexpected token.', $commaLastSeenAt); } return $ret; } /** * @param SetOperation|SetOperation[] $component the component to be built * @param array $options parameters for building * * @return string */ public static function build($component, array $options = []) { if (is_array($component)) { return implode(', ', $component); } return $component->column . ' = ' . $component->value; } }
{ "pile_set_name": "Github" }
# This file is distributed under the same license as the Django package. # # Translators: # Jannis Leidel <jannis@leidel.info>, 2011. # Tetsuya Morimoto <tetsuya.morimoto@gmail.com>, 2011. msgid "" msgstr "" "Project-Id-Version: Django\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-03-23 02:42+0100\n" "PO-Revision-Date: 2012-03-08 12:24+0000\n" "Last-Translator: Tetsuya Morimoto <tetsuya.morimoto@gmail.com>\n" "Language-Team: Japanese (http://www.transifex.net/projects/p/django/language/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0\n" #: ar/forms.py:30 msgid "Enter a postal code in the format NNNN or ANNNNAAA." msgstr "NNNNか、ANNNNAAAの形式で郵便番号を入力してください。" #: ar/forms.py:52 br/forms.py:95 br/forms.py:134 pe/forms.py:27 pe/forms.py:55 msgid "This field requires only numbers." msgstr "このフィールドは必須です(数値のみ)。" #: ar/forms.py:53 msgid "This field requires 7 or 8 digits." msgstr "7桁か8桁で入力して下さい。" #: ar/forms.py:82 msgid "Enter a valid CUIT in XX-XXXXXXXX-X or XXXXXXXXXXXX format." msgstr "" "XX-XXXXXXXX-X か XXXXXXXXXXXX の形式で納税証明単一番号(CUIT)を入力して下さ" "い。" #: ar/forms.py:83 msgid "Invalid CUIT." msgstr "無効な納税証明単一番号(CUIT): %s" #: at/at_states.py:5 msgid "Burgenland" msgstr "Burgenland" #: at/at_states.py:6 msgid "Carinthia" msgstr "Carinthia" #: at/at_states.py:7 msgid "Lower Austria" msgstr "Lower Austria" #: at/at_states.py:8 msgid "Upper Austria" msgstr "Upper Austria" #: at/at_states.py:9 msgid "Salzburg" msgstr "Salzburg" #: at/at_states.py:10 msgid "Styria" msgstr "Styria" #: at/at_states.py:11 msgid "Tyrol" msgstr "Tyrol" #: at/at_states.py:12 msgid "Vorarlberg" msgstr "Vorarlberg" #: at/at_states.py:13 msgid "Vienna" msgstr "Vienna" #: at/forms.py:22 ch/forms.py:22 no/forms.py:19 msgid "Enter a zip code in the format XXXX." msgstr "XXXXの形式でZipコードを入力してください。" #: at/forms.py:50 msgid "Enter a valid Austrian Social Security Number in XXXX XXXXXX format." msgstr "XXXX XXXXXX の形式でオーストリア社会保障番号を入力してください。" #: au/forms.py:26 msgid "Enter a 4 digit postcode." msgstr "" #: au/models.py:9 msgid "Australian State" msgstr "" #: au/models.py:19 msgid "Australian Postcode" msgstr "" #: au/models.py:33 msgid "Australian Phone number" msgstr "" #: be/be_provinces.py:5 msgid "Antwerp" msgstr "アントワープ" #: be/be_provinces.py:6 msgid "Brussels" msgstr "ブリュッセル" #: be/be_provinces.py:7 msgid "East Flanders" msgstr "東フランドル" #: be/be_provinces.py:8 msgid "Flemish Brabant" msgstr "フランダースブラバント" #: be/be_provinces.py:9 msgid "Hainaut" msgstr "エノー州" #: be/be_provinces.py:10 msgid "Liege" msgstr "リエージュ" #: be/be_provinces.py:11 nl/nl_provinces.py:9 msgid "Limburg" msgstr "Limburg" #: be/be_provinces.py:12 msgid "Luxembourg" msgstr "ルクセンブルグ" #: be/be_provinces.py:13 msgid "Namur" msgstr "ナミュール" #: be/be_provinces.py:14 msgid "Walloon Brabant" msgstr "ブラバンワロン州" #: be/be_provinces.py:15 msgid "West Flanders" msgstr "西フランドル" #: be/be_regions.py:5 msgid "Brussels Capital Region" msgstr "ブリュッセル首都圏" #: be/be_regions.py:6 msgid "Flemish Region" msgstr "フランダース地方" #: be/be_regions.py:7 msgid "Wallonia" msgstr "ワロン地域" #: be/forms.py:25 msgid "Enter a valid postal code in the range and format 1XXX - 9XXX." msgstr "郵便番号の範囲を 1XXX - 9XXX の形式で入力してください。" #: be/forms.py:48 msgid "" "Enter a valid phone number in one of the formats 0x xxx xx xx, 0xx xx xx xx, " "04xx xx xx xx, 0x/xxx.xx.xx, 0xx/xx.xx.xx, 04xx/xx.xx.xx, 0x.xxx.xx.xx, 0xx." "xx.xx.xx, 04xx.xx.xx.xx, 0xxxxxxxx or 04xxxxxxxx." msgstr "" "電話番号を次の形式のうちどれかを選択して入力してください: 0x xxx xx xx, 0xx " "xx xx xx, 04xx xx xx xx, 0x/xxx.xx.xx, 0xx/xx.xx.xx, 04xx/xx.xx.xx, 0x.xxx." "xx.xx, 0xx.xx.xx.xx, 04xx.xx.xx.xx, 0xxxxxxxx or 04xxxxxxxx." #: br/forms.py:22 msgid "Enter a zip code in the format XXXXX-XXX." msgstr "XXXXX-XXXの形式でZipコードを入力してください。" #: br/forms.py:31 msgid "Phone numbers must be in XX-XXXX-XXXX format." msgstr "電話番号は XX-XXXX-XXXX 形式で入力してください。" #: br/forms.py:58 msgid "" "Select a valid brazilian state. That state is not one of the available " "states." msgstr "ブラジルの州から選択してください。選択したものは候補にありません。" #: br/forms.py:93 msgid "Invalid CPF number." msgstr "ブラジル納税者番号(CPF)が無効です。" #: br/forms.py:94 msgid "This field requires at most 11 digits or 14 characters." msgstr "11桁の数字か14文字で入力してください。" #: br/forms.py:133 msgid "Invalid CNPJ number." msgstr "納税登録番号(CNPJ)が正しくありません。" #: br/forms.py:135 msgid "This field requires at least 14 digits" msgstr "14桁以上で入力して下さい。" #: ca/forms.py:29 msgid "Enter a postal code in the format XXX XXX." msgstr "XXX XXXの形式で郵便番号を入力してください。" #: ca/forms.py:110 msgid "Enter a valid Canadian Social Insurance number in XXX-XXX-XXX format." msgstr "XXX-XXX-XXX の形式で、カナダ社会保障番号を入力して下さい。" #: ch/ch_states.py:5 msgid "Aargau" msgstr "Aargau" #: ch/ch_states.py:6 msgid "Appenzell Innerrhoden" msgstr "Appenzell Innerrhoden" #: ch/ch_states.py:7 msgid "Appenzell Ausserrhoden" msgstr "Appenzell Ausserrhoden" #: ch/ch_states.py:8 msgid "Basel-Stadt" msgstr "Basel-Stadt" #: ch/ch_states.py:9 msgid "Basel-Land" msgstr "Basel-Land" #: ch/ch_states.py:10 msgid "Berne" msgstr "Berne" #: ch/ch_states.py:11 msgid "Fribourg" msgstr "Fribourg" #: ch/ch_states.py:12 msgid "Geneva" msgstr "Geneva" #: ch/ch_states.py:13 msgid "Glarus" msgstr "Glarus" #: ch/ch_states.py:14 msgid "Graubuenden" msgstr "Graubuenden" #: ch/ch_states.py:15 msgid "Jura" msgstr "Jura" #: ch/ch_states.py:16 msgid "Lucerne" msgstr "Lucerne" #: ch/ch_states.py:17 msgid "Neuchatel" msgstr "Neuchatel" #: ch/ch_states.py:18 msgid "Nidwalden" msgstr "Nidwalden" #: ch/ch_states.py:19 msgid "Obwalden" msgstr "Obwalden" #: ch/ch_states.py:20 msgid "Schaffhausen" msgstr "Schaffhausen" #: ch/ch_states.py:21 msgid "Schwyz" msgstr "Schwyz" #: ch/ch_states.py:22 msgid "Solothurn" msgstr "Solothurn" #: ch/ch_states.py:23 msgid "St. Gallen" msgstr "St. Gallen" #: ch/ch_states.py:24 msgid "Thurgau" msgstr "Thurgau" #: ch/ch_states.py:25 msgid "Ticino" msgstr "Ticino" #: ch/ch_states.py:26 msgid "Uri" msgstr "Uri" #: ch/ch_states.py:27 msgid "Valais" msgstr "Valais" #: ch/ch_states.py:28 msgid "Vaud" msgstr "Vaud" #: ch/ch_states.py:29 msgid "Zug" msgstr "Zug" #: ch/ch_states.py:30 msgid "Zurich" msgstr "Zurich" #: ch/forms.py:68 msgid "" "Enter a valid Swiss identity or passport card number in X1234567<0 or " "1234567890 format." msgstr "" "スイス アイデンティティかパスポート番号を X1234567<0 か 1234567890 の形式で入" "力して下さい。" #: cl/forms.py:32 msgid "Enter a valid Chilean RUT." msgstr "正しいチリ納税者番号(RUT)を入力してください。" #: cl/forms.py:33 msgid "Enter a valid Chilean RUT. The format is XX.XXX.XXX-X." msgstr "XX.XXX.XXX-Xの形式でチリ納税者番号(RUT)を入力してください。" #: cl/forms.py:34 msgid "The Chilean RUT is not valid." msgstr "このチリ納税者番号(RUT)は無効です。" #: cn/forms.py:84 msgid "Enter a post code in the format XXXXXX." msgstr "" #: cn/forms.py:105 msgid "ID Card Number consists of 15 or 18 digits." msgstr "" #: cn/forms.py:106 msgid "Invalid ID Card Number: Wrong checksum" msgstr "" #: cn/forms.py:107 msgid "Invalid ID Card Number: Wrong birthdate" msgstr "" #: cn/forms.py:108 msgid "Invalid ID Card Number: Wrong location code" msgstr "" #: cn/forms.py:193 msgid "Enter a valid phone number." msgstr "" #: cn/forms.py:210 msgid "Enter a valid cell number." msgstr "" #: cz/cz_regions.py:8 msgid "Prague" msgstr "プラハ" #: cz/cz_regions.py:9 msgid "Central Bohemian Region" msgstr "中央ボヘミア州" #: cz/cz_regions.py:10 msgid "South Bohemian Region" msgstr "南ボヘミア州" #: cz/cz_regions.py:11 msgid "Pilsen Region" msgstr "プルゼニ州" #: cz/cz_regions.py:12 msgid "Carlsbad Region" msgstr "カルロヴィ・ヴァリ州" #: cz/cz_regions.py:13 msgid "Usti Region" msgstr "ウースチー州" #: cz/cz_regions.py:14 msgid "Liberec Region" msgstr "リベレツ州" #: cz/cz_regions.py:15 msgid "Hradec Region" msgstr "フラデツ・クラーロヴェー州" #: cz/cz_regions.py:16 msgid "Pardubice Region" msgstr "パルドゥビツェ州" #: cz/cz_regions.py:17 msgid "Vysocina Region" msgstr "ヴィソチナ州" #: cz/cz_regions.py:18 msgid "South Moravian Region" msgstr "南モラヴィア州" #: cz/cz_regions.py:19 msgid "Olomouc Region" msgstr "オロモウツ州" #: cz/cz_regions.py:20 msgid "Zlin Region" msgstr "ズリーン州" #: cz/cz_regions.py:21 msgid "Moravian-Silesian Region" msgstr "モラヴィア・スレスコ州" #: cz/forms.py:32 sk/forms.py:33 msgid "Enter a postal code in the format XXXXX or XXX XX." msgstr "XXXXXか、XXX XXの形式で郵便番号を入力してください。" #: cz/forms.py:52 msgid "Enter a birth number in the format XXXXXX/XXXX or XXXXXXXXXX." msgstr "XXXXXX/XXXXか、XXXXXXXXXXの形式で誕生番号を入力してください。" #: cz/forms.py:53 msgid "Invalid optional parameter Gender, valid values are 'f' and 'm'" msgstr "" "オプションの性別パラメーターに対する不正な値です。可能な値は 'f' か 'm' で" "す。" #: cz/forms.py:54 msgid "Enter a valid birth number." msgstr "誕生番号を正しく入力してください。" #: cz/forms.py:115 msgid "Enter a valid IC number." msgstr "IC番号を正しく入力してください。" #: de/de_states.py:5 msgid "Baden-Wuerttemberg" msgstr "Baden-Wuerttemberg" #: de/de_states.py:6 msgid "Bavaria" msgstr "Bavaria" #: de/de_states.py:7 msgid "Berlin" msgstr "Berlin" #: de/de_states.py:8 msgid "Brandenburg" msgstr "Brandenburg" #: de/de_states.py:9 msgid "Bremen" msgstr "Bremen" #: de/de_states.py:10 msgid "Hamburg" msgstr "Hamburg" #: de/de_states.py:11 msgid "Hessen" msgstr "Hessen" #: de/de_states.py:12 msgid "Mecklenburg-Western Pomerania" msgstr "Mecklenburg-Western Pomerania" #: de/de_states.py:13 msgid "Lower Saxony" msgstr "Lower Saxony" #: de/de_states.py:14 msgid "North Rhine-Westphalia" msgstr "North Rhine-Westphalia" #: de/de_states.py:15 msgid "Rhineland-Palatinate" msgstr "Rhineland-Palatinate" #: de/de_states.py:16 msgid "Saarland" msgstr "Saarland" #: de/de_states.py:17 msgid "Saxony" msgstr "Saxony" #: de/de_states.py:18 msgid "Saxony-Anhalt" msgstr "Saxony-Anhalt" #: de/de_states.py:19 msgid "Schleswig-Holstein" msgstr "Schleswig-Holstein" #: de/de_states.py:20 msgid "Thuringia" msgstr "Thuringia" #: de/forms.py:20 fi/forms.py:18 fr/forms.py:20 msgid "Enter a zip code in the format XXXXX." msgstr "XXXXXの形式でZipコードを入力してください。" #: de/forms.py:46 msgid "" "Enter a valid German identity card number in XXXXXXXXXXX-XXXXXXX-XXXXXXX-X " "format." msgstr "" "XXXXXXXXXXX-XXXXXXX-XXXXXXX-X の形式でドイツIDカード番号を入力して下さい。" #: es/es_provinces.py:5 msgid "Arava" msgstr "Arava" #: es/es_provinces.py:6 msgid "Albacete" msgstr "Albacete" #: es/es_provinces.py:7 msgid "Alacant" msgstr "Alacant" #: es/es_provinces.py:8 msgid "Almeria" msgstr "Almeria" #: es/es_provinces.py:9 msgid "Avila" msgstr "Avila" #: es/es_provinces.py:10 msgid "Badajoz" msgstr "Badajoz" #: es/es_provinces.py:11 msgid "Illes Balears" msgstr "Illes Balears" #: es/es_provinces.py:12 msgid "Barcelona" msgstr "Barcelona" #: es/es_provinces.py:13 msgid "Burgos" msgstr "Burgos" #: es/es_provinces.py:14 msgid "Caceres" msgstr "Caceres" #: es/es_provinces.py:15 msgid "Cadiz" msgstr "Cadiz" #: es/es_provinces.py:16 msgid "Castello" msgstr "Castello" #: es/es_provinces.py:17 msgid "Ciudad Real" msgstr "Ciudad Real" #: es/es_provinces.py:18 msgid "Cordoba" msgstr "Cordoba" #: es/es_provinces.py:19 msgid "A Coruna" msgstr "A Coruna" #: es/es_provinces.py:20 msgid "Cuenca" msgstr "Cuenca" #: es/es_provinces.py:21 msgid "Girona" msgstr "Girona" #: es/es_provinces.py:22 msgid "Granada" msgstr "Granada" #: es/es_provinces.py:23 msgid "Guadalajara" msgstr "Guadalajara" #: es/es_provinces.py:24 msgid "Guipuzkoa" msgstr "Guipuzkoa" #: es/es_provinces.py:25 msgid "Huelva" msgstr "Huelva" #: es/es_provinces.py:26 msgid "Huesca" msgstr "Huesca" #: es/es_provinces.py:27 msgid "Jaen" msgstr "Jaen" #: es/es_provinces.py:28 msgid "Leon" msgstr "Leon" #: es/es_provinces.py:29 msgid "Lleida" msgstr "Lleida" #: es/es_provinces.py:30 es/es_regions.py:17 msgid "La Rioja" msgstr "La Rioja" #: es/es_provinces.py:31 msgid "Lugo" msgstr "Lugo" #: es/es_provinces.py:32 es/es_regions.py:18 msgid "Madrid" msgstr "Madrid" #: es/es_provinces.py:33 msgid "Malaga" msgstr "Malaga" #: es/es_provinces.py:34 msgid "Murcia" msgstr "Murcia" #: es/es_provinces.py:35 msgid "Navarre" msgstr "Navarre" #: es/es_provinces.py:36 msgid "Ourense" msgstr "Ourense" #: es/es_provinces.py:37 msgid "Asturias" msgstr "Asturias" #: es/es_provinces.py:38 msgid "Palencia" msgstr "Palencia" #: es/es_provinces.py:39 msgid "Las Palmas" msgstr "Las Palmas" #: es/es_provinces.py:40 msgid "Pontevedra" msgstr "Pontevedra" #: es/es_provinces.py:41 msgid "Salamanca" msgstr "Salamanca" #: es/es_provinces.py:42 msgid "Santa Cruz de Tenerife" msgstr "Santa Cruz de Tenerife" #: es/es_provinces.py:43 es/es_regions.py:11 msgid "Cantabria" msgstr "Cantabria" #: es/es_provinces.py:44 msgid "Segovia" msgstr "Segovia" #: es/es_provinces.py:45 msgid "Seville" msgstr "Seville" #: es/es_provinces.py:46 msgid "Soria" msgstr "Soria" #: es/es_provinces.py:47 msgid "Tarragona" msgstr "Tarragona" #: es/es_provinces.py:48 msgid "Teruel" msgstr "Teruel" #: es/es_provinces.py:49 msgid "Toledo" msgstr "Toledo" #: es/es_provinces.py:50 msgid "Valencia" msgstr "Valencia" #: es/es_provinces.py:51 msgid "Valladolid" msgstr "Valladolid" #: es/es_provinces.py:52 msgid "Bizkaia" msgstr "Bizkaia" #: es/es_provinces.py:53 msgid "Zamora" msgstr "Zamora" #: es/es_provinces.py:54 msgid "Zaragoza" msgstr "Zaragoza" #: es/es_provinces.py:55 msgid "Ceuta" msgstr "Ceuta" #: es/es_provinces.py:56 msgid "Melilla" msgstr "Melilla" #: es/es_regions.py:5 msgid "Andalusia" msgstr "Andalusia" #: es/es_regions.py:6 msgid "Aragon" msgstr "Aragon" #: es/es_regions.py:7 msgid "Principality of Asturias" msgstr "Principality of Asturias" #: es/es_regions.py:8 msgid "Balearic Islands" msgstr "Balearic Islands" #: es/es_regions.py:9 msgid "Basque Country" msgstr "Basque Country" #: es/es_regions.py:10 msgid "Canary Islands" msgstr "Canary Islands" #: es/es_regions.py:12 msgid "Castile-La Mancha" msgstr "Castile-La Mancha" #: es/es_regions.py:13 msgid "Castile and Leon" msgstr "Castile and Leon" #: es/es_regions.py:14 msgid "Catalonia" msgstr "Catalonia" #: es/es_regions.py:15 msgid "Extremadura" msgstr "Extremadura" #: es/es_regions.py:16 msgid "Galicia" msgstr "Galicia" #: es/es_regions.py:19 msgid "Region of Murcia" msgstr "Region of Murcia" #: es/es_regions.py:20 msgid "Foral Community of Navarre" msgstr "Foral Community of Navarre" #: es/es_regions.py:21 msgid "Valencian Community" msgstr "Valencian Community" #: es/forms.py:26 msgid "Enter a valid postal code in the range and format 01XXX - 52XXX." msgstr "01XXX から 52XXXの形式で郵便番号を入力してください。" #: es/forms.py:46 msgid "" "Enter a valid phone number in one of the formats 6XXXXXXXX, 8XXXXXXXX or " "9XXXXXXXX." msgstr "" "6XXXXXXXX か 8XXXXXXXX か 9XXXXXXXX かのいずれかの形式で電話番号を入力してく" "ださい。" #: es/forms.py:73 msgid "Please enter a valid NIF, NIE, or CIF." msgstr "" "スペイン納税者番号(NIF)かスペイン住民番号(N.I.E)かスペイン企業番号(CIF)のいず" "れかを入力してください。" #: es/forms.py:74 msgid "Please enter a valid NIF or NIE." msgstr "スペイン納税者番号(NIF)かスペイン住民番号(N.I.E)を入力してください。" #: es/forms.py:75 msgid "Invalid checksum for NIF." msgstr "スペイン納税者番号(NIF)のチェックサムがあいません。" #: es/forms.py:76 msgid "Invalid checksum for NIE." msgstr "スペイン住民番号(N.I.E)のチェックサムがあいません。" #: es/forms.py:77 msgid "Invalid checksum for CIF." msgstr "スペイン企業番号(CIF)のチェックサムがあいません。" #: es/forms.py:149 msgid "" "Please enter a valid bank account number in format XXXX-XXXX-XX-XXXXXXXXXX." msgstr "XXXX-XXXX-XX-XXXXXXXXXX の形式で銀行口座番号を入力して下さい。" #: es/forms.py:150 msgid "Invalid checksum for bank account number." msgstr "銀行口座番号のチェックサムがあいません。" #: fi/forms.py:33 msgid "Enter a valid Finnish social security number." msgstr "フィンランド社会保証番号を正しく入力してください。" #: fr/forms.py:35 msgid "Phone numbers must be in 0X XX XX XX XX format." msgstr "電話番号は 0X XX XX XX XX 形式で入力してください。" #: gb/forms.py:25 msgid "Enter a valid postcode." msgstr "郵便番号を正しく入力してください。" #: gb/gb_regions.py:11 msgid "Bedfordshire" msgstr "Bedfordshire" #: gb/gb_regions.py:12 msgid "Buckinghamshire" msgstr "Buckinghamshire" #: gb/gb_regions.py:14 msgid "Cheshire" msgstr "Cheshire" #: gb/gb_regions.py:15 msgid "Cornwall and Isles of Scilly" msgstr "Cornwall and Isles of Scilly" #: gb/gb_regions.py:16 msgid "Cumbria" msgstr "Cumbria" #: gb/gb_regions.py:17 msgid "Derbyshire" msgstr "Derbyshire" #: gb/gb_regions.py:18 msgid "Devon" msgstr "Devon" #: gb/gb_regions.py:19 msgid "Dorset" msgstr "Dorset" #: gb/gb_regions.py:20 msgid "Durham" msgstr "Durham" #: gb/gb_regions.py:21 msgid "East Sussex" msgstr "East Sussex" #: gb/gb_regions.py:22 msgid "Essex" msgstr "Essex" #: gb/gb_regions.py:23 msgid "Gloucestershire" msgstr "Gloucestershire" #: gb/gb_regions.py:24 msgid "Greater London" msgstr "Greater London" #: gb/gb_regions.py:25 msgid "Greater Manchester" msgstr "Greater Manchester" #: gb/gb_regions.py:26 msgid "Hampshire" msgstr "Hampshire" #: gb/gb_regions.py:27 msgid "Hertfordshire" msgstr "Hertfordshire" #: gb/gb_regions.py:28 msgid "Kent" msgstr "Kent" #: gb/gb_regions.py:29 msgid "Lancashire" msgstr "Lancashire" #: gb/gb_regions.py:30 msgid "Leicestershire" msgstr "Leicestershire" #: gb/gb_regions.py:31 msgid "Lincolnshire" msgstr "Lincolnshire" #: gb/gb_regions.py:32 msgid "Merseyside" msgstr "Merseyside" #: gb/gb_regions.py:33 msgid "Norfolk" msgstr "Norfolk" #: gb/gb_regions.py:34 msgid "North Yorkshire" msgstr "North Yorkshire" #: gb/gb_regions.py:35 msgid "Northamptonshire" msgstr "Northamptonshire" #: gb/gb_regions.py:36 msgid "Northumberland" msgstr "Northumberland" #: gb/gb_regions.py:37 msgid "Nottinghamshire" msgstr "Nottinghamshire" #: gb/gb_regions.py:38 msgid "Oxfordshire" msgstr "Oxfordshire" #: gb/gb_regions.py:39 msgid "Shropshire" msgstr "Shropshire" #: gb/gb_regions.py:40 msgid "Somerset" msgstr "Somerset" #: gb/gb_regions.py:41 msgid "South Yorkshire" msgstr "South Yorkshire" #: gb/gb_regions.py:42 msgid "Staffordshire" msgstr "Staffordshire" #: gb/gb_regions.py:43 msgid "Suffolk" msgstr "Suffolk" #: gb/gb_regions.py:44 msgid "Surrey" msgstr "Surrey" #: gb/gb_regions.py:45 msgid "Tyne and Wear" msgstr "Tyne and Wear" #: gb/gb_regions.py:46 msgid "Warwickshire" msgstr "Warwickshire" #: gb/gb_regions.py:47 msgid "West Midlands" msgstr "West Midlands" #: gb/gb_regions.py:48 msgid "West Sussex" msgstr "West Sussex" #: gb/gb_regions.py:49 msgid "West Yorkshire" msgstr "West Yorkshire" #: gb/gb_regions.py:50 msgid "Wiltshire" msgstr "Wiltshire" #: gb/gb_regions.py:51 msgid "Worcestershire" msgstr "Worcestershire" #: gb/gb_regions.py:55 msgid "County Antrim" msgstr "County Antrim" #: gb/gb_regions.py:56 msgid "County Armagh" msgstr "County Armagh" #: gb/gb_regions.py:57 msgid "County Down" msgstr "County Down" #: gb/gb_regions.py:58 msgid "County Fermanagh" msgstr "County Fermanagh" #: gb/gb_regions.py:59 msgid "County Londonderry" msgstr "County Londonderry" #: gb/gb_regions.py:60 msgid "County Tyrone" msgstr "County Tyrone" #: gb/gb_regions.py:64 msgid "Clwyd" msgstr "Clwyd" #: gb/gb_regions.py:65 msgid "Dyfed" msgstr "Dyfed" #: gb/gb_regions.py:66 msgid "Gwent" msgstr "Gwent" #: gb/gb_regions.py:67 msgid "Gwynedd" msgstr "Gwynedd" #: gb/gb_regions.py:68 msgid "Mid Glamorgan" msgstr "Mid Glamorgan" #: gb/gb_regions.py:69 msgid "Powys" msgstr "Powys" #: gb/gb_regions.py:70 msgid "South Glamorgan" msgstr "South Glamorgan" #: gb/gb_regions.py:71 msgid "West Glamorgan" msgstr "West Glamorgan" #: gb/gb_regions.py:75 msgid "Borders" msgstr "Borders" #: gb/gb_regions.py:76 msgid "Central Scotland" msgstr "Central Scotland" #: gb/gb_regions.py:77 msgid "Dumfries and Galloway" msgstr "Dumfries and Galloway" #: gb/gb_regions.py:78 msgid "Fife" msgstr "Fife" #: gb/gb_regions.py:79 msgid "Grampian" msgstr "Grampian" #: gb/gb_regions.py:80 msgid "Highland" msgstr "Highland" #: gb/gb_regions.py:81 msgid "Lothian" msgstr "Lothian" #: gb/gb_regions.py:82 msgid "Orkney Islands" msgstr "Orkney Islands" #: gb/gb_regions.py:83 msgid "Shetland Islands" msgstr "Shetland Islands" #: gb/gb_regions.py:84 msgid "Strathclyde" msgstr "Strathclyde" #: gb/gb_regions.py:85 msgid "Tayside" msgstr "Tayside" #: gb/gb_regions.py:86 msgid "Western Isles" msgstr "Western Isles" #: gb/gb_regions.py:90 msgid "England" msgstr "England" #: gb/gb_regions.py:91 msgid "Northern Ireland" msgstr "Northern Ireland" #: gb/gb_regions.py:92 msgid "Scotland" msgstr "Scotland" #: gb/gb_regions.py:93 msgid "Wales" msgstr "Wales" #: hr/forms.py:75 msgid "Enter a valid 13 digit JMBG" msgstr "" #: hr/forms.py:76 msgid "Error in date segment" msgstr "" #: hr/forms.py:123 msgid "Enter a valid 11 digit OIB" msgstr "" #: hr/forms.py:152 id/forms.py:112 msgid "Enter a valid vehicle license plate number" msgstr "自動車のプレートナンバーを正しく入力してください。" #: hr/forms.py:153 msgid "Enter a valid location code" msgstr "" #: hr/forms.py:154 msgid "Number part cannot be zero" msgstr "" #: hr/forms.py:190 msgid "Enter a valid 5 digit postal code" msgstr "" #: hr/forms.py:218 id/forms.py:72 nl/forms.py:56 msgid "Enter a valid phone number" msgstr "電話番号を正しく入力してください。" #: hr/forms.py:219 msgid "Enter a valid area or mobile network code" msgstr "" #: hr/forms.py:220 msgid "The phone nubmer is too long" msgstr "" #: hr/forms.py:258 msgid "Enter a valid 19 digit JMBAG starting with 601983" msgstr "" #: hr/forms.py:259 msgid "Card issue number cannot be zero" msgstr "" #: hr/hr_choices.py:12 msgid "Grad Zagreb" msgstr "" #: hr/hr_choices.py:13 msgid "Bjelovarsko-bilogorska županija" msgstr "" #: hr/hr_choices.py:14 msgid "Brodsko-posavska županija" msgstr "" #: hr/hr_choices.py:15 msgid "Dubrovačko-neretvanska županija" msgstr "" #: hr/hr_choices.py:16 msgid "Istarska županija" msgstr "" #: hr/hr_choices.py:17 msgid "Karlovačka županija" msgstr "" #: hr/hr_choices.py:18 msgid "Koprivničko-križevačka županija" msgstr "" #: hr/hr_choices.py:19 msgid "Krapinsko-zagorska županija" msgstr "" #: hr/hr_choices.py:20 msgid "Ličko-senjska županija" msgstr "" #: hr/hr_choices.py:21 msgid "Međimurska županija" msgstr "" #: hr/hr_choices.py:22 msgid "Osječko-baranjska županija" msgstr "" #: hr/hr_choices.py:23 msgid "Požeško-slavonska županija" msgstr "" #: hr/hr_choices.py:24 msgid "Primorsko-goranska županija" msgstr "" #: hr/hr_choices.py:25 msgid "Sisačko-moslavačka županija" msgstr "" #: hr/hr_choices.py:26 msgid "Splitsko-dalmatinska županija" msgstr "" #: hr/hr_choices.py:27 msgid "Šibensko-kninska županija" msgstr "" #: hr/hr_choices.py:28 msgid "Varaždinska županija" msgstr "" #: hr/hr_choices.py:29 msgid "Virovitičko-podravska županija" msgstr "" #: hr/hr_choices.py:30 msgid "Vukovarsko-srijemska županija" msgstr "" #: hr/hr_choices.py:31 msgid "Zadarska županija" msgstr "" #: hr/hr_choices.py:32 msgid "Zagrebačka županija" msgstr "" #: id/forms.py:31 msgid "Enter a valid post code" msgstr "郵便番号を正しく入力してください。" #: id/forms.py:176 msgid "Enter a valid NIK/KTP number" msgstr "NIK/KTP番号を正しく入力してください。" #: id/id_choices.py:15 msgid "Aceh" msgstr "アチェ" #: id/id_choices.py:16 id/id_choices.py:79 msgid "Bali" msgstr "バリ" #: id/id_choices.py:17 id/id_choices.py:51 msgid "Banten" msgstr "バンテン" #: id/id_choices.py:18 id/id_choices.py:60 msgid "Bengkulu" msgstr "ベンクルー州" #: id/id_choices.py:19 id/id_choices.py:53 msgid "Yogyakarta" msgstr "ジョクジャカルタ" #: id/id_choices.py:20 id/id_choices.py:57 msgid "Jakarta" msgstr "ジャカルタ" #: id/id_choices.py:21 id/id_choices.py:81 msgid "Gorontalo" msgstr "ゴロンタロ" #: id/id_choices.py:22 id/id_choices.py:63 msgid "Jambi" msgstr "ジャンビ" #: id/id_choices.py:23 msgid "Jawa Barat" msgstr "ジャワバラット州" #: id/id_choices.py:24 msgid "Jawa Tengah" msgstr "ジャワトゥンガ州" #: id/id_choices.py:25 msgid "Jawa Timur" msgstr "ジャワティムール州" #: id/id_choices.py:26 id/id_choices.py:94 msgid "Kalimantan Barat" msgstr "カリマンタンバラット州" #: id/id_choices.py:27 id/id_choices.py:72 msgid "Kalimantan Selatan" msgstr "カリマンタンスラタン州" #: id/id_choices.py:28 id/id_choices.py:95 msgid "Kalimantan Tengah" msgstr "カリマンタントゥンガ州" #: id/id_choices.py:29 id/id_choices.py:96 msgid "Kalimantan Timur" msgstr "カリマンタンティムール州" #: id/id_choices.py:30 msgid "Kepulauan Bangka-Belitung" msgstr "バンカ-ビリトン諸島" #: id/id_choices.py:31 id/id_choices.py:68 msgid "Kepulauan Riau" msgstr "リアオ諸島" #: id/id_choices.py:32 id/id_choices.py:61 msgid "Lampung" msgstr "ランプン州" #: id/id_choices.py:33 id/id_choices.py:76 msgid "Maluku" msgstr "マルク州" #: id/id_choices.py:34 id/id_choices.py:77 msgid "Maluku Utara" msgstr "マルクウタラ" #: id/id_choices.py:35 msgid "Nusa Tenggara Barat" msgstr "ヌサトゥンガラバラット" #: id/id_choices.py:36 msgid "Nusa Tenggara Timur" msgstr "ヌサトゥンガラティムール州" #: id/id_choices.py:37 msgid "Papua" msgstr "パプア" #: id/id_choices.py:38 msgid "Papua Barat" msgstr "パプアバラット" #: id/id_choices.py:39 id/id_choices.py:66 msgid "Riau" msgstr "リアウ州" #: id/id_choices.py:40 id/id_choices.py:74 msgid "Sulawesi Barat" msgstr "スラウェシバラット" #: id/id_choices.py:41 id/id_choices.py:75 msgid "Sulawesi Selatan" msgstr "スラウェシスラタン州" #: id/id_choices.py:42 id/id_choices.py:82 msgid "Sulawesi Tengah" msgstr "スラウェシトゥンガ州" #: id/id_choices.py:43 id/id_choices.py:85 msgid "Sulawesi Tenggara" msgstr "スラウェシトゥンガラ州" #: id/id_choices.py:44 msgid "Sulawesi Utara" msgstr "スラウェシウタラ州" #: id/id_choices.py:45 id/id_choices.py:58 msgid "Sumatera Barat" msgstr "スマトラバラット州" #: id/id_choices.py:46 id/id_choices.py:62 msgid "Sumatera Selatan" msgstr "スマトラスラタン州" #: id/id_choices.py:47 id/id_choices.py:64 msgid "Sumatera Utara" msgstr "スマトラウタラ州" #: id/id_choices.py:52 msgid "Magelang" msgstr "マグラン" #: id/id_choices.py:54 msgid "Surakarta - Solo" msgstr "スラカルタ - ソロ" #: id/id_choices.py:55 msgid "Madiun" msgstr "マディウン" #: id/id_choices.py:56 msgid "Kediri" msgstr "クディリ" #: id/id_choices.py:59 msgid "Tapanuli" msgstr "タパヌリ" #: id/id_choices.py:65 msgid "Nanggroe Aceh Darussalam" msgstr "ナングロアチェダルサラーム" #: id/id_choices.py:67 msgid "Kepulauan Bangka Belitung" msgstr "バンカビリトン諸島" #: id/id_choices.py:69 msgid "Corps Consulate" msgstr "領事館部隊" #: id/id_choices.py:70 msgid "Corps Diplomatic" msgstr "外交部隊" #: id/id_choices.py:71 msgid "Bandung" msgstr "バンドン" #: id/id_choices.py:73 msgid "Sulawesi Utara Daratan" msgstr "スラウェシウタラダラタン" #: id/id_choices.py:78 msgid "NTT - Timor" msgstr "株式会社 NTT - 東ティモール" #: id/id_choices.py:80 msgid "Sulawesi Utara Kepulauan" msgstr "スラウェシウタラ諸島" #: id/id_choices.py:83 msgid "NTB - Lombok" msgstr "NTB - ロンボク" #: id/id_choices.py:84 msgid "Papua dan Papua Barat" msgstr "パプアダンパプアバラット" #: id/id_choices.py:86 msgid "Cirebon" msgstr "チルボン" #: id/id_choices.py:87 msgid "NTB - Sumbawa" msgstr "NTB - スンバワ" #: id/id_choices.py:88 msgid "NTT - Flores" msgstr "株式会社 NTT - フローリーズ" #: id/id_choices.py:89 msgid "NTT - Sumba" msgstr "株式会社NTT - スンバ" #: id/id_choices.py:90 msgid "Bogor" msgstr "ボゴール" #: id/id_choices.py:91 msgid "Pekalongan" msgstr "プカロンガン" #: id/id_choices.py:92 msgid "Semarang" msgstr "スマラン" #: id/id_choices.py:93 msgid "Pati" msgstr "パティ" #: id/id_choices.py:97 msgid "Surabaya" msgstr "スラバヤ" #: id/id_choices.py:98 msgid "Madura" msgstr "マドゥラ" #: id/id_choices.py:99 msgid "Malang" msgstr "マラン" #: id/id_choices.py:100 msgid "Jember" msgstr "ジェンバー" #: id/id_choices.py:101 msgid "Banyumas" msgstr "バニュマス" #: id/id_choices.py:102 msgid "Federal Government" msgstr "連邦政府" #: id/id_choices.py:103 msgid "Bojonegoro" msgstr "ボジョネゴロ" #: id/id_choices.py:104 msgid "Purwakarta" msgstr "プルワカルタ" #: id/id_choices.py:105 msgid "Sidoarjo" msgstr "シドアルジョ" #: id/id_choices.py:106 msgid "Garut" msgstr "ガルト" #: ie/ie_counties.py:8 msgid "Antrim" msgstr "アントリム" #: ie/ie_counties.py:9 msgid "Armagh" msgstr "アルマー" #: ie/ie_counties.py:10 msgid "Carlow" msgstr "カーロー" #: ie/ie_counties.py:11 msgid "Cavan" msgstr "カバン" #: ie/ie_counties.py:12 msgid "Clare" msgstr "クレア" #: ie/ie_counties.py:13 msgid "Cork" msgstr "コーク" #: ie/ie_counties.py:14 msgid "Derry" msgstr "デリー" #: ie/ie_counties.py:15 msgid "Donegal" msgstr "ドニゴール" #: ie/ie_counties.py:16 msgid "Down" msgstr "ダウン" #: ie/ie_counties.py:17 msgid "Dublin" msgstr "ダブリン" #: ie/ie_counties.py:18 msgid "Fermanagh" msgstr "ファーマナ州" #: ie/ie_counties.py:19 msgid "Galway" msgstr "ゴールウェイ" #: ie/ie_counties.py:20 msgid "Kerry" msgstr "ケリー" #: ie/ie_counties.py:21 msgid "Kildare" msgstr "キルデア" #: ie/ie_counties.py:22 msgid "Kilkenny" msgstr "キルケニー" #: ie/ie_counties.py:23 msgid "Laois" msgstr "リーシュ" #: ie/ie_counties.py:24 msgid "Leitrim" msgstr "リートリム" #: ie/ie_counties.py:25 msgid "Limerick" msgstr "リマリック" #: ie/ie_counties.py:26 msgid "Longford" msgstr "ロングフォード" #: ie/ie_counties.py:27 msgid "Louth" msgstr "ラウス" #: ie/ie_counties.py:28 msgid "Mayo" msgstr "メイヨー" #: ie/ie_counties.py:29 msgid "Meath" msgstr "ミーズ" #: ie/ie_counties.py:30 msgid "Monaghan" msgstr "モナハン" #: ie/ie_counties.py:31 msgid "Offaly" msgstr "オファリー" #: ie/ie_counties.py:32 msgid "Roscommon" msgstr "ロスコモン" #: ie/ie_counties.py:33 msgid "Sligo" msgstr "スライゴ" #: ie/ie_counties.py:34 msgid "Tipperary" msgstr "ティペラリー" #: ie/ie_counties.py:35 msgid "Tyrone" msgstr "タイローン" #: ie/ie_counties.py:36 msgid "Waterford" msgstr "ウォーターフォード" #: ie/ie_counties.py:37 msgid "Westmeath" msgstr "ウェストミーズ" #: ie/ie_counties.py:38 msgid "Wexford" msgstr "ウェクスフォード" #: ie/ie_counties.py:39 msgid "Wicklow" msgstr "ウィックロー" #: il/forms.py:31 msgid "Enter a postal code in the format XXXXX" msgstr "郵便番号を XXXXX 形式で入力してください" #: il/forms.py:50 msgid "Enter a valid ID number." msgstr "ID 番号を入力してください。" #: in_/forms.py:41 msgid "Enter a zip code in the format XXXXXX or XXX XXX." msgstr "" #: in_/forms.py:64 msgid "Enter an Indian state or territory." msgstr "" #: in_/forms.py:103 msgid "Phone numbers must be in 02X-8X or 03X-7X or 04X-6X format." msgstr "" #: is_/forms.py:22 msgid "" "Enter a valid Icelandic identification number. The format is XXXXXX-XXXX." msgstr "XXXXXか、XXXXX-XXXXの形式でアイスランド納税者番号を入力してください。" #: is_/forms.py:23 msgid "The Icelandic identification number is not valid." msgstr "アイスランド納税者番号を正しく入力して下さい。" #: it/forms.py:21 msgid "Enter a valid zip code." msgstr "Zipコードを正しく入力してください。" #: it/forms.py:48 msgid "Enter a valid Social Security number." msgstr "社会保障番号番号を正しく入力してください。" #: it/forms.py:73 msgid "Enter a valid VAT number." msgstr "VAT番号を正しく入力してください。" #: jp/forms.py:19 msgid "Enter a postal code in the format XXXXXXX or XXX-XXXX." msgstr "XXXXXか、XXXXX-XXXXの形式で郵便番号を入力してください。" #: jp/jp_prefectures.py:4 msgid "Hokkaido" msgstr "北海道" #: jp/jp_prefectures.py:5 msgid "Aomori" msgstr "青森県" #: jp/jp_prefectures.py:6 msgid "Iwate" msgstr "岩手県" #: jp/jp_prefectures.py:7 msgid "Miyagi" msgstr "宮城県" #: jp/jp_prefectures.py:8 msgid "Akita" msgstr "秋田県" #: jp/jp_prefectures.py:9 msgid "Yamagata" msgstr "山形県" #: jp/jp_prefectures.py:10 msgid "Fukushima" msgstr "福島県" #: jp/jp_prefectures.py:11 msgid "Ibaraki" msgstr "茨城県" #: jp/jp_prefectures.py:12 msgid "Tochigi" msgstr "栃木県" #: jp/jp_prefectures.py:13 msgid "Gunma" msgstr "群馬県" #: jp/jp_prefectures.py:14 msgid "Saitama" msgstr "埼玉県" #: jp/jp_prefectures.py:15 msgid "Chiba" msgstr "千葉県" #: jp/jp_prefectures.py:16 msgid "Tokyo" msgstr "東京都" #: jp/jp_prefectures.py:17 msgid "Kanagawa" msgstr "神奈川県" #: jp/jp_prefectures.py:18 msgid "Yamanashi" msgstr "山梨県" #: jp/jp_prefectures.py:19 msgid "Nagano" msgstr "長野県" #: jp/jp_prefectures.py:20 msgid "Niigata" msgstr "新潟県" #: jp/jp_prefectures.py:21 msgid "Toyama" msgstr "富山県" #: jp/jp_prefectures.py:22 msgid "Ishikawa" msgstr "石川県" #: jp/jp_prefectures.py:23 msgid "Fukui" msgstr "福井県" #: jp/jp_prefectures.py:24 msgid "Gifu" msgstr "岐阜県" #: jp/jp_prefectures.py:25 msgid "Shizuoka" msgstr "静岡県" #: jp/jp_prefectures.py:26 msgid "Aichi" msgstr "愛知県" #: jp/jp_prefectures.py:27 msgid "Mie" msgstr "三重県" #: jp/jp_prefectures.py:28 msgid "Shiga" msgstr "滋賀県" #: jp/jp_prefectures.py:29 msgid "Kyoto" msgstr "京都府" #: jp/jp_prefectures.py:30 msgid "Osaka" msgstr "大阪府" #: jp/jp_prefectures.py:31 msgid "Hyogo" msgstr "兵庫県" #: jp/jp_prefectures.py:32 msgid "Nara" msgstr "奈良県" #: jp/jp_prefectures.py:33 msgid "Wakayama" msgstr "和歌山県" #: jp/jp_prefectures.py:34 msgid "Tottori" msgstr "鳥取県" #: jp/jp_prefectures.py:35 msgid "Shimane" msgstr "島根県" #: jp/jp_prefectures.py:36 msgid "Okayama" msgstr "岡山県" #: jp/jp_prefectures.py:37 msgid "Hiroshima" msgstr "広島県" #: jp/jp_prefectures.py:38 msgid "Yamaguchi" msgstr "山口県" #: jp/jp_prefectures.py:39 msgid "Tokushima" msgstr "徳島県" #: jp/jp_prefectures.py:40 msgid "Kagawa" msgstr "香川県" #: jp/jp_prefectures.py:41 msgid "Ehime" msgstr "愛媛県" #: jp/jp_prefectures.py:42 msgid "Kochi" msgstr "高知県" #: jp/jp_prefectures.py:43 msgid "Fukuoka" msgstr "福岡県" #: jp/jp_prefectures.py:44 msgid "Saga" msgstr "佐賀県" #: jp/jp_prefectures.py:45 msgid "Nagasaki" msgstr "長崎県" #: jp/jp_prefectures.py:46 msgid "Kumamoto" msgstr "熊本県" #: jp/jp_prefectures.py:47 msgid "Oita" msgstr "大分県" #: jp/jp_prefectures.py:48 msgid "Miyazaki" msgstr "宮崎県" #: jp/jp_prefectures.py:49 msgid "Kagoshima" msgstr "鹿児島県" #: jp/jp_prefectures.py:50 msgid "Okinawa" msgstr "沖縄県" #: kw/forms.py:25 msgid "Enter a valid Kuwaiti Civil ID number" msgstr "クウェート市民番号を正しく入力してください。" #: mk/forms.py:18 msgid "" "Identity card numbers must contain either 4 to 7 digits or an uppercase " "letter and 7 digits." msgstr "" #: mk/forms.py:57 si/forms.py:24 msgid "This field should contain exactly 13 digits." msgstr "" #: mk/forms.py:58 msgid "The first 7 digits of the UMCN must represent a valid past date." msgstr "" #: mk/forms.py:59 msgid "The UMCN is not valid." msgstr "" #: mk/mk_choices.py:8 msgid "Aerodrom" msgstr "" #: mk/mk_choices.py:9 msgid "Aračinovo" msgstr "" #: mk/mk_choices.py:10 msgid "Berovo" msgstr "" #: mk/mk_choices.py:11 msgid "Bitola" msgstr "" #: mk/mk_choices.py:12 msgid "Bogdanci" msgstr "" #: mk/mk_choices.py:13 msgid "Bogovinje" msgstr "" #: mk/mk_choices.py:14 msgid "Bosilovo" msgstr "" #: mk/mk_choices.py:15 msgid "Brvenica" msgstr "" #: mk/mk_choices.py:16 msgid "Butel" msgstr "" #: mk/mk_choices.py:17 msgid "Valandovo" msgstr "" #: mk/mk_choices.py:18 msgid "Vasilevo" msgstr "" #: mk/mk_choices.py:19 msgid "Vevčani" msgstr "" #: mk/mk_choices.py:20 msgid "Veles" msgstr "" #: mk/mk_choices.py:21 msgid "Vinica" msgstr "" #: mk/mk_choices.py:22 msgid "Vraneštica" msgstr "" #: mk/mk_choices.py:23 msgid "Vrapčište" msgstr "" #: mk/mk_choices.py:24 msgid "Gazi Baba" msgstr "" #: mk/mk_choices.py:25 msgid "Gevgelija" msgstr "" #: mk/mk_choices.py:26 msgid "Gostivar" msgstr "" #: mk/mk_choices.py:27 msgid "Gradsko" msgstr "" #: mk/mk_choices.py:28 msgid "Debar" msgstr "" #: mk/mk_choices.py:29 msgid "Debarca" msgstr "" #: mk/mk_choices.py:30 msgid "Delčevo" msgstr "" #: mk/mk_choices.py:31 msgid "Demir Kapija" msgstr "" #: mk/mk_choices.py:32 msgid "Demir Hisar" msgstr "" #: mk/mk_choices.py:33 msgid "Dolneni" msgstr "" #: mk/mk_choices.py:34 msgid "Drugovo" msgstr "" #: mk/mk_choices.py:35 msgid "Gjorče Petrov" msgstr "" #: mk/mk_choices.py:36 msgid "Želino" msgstr "" #: mk/mk_choices.py:37 msgid "Zajas" msgstr "" #: mk/mk_choices.py:38 msgid "Zelenikovo" msgstr "" #: mk/mk_choices.py:39 msgid "Zrnovci" msgstr "" #: mk/mk_choices.py:40 msgid "Ilinden" msgstr "" #: mk/mk_choices.py:41 msgid "Jegunovce" msgstr "" #: mk/mk_choices.py:42 msgid "Kavadarci" msgstr "" #: mk/mk_choices.py:43 msgid "Karbinci" msgstr "" #: mk/mk_choices.py:44 msgid "Karpoš" msgstr "" #: mk/mk_choices.py:45 msgid "Kisela Voda" msgstr "" #: mk/mk_choices.py:46 msgid "Kičevo" msgstr "" #: mk/mk_choices.py:47 msgid "Konče" msgstr "" #: mk/mk_choices.py:48 msgid "Koćani" msgstr "" #: mk/mk_choices.py:49 msgid "Kratovo" msgstr "" #: mk/mk_choices.py:50 msgid "Kriva Palanka" msgstr "" #: mk/mk_choices.py:51 msgid "Krivogaštani" msgstr "" #: mk/mk_choices.py:52 msgid "Kruševo" msgstr "" #: mk/mk_choices.py:53 msgid "Kumanovo" msgstr "" #: mk/mk_choices.py:54 msgid "Lipkovo" msgstr "" #: mk/mk_choices.py:55 msgid "Lozovo" msgstr "" #: mk/mk_choices.py:56 msgid "Mavrovo i Rostuša" msgstr "" #: mk/mk_choices.py:57 msgid "Makedonska Kamenica" msgstr "" #: mk/mk_choices.py:58 msgid "Makedonski Brod" msgstr "" #: mk/mk_choices.py:59 msgid "Mogila" msgstr "" #: mk/mk_choices.py:60 msgid "Negotino" msgstr "" #: mk/mk_choices.py:61 msgid "Novaci" msgstr "" #: mk/mk_choices.py:62 msgid "Novo Selo" msgstr "" #: mk/mk_choices.py:63 msgid "Oslomej" msgstr "" #: mk/mk_choices.py:64 msgid "Ohrid" msgstr "" #: mk/mk_choices.py:65 msgid "Petrovec" msgstr "" #: mk/mk_choices.py:66 msgid "Pehčevo" msgstr "" #: mk/mk_choices.py:67 msgid "Plasnica" msgstr "" #: mk/mk_choices.py:68 msgid "Prilep" msgstr "" #: mk/mk_choices.py:69 msgid "Probištip" msgstr "" #: mk/mk_choices.py:70 msgid "Radoviš" msgstr "" #: mk/mk_choices.py:71 msgid "Rankovce" msgstr "" #: mk/mk_choices.py:72 msgid "Resen" msgstr "" #: mk/mk_choices.py:73 msgid "Rosoman" msgstr "" #: mk/mk_choices.py:74 msgid "Saraj" msgstr "" #: mk/mk_choices.py:75 msgid "Sveti Nikole" msgstr "" #: mk/mk_choices.py:76 msgid "Sopište" msgstr "" #: mk/mk_choices.py:77 msgid "Star Dojran" msgstr "" #: mk/mk_choices.py:78 msgid "Staro Nagoričane" msgstr "" #: mk/mk_choices.py:79 msgid "Struga" msgstr "" #: mk/mk_choices.py:80 msgid "Strumica" msgstr "" #: mk/mk_choices.py:81 msgid "Studeničani" msgstr "" #: mk/mk_choices.py:82 msgid "Tearce" msgstr "" #: mk/mk_choices.py:83 msgid "Tetovo" msgstr "" #: mk/mk_choices.py:84 msgid "Centar" msgstr "" #: mk/mk_choices.py:85 msgid "Centar-Župa" msgstr "" #: mk/mk_choices.py:86 msgid "Čair" msgstr "" #: mk/mk_choices.py:87 msgid "Čaška" msgstr "" #: mk/mk_choices.py:88 msgid "Češinovo-Obleševo" msgstr "" #: mk/mk_choices.py:89 msgid "Čučer-Sandevo" msgstr "" #: mk/mk_choices.py:90 msgid "Štip" msgstr "" #: mk/mk_choices.py:91 msgid "Šuto Orizari" msgstr "" #: mk/models.py:11 msgid "Macedonian identity card number" msgstr "" #: mk/models.py:25 msgid "A Macedonian municipality (2 character code)" msgstr "" #: mk/models.py:35 msgid "Unique master citizen number (13 digits)" msgstr "" #: mx/forms.py:65 msgid "Enter a valid zip code in the format XXXXX." msgstr "" #: mx/forms.py:108 msgid "Enter a valid RFC." msgstr "" #: mx/forms.py:109 msgid "Invalid checksum for RFC." msgstr "" #: mx/forms.py:189 msgid "Enter a valid CURP." msgstr "" #: mx/forms.py:190 msgid "Invalid checksum for CURP." msgstr "" #: mx/models.py:14 msgid "Mexico state (three uppercase letters)" msgstr "" #: mx/models.py:27 msgid "Mexico zip code" msgstr "" #: mx/models.py:44 msgid "Mexican RFC" msgstr "" #: mx/models.py:61 msgid "Mexican CURP" msgstr "" #: mx/mx_states.py:13 msgid "Aguascalientes" msgstr "Aguascalientes" #: mx/mx_states.py:14 msgid "Baja California" msgstr "Baja California" #: mx/mx_states.py:15 msgid "Baja California Sur" msgstr "Baja California Sur" #: mx/mx_states.py:16 msgid "Campeche" msgstr "Campeche" #: mx/mx_states.py:17 msgid "Chihuahua" msgstr "Chihuahua" #: mx/mx_states.py:18 msgid "Chiapas" msgstr "Chiapas" #: mx/mx_states.py:19 msgid "Coahuila" msgstr "Coahuila" #: mx/mx_states.py:20 msgid "Colima" msgstr "Colima" #: mx/mx_states.py:21 msgid "Distrito Federal" msgstr "Distrito Federal" #: mx/mx_states.py:22 msgid "Durango" msgstr "Durango" #: mx/mx_states.py:23 msgid "Guerrero" msgstr "Guerrero" #: mx/mx_states.py:24 msgid "Guanajuato" msgstr "Guanajuato" #: mx/mx_states.py:25 msgid "Hidalgo" msgstr "Hidalgo" #: mx/mx_states.py:26 msgid "Jalisco" msgstr "Jalisco" #: mx/mx_states.py:27 msgid "Estado de México" msgstr "Estado de México" #: mx/mx_states.py:28 msgid "Michoacán" msgstr "Michoacan" #: mx/mx_states.py:29 msgid "Morelos" msgstr "Morelos" #: mx/mx_states.py:30 msgid "Nayarit" msgstr "Nayarit" #: mx/mx_states.py:31 msgid "Nuevo León" msgstr "Nuevo Leon" #: mx/mx_states.py:32 msgid "Oaxaca" msgstr "Oaxaca" #: mx/mx_states.py:33 msgid "Puebla" msgstr "Puebla" #: mx/mx_states.py:34 msgid "Querétaro" msgstr "Queretaro" #: mx/mx_states.py:35 msgid "Quintana Roo" msgstr "Quintana Roo" #: mx/mx_states.py:36 msgid "Sinaloa" msgstr "Sinaloa" #: mx/mx_states.py:37 msgid "San Luis Potosí" msgstr "San Luis Potosi" #: mx/mx_states.py:38 msgid "Sonora" msgstr "Sonora" #: mx/mx_states.py:39 msgid "Tabasco" msgstr "Tabasco" #: mx/mx_states.py:40 msgid "Tamaulipas" msgstr "Tamaulipas" #: mx/mx_states.py:41 msgid "Tlaxcala" msgstr "Tlaxcala" #: mx/mx_states.py:42 msgid "Veracruz" msgstr "Veracruz" #: mx/mx_states.py:43 msgid "Yucatán" msgstr "Yucatan" #: mx/mx_states.py:44 msgid "Zacatecas" msgstr "Zacatecas" #: nl/forms.py:26 msgid "Enter a valid postal code" msgstr "郵便番号を正しく入力してください。" #: nl/forms.py:82 msgid "Enter a valid SoFi number" msgstr "社会税務番号(SoFi)を正しく入力してください。" #: nl/nl_provinces.py:4 msgid "Drenthe" msgstr "Drenthe" #: nl/nl_provinces.py:5 msgid "Flevoland" msgstr "Flevoland" #: nl/nl_provinces.py:6 msgid "Friesland" msgstr "Friesland" #: nl/nl_provinces.py:7 msgid "Gelderland" msgstr "Gelderland" #: nl/nl_provinces.py:8 msgid "Groningen" msgstr "Groningen" #: nl/nl_provinces.py:10 msgid "Noord-Brabant" msgstr "Noord-Brabant" #: nl/nl_provinces.py:11 msgid "Noord-Holland" msgstr "Noord-Holland" #: nl/nl_provinces.py:12 msgid "Overijssel" msgstr "Overijssel" #: nl/nl_provinces.py:13 msgid "Utrecht" msgstr "Utrecht" #: nl/nl_provinces.py:14 msgid "Zeeland" msgstr "Zeeland" #: nl/nl_provinces.py:15 msgid "Zuid-Holland" msgstr "Zuid-Holland" #: no/forms.py:39 msgid "Enter a valid Norwegian social security number." msgstr "ノルウェー社会保障番号を正しく入力してください。" #: pe/forms.py:28 msgid "This field requires 8 digits." msgstr "8桁で入力して下さい。" #: pe/forms.py:56 msgid "This field requires 11 digits." msgstr "11桁で入力して下さい。" #: pl/forms.py:42 msgid "National Identification Number consists of 11 digits." msgstr "国民識別番号は11文字で入力して下さい。" #: pl/forms.py:43 msgid "Wrong checksum for the National Identification Number." msgstr "国民識別番号のチェックサムがあいません。" #: pl/forms.py:79 msgid "National ID Card Number consists of 3 letters and 6 digits." msgstr "" #: pl/forms.py:80 msgid "Wrong checksum for the National ID Card Number." msgstr "" #: pl/forms.py:131 msgid "" "Enter a tax number field (NIP) in the format XXX-XXX-XX-XX, XXX-XX-XX-XXX or " "XXXXXXXXXX." msgstr "" #: pl/forms.py:132 msgid "Wrong checksum for the Tax Number (NIP)." msgstr "税務署登録ID(NIP)のチェックサムがあいません。" #: pl/forms.py:171 msgid "National Business Register Number (REGON) consists of 9 or 14 digits." msgstr "ポーランド企業番号(REGON)は9文字か14文字で入力して下さい。" #: pl/forms.py:172 msgid "Wrong checksum for the National Business Register Number (REGON)." msgstr "ポーランド企業番号(REGON)のチェックサムがあいません。" #: pl/forms.py:212 msgid "Enter a postal code in the format XX-XXX." msgstr "XX-XXXの形式で郵便番号を入力してください。" #: pl/pl_voivodeships.py:8 msgid "Lower Silesia" msgstr "Lower Silesia" #: pl/pl_voivodeships.py:9 msgid "Kuyavia-Pomerania" msgstr "Kuyavia-Pomerania" #: pl/pl_voivodeships.py:10 msgid "Lublin" msgstr "Lublin" #: pl/pl_voivodeships.py:11 msgid "Lubusz" msgstr "Lubusz" #: pl/pl_voivodeships.py:12 msgid "Lodz" msgstr "Lodz" #: pl/pl_voivodeships.py:13 msgid "Lesser Poland" msgstr "Lesser Poland" #: pl/pl_voivodeships.py:14 msgid "Masovia" msgstr "Masovia" #: pl/pl_voivodeships.py:15 msgid "Opole" msgstr "Opole" #: pl/pl_voivodeships.py:16 msgid "Subcarpatia" msgstr "Subcarpatia" #: pl/pl_voivodeships.py:17 msgid "Podlasie" msgstr "Podlasie" #: pl/pl_voivodeships.py:18 msgid "Pomerania" msgstr "Pomerania" #: pl/pl_voivodeships.py:19 msgid "Silesia" msgstr "Silesia" #: pl/pl_voivodeships.py:20 msgid "Swietokrzyskie" msgstr "Swietokrzyskie" #: pl/pl_voivodeships.py:21 msgid "Warmia-Masuria" msgstr "Warmia-Masuria" #: pl/pl_voivodeships.py:22 msgid "Greater Poland" msgstr "Greater Poland" #: pl/pl_voivodeships.py:23 msgid "West Pomerania" msgstr "West Pomerania" #: pt/forms.py:17 msgid "Enter a zip code in the format XXXX-XXX." msgstr "XXXX-XXXの形式でZipコードを入力してください。" #: pt/forms.py:37 msgid "Phone numbers must have 9 digits, or start by + or 00." msgstr "電話番号は9桁の数字か、プラス記号(+)または00で始まる必要があります。" #: ro/forms.py:20 msgid "Enter a valid CIF." msgstr "CIFを正しく入力してください。" #: ro/forms.py:57 msgid "Enter a valid CNP." msgstr "CNPを正しく入力してください。" #: ro/forms.py:142 msgid "Enter a valid IBAN in ROXX-XXXX-XXXX-XXXX-XXXX-XXXX format" msgstr "ROXX-XXXX-XXXX-XXXX-XXXX-XXXX の形式でIBANを入力してください" #: ro/forms.py:174 msgid "Phone numbers must be in XXXX-XXXXXX format." msgstr "電話番号は XXXX-XXXXXX 形式で入力してください。" #: ro/forms.py:199 msgid "Enter a valid postal code in the format XXXXXX" msgstr "XXXXXX の形式で郵便番号を入力してください。" #: ru/forms.py:37 msgid "Enter a postal code in the format XXXXXX." msgstr "" #: ru/forms.py:50 msgid "Enter a passport number in the format XXXX XXXXXX." msgstr "" #: ru/forms.py:63 msgid "Enter a passport number in the format XX XXXXXXX." msgstr "" #: ru/ru_regions.py:10 msgid "Central Federal County" msgstr "" #: ru/ru_regions.py:11 msgid "South Federal County" msgstr "" #: ru/ru_regions.py:12 msgid "North-West Federal County" msgstr "" #: ru/ru_regions.py:13 msgid "Far-East Federal County" msgstr "" #: ru/ru_regions.py:14 msgid "Siberian Federal County" msgstr "" #: ru/ru_regions.py:15 msgid "Ural Federal County" msgstr "" #: ru/ru_regions.py:16 msgid "Privolzhsky Federal County" msgstr "" #: ru/ru_regions.py:17 msgid "North-Caucasian Federal County" msgstr "" #: ru/ru_regions.py:21 msgid "Moskva" msgstr "" #: ru/ru_regions.py:22 msgid "Saint-Peterburg" msgstr "" #: ru/ru_regions.py:23 msgid "Moskovskaya oblast'" msgstr "" #: ru/ru_regions.py:24 msgid "Adygeya, Respublika" msgstr "" #: ru/ru_regions.py:25 msgid "Bashkortostan, Respublika" msgstr "" #: ru/ru_regions.py:26 msgid "Buryatia, Respublika" msgstr "" #: ru/ru_regions.py:27 msgid "Altay, Respublika" msgstr "" #: ru/ru_regions.py:28 msgid "Dagestan, Respublika" msgstr "" #: ru/ru_regions.py:29 msgid "Ingushskaya Respublika" msgstr "" #: ru/ru_regions.py:30 msgid "Kabardino-Balkarskaya Respublika" msgstr "" #: ru/ru_regions.py:31 msgid "Kalmykia, Respublika" msgstr "" #: ru/ru_regions.py:32 msgid "Karachaevo-Cherkesskaya Respublika" msgstr "" #: ru/ru_regions.py:33 msgid "Karelia, Respublika" msgstr "" #: ru/ru_regions.py:34 msgid "Komi, Respublika" msgstr "" #: ru/ru_regions.py:35 msgid "Mariy Ehl, Respublika" msgstr "" #: ru/ru_regions.py:36 msgid "Mordovia, Respublika" msgstr "" #: ru/ru_regions.py:37 msgid "Sakha, Respublika (Yakutiya)" msgstr "" #: ru/ru_regions.py:38 msgid "Severnaya Osetia, Respublika (Alania)" msgstr "" #: ru/ru_regions.py:39 msgid "Tatarstan, Respublika" msgstr "" #: ru/ru_regions.py:40 msgid "Tyva, Respublika (Tuva)" msgstr "" #: ru/ru_regions.py:41 msgid "Udmurtskaya Respublika" msgstr "" #: ru/ru_regions.py:42 msgid "Khakassiya, Respublika" msgstr "" #: ru/ru_regions.py:43 msgid "Chechenskaya Respublika" msgstr "" #: ru/ru_regions.py:44 msgid "Chuvashskaya Respublika" msgstr "" #: ru/ru_regions.py:45 msgid "Altayskiy Kray" msgstr "" #: ru/ru_regions.py:46 msgid "Zabaykalskiy Kray" msgstr "" #: ru/ru_regions.py:47 msgid "Kamchatskiy Kray" msgstr "" #: ru/ru_regions.py:48 msgid "Krasnodarskiy Kray" msgstr "" #: ru/ru_regions.py:49 msgid "Krasnoyarskiy Kray" msgstr "" #: ru/ru_regions.py:50 msgid "Permskiy Kray" msgstr "" #: ru/ru_regions.py:51 msgid "Primorskiy Kray" msgstr "" #: ru/ru_regions.py:52 msgid "Stavropol'siyy Kray" msgstr "" #: ru/ru_regions.py:53 msgid "Khabarovskiy Kray" msgstr "" #: ru/ru_regions.py:54 msgid "Amurskaya oblast'" msgstr "" #: ru/ru_regions.py:55 msgid "Arkhangel'skaya oblast'" msgstr "" #: ru/ru_regions.py:56 msgid "Astrakhanskaya oblast'" msgstr "" #: ru/ru_regions.py:57 msgid "Belgorodskaya oblast'" msgstr "" #: ru/ru_regions.py:58 msgid "Bryanskaya oblast'" msgstr "" #: ru/ru_regions.py:59 msgid "Vladimirskaya oblast'" msgstr "" #: ru/ru_regions.py:60 msgid "Volgogradskaya oblast'" msgstr "" #: ru/ru_regions.py:61 msgid "Vologodskaya oblast'" msgstr "" #: ru/ru_regions.py:62 msgid "Voronezhskaya oblast'" msgstr "" #: ru/ru_regions.py:63 msgid "Ivanovskaya oblast'" msgstr "" #: ru/ru_regions.py:64 msgid "Irkutskaya oblast'" msgstr "" #: ru/ru_regions.py:65 msgid "Kaliningradskaya oblast'" msgstr "" #: ru/ru_regions.py:66 msgid "Kaluzhskaya oblast'" msgstr "" #: ru/ru_regions.py:67 msgid "Kemerovskaya oblast'" msgstr "" #: ru/ru_regions.py:68 msgid "Kirovskaya oblast'" msgstr "" #: ru/ru_regions.py:69 msgid "Kostromskaya oblast'" msgstr "" #: ru/ru_regions.py:70 msgid "Kurganskaya oblast'" msgstr "" #: ru/ru_regions.py:71 msgid "Kurskaya oblast'" msgstr "" #: ru/ru_regions.py:72 msgid "Leningradskaya oblast'" msgstr "" #: ru/ru_regions.py:73 msgid "Lipeckaya oblast'" msgstr "" #: ru/ru_regions.py:74 msgid "Magadanskaya oblast'" msgstr "" #: ru/ru_regions.py:75 msgid "Murmanskaya oblast'" msgstr "" #: ru/ru_regions.py:76 msgid "Nizhegorodskaja oblast'" msgstr "" #: ru/ru_regions.py:77 msgid "Novgorodskaya oblast'" msgstr "" #: ru/ru_regions.py:78 msgid "Novosibirskaya oblast'" msgstr "" #: ru/ru_regions.py:79 msgid "Omskaya oblast'" msgstr "" #: ru/ru_regions.py:80 msgid "Orenburgskaya oblast'" msgstr "" #: ru/ru_regions.py:81 msgid "Orlovskaya oblast'" msgstr "" #: ru/ru_regions.py:82 msgid "Penzenskaya oblast'" msgstr "" #: ru/ru_regions.py:83 msgid "Pskovskaya oblast'" msgstr "" #: ru/ru_regions.py:84 msgid "Rostovskaya oblast'" msgstr "" #: ru/ru_regions.py:85 msgid "Rjazanskaya oblast'" msgstr "" #: ru/ru_regions.py:86 msgid "Samarskaya oblast'" msgstr "" #: ru/ru_regions.py:87 msgid "Saratovskaya oblast'" msgstr "" #: ru/ru_regions.py:88 msgid "Sakhalinskaya oblast'" msgstr "" #: ru/ru_regions.py:89 msgid "Sverdlovskaya oblast'" msgstr "" #: ru/ru_regions.py:90 msgid "Smolenskaya oblast'" msgstr "" #: ru/ru_regions.py:91 msgid "Tambovskaya oblast'" msgstr "" #: ru/ru_regions.py:92 msgid "Tverskaya oblast'" msgstr "" #: ru/ru_regions.py:93 msgid "Tomskaya oblast'" msgstr "" #: ru/ru_regions.py:94 msgid "Tul'skaya oblast'" msgstr "" #: ru/ru_regions.py:95 msgid "Tyumenskaya oblast'" msgstr "" #: ru/ru_regions.py:96 msgid "Ul'ianovskaya oblast'" msgstr "" #: ru/ru_regions.py:97 msgid "Chelyabinskaya oblast'" msgstr "" #: ru/ru_regions.py:98 msgid "Yaroslavskaya oblast'" msgstr "" #: ru/ru_regions.py:99 msgid "Evreyskaya avtonomnaja oblast'" msgstr "" #: ru/ru_regions.py:100 msgid "Neneckiy autonomnyy okrug" msgstr "" #: ru/ru_regions.py:101 msgid "Khanty-Mansiyskiy avtonomnyy okrug - Yugra" msgstr "" #: ru/ru_regions.py:102 msgid "Chukotskiy avtonomnyy okrug" msgstr "" #: ru/ru_regions.py:103 msgid "Yamalo-Neneckiy avtonomnyy okrug" msgstr "" #: se/forms.py:54 msgid "Enter a valid Swedish organisation number." msgstr "スウェーデン組織番号を正しく入力してください。" #: se/forms.py:111 msgid "Enter a valid Swedish personal identity number." msgstr "スウェーデン個人識別番号を正しく入力してください。" #: se/forms.py:112 msgid "Co-ordination numbers are not allowed." msgstr "コーディネーション番号は許可されていません。" #: se/forms.py:154 msgid "Enter a Swedish postal code in the format XXXXX." msgstr "XXXXXの形式で郵便番号を入力してください。" #: se/se_counties.py:15 msgid "Stockholm" msgstr "ストックホルム" #: se/se_counties.py:16 msgid "Västerbotten" msgstr "ベステルボッテン" #: se/se_counties.py:17 msgid "Norrbotten" msgstr "ノルボッテン" #: se/se_counties.py:18 msgid "Uppsala" msgstr "ウプサラ" #: se/se_counties.py:19 msgid "Södermanland" msgstr "セーデルマンランド" #: se/se_counties.py:20 msgid "Östergötland" msgstr "エステルイェトランド" #: se/se_counties.py:21 msgid "Jönköping" msgstr "ヨンショーピン" #: se/se_counties.py:22 msgid "Kronoberg" msgstr "クルーヌベリ" #: se/se_counties.py:23 msgid "Kalmar" msgstr "カルマル" #: se/se_counties.py:24 msgid "Gotland" msgstr "ゴトランド" #: se/se_counties.py:25 msgid "Blekinge" msgstr "ブレーキンゲ" #: se/se_counties.py:26 msgid "Skåne" msgstr "スコーネ" #: se/se_counties.py:27 msgid "Halland" msgstr "ハランド" #: se/se_counties.py:28 msgid "Västra Götaland" msgstr "ヴィストライェータランド" #: se/se_counties.py:29 msgid "Värmland" msgstr "ヴェルムランド" #: se/se_counties.py:30 msgid "Örebro" msgstr "オレブロ" #: se/se_counties.py:31 msgid "Västmanland" msgstr "ベストマンランド" #: se/se_counties.py:32 msgid "Dalarna" msgstr "ダーラルナ" #: se/se_counties.py:33 msgid "Gävleborg" msgstr "イェブレボリ" #: se/se_counties.py:34 msgid "Västernorrland" msgstr "ベステルノルランド" #: se/se_counties.py:35 msgid "Jämtland" msgstr "イェムトランド" #: si/forms.py:25 msgid "The first 7 digits of the EMSO must represent a valid past date." msgstr "" #: si/forms.py:26 msgid "The EMSO is not valid." msgstr "" #: si/forms.py:86 msgid "Enter a valid tax number in form SIXXXXXXXX" msgstr "" #: si/forms.py:151 msgid "Enter phone number in form +386XXXXXXXX or 0XXXXXXXX." msgstr "" #: sk/sk_districts.py:8 msgid "Banska Bystrica" msgstr "Banska Bystrica" #: sk/sk_districts.py:9 msgid "Banska Stiavnica" msgstr "Banska Stiavnica" #: sk/sk_districts.py:10 msgid "Bardejov" msgstr "Bardejov" #: sk/sk_districts.py:11 msgid "Banovce nad Bebravou" msgstr "Banovce nad Bebravou" #: sk/sk_districts.py:12 msgid "Brezno" msgstr "Brezno" #: sk/sk_districts.py:13 msgid "Bratislava I" msgstr "Bratislava I" #: sk/sk_districts.py:14 msgid "Bratislava II" msgstr "Bratislava II" #: sk/sk_districts.py:15 msgid "Bratislava III" msgstr "Bratislava III" #: sk/sk_districts.py:16 msgid "Bratislava IV" msgstr "Bratislava IV" #: sk/sk_districts.py:17 msgid "Bratislava V" msgstr "Bratislava V" #: sk/sk_districts.py:18 msgid "Bytca" msgstr "Bytca" #: sk/sk_districts.py:19 msgid "Cadca" msgstr "Cadca" #: sk/sk_districts.py:20 msgid "Detva" msgstr "Detva" #: sk/sk_districts.py:21 msgid "Dolny Kubin" msgstr "Dolny Kubin" #: sk/sk_districts.py:22 msgid "Dunajska Streda" msgstr "Dunajska Streda" #: sk/sk_districts.py:23 msgid "Galanta" msgstr "Galanta" #: sk/sk_districts.py:24 msgid "Gelnica" msgstr "Gelnica" #: sk/sk_districts.py:25 msgid "Hlohovec" msgstr "Hlohovec" #: sk/sk_districts.py:26 msgid "Humenne" msgstr "Humenne" #: sk/sk_districts.py:27 msgid "Ilava" msgstr "Ilava" #: sk/sk_districts.py:28 msgid "Kezmarok" msgstr "Kezmarok" #: sk/sk_districts.py:29 msgid "Komarno" msgstr "Komarno" #: sk/sk_districts.py:30 msgid "Kosice I" msgstr "Kosice I" #: sk/sk_districts.py:31 msgid "Kosice II" msgstr "Kosice II" #: sk/sk_districts.py:32 msgid "Kosice III" msgstr "Kosice III" #: sk/sk_districts.py:33 msgid "Kosice IV" msgstr "Kosice IV" #: sk/sk_districts.py:34 msgid "Kosice - okolie" msgstr "Kosice - okolie" #: sk/sk_districts.py:35 msgid "Krupina" msgstr "Krupina" #: sk/sk_districts.py:36 msgid "Kysucke Nove Mesto" msgstr "Kysucke Nove Mesto" #: sk/sk_districts.py:37 msgid "Levice" msgstr "Levice" #: sk/sk_districts.py:38 msgid "Levoca" msgstr "Levoca" #: sk/sk_districts.py:39 msgid "Liptovsky Mikulas" msgstr "Liptovsky Mikulas" #: sk/sk_districts.py:40 msgid "Lucenec" msgstr "Lucenec" #: sk/sk_districts.py:41 msgid "Malacky" msgstr "Malacky" #: sk/sk_districts.py:42 msgid "Martin" msgstr "Martin" #: sk/sk_districts.py:43 msgid "Medzilaborce" msgstr "Medzilaborce" #: sk/sk_districts.py:44 msgid "Michalovce" msgstr "Michalovce" #: sk/sk_districts.py:45 msgid "Myjava" msgstr "Myjava" #: sk/sk_districts.py:46 msgid "Namestovo" msgstr "Namestovo" #: sk/sk_districts.py:47 msgid "Nitra" msgstr "Nitra" #: sk/sk_districts.py:48 msgid "Nove Mesto nad Vahom" msgstr "Nove Mesto nad Vahom" #: sk/sk_districts.py:49 msgid "Nove Zamky" msgstr "Nove Zamky" #: sk/sk_districts.py:50 msgid "Partizanske" msgstr "Partizanske" #: sk/sk_districts.py:51 msgid "Pezinok" msgstr "Pezinok" #: sk/sk_districts.py:52 msgid "Piestany" msgstr "Piestany" #: sk/sk_districts.py:53 msgid "Poltar" msgstr "Poltar" #: sk/sk_districts.py:54 msgid "Poprad" msgstr "Poprad" #: sk/sk_districts.py:55 msgid "Povazska Bystrica" msgstr "Povazska Bystrica" #: sk/sk_districts.py:56 msgid "Presov" msgstr "Presov" #: sk/sk_districts.py:57 msgid "Prievidza" msgstr "Prievidza" #: sk/sk_districts.py:58 msgid "Puchov" msgstr "Puchov" #: sk/sk_districts.py:59 msgid "Revuca" msgstr "Revuca" #: sk/sk_districts.py:60 msgid "Rimavska Sobota" msgstr "Rimavska Sobota" #: sk/sk_districts.py:61 msgid "Roznava" msgstr "Roznava" #: sk/sk_districts.py:62 msgid "Ruzomberok" msgstr "Ruzomberok" #: sk/sk_districts.py:63 msgid "Sabinov" msgstr "Sabinov" #: sk/sk_districts.py:64 msgid "Senec" msgstr "Senec" #: sk/sk_districts.py:65 msgid "Senica" msgstr "Senica" #: sk/sk_districts.py:66 msgid "Skalica" msgstr "Skalica" #: sk/sk_districts.py:67 msgid "Snina" msgstr "Snina" #: sk/sk_districts.py:68 msgid "Sobrance" msgstr "Sobrance" #: sk/sk_districts.py:69 msgid "Spisska Nova Ves" msgstr "Spisska Nova Ves" #: sk/sk_districts.py:70 msgid "Stara Lubovna" msgstr "Stara Lubovna" #: sk/sk_districts.py:71 msgid "Stropkov" msgstr "Stropkov" #: sk/sk_districts.py:72 msgid "Svidnik" msgstr "Svidnik" #: sk/sk_districts.py:73 msgid "Sala" msgstr "Sala" #: sk/sk_districts.py:74 msgid "Topolcany" msgstr "Topolcany" #: sk/sk_districts.py:75 msgid "Trebisov" msgstr "Trebisov" #: sk/sk_districts.py:76 msgid "Trencin" msgstr "Trencin" #: sk/sk_districts.py:77 msgid "Trnava" msgstr "Trnava" #: sk/sk_districts.py:78 msgid "Turcianske Teplice" msgstr "Turcianske Teplice" #: sk/sk_districts.py:79 msgid "Tvrdosin" msgstr "Tvrdosin" #: sk/sk_districts.py:80 msgid "Velky Krtis" msgstr "Velky Krtis" #: sk/sk_districts.py:81 msgid "Vranov nad Toplou" msgstr "Vranov nad Toplou" #: sk/sk_districts.py:82 msgid "Zlate Moravce" msgstr "Zlate Moravce" #: sk/sk_districts.py:83 msgid "Zvolen" msgstr "Zvolen" #: sk/sk_districts.py:84 msgid "Zarnovica" msgstr "Zarnovica" #: sk/sk_districts.py:85 msgid "Ziar nad Hronom" msgstr "Ziar nad Hronom" #: sk/sk_districts.py:86 msgid "Zilina" msgstr "Zilina" #: sk/sk_regions.py:8 msgid "Banska Bystrica region" msgstr "Banska Bystrica region" #: sk/sk_regions.py:9 msgid "Bratislava region" msgstr "Bratislava region" #: sk/sk_regions.py:10 msgid "Kosice region" msgstr "Kosice region" #: sk/sk_regions.py:11 msgid "Nitra region" msgstr "Nitra region" #: sk/sk_regions.py:12 msgid "Presov region" msgstr "Presov region" #: sk/sk_regions.py:13 msgid "Trencin region" msgstr "Trencin region" #: sk/sk_regions.py:14 msgid "Trnava region" msgstr "Trnava region" #: sk/sk_regions.py:15 msgid "Zilina region" msgstr "Zilina region" #: tr/forms.py:21 msgid "Enter a postal code in the format XXXXX." msgstr "郵便番号を XXXXX 形式で入力してください。" #: tr/forms.py:42 msgid "Phone numbers must be in 0XXX XXX XXXX format." msgstr "電話番号は 0XXX XXX XXXX 形式でなければいけません。" #: tr/forms.py:69 msgid "Enter a valid Turkish Identification number." msgstr "トルコ国民番号を入力してください。" #: tr/forms.py:70 msgid "Turkish Identification number must be 11 digits." msgstr "トルコ国民番号は11桁でなければいけません。" #: us/forms.py:21 msgid "Enter a zip code in the format XXXXX or XXXXX-XXXX." msgstr "XXXXXか、XXXXX-XXXXの形式で郵便番号を入力してください。" #: us/forms.py:30 msgid "Phone numbers must be in XXX-XXX-XXXX format." msgstr "電話番号は XXX-XXX-XXXX 形式で入力してください。" #: us/forms.py:59 msgid "Enter a valid U.S. Social Security number in XXX-XX-XXXX format." msgstr "XXX-XX-XXXX の形式で、米国社会保障番号を入力して下さい。" #: us/forms.py:92 msgid "Enter a U.S. state or territory." msgstr "合衆国の州か地域を入力してください。" #: us/models.py:8 msgid "U.S. state (two uppercase letters)" msgstr "アメリカの州 (大文字二文字で)" #: us/models.py:17 msgid "U.S. postal code (two uppercase letters)" msgstr "米国郵便番号(大文字で2文字)" #: us/models.py:26 msgid "Phone number" msgstr "電話番号" #: uy/forms.py:29 msgid "Enter a valid CI number in X.XXX.XXX-X,XXXXXXX-X or XXXXXXXX format." msgstr "X.XXX.XXX-X,XXXXXXX-X か XXXXXXXX の形式でCI番号を入力して下さい。" #: uy/forms.py:31 msgid "Enter a valid CI number." msgstr "CI番号を正しく入力してください。" #: za/forms.py:21 msgid "Enter a valid South African ID number" msgstr "南アフリカID番号を正しく入力してください。" #: za/forms.py:55 msgid "Enter a valid South African postal code" msgstr "南アフリカ郵便番号を正しく入力してください。" #: za/za_provinces.py:4 msgid "Eastern Cape" msgstr "Eastern Cape" #: za/za_provinces.py:5 msgid "Free State" msgstr "Free State" #: za/za_provinces.py:6 msgid "Gauteng" msgstr "Gauteng" #: za/za_provinces.py:7 msgid "KwaZulu-Natal" msgstr "KwaZulu-Natal" #: za/za_provinces.py:8 msgid "Limpopo" msgstr "Limpopo" #: za/za_provinces.py:9 msgid "Mpumalanga" msgstr "Mpumalanga" #: za/za_provinces.py:10 msgid "Northern Cape" msgstr "Northern Cape" #: za/za_provinces.py:11 msgid "North West" msgstr "North West" #: za/za_provinces.py:12 msgid "Western Cape" msgstr "Western Cape"
{ "pile_set_name": "Github" }
# Copyright 2013 the V8 project authors. All rights reserved. # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple 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: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. 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. # # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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. Test for bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build). On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS /^[s{-.[]()]$/ threw exception SyntaxError: Invalid regular expression: /^[s{-.[]()]$/: Range out of order in character class. PASS successfullyParsed is true TEST COMPLETE
{ "pile_set_name": "Github" }
/* slist.c -- generalised singly linked lists Copyright (C) 2000, 2004, 2007-2009, 2011-2015 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <assert.h> #include "slist.h" #include <stdlib.h> static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata); /* Call DELETE repeatedly on each element of HEAD. CAVEAT: If you call this when HEAD is the start of a list of boxed items, you must remember that each item passed back to your DELETE function will be a boxed item that must be slist_unbox()ed before operating on its contents. e.g. void boxed_delete (void *item) { item_free (slist_unbox (item)); } ... slist = slist_delete (slist, boxed_delete); ... */ SList * slist_delete (SList *head, void (*delete_fct) (void *item)) { assert (delete_fct); while (head) { SList *next = head->next; (*delete_fct) (head); head = next; } return 0; } /* Call FIND repeatedly with MATCHDATA and each item of *PHEAD, until FIND returns non-NULL, or the list is exhausted. If a match is found the matching item is destructively removed from *PHEAD, and the value returned by the matching call to FIND is returned. CAVEAT: To avoid memory leaks, unless you already have the address of the stale item, you should probably return that from FIND if it makes a successful match. Don't forget to slist_unbox() every item in a boxed list before operating on its contents. */ SList * slist_remove (SList **phead, SListCallback *find, void *matchdata) { SList *stale = 0; void *result = 0; assert (find); if (!phead || !*phead) return 0; /* Does the head of the passed list match? */ result = (*find) (*phead, matchdata); if (result) { stale = *phead; *phead = stale->next; } /* what about the rest of the elements? */ else { SList *head; for (head = *phead; head->next; head = head->next) { result = (*find) (head->next, matchdata); if (result) { stale = head->next; head->next = stale->next; break; } } } return (SList *) result; } /* Call FIND repeatedly with each element of SLIST and MATCHDATA, until FIND returns non-NULL, or the list is exhausted. If a match is found the value returned by the matching call to FIND is returned. */ void * slist_find (SList *slist, SListCallback *find, void *matchdata) { void *result = 0; assert (find); for (; slist; slist = slist->next) { result = (*find) (slist, matchdata); if (result) break; } return result; } /* Return a single list, composed by destructively concatenating the items in HEAD and TAIL. The values of HEAD and TAIL are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_concat (slist1, slist2); */ SList * slist_concat (SList *head, SList *tail) { SList *last; if (!head) { return tail; } last = head; while (last->next) last = last->next; last->next = tail; return head; } /* Return a single list, composed by destructively appending all of the items in SLIST to ITEM. The values of ITEM and SLIST are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_cons (slist_box (data), slist1); */ SList * slist_cons (SList *item, SList *slist) { if (!item) { return slist; } assert (!item->next); item->next = slist; return item; } /* Return a list starting at the second item of SLIST. */ SList * slist_tail (SList *slist) { return slist ? slist->next : NULL; } /* Return a list starting at the Nth item of SLIST. If SLIST is less than N items long, NULL is returned. Just to be confusing, list items are counted from 1, to get the 2nd element of slist: e.g. shared_list = slist_nth (slist, 2); */ SList * slist_nth (SList *slist, size_t n) { for (;n > 1 && slist; n--) slist = slist->next; return slist; } /* Return the number of items in SLIST. We start counting from 1, so the length of a list with no items is 0, and so on. */ size_t slist_length (SList *slist) { size_t n; for (n = 0; slist; ++n) slist = slist->next; return n; } /* Destructively reverse the order of items in SLIST. The value of SLIST is undefined after calling this function. CAVEAT: You must store the result of this function, or you might not be able to get all the items except the first one back again. e.g. slist = slist_reverse (slist); */ SList * slist_reverse (SList *slist) { SList *result = 0; SList *next; while (slist) { next = slist->next; slist->next = result; result = slist; slist = next; } return result; } /* Call FOREACH once for each item in SLIST, passing both the item and USERDATA on each call. */ void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata) { void *result = 0; assert (foreach); while (slist) { SList *next = slist->next; result = (*foreach) (slist, userdata); if (result) break; slist = next; } return result; } /* Destructively merge the items of two ordered lists LEFT and RIGHT, returning a single sorted list containing the items of both -- Part of the quicksort algorithm. The values of LEFT and RIGHT are undefined after calling this function. At each iteration, add another item to the merged list by taking the lowest valued item from the head of either LEFT or RIGHT, determined by passing those items and USERDATA to COMPARE. COMPARE should return less than 0 if the head of LEFT has the lower value, greater than 0 if the head of RIGHT has the lower value, otherwise 0. */ static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata) { SList merged, *insert; insert = &merged; while (left && right) { if ((*compare) (left, right, userdata) <= 0) { insert = insert->next = left; left = left->next; } else { insert = insert->next = right; right = right->next; } } insert->next = left ? left : right; return merged.next; } /* Perform a destructive quicksort on the items in SLIST, by repeatedly calling COMPARE with a pair of items from SLIST along with USERDATA at every iteration. COMPARE is a function as defined above for slist_sort_merge(). The value of SLIST is undefined after calling this function. e.g. slist = slist_sort (slist, compare, 0); */ SList * slist_sort (SList *slist, SListCompare *compare, void *userdata) { SList *left, *right; if (!slist) return slist; /* Be sure that LEFT and RIGHT never contain the same item. */ left = slist; right = slist->next; if (!right) return left; /* Skip two items with RIGHT and one with SLIST, until RIGHT falls off the end. SLIST must be about half way along. */ while (right && (right = right->next)) { if (!right || !(right = right->next)) break; slist = slist->next; } right = slist->next; slist->next = 0; /* Sort LEFT and RIGHT, then merge the two. */ return slist_sort_merge (slist_sort (left, compare, userdata), slist_sort (right, compare, userdata), compare, userdata); } /* Aside from using the functions above to manage chained structures of any type that has a NEXT pointer as its first field, SLISTs can be comprised of boxed items. The boxes are chained together in that case, so there is no need for a NEXT field in the item proper. Some care must be taken to slist_box and slist_unbox each item in a boxed list at the appropriate points to avoid leaking the memory used for the boxes. It us usually a very bad idea to mix boxed and non-boxed items in a single list. */ /* Return a 'boxed' freshly mallocated 1 element list containing USERDATA. */ SList * slist_box (const void *userdata) { SList *item = (SList *) malloc (sizeof *item); if (item) { item->next = 0; item->userdata = userdata; } return item; } /* Return the contents of a 'boxed' ITEM, recycling the box itself. */ void * slist_unbox (SList *item) { void *userdata = 0; if (item) { /* Strip the const, because responsibility for this memory passes to the caller on return. */ userdata = (void *) item->userdata; free (item); } return userdata; }
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace KendoUIMVC5.Models { public class CarsService { private Random random = new Random(); private Dictionary<string, List<string>> data = new Dictionary<string, List<string>>(); public CarsService() { data.Add("BMW", new List<string> { "116i", "116d", "118i", "118d", "120i", "120d", "125i", "125d", "130i", "135i", "235i", "330i", "330d", "335i", "335d", "340i", "430i", "440i", "530i", "530d", "535i", "535d", "540i", "540d", "550i", "550d", "640i", "650i", "750i", "760i", "X1", "X2", "X3", "X4", "x5", "X6" }); data.Add("Audi", new List<string> { "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "Q1", "Q2", "Q3", "Q5", "Q7" }); data.Add("Mercedes-Benz", new List<string> { "A", "B", "C", "E", "S", "SL", "ML", "G", "GL", "CLK", "SLK", "SLS", "GLS", "GLE", "GLK", "GLC" }); data.Add("Volkswagen", new List<string> { "Up", "Lupo", "Polo", "Golf", "Jetta", "Passat", "Arteon", "Caddy", "Touran", "Vento", "Touareg", "Tiguan", "T-Roc", "T-Cross", "Scirocco", "Beetle" }); } public ICollection<Car> GetAllCars() { var result = new List<Car>(); for (int i = 0; i < 1000; i++) { var make = data.ElementAt(random.Next(0, 3)); result.Add(new Car { Id = Guid.NewGuid(), Make = make.Key, Model = make.Value[random.Next(0, make.Value.Count)], ProductionDate = new DateTimeOffset(random.Next(2000, 2020), random.Next(1, 11), random.Next(1, 27), random.Next(1, 23), random.Next(1, 59), random.Next(0,1), TimeSpan.Zero) }); } return result; } } }
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "filename" : "dismissButton.png", "scale" : "1x" }, { "idiom" : "universal", "filename" : "dismissButton@2x.png", "scale" : "2x" }, { "idiom" : "universal", "filename" : "dismissButton@3x.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #pragma mark - // // File: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/PrivateFrameworks/VideoConference.framework/Versions/A/VideoConference // UUID: EE624E82-1CA3-3EF2-8421-AE3DA3C51A95 // // Arch: x86_64 // Source version: 469.0.0.0.0 // Minimum Mac OS X version: 10.9.0 // SDK version: 10.9.0 // // Objective-C Garbage Collection: Unknown //
{ "pile_set_name": "Github" }
package com.trilead.ssh2.signature; import java.math.BigInteger; /** * DSAPrivateKey. * * @author Christian Plattner, plattner@trilead.com * @version $Id: DSAPrivateKey.java,v 1.1 2007/10/15 12:49:57 cplattne Exp $ * @deprecated use {@link java.security.interfaces.DSAPrivateKey} * @see java.security.interfaces.DSAPrivateKey */ @Deprecated public class DSAPrivateKey { private BigInteger p; private BigInteger q; private BigInteger g; private BigInteger x; private BigInteger y; public DSAPrivateKey(BigInteger p, BigInteger q, BigInteger g, BigInteger y, BigInteger x) { this.p = p; this.q = q; this.g = g; this.y = y; this.x = x; } public BigInteger getP() { return p; } public BigInteger getQ() { return q; } public BigInteger getG() { return g; } public BigInteger getY() { return y; } public BigInteger getX() { return x; } public DSAPublicKey getPublicKey() { return new DSAPublicKey(p, q, g, y); } }
{ "pile_set_name": "Github" }
import 'package:flutter/material.dart'; const Color backgroundColor = Color.fromARGB(255, 255, 241, 159); const Color commentColor = Color.fromARGB(255, 255, 246, 196);
{ "pile_set_name": "Github" }
import _ from 'lodash'; import configFile from '../../timelion.json'; module.exports = function () { function flattenWith(dot, nestedObj, flattenArrays) { const stack = []; // track key stack const flatObj = {}; (function flattenObj(obj) { _.keys(obj).forEach(function (key) { stack.push(key); if (!flattenArrays && _.isArray(obj[key])) flatObj[stack.join(dot)] = obj[key]; else if (_.isObject(obj[key])) flattenObj(obj[key]); else flatObj[stack.join(dot)] = obj[key]; stack.pop(); }); }(nestedObj)); return flatObj; } const timelionDefaults = flattenWith('.', configFile); return _.reduce(timelionDefaults, (result, value, key) => { result['timelion:' + key] = value; return result; }, {}); };
{ "pile_set_name": "Github" }
/* * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef MODULES_DESKTOP_CAPTURE_SHARED_DESKTOP_FRAME_H_ #define MODULES_DESKTOP_CAPTURE_SHARED_DESKTOP_FRAME_H_ #include <memory> #include "api/scoped_refptr.h" #include "modules/desktop_capture/desktop_frame.h" #include "rtc_base/constructor_magic.h" #include "rtc_base/ref_counted_object.h" #include "rtc_base/system/rtc_export.h" namespace webrtc { // SharedDesktopFrame is a DesktopFrame that may have multiple instances all // sharing the same buffer. class RTC_EXPORT SharedDesktopFrame : public DesktopFrame { public: ~SharedDesktopFrame() override; static std::unique_ptr<SharedDesktopFrame> Wrap( std::unique_ptr<DesktopFrame> desktop_frame); // Deprecated. // TODO(sergeyu): remove this method. static SharedDesktopFrame* Wrap(DesktopFrame* desktop_frame); // Deprecated. Clients do not need to know the underlying DesktopFrame // instance. // TODO(zijiehe): Remove this method. // Returns the underlying instance of DesktopFrame. DesktopFrame* GetUnderlyingFrame(); // Returns whether |this| and |other| share the underlying DesktopFrame. bool ShareFrameWith(const SharedDesktopFrame& other) const; // Creates a clone of this object. std::unique_ptr<SharedDesktopFrame> Share(); // Checks if the frame is currently shared. If it returns false it's // guaranteed that there are no clones of the object. bool IsShared(); private: typedef rtc::RefCountedObject<std::unique_ptr<DesktopFrame>> Core; SharedDesktopFrame(rtc::scoped_refptr<Core> core); const rtc::scoped_refptr<Core> core_; RTC_DISALLOW_COPY_AND_ASSIGN(SharedDesktopFrame); }; } // namespace webrtc #endif // MODULES_DESKTOP_CAPTURE_SHARED_DESKTOP_FRAME_H_
{ "pile_set_name": "Github" }
<?php /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2016, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team 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 HOLDERS * AND 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. * * @package SimplePie * @copyright 2004-2016 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * Handles `<atom:source>` * * Used by {@see SimplePie_Item::get_source()} * * This class can be overloaded with {@see SimplePie::set_source_class()} * * @package SimplePie * @subpackage API */ class SimplePie_Source { var $item; var $data = array(); protected $registry; public function __construct($item, $data) { $this->item = $item; $this->data = $data; } public function set_registry(SimplePie_Registry $registry) { $this->registry = $registry; } public function __toString() { return md5(serialize($this->data)); } public function get_source_tags($namespace, $tag) { if (isset($this->data['child'][$namespace][$tag])) { return $this->data['child'][$namespace][$tag]; } else { return null; } } public function get_base($element = array()) { return $this->item->get_base($element); } public function sanitize($data, $type, $base = '') { return $this->item->sanitize($data, $type, $base); } public function get_item() { return $this->item; } public function get_title() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'title')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'title')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'title')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } public function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } else { return null; } } public function get_categories() { $categories = array(); foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['attribs']['']['term'])) { $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = $this->registry->create('Category', array($term, $scheme, $label)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'category') as $category) { // This is really the label, but keep this as the term also for BC. // Label will also work on retrieving because that falls back to term. $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); if (isset($category['attribs']['']['domain'])) { $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); } else { $scheme = null; } $categories[] = $this->registry->create('Category', array($term, $scheme, null)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'subject') as $category) { $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'subject') as $category) { $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } if (!empty($categories)) { return array_unique($categories); } else { return null; } } public function get_author($key = 0) { $authors = $this->get_authors(); if (isset($authors[$key])) { return $authors[$key]; } else { return null; } } public function get_authors() { $authors = array(); foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author') as $author) { $name = null; $uri = null; $email = null; if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $authors[] = $this->registry->create('Author', array($name, $uri, $email)); } } if ($author = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'author')) { $name = null; $url = null; $email = null; if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $authors[] = $this->registry->create('Author', array($name, $url, $email)); } } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author) { $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } if (!empty($authors)) { return array_unique($authors); } else { return null; } } public function get_contributor($key = 0) { $contributors = $this->get_contributors(); if (isset($contributors[$key])) { return $contributors[$key]; } else { return null; } } public function get_contributors() { $contributors = array(); foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'contributor') as $contributor) { $name = null; $uri = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $contributors[] = $this->registry->create('Author', array($name, $uri, $email)); } } foreach ((array) $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'contributor') as $contributor) { $name = null; $url = null; $email = null; if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0])); } if (isset($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $contributors[] = $this->registry->create('Author', array($name, $url, $email)); } } if (!empty($contributors)) { return array_unique($contributors); } else { return null; } } public function get_link($key = 0, $rel = 'alternate') { $links = $this->get_links($rel); if (isset($links[$key])) { return $links[$key]; } else { return null; } } /** * Added for parity between the parent-level and the item/entry-level. */ public function get_permalink() { return $this->get_link(0); } public function get_links($rel = 'alternate') { if (!isset($this->data['links'])) { $this->data['links'] = array(); if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($links[0])); } $keys = array_keys($this->data['links']); foreach ($keys as $key) { if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key))) { if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key])) { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]); $this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]; } else { $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key]; } } elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] =& $this->data['links'][$key]; } $this->data['links'][$key] = array_unique($this->data['links'][$key]); } } if (isset($this->data['links'][$rel])) { return $this->data['links'][$rel]; } else { return null; } } public function get_description() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'subtitle')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'tagline')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'description')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'summary')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'subtitle')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_HTML, $this->get_base($return[0])); } else { return null; } } public function get_copyright() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'rights')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_10_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'copyright')) { return $this->sanitize($return[0]['data'], $this->registry->call('Misc', 'atom_03_construct_type', array($return[0]['attribs'])), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'copyright')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'rights')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } public function get_language() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_11, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_DC_10, 'language')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } elseif (isset($this->data['xml_lang'])) { return $this->sanitize($this->data['xml_lang'], SIMPLEPIE_CONSTRUCT_TEXT); } else { return null; } } public function get_latitude() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lat')) { return (float) $return[0]['data']; } elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[1]; } else { return null; } } public function get_longitude() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'long')) { return (float) $return[0]['data']; } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO, 'lon')) { return (float) $return[0]['data']; } elseif (($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[2]; } else { return null; } } public function get_image_url() { if ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'image')) { return $this->sanitize($return[0]['attribs']['']['href'], SIMPLEPIE_CONSTRUCT_IRI); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'logo')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'icon')) { return $this->sanitize($return[0]['data'], SIMPLEPIE_CONSTRUCT_IRI, $this->get_base($return[0])); } else { return null; } } }
{ "pile_set_name": "Github" }
# DO NOT EDIT THIS FILE MANUALLY # # This file has been auto-generated from our Google Docs Spreadsheet. --- 'no': ab_tests: test_ideasubmit: help_your_community: Gi ditt bidrag make_your_voice_heard: Bli hørt test_showmespace: make_your_choice: Ta et valg og se hva som skjer videre please_click: Klikk på ditt valg test_stackoverflow: first_time: Første gang du ser her? Klikk på det alternativet du liker best for å starte stemmegivningen! no_first_time: Klikk på det alternativet du liker best for å starte stemmegivningen! common: X_votes_on_Y_ideas: ! '%{1}%{votes_count}%{_1} stemmer på %{2}%{ideas_count}%{_2} ideer' active: aktiv and: og characters: tegn idea: idé idea_marketplace: Idémarked ideas: ideer inactive: inaktiv items: ideer photo: foto score: poengsum skips: Hopp over title: All Our Ideas – tar surveyteknologien inn i den digitale tidsalder title_widget: All Our Ideas user_sessions: Brukersesjoner users: brukere vote: stemme votes: Stemmer votes_on: stemmer på footer: logged_in: Logget inn logged_in_as: Logget inn som %{user} my_questions: Mine spørsmål open_source: All Our Ideas er basert på åpent kildekode. Føl deg fri til å gjennomgå, redesigne eller bidra. support: Dette prosjektet er støttet med tilskudd fra Google og CITP ved Princeton University . form: create: Skap save: Lagre submit: Send inn home: whats_this_txt: All Our Ideas er en platform som gjør det mulig for grupper å samle og prioritere ideer i en gjennomsiktig, demokratisk, og bottum-up måte. Det er en forslagskasse for den digitale tidsalder. items: about_scoring: Om poenggivningen added_on: Lagt til idea: Idé items: Ideer list: activated: Aktivert change_status: endre status content: teksten som vises deactivated: deaktivert status: status toggle: veksle new: too_long: Idéteksten er for lang. Maks lengde er number_of_votes: Antall stemmer score: Score score_explain: Poengsummen for en idé er beregnet ut fra estimert sjanse for at den vil vinne mot en tilfeldig valgt idé. For eksempel betyr en score på 100 at ideen er prediket å vinne hver gang, mens en score på 0 betyr at ideen er prediket å tape hver gang. toggle_error: Beklager, vi kunne ikke endre status for dette valget fordi du ikke eier spørsmålet you_have_successfully_activated: Du har nå aktivert ideen you_have_successfully_deactivated: Du har deaktivert ideen you_just_submitted: Du har nettopp lagt til en idé andre kan stemme på login: header: Logg deg på kontoen din nav: about: Om about_this_page: Om denne siden back: Tilbake blog: Blogg create: Opprett feedback: Tilbakemelding home: Hjem make_your_own: Opprett et spørsmål manage_question: Administrer denne siden privacy: privacy_policy: Regler for personvern og samtykke return_voting_widget: Tilbake til stemmegivning see_all_ideas: Se mer… signup: registrer deg view_idea: Vis idé view_more_results_widget: Vis flere resultater view_results: Vis resultater results: about_word_cloud: Om ordskyer close_link: ! '[Lukk]' data_visualizations: Datavisualisering date: Dato next: Neste >> no_data_error: Kan ikke lage figur, mangler data number_of: Antall number_of_ideas: Antall ideer number_of_ideas_per_day: Antall ideer per dag number_of_user_sessions: Antall brukersesjoner number_of_user_sessions_per_day: Antall brukersesjoner per dag number_of_votes_per_day: Antall stemmer per dag original_ideas: Orginale ideer overall_total: Totalt antall - overall_total_votes: Totalt antall -%{count} stemmer per_day: per dag previous: << Forrige rollover_to_see_more: Ta kursøren over hvert punkt for å lære mer scatter_ideas_subtitle: Ta kursøren over hvert punkt for å lære mer scatter_ideas_title: Sammenlign ideer som er lastet opp med opprinnelige ideer scores_of: Resultater av scores_of_uploaded_and_orginal_ideas: Resultater for opplastede ideer og opprinnelige ideer unable_to_find_location_of_X_votes: Vi finner ikke plasseringen av %{count} stemmer uploaded_ideas: Opplastede ideer user_ideas_over_time_title: Antall innsendte ideer over tid user_sessions_over_time_title: Antall unike brukersesjoner per dag view_link: ! '[Vis]' vote_map_geo_error: Vi finner ikke plasseringen av votes_over_time_title: Antall stemmer over tid word_cloud_exp: Ordskyen som vises på denne siden er en visualisering av de ordene som oftest brukes på idémarkedet. Når ordskyen vektes etter poengsum, brukes scoren på en ide til å bestemme hvor populært ordet er. Vær oppmerksom på at noen vanlige eller sjeldne ord kan filtreres ut av ordskyen. word_cloud_ideas_title: Ordsky av ideer word_cloud_uploaded_title: Ordsky av opplastede ideer word_cloud_uploaded_weighted_title: Ordsky av opplastede ideer vektet etter poengsum word_cloud_weighted_title: Ordsky av ideer vektet etter poengsum world_map_creators: Verdenskart over alle ideskaperne world_map_ideas_title: Verdenskart over alle opplastede ideer world_map_title: Verdenskart over alle stemmer user: change_your_password: Endre passord choose_password_below: Ditt password er tilbakestilt. Velg et nytt password under. close: Lukk control_panel: Kontrollpanel deny_access_error: Du må være pålogget for å gjøre dette email: Epost forgot_password: Glemt password? login: Logg inn logout: Logg ut not_authorized_error: Du har ikke tillatelse til å endre på dette spørsmålet password: Passord password_confirmation: Bekreft passord reset_password_button: Tilbakestill passord reset_password_explain: Glemt passord? Legg inn ditt brukernavn under så sender vi deg en epost med link for å tilbakestille passordet ditt. reset_password_header: Tilbakestill passord save_password_button: Lagre passord vote: add_your_idea: Legg til din idé her… add_your_idea_button: Legg til din idé cant_decide: Jeg kan ikke bestemme meg cant_decide_message: Du kan ikke bestemme deg. cant_decide_title: Jeg kan ikke bestemme meg fordi… cast_votes: Gi din stemme cd_both_same: Jeg syntes begge ideene er like cd_dislike_both: Jeg liker ingen av ideene cd_dont_know_both: Jeg kan ikke nok om noen av ideene cd_dont_know_both_widget: Jeg kan ikke nok om noen cd_dont_know_left: ! 'Jeg kan ikke nok om:' cd_dont_know_right: ! 'Jeg kan ikke nok om:' cd_explicit_dont_know_left_widget: Jeg kan ikke nok om ideen til venstre cd_explicit_dont_know_right_widget: Jeg kan ikke nok om ideen til høyre cd_like_both: Jeg liker begge ideene cd_other: Jeg klarer ikke bestemme meg cd_user_other: ! 'Andre:' click_idea_to_start_widget: Klikk på en ide for å starte stemmegivningen flag_as_inappropriate: Marker som upassende flag_complete_message: Du markerte et valg som upassende. idea_sent_for_review: Din idé er blitt sendt til vurdering. Den vil snart bli synlig på siden. leveling: adjective_0: bra adjective_1: fint adjective_2: vidunderlig adjective_3: fabelaktig adjective_4: Fantastisk adjective_5: Supert adjective_6: fantastisk adjective_7: utrolig adjective_8: kjempe flott adjective_9: wow leveling_message: ! 'Du har nå avgitt %{vote_num} %{vote_noun} og lagt til %{idea_num} %{idea_noun}: %{adjective}' leveling_message_votes_only: Du har nå avgitt %{vote_num} %{vote_noun} others_thought: Klikk for å se hva andre mener. over: over please_explain_flag: ! 'Forklar hvorfor du mener dette valget er upassende:' powered_widget_aoi: Dette idémarkedet er drevet av %{allourideas} skip: Hopp over submit: Send inn submit_idea_default_error: Beklager, ideer uten tekst er ikke tillat. submit_idea_thankyou: Takk. Din idé er lagt til Legg gjerne til flere. submit_idea_too_long_error: Beklager. Ideer kan ikke inneholde mer enn 140 tegn. view_all_the_results: Vis alle resultater vote_other_error: Beklager, din stemme ble ikke telt med… det skjedde en feil vote_timeout_error: Beklager at stemmegivningen tar lang tid … pågangen på siden er stor! you_chose_winner_over_loser: Du velger %{winner} fremfor %{loser} you_skipped_both: Du hoppet over about_page: intro: Du deltar på en “wiki survey” som gjør det mulig å samle og prioritere ideer på en åpen, demokratisk og effektiv måte. Ved å kombinere stemmegivning med mulighet for å laste opp nye ideer, vil man kunne få frem de beste ideene. how_many_votes_q: Hvor mange ganger kan jeg stemme? how_many_votes_exp: Du kan stemme så mange ganger du vil, og du kan stoppe stemmegivningen når du måtte ønske det. how_many_ideas_q: Hvor mange ideer kan jeg legge til? Hva skjer med min ide etter at jeg har lastet den opp? how_many_ideas_exp: Du kan legge til så mange ideer du vil. Etter at du har lastet opp en ny ide blir den vurdert av en moderator for å sikre at ingen støtende ideer blir lastet opp. Straks ideen er godkjent, vil andre kunne stemme på den. view_results_q: Kan jeg se hva alle andre mener? view_results_exp: Ja, ved å klikke på “Vis resultater” vil du kunne se hva andre har stemt på. make_my_own_q: Dette er veldig bra. Kan jeg lage en slik selv? make_my_own_exp: ! 'Det kan du. Det er lett å sette opp din egen wiki survey. Det er også helt gratis takket være tilskudd fra Google og Center for Information Technology Policy (CITP) ved Princeton University. Du kan lage din egen wiki her: http://www.allourideas.org/questions/new.'
{ "pile_set_name": "Github" }
{ "name": "SocketKB", "author": "Brendan Coles <bcoles@gmail.com>", "version": "0.2", "description": "Deploy your own professional knowledge base or knowledge repository. Provide your customers the answers to their questions with SocketKB. Increase customer satisfaction and confidence. Easy and fast to install.", "website": "http://socketkb.com/site/home/", "matches": [ { "regexp": "(?-mix:>Powered by SocketKB version ([\\d\\.]+)<\\/a>)", "offset": 1 } ] }
{ "pile_set_name": "Github" }
/* ** DynASM PPC encoding engine. ** Copyright (C) 2005-2014 Mike Pall. All rights reserved. ** Released under the MIT license. See dynasm.lua for full copyright notice. */ #include <stddef.h> #include <stdarg.h> #include <string.h> #include <stdlib.h> #define DASM_ARCH "ppc" #ifndef DASM_EXTERN #define DASM_EXTERN(a,b,c,d) 0 #endif /* Action definitions. */ enum { DASM_STOP, DASM_SECTION, DASM_ESC, DASM_REL_EXT, /* The following actions need a buffer position. */ DASM_ALIGN, DASM_REL_LG, DASM_LABEL_LG, /* The following actions also have an argument. */ DASM_REL_PC, DASM_LABEL_PC, DASM_IMM, DASM__MAX }; /* Maximum number of section buffer positions for a single dasm_put() call. */ #define DASM_MAXSECPOS 25 /* DynASM encoder status codes. Action list offset or number are or'ed in. */ #define DASM_S_OK 0x00000000 #define DASM_S_NOMEM 0x01000000 #define DASM_S_PHASE 0x02000000 #define DASM_S_MATCH_SEC 0x03000000 #define DASM_S_RANGE_I 0x11000000 #define DASM_S_RANGE_SEC 0x12000000 #define DASM_S_RANGE_LG 0x13000000 #define DASM_S_RANGE_PC 0x14000000 #define DASM_S_RANGE_REL 0x15000000 #define DASM_S_UNDEF_LG 0x21000000 #define DASM_S_UNDEF_PC 0x22000000 /* Macros to convert positions (8 bit section + 24 bit index). */ #define DASM_POS2IDX(pos) ((pos)&0x00ffffff) #define DASM_POS2BIAS(pos) ((pos)&0xff000000) #define DASM_SEC2POS(sec) ((sec)<<24) #define DASM_POS2SEC(pos) ((pos)>>24) #define DASM_POS2PTR(D, pos) (D->sections[DASM_POS2SEC(pos)].rbuf + (pos)) /* Action list type. */ typedef const unsigned int *dasm_ActList; /* Per-section structure. */ typedef struct dasm_Section { int *rbuf; /* Biased buffer pointer (negative section bias). */ int *buf; /* True buffer pointer. */ size_t bsize; /* Buffer size in bytes. */ int pos; /* Biased buffer position. */ int epos; /* End of biased buffer position - max single put. */ int ofs; /* Byte offset into section. */ } dasm_Section; /* Core structure holding the DynASM encoding state. */ struct dasm_State { size_t psize; /* Allocated size of this structure. */ dasm_ActList actionlist; /* Current actionlist pointer. */ int *lglabels; /* Local/global chain/pos ptrs. */ size_t lgsize; int *pclabels; /* PC label chains/pos ptrs. */ size_t pcsize; void **globals; /* Array of globals (bias -10). */ dasm_Section *section; /* Pointer to active section. */ size_t codesize; /* Total size of all code sections. */ int maxsection; /* 0 <= sectionidx < maxsection. */ int status; /* Status code. */ dasm_Section sections[1]; /* All sections. Alloc-extended. */ }; /* The size of the core structure depends on the max. number of sections. */ #define DASM_PSZ(ms) (sizeof(dasm_State)+(ms-1)*sizeof(dasm_Section)) /* Initialize DynASM state. */ void dasm_init(Dst_DECL, int maxsection) { dasm_State *D; size_t psz = 0; int i; Dst_REF = NULL; DASM_M_GROW(Dst, struct dasm_State, Dst_REF, psz, DASM_PSZ(maxsection)); D = Dst_REF; D->psize = psz; D->lglabels = NULL; D->lgsize = 0; D->pclabels = NULL; D->pcsize = 0; D->globals = NULL; D->maxsection = maxsection; for (i = 0; i < maxsection; i++) { D->sections[i].buf = NULL; /* Need this for pass3. */ D->sections[i].rbuf = D->sections[i].buf - DASM_SEC2POS(i); D->sections[i].bsize = 0; D->sections[i].epos = 0; /* Wrong, but is recalculated after resize. */ } } /* Free DynASM state. */ void dasm_free(Dst_DECL) { dasm_State *D = Dst_REF; int i; for (i = 0; i < D->maxsection; i++) if (D->sections[i].buf) DASM_M_FREE(Dst, D->sections[i].buf, D->sections[i].bsize); if (D->pclabels) DASM_M_FREE(Dst, D->pclabels, D->pcsize); if (D->lglabels) DASM_M_FREE(Dst, D->lglabels, D->lgsize); DASM_M_FREE(Dst, D, D->psize); } /* Setup global label array. Must be called before dasm_setup(). */ void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl) { dasm_State *D = Dst_REF; D->globals = gl - 10; /* Negative bias to compensate for locals. */ DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int)); } /* Grow PC label array. Can be called after dasm_setup(), too. */ void dasm_growpc(Dst_DECL, unsigned int maxpc) { dasm_State *D = Dst_REF; size_t osz = D->pcsize; DASM_M_GROW(Dst, int, D->pclabels, D->pcsize, maxpc*sizeof(int)); memset((void *)(((unsigned char *)D->pclabels)+osz), 0, D->pcsize-osz); } /* Setup encoder. */ void dasm_setup(Dst_DECL, const void *actionlist) { dasm_State *D = Dst_REF; int i; D->actionlist = (dasm_ActList)actionlist; D->status = DASM_S_OK; D->section = &D->sections[0]; memset((void *)D->lglabels, 0, D->lgsize); if (D->pclabels) memset((void *)D->pclabels, 0, D->pcsize); for (i = 0; i < D->maxsection; i++) { D->sections[i].pos = DASM_SEC2POS(i); D->sections[i].ofs = 0; } } #ifdef DASM_CHECKS #define CK(x, st) \ do { if (!(x)) { \ D->status = DASM_S_##st|(p-D->actionlist-1); return; } } while (0) #define CKPL(kind, st) \ do { if ((size_t)((char *)pl-(char *)D->kind##labels) >= D->kind##size) { \ D->status = DASM_S_RANGE_##st|(p-D->actionlist-1); return; } } while (0) #else #define CK(x, st) ((void)0) #define CKPL(kind, st) ((void)0) #endif /* Pass 1: Store actions and args, link branches/labels, estimate offsets. */ void dasm_put(Dst_DECL, int start, ...) { va_list ap; dasm_State *D = Dst_REF; dasm_ActList p = D->actionlist + start; dasm_Section *sec = D->section; int pos = sec->pos, ofs = sec->ofs; int *b; if (pos >= sec->epos) { DASM_M_GROW(Dst, int, sec->buf, sec->bsize, sec->bsize + 2*DASM_MAXSECPOS*sizeof(int)); sec->rbuf = sec->buf - DASM_POS2BIAS(pos); sec->epos = (int)sec->bsize/sizeof(int) - DASM_MAXSECPOS+DASM_POS2BIAS(pos); } b = sec->rbuf; b[pos++] = start; va_start(ap, start); while (1) { unsigned int ins = *p++; unsigned int action = (ins >> 16); if (action >= DASM__MAX) { ofs += 4; } else { int *pl, n = action >= DASM_REL_PC ? va_arg(ap, int) : 0; switch (action) { case DASM_STOP: goto stop; case DASM_SECTION: n = (ins & 255); CK(n < D->maxsection, RANGE_SEC); D->section = &D->sections[n]; goto stop; case DASM_ESC: p++; ofs += 4; break; case DASM_REL_EXT: break; case DASM_ALIGN: ofs += (ins & 255); b[pos++] = ofs; break; case DASM_REL_LG: n = (ins & 2047) - 10; pl = D->lglabels + n; /* Bkwd rel or global. */ if (n >= 0) { CK(n>=10||*pl<0, RANGE_LG); CKPL(lg, LG); goto putrel; } pl += 10; n = *pl; if (n < 0) n = 0; /* Start new chain for fwd rel if label exists. */ goto linkrel; case DASM_REL_PC: pl = D->pclabels + n; CKPL(pc, PC); putrel: n = *pl; if (n < 0) { /* Label exists. Get label pos and store it. */ b[pos] = -n; } else { linkrel: b[pos] = n; /* Else link to rel chain, anchored at label. */ *pl = pos; } pos++; break; case DASM_LABEL_LG: pl = D->lglabels + (ins & 2047) - 10; CKPL(lg, LG); goto putlabel; case DASM_LABEL_PC: pl = D->pclabels + n; CKPL(pc, PC); putlabel: n = *pl; /* n > 0: Collapse rel chain and replace with label pos. */ while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = pos; } *pl = -pos; /* Label exists now. */ b[pos++] = ofs; /* Store pass1 offset estimate. */ break; case DASM_IMM: #ifdef DASM_CHECKS CK((n & ((1<<((ins>>10)&31))-1)) == 0, RANGE_I); #endif n >>= ((ins>>10)&31); #ifdef DASM_CHECKS if (ins & 0x8000) CK(((n + (1<<(((ins>>5)&31)-1)))>>((ins>>5)&31)) == 0, RANGE_I); else CK((n>>((ins>>5)&31)) == 0, RANGE_I); #endif b[pos++] = n; break; } } } stop: va_end(ap); sec->pos = pos; sec->ofs = ofs; } #undef CK /* Pass 2: Link sections, shrink aligns, fix label offsets. */ int dasm_link(Dst_DECL, size_t *szp) { dasm_State *D = Dst_REF; int secnum; int ofs = 0; #ifdef DASM_CHECKS *szp = 0; if (D->status != DASM_S_OK) return D->status; { int pc; for (pc = 0; pc*sizeof(int) < D->pcsize; pc++) if (D->pclabels[pc] > 0) return DASM_S_UNDEF_PC|pc; } #endif { /* Handle globals not defined in this translation unit. */ int idx; for (idx = 20; idx*sizeof(int) < D->lgsize; idx++) { int n = D->lglabels[idx]; /* Undefined label: Collapse rel chain and replace with marker (< 0). */ while (n > 0) { int *pb = DASM_POS2PTR(D, n); n = *pb; *pb = -idx; } } } /* Combine all code sections. No support for data sections (yet). */ for (secnum = 0; secnum < D->maxsection; secnum++) { dasm_Section *sec = D->sections + secnum; int *b = sec->rbuf; int pos = DASM_SEC2POS(secnum); int lastpos = sec->pos; while (pos != lastpos) { dasm_ActList p = D->actionlist + b[pos++]; while (1) { unsigned int ins = *p++; unsigned int action = (ins >> 16); switch (action) { case DASM_STOP: case DASM_SECTION: goto stop; case DASM_ESC: p++; break; case DASM_REL_EXT: break; case DASM_ALIGN: ofs -= (b[pos++] + ofs) & (ins & 255); break; case DASM_REL_LG: case DASM_REL_PC: pos++; break; case DASM_LABEL_LG: case DASM_LABEL_PC: b[pos++] += ofs; break; case DASM_IMM: pos++; break; } } stop: (void)0; } ofs += sec->ofs; /* Next section starts right after current section. */ } D->codesize = ofs; /* Total size of all code sections */ *szp = ofs; return DASM_S_OK; } #ifdef DASM_CHECKS #define CK(x, st) \ do { if (!(x)) return DASM_S_##st|(p-D->actionlist-1); } while (0) #else #define CK(x, st) ((void)0) #endif /* Pass 3: Encode sections. */ int dasm_encode(Dst_DECL, void *buffer) { dasm_State *D = Dst_REF; char *base = (char *)buffer; unsigned int *cp = (unsigned int *)buffer; int secnum; /* Encode all code sections. No support for data sections (yet). */ for (secnum = 0; secnum < D->maxsection; secnum++) { dasm_Section *sec = D->sections + secnum; int *b = sec->buf; int *endb = sec->rbuf + sec->pos; while (b != endb) { dasm_ActList p = D->actionlist + *b++; while (1) { unsigned int ins = *p++; unsigned int action = (ins >> 16); int n = (action >= DASM_ALIGN && action < DASM__MAX) ? *b++ : 0; switch (action) { case DASM_STOP: case DASM_SECTION: goto stop; case DASM_ESC: *cp++ = *p++; break; case DASM_REL_EXT: n = DASM_EXTERN(Dst, (unsigned char *)cp, (ins & 2047), 1) - 4; goto patchrel; case DASM_ALIGN: ins &= 255; while ((((char *)cp - base) & ins)) *cp++ = 0x60000000; break; case DASM_REL_LG: CK(n >= 0, UNDEF_LG); case DASM_REL_PC: CK(n >= 0, UNDEF_PC); n = *DASM_POS2PTR(D, n) - (int)((char *)cp - base); patchrel: CK((n & 3) == 0 && (((n+4) + ((ins & 2048) ? 0x00008000 : 0x02000000)) >> ((ins & 2048) ? 16 : 26)) == 0, RANGE_REL); cp[-1] |= ((n+4) & ((ins & 2048) ? 0x0000fffc: 0x03fffffc)); break; case DASM_LABEL_LG: ins &= 2047; if (ins >= 20) D->globals[ins-10] = (void *)(base + n); break; case DASM_LABEL_PC: break; case DASM_IMM: cp[-1] |= (n & ((1<<((ins>>5)&31))-1)) << (ins&31); break; default: *cp++ = ins; break; } } stop: (void)0; } } if (base + D->codesize != (char *)cp) /* Check for phase errors. */ return DASM_S_PHASE; return DASM_S_OK; } #undef CK /* Get PC label offset. */ int dasm_getpclabel(Dst_DECL, unsigned int pc) { dasm_State *D = Dst_REF; if (pc*sizeof(int) < D->pcsize) { int pos = D->pclabels[pc]; if (pos < 0) return *DASM_POS2PTR(D, -pos); if (pos > 0) return -1; /* Undefined. */ } return -2; /* Unused or out of range. */ } #ifdef DASM_CHECKS /* Optional sanity checker to call between isolated encoding steps. */ int dasm_checkstep(Dst_DECL, int secmatch) { dasm_State *D = Dst_REF; if (D->status == DASM_S_OK) { int i; for (i = 1; i <= 9; i++) { if (D->lglabels[i] > 0) { D->status = DASM_S_UNDEF_LG|i; break; } D->lglabels[i] = 0; } } if (D->status == DASM_S_OK && secmatch >= 0 && D->section != &D->sections[secmatch]) D->status = DASM_S_MATCH_SEC|(D->section-D->sections); return D->status; } #endif
{ "pile_set_name": "Github" }
#!/bin/bash -eux retry() { local COUNT=1 local RESULT=0 while [[ "${COUNT}" -le 10 ]]; do [[ "${RESULT}" -ne 0 ]] && { [ "`which tput 2> /dev/null`" != "" ] && tput setaf 1 echo -e "\n${*} failed... retrying ${COUNT} of 10.\n" >&2 [ "`which tput 2> /dev/null`" != "" ] && tput sgr0 } "${@}" && { RESULT=0 && break; } || RESULT="${?}" COUNT="$((COUNT + 1))" # Increase the delay with each iteration. DELAY="$((DELAY + 10))" sleep $DELAY done [[ "${COUNT}" -gt 10 ]] && { [ "`which tput 2> /dev/null`" != "" ] && tput setaf 1 echo -e "\nThe command failed 10 times.\n" >&2 [ "`which tput 2> /dev/null`" != "" ] && tput sgr0 } return "${RESULT}" } # Disable IPv6 for the current boot. sysctl net.ipv6.conf.all.disable_ipv6=1 # Ensure IPv6 stays disabled. printf "\nnet.ipv6.conf.all.disable_ipv6 = 1\n" >> /etc/sysctl.conf # Set the hostname, and then ensure it will resolve properly. if [[ "$PACKER_BUILD_NAME" =~ ^generic-ubuntu1804-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then printf "ubuntu1804.localdomain\n" > /etc/hostname printf "\n127.0.0.1 ubuntu1804.localdomain\n\n" >> /etc/hosts else printf "magma.builder\n" > /etc/hostname printf "\n127.0.0.1 magma.builder\n\n" >> /etc/hosts fi cat <<-EOF > /etc/netplan/01-netcfg.yaml network: version: 2 renderer: networkd ethernets: eth0: dhcp4: true dhcp6: false optional: true nameservers: addresses: [4.2.2.1, 4.2.2.2, 208.67.220.220] EOF # Apply the network plan configuration. netplan generate # Ensure a nameserver is being used that won't return an IP for non-existent domain names. sed -i -e "s/#DNS=.*/DNS=4.2.2.1 4.2.2.2 208.67.220.220/g" /etc/systemd/resolved.conf sed -i -e "s/#FallbackDNS=.*/FallbackDNS=/g" /etc/systemd/resolved.conf sed -i -e "s/#Domains=.*/Domains=/g" /etc/systemd/resolved.conf sed -i -e "s/#DNSSEC=.*/DNSSEC=yes/g" /etc/systemd/resolved.conf sed -i -e "s/#Cache=.*/Cache=yes/g" /etc/systemd/resolved.conf sed -i -e "s/#DNSStubListener=.*/DNSStubListener=yes/g" /etc/systemd/resolved.conf # Install ifplugd so we can monitor and auto-configure nics. retry apt-get --assume-yes install ifplugd # Configure ifplugd to monitor the eth0 interface. sed -i -e 's/INTERFACES=.*/INTERFACES="eth0"/g' /etc/default/ifplugd # Ensure the networking interfaces get configured on boot. systemctl enable systemd-networkd.service # Ensure ifplugd also gets started, so the ethernet interface is monitored. systemctl enable ifplugd.service # Reboot onto the new kernel (if applicable). $(shutdown -r +1) &
{ "pile_set_name": "Github" }
package org.basex.query.func.math; import static java.lang.StrictMath.*; import org.basex.query.*; import org.basex.query.value.item.*; import org.basex.query.value.seq.*; import org.basex.util.*; /** * Function implementation. * * @author BaseX Team 2005-20, BSD License * @author Christian Gruen */ public final class MathCosh extends MathFn { @Override public Item item(final QueryContext qc, final InputInfo ii) throws QueryException { final Item item = exprs[0].atomItem(qc, info); return item == Empty.VALUE ? Empty.VALUE : Dbl.get(cosh(toDouble(item))); } }
{ "pile_set_name": "Github" }
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // <auto-generated/> // Template Source: Templates\CSharp\Model\ComplexType.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; using System.IO; using System.Runtime.Serialization; using Newtonsoft.Json; /// <summary> /// The type DeviceOperatingSystemSummary. /// </summary> [JsonObject(MemberSerialization = MemberSerialization.OptIn)] [JsonConverter(typeof(DerivedTypeConverter))] public partial class DeviceOperatingSystemSummary { /// <summary> /// Initializes a new instance of the <see cref="DeviceOperatingSystemSummary"/> class. /// </summary> public DeviceOperatingSystemSummary() { this.ODataType = "microsoft.graph.deviceOperatingSystemSummary"; } /// <summary> /// Gets or sets androidCount. /// Number of android device count. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "androidCount", Required = Newtonsoft.Json.Required.Default)] public Int32? AndroidCount { get; set; } /// <summary> /// Gets or sets iosCount. /// Number of iOS device count. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "iosCount", Required = Newtonsoft.Json.Required.Default)] public Int32? IosCount { get; set; } /// <summary> /// Gets or sets macOSCount. /// Number of Mac OS X device count. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "macOSCount", Required = Newtonsoft.Json.Required.Default)] public Int32? MacOSCount { get; set; } /// <summary> /// Gets or sets unknownCount. /// Number of unknown device count. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "unknownCount", Required = Newtonsoft.Json.Required.Default)] public Int32? UnknownCount { get; set; } /// <summary> /// Gets or sets windowsCount. /// Number of Windows device count. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "windowsCount", Required = Newtonsoft.Json.Required.Default)] public Int32? WindowsCount { get; set; } /// <summary> /// Gets or sets windowsMobileCount. /// Number of Windows mobile device count. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "windowsMobileCount", Required = Newtonsoft.Json.Required.Default)] public Int32? WindowsMobileCount { get; set; } /// <summary> /// Gets or sets additional data. /// </summary> [JsonExtensionData(ReadData = true)] public IDictionary<string, object> AdditionalData { get; set; } /// <summary> /// Gets or sets @odata.type. /// </summary> [JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "@odata.type", Required = Newtonsoft.Json.Required.Default)] public string ODataType { get; set; } } }
{ "pile_set_name": "Github" }
"""Middleware classes to process messages on their way in and out of workers. """ from vumi.middleware.base import ( BaseMiddleware, TransportMiddleware, ApplicationMiddleware, MiddlewareStack, create_middlewares_from_config, setup_middlewares_from_config) __all__ = [ 'BaseMiddleware', 'TransportMiddleware', 'ApplicationMiddleware', 'MiddlewareStack', 'create_middlewares_from_config', 'setup_middlewares_from_config']
{ "pile_set_name": "Github" }
//===- DominanceFrontier.cpp - Dominance Frontier Calculation -------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "llvm/Analysis/DominanceFrontier.h" #include "llvm/Analysis/DominanceFrontierImpl.h" #include "llvm/Config/llvm-config.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/Function.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; namespace llvm { template class DominanceFrontierBase<BasicBlock, false>; template class DominanceFrontierBase<BasicBlock, true>; template class ForwardDominanceFrontierBase<BasicBlock>; } // end namespace llvm char DominanceFrontierWrapperPass::ID = 0; INITIALIZE_PASS_BEGIN(DominanceFrontierWrapperPass, "domfrontier", "Dominance Frontier Construction", true, true) INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) INITIALIZE_PASS_END(DominanceFrontierWrapperPass, "domfrontier", "Dominance Frontier Construction", true, true) DominanceFrontierWrapperPass::DominanceFrontierWrapperPass() : FunctionPass(ID), DF() { initializeDominanceFrontierWrapperPassPass(*PassRegistry::getPassRegistry()); } void DominanceFrontierWrapperPass::releaseMemory() { DF.releaseMemory(); } bool DominanceFrontierWrapperPass::runOnFunction(Function &) { releaseMemory(); DF.analyze(getAnalysis<DominatorTreeWrapperPass>().getDomTree()); return false; } void DominanceFrontierWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired<DominatorTreeWrapperPass>(); } void DominanceFrontierWrapperPass::print(raw_ostream &OS, const Module *) const { DF.print(OS); } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void DominanceFrontierWrapperPass::dump() const { print(dbgs()); } #endif /// Handle invalidation explicitly. bool DominanceFrontier::invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &) { // Check whether the analysis, all analyses on functions, or the function's // CFG have been preserved. auto PAC = PA.getChecker<DominanceFrontierAnalysis>(); return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Function>>() || PAC.preservedSet<CFGAnalyses>()); } AnalysisKey DominanceFrontierAnalysis::Key; DominanceFrontier DominanceFrontierAnalysis::run(Function &F, FunctionAnalysisManager &AM) { DominanceFrontier DF; DF.analyze(AM.getResult<DominatorTreeAnalysis>(F)); return DF; } DominanceFrontierPrinterPass::DominanceFrontierPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses DominanceFrontierPrinterPass::run(Function &F, FunctionAnalysisManager &AM) { OS << "DominanceFrontier for function: " << F.getName() << "\n"; AM.getResult<DominanceFrontierAnalysis>(F).print(OS); return PreservedAnalyses::all(); }
{ "pile_set_name": "Github" }
[![Build Status](https://travis-ci.org/MichaelRocks/libphonenumber-android.svg?branch=master)](https://travis-ci.org/MichaelRocks/libphonenumber-android) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-libphonenumber--android-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/3676) [![Methods Count](https://img.shields.io/badge/Methods%20count-core:%20705%20-e91e63.svg)](http://www.methodscount.com/?lib=io.michaelrocks%3Alibphonenumber-android%3A8.12.10) libphonenumber-android ====================== Android port of Google's [libphonenumber][1]. Why? ---- Google's libphonenumber is a great library but it has to major flaws when used on Android: 1. ~~It adds about [7k methods][2] to a final dex.~~ Not anymore, since 7.7.0. 2. Internally the library uses `Class.getResourceAsStream()` method, which is [very slow on Android][3]. The goal of this library is to fix these two issues. Download -------- Gradle: ```groovy repositories { jcenter() } dependencies { implementation 'io.michaelrocks:libphonenumber-android:8.12.10' } ``` For DexGuard users ------------------ If your project is obfuscated with DexGuard you may need to add the following line to the DexGuard configuration: ``` -keepresourcefiles assets/io/michaelrocks/libphonenumber/android/** ``` API differences --------------- This library is not fully compatible with the original `libphonenumber`. 1. Every `libphonenumber` class is repackaged to `io.michaelrocks.libphonenumber.android`. 2. `PhoneNumberUtil` doesn't contain a `getInstance()` method so you have to create an instance of this class with one of `PhoneNumberUtil.createInstance()` methods and store it somewhere. 3. `PhoneNumberUtil` now has a `createInstance(Context)` method, which is a default way to obtain an instance of this class on Android. License ======= Copyright 2017 Michael Rozumyanskiy 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. [1]: https://github.com/googlei18n/libphonenumber [2]: http://www.methodscount.com/?lib=com.googlecode.libphonenumber%3Alibphonenumber%3A8.12.10 [3]: http://blog.nimbledroid.com/2016/04/06/slow-ClassLoader.getResourceAsStream.html
{ "pile_set_name": "Github" }
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "BulletCollision/CollisionShapes/btCollisionShape.h" #include "LinearMath/btSerializer.h" /* Make sure this dummy function never changes so that it can be used by probes that are checking whether the library is actually installed. */ extern "C" { void btBulletCollisionProbe(); void btBulletCollisionProbe() {} } void btCollisionShape::getBoundingSphere(btVector3& center, btScalar& radius) const { btTransform tr; tr.setIdentity(); btVector3 aabbMin, aabbMax; getAabb(tr, aabbMin, aabbMax); radius = (aabbMax - aabbMin).length() * btScalar(0.5); center = (aabbMin + aabbMax) * btScalar(0.5); } btScalar btCollisionShape::getContactBreakingThreshold(btScalar defaultContactThreshold) const { return getAngularMotionDisc() * defaultContactThreshold; } btScalar btCollisionShape::getAngularMotionDisc() const { ///@todo cache this value, to improve performance btVector3 center; btScalar disc; getBoundingSphere(center, disc); disc += (center).length(); return disc; } void btCollisionShape::calculateTemporalAabb(const btTransform& curTrans, const btVector3& linvel, const btVector3& angvel, btScalar timeStep, btVector3& temporalAabbMin, btVector3& temporalAabbMax) const { //start with static aabb getAabb(curTrans, temporalAabbMin, temporalAabbMax); btScalar temporalAabbMaxx = temporalAabbMax.getX(); btScalar temporalAabbMaxy = temporalAabbMax.getY(); btScalar temporalAabbMaxz = temporalAabbMax.getZ(); btScalar temporalAabbMinx = temporalAabbMin.getX(); btScalar temporalAabbMiny = temporalAabbMin.getY(); btScalar temporalAabbMinz = temporalAabbMin.getZ(); // add linear motion btVector3 linMotion = linvel * timeStep; ///@todo: simd would have a vector max/min operation, instead of per-element access if (linMotion.x() > btScalar(0.)) temporalAabbMaxx += linMotion.x(); else temporalAabbMinx += linMotion.x(); if (linMotion.y() > btScalar(0.)) temporalAabbMaxy += linMotion.y(); else temporalAabbMiny += linMotion.y(); if (linMotion.z() > btScalar(0.)) temporalAabbMaxz += linMotion.z(); else temporalAabbMinz += linMotion.z(); //add conservative angular motion btScalar angularMotion = angvel.length() * getAngularMotionDisc() * timeStep; btVector3 angularMotion3d(angularMotion, angularMotion, angularMotion); temporalAabbMin = btVector3(temporalAabbMinx, temporalAabbMiny, temporalAabbMinz); temporalAabbMax = btVector3(temporalAabbMaxx, temporalAabbMaxy, temporalAabbMaxz); temporalAabbMin -= angularMotion3d; temporalAabbMax += angularMotion3d; } ///fills the dataBuffer and returns the struct name (and 0 on failure) const char* btCollisionShape::serialize(void* dataBuffer, btSerializer* serializer) const { btCollisionShapeData* shapeData = (btCollisionShapeData*)dataBuffer; char* name = (char*)serializer->findNameForPointer(this); shapeData->m_name = (char*)serializer->getUniquePointer(name); if (shapeData->m_name) { serializer->serializeName(name); } shapeData->m_shapeType = m_shapeType; // Fill padding with zeros to appease msan. memset(shapeData->m_padding, 0, sizeof(shapeData->m_padding)); return "btCollisionShapeData"; } void btCollisionShape::serializeSingleShape(btSerializer* serializer) const { int len = calculateSerializeBufferSize(); btChunk* chunk = serializer->allocate(len, 1); const char* structType = serialize(chunk->m_oldPtr, serializer); serializer->finalizeChunk(chunk, structType, BT_SHAPE_CODE, (void*)this); }
{ "pile_set_name": "Github" }
3.0 (quilt)
{ "pile_set_name": "Github" }
# ------------------------------------------------------------------------- # This file controls default concretization preferences for Spack. # # Settings here are versioned with Spack and are intended to provide # sensible defaults out of the box. Spack maintainers should edit this # file to keep it current. # # Users can override these settings by editing the following files. # # Per-spack-instance settings (overrides defaults): # $SPACK_ROOT/etc/spack/packages.yaml # # Per-user settings (overrides default and site settings): # ~/.spack/packages.yaml # ------------------------------------------------------------------------- packages: cmake: paths: cmake: /usr/bin/cmake buildable: False dyninst: variants: build_type=Release mpich: variants: pmi=pmi2 papi: variants: +rapl+powercap+lmsensors~example caliper: variants: +callpath+dyninst+gotcha+libpfm~papi~mpi+sampler openmpi: variants: ~vt-pmi+cuda+thread_multiple fabrics=auto tau: variants: ~ompt+openmp+papi~pdt+pthreads+python+mpi~likwid+libunwind~cuda~phase all: compiler: [gcc, intel, pgi, clang, xl, nag, fj, gfortran] providers: D: [ldc] awk: [gawk] blas: [openblas] daal: [intel-daal] elf: [elfutils] fftw-api: [fftw] gl: [mesa+opengl, opengl] glx: [mesa+glx, opengl] glu: [mesa-glu, openglu] golang: [gcc] iconv: [libiconv] ipp: [intel-ipp] java: [openjdk, jdk, ibm-java] jpeg: [libjpeg-turbo, libjpeg] lapack: [openblas] mariadb-client: [mariadb-c-client, mariadb] mkl: [intel-mkl] mpe: [mpe2] mpi: [mpich] mysql-client: [mysql, mariadb-c-client] opencl: [pocl] pil: [py-pillow] pkgconfig: [pkgconf, pkg-config] scalapack: [netlib-scalapack] sycl: [hipsycl] szip: [libszip, libaec] tbb: [intel-tbb] unwind: [libunwind] sycl: [hipsycl] permissions: read: world write: user
{ "pile_set_name": "Github" }
package reflect2 import ( "reflect" "unsafe" ) type UnsafeMapType struct { unsafeType pKeyRType unsafe.Pointer pElemRType unsafe.Pointer } func newUnsafeMapType(cfg *frozenConfig, type1 reflect.Type) MapType { return &UnsafeMapType{ unsafeType: *newUnsafeType(cfg, type1), pKeyRType: unpackEFace(reflect.PtrTo(type1.Key())).data, pElemRType: unpackEFace(reflect.PtrTo(type1.Elem())).data, } } func (type2 *UnsafeMapType) IsNil(obj interface{}) bool { if obj == nil { return true } objEFace := unpackEFace(obj) assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype) return type2.UnsafeIsNil(objEFace.data) } func (type2 *UnsafeMapType) UnsafeIsNil(ptr unsafe.Pointer) bool { if ptr == nil { return true } return *(*unsafe.Pointer)(ptr) == nil } func (type2 *UnsafeMapType) LikePtr() bool { return true } func (type2 *UnsafeMapType) Indirect(obj interface{}) interface{} { objEFace := unpackEFace(obj) assertType("MapType.Indirect argument 1", type2.ptrRType, objEFace.rtype) return type2.UnsafeIndirect(objEFace.data) } func (type2 *UnsafeMapType) UnsafeIndirect(ptr unsafe.Pointer) interface{} { return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr)) } func (type2 *UnsafeMapType) Key() Type { return type2.cfg.Type2(type2.Type.Key()) } func (type2 *UnsafeMapType) MakeMap(cap int) interface{} { return packEFace(type2.ptrRType, type2.UnsafeMakeMap(cap)) } func (type2 *UnsafeMapType) UnsafeMakeMap(cap int) unsafe.Pointer { m := makeMapWithSize(type2.rtype, cap) return unsafe.Pointer(&m) } func (type2 *UnsafeMapType) SetIndex(obj interface{}, key interface{}, elem interface{}) { objEFace := unpackEFace(obj) assertType("MapType.SetIndex argument 1", type2.ptrRType, objEFace.rtype) keyEFace := unpackEFace(key) assertType("MapType.SetIndex argument 2", type2.pKeyRType, keyEFace.rtype) elemEFace := unpackEFace(elem) assertType("MapType.SetIndex argument 3", type2.pElemRType, elemEFace.rtype) type2.UnsafeSetIndex(objEFace.data, keyEFace.data, elemEFace.data) } func (type2 *UnsafeMapType) UnsafeSetIndex(obj unsafe.Pointer, key unsafe.Pointer, elem unsafe.Pointer) { mapassign(type2.rtype, *(*unsafe.Pointer)(obj), key, elem) } func (type2 *UnsafeMapType) TryGetIndex(obj interface{}, key interface{}) (interface{}, bool) { objEFace := unpackEFace(obj) assertType("MapType.TryGetIndex argument 1", type2.ptrRType, objEFace.rtype) keyEFace := unpackEFace(key) assertType("MapType.TryGetIndex argument 2", type2.pKeyRType, keyEFace.rtype) elemPtr := type2.UnsafeGetIndex(objEFace.data, keyEFace.data) if elemPtr == nil { return nil, false } return packEFace(type2.pElemRType, elemPtr), true } func (type2 *UnsafeMapType) GetIndex(obj interface{}, key interface{}) interface{} { objEFace := unpackEFace(obj) assertType("MapType.GetIndex argument 1", type2.ptrRType, objEFace.rtype) keyEFace := unpackEFace(key) assertType("MapType.GetIndex argument 2", type2.pKeyRType, keyEFace.rtype) elemPtr := type2.UnsafeGetIndex(objEFace.data, keyEFace.data) return packEFace(type2.pElemRType, elemPtr) } func (type2 *UnsafeMapType) UnsafeGetIndex(obj unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer { return mapaccess(type2.rtype, *(*unsafe.Pointer)(obj), key) } func (type2 *UnsafeMapType) Iterate(obj interface{}) MapIterator { objEFace := unpackEFace(obj) assertType("MapType.Iterate argument 1", type2.ptrRType, objEFace.rtype) return type2.UnsafeIterate(objEFace.data) } func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator { return &UnsafeMapIterator{ hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)), pKeyRType: type2.pKeyRType, pElemRType: type2.pElemRType, } } type UnsafeMapIterator struct { *hiter pKeyRType unsafe.Pointer pElemRType unsafe.Pointer } func (iter *UnsafeMapIterator) HasNext() bool { return iter.key != nil } func (iter *UnsafeMapIterator) Next() (interface{}, interface{}) { key, elem := iter.UnsafeNext() return packEFace(iter.pKeyRType, key), packEFace(iter.pElemRType, elem) } func (iter *UnsafeMapIterator) UnsafeNext() (unsafe.Pointer, unsafe.Pointer) { key := iter.key elem := iter.value mapiternext(iter.hiter) return key, elem }
{ "pile_set_name": "Github" }
// (C) Copyright Gennadiy Rozental 2001-2008. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // // Version : $Revision$ // // Description : storage for unit test framework parameters information // *************************************************************************** #ifndef BOOST_TEST_UNIT_TEST_PARAMETERS_HPP_071894GER #define BOOST_TEST_UNIT_TEST_PARAMETERS_HPP_071894GER #include <boost/test/detail/global_typedef.hpp> #include <boost/test/detail/log_level.hpp> #include <boost/test/detail/suppress_warnings.hpp> // STL #include <iosfwd> //____________________________________________________________________________// namespace boost { namespace unit_test { // ************************************************************************** // // ************** runtime_config ************** // // ************************************************************************** // namespace runtime_config { BOOST_TEST_DECL void init( int& argc, char** argv ); BOOST_TEST_DECL unit_test::log_level log_level(); BOOST_TEST_DECL bool no_result_code(); BOOST_TEST_DECL unit_test::report_level report_level(); BOOST_TEST_DECL const_string test_to_run(); BOOST_TEST_DECL const_string break_exec_path(); BOOST_TEST_DECL bool save_pattern(); BOOST_TEST_DECL bool show_build_info(); BOOST_TEST_DECL bool show_progress(); BOOST_TEST_DECL bool catch_sys_errors(); BOOST_TEST_DECL bool auto_start_dbg(); BOOST_TEST_DECL bool use_alt_stack(); BOOST_TEST_DECL bool detect_fp_exceptions(); BOOST_TEST_DECL output_format report_format(); BOOST_TEST_DECL output_format log_format(); BOOST_TEST_DECL std::ostream* report_sink(); BOOST_TEST_DECL std::ostream* log_sink(); BOOST_TEST_DECL long detect_memory_leaks(); BOOST_TEST_DECL int random_seed(); } // namespace runtime_config } // namespace unit_test } // namespace boost //____________________________________________________________________________// #include <boost/test/detail/enable_warnings.hpp> #endif // BOOST_TEST_UNIT_TEST_PARAMETERS_HPP_071894GER
{ "pile_set_name": "Github" }
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package expressions type T struct { x, y, z int } var ( a, b, c, d, e int under_bar int longIdentifier1, longIdentifier2, longIdentifier3 int t0, t1, t2 T s string p *int ) func _() { // no spaces around simple or parenthesized expressions _ = (a+0) _ = a+b _ = a+b+c _ = a+b-c _ = a-b-c _ = a+(b*c) _ = a+(b/c) _ = a-(b%c) _ = 1+a _ = a+1 _ = a+b+1 _ = s[a] _ = s[a:] _ = s[:b] _ = s[1:2] _ = s[a:b] _ = s[0:len(s)] _ = s[0]<<1 _ = (s[0]<<1)&0xf _ = s[0] << 2 | s[1] >> 4 _ = "foo"+s _ = s+"foo" _ = 'a'+'b' _ = len(s)/2 _ = len(t0.x)/a // spaces around expressions of different precedence or expressions containing spaces _ = a + -b _ = a - ^b _ = a / *p _ = a + b*c _ = 1 + b*c _ = a + 2*c _ = a + c*2 _ = 1 + 2*3 _ = s[1 : 2*3] _ = s[a : b-c] _ = s[0:] _ = s[a+b] _ = s[: b-c] _ = s[a+b :] _ = a[a<<b+1] _ = a[a<<b+1 :] _ = s[a+b : len(s)] _ = s[len(s) : -a] _ = s[a : len(s)+1] _ = s[a : len(s)+1]+s // spaces around operators with equal or lower precedence than comparisons _ = a == b _ = a != b _ = a > b _ = a >= b _ = a < b _ = a <= b _ = a < b && c > d _ = a < b || c > d // spaces around "long" operands _ = a + longIdentifier1 _ = longIdentifier1 + a _ = longIdentifier1 + longIdentifier2 * longIdentifier3 _ = s + "a longer string" // some selected cases _ = a + t0.x _ = a + t0.x + t1.x * t2.x _ = a + b + c + d + e + 2*3 _ = a + b + c + 2*3 + d + e _ = (a+b+c)*2 _ = a - b + c - d + (a+b+c) + d&e _ = under_bar-1 _ = Open(dpath + "/file", O_WRONLY | O_CREAT, 0666) _ = int(c0&_Mask4)<<18 | int(c1&_Maskx)<<12 | int(c2&_Maskx)<<6 | int(c3&_Maskx) // test case for issue 8021 // want: // ([]bool{})[([]int{})[((1)+(((1)+((((1)*(((1)+(1))+(1)))+(1))*(1)))+(1)))]] _ = ([]bool{})[([]int{})[((1) + (((((1) + (((((((1) * (((((1) + (1))) + (1))))) + (1))) * (1))))) + (1))))]] // the parser does not restrict expressions that may appear as statements true 42 "foo" x (x) a+b a+b+c a+(b*c) a+(b/c) 1+a a+1 s[a] x<<1 (s[0]<<1)&0xf "foo"+s x == y x < y || z > 42 } // slice expressions with cap func _() { _ = x[a:b:c] _ = x[a:b:c+d] _ = x[a:b+d:c] _ = x[a:b+d:c+d] _ = x[a+d:b:c] _ = x[a+d:b:c+d] _ = x[a+d:b+d:c] _ = x[a+d:b+d:c+d] _ = x[:b:c] _ = x[:b:c+d] _ = x[:b+d:c] _ = x[:b+d:c+d] } func issue22111() { _ = x[:] _ = x[:b] _ = x[:b+1] _ = x[a:] _ = x[a+1:] _ = x[a:b] _ = x[a+1:b] _ = x[a:b+1] _ = x[a+1:b+1] _ = x[:b:c] _ = x[:b+1:c] _ = x[:b:c+1] _ = x[:b+1:c+1] _ = x[a:b:c] _ = x[a+1:b:c] _ = x[a:b+1:c] _ = x[a+1:b+1:c] _ = x[a:b:c+1] _ = x[a+1:b:c+1] _ = x[a:b+1:c+1] _ = x[a+1:b+1:c+1] } func _() { _ = a+b _ = a+b+c _ = a+b*c _ = a+(b*c) _ = (a+b)*c _ = a+(b*c*d) _ = a+(b*c+d) _ = 1<<x _ = -1<<x _ = 1<<x-1 _ = -1<<x-1 _ = f(a+b) _ = f(a+b+c) _ = f(a+b*c) _ = f(a+(b*c)) _ = f(1<<x-1, 1<<x-2) _ = 1<<d.logWindowSize-1 buf = make(x, 2*cap(b.buf) + n) dst[i*3+2] = dbuf[0]<<2 dst[i*3+2] = dbuf[0]<<2 | dbuf[1]>>4 b.buf = b.buf[0:b.off+m+n] b.buf = b.buf[0:b.off+m*n] f(b.buf[0:b.off+m+n]) signed += ' '*8 tw.octal(header[148:155], chksum) _ = x > 0 && i >= 0 x1, x0 := x>>w2, x&m2 z0 = t1<<w2+t0 z1 = (t1+t0>>w2)>>w2 q1, r1 := x1/d1, x1%d1 r1 = r1*b2 | x0>>w2 x1 = (x1<<z)|(x0>>(uint(w)-z)) x1 = x1<<z | x0>>(uint(w)-z) _ = buf[0:len(buf)+1] _ = buf[0:n+1] a,b = b,a a = b+c a = b*c+d _ = a*b+c _ = a-b-c _ = a-(b-c) _ = a-b*c _ = a-(b*c) _ = a*b/c _ = a/ *b _ = x[a|^b] _ = x[a/ *b] _ = a& ^b _ = a+ +b _ = a- -b _ = x[a*-b] _ = x[a+ +b] _ = x^y^z _ = b[a>>24] ^ b[(a>>16)&0xFF] ^ b[(a>>8)&0xFF] ^ b[a&0xFF] _ = len(longVariableName)*2 _ = token(matchType + xlength<<lengthShift + xoffset) } func f(x int, args ...int) { f(0, args...) f(1, args) f(2, args[0]) // make sure syntactically legal code remains syntactically legal f(3, 42 ...) // a blank must remain between 42 and ... f(4, 42. ...) f(5, 42....) f(6, 42.0 ...) f(7, 42.0...) f(8, .42 ...) f(9, .42...) f(10, 42e0 ...) f(11, 42e0...) _ = 42 .x // a blank must remain between 42 and .x _ = 42. .x _ = 42..x _ = 42.0 .x _ = 42.0.x _ = .42 .x _ = .42.x _ = 42e0 .x _ = 42e0.x // a blank must remain between the binary operator and the 2nd operand _ = x/ *y _ = x< -1 _ = x< <-1 _ = x+ +1 _ = x- -1 _ = x& &x _ = x& ^x _ = f(x/ *y, x< -1, x< <-1, x+ +1, x- -1, x& &x, x& ^x) } func _() { _ = T{} _ = struct{}{} _ = [10]T{} _ = [...]T{} _ = []T{} _ = map[int]T{} } // one-line structs/interfaces in composite literals (up to a threshold) func _() { _ = struct{}{} _ = struct{ x int }{0} _ = struct{ x, y, z int }{0, 1, 2} _ = struct{ int }{0} _ = struct{ s struct { int } }{struct{ int}{0} } _ = (interface{})(nil) _ = (interface{String() string})(nil) _ = (interface{ String() string })(nil) _ = (interface{fmt.Stringer})(nil) _ = (interface{ fmt.Stringer })(nil) } func _() { // do not modify literals _ = "tab1 tab2 tab3 end" // string contains 3 tabs _ = "tab1 tab2 tab3 end" // same string with 3 blanks - may be unaligned because editors see tabs in strings _ = "" // this comment should be aligned with the one on the previous line _ = `` _ = ` ` _ = `foo bar` _ = `three spaces before the end of the line starting here: they must not be removed` } func _() { // smart handling of indentation for multi-line raw strings var _ = `` var _ = `foo` var _ = `foo bar` var _ = `` var _ = `foo` var _ = // the next line should remain indented `foo bar` var _ = // comment `` var _ = // comment `foo` var _ = // comment // the next line should remain indented `foo bar` var _ = /* comment */ `` var _ = /* comment */ `foo` var _ = /* comment */ `foo bar` var _ = /* comment */ `` var _ = /* comment */ `foo` var _ = /* comment */ // the next line should remain indented `foo bar` var board = []int( `........... ........... ....●●●.... ....●●●.... ..●●●●●●●.. ..●●●○●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... `) var state = S{ "foo", // the next line should remain indented `........... ........... ....●●●.... ....●●●.... ..●●●●●●●.. ..●●●○●●●.. ..●●●●●●●.. ....●●●.... ....●●●.... ........... ........... `, "bar", } } func _() { // one-line function literals (body is on a single line) _ = func() {} _ = func() int { return 0 } _ = func(x, y int) bool { m := (x+y)/2; return m < 0 } // multi-line function literals (body is not on one line) _ = func() { } _ = func() int { return 0 } _ = func(x, y int) bool { m := (x+y)/2; return x < y } f(func() { }) f(func() int { return 0 }) f(func(x, y int) bool { m := (x+y)/2; return x < y }) } func _() { _ = [][]int { []int{1}, []int{1, 2}, []int{1, 2, 3}, } _ = [][]int { {1}, []int{1, 2}, []int{1, 2, 3}, } _ = [][]int { {1}, {1, 2}, {1, 2, 3}, } _ = [][]int {{1}, {1, 2}, {1, 2, 3}} } // various multi-line expressions func _() { // do not add extra indentation to multi-line string lists _ = "foo" + "bar" _ = "foo" + "bar" + "bah" _ = []string { "abc" + "def", "foo" + "bar", } } const _ = F1 + `string = "%s";` + `ptr = *;` + `datafmt.T2 = s ["-" p "-"];` const _ = `datafmt "datafmt";` + `default = "%v";` + `array = *;` + `datafmt.T3 = s {" " a a / ","};` const _ = `datafmt "datafmt";` + `default = "%v";` + `array = *;` + `datafmt.T3 = s {" " a a / ","};` func _() { _ = F1 + `string = "%s";` + `ptr = *;` + `datafmt.T2 = s ["-" p "-"];` _ = `datafmt "datafmt";` + `default = "%v";` + `array = *;` + `datafmt.T3 = s {" " a a / ","};` _ = `datafmt "datafmt";` + `default = "%v";` + `array = *;` + `datafmt.T3 = s {" " a a / ","};` } func _() { // respect source lines in multi-line expressions _ = a+ b+ c _ = a < b || b < a _ = "933262154439441526816992388562667004907159682643816214685929" + "638952175999932299156089414639761565182862536979208272237582" + "51185210916864000000000000000000000000" // 100! _ = "170141183460469231731687303715884105727" // prime } // Alignment after overlong lines const ( _ = "991" _ = "2432902008176640000" // 20! _ = "933262154439441526816992388562667004907159682643816214685929" + "638952175999932299156089414639761565182862536979208272237582" + "51185210916864000000000000000000000000" // 100! _ = "170141183460469231731687303715884105727" // prime ) // Correct placement of operators and comments in multi-line expressions func _() { _ = a + // comment b + // comment c _ = "a" + "b" + // comment "c" _ = "ba0408" + "7265717569726564" // field 71, encoding 2, string "required" } // Correct placement of terminating comma/closing parentheses in multi-line calls. func _() { f(1, 2, 3) f(1, 2, 3, ) f(1, 2, 3) // comment f(1, 2, 3, // comment ) f(1, 2, 3)// comment f(1, 2, 3,// comment ) } // Align comments in multi-line lists of single-line expressions. var txpix = [NCOL]draw.Color{ draw.Yellow, // yellow draw.Cyan, // cyan draw.Green, // lime green draw.GreyBlue, // slate draw.Red, /* red */ draw.GreyGreen, /* olive green */ draw.Blue, /* blue */ draw.Color(0xFF55AAFF), /* pink */ draw.Color(0xFFAAFFFF), /* lavender */ draw.Color(0xBB005DFF), /* maroon */ } func same(t, u *Time) bool { // respect source lines in multi-line expressions return t.Year == u.Year && t.Month == u.Month && t.Day == u.Day && t.Hour == u.Hour && t.Minute == u.Minute && t.Second == u.Second && t.Weekday == u.Weekday && t.ZoneOffset == u.ZoneOffset && t.Zone == u.Zone } func (p *parser) charClass() { // respect source lines in multi-line expressions if cc.negate && len(cc.ranges) == 2 && cc.ranges[0] == '\n' && cc.ranges[1] == '\n' { nl := new(_NotNl) p.re.add(nl) } } func addState(s []state, inst instr, match []int) { // handle comments correctly in multi-line expressions for i := 0; i < l; i++ { if s[i].inst.index() == index && // same instruction s[i].match[0] < pos { // earlier match already going; leftmost wins return s } } } func (self *T) foo(x int) *T { return self } func _() { module.Func1().Func2() } func _() { _ = new(T). foo(1). foo(2). foo(3) _ = new(T). foo(1). foo(2). // inline comments foo(3) _ = new(T).foo(1).foo(2).foo(3) // handle multiline argument list correctly _ = new(T). foo( 1). foo(2) _ = new(T).foo( 1).foo(2) _ = Array[3 + 4] _ = Method(1, 2, 3) _ = new(T). foo(). bar() . (*Type) _ = new(T). foo(). bar().(*Type). baz() _ = new(T). foo(). bar()["idx"] _ = new(T). foo(). bar()["idx"] . baz() _ = new(T). foo(). bar()[1:2] _ = new(T). foo(). bar()[1:2]. baz() _ = new(T). Field. Array[3+ 4]. Table ["foo"]. Blob. (*Type). Slices[1:4]. Method(1, 2, 3). Thingy _ = a.b.c _ = a. b. c _ = a.b().c _ = a. b(). c _ = a.b[0].c _ = a. b[0]. c _ = a.b[0:].c _ = a. b[0:]. c _ = a.b.(T).c _ = a. b. (T). c } // Don't introduce extra newlines in strangely formatted expression lists. func f() { // os.Open parameters should remain on two lines if writer, err = os.Open(outfile, s.O_WRONLY|os.O_CREATE| os.O_TRUNC, 0666); err != nil { log.Fatal(err) } } // Handle multi-line argument lists ending in ... correctly. // Was issue 3130. func _() { _ = append(s, a...) _ = append( s, a...) _ = append(s, a...) _ = append( s, a...) _ = append(s, a..., ) _ = append(s, a..., ) _ = append( s, a..., ) } // Literal function types in conversions must be parenthesized; // for now go/parser accepts the unparenthesized form where it // is non-ambiguous. func _() { // these conversions should be rewritten to look // the same as the parenthesized conversions below _ = func()()(nil) _ = func(x int)(float)(nil) _ = func() func() func()()(nil) _ = (func()())(nil) _ = (func(x int)(float))(nil) _ = (func() func() func()())(nil) } func _() { _ = f(). f(func() { f() }). f(map[int]int{ 1: 2, 3: 4, }) _ = f(). f( func() { f() }, ) }
{ "pile_set_name": "Github" }
/***************************************************************** * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. ****************************************************************/ package org.apache.cayenne.access; import java.sql.Types; import java.util.List; import java.util.Map; import org.apache.cayenne.di.Inject; import org.apache.cayenne.query.ObjectSelect; import org.apache.cayenne.query.Ordering; import org.apache.cayenne.query.SortOrder; import org.apache.cayenne.test.jdbc.DBHelper; import org.apache.cayenne.test.jdbc.TableHelper; import org.apache.cayenne.testdo.locking.RelLockingTestEntity; import org.apache.cayenne.testdo.locking.SimpleLockingTestEntity; import org.apache.cayenne.unit.di.server.CayenneProjects; import org.apache.cayenne.unit.di.server.ServerCase; import org.apache.cayenne.unit.di.server.UseServerRuntime; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; @UseServerRuntime(CayenneProjects.LOCKING_PROJECT) public class OptimisticLockingIT extends ServerCase { @Inject protected DataContext context; @Inject protected DBHelper dbHelper; protected TableHelper tSimpleLockingTest; protected TableHelper tRelLockingTest; protected TableHelper tLockingHelper; @Before public void setUp() throws Exception { tSimpleLockingTest = new TableHelper(dbHelper, "SIMPLE_LOCKING_TEST"); tSimpleLockingTest.setColumns("LOCKING_TEST_ID", "NAME", "DESCRIPTION", "INT_COLUMN_NOTNULL") .setColumnTypes(Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER); tRelLockingTest = new TableHelper(dbHelper, "REL_LOCKING_TEST"); tRelLockingTest.setColumns( "REL_LOCKING_TEST_ID", "SIMPLE_LOCKING_TEST_ID", "NAME"); tLockingHelper = new TableHelper(dbHelper, "LOCKING_HELPER"); tLockingHelper.setColumns("LOCKING_HELPER_ID", "REL_LOCKING_TEST_ID", "NAME"); } protected void createSimpleLockingDataSet() throws Exception { tSimpleLockingTest.insert(1, "LockTest1", null, 1); } protected void createLockingOnNullDataSet() throws Exception { tSimpleLockingTest.insert(1, null, null, 0); } protected void createLockingOnMixedDataSet() throws Exception { tSimpleLockingTest.insert(1, null, null, 1); tSimpleLockingTest.insert(2, "LockTest2", null, 2); tSimpleLockingTest.insert(3, "LockTest3", "Another Lock Test", 3); } protected void createLockingOnToOneDataSet() throws Exception { tSimpleLockingTest.insert(1, "LockTest1", null, 2); tRelLockingTest.insert(5, 1, "Rel Test 1"); tLockingHelper.insert(1, 5, "Locking Helper 1"); } protected void createSimpleLockUpdate() throws Exception { assertEquals(1, tSimpleLockingTest .update() .set("NAME", "LockTest1Updated") .where("LOCKING_TEST_ID", 1) .execute()); } protected void createRelLockUpdate() throws Exception { tRelLockingTest.update().set("SIMPLE_LOCKING_TEST_ID", 1).where( "REL_LOCKING_TEST_ID", 5).execute(); } protected void createSimpleLockDelete() throws Exception { tSimpleLockingTest.delete().execute(); } @Test public void testSuccessSimpleLockingOnDelete() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); context.deleteObjects(object); context.commitChanges(); } @Test public void testSuccessSimpleLockingOnDeleteFollowedByInvalidate() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); context.deleteObjects(object); context.invalidateObjects(object); context.commitChanges(); } @Test public void testSuccessSimpleLockingOnDeleteFollowedByForgetSnapshot() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); context.deleteObjects(object); context.getObjectStore().getDataRowCache().forgetSnapshot(object.getObjectId()); context.commitChanges(); } @Test public void testSuccessSimpleLockingOnDeletePrecededByInvalidate() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); context.invalidateObjects(object); context.deleteObjects(object); context.commitChanges(); } @Test public void testSuccessSimpleLockingOnDeletePrecededByForgetSnapshot() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); context.getObjectStore().getDataRowCache().forgetSnapshot(object.getObjectId()); context.deleteObjects(object); context.commitChanges(); } @Test public void testFailSimpleLockingOnDelete() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("second update"); context.commitChanges(); // change row underneath, delete and save... optimistic lock failure expected createSimpleLockUpdate(); context.deleteObjects(object); try { context.commitChanges(); fail("Optimistic lock failure expected."); } catch (OptimisticLockException ex) { // optimistic lock failure expected... } } @Test public void testSuccessSimpleLockingOnUpdate() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); object.setDescription("second update"); context.commitChanges(); } @Test public void testSuccessSimpleLockingNullablePrimitiveColumn() throws Exception { createSimpleLockingDataSet(); SimpleLockingTestEntity object = ObjectSelect.query(SimpleLockingTestEntity.class).selectOne(context); // we should have NULL value in primitive column assertEquals(0, object.getIntColumnNull()); assertNull(object.readPropertyDirectly("intColumnNull")); // change object and save... no optimistic lock failure expected object.setDescription("first update"); object.setIntColumnNotnull(2); context.commitChanges(); // update values once more object.setDescription("second update"); object.setIntColumnNull(3); context.commitChanges(); } @Test public void testSuccessSimpleLockingOnUpdateFollowedByInvalidate() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); object.setDescription("second update"); context.invalidateObjects(object); context.commitChanges(); } @Test public void testSuccessSimpleLockingOnUpdatePrecededByInvalidate() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); context.invalidateObjects(object); object.setDescription("second update"); context.commitChanges(); } @Test public void testSuccessSimpleLockingOnUpdateFollowedByForgetSnapshot() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); object.setDescription("second update"); context.getObjectStore().getDataRowCache().forgetSnapshot(object.getObjectId()); context.commitChanges(); } @Test public void testSuccessSimpleLockingOnUpdatePrecededByForgetSnapshot() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); context.getObjectStore().getDataRowCache().forgetSnapshot(object.getObjectId()); object.setDescription("second update"); context.commitChanges(); } @Test public void testFailSimpleLocking() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected object.setDescription("first update"); context.commitChanges(); // change row underneath, change description and save... optimistic lock failure // expected createSimpleLockUpdate(); object.setDescription("second update"); try { context.commitChanges(); fail("Optimistic lock failure expected."); } catch (OptimisticLockException ex) { // optimistic lock failure expected... } } @Test public void testFailLockingOnNull() throws Exception { createLockingOnNullDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); // change description and save... no optimistic lock failure expected... object.setDescription("first update"); context.commitChanges(); // change row underneath, change description and save... optimistic lock failure // expected createSimpleLockUpdate(); object.setDescription("second update"); try { context.commitChanges(); fail("Optimistic lock failure expected."); } catch (OptimisticLockException ex) { // optimistic lock failure expected... assertEquals(object.getObjectId(), ex.getFailedObjectId()); } } @Test public void testSuccessLockingOnMixed() throws Exception { createLockingOnMixedDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect.query(SimpleLockingTestEntity.class) .orderBy(new Ordering("db:LOCKING_TEST_ID", SortOrder.ASCENDING)) .select(context); assertEquals(3, allObjects.size()); SimpleLockingTestEntity object1 = allObjects.get(0); SimpleLockingTestEntity object2 = allObjects.get(1); SimpleLockingTestEntity object3 = allObjects.get(2); // change description and save... no optimistic lock failure expected... object1.setDescription("first update for object1"); object2.setDescription("first update for object2"); object3.setName("object3 - new name"); context.commitChanges(); // TODO: it would be nice to pick inside DataContext to see that 3 batches where // generated... // this requires refactoring of ContextCommit. } @Test public void testSuccessLockingOnToOneNull() throws Exception { createLockingOnToOneDataSet(); List<RelLockingTestEntity> allObjects = ObjectSelect .query(RelLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); RelLockingTestEntity object = allObjects.get(0); // set to-one relationship to null and save SimpleLockingTestEntity object1 = object.getToSimpleLockingTest(); object.setToSimpleLockingTest(null); context.commitChanges(); // change to-one relationship to non-null and save... should lock on null value object.setToSimpleLockingTest(object1); context.commitChanges(); } @Test public void testFailLockingOnToOne() throws Exception { createLockingOnToOneDataSet(); List<RelLockingTestEntity> allObjects = ObjectSelect .query(RelLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); RelLockingTestEntity object = allObjects.get(0); // change name and save... no optimistic lock failure expected object.setName("first update"); context.commitChanges(); // change relationship and save... no optimistic lock failure expected SimpleLockingTestEntity object1 = context .newObject(SimpleLockingTestEntity.class); object.setToSimpleLockingTest(object1); context.commitChanges(); // change row underneath, change description and save... optimistic lock failure // expected createRelLockUpdate(); object.setName("third update"); try { context.commitChanges(); fail("Optimistic lock failure expected."); } catch (OptimisticLockException ex) { // optimistic lock failure expected... } } @Test public void testFailRetrieveRow() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); object.setDescription("first update"); // change row underneath, change description and save... optimistic lock failure // expected createSimpleLockUpdate(); try { context.commitChanges(); fail("Optimistic lock failure expected."); } catch (OptimisticLockException ex) { Map<?, ?> freshFailedRow = ex.getFreshSnapshot(context); assertNotNull(freshFailedRow); assertEquals("LockTest1Updated", freshFailedRow.get("NAME")); } } @Test public void testFailRetrieveDeletedRow() throws Exception { createSimpleLockingDataSet(); List<SimpleLockingTestEntity> allObjects = ObjectSelect .query(SimpleLockingTestEntity.class) .select(context); assertEquals(1, allObjects.size()); SimpleLockingTestEntity object = allObjects.get(0); object.setDescription("first update"); // delete row underneath, change description and save... optimistic lock failure // expected createSimpleLockDelete(); try { context.commitChanges(); fail("Optimistic lock failure expected."); } catch (OptimisticLockException ex) { Map<?, ?> freshFailedRow = ex.getFreshSnapshot(context); assertNull("" + freshFailedRow, freshFailedRow); } } }
{ "pile_set_name": "Github" }
{ "type": "File", "start": 0, "end": 18, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 18 } }, "program": { "type": "Program", "start": 0, "end": 18, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 18 } }, "sourceType": "script", "body": [ { "type": "ExpressionStatement", "start": 0, "end": 18, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 18 } }, "expression": { "type": "JSXElement", "start": 0, "end": 18, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 18 } }, "openingElement": { "type": "JSXOpeningElement", "start": 0, "end": 5, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 5 } }, "attributes": [], "name": { "type": "JSXIdentifier", "start": 1, "end": 4, "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 4 } }, "name": "div" }, "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", "start": 12, "end": 18, "loc": { "start": { "line": 1, "column": 12 }, "end": { "line": 1, "column": 18 } }, "name": { "type": "JSXIdentifier", "start": 14, "end": 17, "loc": { "start": { "line": 1, "column": 14 }, "end": { "line": 1, "column": 17 } }, "name": "div" } }, "children": [ { "type": "JSXExpressionContainer", "start": 5, "end": 12, "loc": { "start": { "line": 1, "column": 5 }, "end": { "line": 1, "column": 12 } }, "expression": { "type": "ObjectExpression", "start": 7, "end": 10, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 10 } }, "properties": [ { "type": "ObjectProperty", "start": 8, "end": 9, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 9 } }, "method": false, "computed": false, "key": { "type": "Identifier", "start": 8, "end": 9, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 9 }, "identifierName": "a" }, "name": "a" }, "shorthand": true, "value": { "type": "Identifier", "start": 8, "end": 9, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 9 }, "identifierName": "a" }, "name": "a" }, "extra": { "shorthand": true } } ] } } ] } } ], "directives": [] } }
{ "pile_set_name": "Github" }