text
stringlengths
2
1.04M
meta
dict
/* Layout helpers ----------------------------------*/ .ui-helper-hidden { display: none; } .ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } .ui-helper-clearfix:after { clear: both; } .ui-helper-clearfix { min-height: 0; /* support: IE7 */ } .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } .ui-front { z-index: 100; } /* Interaction Cues ----------------------------------*/ .ui-state-disabled { cursor: default !important; } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } /* Misc visuals ----------------------------------*/ /* Overlays */ .ui-widget-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; } .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; min-height: 0; /* support: IE7 */ } .ui-accordion .ui-accordion-icons { padding-left: 2.2em; } .ui-accordion .ui-accordion-noicons { padding-left: .7em; } .ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; } .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; } .ui-autocomplete { position: absolute; top: 0; left: 0; cursor: default; } .ui-button { display: inline-block; position: relative; padding: 0; line-height: normal; margin-right: .1em; cursor: pointer; vertical-align: middle; text-align: center; overflow: visible; /* removes extra width in IE */ } .ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; } /* to make room for the icon, a width needs to be set here */ .ui-button-icon-only { width: 2.2em; } /* button elements seem to need a little more width */ button.ui-button-icon-only { width: 2.4em; } .ui-button-icons-only { width: 3.4em; } button.ui-button-icons-only { width: 3.7em; } /* button text element */ .ui-button .ui-button-text { display: block; line-height: normal; } .ui-button-text-only .ui-button-text { padding: .4em 1em; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } /* no icon support for input elements, provide padding by default */ input.ui-button { padding: .4em 1em; } /* button icon element(s) */ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } /* button sets */ .ui-buttonset { margin-right: 7px; } .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } /* workarounds */ /* reset extra padding in Firefox, see h5bp.com/l */ input.ui-button::-moz-focus-inner, button.ui-button::-moz-focus-inner { border: 0; padding: 0; } .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; z-index: 9999; } .ui-datepicker .ui-datepicker-header { position: relative; padding: .2em 0; } .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position: absolute; top: 2px; width: 1.8em; height: 1.8em; } .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } .ui-datepicker .ui-datepicker-prev { left: 2px; } .ui-datepicker .ui-datepicker-next { right: 2px; } .ui-datepicker .ui-datepicker-prev-hover { left: 1px; } .ui-datepicker .ui-datepicker-next-hover { right: 1px; } .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } .ui-datepicker .ui-datepicker-title select { font-size: 1em; margin: 1px 0; } .ui-datepicker select.ui-datepicker-month-year { width: 100%; } .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 49%; } .ui-datepicker table { width: 100%; font-size: .9em; border-collapse: collapse; margin: 0 0 .4em; } .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } .ui-datepicker td { border: 0; padding: 1px; } .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding: 0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width: auto; overflow: visible; } .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float: left; } /* with multiple calendars */ .ui-datepicker.ui-datepicker-multi { width: auto; } .ui-datepicker-multi .ui-datepicker-group { float: left; } .ui-datepicker-multi .ui-datepicker-group table { width: 95%; margin: 0 auto .4em; } .ui-datepicker-multi-2 .ui-datepicker-group { width: 50%; } .ui-datepicker-multi-3 .ui-datepicker-group { width: 33.3%; } .ui-datepicker-multi-4 .ui-datepicker-group { width: 25%; } .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width: 0; } .ui-datepicker-multi .ui-datepicker-buttonpane { clear: left; } .ui-datepicker-row-break { clear: both; width: 100%; font-size: 0; } /* RTL support */ .ui-datepicker-rtl { direction: rtl; } .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } .ui-datepicker-rtl .ui-datepicker-buttonpane { clear: right; } .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, .ui-datepicker-rtl .ui-datepicker-group { float: right; } .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width: 0; border-left-width: 1px; } .ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; outline: 0; } .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } .ui-dialog .ui-dialog-title { float: left; margin: .1em 0; white-space: nowrap; width: 90%; overflow: hidden; text-overflow: ellipsis; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 21px; margin: -10px 0 0 0; padding: 1px; height: 20px; } .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; } .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin-top: .5em; padding: .3em 1em .5em .4em; } .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } .ui-dialog .ui-resizable-se { width: 12px; height: 12px; right: -5px; bottom: -5px; background-position: 16px 16px; } .ui-draggable .ui-dialog-titlebar { cursor: move; } .ui-menu { list-style: none; padding: 2px; margin: 0; display: block; outline: none; } .ui-menu .ui-menu { margin-top: -3px; position: absolute; } .ui-menu .ui-menu-item { margin: 0; padding: 0; width: 100%; } .ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; } .ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; min-height: 0; /* support: IE7 */ font-weight: normal; } .ui-menu .ui-menu-item a.ui-state-focus, .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; } .ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; } .ui-menu .ui-state-disabled a { cursor: default; } /* icon support */ .ui-menu-icons { position: relative; } .ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; } /* left-aligned */ .ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; } /* right-aligned */ .ui-menu .ui-menu-icon { position: static; float: right; } .ui-progressbar { height: 2em; text-align: left; overflow: hidden; } .ui-progressbar .ui-progressbar-value { margin: -1px; height: 100%; } .ui-progressbar .ui-progressbar-overlay { background: url("images/animated-overlay.gif"); height: 100%; filter: alpha(opacity=25); opacity: 0.25; } .ui-progressbar-indeterminate .ui-progressbar-value { background-image: none; } .ui-resizable { position: relative; } .ui-resizable-handle { position: absolute; font-size: 0.1px; display: block; } .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px; } .ui-selectable-helper { position: absolute; z-index: 100; border: 1px dotted black; } .ui-slider { position: relative; text-align: left; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } /* For IE8 - See #6727 */ .ui-slider.ui-state-disabled .ui-slider-handle, .ui-slider.ui-state-disabled .ui-slider-range { filter: inherit; } .ui-slider-horizontal { height: .8em; } .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } .ui-slider-horizontal .ui-slider-range-min { left: 0; } .ui-slider-horizontal .ui-slider-range-max { right: 0; } .ui-slider-vertical { width: .8em; height: 100px; } .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } .ui-slider-vertical .ui-slider-range-min { bottom: 0; } .ui-slider-vertical .ui-slider-range-max { top: 0; } .ui-spinner { position: relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; } .ui-spinner-input { border: none; background: none; color: inherit; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; } .ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; } /* more specificity required here to overide default borders */ .ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* vertical centre icon */ .ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } .ui-spinner-up { top: 0; } .ui-spinner-down { bottom: 0; } /* TR overrides */ .ui-spinner .ui-icon-triangle-1-s { /* need to fix icons sprite */ background-position: -65px -16px; } .ui-tabs { position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ padding: .2em; } .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; } .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; } .ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; } .ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } .ui-tooltip { padding: 8px; position: absolute; z-index: 9999; max-width: 300px; -webkit-box-shadow: 0 0 5px #aaa; box-shadow: 0 0 5px #aaa; } body .ui-tooltip { border-width: 2px; } /* Component containers ----------------------------------*/ .ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; } .ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; } .ui-widget-content a { color: #222222/*{fcContent}*/; } .ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; } .ui-widget-header a { color: #222222/*{fcHeader}*/; } /* Interaction states ----------------------------------*/ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; } .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121/*{fcHover}*/; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; } /* Interaction Cues ----------------------------------*/ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a, .ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; } .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } .ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ } /* Icons ----------------------------------*/ /* states and images */ .ui-icon { width: 16px; height: 16px; background-position: 16px 16px; } .ui-icon, .ui-widget-content .ui-icon { background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } .ui-widget-header .ui-icon { background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon { background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } .ui-state-active .ui-icon { background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } .ui-state-highlight .ui-icon { background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } .ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } .ui-icon-carat-1-se { background-position: -48px 0; } .ui-icon-carat-1-s { background-position: -64px 0; } .ui-icon-carat-1-sw { background-position: -80px 0; } .ui-icon-carat-1-w { background-position: -96px 0; } .ui-icon-carat-1-nw { background-position: -112px 0; } .ui-icon-carat-2-n-s { background-position: -128px 0; } .ui-icon-carat-2-e-w { background-position: -144px 0; } .ui-icon-triangle-1-n { background-position: 0 -16px; } .ui-icon-triangle-1-ne { background-position: -16px -16px; } .ui-icon-triangle-1-e { background-position: -32px -16px; } .ui-icon-triangle-1-se { background-position: -48px -16px; } .ui-icon-triangle-1-s { background-position: -64px -16px; } .ui-icon-triangle-1-sw { background-position: -80px -16px; } .ui-icon-triangle-1-w { background-position: -96px -16px; } .ui-icon-triangle-1-nw { background-position: -112px -16px; } .ui-icon-triangle-2-n-s { background-position: -128px -16px; } .ui-icon-triangle-2-e-w { background-position: -144px -16px; } .ui-icon-arrow-1-n { background-position: 0 -32px; } .ui-icon-arrow-1-ne { background-position: -16px -32px; } .ui-icon-arrow-1-e { background-position: -32px -32px; } .ui-icon-arrow-1-se { background-position: -48px -32px; } .ui-icon-arrow-1-s { background-position: -64px -32px; } .ui-icon-arrow-1-sw { background-position: -80px -32px; } .ui-icon-arrow-1-w { background-position: -96px -32px; } .ui-icon-arrow-1-nw { background-position: -112px -32px; } .ui-icon-arrow-2-n-s { background-position: -128px -32px; } .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } .ui-icon-arrow-2-e-w { background-position: -160px -32px; } .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } .ui-icon-arrowstop-1-n { background-position: -192px -32px; } .ui-icon-arrowstop-1-e { background-position: -208px -32px; } .ui-icon-arrowstop-1-s { background-position: -224px -32px; } .ui-icon-arrowstop-1-w { background-position: -240px -32px; } .ui-icon-arrowthick-1-n { background-position: 0 -48px; } .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } .ui-icon-arrowthick-1-e { background-position: -32px -48px; } .ui-icon-arrowthick-1-se { background-position: -48px -48px; } .ui-icon-arrowthick-1-s { background-position: -64px -48px; } .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } .ui-icon-arrowthick-1-w { background-position: -96px -48px; } .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } .ui-icon-arrow-4 { background-position: 0 -80px; } .ui-icon-arrow-4-diag { background-position: -16px -80px; } .ui-icon-extlink { background-position: -32px -80px; } .ui-icon-newwin { background-position: -48px -80px; } .ui-icon-refresh { background-position: -64px -80px; } .ui-icon-shuffle { background-position: -80px -80px; } .ui-icon-transfer-e-w { background-position: -96px -80px; } .ui-icon-transferthick-e-w { background-position: -112px -80px; } .ui-icon-folder-collapsed { background-position: 0 -96px; } .ui-icon-folder-open { background-position: -16px -96px; } .ui-icon-document { background-position: -32px -96px; } .ui-icon-document-b { background-position: -48px -96px; } .ui-icon-note { background-position: -64px -96px; } .ui-icon-mail-closed { background-position: -80px -96px; } .ui-icon-mail-open { background-position: -96px -96px; } .ui-icon-suitcase { background-position: -112px -96px; } .ui-icon-comment { background-position: -128px -96px; } .ui-icon-person { background-position: -144px -96px; } .ui-icon-print { background-position: -160px -96px; } .ui-icon-trash { background-position: -176px -96px; } .ui-icon-locked { background-position: -192px -96px; } .ui-icon-unlocked { background-position: -208px -96px; } .ui-icon-bookmark { background-position: -224px -96px; } .ui-icon-tag { background-position: -240px -96px; } .ui-icon-home { background-position: 0 -112px; } .ui-icon-flag { background-position: -16px -112px; } .ui-icon-calendar { background-position: -32px -112px; } .ui-icon-cart { background-position: -48px -112px; } .ui-icon-pencil { background-position: -64px -112px; } .ui-icon-clock { background-position: -80px -112px; } .ui-icon-disk { background-position: -96px -112px; } .ui-icon-calculator { background-position: -112px -112px; } .ui-icon-zoomin { background-position: -128px -112px; } .ui-icon-zoomout { background-position: -144px -112px; } .ui-icon-search { background-position: -160px -112px; } .ui-icon-wrench { background-position: -176px -112px; } .ui-icon-gear { background-position: -192px -112px; } .ui-icon-heart { background-position: -208px -112px; } .ui-icon-star { background-position: -224px -112px; } .ui-icon-link { background-position: -240px -112px; } .ui-icon-cancel { background-position: 0 -128px; } .ui-icon-plus { background-position: -16px -128px; } .ui-icon-plusthick { background-position: -32px -128px; } .ui-icon-minus { background-position: -48px -128px; } .ui-icon-minusthick { background-position: -64px -128px; } .ui-icon-close { background-position: -80px -128px; } .ui-icon-closethick { background-position: -96px -128px; } .ui-icon-key { background-position: -112px -128px; } .ui-icon-lightbulb { background-position: -128px -128px; } .ui-icon-scissors { background-position: -144px -128px; } .ui-icon-clipboard { background-position: -160px -128px; } .ui-icon-copy { background-position: -176px -128px; } .ui-icon-contact { background-position: -192px -128px; } .ui-icon-image { background-position: -208px -128px; } .ui-icon-video { background-position: -224px -128px; } .ui-icon-script { background-position: -240px -128px; } .ui-icon-alert { background-position: 0 -144px; } .ui-icon-info { background-position: -16px -144px; } .ui-icon-notice { background-position: -32px -144px; } .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } .ui-icon-radio-on { background-position: -96px -144px; } .ui-icon-radio-off { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-play { background-position: 0 -160px; } .ui-icon-pause { background-position: -16px -160px; } .ui-icon-seek-next { background-position: -32px -160px; } .ui-icon-seek-prev { background-position: -48px -160px; } .ui-icon-seek-end { background-position: -64px -160px; } .ui-icon-seek-start { background-position: -80px -160px; } /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ .ui-icon-seek-first { background-position: -80px -160px; } .ui-icon-stop { background-position: -96px -160px; } .ui-icon-eject { background-position: -112px -160px; } .ui-icon-volume-off { background-position: -128px -160px; } .ui-icon-volume-on { background-position: -144px -160px; } .ui-icon-power { background-position: 0 -176px; } .ui-icon-signal-diag { background-position: -16px -176px; } .ui-icon-signal { background-position: -32px -176px; } .ui-icon-battery-0 { background-position: -48px -176px; } .ui-icon-battery-1 { background-position: -64px -176px; } .ui-icon-battery-2 { background-position: -80px -176px; } .ui-icon-battery-3 { background-position: -96px -176px; } .ui-icon-circle-plus { background-position: 0 -192px; } .ui-icon-circle-minus { background-position: -16px -192px; } .ui-icon-circle-close { background-position: -32px -192px; } .ui-icon-circle-triangle-e { background-position: -48px -192px; } .ui-icon-circle-triangle-s { background-position: -64px -192px; } .ui-icon-circle-triangle-w { background-position: -80px -192px; } .ui-icon-circle-triangle-n { background-position: -96px -192px; } .ui-icon-circle-arrow-e { background-position: -112px -192px; } .ui-icon-circle-arrow-s { background-position: -128px -192px; } .ui-icon-circle-arrow-w { background-position: -144px -192px; } .ui-icon-circle-arrow-n { background-position: -160px -192px; } .ui-icon-circle-zoomin { background-position: -176px -192px; } .ui-icon-circle-zoomout { background-position: -192px -192px; } .ui-icon-circle-check { background-position: -208px -192px; } .ui-icon-circlesmall-plus { background-position: 0 -208px; } .ui-icon-circlesmall-minus { background-position: -16px -208px; } .ui-icon-circlesmall-close { background-position: -32px -208px; } .ui-icon-squaresmall-plus { background-position: -48px -208px; } .ui-icon-squaresmall-minus { background-position: -64px -208px; } .ui-icon-squaresmall-close { background-position: -80px -208px; } .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } .ui-icon-grip-solid-vertical { background-position: -32px -224px; } .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } .ui-icon-grip-diagonal-se { background-position: -80px -224px; } /* Misc visuals ----------------------------------*/ /* Corner radius */ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { border-top-left-radius: 0; } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { border-top-right-radius: 0; } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { border-bottom-left-radius: 0; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { border-bottom-right-radius: 0; } /* Overlays */ .ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3/*{opacityOverlay}*/; filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/; } .ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3/*{opacityShadow}*/; filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; }
{ "content_hash": "faaf5c3f4a01a086cc558a779d8ddd5c", "timestamp": "", "source": "github", "line_count": 1184, "max_line_length": 192, "avg_line_length": 26.78293918918919, "alnum_prop": 0.6879947021538267, "repo_name": "equella/Equella", "id": "d3634e85bbfbe35a1f8d996c1b33183270cd44ea", "size": "32205", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "Source/Plugins/Core/com.equella.core/resources/web/css/themes/equella/jquery-ui.css", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "402" }, { "name": "Batchfile", "bytes": "38432" }, { "name": "CSS", "bytes": "648823" }, { "name": "Dockerfile", "bytes": "2055" }, { "name": "FreeMarker", "bytes": "370046" }, { "name": "HTML", "bytes": "865667" }, { "name": "Java", "bytes": "27081020" }, { "name": "JavaScript", "bytes": "1673995" }, { "name": "PHP", "bytes": "821" }, { "name": "PLpgSQL", "bytes": "1363" }, { "name": "PureScript", "bytes": "307610" }, { "name": "Python", "bytes": "79871" }, { "name": "Scala", "bytes": "765981" }, { "name": "Shell", "bytes": "64170" }, { "name": "TypeScript", "bytes": "146564" }, { "name": "XSLT", "bytes": "510113" } ], "symlink_target": "" }
Requirements: - appserver.io - composer - bower - npm Installation (OSX): - go to /opt/appserver/webapps/ and git clone the repository, or create a symlink at /opt/appserver/webapps/ to the project folder - insert hosts into your /etc/hosts file: 127.0.0.1 angular-messages.dev - go to the project folder on the command line and use folllwing commands: - composer --no-interaction --prefer-dist --optimize-autoloader install - bower install - npm install - gulp -d - sudo /opt/appserver/sbin/appserverctl restart - go to your browser and open "http://angular-messages.dev:9080/app/" Now you should see a the angular app based on appserver.io, AngularJS 1.4.x and Zurb Foundation for Apps
{ "content_hash": "0324ef61444a4c23d8a047480abed54d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 130, "avg_line_length": 38.333333333333336, "alnum_prop": 0.7623188405797101, "repo_name": "FlorianHartl/angular-messages", "id": "87fb73c5aea0853d873763d0a78fd42948db59a1", "size": "736", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "18708" }, { "name": "HTML", "bytes": "8142" }, { "name": "JavaScript", "bytes": "11168" }, { "name": "PHP", "bytes": "5932" } ], "symlink_target": "" }
package org.apache.geode.internal.cache.extension; import static org.junit.Assert.*; import java.util.Iterator; import java.util.NoSuchElementException; import java.util.concurrent.atomic.AtomicInteger; import org.junit.Test; import org.junit.experimental.categories.Category; import org.apache.geode.cache.Cache; import org.apache.geode.internal.cache.xmlcache.XmlGenerator; import org.apache.geode.test.fake.Fakes; import org.apache.geode.test.junit.categories.UnitTest; /** * Unit tests for {@link SimpleExtensionPoint}. * * @since GemFire 8.1 */ @Category(UnitTest.class) public class SimpleExtensionPointJUnitTest { /** * Test method for {@link SimpleExtensionPoint#SimpleExtensionPoint(Extensible, Object)} . */ @Test public void testSimpleExtensionPoint() { final MockImpl m = new MockImpl(); assertSame(m.extensionPoint.extensible, m.extensionPoint.target); assertNotNull(m.extensionPoint.extensions); assertNotNull(m.extensionPoint.iterable); } /** * Test method for {@link SimpleExtensionPoint#getExtensions()} . */ @Test public void testGetExtensions() { final MockImpl m = new MockImpl(); assertEquals(0, m.extensionPoint.extensions.size()); assertTrue(!m.extensionPoint.iterable.iterator().hasNext()); final Iterable<Extension<MockInterface>> extensions = m.getExtensionPoint().getExtensions(); assertNotNull(extensions); // extensions should be empty final Iterator<Extension<MockInterface>> iterator = extensions.iterator(); assertTrue(!iterator.hasNext()); try { iterator.next(); fail("Expected NoSuchElementException."); } catch (NoSuchElementException e) { // ignore } } /** * Test method for {@link SimpleExtensionPoint#addExtension(Extension)} . */ @Test public void testAddExtension() { final MockImpl m = new MockImpl(); final MockExtension extension = new MockExtension(); m.getExtensionPoint().addExtension(extension); assertEquals(1, m.extensionPoint.extensions.size()); final Iterable<Extension<MockInterface>> extensions = m.getExtensionPoint().getExtensions(); assertNotNull(extensions); final Iterator<Extension<MockInterface>> iterator = extensions.iterator(); // first and only entry should be our extension. final Extension<MockInterface> actual = iterator.next(); assertSame(extension, actual); // should only be one extension in the iterator. try { iterator.next(); fail("Expected NoSuchElementException."); } catch (NoSuchElementException e) { // ignore } } /** * Test method for {@link SimpleExtensionPoint#removeExtension(Extension)} . */ @Test public void testRemoveExtension() { final MockImpl m = new MockImpl(); final MockExtension extension = new MockExtension(); m.getExtensionPoint().addExtension(extension); final Iterable<Extension<MockInterface>> extensions = m.getExtensionPoint().getExtensions(); assertNotNull(extensions); final Iterator<Extension<MockInterface>> i = extensions.iterator(); // first and only entry should be our extension. final Extension<MockInterface> actual = i.next(); assertSame(extension, actual); // should not be able to remove it via iterator. try { i.remove(); fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException e) { // ignore } m.getExtensionPoint().removeExtension(extension); assertEquals(0, m.extensionPoint.extensions.size()); // extensions should be empty final Iterable<Extension<MockInterface>> extensionsRemoved = m.getExtensionPoint().getExtensions(); try { extensionsRemoved.iterator().next(); fail("Expected NoSuchElementException"); } catch (NoSuchElementException e) { // ignore } } /** * Test method for {@link SimpleExtensionPoint#getTarget()} . */ @Test public void testGetTarget() { final MockImpl m = new MockImpl(); final MockInterface a = m.getExtensionPoint().getTarget(); assertSame(m, a); } /** * Test method for {@link SimpleExtensionPoint#fireCreate(Extensible)} . */ @Test public void testFireCreate() { final MockImpl m = new MockImpl(); final AtomicInteger counter = new AtomicInteger(0); final MockExtension extension = new MockExtension() { @Override public void onCreate(Extensible<MockInterface> source, Extensible<MockInterface> target) { counter.incrementAndGet(); } }; counter.set(0); m.getExtensionPoint().addExtension(extension); // fire with itself as the target m.extensionPoint.fireCreate(m); assertEquals(1, counter.get()); counter.set(0); m.getExtensionPoint().removeExtension(extension); // fire with itself as the target m.extensionPoint.fireCreate(m); assertEquals(0, counter.get()); } /** * Test method for {@link SimpleExtensionPoint#beforeCreate(Cache)} . */ @Test public void testBeforeCreate() { final MockImpl m = new MockImpl(); final Cache c = Fakes.cache(); final AtomicInteger counter = new AtomicInteger(0); final MockExtension extension = new MockExtension() { @Override public void beforeCreate(Extensible<MockInterface> source, Cache cache) { counter.incrementAndGet(); } }; counter.set(0); m.getExtensionPoint().addExtension(extension); // Verify beforeCreate is invoked when the extension is added m.extensionPoint.beforeCreate(c); assertEquals(1, counter.get()); counter.set(0); m.getExtensionPoint().removeExtension(extension); // Verify beforeCreate is not invoked when the extension is removed m.extensionPoint.beforeCreate(c); assertEquals(0, counter.get()); } private interface MockInterface { public void method1(); } private static class MockImpl implements MockInterface, Extensible<MockInterface> { private SimpleExtensionPoint<MockInterface> extensionPoint = new SimpleExtensionPoint<SimpleExtensionPointJUnitTest.MockInterface>(this, this); @Override public ExtensionPoint<MockInterface> getExtensionPoint() { return extensionPoint; } @Override public void method1() {} } private static class MockExtension implements Extension<MockInterface> { @Override public XmlGenerator<MockInterface> getXmlGenerator() { throw new UnsupportedOperationException(); } @Override public void beforeCreate(Extensible<MockInterface> source, Cache cache) { throw new UnsupportedOperationException(); } @Override public void onCreate(Extensible<MockInterface> source, Extensible<MockInterface> target) { throw new UnsupportedOperationException(); } } }
{ "content_hash": "cac95402b5cc78dd6e2433c2826f7a6b", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 96, "avg_line_length": 29.558441558441558, "alnum_prop": 0.7041593438781488, "repo_name": "smanvi-pivotal/geode", "id": "4d34332bcd785d59ecc63a0b2bee714427cc5b37", "size": "7617", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "geode-core/src/test/java/org/apache/geode/internal/cache/extension/SimpleExtensionPointJUnitTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "106707" }, { "name": "Groovy", "bytes": "2928" }, { "name": "HTML", "bytes": "3998074" }, { "name": "Java", "bytes": "26700079" }, { "name": "JavaScript", "bytes": "1781013" }, { "name": "Ruby", "bytes": "6751" }, { "name": "Shell", "bytes": "21891" } ], "symlink_target": "" }
import path from 'path'; import { readFileSync } from 'fs-extra'; const typeDefs = readFileSync(path.join(__dirname, 'typedefs.graphql'), 'utf8'); export default typeDefs;
{ "content_hash": "64b0a24dde0165cc49c64a76c912c730", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 80, "avg_line_length": 29, "alnum_prop": 0.7298850574712644, "repo_name": "boldr/boldr", "id": "929c93717d553d29c137cc183696dca74d192558", "size": "174", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "project/server/graphql/typeDefs.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "33159" }, { "name": "JavaScript", "bytes": "1820797" }, { "name": "Makefile", "bytes": "877" } ], "symlink_target": "" }
package info.pinlab.snd.oal; import info.pinlab.pinsound.PlayerDeviceController; import info.pinlab.pinsound.WavClip; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class SimpleAudioPlayer{ public static Logger LOG = LoggerFactory.getLogger(SimpleAudioPlayer.class); // private final WavClip wav; private final PlayerDeviceController player; volatile long pos = 0; private Runnable onFinishAction = null; // private Runnable onPauseAction = null; // private Thread onFinishActionThread = null; // private boolean localPlayer = false; public SimpleAudioPlayer(WavClip wav){ this(new OpenAlPlayer(), wav); // localPlayer = true; } public SimpleAudioPlayer(PlayerDeviceController player, WavClip wav){ // this.wav = wav; this.player = player; this.player.initWav(wav); } public void runOnFinish(Runnable run){ onFinishAction = run; } private int playResolution = 100; private volatile boolean isInterrupted = false; synchronized private boolean isInterrupted(){ return isInterrupted; } synchronized private void isInterrupted(boolean b){ isInterrupted = b; } public long pause(){ isInterrupted(true); pos = player.pause(); return pos; } public void play(){ player.setCursorPosInMs(pos); player.play(); isInterrupted(false); new Thread(new Runnable() { @Override public void run() { while(player.isPlaying()){ try { Thread.sleep(playResolution); } catch (InterruptedException e) { e.printStackTrace(); break; } } if(!isInterrupted()) new Thread(onFinishAction).start(); } }).start(); } public void stop(){ if(player.isPlaying()){ isInterrupted(true); player.stop(); }//-- if not playing just rewind! pos = 0; } public void dispose(){ player.stop(); player.dispose(); } public static void main(String[] args) throws Exception { // BasicConfigurator.configure(); SimpleAudioPlayer player = new SimpleAudioPlayer(new WavClip("data/snd/sample.wav")); player.runOnFinish(new Runnable() { @Override public void run() { System.out.println("FINISHED!"); } }); player.play(); for (int i = 1 ; i < 10 ; i++){ // System.out.println(i); Thread.sleep(95); } player.pause(); Thread.sleep(2000); player.play(); Thread.sleep(2000); // System.out.println("PLAYING"); player.dispose(); } }
{ "content_hash": "23c7dad3158f2b5222564fd6bfb11066", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 87, "avg_line_length": 20.74137931034483, "alnum_prop": 0.6820448877805486, "repo_name": "kinokocchi/PinSound", "id": "0a9ef949023542b6f73e78eda3bbe75587febd99", "size": "2406", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pinsound/openal/src/main/java/info/pinlab/snd/oal/SimpleAudioPlayer.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "84111" } ], "symlink_target": "" }
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). // // 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. /*! * @file MockCryptoTransform.h */ #ifndef _RTPS_SECURITY_MOCKCRYPTOTRANSFORM_H_ #define _RTPS_SECURITY_MOCKCRYPTOTRANSFORM_H_ #include <fastrtps/rtps/security/cryptography/CryptoTransform.h> #include <fastrtps/rtps/security/cryptography/CryptoTypes.h> #include <gmock/gmock.h> namespace eprosima { namespace fastrtps { namespace rtps { namespace security { class MockCryptoTransform : public CryptoTransform { public: virtual ~MockCryptoTransform() { } MOCK_METHOD5(encode_serialized_payload, bool ( SerializedPayload_t&, std::vector<uint8_t>&, const SerializedPayload_t&, DatawriterCryptoHandle&, SecurityException &)); MOCK_METHOD5(encode_datawriter_submessage, bool ( CDRMessage_t&, const CDRMessage_t&, DatawriterCryptoHandle&, std::vector<std::shared_ptr<DatareaderCryptoHandle>>&, SecurityException &)); MOCK_METHOD5(encode_datareader_submessage, bool ( CDRMessage_t&, const CDRMessage_t&, DatareaderCryptoHandle&, std::vector<std::shared_ptr<DatawriterCryptoHandle>>&, SecurityException & exception)); MOCK_METHOD5(encode_rtps_message, bool ( CDRMessage_t&, const CDRMessage_t&, ParticipantCryptoHandle&, std::vector<std::shared_ptr<ParticipantCryptoHandle>>&, SecurityException &)); MOCK_METHOD5(decode_rtps_message, bool ( CDRMessage_t&, const CDRMessage_t&, const ParticipantCryptoHandle&, const ParticipantCryptoHandle&, SecurityException &)); MOCK_METHOD7(preprocess_secure_submsg, bool ( DatawriterCryptoHandle * *, DatareaderCryptoHandle * *, SecureSubmessageCategory_t&, const CDRMessage_t&, ParticipantCryptoHandle&, ParticipantCryptoHandle&, SecurityException &)); MOCK_METHOD5(decode_datawriter_submessage, bool ( CDRMessage_t&, CDRMessage_t&, DatareaderCryptoHandle&, DatawriterCryptoHandle&, SecurityException &)); MOCK_METHOD5(decode_datareader_submessage, bool ( CDRMessage_t&, CDRMessage_t&, DatawriterCryptoHandle&, DatareaderCryptoHandle&, SecurityException &)); MOCK_METHOD6(decode_serialized_payload, bool ( SerializedPayload_t&, const SerializedPayload_t&, const std::vector<uint8_t>&, DatareaderCryptoHandle&, DatawriterCryptoHandle&, SecurityException &)); uint32_t calculate_extra_size_for_rtps_message( uint32_t /*number_discovered_participants*/) const { return 0; } uint32_t calculate_extra_size_for_rtps_submessage( uint32_t /*number_discovered_readers*/) const { return 0; } uint32_t calculate_extra_size_for_encoded_payload( uint32_t /*number_discovered_readers*/) const { return 0; } }; } //namespace security } //namespace rtps } //namespace fastrtps } //namespace eprosima #endif //_RTPS_SECURITY_MOCKCRYPTOTRANSFORM_H_
{ "content_hash": "fd66d0eca9ea33aa24c3448d395850ef", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 75, "avg_line_length": 31.984496124031008, "alnum_prop": 0.6063984488608822, "repo_name": "eProsima/Fast-DDS", "id": "5cc6b2d009c1d593161200fa7419ec42e68116a6", "size": "4126", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/mock/rtps/SecurityPluginFactory/rtps/security/MockCryptoTransform.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "874" }, { "name": "C", "bytes": "9035166" }, { "name": "C++", "bytes": "19044069" }, { "name": "CMake", "bytes": "450920" }, { "name": "CSS", "bytes": "28054" }, { "name": "HTML", "bytes": "2698" }, { "name": "M4", "bytes": "12825" }, { "name": "PowerShell", "bytes": "954" }, { "name": "Python", "bytes": "125888" }, { "name": "Shell", "bytes": "5639" } ], "symlink_target": "" }
using NassquaDAL.Bussiness.SPA.Experience; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NassquaTest { class Program { static void Main(string[] args) { // NassquaCoreAPI Test ExperienceCRUD es = new ExperienceCRUD(); List<Models.Experience> experiences = es.getExperiences(); foreach (Models.Experience experience in experiences) { Console.WriteLine("Experience Id : {0} and Experience Desc: {1}", experience.ExpId, experience.ExpDesc); } Console.ReadLine(); } } }
{ "content_hash": "a3840107f52670b33dd4c8eb4fb9222c", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 120, "avg_line_length": 22.29032258064516, "alnum_prop": 0.6164978292329957, "repo_name": "Nassqua/NassquaCoreAPI", "id": "9b2054ff860fac93544671680268de719531d342", "size": "693", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "NassquaCoreAPI/NassquaTest/Program.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "202" }, { "name": "C#", "bytes": "21224" }, { "name": "PowerShell", "bytes": "102363" } ], "symlink_target": "" }
Testing out Markdown
{ "content_hash": "16e2a86a0e5326b768c6240882b2596c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 20, "avg_line_length": 21, "alnum_prop": 0.8571428571428571, "repo_name": "HBossier/Markdown", "id": "59a73f7de79dff14e150c48b5108b2fdd2d717a5", "size": "32", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?php Route::group(['prefix' => 'admin'], function() { Route::get('/login', '\App\Admin\Controllers\LoginController@index'); Route::post('/login', '\App\Admin\Controllers\LoginController@login'); Route::get('/logout', '\App\Admin\Controllers\LoginController@logout'); // 需要登陆的 Route::group(['middleware' => 'auth:admin'], function(){ Route::get('/home', '\App\Admin\Controllers\HomeController@index'); // 系统管理 Route::group(['middleware' => 'can:system'], function(){ // 用户管理 Route::get('/users', '\App\Admin\Controllers\UserController@index'); Route::get('/users/create', '\App\Admin\Controllers\UserController@create'); Route::post('/users/store', '\App\Admin\Controllers\UserController@store'); Route::get('/users/{user}/role', '\App\Admin\Controllers\UserController@role'); Route::post('/users/{user}/role', '\App\Admin\Controllers\UserController@storeRole'); // 角色管理 Route::get('/roles', '\App\Admin\Controllers\RoleController@index'); Route::get('/roles/create', '\App\Admin\Controllers\RoleController@create'); Route::post('/roles/store', '\App\Admin\Controllers\RoleController@store'); Route::get('/roles/{role}/permission', '\App\Admin\Controllers\RoleController@permission'); Route::post('/roles/{role}/permission', '\App\Admin\Controllers\RoleController@storePermission'); // 权限管理 Route::get('/permissions', '\App\Admin\Controllers\PermissionController@index'); Route::get('/permissions/create', '\App\Admin\Controllers\PermissionController@create'); Route::post('/permissions/store', '\App\Admin\Controllers\PermissionController@store'); }); // 文章管理 Route::group(['middleware' => 'can:post'], function() { // 文章管理 Route::get('/posts', '\App\Admin\Controllers\PostController@index'); Route::post('/posts/{post}/status', '\App\Admin\Controllers\PostController@status'); }); // 专题模块 Route::group(['middleware' => 'can:topic'], function(){ Route::resource('topics', '\App\Admin\Controllers\TopicController', ['only' => [ 'index', 'create', 'store', 'destroy' ]]); }); // 通知模块 Route::group(['middleware' => 'can:notice'], function(){ Route::resource('notices', '\App\Admin\Controllers\NoticeController', [ 'only' => ['index', 'create', 'store'], ]); }); }); });
{ "content_hash": "b20148e1a809a44fb58b469ad77cb91f", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 109, "avg_line_length": 45.78947368421053, "alnum_prop": 0.5865900383141762, "repo_name": "m0rezer0/larBlog", "id": "736ca153e81a81b4348d2042285879d7dce4120a", "size": "2684", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "routes/admin.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "106100" }, { "name": "HTML", "bytes": "3453647" }, { "name": "PHP", "bytes": "116593" }, { "name": "Vue", "bytes": "563" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <!-- Generated by javadoc (1.8.0) on Sun Feb 09 16:30:40 CET 2014 --> <title>com.interactivemesh.jfx.importer (JavaFX 3D Model Importers)</title> <meta name="date" content="2014-02-09"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet-im.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="com.interactivemesh.jfx.importer (JavaFX 3D Model Importers)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 3D Model Importers</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev&nbsp;Package</li> <li><a href="../../../../com/interactivemesh/jfx/importer/col/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/interactivemesh/jfx/importer/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Package" class="title">Package&nbsp;com.interactivemesh.jfx.importer</h1> <div class="docSummary"> <div class="block"><span style="text-align:left; font-size:1.0em; font-weight:normal; color:#4D7A97"> Common classes for JavaFX 3D model importers.</div> </div> <p>See:&nbsp;<a href="#package.description">Description</a></p> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation"> <caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Interface</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../com/interactivemesh/jfx/importer/Importer.html" title="interface in com.interactivemesh.jfx.importer">Importer</a></td> <td class="colLast"> <div class="block">The Importer interface specifies the core import capabilities of the JavaFX 3D importers.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../com/interactivemesh/jfx/importer/ModelImporter.html" title="interface in com.interactivemesh.jfx.importer">ModelImporter</a></td> <td class="colLast"> <div class="block">The ModelImporter interface specifies the core import capabilities of the JavaFX 3D model importers.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../com/interactivemesh/jfx/importer/FilePath.html" title="class in com.interactivemesh.jfx.importer">FilePath</a></td> <td class="colLast"> <div class="block">A FilePath object represents the paths of a resource file associated with the imported 3D model file.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../../../com/interactivemesh/jfx/importer/Viewpoint.html" title="class in com.interactivemesh.jfx.importer">Viewpoint</a></td> <td class="colLast"> <div class="block">A Viewpoint object provides viewing properties of a JavaFX Camera object.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation"> <caption><span>Exception Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Exception</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../../../com/interactivemesh/jfx/importer/ImportException.html" title="class in com.interactivemesh.jfx.importer">ImportException</a></td> <td class="colLast"> <div class="block">An ImportException is thrown if the importer encounters a problem reading or parsing the specified file.</div> </td> </tr> </tbody> </table> </li> </ul> <a name="package.description"> <!-- --> </a> <h2 title="Package com.interactivemesh.jfx.importer Description">Package com.interactivemesh.jfx.importer Description</h2> <div class="block"><span style="text-align:left; font-size:1.0em; font-weight:normal; color:#4D7A97"> Common classes for JavaFX 3D model importers. </span></div> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 3D Model Importers</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev&nbsp;Package</li> <li><a href="../../../../com/interactivemesh/jfx/importer/col/package-summary.html">Next&nbsp;Package</a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/interactivemesh/jfx/importer/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><p style=color:#4D7A97>Copyright (C) 2013-2014 InteractiveMesh e.K.</p></small></p> </body> </html>
{ "content_hash": "5aa216cb1f481c707daf79449f1fe2ed", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 171, "avg_line_length": 38.01449275362319, "alnum_prop": 0.665522938111577, "repo_name": "juanvallejo/javafx-project", "id": "be34ffe6316b8d16aa36c85093b2bd8244f9b4a5", "size": "7869", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/JFX3DModelImporters/apidoc/com/interactivemesh/jfx/importer/package-summary.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "12773" }, { "name": "HTML", "bytes": "911026" }, { "name": "Java", "bytes": "20553" }, { "name": "JavaScript", "bytes": "827" } ], "symlink_target": "" }
package gnu.classpath.tools.javah; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import java.lang.reflect.Modifier; import java.util.Iterator; import org.objectweb.asm.Type; import org.objectweb.asm.tree.FieldNode; import org.objectweb.asm.tree.MethodNode; public class JniIncludePrinter extends Printer { protected JniIncludePrinter(Main classpath, File outFile, boolean isDir, boolean force) { super(classpath, outFile, isDir, force); } private void writeFields(ClassWrapper klass, JniPrintStream out) throws IOException { klass.linkSupers(); boolean wroteAny = false; for (; klass != null; klass = klass.superClass) { Iterator<?> i = klass.fields.iterator(); while (i.hasNext()) { FieldNode field = (FieldNode) i.next(); if (! Modifier.isStatic(field.access) || ! Modifier.isFinal(field.access)) continue; if (! (field.value instanceof Integer) && ! (field.value instanceof Long)) continue; // Note that we don't want to mangle the field name. String name = (JniHelper.mangle(klass.name) + "_" + field.name); out.print("#undef "); out.println(name); out.print("#define "); out.print(name); out.print(" "); out.print(field.value); if (field.value instanceof Integer) out.print("L"); else if (field.value instanceof Long) out.print("LL"); out.println(); wroteAny = true; } } if (wroteAny) out.println(); } protected void writePreambleImpl(PrintStream out) { out.println("/* DO NOT EDIT THIS FILE - it is machine generated */"); out.println(); out.println("#include <jni.h>"); } protected PrintStream getPrintStreamImpl(FileOutputStream fos, ClassWrapper klass) { return new JniPrintStream(classpath, fos, klass); } public void printClass(File file, ClassWrapper klass) throws IOException { // Note that we ignore the filename here. String xname = JniHelper.mangle(klass.name); // mangle the filename a bit String filename = klass.name; filename = filename.replace('/', '_'); filename = filename.replace('$', '_'); filename = filename + ".h"; JniPrintStream out = (JniPrintStream) getPrintStream(filename, klass); if (out == null) return; out.println(); out.print("#ifndef __"); out.print(xname); out.println("__"); out.print("#define __"); out.print(xname); out.println("__"); out.println(); out.println("#ifdef __cplusplus"); out.println("extern \"C\""); out.println("{"); out.println("#endif"); out.println(); Iterator<?> i = klass.methods.iterator(); while (i.hasNext()) { MethodNode method = (MethodNode) i.next(); if (! Modifier.isNative(method.access)) continue; out.print("JNIEXPORT "); out.print(Type.getReturnType(method.desc)); out.print(" JNICALL "); out.print(method, xname); out.println(";"); } out.println(); writeFields(klass, out); out.println("#ifdef __cplusplus"); out.println("}"); out.println("#endif"); out.println(); out.print("#endif /* __"); out.print(xname); out.println("__ */"); out.close(); } }
{ "content_hash": "2e2377e0bfb957e312f23edc66098c1b", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 76, "avg_line_length": 26.84328358208955, "alnum_prop": 0.577425632471504, "repo_name": "the-linix-project/linix-kernel-source", "id": "cb8bcd8d9c2b287251075ccab194616ac3e25a71", "size": "5392", "binary": false, "copies": "21", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ada", "bytes": "38139979" }, { "name": "Assembly", "bytes": "3723477" }, { "name": "Awk", "bytes": "83739" }, { "name": "C", "bytes": "103607293" }, { "name": "C#", "bytes": "55726" }, { "name": "C++", "bytes": "38577421" }, { "name": "CLIPS", "bytes": "6933" }, { "name": "CSS", "bytes": "32588" }, { "name": "Emacs Lisp", "bytes": "13451" }, { "name": "FORTRAN", "bytes": "4294984" }, { "name": "GAP", "bytes": "13089" }, { "name": "Go", "bytes": "11277335" }, { "name": "Haskell", "bytes": "2415" }, { "name": "Java", "bytes": "45298678" }, { "name": "JavaScript", "bytes": "6265" }, { "name": "Matlab", "bytes": "56" }, { "name": "OCaml", "bytes": "148372" }, { "name": "Objective-C", "bytes": "995127" }, { "name": "Objective-C++", "bytes": "436045" }, { "name": "PHP", "bytes": "12361" }, { "name": "Pascal", "bytes": "40318" }, { "name": "Perl", "bytes": "358808" }, { "name": "Python", "bytes": "60178" }, { "name": "SAS", "bytes": "1711" }, { "name": "Scilab", "bytes": "258457" }, { "name": "Shell", "bytes": "2610907" }, { "name": "Tcl", "bytes": "17983" }, { "name": "TeX", "bytes": "1455571" }, { "name": "XSLT", "bytes": "156419" } ], "symlink_target": "" }
import random import acpc_python_client as acpc ACTIONS = [ acpc.ActionType.FOLD, acpc.ActionType.CALL, acpc.ActionType.RAISE ] def convert_action_to_str(action): if action == acpc.ActionType.FOLD: return 'f' elif action == acpc.ActionType.CALL: return 'c' elif action == acpc.ActionType.RAISE: return 'r' else: raise RuntimeError('Invalid action: %s' % action) def convert_action_to_int(action): if action == acpc.ActionType.FOLD: return 0 elif action == acpc.ActionType.CALL: return 1 elif action == acpc.ActionType.RAISE: return 2 else: raise RuntimeError('Invalid action: %s' % action) def select_action(strategy): """Randomly select action from node strategy. Args: strategy (list(float)): Strategy of the node Returns: acpc.ActionType: Selected action. """ choice = random.random() probability_sum = 0 for i in range(3): action_probability = strategy[i] if action_probability == 0: continue probability_sum += action_probability if choice < probability_sum: return ACTIONS[i] # Return the last action since it could have not been selected due to floating point error return ACTIONS[2] def get_info_set(game, match_state): """Return unique string representing each game state. Result is used as a node key in strategy. Args: game (Game): Game definition object match_state (MatchState): Current game state Returns: string: Representation of current game state. """ state = match_state.get_state() info_set = '' num_hole_cards = game.get_num_hole_cards() viewing_player = match_state.get_viewing_player() info_set += '%s:' % ':'.join([str(state.get_hole_card(viewing_player, i)) for i in range(num_hole_cards)]) total_board_cards_count = 0 for round_index in range(state.get_round() + 1): new_total_board_cards_count = game.get_total_num_board_cards(round_index) if new_total_board_cards_count > total_board_cards_count: info_set += ':%s:' % ':'.join( [str(state.get_board_card(i)) for i in range(total_board_cards_count, new_total_board_cards_count)]) total_board_cards_count = new_total_board_cards_count info_set += ''.join( [convert_action_to_str(state.get_action_type(round_index, action_index)) for action_index in range(state.get_num_actions(round_index))]) return info_set
{ "content_hash": "07de720a5d5e0ff02173892ec68d3d94", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 110, "avg_line_length": 29.568181818181817, "alnum_prop": 0.6272098385857033, "repo_name": "JakubPetriska/poker-cfr", "id": "388393fc6cfe99e7a4ac805300d9a2a01ab0f62e", "size": "2602", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/agent_utils.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "27623" }, { "name": "Shell", "bytes": "7060" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="ro"> <head> <!-- Generated by javadoc (version 1.7.0_07) on Tue May 27 14:37:12 EEST 2014 --> <title>JRCrosstabColumnGroupFactory (JasperReports 5.6.0 API)</title> <meta name="date" content="2014-05-27"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="JRCrosstabColumnGroupFactory (JasperReports 5.6.0 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/JRCrosstabColumnGroupFactory.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabCellFactory.html" title="class in net.sf.jasperreports.crosstabs.xml"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabDatasetFactory.html" title="class in net.sf.jasperreports.crosstabs.xml"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?net/sf/jasperreports/crosstabs/xml/JRCrosstabColumnGroupFactory.html" target="_top">Frames</a></li> <li><a href="JRCrosstabColumnGroupFactory.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">net.sf.jasperreports.crosstabs.xml</div> <h2 title="Class JRCrosstabColumnGroupFactory" class="title">Class JRCrosstabColumnGroupFactory</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li><a href="../../../../../net/sf/jasperreports/engine/xml/JRBaseFactory.html" title="class in net.sf.jasperreports.engine.xml">net.sf.jasperreports.engine.xml.JRBaseFactory</a></li> <li> <ul class="inheritance"> <li><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html" title="class in net.sf.jasperreports.crosstabs.xml">net.sf.jasperreports.crosstabs.xml.JRCrosstabGroupFactory</a></li> <li> <ul class="inheritance"> <li>net.sf.jasperreports.crosstabs.xml.JRCrosstabColumnGroupFactory</li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>org.apache.commons.digester.ObjectCreationFactory</dd> </dl> <hr> <br> <pre>public class <span class="strong">JRCrosstabColumnGroupFactory</span> extends <a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html" title="class in net.sf.jasperreports.crosstabs.xml">JRCrosstabGroupFactory</a></pre> <dl><dt><span class="strong">Version:</span></dt> <dd>$Id: JRCrosstabColumnGroupFactory.java 5960 2013-03-07 14:54:18Z lucianc $</dd> <dt><span class="strong">Author:</span></dt> <dd>Lucian Chirita (lucianc@users.sourceforge.net)</dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabColumnGroupFactory.html#ATTRIBUTE_headerPosition">ATTRIBUTE_headerPosition</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabColumnGroupFactory.html#ATTRIBUTE_height">ATTRIBUTE_height</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabColumnGroupFactory.html#ELEMENT_crosstabHeader">ELEMENT_crosstabHeader</a></strong></code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_net.sf.jasperreports.crosstabs.xml.JRCrosstabGroupFactory"> <!-- --> </a> <h3>Fields inherited from class&nbsp;net.sf.jasperreports.crosstabs.xml.<a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html" title="class in net.sf.jasperreports.crosstabs.xml">JRCrosstabGroupFactory</a></h3> <code><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html#ATTRIBUTE_name">ATTRIBUTE_name</a>, <a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html#ATTRIBUTE_totalPosition">ATTRIBUTE_totalPosition</a>, <a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html#ELEMENT_columnGroup">ELEMENT_columnGroup</a>, <a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html#ELEMENT_crosstabColumnHeader">ELEMENT_crosstabColumnHeader</a>, <a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html#ELEMENT_crosstabTotalColumnHeader">ELEMENT_crosstabTotalColumnHeader</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_net.sf.jasperreports.engine.xml.JRBaseFactory"> <!-- --> </a> <h3>Fields inherited from class&nbsp;net.sf.jasperreports.engine.xml.<a href="../../../../../net/sf/jasperreports/engine/xml/JRBaseFactory.html" title="class in net.sf.jasperreports.engine.xml">JRBaseFactory</a></h3> <code><a href="../../../../../net/sf/jasperreports/engine/xml/JRBaseFactory.html#digester">digester</a></code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabColumnGroupFactory.html#JRCrosstabColumnGroupFactory()">JRCrosstabColumnGroupFactory</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.Object</code></td> <td class="colLast"><code><strong><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabColumnGroupFactory.html#createObject(org.xml.sax.Attributes)">createObject</a></strong>(org.xml.sax.Attributes&nbsp;attributes)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_net.sf.jasperreports.crosstabs.xml.JRCrosstabGroupFactory"> <!-- --> </a> <h3>Methods inherited from class&nbsp;net.sf.jasperreports.crosstabs.xml.<a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html" title="class in net.sf.jasperreports.crosstabs.xml">JRCrosstabGroupFactory</a></h3> <code><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabGroupFactory.html#setGroupAtts(org.xml.sax.Attributes, net.sf.jasperreports.crosstabs.design.JRDesignCrosstabGroup)">setGroupAtts</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_net.sf.jasperreports.engine.xml.JRBaseFactory"> <!-- --> </a> <h3>Methods inherited from class&nbsp;net.sf.jasperreports.engine.xml.<a href="../../../../../net/sf/jasperreports/engine/xml/JRBaseFactory.html" title="class in net.sf.jasperreports.engine.xml">JRBaseFactory</a></h3> <code><a href="../../../../../net/sf/jasperreports/engine/xml/JRBaseFactory.html#getDigester()">getDigester</a>, <a href="../../../../../net/sf/jasperreports/engine/xml/JRBaseFactory.html#setDigester(org.apache.commons.digester.Digester)">setDigester</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field_detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="ELEMENT_crosstabHeader"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ELEMENT_crosstabHeader</h4> <pre>public static final&nbsp;java.lang.String ELEMENT_crosstabHeader</pre> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#net.sf.jasperreports.crosstabs.xml.JRCrosstabColumnGroupFactory.ELEMENT_crosstabHeader">Constant Field Values</a></dd></dl> </li> </ul> <a name="ATTRIBUTE_height"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ATTRIBUTE_height</h4> <pre>public static final&nbsp;java.lang.String ATTRIBUTE_height</pre> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#net.sf.jasperreports.crosstabs.xml.JRCrosstabColumnGroupFactory.ATTRIBUTE_height">Constant Field Values</a></dd></dl> </li> </ul> <a name="ATTRIBUTE_headerPosition"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>ATTRIBUTE_headerPosition</h4> <pre>public static final&nbsp;java.lang.String ATTRIBUTE_headerPosition</pre> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#net.sf.jasperreports.crosstabs.xml.JRCrosstabColumnGroupFactory.ATTRIBUTE_headerPosition">Constant Field Values</a></dd></dl> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="JRCrosstabColumnGroupFactory()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>JRCrosstabColumnGroupFactory</h4> <pre>public&nbsp;JRCrosstabColumnGroupFactory()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="createObject(org.xml.sax.Attributes)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>createObject</h4> <pre>public&nbsp;java.lang.Object&nbsp;createObject(org.xml.sax.Attributes&nbsp;attributes)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/JRCrosstabColumnGroupFactory.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabCellFactory.html" title="class in net.sf.jasperreports.crosstabs.xml"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../net/sf/jasperreports/crosstabs/xml/JRCrosstabDatasetFactory.html" title="class in net.sf.jasperreports.crosstabs.xml"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?net/sf/jasperreports/crosstabs/xml/JRCrosstabColumnGroupFactory.html" target="_top">Frames</a></li> <li><a href="JRCrosstabColumnGroupFactory.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <span style="font-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:8pt;font-style:normal;color:#000000;">&copy; 2001-2010 Jaspersoft Corporation <a href="http://www.jaspersoft.com" target="_blank" style="color:#000000;">www.jaspersoft.com</a></span> </small></p> </body> </html>
{ "content_hash": "1a91f3b76b4e351e60bd0cf4057386a2", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 725, "avg_line_length": 43.34139784946237, "alnum_prop": 0.6734478695031942, "repo_name": "phurtado1112/cnaemvc", "id": "71319ed7452a2f9e3485bd7624d5b8605b1ea0f5", "size": "16123", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/JasperReport__5.6/docs/api/net/sf/jasperreports/crosstabs/xml/JRCrosstabColumnGroupFactory.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "11139" }, { "name": "HTML", "bytes": "112926414" }, { "name": "Java", "bytes": "532942" } ], "symlink_target": "" }
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:fillColor="#FF000000" android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/> </vector> <!-- From: file:/Users/Juleelala/AndroidStudioProjects/CSE110/Tuber/src/main/res/drawable-anydpi-v21/ic_home_black_24dp.xml -->
{ "content_hash": "85f4193f7a8ec42295550ec915b4dc2a", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 127, "avg_line_length": 45.2, "alnum_prop": 0.6836283185840708, "repo_name": "Jcurrie314/CSE110", "id": "22e30ad2ee909f06fa7ea720b330ac7f9144c9dc", "size": "452", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Tuber/build/intermediates/res/merged/debug/drawable-anydpi-v21/ic_home_black_24dp.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1674516" } ], "symlink_target": "" }
var player = { posX: 0, posY: 0, gold: 0, success: false, move: function(direction) { if(direction === 'forward'){ this.posX +=10; } else if(direction === 'back'){ player.posX -=10; } else if(direction === 'up'){ player.posY += 10; } else if(direction === 'down'){ player.posY -=10; } //when player moves, dragon moves too dragon.posX = Math.floor((Math.random()*100)+1); dragon.posY = Math.floor((Math.random()*100)+1); console.log("Dragon's position is " + dragon.posX + "," + dragon.posY); //Display where player is console.log("Player's position is " + player.posX + "," + player.posY); //After every move, check if the player is near the dragon or the gold if(player.posX === dragon.posX && player.posY === dragon.posY){ console.log("You encountered the dragon, Game Over!"); } else if(player.posX === gold.posX && player.posY === gold.posY){ player.success = true; player.gold = 100; console.log("You reached the gold, you win!!"); } } }; var gold = { posX: Math.floor((Math.random()*100)+1), posY: Math.floor((Math.random()*100)+1) }; var dragon = { health: 100, posX: Math.floor((Math.random()*100)+1), posY: Math.floor((Math.random()*100)+1) }; player.move('up'); player.move('forward');
{ "content_hash": "b09cb0973c6be0a9731463df2c04bc0e", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 73, "avg_line_length": 22.321428571428573, "alnum_prop": 0.6312, "repo_name": "Elizabeth-Roche/phase-0", "id": "e29f9dcf507677abcdfba0303ad129259c8cb530", "size": "1250", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "week-7/file.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2784" }, { "name": "HTML", "bytes": "16786" }, { "name": "JavaScript", "bytes": "35015" }, { "name": "Ruby", "bytes": "107153" } ], "symlink_target": "" }
import copy from tempest.lib.api_schema.response.compute.v2_71 import servers as servers271 ########################################################################### # # 2.73: # # The locked_reason parameter is now returned in the response body of the # following calls: # # - POST /servers/{server_id}/action (where the action is rebuild) # - PUT /servers/{server_id} (update) # - GET /servers/{server_id} (show) # - GET /servers/detail (list) # ########################################################################### # The "locked_reason" parameter will either be a string or None. locked_reason = {'type': ['string', 'null']} rebuild_server = copy.deepcopy(servers271.rebuild_server) rebuild_server['response_body']['properties']['server'][ 'properties'].update({'locked_reason': locked_reason}) rebuild_server['response_body']['properties']['server'][ 'required'].append('locked_reason') rebuild_server_with_admin_pass = copy.deepcopy( servers271.rebuild_server_with_admin_pass) rebuild_server_with_admin_pass['response_body']['properties']['server'][ 'properties'].update({'locked_reason': locked_reason}) rebuild_server_with_admin_pass['response_body']['properties']['server'][ 'required'].append('locked_reason') update_server = copy.deepcopy(servers271.update_server) update_server['response_body']['properties']['server'][ 'properties'].update({'locked_reason': locked_reason}) update_server['response_body']['properties']['server'][ 'required'].append('locked_reason') get_server = copy.deepcopy(servers271.get_server) get_server['response_body']['properties']['server'][ 'properties'].update({'locked_reason': locked_reason}) get_server['response_body']['properties']['server'][ 'required'].append('locked_reason') list_servers_detail = copy.deepcopy(servers271.list_servers_detail) list_servers_detail['response_body']['properties']['servers']['items'][ 'properties'].update({'locked_reason': locked_reason}) list_servers_detail['response_body']['properties']['servers']['items'][ 'required'].append('locked_reason') # NOTE(lajoskatona): Below are the unchanged schema in this microversion. We # need to keep this schema in this file to have the generic way to select the # right schema based on self.schema_versions_info mapping in service client. # ****** Schemas unchanged since microversion 2.71 *** list_servers = copy.deepcopy(servers271.list_servers) show_server_diagnostics = copy.deepcopy(servers271.show_server_diagnostics) get_remote_consoles = copy.deepcopy(servers271.get_remote_consoles) list_tags = copy.deepcopy(servers271.list_tags) update_all_tags = copy.deepcopy(servers271.update_all_tags) delete_all_tags = copy.deepcopy(servers271.delete_all_tags) check_tag_existence = copy.deepcopy(servers271.check_tag_existence) update_tag = copy.deepcopy(servers271.update_tag) delete_tag = copy.deepcopy(servers271.delete_tag)
{ "content_hash": "0cbef10bf384ee5f9bd2a6b3914df656", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 79, "avg_line_length": 44.09090909090909, "alnum_prop": 0.6993127147766323, "repo_name": "cisco-openstack/tempest", "id": "6e491e979df3cda6d2af42d3681bdbd520edff86", "size": "3483", "binary": false, "copies": "1", "ref": "refs/heads/proposed", "path": "tempest/lib/api_schema/response/compute/v2_73/servers.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "4431271" }, { "name": "Shell", "bytes": "7435" } ], "symlink_target": "" }
package org.teavm.model; import java.util.HashMap; import java.util.Map; public class ReferenceCache { private Map<MethodReference, MethodReference> referenceCache = new HashMap<>(); private Map<FieldReference, FieldReference> fieldRefenceCache = new HashMap<>(); private Map<MethodDescriptor, MethodDescriptor> descriptorCache = new HashMap<>(); private Map<ValueType, ValueType> valueTypeCache = new HashMap<>(); private Map<String, String> classCache = new HashMap<>(); private Map<String, MethodReference> referenceParseCache = new HashMap<>(); private Map<String, MethodDescriptor> descriptorParseCache = new HashMap<>(); private Map<String, ValueType> valueTypeParseCache = new HashMap<>(); public MethodReference getCached(MethodReference reference) { MethodReference result = referenceCache.get(reference); if (result == null) { MethodDescriptor descriptor = getCached(reference.getDescriptor()); String className = getCached(reference.getClassName()); if (descriptor != reference.getDescriptor() || className != reference.getClassName()) { result = new MethodReference(className, descriptor); } else { result = reference; } referenceCache.put(result, result); } return result; } public MethodDescriptor getCached(MethodDescriptor descriptor) { MethodDescriptor result = descriptorCache.get(descriptor); if (result == null) { result = descriptor; ValueType[] signature = descriptor.getSignature(); boolean signatureChanged = false; for (int i = 0; i < signature.length; ++i) { ValueType type = signature[i]; if (type == null) { continue; } ValueType cachedType = getCached(type); if (type != cachedType) { signatureChanged = true; signature[i] = cachedType; } } if (signatureChanged) { result = new MethodDescriptor(descriptor.getName(), signature); } descriptorCache.put(result, result); } return result; } public FieldReference getCached(FieldReference reference) { FieldReference result = fieldRefenceCache.get(reference); if (result == null) { result = reference; String classNameCached = getCached(reference.getClassName()); String fieldNameCached = getCached(reference.getFieldName()); if (classNameCached != reference.getClassName() || fieldNameCached != reference.getFieldName()) { result = new FieldReference(classNameCached, fieldNameCached); } fieldRefenceCache.put(result, result); } return result; } public ValueType getCached(ValueType valueType) { if (valueType instanceof ValueType.Primitive) { return valueType; } ValueType result = valueTypeCache.get(valueType); if (result == null) { result = valueType; if (result instanceof ValueType.Object) { String className = ((ValueType.Object) result).getClassName(); String cachedClassName = getCached(className); if (cachedClassName != className) { result = ValueType.object(cachedClassName); } } else if (result instanceof ValueType.Array) { ValueType item = ((ValueType.Array) result).getItemType(); ValueType cachedItem = getCached(item); if (item != cachedItem) { result = ValueType.arrayOf(cachedItem); } } valueTypeCache.put(result, result); } return result; } public String getCached(String className) { String result = classCache.get(className); if (result == null) { result = className; classCache.put(result, result); } return result; } public MethodReference parseReferenceCached(String value) { MethodReference result = referenceParseCache.get(value); if (result == null) { result = getCached(MethodReference.parse(value)); referenceParseCache.put(value, result); } return result; } public MethodDescriptor parseDescriptorCached(String value) { MethodDescriptor result = descriptorParseCache.get(value); if (result == null) { result = getCached(MethodDescriptor.parse(value)); descriptorParseCache.put(value, result); } return result; } public ValueType parseValueTypeCached(String value) { ValueType result = valueTypeParseCache.get(value); if (result == null) { result = getCached(ValueType.parse(value)); valueTypeParseCache.put(value, result); } return result; } }
{ "content_hash": "a7bf26f9dcfb73fc3bb8fd7509d2948d", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 109, "avg_line_length": 38.84090909090909, "alnum_prop": 0.5968402574605032, "repo_name": "jtulach/teavm", "id": "c8459188a554e69472be3d0e1b66dcf76ac483b9", "size": "5736", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "core/src/main/java/org/teavm/model/ReferenceCache.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1533" }, { "name": "HTML", "bytes": "990" }, { "name": "Java", "bytes": "6763529" }, { "name": "JavaScript", "bytes": "33156" }, { "name": "Shell", "bytes": "1158" } ], "symlink_target": "" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.redis.generated; import com.azure.core.util.Context; /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2021-06-01/examples/RedisCacheListPrivateEndpointConnections.json */ /** * Sample code: RedisCacheListPrivateEndpointConnection. * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void redisCacheListPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) { azure .redisCaches() .manager() .serviceClient() .getPrivateEndpointConnections() .list("rgtest01", "cachetest01", Context.NONE); } }
{ "content_hash": "cc244599da6dc86014d469d3d53607f6", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 152, "avg_line_length": 37.74074074074074, "alnum_prop": 0.7144259077526988, "repo_name": "Azure/azure-sdk-for-java", "id": "f25601fd9ff8f2c85b8bc56a81a9e85c6a80e54f", "size": "1019", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/redis/generated/PrivateEndpointConnectionsListSamples.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "8762" }, { "name": "Bicep", "bytes": "15055" }, { "name": "CSS", "bytes": "7676" }, { "name": "Dockerfile", "bytes": "2028" }, { "name": "Groovy", "bytes": "3237482" }, { "name": "HTML", "bytes": "42090" }, { "name": "Java", "bytes": "432409546" }, { "name": "JavaScript", "bytes": "36557" }, { "name": "Jupyter Notebook", "bytes": "95868" }, { "name": "PowerShell", "bytes": "737517" }, { "name": "Python", "bytes": "240542" }, { "name": "Scala", "bytes": "1143898" }, { "name": "Shell", "bytes": "18488" }, { "name": "XSLT", "bytes": "755" } ], "symlink_target": "" }
"""Python source expertise for coverage.py""" import os.path import types import zipimport from coverage import env, files from coverage.misc import ( contract, CoverageException, expensive, NoSource, join_regex, isolate_module, ) from coverage.parser import PythonParser from coverage.phystokens import source_token_lines, source_encoding from coverage.plugin import FileReporter os = isolate_module(os) @contract(returns='bytes') def read_python_source(filename): """Read the Python source text from `filename`. Returns bytes. """ with open(filename, "rb") as f: return f.read().replace(b"\r\n", b"\n").replace(b"\r", b"\n") @contract(returns='unicode') def get_python_source(filename): """Return the source code, as unicode.""" base, ext = os.path.splitext(filename) if ext == ".py" and env.WINDOWS: exts = [".py", ".pyw"] else: exts = [ext] for ext in exts: try_filename = base + ext if os.path.exists(try_filename): # A regular text file: open it. source = read_python_source(try_filename) break # Maybe it's in a zip file? source = get_zip_bytes(try_filename) if source is not None: break else: # Couldn't find source. raise NoSource("No source for code: '%s'." % filename) # Replace \f because of http://bugs.python.org/issue19035 source = source.replace(b'\f', b' ') source = source.decode(source_encoding(source), "replace") # Python code should always end with a line with a newline. if source and source[-1] != '\n': source += '\n' return source @contract(returns='bytes|None') def get_zip_bytes(filename): """Get data from `filename` if it is a zip file path. Returns the bytestring data read from the zip file, or None if no zip file could be found or `filename` isn't in it. The data returned will be an empty string if the file is empty. """ markers = ['.zip'+os.sep, '.egg'+os.sep] for marker in markers: if marker in filename: parts = filename.split(marker) try: zi = zipimport.zipimporter(parts[0]+marker[:-1]) except zipimport.ZipImportError: continue try: data = zi.get_data(parts[1]) except IOError: continue return data return None class PythonFileReporter(FileReporter): """Report support for a Python file.""" def __init__(self, morf, coverage=None): self.coverage = coverage if hasattr(morf, '__file__'): filename = morf.__file__ elif isinstance(morf, types.ModuleType): # A module should have had .__file__, otherwise we can't use it. # This could be a PEP-420 namespace package. raise CoverageException("Module {0} has no file".format(morf)) else: filename = morf filename = files.unicode_filename(filename) # .pyc files should always refer to a .py instead. if filename.endswith(('.pyc', '.pyo')): filename = filename[:-1] elif filename.endswith('$py.class'): # Jython filename = filename[:-9] + ".py" super(PythonFileReporter, self).__init__(files.canonical_filename(filename)) if hasattr(morf, '__name__'): name = morf.__name__ name = name.replace(".", os.sep) + ".py" name = files.unicode_filename(name) else: name = files.relative_filename(filename) self.relname = name self._source = None self._parser = None self._statements = None self._excluded = None @contract(returns='unicode') def relative_filename(self): return self.relname @property def parser(self): """Lazily create a :class:`PythonParser`.""" if self._parser is None: self._parser = PythonParser( filename=self.filename, exclude=self.coverage._exclude_regex('exclude'), ) self._parser.parse_source() return self._parser def lines(self): """Return the line numbers of statements in the file.""" return self.parser.statements def excluded_lines(self): """Return the line numbers of statements in the file.""" return self.parser.excluded def translate_lines(self, lines): return self.parser.translate_lines(lines) def translate_arcs(self, arcs): return self.parser.translate_arcs(arcs) @expensive def no_branch_lines(self): no_branch = self.parser.lines_matching( join_regex(self.coverage.config.partial_list), join_regex(self.coverage.config.partial_always_list) ) return no_branch @expensive def arcs(self): return self.parser.arcs() @expensive def exit_counts(self): return self.parser.exit_counts() def missing_arc_description(self, start, end, executed_arcs=None): return self.parser.missing_arc_description(start, end, executed_arcs) @contract(returns='unicode') def source(self): if self._source is None: self._source = get_python_source(self.filename) return self._source def should_be_python(self): """Does it seem like this file should contain Python? This is used to decide if a file reported as part of the execution of a program was really likely to have contained Python in the first place. """ # Get the file extension. _, ext = os.path.splitext(self.filename) # Anything named *.py* should be Python. if ext.startswith('.py'): return True # A file with no extension should be Python. if not ext: return True # Everything else is probably not Python. return False def source_token_lines(self): return source_token_lines(self.source())
{ "content_hash": "ac2a543306cca195198e8784babc5d1e", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 84, "avg_line_length": 30.202970297029704, "alnum_prop": 0.6007211932470087, "repo_name": "mcking49/apache-flask", "id": "8e98bea88245267374937e1c3460fd31cc732f08", "size": "6257", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Python/Lib/site-packages/coverage/python.py", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2501" }, { "name": "C", "bytes": "479174" }, { "name": "C++", "bytes": "21416" }, { "name": "CSS", "bytes": "170391" }, { "name": "Groff", "bytes": "21" }, { "name": "HTML", "bytes": "1003190" }, { "name": "JavaScript", "bytes": "1559701" }, { "name": "PHP", "bytes": "3338" }, { "name": "PLSQL", "bytes": "22886" }, { "name": "PowerShell", "bytes": "8175" }, { "name": "Python", "bytes": "30714489" }, { "name": "Visual Basic", "bytes": "481" } ], "symlink_target": "" }
TEST="$1" TESTOBJ="$2" echo "----------------------------------------" echo "Object file section headers for $TESTOBJ" objdump --section-headers "$TESTOBJ" echo "DWARF information for $TESTOBJ" objdump --dwarf=info "$TESTOBJ" echo "----------------------------------------"
{ "content_hash": "996280d7817276a393c495519f5c4b0a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 47, "avg_line_length": 23.166666666666668, "alnum_prop": 0.5035971223021583, "repo_name": "novaprova/novaprova", "id": "a3eeadc3007da7b445d6c39cdd3c5b1c17b3ee3c", "size": "882", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "tests/ad-globfunc-failed.sh", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "66644" }, { "name": "C++", "bytes": "330015" }, { "name": "M4", "bytes": "8963" }, { "name": "Makefile", "bytes": "16706" }, { "name": "Perl", "bytes": "17350" }, { "name": "Python", "bytes": "3242" }, { "name": "Shell", "bytes": "25031" } ], "symlink_target": "" }
package leap.lang.params; import java.util.Map; import leap.lang.collection.WrappedCaseInsensitiveMap; public class ParamsMap extends WrappedCaseInsensitiveMap<Object> implements Params { private static final long serialVersionUID = 2508710025944765055L; @Override public Map<String, Object> map() { return this; } @Override public boolean contains(String name) { return containsKey(name); } @Override public Object get(String name) { return super.get(name); } @Override public Params set(String name, Object value) { put(name,value); return this; } @Override public Params setAll(Map<String, ? extends Object> m) { putAll(m); return this; } @Override public boolean isIndexed() { return false; } @Override public boolean isNamed() { return true; } @Override public int maxIndex() { return -1; } @Override public Object get(int i) throws IllegalStateException, IndexOutOfBoundsException { throw new IllegalStateException("Not an indexed params"); } }
{ "content_hash": "d45ffdfef3f37d9bb186f2220f0f5e31", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 86, "avg_line_length": 18.03448275862069, "alnum_prop": 0.7084130019120459, "repo_name": "leapframework/framework", "id": "ebbabc856c0fa65ad76ce1dcd86773c8bbf15583", "size": "1661", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "base/lang/src/main/java/leap/lang/params/ParamsMap.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "355" }, { "name": "HTML", "bytes": "645766" }, { "name": "Java", "bytes": "13020209" }, { "name": "JavaScript", "bytes": "167" }, { "name": "PLSQL", "bytes": "30834" }, { "name": "Shell", "bytes": "66" } ], "symlink_target": "" }
/* * $Revision: 2565 $ * * last checkin: * $Author: gutwenger $ * $Date: 2012-07-07 17:14:54 +0200 (Sa, 07. Jul 2012) $ ***************************************************************/ /** \file * \brief Definitions of various auxiliary classes for FME layout. * * \author Martin Gronemann * * \par License: * This file is part of the Open Graph Drawing Framework (OGDF). * * \par * Copyright (C)<br> * See README.txt in the root directory of the OGDF installation for details. * * \par * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * Version 2 or 3 as published by the Free Software Foundation; * see the file LICENSE.txt included in the packaging of this file * for details. * * \par * 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. * * \par * 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. * * \see http://www.gnu.org/copyleft/gpl.html ***************************************************************/ #ifdef _MSC_VER #pragma once #endif #ifndef OGDF_FME_FUNC_H #define OGDF_FME_FUNC_H #include "ArrayGraph.h" #include "LinearQuadtree.h" #include "LinearQuadtreeExpansion.h" #include "LinearQuadtreeBuilder.h" #include "WSPD.h" #include "FMEKernel.h" #include <list> namespace ogdf { //! struct for distributing subtrees to the threads struct FMETreePartition { std::list<LinearQuadtree::NodeID> nodes; __uint32 pointCount; template<typename Func> void for_loop(Func& func) { for (std::list<__uint32>::const_iterator it = nodes.begin();it!=nodes.end(); it++) func(*it); } }; struct FMENodeChainPartition { __uint32 begin; __uint32 numNodes; }; //! the main global options for a run struct FMEGlobalOptions { float preProcTimeStep; //!< time step factor for the preprocessing step float preProcEdgeForceFactor; //!< edge force factor for the preprocessing step __uint32 preProcMaxNumIterations; //!< number of iterations the preprocessing is applied float timeStep; //!< time step factor for the main step float edgeForceFactor; //!< edge force factor for the main step float repForceFactor; //!< repulsive force factor for the main step float normEdgeLength; //!< average edge length when desired edge length are normalized float normNodeSize; //!< average node size when node sizes are normalized __uint32 maxNumIterations; //!< maximum number of iterations in the main step __uint32 minNumIterations; //!< minimum number of iterations to be done regardless of any other conditions bool doPrepProcessing; //!< enable preprocessing bool doPostProcessing; //!< enable postprocessing double stopCritForce; //!< stopping criteria double stopCritAvgForce; //!< stopping criteria double stopCritConstSq; //!< stopping criteria __uint32 multipolePrecision; }; //! forward decl of local context struct struct FMELocalContext; /*! * Global Context */ struct FMEGlobalContext { FMELocalContext** pLocalContext; //!< all local contexts __uint32 numThreads; //!< number of threads, local contexts ArrayGraph* pGraph; //!< pointer to the array graph LinearQuadtree* pQuadtree; //!< pointer to the quadtree LinearQuadtreeExpansion* pExpansion; //!< pointer to the coeefficients WSPD* pWSPD; //!< pointer to the well separated pairs decomposition float* globalForceX; //!< the global node force x array float* globalForceY; //!< the global node force y array FMEGlobalOptions* pOptions; //!< pointer to the global options bool earlyExit; //!< var for the main thread to notify the other threads that they are done float scaleFactor; //!< var float coolDown; float min_x; //!< global point, node min x coordinate for bounding box calculations float max_x; //!< global point, node max x coordinate for bounding box calculations float min_y; //!< global point, node min y coordinate for bounding box calculations float max_y; //!< global point, node max y coordinate for bounding box calculations double currAvgEdgeLength; }; /*! * Local Thread Context */ struct FMELocalContext { FMEGlobalContext* pGlobalContext; //!< pointer to the global context float* forceX; //!< local force array for all nodes, points float* forceY; //!< local force array for all nodes, points double maxForceSq; //!< local maximum force double avgForce; //!< local maximum force float min_x; //!< global point, node min x coordinate for bounding box calculations float max_x; //!< global point, node max x coordinate for bounding box calculations float min_y; //!< global point, node min y coordinate for bounding box calculations float max_y; //!< global point, node max y coordinate for bounding box calculations double currAvgEdgeLength; FMETreePartition treePartition; //!< tree partition assigned to the thread FMENodeChainPartition innerNodePartition; //!< chain of inner nodes assigned to the thread FMENodeChainPartition leafPartition; //!< chain of leaf nodes assigned to the thread LinearQuadtree::NodeID firstInnerNode; //!< first inner nodes the thread prepared LinearQuadtree::NodeID lastInnerNode; //!< last inner nodes the thread prepared __uint32 numInnerNodes; //!< number of inner nodes the thread prepared LinearQuadtree::NodeID firstLeaf; //!< first leaves the thread prepared LinearQuadtree::NodeID lastLeaf; //!< last leaves the thread prepared __uint32 numLeaves; //!< number of leaves the thread prepared }; //! creates a min max functor for the x coords of the node static inline min_max_functor<float> min_max_x_function(FMELocalContext* pLocalContext) { return min_max_functor<float>(pLocalContext->pGlobalContext->pGraph->nodeXPos(), pLocalContext->min_x, pLocalContext->max_x); } //! creates a min max functor for the y coords of the node static inline min_max_functor<float> min_max_y_function(FMELocalContext* pLocalContext) { return min_max_functor<float>(pLocalContext->pGlobalContext->pGraph->nodeYPos(), pLocalContext->min_y, pLocalContext->max_y); } class LQMortonFunctor { public: inline LQMortonFunctor ( FMELocalContext* pLocalContext ) { x = pLocalContext->pGlobalContext->pGraph->nodeXPos(); y = pLocalContext->pGlobalContext->pGraph->nodeYPos(); s = pLocalContext->pGlobalContext->pGraph->nodeSize(); quadtree = pLocalContext->pGlobalContext->pQuadtree; translate_x = -quadtree->minX(); translate_y = -quadtree->minY(); scale = quadtree->scaleInv(); } inline __uint32 operator()(void) const { return quadtree->numberOfPoints(); } inline void operator()(__uint32 i) { LinearQuadtree::LQPoint& p = quadtree->point(i); __uint32 ref = p.ref; p.mortonNr = mortonNumber<__uint64, __uint32>((__uint32)((x[ref] + translate_x)*scale), (__uint32)((y[ref] + translate_y)*scale)); } inline void operator()(__uint32 begin, __uint32 end) { for (__uint32 i = begin; i <= end; i++) { this->operator()(i); } } private: LinearQuadtree* quadtree; float translate_x; float translate_y; double scale; float* x; float* y; float* s; }; //! Point-to-Multipole functor struct p2m_functor { const LinearQuadtree& tree; LinearQuadtreeExpansion& expansions; p2m_functor(const LinearQuadtree& t, LinearQuadtreeExpansion& e) : tree(t), expansions(e) { } inline void operator()(LinearQuadtree::NodeID nodeIndex) { __uint32 numPointsInLeaf = tree.numberOfPoints(nodeIndex); __uint32 firstPointOfLeaf = tree.firstPoint(nodeIndex); for (__uint32 pointIndex=firstPointOfLeaf; pointIndex < (firstPointOfLeaf+numPointsInLeaf); pointIndex++) { expansions.P2M(pointIndex, nodeIndex); } } }; //! creates a Point-to-Multipole functor static inline p2m_functor p2m_function(FMELocalContext* pLocalContext) { return p2m_functor(*pLocalContext->pGlobalContext->pQuadtree, *pLocalContext->pGlobalContext->pExpansion); } //! Multipole-to-Multipole functor struct m2m_functor { const LinearQuadtree& tree; LinearQuadtreeExpansion& expansions; m2m_functor(const LinearQuadtree& t, LinearQuadtreeExpansion& e) : tree(t), expansions(e) { } inline void operator()(LinearQuadtree::NodeID parent, LinearQuadtree::NodeID child) { expansions.M2M(child, parent); } inline void operator()(LinearQuadtree::NodeID nodeIndex) { tree.forall_children(pair_call(*this, nodeIndex))(nodeIndex); } }; //! creates Multipole-to-Multipole functor static inline m2m_functor m2m_function(FMELocalContext* pLocalContext) { return m2m_functor(*pLocalContext->pGlobalContext->pQuadtree, *pLocalContext->pGlobalContext->pExpansion); } //! Multipole-to-Local functor struct m2l_functor { LinearQuadtreeExpansion& expansions; m2l_functor(LinearQuadtreeExpansion& e) : expansions(e) { } inline void operator()(LinearQuadtree::NodeID nodeIndexSource, LinearQuadtree::NodeID nodeIndexReceiver) { expansions.M2L(nodeIndexSource, nodeIndexReceiver); } }; //! creates Multipole-to-Local functor static inline m2l_functor m2l_function(FMELocalContext* pLocalContext) { return m2l_functor(*pLocalContext->pGlobalContext->pExpansion); } //! Local-to-Local functor struct l2l_functor { const LinearQuadtree& tree; LinearQuadtreeExpansion& expansions; l2l_functor(const LinearQuadtree& t, LinearQuadtreeExpansion& e) : tree(t), expansions(e) { } inline void operator()(LinearQuadtree::NodeID parent, LinearQuadtree::NodeID child) { expansions.L2L(parent, child); } inline void operator()(LinearQuadtree::NodeID nodeIndex) { tree.forall_children(pair_call(*this, nodeIndex))(nodeIndex); } }; //! creates Local-to-Local functor static inline l2l_functor l2l_function(FMELocalContext* pLocalContext) { return l2l_functor(*pLocalContext->pGlobalContext->pQuadtree, *pLocalContext->pGlobalContext->pExpansion); } //! Local-to-Point functor struct l2p_functor { const LinearQuadtree& tree; LinearQuadtreeExpansion& expansions; float* fx; float* fy; l2p_functor(const LinearQuadtree& t, LinearQuadtreeExpansion& e, float* x, float* y) : tree(t), expansions(e), fx(x), fy(y) { } inline void operator()(LinearQuadtree::NodeID nodeIndex, LinearQuadtree::PointID pointIndex) { expansions.L2P(nodeIndex, pointIndex, fx[pointIndex], fy[pointIndex]); } inline void operator()(LinearQuadtree::PointID pointIndex) { LinearQuadtree::NodeID nodeIndex = tree.pointLeaf(pointIndex); this->operator ()(nodeIndex, pointIndex); } }; //! creates Local-to-Point functor static inline l2p_functor l2p_function(FMELocalContext* pLocalContext) { return l2p_functor(*pLocalContext->pGlobalContext->pQuadtree, *pLocalContext->pGlobalContext->pExpansion, pLocalContext->forceX, pLocalContext->forceY); } //! Local-to-Point functor struct p2p_functor { const LinearQuadtree& tree; float* fx; float* fy; p2p_functor(const LinearQuadtree& t, float* x, float* y) : tree(t), fx(x), fy(y) { } inline void operator()(LinearQuadtree::NodeID nodeIndexA, LinearQuadtree::NodeID nodeIndexB) { __uint32 offsetA = tree.firstPoint(nodeIndexA); __uint32 offsetB = tree.firstPoint(nodeIndexB); __uint32 numPointsA = tree.numberOfPoints(nodeIndexA); __uint32 numPointsB = tree.numberOfPoints(nodeIndexB); eval_direct_fast(tree.pointX() + offsetA, tree.pointY() + offsetA, tree.pointSize() + offsetA, fx + offsetA, fy + offsetA, numPointsA, tree.pointX() + offsetB, tree.pointY() + offsetB, tree.pointSize() + offsetB, fx + offsetB, fy + offsetB, numPointsB); } inline void operator()(LinearQuadtree::NodeID nodeIndex) { __uint32 offset = tree.firstPoint(nodeIndex); __uint32 numPoints = tree.numberOfPoints(nodeIndex); eval_direct_fast(tree.pointX() + offset, tree.pointY() + offset, tree.pointSize() + offset, fx + offset, fy + offset, numPoints); } }; //! creates Local-to-Point functor static inline p2p_functor p2p_function(FMELocalContext* pLocalContext) { return p2p_functor(*pLocalContext->pGlobalContext->pQuadtree, pLocalContext->forceX, pLocalContext->forceY); } //! The partitioner which partitions the quadtree into subtrees and partitions the sequence of inner nodes and leaves class LQPartitioner { public: LQPartitioner( FMELocalContext* pLocalContext ) { numThreads = pLocalContext->pGlobalContext->numThreads; tree = pLocalContext->pGlobalContext->pQuadtree; localContexts = pLocalContext->pGlobalContext->pLocalContext; } void partitionNodeChains() { __uint32 numInnerNodesPerThread = tree->numberOfInnerNodes() / numThreads; if (numInnerNodesPerThread < 25) { localContexts[0]->innerNodePartition.begin = tree->firstInnerNode(); localContexts[0]->innerNodePartition.numNodes = tree->numberOfInnerNodes(); for (__uint32 i=1; i< numThreads; i++) { localContexts[i]->innerNodePartition.numNodes = 0; } } else { LinearQuadtree::NodeID curr = tree->firstInnerNode(); currThread = 0; localContexts[0]->innerNodePartition.begin = curr; localContexts[0]->innerNodePartition.numNodes = 0; for (__uint32 i=0; i< tree->numberOfInnerNodes(); i++) { localContexts[currThread]->innerNodePartition.numNodes++; curr = tree->nextNode(curr); if ((localContexts[currThread]->innerNodePartition.numNodes>=numInnerNodesPerThread) && (currThread < numThreads-1)) { currThread++; localContexts[currThread]->innerNodePartition.numNodes = 0; localContexts[currThread]->innerNodePartition.begin = curr; } } } __uint32 numLeavesPerThread = tree->numberOfLeaves() / numThreads; if (numLeavesPerThread < 25) { localContexts[0]->leafPartition.begin = tree->firstLeaf(); localContexts[0]->leafPartition.numNodes = tree->numberOfLeaves(); for (__uint32 i=1; i< numThreads; i++) { localContexts[i]->leafPartition.numNodes = 0; } } else { LinearQuadtree::NodeID curr = tree->firstLeaf(); currThread = 0; localContexts[0]->leafPartition.begin = curr; localContexts[0]->leafPartition.numNodes = 0; for (__uint32 i=0; i< tree->numberOfLeaves(); i++) { localContexts[currThread]->leafPartition.numNodes++; curr = tree->nextNode(curr); if ((localContexts[currThread]->leafPartition.numNodes>=numLeavesPerThread) && (currThread < numThreads-1)) { currThread++; localContexts[currThread]->leafPartition.numNodes = 0; localContexts[currThread]->leafPartition.begin = curr; } } } } void partition() { partitionNodeChains(); currThread = 0; numPointsPerThread = tree->numberOfPoints() / numThreads; for (__uint32 i=0; i < numThreads; i++) { localContexts[i]->treePartition.nodes.clear(); localContexts[i]->treePartition.pointCount = 0; } if (numThreads>1) newPartition(); } void newPartition(__uint32 node) { __uint32 bound = tree->numberOfPoints() / (numThreads*numThreads); if (tree->isLeaf(node) || (tree->numberOfPoints(node) < bound)) l_par.push_back(node); else for (__uint32 i = 0; i < tree->numberOfChilds(node); i++) newPartition(tree->child(node, i)); } void newPartition() { l_par.clear(); newPartition(tree->root()); __uint32 bound = (tree->numberOfPoints() / (numThreads)) + (tree->numberOfPoints() / (numThreads*numThreads*2)); while (!l_par.empty()) { FMETreePartition* partition = currPartition(); __uint32 v = l_par.front(); if (((partition->pointCount + tree->numberOfPoints(v)) <= bound) || (currThread==numThreads-1)) { partition->pointCount += tree->numberOfPoints(v); partition->nodes.push_back(v); tree->nodeFence(v); l_par.pop_front(); } else { currThread++; } } } FMETreePartition* currPartition() { return &localContexts[currThread]->treePartition; } private: __uint32 numPointsPerThread; __uint32 numThreads; __uint32 currThread; __uint32 currPointCount; std::list<__uint32> l_par; LinearQuadtree* tree; FMELocalContext** localContexts; }; class LQPointUpdateFunctor { public: inline LQPointUpdateFunctor ( FMELocalContext* pLocalContext ) { x = pLocalContext->pGlobalContext->pGraph->nodeXPos(); y = pLocalContext->pGlobalContext->pGraph->nodeYPos(); s = pLocalContext->pGlobalContext->pGraph->nodeSize(); quadtree = pLocalContext->pGlobalContext->pQuadtree; } inline __uint32 operator()(void) const { return quadtree->numberOfPoints(); } inline void operator()(__uint32 i) { LinearQuadtree::LQPoint& p = quadtree->point(i); __uint32 ref = p.ref; quadtree->setPoint(i, x[ref], y[ref], s[ref]); } inline void operator()(__uint32 begin, __uint32 end) { for (__uint32 i = begin; i <= end; i++) { this->operator()(i); } } private: LinearQuadtree* quadtree; float* x; float* y; float* s; }; /*! * Computes the coords and size of the i-th node in the LinearQuadtree */ class LQCoordsFunctor { public: inline LQCoordsFunctor( FMELocalContext* pLocalContext ) { quadtree = pLocalContext->pGlobalContext->pQuadtree; quadtreeExp = pLocalContext->pGlobalContext->pExpansion; } inline __uint32 operator()(void) const { return quadtree->numberOfNodes(); } inline void operator()( __uint32 i ) { quadtree->computeCoords(i); } inline void operator()(__uint32 begin, __uint32 end) { for (__uint32 i = begin; i <= end; i++) { this->operator()(i); } } private: LinearQuadtree* quadtree; LinearQuadtreeExpansion* quadtreeExp; }; /*! * Converts the multipole expansion coefficients from all nodes which are well separated from the i-th node * to local expansion coefficients and adds them to the local expansion coefficients of the i-th node */ class M2LFunctor { public: inline M2LFunctor( FMELocalContext* pLocalContext ) { quadtree = pLocalContext->pGlobalContext->pQuadtree; quadtreeExp = pLocalContext->pGlobalContext->pExpansion; wspd = pLocalContext->pGlobalContext->pWSPD; } inline __uint32 operator()(void) const { return quadtree->numberOfNodes(); } inline void operator()(__uint32 i) { __uint32 currEntryIndex = wspd->firstPairEntry(i); for (__uint32 k = 0; k < wspd->numWSNodes(i); k++) { __uint32 j = wspd->wsNodeOfPair(currEntryIndex, i); quadtreeExp->M2L(j, i); currEntryIndex = wspd->nextPair(currEntryIndex, i); } } inline void operator()(__uint32 begin, __uint32 end) { for (__uint32 i = begin; i <= end; i++) { this->operator()(i); } } private: LinearQuadtree* quadtree; LinearQuadtreeExpansion* quadtreeExp; WSPD* wspd; }; /*! * Calculates the repulsive forces acting between all nodes inside the cell of the i-th LinearQuadtree node. */ class NDFunctor { public: inline NDFunctor( FMELocalContext* pLocalContext ) { quadtree = pLocalContext->pGlobalContext->pQuadtree; quadtreeExp = pLocalContext->pGlobalContext->pExpansion; forceArrayX = pLocalContext->forceX; forceArrayY = pLocalContext->forceY; } inline __uint32 operator()(void) const { return quadtree->numberOfDirectNodes(); } inline void operator()(__uint32 i) { __uint32 node = quadtree->directNode(i); __uint32 offset = quadtree->firstPoint(node); __uint32 numPoints = quadtree->numberOfPoints(node); eval_direct_fast(quadtree->pointX() + offset, quadtree->pointY() + offset, quadtree->pointSize() + offset, forceArrayX + offset, forceArrayY + offset, numPoints); } inline void operator()(__uint32 begin, __uint32 end) { for (__uint32 i = begin; i <= end; i++) { this->operator()(i); } } private: LinearQuadtree* quadtree; LinearQuadtreeExpansion* quadtreeExp; float* forceArrayX; float* forceArrayY; }; /*! * Calculates the repulsive forces acting between all nodes of the direct interacting cells of the i-th node */ class D2DFunctor { public: inline D2DFunctor( FMELocalContext* pLocalContext ) { quadtree = pLocalContext->pGlobalContext->pQuadtree; quadtreeExp = pLocalContext->pGlobalContext->pExpansion; forceArrayX = pLocalContext->forceX; forceArrayY = pLocalContext->forceY; } inline __uint32 operator()(void) const { return quadtree->numberOfDirectPairs(); } inline void operator()(__uint32 i) { __uint32 nodeA = quadtree->directNodeA(i); __uint32 nodeB = quadtree->directNodeB(i); __uint32 offsetA = quadtree->firstPoint(nodeA); __uint32 offsetB = quadtree->firstPoint(nodeB); __uint32 numPointsA = quadtree->numberOfPoints(nodeA); __uint32 numPointsB = quadtree->numberOfPoints(nodeB); eval_direct_fast(quadtree->pointX() + offsetA, quadtree->pointY() + offsetA, quadtree->pointSize() + offsetA, forceArrayX + offsetA, forceArrayY + offsetA, numPointsA, quadtree->pointX() + offsetB, quadtree->pointY() + offsetB, quadtree->pointSize() + offsetB, forceArrayX + offsetB, forceArrayY + offsetB, numPointsB); } inline void operator()(__uint32 begin, __uint32 end) { for (__uint32 i = begin; i <= end; i++) { this->operator()(i); } } private: LinearQuadtree* quadtree; LinearQuadtreeExpansion* quadtreeExp; float* forceArrayX; float* forceArrayY; }; enum { EDGE_FORCE_SUB_REP = 0x2, EDGE_FORCE_DIV_DEGREE = 0x8 }; template<unsigned int FLAGS> class EdgeForceFunctor { public: inline EdgeForceFunctor( FMELocalContext* pLocalContext ) { pGraph = pLocalContext->pGlobalContext->pGraph; x = pGraph->nodeXPos(); y = pGraph->nodeYPos(); edgeInfo = pGraph->edgeInfo(); nodeInfo = pGraph->nodeInfo(); desiredEdgeLength = pGraph->desiredEdgeLength(); nodeSize = pGraph->nodeSize(); forceArrayX = pLocalContext->forceX; forceArrayY = pLocalContext->forceY; } inline __uint32 operator()(void) const { return pGraph->numEdges(); } inline void operator()(__uint32 i) { const EdgeAdjInfo& e_info = edgeInfo[i]; const NodeAdjInfo& a_info = nodeInfo[e_info.a]; const NodeAdjInfo& b_info = nodeInfo[e_info.b]; float d_x = x[e_info.a] - x[e_info.b]; float d_y = y[e_info.a] - y[e_info.b]; float d_sq = d_x*d_x + d_y*d_y; float f = (float)(logf(d_sq)*0.5f-logf(desiredEdgeLength[i])); float fa = f*0.25f; float fb = f*0.25f; if (FLAGS & EDGE_FORCE_DIV_DEGREE) { fa = (float)(fa/((float)a_info.degree)); fb = (float)(fb/((float)b_info.degree)); } if (FLAGS & EDGE_FORCE_SUB_REP) { fa += (nodeSize[e_info.b] / d_sq); fb += (nodeSize[e_info.a] / d_sq); } forceArrayX[e_info.a] -= fa*d_x; forceArrayY[e_info.a] -= fa*d_y; forceArrayX[e_info.b] += fb*d_x; forceArrayY[e_info.b] += fb*d_y; } inline void operator()(__uint32 begin, __uint32 end) { for (__uint32 i = begin; i <= end; i++) { this->operator()(i); } } private: float* x; float* y; EdgeAdjInfo* edgeInfo; NodeAdjInfo* nodeInfo; ArrayGraph* pGraph; float* desiredEdgeLength; float* nodeSize; float* forceArrayX; float* forceArrayY; }; template<unsigned int FLAGS> static inline EdgeForceFunctor<FLAGS> edge_force_function( FMELocalContext* pLocalContext ) { return EdgeForceFunctor<FLAGS>( pLocalContext ); } enum { COLLECT_NO_FACTOR = 0x00, COLLECT_EDGE_FACTOR = 0x01, COLLECT_REPULSIVE_FACTOR = 0x02, COLLECT_EDGE_FACTOR_PREP = 0x04, COLLECT_TREE_2_GRAPH_ORDER = 0x08, COLLECT_ZERO_THREAD_ARRAY = 0x10 }; template<unsigned int FLAGS> class CollectForceFunctor { public: inline CollectForceFunctor( FMELocalContext* pLocalContext ) { numContexts = pLocalContext->pGlobalContext->numThreads; globalContext = pLocalContext->pGlobalContext; localContexts = pLocalContext->pGlobalContext->pLocalContext; globalArrayX = globalContext->globalForceX; globalArrayY = globalContext->globalForceY; pGraph = pLocalContext->pGlobalContext->pGraph; if (FLAGS & COLLECT_EDGE_FACTOR) factor = pLocalContext->pGlobalContext->pOptions->edgeForceFactor; else if (FLAGS & COLLECT_REPULSIVE_FACTOR) factor = pLocalContext->pGlobalContext->pOptions->repForceFactor; else if (FLAGS & COLLECT_EDGE_FACTOR_PREP) factor = pLocalContext->pGlobalContext->pOptions->preProcEdgeForceFactor; else factor = 1.0; } inline __uint32 operator()(void) const { return pGraph->numNodes(); } inline void operator()(__uint32 i) { float sumX = 0.0f; float sumY = 0.0f; for (__uint32 j=0; j < numContexts; j++) { float* localArrayX = localContexts[j]->forceX; float* localArrayY = localContexts[j]->forceY; sumX += localArrayX[i]; sumY += localArrayY[i]; if (FLAGS & COLLECT_ZERO_THREAD_ARRAY) { localArrayX[i] = 0.0f; localArrayY[i] = 0.0f; } } if (FLAGS & COLLECT_TREE_2_GRAPH_ORDER) { __uint32 l = (globalContext->pQuadtree->refOfPoint(i)); if (FLAGS & COLLECT_REPULSIVE_FACTOR) { // prevent some evil effects if (pGraph->nodeInfo(l).degree > 100) { sumX /= (float)pGraph->nodeInfo(l).degree; sumY /= (float)pGraph->nodeInfo(l).degree; } } globalArrayX[l] += sumX*factor; globalArrayY[l] += sumY*factor; } else { if (FLAGS & COLLECT_REPULSIVE_FACTOR) { // prevent some evil effects if (pGraph->nodeInfo(i).degree > 100) { sumX /= (float)pGraph->nodeInfo(i).degree; sumY /= (float)pGraph->nodeInfo(i).degree; } } globalArrayX[i] += sumX*factor; globalArrayY[i] += sumY*factor; } } inline void operator()(__uint32 begin, __uint32 end) { for (__uint32 i = begin; i <= end; i++) { this->operator()(i); } } private: ArrayGraph* pGraph; FMEGlobalContext* globalContext; FMELocalContext** localContexts; float* globalArrayX; float* globalArrayY; __uint32 numContexts; float factor; }; template<unsigned int FLAGS> static inline CollectForceFunctor<FLAGS> collect_force_function( FMELocalContext* pLocalContext ) { return CollectForceFunctor<FLAGS>( pLocalContext ); } enum { TIME_STEP_NORMAL = 0x1, TIME_STEP_PREP = 0x2, ZERO_GLOBAL_ARRAY = 0x4, USE_NODE_MOVE_RAD = 0x8 }; template<unsigned int FLAGS> class NodeMoveFunctor { public: inline NodeMoveFunctor( FMELocalContext* pLocalContext )// float* xCoords, float* yCoords, float ftimeStep, float* globalForceArray): x(xCoords), y(yCoords), timeStep(ftimeStep), forceArray(globalForceArray) { if (FLAGS & TIME_STEP_NORMAL) timeStep = pLocalContext->pGlobalContext->pOptions->timeStep * pLocalContext->pGlobalContext->coolDown; else if (FLAGS & TIME_STEP_PREP) timeStep = pLocalContext->pGlobalContext->pOptions->preProcTimeStep; else timeStep = 1.0; pGraph = pLocalContext->pGlobalContext->pGraph; x = pGraph->nodeXPos(); y = pGraph->nodeYPos(); nodeMoveRadius = pGraph->nodeMoveRadius(); forceArrayX = pLocalContext->pGlobalContext->globalForceX; forceArrayY = pLocalContext->pGlobalContext->globalForceY; localContext = pLocalContext; currentEdgeLength = pLocalContext->pGlobalContext->pGraph->desiredEdgeLength(); } /* inline void operator()(void) const { return pGraph->numNodes(); }; */ inline void operator()(__uint32 i) { float d_x = forceArrayX[i]* timeStep; float d_y = forceArrayY[i]* timeStep; double dsq = (d_x*d_x + d_y*d_y); double d = sqrt(dsq); localContext->maxForceSq = max<double>(localContext->maxForceSq, (double)dsq ); localContext->avgForce += d; if (d < FLT_MAX) { x[i] += (float)((d_x)); y[i] += (float)((d_y)); if (FLAGS & ZERO_GLOBAL_ARRAY) { forceArrayX[i] = 0.0; forceArrayY[i] = 0.0; } else { forceArrayX[i] = (float)((d_x));; forceArrayY[i] = (float)((d_y));; } } else { forceArrayX[i] = 0.0; forceArrayY[i] = 0.0; } } inline void operator()(__uint32 begin, __uint32 end) { for (__uint32 i = begin; i <= end; i++) { this->operator()(i); } } private: float timeStep; float* x; float* y; float* forceArrayX; float* forceArrayY; float* nodeMoveRadius; float* currentEdgeLength; ArrayGraph* pGraph; FMELocalContext* localContext; }; template<unsigned int FLAGS> static inline NodeMoveFunctor<FLAGS> node_move_function( FMELocalContext* pLocalContext ) { return NodeMoveFunctor<FLAGS>( pLocalContext ); } template<typename TYP> inline void for_loop_array_set(__uint32 threadNr, __uint32 numThreads, TYP* a, __uint32 n, TYP value) { __uint32 s = n/numThreads; __uint32 o = s*threadNr; if (threadNr == numThreads-1) s = s + (n % numThreads); for (__uint32 i = 0; i < s; i++ ) { a[o+i] = value; } } } // end of namespace #endif
{ "content_hash": "007abbcb40a72fafddd6830ee764f973", "timestamp": "", "source": "github", "line_count": 1047, "max_line_length": 208, "avg_line_length": 27.29321872015282, "alnum_prop": 0.7005529115341546, "repo_name": "jim-bo/silp2", "id": "9338fd5507bd5aba8996aea8baecfb8d415514f2", "size": "28576", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "OGDF/src/energybased/FMEFunc.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "500938" }, { "name": "C++", "bytes": "6069099" }, { "name": "CSS", "bytes": "21295" }, { "name": "Objective-C", "bytes": "28724" }, { "name": "Python", "bytes": "177902" }, { "name": "Shell", "bytes": "411" } ], "symlink_target": "" }
<html><body> <style> body, h1, h2, h3, div, span, p, pre, a { margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } body { font-size: 13px; padding: 1em; } h1 { font-size: 26px; margin-bottom: 1em; } h2 { font-size: 24px; margin-bottom: 1em; } h3 { font-size: 20px; margin-bottom: 1em; margin-top: 1em; } pre, code { line-height: 1.5; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; } pre { margin-top: 0.5em; } h1, h2, h3, p { font-family: Arial, sans serif; } h1, h2, h3 { border-bottom: solid #CCC 1px; } .toc_element { margin-top: 0.5em; } .firstline { margin-left: 2 em; } .method { margin-top: 1em; border: solid 1px #CCC; padding: 1em; background: #EEE; } .details { font-weight: bold; font-size: 14px; } </style> <h1><a href="servicedirectory_v1beta1.html">Service Directory API</a> . <a href="servicedirectory_v1beta1.projects.html">projects</a> . <a href="servicedirectory_v1beta1.projects.locations.html">locations</a></h1> <h2>Instance Methods</h2> <p class="toc_element"> <code><a href="servicedirectory_v1beta1.projects.locations.namespaces.html">namespaces()</a></code> </p> <p class="firstline">Returns the namespaces Resource.</p> <p class="toc_element"> <code><a href="servicedirectory_v1beta1.projects.locations.registrationPolicies.html">registrationPolicies()</a></code> </p> <p class="firstline">Returns the registrationPolicies Resource.</p> <p class="toc_element"> <code><a href="#close">close()</a></code></p> <p class="firstline">Close httplib2 connections.</p> <p class="toc_element"> <code><a href="#get">get(name, x__xgafv=None)</a></code></p> <p class="firstline">Gets information about a location.</p> <p class="toc_element"> <code><a href="#list">list(name, filter=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> <p class="firstline">Lists information about the supported locations for this service.</p> <p class="toc_element"> <code><a href="#list_next">list_next()</a></code></p> <p class="firstline">Retrieves the next page of results.</p> <h3>Method Details</h3> <div class="method"> <code class="details" id="close">close()</code> <pre>Close httplib2 connections.</pre> </div> <div class="method"> <code class="details" id="get">get(name, x__xgafv=None)</code> <pre>Gets information about a location. Args: name: string, Resource name for the location. (required) x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # A resource that represents Google Cloud Platform location. &quot;displayName&quot;: &quot;A String&quot;, # The friendly name for this location, typically a nearby city name. For example, &quot;Tokyo&quot;. &quot;labels&quot;: { # Cross-service attributes for the location. For example {&quot;cloud.googleapis.com/region&quot;: &quot;us-east1&quot;} &quot;a_key&quot;: &quot;A String&quot;, }, &quot;locationId&quot;: &quot;A String&quot;, # The canonical id for this location. For example: `&quot;us-east1&quot;`. &quot;metadata&quot;: { # Service-specific metadata. For example the available capacity at the given location. &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL. }, &quot;name&quot;: &quot;A String&quot;, # Resource name for the location, which may vary between implementations. For example: `&quot;projects/example-project/locations/us-east1&quot;` }</pre> </div> <div class="method"> <code class="details" id="list">list(name, filter=None, pageSize=None, pageToken=None, x__xgafv=None)</code> <pre>Lists information about the supported locations for this service. Args: name: string, The resource that owns the locations collection, if applicable. (required) filter: string, A filter to narrow down results to a preferred subset. The filtering language accepts strings like `&quot;displayName=tokyo&quot;`, and is documented in more detail in [AIP-160](https://google.aip.dev/160). pageSize: integer, The maximum number of results to return. If not set, the service selects a default. pageToken: string, A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page. x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # The response message for Locations.ListLocations. &quot;locations&quot;: [ # A list of locations that matches the specified filter in the request. { # A resource that represents Google Cloud Platform location. &quot;displayName&quot;: &quot;A String&quot;, # The friendly name for this location, typically a nearby city name. For example, &quot;Tokyo&quot;. &quot;labels&quot;: { # Cross-service attributes for the location. For example {&quot;cloud.googleapis.com/region&quot;: &quot;us-east1&quot;} &quot;a_key&quot;: &quot;A String&quot;, }, &quot;locationId&quot;: &quot;A String&quot;, # The canonical id for this location. For example: `&quot;us-east1&quot;`. &quot;metadata&quot;: { # Service-specific metadata. For example the available capacity at the given location. &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL. }, &quot;name&quot;: &quot;A String&quot;, # Resource name for the location, which may vary between implementations. For example: `&quot;projects/example-project/locations/us-east1&quot;` }, ], &quot;nextPageToken&quot;: &quot;A String&quot;, # The standard List next-page token. }</pre> </div> <div class="method"> <code class="details" id="list_next">list_next()</code> <pre>Retrieves the next page of results. Args: previous_request: The request for the previous page. (required) previous_response: The response from the request for the previous page. (required) Returns: A request object that you can call &#x27;execute()&#x27; on to request the next page. Returns None if there are no more items in the collection. </pre> </div> </body></html>
{ "content_hash": "5b20d7f552bc0973b3a56a603f8beccc", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 224, "avg_line_length": 35.18232044198895, "alnum_prop": 0.6896984924623115, "repo_name": "googleapis/google-api-python-client", "id": "9733151ce8927a3e1ee925b5d92adecd55968075", "size": "6368", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "docs/dyn/servicedirectory_v1beta1.projects.locations.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "1276" }, { "name": "Python", "bytes": "482401" }, { "name": "Shell", "bytes": "32576" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2013 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources> <dimen name="preview_margin">2dp</dimen> <dimen name="shadow_margin">5dp</dimen> <dimen name="crop_min_side">45dp</dimen> <dimen name="crop_touch_tolerance">20dp</dimen> <dimen name="wp_selector_dash_length">4dp</dimen> <dimen name="wp_selector_off_length">4dp</dimen> </resources>
{ "content_hash": "d295b4a13424e81ad53aaeb6fdc3744d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 77, "avg_line_length": 42.95652173913044, "alnum_prop": 0.7044534412955465, "repo_name": "jameliu/Camera2", "id": "fc91dbfb2040c1affa39451c8f4b917d4b0a0b60", "size": "988", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "app/src/main/res/values/crop_dimens.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2191271" } ], "symlink_target": "" }
A bootloader for the Cypress FX2 designed to be as small as possible.
{ "content_hash": "6165f1ed2fba0a3f358b5e6a985e69a2", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 69, "avg_line_length": 70, "alnum_prop": 0.8, "repo_name": "mithro/fx2-microload", "id": "768f712c761a42c020aabedeb5335432ac942744", "size": "70", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "10256" }, { "name": "Makefile", "bytes": "396" } ], "symlink_target": "" }
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016] EMBL-European Bioinformatics Institute 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. =cut =head1 CONTACT Please email comments or questions to the public Ensembl developers list at <http://lists.ensembl.org/mailman/listinfo/dev>. Questions may also be sent to the Ensembl help desk at <http://www.ensembl.org/Help/Contact>. =cut package Bio::EnsEMBL::DBSQL::MetaCoordContainer; use strict; use warnings; use vars qw(@ISA); use strict; use Bio::EnsEMBL::DBSQL::BaseAdaptor; use Bio::EnsEMBL::Utils::Exception; @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor); sub new { my $class = shift; my $self = $class->SUPER::new(@_); # # Retrieve the list of the coordinate systems that features are stored # in and cache them. # my @coord_systems = @{ $self->db()->dnadb()->get_CoordSystemAdaptor->fetch_all() }; my @cs_ids; foreach my $cs (@coord_systems) { push( @cs_ids, $cs->dbID() ) } my $sth = $self->prepare( 'SELECT mc.table_name, mc.coord_system_id, mc.max_length ' . 'FROM meta_coord mc ' . 'WHERE mc.coord_system_id in (' . join( ',', @cs_ids ) . ')' ); $sth->execute(); while ( my ( $table_name, $cs_id, $max_length ) = $sth->fetchrow_array() ) { $table_name = lc($table_name); $self->{'_feature_cache'}->{$table_name} ||= []; push( @{ $self->{'_feature_cache'}->{$table_name} }, $cs_id ); $self->{'_max_len_cache'}->{$cs_id}->{$table_name} = $max_length; } $sth->finish(); return $self; } ## end sub new =head2 fetch_all_CoordSystems_by_feature_type Arg [1] : string $table - the name of the table to retrieve coord systems for. E.g. 'gene', 'exon', 'dna_align_feature' Example : @css = @{$mcc->fetch_all_CoordSystems_by_feature_type('gene')}; Description: This retrieves the list of coordinate systems that features in a particular table are stored. It is used internally by the API to perform queries to these tables and to ensure that features are only stored in appropriate coordinate systems. Returntype : listref of Bio::EnsEMBL::CoordSystem objects Exceptions : throw if name argument not provided Caller : BaseFeatureAdaptor Status : Stable =cut sub fetch_all_CoordSystems_by_feature_type { my $self = shift; my $table = lc(shift); #case insensitive matching throw('Name argument is required') unless $table; if(!$self->{'_feature_cache'}->{$table}) { return []; } my @cs_ids = @{$self->{'_feature_cache'}->{$table}}; my @coord_systems; my $csa = $self->db->get_CoordSystemAdaptor(); foreach my $cs_id (@cs_ids) { my $cs = $csa->fetch_by_dbID($cs_id); if(!$cs) { throw("meta_coord table refers to non-existant coord_system $cs_id"); } push @coord_systems, $cs; } return \@coord_systems; } =head2 fetch_max_length_by_CoordSystem_feature_type Arg [1] : Bio::EnsEMBL::CoordSystem $cs Arg [2] : string $table Example : $max_len = $mcc->fetch_max_length_by_CoordSystem_feature_type($cs,'gene'); Description: Returns the maximum length of features of a given type in a given coordinate system. Returntype : int or undef Exceptions : throw on incorrect argument Caller : BaseFeatureAdaptor Status : Stable =cut sub fetch_max_length_by_CoordSystem_feature_type { my $self = shift; my $cs = shift; my $table = shift; if(!ref($cs) || !$cs->isa('Bio::EnsEMBL::CoordSystem')) { throw('Bio::EnsEMBL::CoordSystem argument expected'); } throw("Table name argument is required") unless $table; return $self->{'_max_len_cache'}->{$cs->dbID()}->{lc($table)}; } =head2 add_feature_type Arg [1] : Bio::EnsEMBL::CoordSystem $cs The coordinate system to associate with a feature table Arg [2] : string $table - the name of the table in which features of a given coordinate system will be stored in Arg [3] : int $length This length is used to update the max_length in the database and the internal cache. Example : $csa->add_feature_table($chr_coord_system, 'gene'); Description: This function tells the coordinate system adaptor that features from a specified table will be stored in a certain coordinate system. If this information is not already stored in the database it will be added. Returntype : none Exceptions : none Caller : BaseFeatureAdaptor Status : Stable =cut sub add_feature_type { my $self = shift; my $cs = shift; my $table = lc(shift); my $length = shift; if(!ref($cs) || !$cs->isa('Bio::EnsEMBL::CoordSystem')) { throw('CoordSystem argument is required.'); } if(!$table) { throw('Table argument is required.'); } my $cs_ids = $self->{'_feature_cache'}->{$table} || []; my ($exists) = grep {$cs->dbID() == $_} @$cs_ids; if( $exists ) { if( !$self->{'_max_len_cache'}->{$cs->dbID()}->{$table} || $self->{'_max_len_cache'}->{$cs->dbID()}->{$table} < $length ) { my $sth = $self->prepare('UPDATE meta_coord ' . "SET max_length = $length " . 'WHERE coord_system_id = ? ' . 'AND table_name = ? '. "AND (max_length<$length ". "OR max_length is null)"); $sth->execute( $cs->dbID(), $table ); $self->{'_max_len_cache'}->{$cs->dbID()}->{$table} = $length; } return; } #store the new tablename -> coord system relationship in the db #ignore failures b/c during the pipeline multiple processes may try #to update this table and only the first will be successful my $insert_ignore = $self->insert_ignore_clause(); my $sth = $self->prepare(qq{ ${insert_ignore} INTO meta_coord (coord_system_id, table_name, max_length) VALUES (?, ?, ?) } ); $sth->execute($cs->dbID, $table, $length ); #update the internal cache $self->{'_feature_cache'}->{$table} ||= []; push @{$self->{'_feature_cache'}->{$table}}, $cs->dbID(); $self->{'_max_len_cache'}->{$cs->dbID()}->{$table} = $length; return; } =head2 remove_feature_type Arg [1] : Bio::EnsEMBL::CoordSystem $cs The coordinate system to associate with a feature table Arg [2] : string $table - the name of the table in which features of a given coordinate system are being removed Example : $csa->remove_feature_table($chr_coord_system, 'gene'); Description: This function tells the coordinate system adaptor that features have been fully removed from a certain coordinate system. Use with caution as it will cause issues if there are still features left. Returntype : none Exceptions : none Caller : BaseFeatureAdaptor Status : Stable =cut sub remove_feature_type { my $self = shift; my $cs = shift; my $table = lc(shift); my $length = shift; if(!ref($cs) || !$cs->isa('Bio::EnsEMBL::CoordSystem')) { throw('CoordSystem argument is required.'); } if(!$table) { throw('Table argument is required.'); } my $cs_ids = $self->{'_feature_cache'}->{$table} || []; my ($exists) = grep {$cs->dbID() == $_} @$cs_ids; if( $exists ) { my $sth = $self->prepare('DELETE FROM meta_coord ' . 'WHERE coord_system_id = ? ' . 'AND table_name = ? '); $sth->execute( $cs->dbID(), $table ); delete $self->{'_max_len_cache'}->{$cs->dbID()}->{$table}; } return; } 1;
{ "content_hash": "9c9de99fc0b18dbc0a4f09d821ff06c1", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 100, "avg_line_length": 29.749116607773853, "alnum_prop": 0.6035158569901413, "repo_name": "danstaines/ensembl", "id": "429e7a1194dcc26cf6820106108e601c5441eed2", "size": "8419", "binary": false, "copies": "1", "ref": "refs/heads/release/87", "path": "modules/Bio/EnsEMBL/DBSQL/MetaCoordContainer.pm", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "7944" }, { "name": "HTML", "bytes": "1434" }, { "name": "PLSQL", "bytes": "12625" }, { "name": "PLpgSQL", "bytes": "268734" }, { "name": "Perl", "bytes": "6383145" }, { "name": "Prolog", "bytes": "46289" }, { "name": "SQLPL", "bytes": "10911" }, { "name": "Shell", "bytes": "9158" } ], "symlink_target": "" }
module Mongo module Protocol # MongoDB Wire protocol KillCursors message. # # This is a client request message that is sent to the server in order # to kill a number of cursors. # # @api semipublic class KillCursors < Message # Creates a new KillCursors message # # @example Kill the cursor on the server with id 1. # KillCursors.new([1]) # # @param cursor_ids [Array<Fixnum>] The cursor ids to kill. # @param options [Hash] The additional kill cursors options. def initialize(cursor_ids, options = {}) @cursor_ids = cursor_ids @id_count = @cursor_ids.size end # The log message for a kill cursors operation. # # @example Get the log message. # kill_cursors.log_message # # @return [ String ] The log message # # @since 2.0.0 def log_message fields = [] fields << ["%s |", "KILLCURSORS"] fields << ["cursor_ids=%s", cursor_ids.inspect] f, v = fields.transpose f.join(" ") % v end private # The operation code required to specify +KillCursors+ message. # @return [Fixnum] the operation code. def op_code 2007 end # Field representing Zero encoded as an Int32. field :zero, Zero # @!attribute # @return [Fixnum] Count of the number of cursor ids. field :id_count, Int32 # @!attribute # @return [Array<Fixnum>] Cursors to kill. field :cursor_ids, Int64, true end end end
{ "content_hash": "84db0152d8858e54679879a496338367", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 74, "avg_line_length": 26.233333333333334, "alnum_prop": 0.5806861499364676, "repo_name": "0x00evil/mongo-ruby-driver", "id": "ab05084072cf5c81388d79f8fa05bb6189267a8c", "size": "2159", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/mongo/protocol/kill_cursors.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ruby", "bytes": "949776" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>semantics: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.2 / semantics - 8.11.1</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> semantics <small> 8.11.1 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-08-29 10:22:14 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-08-29 10:22:14 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.12 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.7.2 Formal proof management system. num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; authors: [ &quot;Yves Bertot&quot; ] maintainer: &quot;kartiksinghal@gmail.com&quot; homepage: &quot;https://github.com/coq-community/semantics&quot; dev-repo: &quot;git+https://github.com/coq-community/semantics.git&quot; bug-reports: &quot;https://github.com/coq-community/semantics/issues&quot; license: &quot;MIT&quot; synopsis: &quot;A survey of semantics styles, from natural semantics through structural operational, axiomatic, and denotational semantics, to abstract interpretation&quot; description: &quot;&quot;&quot; This is a survey of programming language semantics styles for a miniature example of a programming language, with their encoding in Coq, the proofs of equivalence of different styles, and the proof of soundess of tools obtained from axiomatic semantics or abstract interpretation. The tools can be run inside Coq, thus making them available for proof by reflection, and the code can also be extracted and connected to a yacc-based parser, thanks to the use of a functor parameterized by a module type of strings. A hand-written parser is also provided in Coq, but there are no proofs associated. &quot;&quot;&quot; build: [make &quot;-j%{jobs}%&quot; ] install: [make &quot;install&quot;] depends: [ &quot;coq&quot; {&gt;= &quot;8.10&quot;} &quot;ocamlbuild&quot; {build} ] tags: [ &quot;category:Computer Science/Semantics&quot; &quot;category:Compilation/Semantics&quot; &quot;keyword:natural semantics&quot; &quot;keyword:denotational semantics&quot; &quot;keyword:axiomatic semantics&quot; &quot;keyword:Hoare logic&quot; &quot;keyword:Dijkstra weakest pre-condition calculus&quot; &quot;keyword:abstract interpretation&quot; &quot;keyword:intervals&quot; &quot;logpath:Semantics&quot; ] url { src: &quot;https://github.com/coq-community/semantics/archive/v8.11.1.tar.gz&quot; checksum: [ &quot;md5=ed6ac2b800fd6277e9bf8a49ea9f4468&quot; &quot;sha512=02c6c8f8049e23fd36ec754f3df26d52f2b8f9e7f9d6b86841970dbad164a4283fdb33f8711aea17cafc73c4159dfdcb3005cf926b5bb1d2ebd847bddcbecdf5&quot; ] } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-semantics.8.11.1 coq.8.7.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.2). The following dependencies couldn&#39;t be met: - coq-semantics -&gt; coq &gt;= 8.10 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-semantics.8.11.1</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "3a3a0064f15392f277d512f3cbea7833", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 172, "avg_line_length": 41.75, "alnum_prop": 0.578162823289591, "repo_name": "coq-bench/coq-bench.github.io", "id": "f08c4858c520e5058952c23f19be06fd41388b8e", "size": "7851", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.7.2/semantics/8.11.1.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
module System.Console.Haskeline.Prefs( Prefs(..), defaultPrefs, readPrefs, CompletionType(..), BellStyle(..), EditMode(..), HistoryDuplicates(..), lookupKeyBinding ) where import Control.Monad.Catch (handle) import Control.Exception (IOException) import Data.Char(isSpace,toLower) import Data.List(foldl') import qualified Data.Map as Map import System.Console.Haskeline.Key {- | 'Prefs' allow the user to customize the terminal-style line-editing interface. They are read by default from @~/.haskeline@; to override that behavior, use 'readPrefs' and @runInputTWithPrefs@. Each line of a @.haskeline@ file defines one field of the 'Prefs' datatype; field names are case-insensitive and unparseable lines are ignored. For example: > editMode: Vi > completionType: MenuCompletion > maxhistorysize: Just 40 -} data Prefs = Prefs { bellStyle :: !BellStyle, editMode :: !EditMode, maxHistorySize :: !(Maybe Int), historyDuplicates :: HistoryDuplicates, completionType :: !CompletionType, completionPaging :: !Bool, -- ^ When listing completion alternatives, only display -- one screen of possibilities at a time. completionPromptLimit :: !(Maybe Int), -- ^ If more than this number of completion -- possibilities are found, then ask before listing -- them. listCompletionsImmediately :: !Bool, -- ^ If 'False', completions with multiple possibilities -- will ring the bell and only display them if the user -- presses @TAB@ again. customBindings :: Map.Map Key [Key], -- (termName, keysequence, key) customKeySequences :: [(Maybe String, String,Key)] } deriving Show data CompletionType = ListCompletion | MenuCompletion deriving (Read,Show) data BellStyle = NoBell | VisualBell | AudibleBell deriving (Show, Read) data EditMode = Vi | Emacs deriving (Show,Read) data HistoryDuplicates = AlwaysAdd | IgnoreConsecutive | IgnoreAll deriving (Show,Read) -- | The default preferences which may be overwritten in the -- @.haskeline@ file. defaultPrefs :: Prefs defaultPrefs = Prefs {bellStyle = AudibleBell, maxHistorySize = Just 100, editMode = Emacs, completionType = ListCompletion, completionPaging = True, completionPromptLimit = Just 100, listCompletionsImmediately = True, historyDuplicates = AlwaysAdd, customBindings = Map.empty, customKeySequences = [] } mkSettor :: Read a => (a -> Prefs -> Prefs) -> String -> Prefs -> Prefs mkSettor f str = maybe id f (readMaybe str) readMaybe :: Read a => String -> Maybe a readMaybe str = case reads str of [(x,_)] -> Just x _ -> Nothing settors :: [(String, String -> Prefs -> Prefs)] settors = [("bellstyle", mkSettor $ \x p -> p {bellStyle = x}) ,("editmode", mkSettor $ \x p -> p {editMode = x}) ,("maxhistorysize", mkSettor $ \x p -> p {maxHistorySize = x}) ,("completiontype", mkSettor $ \x p -> p {completionType = x}) ,("completionpaging", mkSettor $ \x p -> p {completionPaging = x}) ,("completionpromptlimit", mkSettor $ \x p -> p {completionPromptLimit = x}) ,("listcompletionsimmediately", mkSettor $ \x p -> p {listCompletionsImmediately = x}) ,("historyduplicates", mkSettor $ \x p -> p {historyDuplicates = x}) ,("bind", addCustomBinding) ,("keyseq", addCustomKeySequence) ] addCustomBinding :: String -> Prefs -> Prefs addCustomBinding str p = case mapM parseKey (words str) of Just (k:ks) -> p {customBindings = Map.insert k ks (customBindings p)} _ -> p addCustomKeySequence :: String -> Prefs -> Prefs addCustomKeySequence str = maybe id addKS maybeParse where maybeParse :: Maybe (Maybe String, String,Key) maybeParse = case words str of [cstr,kstr] -> parseWords Nothing cstr kstr [term,cstr,kstr] -> parseWords (Just term) cstr kstr _ -> Nothing parseWords mterm cstr kstr = do k <- parseKey kstr cs <- readMaybe cstr return (mterm,cs,k) addKS ks p = p {customKeySequences = ks:customKeySequences p} lookupKeyBinding :: Key -> Prefs -> [Key] lookupKeyBinding k = Map.findWithDefault [k] k . customBindings -- | Read 'Prefs' from a given file. If there is an error reading the file, -- the 'defaultPrefs' will be returned. readPrefs :: FilePath -> IO Prefs readPrefs file = handle (\(_::IOException) -> return defaultPrefs) $ do ls <- fmap lines $ readFile file return $! foldl' applyField defaultPrefs ls where applyField p l = case break (==':') l of (name,val) -> case lookup (map toLower $ trimSpaces name) settors of Nothing -> p Just set -> set (drop 1 val) p -- drop initial ":", don't crash if val=="" trimSpaces = dropWhile isSpace . reverse . dropWhile isSpace . reverse
{ "content_hash": "816c1f98e00fe7457b152d8b60b69461", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 99, "avg_line_length": 41.539568345323744, "alnum_prop": 0.5620020782819536, "repo_name": "ghc/packages-haskeline", "id": "8033a8f862c525154fb8e7722ba6a664230869ca", "size": "5774", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "System/Console/Haskeline/Prefs.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "14950" }, { "name": "Haskell", "bytes": "217281" }, { "name": "Shell", "bytes": "171" } ], "symlink_target": "" }
using namespace seqan; TEST_CASE ("kmerifyGraph should create a non-empty kmer map") { std::ostringstream ss; ss << gyper_SOURCE_DIRECTORY << "/test/alignments/test_case5_e3.fa"; std::string tmp_str = ss.str(); const char* alignment_file_e3 = tmp_str.c_str(); std::vector<std::string> ids; std::vector<VertexLabels> vertex_vector; boost::unordered_map< std::pair<TVertexDescriptor, TVertexDescriptor>, boost::dynamic_bitset<> > edge_ids; boost::unordered_set<TVertexDescriptor> free_nodes; free_nodes.insert(1); free_nodes.insert(0); TVertexDescriptor begin_vertex; TGraph graph = createGraph(alignment_file_e3, vertex_vector, edge_ids, ids, begin_vertex); SECTION("We should only find one 4 kmer for test_case5, exon 3") { int kmer_size = 4; String<TVertexDescriptor> order; topologicalSort(order, graph); TKmerMap kmer_map = kmerifyGraph(order, graph, vertex_vector, free_nodes, edge_ids, kmer_size); REQUIRE(kmer_map.size() == 2); DnaString kmer1 = "TGCC"; REQUIRE(kmer_map.count(kmer1) == 1); REQUIRE(kmer_map[kmer1].size() == 1); REQUIRE(kmer_map[kmer1][0].start_vertex == 2); REQUIRE(kmer_map[kmer1][0].end_vertex == 5); DnaString kmer2 = "TGCA"; REQUIRE(kmer_map.count(kmer2) == 1); REQUIRE(kmer_map[kmer2].size() == 1); REQUIRE(kmer_map[kmer2][0].start_vertex == 2); REQUIRE(kmer_map[kmer2][0].end_vertex == 6); } std::ostringstream ss2; ss2 << gyper_SOURCE_DIRECTORY << "/test/alignments/test_case5_i2.fa"; std::string tmp_str2 = ss2.str(); const char* alignment_file_i2 = tmp_str2.c_str(); TVertexDescriptor new_begin_vertex; free_nodes.insert(begin_vertex); extendGraph(graph, alignment_file_i2, vertex_vector, new_begin_vertex, begin_vertex); free_nodes.insert(begin_vertex); std::size_t num_ids = ids.size(); SECTION ("Add intron 2 and align using 4 mers") { // Use 4-mers when testing int kmer_size = 4; String<TVertexDescriptor> order; topologicalSort(order, graph); TKmerMap kmer_map = kmerifyGraph(order, graph, vertex_vector, free_nodes, edge_ids, kmer_size); boost::dynamic_bitset<> expected_bitset_11(num_ids, 3ul); boost::dynamic_bitset<> expected_bitset_10(num_ids, 2ul); boost::dynamic_bitset<> expected_bitset_01(num_ids, 1ul); boost::dynamic_bitset<> expected_bitset_00(num_ids, 0ul); REQUIRE(kmer_map.size() == 5); DnaString kmer1 = "TTTT"; REQUIRE(kmer_map.count(kmer1) == 1); REQUIRE(kmer_map[kmer1].size() == 2); REQUIRE(kmer_map[kmer1][0].start_vertex == 8); REQUIRE(kmer_map[kmer1][0].end_vertex == 11); REQUIRE(kmer_map[kmer1][0].id_bits == expected_bitset_11); REQUIRE(kmer_map[kmer1][1].start_vertex == 9); REQUIRE(kmer_map[kmer1][1].end_vertex == 2); REQUIRE(kmer_map[kmer1][1].id_bits == expected_bitset_11); DnaString kmer2 = "TTTG"; REQUIRE(kmer_map.count(kmer2) == 1); REQUIRE(kmer_map[kmer2].size() == 1); REQUIRE(kmer_map[kmer2][0].start_vertex == 10); REQUIRE(kmer_map[kmer2][0].end_vertex == 3); REQUIRE(kmer_map[kmer2][0].id_bits == expected_bitset_11); DnaString kmer3 = "TTGC"; REQUIRE(kmer_map.count(kmer3) == 1); REQUIRE(kmer_map[kmer3].size() == 2); REQUIRE(kmer_map[kmer3][0].start_vertex == 11); REQUIRE(kmer_map[kmer3][0].end_vertex == 5); REQUIRE(kmer_map[kmer3][0].id_bits == expected_bitset_10); REQUIRE(kmer_map[kmer3][1].start_vertex == 11); REQUIRE(kmer_map[kmer3][1].end_vertex == 4); REQUIRE(kmer_map[kmer3][1].id_bits == expected_bitset_01); DnaString kmer4 = "TGCC"; REQUIRE(kmer_map.count(kmer4) == 1); REQUIRE(kmer_map[kmer4].size() == 1); REQUIRE(kmer_map[kmer4][0].start_vertex == 2); REQUIRE(kmer_map[kmer4][0].end_vertex == 5); REQUIRE(kmer_map[kmer4][0].id_bits == expected_bitset_01); DnaString kmer5 = "TGCA"; REQUIRE(kmer_map.count(kmer5) == 1); REQUIRE(kmer_map[kmer5].size() == 1); REQUIRE(kmer_map[kmer5][0].start_vertex == 2); REQUIRE(kmer_map[kmer5][0].end_vertex == 6); REQUIRE(kmer_map[kmer5][0].id_bits == expected_bitset_10); DnaString kmer6 = "GCCA"; // Not possible! Since the bitstring will be 00 REQUIRE(kmer_map.count(kmer6) == 0); SECTION ("sequence is TGCC") { DnaString sequence = "TGCC"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_01 == actual_bitset); } SECTION ("sequence is TTGC") { DnaString sequence = "TTGC"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_11 == actual_bitset); } SECTION ("sequence is TTTTGCC") { DnaString sequence = "TTTTGCC"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_01 == actual_bitset); } SECTION ("sequence is TTTTTGC") { DnaString sequence = "TTTTTGC"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_11 == actual_bitset); } SECTION ("sequence is TTTTTGCA. The A should not be ignored") { DnaString sequence = "TTTTTGCA"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_10 == actual_bitset); } } SECTION ("Add intron 2 and align using 2 mers") { int kmer_size = 2; String<TVertexDescriptor> order; topologicalSort(order, graph); TKmerMap kmer_map = kmerifyGraph(order, graph, vertex_vector, free_nodes, edge_ids, kmer_size); boost::dynamic_bitset<> expected_bitset_11(num_ids, 3ul); boost::dynamic_bitset<> expected_bitset_10(num_ids, 2ul); boost::dynamic_bitset<> expected_bitset_01(num_ids, 1ul); boost::dynamic_bitset<> expected_bitset_00(num_ids, 0ul); REQUIRE(kmer_map.size() == 5); DnaString kmer1 = "TT"; REQUIRE(kmer_map.count(kmer1) == 1); REQUIRE(kmer_map[kmer1].size() == 4); REQUIRE(kmer_map[kmer1][0].start_vertex == 8); REQUIRE(kmer_map[kmer1][0].end_vertex == 9); REQUIRE(kmer_map[kmer1][0].id_bits == expected_bitset_11); REQUIRE(kmer_map[kmer1][1].start_vertex == 9); REQUIRE(kmer_map[kmer1][1].end_vertex == 10); REQUIRE(kmer_map[kmer1][1].id_bits == expected_bitset_11); REQUIRE(kmer_map[kmer1][2].start_vertex == 10); REQUIRE(kmer_map[kmer1][2].end_vertex == 11); REQUIRE(kmer_map[kmer1][2].id_bits == expected_bitset_11); REQUIRE(kmer_map[kmer1][3].start_vertex == 11); REQUIRE(kmer_map[kmer1][3].end_vertex == 2); REQUIRE(kmer_map[kmer1][3].id_bits == expected_bitset_11); DnaString kmer2 = "TG"; REQUIRE(kmer_map.count(kmer2) == 1); REQUIRE(kmer_map[kmer2].size() == 1); REQUIRE(kmer_map[kmer2][0].start_vertex == 2); REQUIRE(kmer_map[kmer2][0].end_vertex == 3); REQUIRE(kmer_map[kmer2][0].id_bits == expected_bitset_11); DnaString kmer3 = "GC"; REQUIRE(kmer_map.count(kmer3) == 1); REQUIRE(kmer_map[kmer3].size() == 2); REQUIRE(kmer_map[kmer3][0].start_vertex == 3); REQUIRE(kmer_map[kmer3][0].end_vertex == 5); REQUIRE(kmer_map[kmer3][0].id_bits == expected_bitset_10); REQUIRE(kmer_map[kmer3][1].start_vertex == 3); REQUIRE(kmer_map[kmer3][1].end_vertex == 4); REQUIRE(kmer_map[kmer3][1].id_bits == expected_bitset_01); DnaString kmer4 = "CC"; REQUIRE(kmer_map.count(kmer4) == 1); REQUIRE(kmer_map[kmer4].size() == 1); REQUIRE(kmer_map[kmer4][0].start_vertex == 4); REQUIRE(kmer_map[kmer4][0].end_vertex == 5); REQUIRE(kmer_map[kmer4][0].id_bits == expected_bitset_01); DnaString kmer5 = "CA"; REQUIRE(kmer_map.count(kmer5) == 1); REQUIRE(kmer_map[kmer5].size() == 1); REQUIRE(kmer_map[kmer5][0].start_vertex == 5); REQUIRE(kmer_map[kmer5][0].end_vertex == 6); REQUIRE(kmer_map[kmer5][0].id_bits == expected_bitset_10); SECTION ("sequence is TTTTTGCC") { DnaString sequence = "TTTTTGCC"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_01 == actual_bitset); } SECTION ("sequence is TGCC") { DnaString sequence = "TGCC"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_01 == actual_bitset); } SECTION ("sequence is TTGC") { DnaString sequence = "TTGC"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_11 == actual_bitset); } } } TEST_CASE ("Try to align with backward alignments") { std::ostringstream ss; ss << gyper_SOURCE_DIRECTORY << "/test/alignments/test_case6.fa"; std::string tmp_str = ss.str(); const char* alignment_file_e3 = tmp_str.c_str(); std::vector<std::string> ids; std::vector<VertexLabels> vertex_vector; boost::unordered_map< std::pair<TVertexDescriptor, TVertexDescriptor>, boost::dynamic_bitset<> > edge_ids; boost::unordered_set<TVertexDescriptor> free_nodes; free_nodes.insert(1); free_nodes.insert(0); TVertexDescriptor begin_vertex; TGraph graph = createGraph(alignment_file_e3, vertex_vector, edge_ids, ids, begin_vertex); std::size_t num_ids = ids.size(); boost::dynamic_bitset<> expected_bitset_11(num_ids, 3ul); boost::dynamic_bitset<> expected_bitset_10(num_ids, 2ul); boost::dynamic_bitset<> expected_bitset_01(num_ids, 1ul); boost::dynamic_bitset<> expected_bitset_00(num_ids, 0ul); int kmer_size = 3; String<TVertexDescriptor> order; topologicalSort(order, graph); TKmerMap kmer_map = kmerifyGraph(order, graph, vertex_vector, free_nodes, edge_ids, kmer_size); SECTION ("sequence is TTG") { DnaString sequence = "TTG"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_11 == actual_bitset); } SECTION ("sequence is TTG") { DnaString sequence = "TTG"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 0, kmer_size, 0 ); REQUIRE (expected_bitset_11 == actual_bitset); } SECTION ("sequence is TTGGG") { DnaString sequence = "TTGGG"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 2, kmer_size, 0 ); REQUIRE (expected_bitset_11 == actual_bitset); } SECTION ("sequence is TTTGGG, start at index 2") { DnaString sequence = "TTTGGG"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 2, kmer_size, 0 ); REQUIRE (expected_bitset_10 == actual_bitset); } SECTION ("sequence is TTTGGG, start at index 1") { DnaString sequence = "TTTGGG"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 1, kmer_size, 0 ); REQUIRE (expected_bitset_10 == actual_bitset); } } TEST_CASE ("Reads failing after best kmer should still allow partial reads") { std::ostringstream ss; ss << gyper_SOURCE_DIRECTORY << "/test/alignments/test_case6.fa"; std::string tmp_str = ss.str(); const char* alignment_file_e3 = tmp_str.c_str(); std::vector<std::string> ids; std::vector<VertexLabels> vertex_vector; boost::unordered_map< std::pair<TVertexDescriptor, TVertexDescriptor>, boost::dynamic_bitset<> > edge_ids; boost::unordered_set<TVertexDescriptor> free_nodes; free_nodes.insert(1); free_nodes.insert(0); TVertexDescriptor begin_vertex; TGraph graph = createGraph(alignment_file_e3, vertex_vector, edge_ids, ids, begin_vertex); std::size_t num_ids = ids.size(); boost::dynamic_bitset<> expected_bitset_11(num_ids, 3ul); boost::dynamic_bitset<> expected_bitset_10(num_ids, 2ul); boost::dynamic_bitset<> expected_bitset_01(num_ids, 1ul); boost::dynamic_bitset<> expected_bitset_00(num_ids, 0ul); int kmer_size = 3; String<TVertexDescriptor> order; topologicalSort(order, graph); TKmerMap kmer_map = kmerifyGraph(order, graph, vertex_vector, free_nodes, edge_ids, kmer_size); SECTION ("sequence is TATTAGGG") { DnaString sequence = "TATTAGGG"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 1, kmer_size, 0 ); REQUIRE (expected_bitset_01 == actual_bitset); } SECTION ("sequence is GTTTGG") { DnaString sequence = "GTTTGG"; std::vector<TVertexDescriptor> matching_vertices; boost::dynamic_bitset<> actual_bitset = align_kmer_to_graph (sequence, num_ids, kmer_map, vertex_vector, 3, kmer_size, 0 ); REQUIRE (expected_bitset_10 == actual_bitset); } } TEST_CASE("find_best_kmer should find the kmer with the best quality") { // !"#$%&'()*+.-./0123456789:;<=>?@ABCDEFGHIJ unsigned k = 4; SECTION ("Last kmer has the highest quality") { String<char> qual = "44440"; REQUIRE(0 == find_best_kmer(qual, k)); } SECTION ("First kmer has the highest quality") { String<char> qual = "04444"; REQUIRE(1 == find_best_kmer(qual, k)); } SECTION ("Middle kmer has the highest quality") { String<char> qual = "044440"; REQUIRE(1 == find_best_kmer(qual, k)); } SECTION ("Just another test case") { String<char> qual = "0000099990000"; REQUIRE(5 == find_best_kmer(qual, k)); } SECTION ("Don't break if with highest quality with k = 16") { k = 16; String<char> qual = "0000JJJJJJJJJJJJJJJJ0000"; REQUIRE(4 == find_best_kmer(qual, k)); } SECTION ("*,A,A,A,A is far worse than 1,1,1,1,1 even though its sum is higher") { k = 5; String<char> qual = "000033333000000*AAAA"; REQUIRE(4 == find_best_kmer(qual, k)); } } // Forces no optimization for this test case #pragma GCC push_options #pragma GCC optimize ("O0") TEST_CASE("Dna strings should be able to have unique hash_values") { SECTION ("Simple case") { String<Dna> simple_dna_string = "ACCCTTAGGA"; // It has length 10 REQUIRE(hash_value(simple_dna_string) != 0); } SECTION ("Different k-mers should have different hashes") { String<Dna> dna_string_1 = "ACCCTTAGGA"; String<Dna> dna_string_2 = "ACCCTTAGGT"; REQUIRE(hash_value(dna_string_1) != hash_value(dna_string_2)); } SECTION ("Long k-mers should be supported to up to 32 bases") { String<Dna> dna_string_of_length_32_1 = "AAAAACCCCCTTTTTGGGGGAAAAACCCCCTT"; // It has length 32 String<Dna> dna_string_of_length_32_2 = "AAAAACCCCCTTTTTGGGGGAAAAACCCCCTA"; // This one too REQUIRE(hash_value(dna_string_of_length_32_1) != hash_value(dna_string_of_length_32_2)); } SECTION ("After 32 bases, hash values still work") { String<Dna> dna_string_of_length_40_1 = "AAAAACCCCCTTTTTGGGGGAAAAACCCCCTTTTTGGGGG"; // It has length 40 String<Dna> dna_string_of_length_40_2 = "AAAAACCCCCTTTTTGGGGGAAAAACCCCCTTTTTGGGGA"; // This one too REQUIRE(hash_value(dna_string_of_length_40_1) != 0); REQUIRE(hash_value(dna_string_of_length_40_2) != 0); } SECTION ("Speed testing with a string of 32") { String<Dna> dna_string_of_length_32 = "AAAAACCCCCTTTTTGGGGGAAAAACCCCCTT"; unsigned number_of_times = 100000000; for (unsigned i = 0 ; i < number_of_times / 100 ; ++i) { hash_value(dna_string_of_length_32); } SECTION ("Default") { clock_t begin = clock(); for (unsigned i = 0 ; i < number_of_times ; ++i) { hash_value(dna_string_of_length_32); } printf("[%6.2f] Default.\n", double(clock()-begin) / CLOCKS_PER_SEC); } SECTION ("Optional 1") { clock_t begin = clock(); for (unsigned i = 0 ; i < number_of_times ; ++i) { hash_value_optional1(dna_string_of_length_32); } printf("[%6.2f] Optional 1.\n", double(clock()-begin) / CLOCKS_PER_SEC); } SECTION ("Optional 2") { clock_t begin = clock(); for (unsigned i = 0 ; i < number_of_times ; ++i) { hash_value_optional2(dna_string_of_length_32); } printf("[%6.2f] Optional 2.\n", double(clock()-begin) / CLOCKS_PER_SEC); } SECTION ("Optional 3") { clock_t begin = clock(); for (unsigned i = 0 ; i < number_of_times ; ++i) { hash_value_optional3(dna_string_of_length_32); } printf("[%6.2f] Optional 3.\n", double(clock()-begin) / CLOCKS_PER_SEC); } } SECTION ("Speed testing with a string of 80") { String<Dna> dna_string_of_length_80 = "AAAAACCCCCTTTTTGGGGGAAAAACCCCCTTTTTGGGGGAAAAACCCCCTTTTTGGGGGAAAAACCCCCTTTTTGGGGG"; unsigned number_of_times = 100000000; SECTION ("Default") { clock_t begin = clock(); for (unsigned i = 0 ; i < number_of_times ; ++i) { hash_value(dna_string_of_length_80); } printf("[%6.2f] Default.\n", double(clock()-begin) / CLOCKS_PER_SEC); } SECTION ("Optional 1") { clock_t begin = clock(); for (unsigned i = 0 ; i < number_of_times ; ++i) { hash_value_optional1(dna_string_of_length_80); } printf("[%6.2f] Optional 1.\n", double(clock()-begin) / CLOCKS_PER_SEC); } SECTION ("Optional 2") { clock_t begin = clock(); for (unsigned i = 0 ; i < number_of_times ; ++i) { hash_value_optional2(dna_string_of_length_80); } printf("[%6.2f] Optional 2.\n", double(clock()-begin) / CLOCKS_PER_SEC); } SECTION ("Optional 3") { clock_t begin = clock(); for (unsigned i = 0 ; i < number_of_times ; ++i) { hash_value_optional3(dna_string_of_length_80); } printf("[%6.2f] Optional 3.\n", double(clock()-begin) / CLOCKS_PER_SEC); } } } #pragma GCC pop_options
{ "content_hash": "b62c4f2a08b6fbf7303b253f449a49e4", "timestamp": "", "source": "github", "line_count": 696, "max_line_length": 125, "avg_line_length": 31.666666666666668, "alnum_prop": 0.5571234119782215, "repo_name": "gyper/gyper", "id": "bd01f68162694ff8444ca174f1fb0452f8d741dc", "size": "22182", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/test_graph_kmer.cpp", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C++", "bytes": "167582" }, { "name": "CMake", "bytes": "19642" } ], "symlink_target": "" }
<!-- ~ Copyright (c) 2020-2021 VMware, Inc. or its affiliates, 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 ~ ~ 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. --> <configuration> <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern> %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n </pattern> </encoder> </appender> <!--appender name="file" class="ch.qos.logback.core.FileAppender"> <file>testFile.log</file> <append>false</append> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender--> <!-- Access Log configuration <appender name="accessLog" class="ch.qos.logback.core.FileAppender"> <file>access_log.log</file> <encoder> <pattern>%msg%n</pattern> </encoder> </appender> <appender name="async" class="ch.qos.logback.classic.AsyncAppender"> <appender-ref ref="accessLog" /> </appender> <logger name="reactor.netty.http.server.AccessLog" level="INFO" additivity="false"> <appender-ref ref="async"/> </logger> --> <!--<logger name="reactor" level="DEBUG"/>--> <!--<logger name="reactor" level="INFO"/>--> <logger name="reactor.netty" level="DEBUG" /> <logger name="_reactor.netty.channel.LeakDetection" level="DEBUG" /> <!--<logger name="reactor.netty.http.client.HttpClient" level="DEBUG" />--> <!--<logger name="reactor.netty.channel.FluxReceive" level="DEBUG" />--> <!--<logger name="reactor.netty.http.server.HttpServer" level="DEBUG" />--> <root level="info"> <appender-ref ref="stdout"/> </root> </configuration>
{ "content_hash": "3ba76bac25d6e510a8a2bf51b66b091e", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 87, "avg_line_length": 37.65, "alnum_prop": 0.628596724214254, "repo_name": "reactor/reactor-netty", "id": "fb9d6a97fa3f519cf33283a777298305c24c4e12", "size": "2259", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "reactor-netty-http-brave/src/test/resources/logback.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "5434" }, { "name": "HTML", "bytes": "1154" }, { "name": "Java", "bytes": "3071019" } ], "symlink_target": "" }
{{set "title" "Home" .}} {{template "header.html" .}} <div id="login"> (try with demo/demo) <form action="{{url "Application.Login"}}" id="formLogin" method="POST"> <p class="field"> <label>Login Name:</label> <input type="text" name="username" size="19" value="{{.flash.username}}" /> </p> <p class="field"> <label>Password:</label> <input type="password" name="password" size="19"/> </p> <p class="buttons"> <input type="submit" value="Account login" /> </p> </form> <p> <a href="{{url "Application.Register"}}">Register New User</a> </p> </div> {{template "footer.html" .}}
{ "content_hash": "8a14eeb889d1ff340d19f72bfc631017", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 81, "avg_line_length": 23.25, "alnum_prop": 0.5622119815668203, "repo_name": "jamesward/revel", "id": "5d8486e76c91219554c594b433656a474e5fcc5e", "size": "651", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "samples/booking/app/views/Application/Index.html", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "140013" } ], "symlink_target": "" }
module HerokuSchemas class Drop < SchemaCommand attr_reader :database def initialize(options) super(options) @string_reference = options[:string_reference] raise 'Context app not provided' if @context_app.blank? raise 'Schema reference not provided' if @string_reference.blank? related_apps = [@context_app, @string_reference.split(':').first].uniq @schema = HerokuSchemas::SchemaReference.new(heroku: @heroku, string_reference: @context_app, related_apps: related_apps) @database = HerokuSchemas::CurrentDatabase.connect_to_url(@schema.database_url) end def perform @database.execute("DROP SCHEMA #{@schema.schema} CASCADE") write "Dropped schema #{@schema.database_app}:#{@schema.database_variable}:#{@schema.schema}" end end end
{ "content_hash": "89c5f9718be16bc2b5bef4e52bee16aa", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 127, "avg_line_length": 37.27272727272727, "alnum_prop": 0.6951219512195121, "repo_name": "tombenner/heroku-schemas", "id": "84d2f9cc655868cae1b8ed513455ee1558d42f1b", "size": "820", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/heroku-schemas/drop.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "546" }, { "name": "JavaScript", "bytes": "641" }, { "name": "Ruby", "bytes": "41158" } ], "symlink_target": "" }
package com.areen.jlib.sql; import java.sql.Connection; import java.sql.ResultSet; import java.sql.CallableStatement; import java.sql.PreparedStatement; import java.sql.Statement; /** * Various helper methods that operate on SQL objects. * * @author Dejan */ public class SQLUtil { /** * Closes all give ResultSet objects. * @param argResultSets * @throws Exception */ public static void closeRS(ResultSet... argResultSets) throws Exception { for (ResultSet rs : argResultSets) { if (rs != null) { rs.close(); } } // foreach } // closeRS() method /** * Closes the given prepared statement. * * @param argPreparedStatement * @throws Exception */ public static void closeCS(CallableStatement argCallableStatement) throws Exception { if (argCallableStatement != null) { argCallableStatement.close(); } } // close() method /** * Closes all given PreparedStatement objects. * * @param argPreparedStatements * @throws Exception */ public static void closeCS(CallableStatement... argCallableStatement) throws Exception { for (CallableStatement cs : argCallableStatement) { closeCS(cs); } // foreach } // closePS() method /** * Closes the given prepared statement. * * @param argPreparedStatement * @throws Exception */ public static void closePS(PreparedStatement argPreparedStatement) throws Exception { if (argPreparedStatement != null) { argPreparedStatement.close(); } } // close() method /** * Closes all given PreparedStatement objects. * * @param argPreparedStatements * @throws Exception */ public static void closePS(PreparedStatement... argPreparedStatements) throws Exception { for (PreparedStatement ps : argPreparedStatements) { closePS(ps); } // foreach } // closePS() method /** * Closes the given prepared statement. * * @param argPreparedStatement * @throws Exception */ public static void closeST(Statement argStatement) throws Exception { if (argStatement != null) { argStatement.close(); } } // close() method /** * Closes all given Statement objects. * * @param argStatements * @throws Exception */ public static void closeST(Statement... argStatements) throws Exception { for (Statement s : argStatements) { closeST(s); } // foreach } // closePS() method /** * Closes the given SQL Connection. * * @param argConnection * @throws Exception */ public static void close(Connection argConnection) throws Exception { if (argConnection != null) { argConnection.close(); } } // close() method public static void close(Connection... argConnections) throws Exception { for (Connection con : argConnections) { close(con); } // foreach } // close() method } // SQLUtil class // $Id$
{ "content_hash": "44a2441c559179861fd49ab64496264d", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 93, "avg_line_length": 26.735537190082646, "alnum_prop": 0.594435857805255, "repo_name": "dejlek/jlib", "id": "88e81d8d3752485d49ebcd8292f3412fef44ad68", "size": "5528", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/areen/jlib/sql/SQLUtil.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "971468" } ], "symlink_target": "" }
package org.elasticsearch.xpack.security.authc.ldap.support; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import com.unboundid.ldap.sdk.Attribute; import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.test.ESTestCase; import static org.hamcrest.Matchers.arrayContaining; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.nullValue; public class LdapMetaDataResolverTests extends ESTestCase { private static final String HAWKEYE_DN = "uid=hawkeye,ou=people,dc=oldap,dc=test,dc=elasticsearch,dc=com"; private LdapMetaDataResolver resolver; public void testParseSettings() throws Exception { resolver = new LdapMetaDataResolver(Settings.builder().putList("metadata", "cn", "uid").build(), false); assertThat(resolver.attributeNames(), arrayContaining("cn", "uid")); } public void testResolveSingleValuedAttributeFromCachedAttributes() throws Exception { resolver = new LdapMetaDataResolver(Arrays.asList("cn", "uid"), true); final Collection<Attribute> attributes = Arrays.asList( new Attribute("cn", "Clint Barton"), new Attribute("uid", "hawkeye"), new Attribute("email", "clint.barton@shield.gov"), new Attribute("memberOf", "cn=staff,ou=groups,dc=example,dc=com", "cn=admin,ou=groups,dc=example,dc=com") ); final Map<String, Object> map = resolve(attributes); assertThat(map.size(), equalTo(2)); assertThat(map.get("cn"), equalTo("Clint Barton")); assertThat(map.get("uid"), equalTo("hawkeye")); } public void testResolveMultiValuedAttributeFromCachedAttributes() throws Exception { resolver = new LdapMetaDataResolver(Arrays.asList("cn", "uid"), true); final Collection<Attribute> attributes = Arrays.asList( new Attribute("cn", "Clint Barton", "hawkeye"), new Attribute("uid", "hawkeye") ); final Map<String, Object> map = resolve(attributes); assertThat(map.size(), equalTo(2)); assertThat(map.get("cn"), instanceOf(List.class)); assertThat((List<?>) map.get("cn"), contains("Clint Barton", "hawkeye")); assertThat(map.get("uid"), equalTo("hawkeye")); } public void testResolveMissingAttributeFromCachedAttributes() throws Exception { resolver = new LdapMetaDataResolver(Arrays.asList("cn", "uid"), true); final Collection<Attribute> attributes = Collections.singletonList(new Attribute("uid", "hawkeye")); final Map<String, Object> map = resolve(attributes); assertThat(map.size(), equalTo(1)); assertThat(map.get("cn"), nullValue()); assertThat(map.get("uid"), equalTo("hawkeye")); } private Map<String, Object> resolve(Collection<Attribute> attributes) throws Exception { final PlainActionFuture<Map<String, Object>> future = new PlainActionFuture<>(); resolver.resolve(null, HAWKEYE_DN, TimeValue.timeValueSeconds(1), logger, attributes, future); return future.get(); } }
{ "content_hash": "422a11e6e83658f1afd5b432a17d39ce", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 121, "avg_line_length": 45.7027027027027, "alnum_prop": 0.6939680662329982, "repo_name": "gfyoung/elasticsearch", "id": "74502b4e2b33b2e391c634c4c04339f3c2e7b478", "size": "3623", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ldap/support/LdapMetaDataResolverTests.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "11082" }, { "name": "Batchfile", "bytes": "13592" }, { "name": "Emacs Lisp", "bytes": "3341" }, { "name": "FreeMarker", "bytes": "45" }, { "name": "Groovy", "bytes": "330070" }, { "name": "HTML", "bytes": "2186" }, { "name": "Java", "bytes": "42238459" }, { "name": "Perl", "bytes": "7271" }, { "name": "Python", "bytes": "54395" }, { "name": "Shell", "bytes": "108747" } ], "symlink_target": "" }
package org.literacybridge.stats.formats.formats.statsFile; import junit.framework.TestCase; import org.junit.Test; import org.literacybridge.stats.formats.statsFile.StatsFile; import java.io.*; /** */ public class TestStatsFile { @Test public void testStatsFile() throws IOException { FileInputStream is = new FileInputStream("src/test/resources/statsFiles/2014-2^b-30346464_0E246981.stat".replace('/', File.separatorChar)); StatsFile statsFile = StatsFile.read(is); TestCase.assertEquals(54, statsFile.openCount); TestCase.assertEquals(48, statsFile.completionCount); TestCase.assertEquals(0, statsFile.copyCount); TestCase.assertEquals(0, statsFile.surveyCount); TestCase.assertEquals(0, statsFile.appliedCount); TestCase.assertEquals(0, statsFile.uselessCount); } @Test public void testRoundTrip() throws IOException { StatsFile writtenFile = new StatsFile("srn", "Hello", 1, 2, 3, 4, 5, 6); ByteArrayOutputStream baos = new ByteArrayOutputStream(); StatsFile.write(writtenFile, baos); baos.flush(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); StatsFile readFile = StatsFile.read(bais); // TestCase.assertEquals(writtenFile, readFile); } @Test public void testRoundTripLongMessageId() throws IOException { StatsFile fileToWrite = new StatsFile("srn", "Hello12345678901234567890", 1, 2, 3, 4, 5, 6); StatsFile fileActuallyWritten = new StatsFile("srn", "Hello12345678901234567890", 1, 2, 3, 4, 5, 6); ByteArrayOutputStream baos = new ByteArrayOutputStream(); StatsFile.write(fileToWrite, baos); baos.flush(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); StatsFile readFile = StatsFile.read(bais); // TestCase.assertEquals(fileActuallyWritten, readFile); } @Test public void writeFilesForTests() throws Exception { StatsFile[] files = new StatsFile[]{ new StatsFile("srn", "H_0200_6A0564FF", 0, 0, 0, 0, 0, 0), new StatsFile("srn", "LB-2_fz02ma8nab_d", 2, 0, 0, 0, 0, 0), new StatsFile("srn", "LB-2_x6g9tv0p3e_m", 2, 2, 0, 0, 0, 0) }; for (StatsFile file : files) { String fileName = "src/test/resources/testSyncDir/testDevice/collected-data/2013-03/Baazu-Jirapa/TB0002FE/8m30d17h9m8s/statistics/stats/" + file.messageId; FileOutputStream fos = new FileOutputStream(fileName.replace('/', File.separatorChar)); StatsFile.write(file, fos); fos.close(); } } }
{ "content_hash": "a1551a4df78885a136e77d2294cb2795", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 161, "avg_line_length": 34.47945205479452, "alnum_prop": 0.7111640842272546, "repo_name": "LiteracyBridge/dashboard-core", "id": "f0fdeea9df1550aebfebde21f5b756416877e061", "size": "2517", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/org/literacybridge/stats/formats/formats/statsFile/TestStatsFile.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "518149" }, { "name": "Shell", "bytes": "752" } ], "symlink_target": "" }
require 'simplecov' module SimpleCov::Configuration def clean_filters @filters = [] end end SimpleCov.configure do clean_filters load_profile 'test_frameworks' end ENV["COVERAGE"] && SimpleCov.start do add_filter "/.rvm/" end require 'rubygems' require 'bundler' begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e $stderr.puts e.message $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code end require 'minitest/autorun' $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'wittgenstein' class MiniTest::Test end MiniTest.autorun
{ "content_hash": "3d3d0cb3d998ac22ea007b76b0748547", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 66, "avg_line_length": 19.34285714285714, "alnum_prop": 0.7282127031019202, "repo_name": "mdtjr/wittgenstein", "id": "70c0a348df8b4905fac96d4410c16c77c5e725de", "size": "677", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/helper.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "2368" } ], "symlink_target": "" }
import { Input, Directive } from '@angular/core'; import { ValidatorFn, Validators, AbstractControl } from '@angular/forms'; import { KEY_BINDING_BEHAVIOR } from './multi-select'; export const HIDDEN_EDITOR = 'hidden'; export const TEXT_EDITOR = 'text'; export const TEXT_AREA_EDITOR = 'textarea'; export const PASSWORD_EDITOR = 'password'; export const RADIO_EDITOR = 'radio'; export const CHECKBOX_EDITOR = 'checkbox'; export const DATE_EDITOR = 'date'; export const NUMBER_EDITOR = 'number'; export const RANGE_EDITOR = 'range'; export const TIME_EDITOR = 'time'; export const SELECT_EDITOR = 'select'; export const MULTI_SELECT_EDITOR = 'multi-select'; export interface Editor { key: string; type: string; label: string; value?: any; options?: Array<{ key: string | number, value: string }>; singleSelection?: boolean; bindingBehaviour?: 'key' | 'value'; required?: boolean; min?: number; max?: number; minLength?: number; maxLength?: number; } export const SINGLE_SLOT = 'single'; export const ARRAY_SLOT = 'array'; export interface Slot { key: string; type: string; title: string; editors: Array<Editor>; children?: Array<Slot>; } export class FormdefValidator { public static getValidators(editor: Editor): ValidatorFn { const validators: Array<ValidatorFn> = new Array<ValidatorFn>(); if (editor.required) { validators.push(Validators.required); } if (editor.min) { validators.push(Validators.min(editor.min)); } if (editor.max) { validators.push(Validators.max(editor.max)); } if (editor.minLength) { validators.push(Validators.minLength(editor.minLength)); } if (editor.maxLength) { validators.push(Validators.maxLength(editor.maxLength)); } return Validators.compose(validators); } } @Directive() export class BaseSlotComponent { @Input() public slot: Slot; @Input() public form: AbstractControl; }
{ "content_hash": "bf75d2f07056017772b8085e030f50eb", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 68, "avg_line_length": 24.375, "alnum_prop": 0.6892307692307692, "repo_name": "thomasduft/microwf", "id": "36204092ba862a74d63470c437b26a33382876ea", "size": "1950", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "samples/WebClient/src/app/shared/formdef/models.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "165267" }, { "name": "Dockerfile", "bytes": "340" }, { "name": "Shell", "bytes": "73" } ], "symlink_target": "" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.young.demo</groupId> <artifactId>nioAndNetty</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <java-version>1.7</java-version> <org.springframework-version>4.0.3.RELEASE</org.springframework-version> <org.aspectj-version>1.6.10</org.aspectj-version> <org.slf4j-version>1.6.6</org.slf4j-version> <junit.version>4.11</junit.version> <mockito.version>1.9.5</mockito.version> <org.slf4j-version>1.7.6</org.slf4j-version> <log4j.version>1.2.17</log4j.version> <thymeleaf.version>2.1.2.RELEASE</thymeleaf.version> <spring.mongodb.version>1.4.1.RELEASE</spring.mongodb.version> <org.apache.shiro.version>1.2.3</org.apache.shiro.version> <org.mybatis.version>3.2.7</org.mybatis.version> <org.mybatis.mybatis-spring.version>1.2.2</org.mybatis.mybatis-spring.version> <net.sf.ehcache.version>2.6.9</net.sf.ehcache.version> </properties> <dependencies> <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>5.0.0.Alpha2</version> </dependency> <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>2.5.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>${java-version}</source> <target>${java-version}</target> </configuration> </plugin> </plugins> </build> </project>
{ "content_hash": "5260535175a5032bc7b8a8825af34d3f", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 104, "avg_line_length": 34.7, "alnum_prop": 0.7123919308357348, "repo_name": "galahade/nioAndNetty", "id": "f3bf1b58c41e8454e0d3adef4a5548b95655eb99", "size": "1735", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "49449" }, { "name": "Protocol Buffer", "bytes": "2202" } ], "symlink_target": "" }
class AddHoursLocToLocationsHoldingLocations < ActiveRecord::Migration[4.2] def change add_reference :locations_holding_locations, :locations_hours_location, foreign_key: true end end
{ "content_hash": "6ac3ffa86e669aa3e230414ed5505824", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 92, "avg_line_length": 38.4, "alnum_prop": 0.8020833333333334, "repo_name": "pulibrary/locations", "id": "79ce34ae0ee11225a7a5490a3d48a257410ce9a7", "size": "192", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "db/migrate/20150603212708_add_hours_loc_to_locations_holding_locations.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1428" }, { "name": "HTML", "bytes": "16476" }, { "name": "JavaScript", "bytes": "3618" }, { "name": "Ruby", "bytes": "94007" }, { "name": "SCSS", "bytes": "448" } ], "symlink_target": "" }
 #include <aws/appstream/model/StartFleetResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/StringUtils.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::AppStream::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; StartFleetResult::StartFleetResult() { } StartFleetResult::StartFleetResult(const Aws::AmazonWebServiceResult<JsonValue>& result) { *this = result; } StartFleetResult& StartFleetResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result) { AWS_UNREFERENCED_PARAM(result); return *this; }
{ "content_hash": "7771de13e7158c59b1065675a39efd8b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 100, "avg_line_length": 22.161290322580644, "alnum_prop": 0.777292576419214, "repo_name": "awslabs/aws-sdk-cpp", "id": "42df0324db2e45d003793451763b9b14e857c857", "size": "806", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "aws-cpp-sdk-appstream/source/model/StartFleetResult.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "7596" }, { "name": "C++", "bytes": "61740540" }, { "name": "CMake", "bytes": "337520" }, { "name": "Java", "bytes": "223122" }, { "name": "Python", "bytes": "47357" } ], "symlink_target": "" }
<?php /************************************************************************************ ************************************************************************************ ** ** ** If you can read this text in your browser then you don't have PHP installed. ** ** Please install PHP 5.0 or higher, preferably PHP 5.2. ** ** ** ************************************************************************************ ************************************************************************************/ /** * SilverStripe CMS Installer * This installer doesn't use any of the fancy Sapphire stuff in case it's unsupported. * It's also PHP4 syntax compatable */ // speed up mysql_connect timeout if the server can't be found ini_set('mysql.connect_timeout', 5); ini_set('max_execution_time', 0); error_reporting(E_ALL ^ E_NOTICE); session_start(); $majorVersion = strtok(phpversion(),'.'); if($majorVersion < 5) { header("HTTP/1.1 500 Server Error"); echo str_replace('$PHPVersion', phpversion(), file_get_contents("sapphire/dev/install/php5-required.html")); die(); } // Include environment files $usingEnv = false; $envFileExists = false; $envFiles = array('_ss_environment.php', '../_ss_environment.php', '../../_ss_environment.php'); foreach($envFiles as $envFile) { if(@file_exists($envFile)) { include_once($envFile); $envFileExists = true; $usingEnv = true; break; } } if($envFileExists) { if(!empty($_REQUEST['useEnv'])) { $usingEnv = true; } else { $usingEnv = false; } } include_once('sapphire/core/Object.php'); include_once('sapphire/core/i18n.php'); include_once('sapphire/dev/install/DatabaseConfigurationHelper.php'); include_once('sapphire/dev/install/DatabaseAdapterRegistry.php'); // Set default locale, but try and sniff from the user agent $locales = i18n::$common_locales; $defaultLocale = i18n::get_locale(); if(isset($_SERVER['HTTP_USER_AGENT'])) { foreach($locales as $code => $details) { $bits = explode('_', $code); if(preg_match("/{$bits[0]}.{$bits[1]}/", $_SERVER['HTTP_USER_AGENT'])) { $defaultLocale = $code; break; } } } // Discover which databases are available DatabaseAdapterRegistry::autodiscover(); // Determine which external database modules are USABLE foreach(DatabaseAdapterRegistry::get_adapters() as $class => $details) { $databaseClasses[$class] = $details; if(file_exists($details['helperPath'])) { $databaseClasses[$class]['hasModule'] = true; include_once($details['helperPath']); } else { $databaseClasses[$class]['hasModule'] = false; } } // Load database config if(isset($_REQUEST['db'])) { if(isset($_REQUEST['db']['type'])) $type = $_REQUEST['db']['type']; else $type = $_REQUEST['db']['type'] = defined('SS_DATABASE_CLASS') ? SS_DATABASE_CLASS : 'MySQLDatabase'; // Disabled inputs don't submit anything - we need to use the environment (except the database name) if($usingEnv) { $_REQUEST['db'][$type] = $databaseConfig = array( "type" => defined('SS_DATABASE_CLASS') ? SS_DATABASE_CLASS : $type, "server" => defined('SS_DATABASE_SERVER') ? SS_DATABASE_SERVER : "localhost", "username" => defined('SS_DATABASE_USERNAME') ? SS_DATABASE_USERNAME : "root", "password" => defined('SS_DATABASE_PASSWORD') ? SS_DATABASE_PASSWORD : "", "database" => $_REQUEST['db'][$type]['database'], ); } else { // Normal behaviour without the environment $databaseConfig = $_REQUEST['db'][$type]; $databaseConfig['type'] = $type; } } else { $_REQUEST['db'][$type] = $databaseConfig = array( "type" => defined('SS_DATABASE_CLASS') ? SS_DATABASE_CLASS : "MySQLDatabase", "server" => defined('SS_DATABASE_SERVER') ? SS_DATABASE_SERVER : "localhost", "username" => defined('SS_DATABASE_USERNAME') ? SS_DATABASE_USERNAME : "root", "password" => defined('SS_DATABASE_PASSWORD') ? SS_DATABASE_PASSWORD : "", "database" => isset($_SERVER['argv'][2]) ? $_SERVER['argv'][2] : "SS_mysite", ); } if(isset($_REQUEST['admin'])) { // Disabled inputs don't submit anything - we need to use the environment (except the database name) if($usingEnv) { $_REQUEST['admin'] = $adminConfig = array( 'username' => defined('SS_DEFAULT_ADMIN_USERNAME') ? SS_DEFAULT_ADMIN_USERNAME : 'admin', 'password' => defined('SS_DEFAULT_ADMIN_PASSWORD') ? SS_DEFAULT_ADMIN_PASSWORD : '', ); } else { $adminConfig = $_REQUEST['admin']; } } else { $_REQUEST['admin'] = $adminConfig = array( 'username' => defined('SS_DEFAULT_ADMIN_USERNAME') ? SS_DEFAULT_ADMIN_USERNAME : 'admin', 'password' => defined('SS_DEFAULT_ADMIN_PASSWORD') ? SS_DEFAULT_ADMIN_PASSWORD : '', ); } $alreadyInstalled = false; if(file_exists('mysite/_config.php')) { // Find the $database variable in the relevant config file without having to execute the config file if(preg_match("/\\\$database\s*=\s*[^\n\r]+[\n\r]/", file_get_contents("mysite/_config.php"), $parts)) { eval($parts[0]); if($database) $alreadyInstalled = true; // Assume that if $databaseConfig is defined in mysite/_config.php, then a non-environment-based installation has // already gone ahead } else if(preg_match("/\\\$databaseConfig\s*=\s*[^\n\r]+[\n\r]/", file_get_contents("mysite/_config.php"), $parts)) { $alreadyInstalled = true; } } if(file_exists('sapphire/silverstripe_version')) { $sapphireVersionFile = file_get_contents('sapphire/silverstripe_version'); if(strstr($sapphireVersionFile, "/sapphire/trunk")) { $silverstripe_version = "trunk"; } else { preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches); $silverstripe_version = $matches[1]; } } else { $silverstripe_version = "unknown"; } // Check requirements $req = new InstallRequirements(); $req->check(); $webserverConfigFile = ''; if($req->isIIS()) { $webserverConfigFile = 'web.config'; } else { $webserverConfigFile = '.htaccess'; } if($req->hasErrors()) { $hasErrorOtherThanDatabase = true; } if($databaseConfig) { $dbReq = new InstallRequirements(); $dbReq->checkDatabase($databaseConfig); } if($adminConfig) { $adminReq = new InstallRequirements(); $adminReq->checkAdminConfig($adminConfig); } // Actual processor $installFromCli = (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'install'); // CLI-install error message. exit(1) will halt any makefile. if($installFromCli && ($req->hasErrors() || $dbReq->hasErrors())) { echo "Cannot install due to errors:\n"; $req->listErrors(); $dbReq->listErrors(); exit(1); } if((isset($_REQUEST['go']) || $installFromCli) && !$req->hasErrors() && !$dbReq->hasErrors() && $adminConfig['username'] && $adminConfig['password']) { // Confirm before reinstalling if(!isset($_REQUEST['force_reinstall']) && !$installFromCli && $alreadyInstalled) { include('sapphire/dev/install/config-form.html'); } else { $inst = new Installer(); if($_REQUEST) $inst->install($_REQUEST); else $inst->install(array( 'db' => $databaseConfig, 'admin' => $adminConfig, )); } // Show the config form } else { include('sapphire/dev/install/config-form.html'); } /** * This class checks requirements * Each of the requireXXX functions takes an argument which gives a user description of the test. * It's an array of 3 parts: * $description[0] - The test catetgory * $description[1] - The test title * $description[2] - The test error to show, if it goes wrong */ class InstallRequirements { var $errors, $warnings, $tests; /** * Check the database configuration. These are done one after another * starting with checking the database function exists in PHP, and * continuing onto more difficult checks like database permissions. */ function checkDatabase($databaseConfig) { if($this->requireDatabaseFunctions( $databaseConfig, array( "Database Configuration", "Database support", "Database support not included in PHP.") ) ) { if($this->requireDatabaseServer( $databaseConfig, array( "Database Configuration", "Database server exists", "I couldn't find a database server on '$databaseConfig[server]'", $databaseConfig['server'] ) )) { if($this->requireDatabaseConnection( $databaseConfig, array( "Database Configuration", "Database access credentials correct", "That username/password doesn't work" ) )) { if($this->requireDatabaseVersion( $databaseConfig, array( "Database Configuration", "Database server meets required version", "" ) )) { $this->requireDatabaseOrCreatePermissions( $databaseConfig, array( "Database Configuration", "Can I access/create the database", "I can't create new databases and the database '$databaseConfig[database]' doesn't exist" ) ); } } } } } function checkAdminConfig($adminConfig) { if(!$adminConfig['username']) { $this->error(array('', 'Please enter a username!')); } if(!$adminConfig['password']) { $this->error(array('', 'Please enter a password!')); } } /** * Check if the web server is IIS. * @return boolean */ function isIIS() { if(isset($_SERVER['SERVER_SOFTWARE'])) { if(strpos($_SERVER['SERVER_SOFTWARE'], 'IIS/7') !== false) { return true; } } return false; } function isApache() { $signature = !empty($_SERVER['SERVER_SIGNATURE']) ? $_SERVER['SERVER_SIGNATURE'] : @$_SERVER['SERVER_SOFTWARE']; $signature = strip_tags(trim($signature)); if($signature && strpos($signature, 'Apache') !== false) { return true; } else { return false; } } function findWebserver() { $webserver = strip_tags(trim(@$_SERVER['SERVER_SIGNATURE'])); if(!$webserver) { if(isset($_SERVER['SERVER_SOFTWARE'])) { if(strpos($_SERVER['SERVER_SOFTWARE'], 'IIS/7') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) { $webserver = $_SERVER['SERVER_SOFTWARE']; } } else { $webserver = "I can't tell what webserver you are running"; } } return $webserver; } /** * Check everything except the database */ function check() { $this->errors = null; $isApache = $this->isApache(); $isIIS = $this->isIIS(); $webserver = $this->findWebserver(); $this->requirePHPVersion('5.2.0', '5.1.0', array("PHP Configuration", "PHP5 installed", null, "PHP version " . phpversion())); // Check that we can identify the root folder successfully $this->requireFile('sapphire/dev/install/config-form.html', array("File permissions", "Does the webserver know where files are stored?", "The webserver isn't letting me identify where files are stored.", $this->getBaseDir() )); $this->requireFile('mysite', array("File permissions", "mysite/ folder exists", "There's no mysite folder.")); $this->requireFile('sapphire', array("File permissions", "sapphire/ folder exists", "There's no sapphire folder.")); $this->requireFile('cms', array("File permissions", "cms/ folder exists", "There's no cms folder.")); if($isApache) { $this->requireWriteable('.htaccess', array("File permissions", "Is the .htaccess file writeable?", null)); } elseif($isIIS) { $this->requireWriteable('web.config', array("File permissions", "Is the web.config file writeable?", null)); } $this->requireWriteable('mysite/_config.php', array("File permissions", "Is the mysite/_config.php file writeable?", null)); $this->requireWriteable('assets', array("File permissions", "Is the assets/ folder writeable?", null)); $this->requireTempFolder(array('File permissions', 'Is the temporary folder writeable?', null)); // Check for web server, unless we're calling the installer from the command-line if(!isset($_SERVER['argv']) || !$_SERVER['argv']) { $this->isRunningWebServer(array("Webserver Configuration", "Server software", "Unknown web server", $webserver)); if($isApache) { $this->requireApacheRewriteModule('mod_rewrite', array("Webserver Configuration", "URL rewriting support", "You need mod_rewrite to use friendly URLs with SilverStripe, but it is not enabled.")); } elseif($isIIS) { $this->requireIISRewriteModule('IIS_UrlRewriteModule', array("Webserver Configuration", "URL rewriting support", "You need to enable the IIS URL Rewrite Module to use friendly URLs with SilverStripe, but it is not installed or enabled. Download it for IIS 7 from http://www.iis.net/expand/URLRewrite")); } else { $this->warning(array("Webserver Configuration", "URL rewriting support", "I can't tell whether any rewriting module is running. You may need to configure a rewriting rule yourself.")); } $this->requireServerVariables(array('SCRIPT_NAME','HTTP_HOST','SCRIPT_FILENAME'), array("Webserver config", "Recognised webserver", "You seem to be using an unsupported webserver. The server variables SCRIPT_NAME, HTTP_HOST, SCRIPT_FILENAME need to be set.")); } // Check for GD support if(!$this->requireFunction("imagecreatetruecolor", array("PHP Configuration", "GD2 support", "PHP must have GD version 2."))) { $this->requireFunction("imagecreate", array("PHP Configuration", "GD2 support", "GD support for PHP not included.")); } // Check for XML support $this->requireFunction('xml_set_object', array("PHP Configuration", "XML support", "XML support not included in PHP.")); $this->requireClass('DOMDocument', array("PHP Configuration", "DOM/XML support", "DOM/XML support not included in PHP.")); // Check for token_get_all $this->requireFunction('token_get_all', array("PHP Configuration", "PHP Tokenizer", "PHP tokenizer support not included in PHP.")); // Check memory allocation $this->requireMemory(32*1024*1024, 64*1024*1024, array("PHP Configuration", "Memory allocated (PHP config option 'memory_limit')", "SilverStripe needs a minimum of 32M allocated to PHP, but recommends 64M.", ini_get("memory_limit"))); return $this->errors; } function suggestPHPSetting($settingName, $settingValues, $testDetails) { $this->testing($testDetails); $val = ini_get($settingName); if(!in_array($val, $settingValues) && $val != $settingValues) { $testDetails[2] = "$settingName is set to '$val' in php.ini. $testDetails[2]"; $this->warning($testDetails); } } function requireMemory($min, $recommended, $testDetails) { $_SESSION['forcemem'] = false; $mem = $this->getPHPMemory(); if($mem < (64 * 1024 * 1024)) { ini_set('memory_limit', '64M'); $mem = $this->getPHPMemory(); $testDetails[3] = ini_get("memory_limit"); } $this->testing($testDetails); if($mem < $min && $mem > 0) { $testDetails[2] .= " You only have " . ini_get("memory_limit") . " allocated"; $this->error($testDetails); } else if($mem < $recommended && $mem > 0) { $testDetails[2] .= " You only have " . ini_get("memory_limit") . " allocated"; $this->warning($testDetails); } elseif($mem == 0) { $testDetails[2] .= " We can't determine how much memory you have allocated. Install only if you're sure you've allocated at least 20 MB."; $this->warning($testDetails); } } function getPHPMemory() { $memString = ini_get("memory_limit"); switch(strtolower(substr($memString,-1))) { case "k": return round(substr($memString,0,-1)*1024); case "m": return round(substr($memString,0,-1)*1024*1024); case "g": return round(substr($memString,0,-1)*1024*1024*1024); default: return round($memString); } } function listErrors() { if($this->errors) { echo "<p>The following problems are preventing me from installing SilverStripe CMS:</p>\n\n"; foreach($this->errors as $error) { echo "<li>" . htmlentities(implode(", ", $error)) . "</li>\n"; } } } function showTable($section = null) { if($section) { $tests = $this->tests[$section]; $id = strtolower(str_replace(' ', '_', $section)); echo "<table id=\"{$id}_results\" class=\"testResults\" width=\"100%\">"; foreach($tests as $test => $result) { echo "<tr class=\"$result[0]\"><td>$test</td><td>" . nl2br(htmlentities($result[1])) . "</td></tr>"; } echo "</table>"; } else { foreach($this->tests as $section => $tests) { $failedRequirements = 0; $warningRequirements = 0; $output = ""; foreach($tests as $test => $result) { if(isset($result['0'])) { switch($result['0']) { case 'error': $failedRequirements++; break; case 'warning': $warningRequirements++; break; } } $output .= "<tr class=\"$result[0]\"><td>$test</td><td>" . nl2br(htmlentities($result[1])) . "</td></tr>"; } $className = "good"; $text = "All Requirements Pass"; $pluralWarnings = ($warningRequirements == 1) ? 'Warning' : 'Warnings'; if($failedRequirements > 0) { $className = "error"; $pluralWarnings = ($warningRequirements == 1) ? 'Warning' : 'Warnings'; $text = $failedRequirements . ' Failed and '. $warningRequirements . ' '. $pluralWarnings; } else if($warningRequirements > 0) { $className = "warning"; $text = "All Requirements Pass but ". $warningRequirements . ' '. $pluralWarnings; } echo "<h5 class='requirement $className'><em class='inlineBarText'>$section</em> <a href='#'>See All Requirements</a> <span>$text</span></h5>"; echo "<table class=\"testResults\">"; echo $output; echo "</table>"; } } } function requireFunction($funcName, $testDetails) { $this->testing($testDetails); if(!function_exists($funcName)) $this->error($testDetails); else return true; } function requireClass($className, $testDetails) { $this->testing($testDetails); if(!class_exists($className)) $this->error($testDetails); else return false; } /** * Require that the given class doesn't exist */ function requireNoClasses($classNames, $testDetails) { $this->testing($testDetails); $badClasses = array(); foreach($classNames as $className) { if(class_exists($className)) $badClasses[] = $className; } if($badClasses) { $testDetails[2] .= ". The following classes are at fault: " . implode(', ', $badClasses); $this->error($testDetails); } else return true; } function requirePHPVersion($recommendedVersion, $requiredVersion, $testDetails) { $this->testing($testDetails); $installedVersion = phpversion(); if(version_compare($installedVersion, $requiredVersion, '<')) { $testDetails[2] = "SilverStripe requires PHP version $requiredVersion or later.\n PHP version $installedVersion is currently installed.\n While SilverStripe requires at least PHP version $requiredVersion, upgrading to $recommendedVersion or later is recommended.\n If you are installing SilverStripe on a shared web server, please ask your web hosting provider to upgrade PHP for you."; $this->error($testDetails); return; } if(version_compare($installedVersion, $recommendedVersion, '<')) { $testDetails[2] = "PHP version $installedVersion is currently installed.\n Upgrading to at least PHP version $recommendedVersion is recommended.\n SilverStripe should run, but you may run into issues. Future releases may require a later version of PHP.\n"; $this->warning($testDetails); return; } return true; } function requireFile($filename, $testDetails) { $this->testing($testDetails); $filename = $this->getBaseDir() . $filename; if(!file_exists($filename)) { $testDetails[2] .= " (file '$filename' not found)"; $this->error($testDetails); } } function requireWriteable($filename, $testDetails) { $this->testing($testDetails); $filename = $this->getBaseDir() . str_replace("/", DIRECTORY_SEPARATOR,$filename); if(!is_writeable($filename)) { if(function_exists('posix_getgroups')) { $userID = posix_geteuid(); $user = posix_getpwuid($userID); $currentOwnerID = fileowner($filename); $currentOwner = posix_getpwuid($currentOwnerID); $testDetails[2] .= "User '$user[name]' needs to be able to write to this file:\n$filename\n\nThe file is currently owned by '$currentOwner[name]'. "; if($user['name'] == $currentOwner['name']) { $testDetails[2] .= "We recommend that you make the file writeable."; } else { $groups = posix_getgroups(); foreach($groups as $group) { $groupInfo = posix_getgrgid($group); if(in_array($currentOwner['name'], $groupInfo['members'])) $groupList[] = $groupInfo['name']; } if($groupList) { $testDetails[2] .= " We recommend that you make the file group-writeable and change the group to one of these groups:\n - ". implode("\n - ", $groupList) . "\n\nFor example:\nchmod g+w $filename\nchgrp " . $groupList[0] . " $filename"; } else { $testDetails[2] .= " There is no user-group that contains both the web-server user and the owner of this file. Change the ownership of the file, create a new group, or temporarily make the file writeable by everyone during the install process."; } } } else { $testDetails[2] .= "The webserver user needs to be able to write to this file:\n$filename"; } $this->error($testDetails); } } function requireTempFolder($testDetails) { $this->testing($testDetails); if(function_exists('sys_get_temp_dir')) { $sysTmp = sys_get_temp_dir(); } elseif(isset($_ENV['TMP'])) { $sysTmp = $_ENV['TMP']; } else { @$tmpFile = tempnam('adfadsfdas',''); @unlink($tmpFile); $sysTmp = dirname($tmpFile); } $worked = true; $ssTmp = "$sysTmp/silverstripe-cache"; if(!@file_exists($ssTmp)) { @$worked = mkdir($ssTmp); if(!$worked) { $ssTmp = dirname($_SERVER['SCRIPT_FILENAME']) . "/silverstripe-cache"; $worked = true; if(!@file_exists($ssTmp)) { @$worked = mkdir($ssTmp); } if(!$worked) { $testDetails[2] = "Permission problem gaining access to a temp folder. " . "Please create a folder named silverstripe-cache in the base folder " . "of the installation and ensure it has the adequate permissions"; $this->error($testDetails); } } } } function requireApacheModule($moduleName, $testDetails) { $this->testing($testDetails); if(!in_array($moduleName, apache_get_modules())) { $this->error($testDetails); return false; } else { return true; } } function testApacheRewriteExists($moduleName = 'mod_rewrite') { if(function_exists('apache_get_modules') && in_array($moduleName, apache_get_modules())) { return true; } else { return false; } } function testIISRewriteModuleExists($moduleName = 'IIS_UrlRewriteModule') { if(isset($_SERVER[$moduleName]) && $_SERVER[$moduleName]) { return true; } else { return false; } } function requireApacheRewriteModule($moduleName, $testDetails) { $this->testing($testDetails); if($this->testApacheRewriteExists()) { return true; } else { $this->warning($testDetails); return false; } } /** * Determines if the web server has any rewriting capability. * @return boolean */ function hasRewritingCapability() { return ($this->testApacheRewriteExists() || $this->testIISRewriteModuleExists()); } function requireIISRewriteModule($moduleName, $testDetails) { $this->testing($testDetails); if($this->testIISRewriteModuleExists()) { return true; } else { $this->warning($testDetails); return false; } } /** * Get an instance of a helper class for the specific database. * @param string $databaseClass e.g. MySQLDatabase or MSSQLDatabase */ function getDatabaseConfigurationHelper($databaseClass) { $adapters = DatabaseAdapterRegistry::get_adapters(); if(isset($adapters[$databaseClass])) { $helperPath = $adapters[$databaseClass]['helperPath']; $class = str_replace('.php', '', basename($helperPath)); } return (class_exists($class)) ? new $class() : new MySQLDatabaseConfigurationHelper(); } function requireDatabaseFunctions($databaseConfig, $testDetails) { $this->testing($testDetails); $helper = $this->getDatabaseConfigurationHelper($databaseConfig['type']); $result = $helper->requireDatabaseFunctions($databaseConfig); if($result) { return true; } else { $this->error($testDetails); return false; } } function requireDatabaseConnection($databaseConfig, $testDetails) { $this->testing($testDetails); $helper = $this->getDatabaseConfigurationHelper($databaseConfig['type']); $result = $helper->requireDatabaseConnection($databaseConfig); if($result['success']) { return true; } else { $testDetails[2] .= ": " . $result['error']; $this->error($testDetails); return false; } } function requireDatabaseVersion($databaseConfig, $testDetails) { $this->testing($testDetails); $helper = $this->getDatabaseConfigurationHelper($databaseConfig['type']); if(method_exists($helper, 'requireDatabaseVersion')) { $result = $helper->requireDatabaseVersion($databaseConfig); if($result['success']) { return true; } else { $testDetails[2] .= $result['error']; $this->warning($testDetails); return false; } } // Skipped test because this database has no required version return true; } function requireDatabaseServer($databaseConfig, $testDetails) { $this->testing($testDetails); $helper = $this->getDatabaseConfigurationHelper($databaseConfig['type']); $result = $helper->requireDatabaseServer($databaseConfig); if($result['success']) { return true; } else { $testDetails[2] .= ": " . $result['error']; $this->error($testDetails); return false; } } function requireDatabaseOrCreatePermissions($databaseConfig, $testDetails) { $this->testing($testDetails); $helper = $this->getDatabaseConfigurationHelper($databaseConfig['type']); $result = $helper->requireDatabaseOrCreatePermissions($databaseConfig); if($result['success']) { if($result['alreadyExists']) $testDetails[3] = "Database $databaseConfig[database] exists"; else $testDetails[3] = "Able to create a new database"; $this->testing($testDetails); return true; } else { if(!@$result['cannotCreate']) { $testDetails[2] .= ". Please create the database manually."; } else { $testDetails[2] .= " (user '$databaseConfig[username]' doesn't have CREATE DATABASE permissions.)"; } $this->error($testDetails); return false; } } function requireServerVariables($varNames, $errorMessage) { //$this->testing($testDetails); foreach($varNames as $varName) { if(!$_SERVER[$varName]) $missing[] = '$_SERVER[' . $varName . ']'; } if(!isset($missing)) { return true; } else { $testDetails[2] .= " (the following PHP variables are missing: " . implode(", ", $missing) . ")"; $this->error($testDetails); } } function isRunningWebServer($testDetails) { $this->testing($testDetails); if(function_exists('apache_get_modules') || stristr(@$_SERVER['SERVER_SIGNATURE'], 'Apache')) { return true; } elseif(strpos($_SERVER['SERVER_SOFTWARE'], 'IIS/7') !== false) { return true; } else { $this->warning($testDetails); return false; } } // Must be PHP4 compatible var $baseDir; function getBaseDir() { // Cache the value so that when the installer mucks with SCRIPT_FILENAME half way through, this method // still returns the correct value. if(!$this->baseDir) $this->baseDir = realpath(dirname($_SERVER['SCRIPT_FILENAME'])) . DIRECTORY_SEPARATOR; return $this->baseDir; } function testing($testDetails) { if(!$testDetails) return; $section = $testDetails[0]; $test = $testDetails[1]; $message = "OK"; if(isset($testDetails[3])) $message .= " ($testDetails[3])"; $this->tests[$section][$test] = array("good", $message); } function error($testDetails) { $section = $testDetails[0]; $test = $testDetails[1]; $this->tests[$section][$test] = array("error", $testDetails[2]); $this->errors[] = $testDetails; } function warning($testDetails) { $section = $testDetails[0]; $test = $testDetails[1]; $this->tests[$section][$test] = array("warning", $testDetails[2]); $this->warnings[] = $testDetails; } function hasErrors() { return sizeof($this->errors); } function hasWarnings() { return sizeof($this->warnings); } } class Installer extends InstallRequirements { function __construct() { // Cache the baseDir value $this->getBaseDir(); } function install($config) { if(isset($_SERVER['HTTP_HOST'])) { ?> <html> <head> <title>Installing SilverStripe...</title> <link rel="stylesheet" type="text/css" href="themes/blackcandy/css/layout.css" /> <link rel="stylesheet" type="text/css" href="themes/blackcandy/css/typography.css" /> <link rel="stylesheet" type="text/css" href="themes/blackcandy/css/form.css" /> <link rel="stylesheet" type="text/css" href="sapphire/dev/install/install.css" /> <script src="sapphire/thirdparty/jquery/jquery.js"></script> </head> <body> <div id="BgContainer"> <div id="Container"> <div id="Header"> <h1>SilverStripe CMS Installation</h1> </div> <div id="Navigation">&nbsp;</div> <div class="clear"><!-- --></div> <div id="Layout"> <div class="typography"> <h1>Installing SilverStripe...</h1> <p>I am now running through the installation steps (this should take about 30 seconds)</p> <p>If you receive a fatal error, refresh this page to continue the installation</p> <ul> <?php } else { echo "SILVERSTRIPE COMMAND-LINE INSTALLATION\n\n"; } $webserver = $this->findWebserver(); $isIIS = $this->isIIS(); $isApache = $this->isApache(); flush(); if(isset($config['stats'])) { if(file_exists('sapphire/silverstripe_version')) { $sapphireVersionFile = file_get_contents('sapphire/silverstripe_version'); if(strstr($sapphireVersionFile, "/sapphire/trunk")) { $silverstripe_version = "trunk"; } else { preg_match("/sapphire\/(?:(?:branches)|(?:tags))(?:\/rc)?\/([A-Za-z0-9._-]+)\/silverstripe_version/", $sapphireVersionFile, $matches); $silverstripe_version = $matches[1]; } } else { $silverstripe_version = "unknown"; } $phpVersion = urlencode(phpversion()); $encWebserver = urlencode($webserver); $dbType = $config['db']['type']; // Try to determine the database version from the helper $databaseVersion = $config['db']['type']; $helper = $this->getDatabaseConfigurationHelper($dbType); if($helper && method_exists($helper, 'getDatabaseVersion')) { $databaseVersion = urlencode($dbType . ': ' . $helper->getDatabaseVersion($config['db'][$dbType])); } $url = "http://ss2stat.silverstripe.com/Installation/add?SilverStripe=$silverstripe_version&PHP=$phpVersion&Database=$databaseVersion&WebServer=$encWebserver"; if(isset($_SESSION['StatsID']) && $_SESSION['StatsID']) { $url .= '&ID=' . $_SESSION['StatsID']; } @$_SESSION['StatsID'] = file_get_contents($url); } if(file_exists('mysite/_config.php')) { // Truncate the contents of _config instead of deleting it - we can't re-create it because Windows handles permissions slightly // differently to UNIX based filesystems - it takes the permissions from the parent directory instead of retaining them $fh = fopen('mysite/_config.php', 'wb'); fclose($fh); } $theme = isset($_POST['template']) ? $_POST['template'] : 'blackcandy'; $locale = isset($_POST['locale']) ? $_POST['locale'] : 'en_US'; $type = $config['db']['type']; $dbConfig = $config['db'][$type]; if(!$dbConfig) { echo "<p style=\"color: red\">Bad config submitted</p><pre>"; print_r($config); echo "</pre>"; die(); } // Write the config file global $usingEnv; if($usingEnv) { $this->statusMessage("Setting up 'mysite/_config.php' for use with _ss_environment.php..."); $this->writeToFile("mysite/_config.php", <<<PHP <?php global \$project; \$project = 'mysite'; global \$database; \$database = '{$dbConfig['database']}'; require_once('conf/ConfigureFromEnv.php'); MySQLDatabase::set_connection_charset('utf8'); // This line set's the current theme. More themes can be // downloaded from http://www.silverstripe.org/themes/ SSViewer::set_theme('$theme'); // Set the site locale i18n::set_locale('$locale'); // enable nested URLs for this site (e.g. page/sub-page/) SiteTree::enable_nested_urls(); PHP ); } else { $this->statusMessage("Setting up 'mysite/_config.php'..."); $escapedPassword = addslashes($dbConfig['password']); $this->writeToFile("mysite/_config.php", <<<PHP <?php global \$project; \$project = 'mysite'; global \$databaseConfig; \$databaseConfig = array( "type" => '{$type}', "server" => '{$dbConfig['server']}', "username" => '{$dbConfig['username']}', "password" => '{$escapedPassword}', "database" => '{$dbConfig['database']}', "path" => '{$dbConfig['path']}', ); // Sites running on the following servers will be // run in development mode. See // http://doc.silverstripe.org/doku.php?id=configuration // for a description of what dev mode does. Director::set_dev_servers(array( 'localhost', '127.0.0.1' )); MySQLDatabase::set_connection_charset('utf8'); // This line set's the current theme. More themes can be // downloaded from http://www.silverstripe.org/themes/ SSViewer::set_theme('$theme'); // Set the site locale i18n::set_locale('$locale'); // enable nested URLs for this site (e.g. page/sub-page/) SiteTree::enable_nested_urls(); PHP ); } // Write the appropriate web server configuration file for rewriting support if($this->hasRewritingCapability()) { if($isApache) { $this->statusMessage("Setting up '.htaccess' file..."); $this->createHtaccess(); } elseif($isIIS) { $this->statusMessage("Setting up 'web.config' file..."); $this->createWebConfig(); } } // Load the sapphire runtime $_SERVER['SCRIPT_FILENAME'] = dirname(realpath($_SERVER['SCRIPT_FILENAME'])) . '/sapphire/main.php'; chdir('sapphire'); // Rebuild the manifest $_GET['flush'] = true; // Show errors as if you're in development mode $_SESSION['isDev'] = 1; require_once('core/Core.php'); $this->statusMessage("Building database schema..."); // Build database $con = new Controller(); $con->pushCurrent(); global $databaseConfig; DB::connect($databaseConfig); $dbAdmin = new DatabaseAdmin(); $dbAdmin->init(); $dbAdmin->doBuild(true); // Create default administrator user and group in database // (not using Security::setDefaultAdmin()) $adminMember = Security::findAnAdministrator(); $adminMember->Email = $config['admin']['username']; $adminMember->Password = $config['admin']['password']; $adminMember->PasswordEncryption = Security::get_password_encryption_algorithm(); // @todo Exception thrown if database with admin already exists with same Email try { $adminMember->write(); } catch(Exception $e) { } // Syncing filesystem (so /assets/Uploads is available instantly, see ticket #2266) Filesystem::sync(); $_SESSION['username'] = $config['admin']['username']; $_SESSION['password'] = $config['admin']['password']; if(!$this->errors) { if(isset($_SERVER['HTTP_HOST']) && $this->hasRewritingCapability()) { $this->statusMessage("Checking that friendly URLs work..."); $this->checkRewrite(); } else { echo <<<HTML <li>SilverStripe successfully installed; I am now redirecting you to your SilverStripe site...</li> <script> setTimeout(function() { window.location = "index.php/home/successfullyinstalled?flush=1"; }, 2000); </script> <noscript> <li><a href="index.php/home/successfullyinstalled?flush=1">Click here to access your site.</li> </noscript> HTML; } } return $this->errors; } function writeToFile($filename, $content) { $base = $this->getBaseDir(); $this->statusMessage("Setting up $base$filename"); if((@$fh = fopen($base . $filename, 'wb')) && fwrite($fh, $content) && fclose($fh)) { return true; } else { $this->error("Couldn't write to file $base$filename"); } } function createHtaccess() { $start = "### SILVERSTRIPE START ###\n"; $end = "\n### SILVERSTRIPE END ###"; $base = dirname($_SERVER['SCRIPT_NAME']); if(defined('DIRECTORY_SEPARATOR')) $base = str_replace(DIRECTORY_SEPARATOR, '/', $base); else $base = str_replace("\\", '/', $base); if($base != '.') $baseClause = "RewriteBase $base\n"; else $baseClause = ""; $rewrite = <<<TEXT <Files *.ss> Order deny,allow Deny from all Allow from 127.0.0.1 </Files> <Files web.config> Order deny,allow Deny from all </Files> <IfModule mod_rewrite.c> RewriteEngine On $baseClause RewriteCond %{REQUEST_URI} ^(.*)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L] </IfModule> TEXT; if(file_exists('.htaccess')) { $htaccess = file_get_contents('.htaccess'); if(strpos($htaccess, '### SILVERSTRIPE START ###') === false && strpos($htaccess, '### SILVERSTRIPE END ###') === false) { $htaccess .= "\n### SILVERSTRIPE START ###\n### SILVERSTRIPE END ###\n"; } if(strpos($htaccess, '### SILVERSTRIPE START ###') !== false && strpos($htaccess, '### SILVERSTRIPE END ###') !== false) { $start = substr($htaccess, 0, strpos($htaccess, '### SILVERSTRIPE START ###')) . "### SILVERSTRIPE START ###\n"; $end = "\n" . substr($htaccess, strpos($htaccess, '### SILVERSTRIPE END ###')); } } $this->writeToFile('.htaccess', $start . $rewrite . $end); } /** * Writes basic configuration to the web.config for IIS * so that rewriting capability can be use. */ function createWebConfig() { $content = <<<TEXT <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="SilverStripe Clean URLs" stopProcessing="true"> <match url="^(.*)$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> </conditions> <action type="Rewrite" url="sapphire/main.php?url={R:1}" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer> </configuration> TEXT; $this->writeToFile('web.config', $content); } function checkRewrite() { if(!isset($_SERVER['HTTP_HOST']) || !$_SERVER['HTTP_HOST']) { $this->statusMessage("Installer seems to be called from command-line, we're going to assume that rewriting is working."); return true; } echo <<<HTML <li id="ModRewriteResult">Testing...</li> <script> if(typeof $ == 'undefined') { document.getElemenyById('ModeRewriteResult').innerHTML = "I can't run jQuery ajax to set rewriting; I will redirect you to the homepage to see if everything is working."; setTimeout(function() { window.location = "home/successfullyinstalled?flush=1"; }, 10000); } else { $.ajax({ method: 'get', url: 'InstallerTest/testrewrite', complete: function(response) { if(response.responseText == 'OK') { $('#ModRewriteResult').html("Friendly URLs set up successfully; I am now redirecting you to your SilverStripe site...") setTimeout(function() { window.location = "home/successfullyinstalled?flush=1"; }, 2000); } else { $('#ModRewriteResult').html("Friendly URLs are not working. This is most likely because a rewrite module isn't configured" + "correctly on your site. Please check the following things in your Apache configuration; " + " you may need to get your web host or server administrator to do this for you:" + "<ul><li>mod_rewrite is enabled</li><li>AllowOverride All is set for your directory</li></ul>"); } } }); } </script> <noscript> <li><a href="home/successfullyinstalled?flush=1">Click here to check friendly URLs are working. If you get a 404 then something is wrong.</li> </noscript> HTML; } function var_export_array_nokeys($array) { $retval = "array(\n"; foreach($array as $item) { $retval .= "\t'"; $retval .= trim($item); $retval .= "',\n"; } $retval .= ")"; return $retval; } /** * Show an installation status message. * The output differs depending on whether this is CLI or web based */ function statusMessage($msg) { if(isset($_SERVER['HTTP_HOST'])) echo "<li>$msg</li>\n"; else echo "$msg\n"; flush(); } }
{ "content_hash": "d150659ec321a1e82ccecdb15cbb0a59", "timestamp": "", "source": "github", "line_count": 1250, "max_line_length": 307, "avg_line_length": 32.5896, "alnum_prop": 0.6430763188256376, "repo_name": "mattclegg/silverstripe-doc-restructuring", "id": "15e4d986845028a01ab72cdd687fe08783fb01dd", "size": "40737", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "preview/install.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "5045985" }, { "name": "PHP", "bytes": "7360131" }, { "name": "Ruby", "bytes": "6364" }, { "name": "Scheme", "bytes": "76497" }, { "name": "Shell", "bytes": "16747" } ], "symlink_target": "" }
import template from "./template.html"; export default { template, config: {} };
{ "content_hash": "851270e2b0ee03f6009bf967564cb303", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 39, "avg_line_length": 14.833333333333334, "alnum_prop": 0.6404494382022472, "repo_name": "blinxjs/blinxjs", "id": "780f9b8d17a7a3c80f4f29561507afc6645c82b3", "size": "89", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/resolve-render-n-after-render/modules/head/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "177903" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "99040af991c046975033e8ea189e3b83", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "9e32507c2b9697b53a00a6c696d5c594b142d804", "size": "181", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Ixora/Ixora mooreensis/ Syn. Hitoa mooreensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.mastercard.api.partnerwallet.domain.common; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for MobilePhone complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="MobilePhone"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="CountryCode" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="PhoneNumber" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="ExtensionPoint" type="{}ExtensionPoint" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "MobilePhone", propOrder = { "countryCode", "phoneNumber", "extensionPoint" }) public class MobilePhone { @XmlElement(name = "CountryCode", required = true) protected String countryCode; @XmlElement(name = "PhoneNumber", required = true) protected String phoneNumber; @XmlElement(name = "ExtensionPoint") protected ExtensionPoint extensionPoint; /** * Gets the value of the countryCode property. * * @return * possible object is * {@link String } * */ public String getCountryCode() { return countryCode; } /** * Sets the value of the countryCode property. * * @param value * allowed object is * {@link String } * */ public void setCountryCode(String value) { this.countryCode = value; } /** * Gets the value of the phoneNumber property. * * @return * possible object is * {@link String } * */ public String getPhoneNumber() { return phoneNumber; } /** * Sets the value of the phoneNumber property. * * @param value * allowed object is * {@link String } * */ public void setPhoneNumber(String value) { this.phoneNumber = value; } /** * Gets the value of the extensionPoint property. * * @return * possible object is * {@link ExtensionPoint } * */ public ExtensionPoint getExtensionPoint() { return extensionPoint; } /** * Sets the value of the extensionPoint property. * * @param value * allowed object is * {@link ExtensionPoint } * */ public void setExtensionPoint(ExtensionPoint value) { this.extensionPoint = value; } }
{ "content_hash": "ba12eefabe35cbdbac43886e80e3732d", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 95, "avg_line_length": 24.508474576271187, "alnum_prop": 0.5968188105117566, "repo_name": "thgriefers/mastercard-api-java", "id": "7f2032559f62ad4af5fa7d731e108cd4128fa6d9", "size": "2892", "binary": false, "copies": "1", "ref": "refs/heads/MasterCard/master", "path": "src/main/java/com/mastercard/api/partnerwallet/domain/common/MobilePhone.java", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "2458408" } ], "symlink_target": "" }
/** * @file MultiIndexBarrelReader.h * @author Yingfeng Zhang * @version SF1 v5.0 * @brief Multi Index Barrel Reader */ #ifndef MULTIINDEXBARRELREADER_H #define MULTIINDEXBARRELREADER_H #include <ir/index_manager/index/IndexBarrelWriter.h> #include <ir/index_manager/index/IndexBarrelReader.h> #include <ir/index_manager/index/BarrelInfo.h> #include <ir/index_manager/index/SingleIndexBarrelReader.h> #include <ir/index_manager/store/Directory.h> NS_IZENELIB_IR_BEGIN namespace indexmanager{ /** * @brief The helper class to make pair between BarrelInfo and SingleIndexBarrelReader, * this pair will be stored inside the MultiIndexBarrelReader */ class BarrelReaderEntry { public: BarrelReaderEntry(IndexReader* pIndexReader,BarrelInfo* pBarrelInfo) { pBarrelInfo_ = pBarrelInfo; if (pBarrelInfo->getWriter()) pBarrelReader_ = pBarrelInfo->getWriter()->inMemoryReader(); else pBarrelReader_ = new SingleIndexBarrelReader(pIndexReader,pBarrelInfo); } ~BarrelReaderEntry() { delete pBarrelReader_; pBarrelReader_ = NULL; pBarrelInfo_ = NULL; } public: BarrelInfo* pBarrelInfo_; IndexBarrelReader* pBarrelReader_; friend class MultiIndexBarrelReader; }; /** * @brief Open multi index barrel and return instance of TermReader, * each index barrel is opened and read by SingleIndexBarrelReader */ class TermReader; class MultiIndexBarrelReader : public IndexBarrelReader { public: MultiIndexBarrelReader( IndexReader* pIndexReader, BarrelsInfo* pBarrelsInfo); virtual ~MultiIndexBarrelReader(); public: void open(const char* name); TermReader* termReader(collectionid_t colID); size_t getDistinctNumTerms(collectionid_t colID, const std::string& property); void close(); bool hasMemBarrel() { return hasMemBarrel_;} private: BarrelsInfo* pBarrelsInfo_; map<collectionid_t, TermReader*> termReaderMap_; vector<BarrelReaderEntry*> readers_; bool hasMemBarrel_; friend class MultiTermReader; }; } NS_IZENELIB_IR_END #endif
{ "content_hash": "dc4c36b1d19c573e0b2ae9c2e1b40616", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 87, "avg_line_length": 24.36263736263736, "alnum_prop": 0.6901217861975643, "repo_name": "izenecloud/izenelib", "id": "f6b522487b222280ca0f02fa85f153f0973aa1b4", "size": "2217", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "include/ir/index_manager/index/MultiIndexBarrelReader.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "81555" }, { "name": "C++", "bytes": "15025100" }, { "name": "Makefile", "bytes": "21662" }, { "name": "Ruby", "bytes": "699" }, { "name": "Shell", "bytes": "1359" } ], "symlink_target": "" }
'use strict'; var util = require('util'); var chalk = require('chalk'); var aws = require('./lib/aws.js'); var conf = require('./lib/conf.js'); module.exports = function (grunt) { grunt.registerTask('ec2_run_instance', 'Spins up an EC2 instance, gives a name tag and assigns an IP', function (name) { conf.init(grunt); if (arguments.length === 0) { grunt.fatal([ 'You should provide a name for the instance.', 'e.g: ' + chalk.yellow('grunt ec2_run_instance:name') ].join('\n')); } grunt.log.writeln('Launching EC2 %s instance', chalk.cyan(conf('AWS_INSTANCE_TYPE'))); var done = this.async(); var params = { ImageId: conf('AWS_IMAGE_ID'), InstanceType: conf('AWS_INSTANCE_TYPE'), MinCount: 1, MaxCount: 1, KeyName: conf('EXISTING_SSH_KEY_NAME') || name, SecurityGroups: [conf('AWS_SECURITY_GROUP')] }; var cmd = 'ec2 run-instances --image-id %s --instance-type %s --count %s --key-name %s --security-groups %s'; aws.log(cmd, params.ImageId, params.InstanceType, params.MinCount, params.KeyName, params.SecurityGroups[0]); aws.ec2.runInstances(params, aws.capture(next)); function next (result) { var elastic = conf('ELASTIC_IP'); grunt.log.ok('ELASTIC IP ---- ' + conf('ELASTIC_IP')); var id = result.Instances[0].InstanceId; var tasks = [ util.format('ec2_create_tag:%s:%s', id, name) ]; if (elastic) { tasks.push('ec2_assign_address:' + id); } grunt.log.ok('Instance requested, initializing...'); grunt.task.run(tasks); done(); } }); };
{ "content_hash": "5fd2a0c7187364f21b03162d0c136f6d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 124, "avg_line_length": 33.98148148148148, "alnum_prop": 0.5367847411444142, "repo_name": "ChoiceScreening/grunt-ec2", "id": "d3bd4eadfb1b76d70ad88a0800639200c4c2f00a", "size": "1835", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tasks/ec2_run_instance.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "57912" } ], "symlink_target": "" }
<?php /** * Created by Hisune EchartsPHP AutoGenerate. * @author: Hisune <hi@hisune.com> */ namespace Hisune\EchartsPHP\Doc\IDE\Toolbox; use Hisune\EchartsPHP\Property; /** * @property Feature\SaveAsImage $saveAsImage * Save as image. * * @property Feature\Restore $restore * Restore configuration item. * * @property Feature\DataView $dataView * Data view tool, which could display data in current chart and updates chart after being edited. * * @property Feature\DataZoom $dataZoom * Data area zooming, which only supports rectangular coordinate by now. * * @property Feature\MagicType $magicType * Magic type switching. * 示例: * feature: { * magicType: { * type: [line, bar, stack] * } * } * * @property Feature\Brush $brush * Brush-selecting icon. * It can also be configured at brush.toolbox. * * {_more_} */ class Feature extends Property {}
{ "content_hash": "65366bacb16c103005a19bc9073ecf40", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 101, "avg_line_length": 24.153846153846153, "alnum_prop": 0.6592356687898089, "repo_name": "hisune/Echarts-PHP", "id": "07b2dc7c32febe8e27e9078dd8599dd1de2bf462", "size": "946", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Doc/IDE/Toolbox/Feature.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "3525197" } ], "symlink_target": "" }
module Xiki # Saves and restores locations. A location can include multiple of # these: a file, a line number, a column number class Location def self.menu %` - examples/ | orig = Location.new # Save where we are | Line.next 4; View.open '/tmp' # Go Somewhere else | orig.go # Go back to where we were ` end attr_accessor :line attr_accessor :file attr_accessor :column attr_accessor :buffer @@spots = {} def file_or_buffer @file || @buffer end # Save file and location def initialize *args # Just use file if it's passed if args[0] && args[0].class == String @file = File.expand_path(args.shift) return end if args[0] && args[0].class == Hash options = args.shift if options[:save_scroll_position] @scroll_position = ($el.line_number_at_pos $el.point) - ($el.line_number_at_pos $el.window_start) end end @file = $el.buffer_file_name @buffer = View.name @line = Line.number @column = $el.point - $el.point_at_bol # Get buffer if no file @buffer = $el.buffer_name unless @file end # Use View.open instead of this, where possible # Opens path, in other window if already open. # If nothing passed, prompt user. If string assume it's a path. # If symbol, assume it's a bookmark. def self.go path=nil, options={} # If no param passed, get key from user and go to corresponding location if path.nil? loc = Keys.input(:optional => true) loc ||= "0" loc = "_#{loc}" View.open("$#{loc}") # Optionally go to point $el.bookmark_jump(loc) unless $el.elvar.current_prefix_arg return # If symbol, look up location in map and go to it elsif path.class == Symbol # @@hash[path.to_s].go View.open("$#{path.to_s}") $el.bookmark_jump(path.to_s) return # If string, look up location in map and go to it elsif path.class == String and path[/^\$./] View.open(path, :goto_point => true) # Jump to specific boomkark point - redundant?? # Is this even a bookmark? $el.bookmark_jump(path.sub(/^\$/, "")) return end # Otherwise, go to path passed in self.new(path).go(options) end # Goes to location, with whatever information we have. Note that if # file is already shown, we just move to its window. def go options={} if ! options[:assume_file] if @file View.open(@file, options) else View.to_buffer(@buffer) end end $el.goto_line @line if @line # Exit if no column is set return unless @column # If enough space, just move to column if $el.point + @column <= $el.point_at_eol $el.forward_char @column # Otherwise, move to end else $el.end_of_line end $el.recenter @scroll_position if @scroll_position end # Saves a generic location based on user input def self.save name=nil # Use string if user types it quickly (or arg, if passed) name ||= Keys.input(:prompt => "Save this spot as (pause when done): ", :optional => true) name ||= "0" #path = path.to_s unless path.class == String name = "_#{name}" # Remove beginning $ (it might have been passed in with the arg) name.sub!(/^\$/, "") # Save location in corresponding register # @@hash[name] = Location.new $el.bookmark_set(name) end def self.jump path=nil path ||= "0" path = "_#{path}" #path = path.to_s unless path.class == String View.open("$#{path}") # Optionally go to point $el.bookmark_jump(path) #unless $el.elvar.current_prefix_arg end # Enter selected text at spot def self.enter_at_spot txt = View.selection txt = FileTree.snippet if Keys.prefix_u? Location.jump("0") View.set_mark $el.insert txt end def self.as_spot key='0' # Remember window (in case buffer in 2 windows) @@spot_index = View.index if key == '0' if View.file # If buffer has a file, just save in location Location.save(key) return @@spots[key] = nil end # Must be a buffer @@spots[key] = [$el.buffer_name(View.buffer), $el.point] end def self.to_spot key='0' if @@spots[key] View.to_buffer @@spots[key][0] View.to @@spots[key][1] else # If file, just jump # If original window/buffer still there, go back if key == '0' if $el.buffer_file_name($el.window_buffer(View.nth(@@spot_index))) == Bookmarks["$_0"] View.to_nth @@spot_index end end Location.jump(key) end end end end
{ "content_hash": "6ab93a108e3bb5775ced11edcaeb298a", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 107, "avg_line_length": 27.7909604519774, "alnum_prop": 0.5712543199837365, "repo_name": "stanwmusic/xiki", "id": "3535c10f6b456c7789ba4f7b996173a2bc6a39bc", "size": "4919", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/xiki/core/location.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Emacs Lisp", "bytes": "4936" }, { "name": "JavaScript", "bytes": "8616" }, { "name": "Python", "bytes": "411" }, { "name": "Ruby", "bytes": "1178474" }, { "name": "Shell", "bytes": "137" }, { "name": "VimL", "bytes": "639" } ], "symlink_target": "" }
/* eslint-env node */ const EmberApp = require('ember-cli/lib/broccoli/ember-app'); //const env = EmberApp.env(); module.exports = function(defaults) { var app = new EmberApp(defaults, { }); return app.toTree(); };
{ "content_hash": "c4fe375224947e2510de4b9bbf897872", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 61, "avg_line_length": 22.8, "alnum_prop": 0.6491228070175439, "repo_name": "pengjiang80/ui", "id": "6f207859ce48cdce4d1a74c3593155811ff19089", "size": "228", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/pipeline/ember-cli-build.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "157884" }, { "name": "HTML", "bytes": "739881" }, { "name": "JavaScript", "bytes": "1407771" }, { "name": "Shell", "bytes": "11290" }, { "name": "Standard ML", "bytes": "1205" } ], "symlink_target": "" }
Pelican-datatable - Automatic dynamic table generation for Pelican ================================================================== `pelican-datatable` is an open source Pelican plugin to produce dynamic HTML tables with visualizations. The plugin provides an automatic HTML table generation from a data structure. Currently plugin only works for Markdown formatted content. This pelican plugin is basically Pelican wrapper for [js-datatable JQuery plugin](https://github.com/toni-heittola/js-datatable). The project was originally developed for the needs of an academic data visualization (see e.g. [DCASE2016 evaluation campaign results](http://www.cs.tut.fi/sgn/arg/dcase2016/task-results-acoustic-scene-classification)). **Author** Toni Heittola (toni.heittola@gmail.com), [GitHub](https://github.com/toni-heittola), [Home page](http://www.cs.tut.fi/~heittolt/) Installation instructions ========================= ## Requirements **pyyaml** and **bs4** are required. To ensure that all external modules are installed, run: pip install -r requirements.txt Or install one by one: **pyyaml**, for yaml reading pip install pyyaml **bs4** (BeautifulSoup) for parsing HTML content pip install beautifulsoup4 ## Pelican installation Make sure the directory where the plugin was installed is set in `pelicanconf.py`. For example if you installed in `plugins/pelican-datatable`, add: PLUGIN_PATHS = ['plugins'] Enable pelican-datatable: PLUGINS = ['pelican-datatable'] To allow plugin in include css and js files, one needs to add following to the `base.html` template, in the head (to include css files): {% if article %} {% if article.styles %} {% for style in article.styles %} {{ style }} {% endfor %} {% endif %} {% endif %} {% if page %} {% if page.styles %} {% for style in page.styles %} {{ style }} {% endfor %} {% endif %} {% endif %} At the bottom of the page before `</body>` tag (to include js files): {% if article %} {% if article.scripts %} {% for script in article.scripts %} {{ script }} {% endfor %} {% endif %} {% endif %} {% if page %} {% if page.scripts %} {% for script in page.scripts %} {{ script }} {% endfor %} {% endif %} {% endif %} Usage ===== ## Table Datatable is injected to `<table>` tags with class `datatable`. Example: <table class="datatable table" data-yaml="content/data/test.yaml" data-show-chart="true" data-chart-modes="bar,scatter,comparison" data-chart-default-mode="scatter" data-id-field="code" data-sort-name="value1" data-sort-order="desc" data-rank-mode="grouped_muted" data-row-highlighting="false" data-pagination="false" data-show-pagination-switch="false" data-scatter-x="value1" data-scatter-y="value2" data-comparison-row-id-field="code" data-comparison-sets-json='[{"title": "All values","data_axis_title": "Value axis", "fields": ["value1", "value2", "value3", "value4"], "field_titles": ["custom title 1","custom title 2","custom title 3","custom title 4"]},{"title": "Sub comparison 1","data_axis_title": "Value", "fields": ["value1", "value2"]},{"title": "Sub comparison 2", "data_axis_title": "Accuracy", "fields": ["value3", "value4"]}]' data-comparison-active-set="All values" data-comparison-a-row="Red" data-comparison-b-row="Blue" data-filter-control="true" data-filter-show-clear="true" > <thead> <tr> <th data-rank="true">Rank</th> <th data-field="code" data-sortable="true"> Name </th> <th data-field="value1" data-sortable="true" data-value-type="float4" data-chartable="true"> Value 1 </th> <th data-field="value2" data-sortable="true" data-value-type="float4" data-chartable="true"> Value 2 </th> <th class="sep-left-cell" data-align="center" data-field="feature1" data-sortable="true" data-tag="true" data-filter-control="select"> Feature 1 </th> <th data-align="center" data-field="feature2" data-sortable="true" data-tag="true" data-filter-control="select"> Feature 2 </th> <th data-align="center" data-field="info.second_level_value" data-sortable="true" data-tag="true" data-filter-control="select"> Second level value </th> </tr> </thead> </table> ## Data structure file Place data structure file inside pelican project folder. Example structure: data: - code: Red value1: 12 value2: 22 value3: 62 value4: 52 feature1: square feature2: triangle row_css: danger info: second_level_value: 2 - code: Blue value1: 62 value2: 42 value3: 62 value4: 52 feature1: circle feature2: triangle row_css: warning info: second_level_value: 12 - code: Black value1: 18 value2: 42 value3: 62 value4: 52 feature1: square feature2: circle row_css: success info: second_level_value: 22 - code: White value1: 18 value2: 37 value3: 62 value4: 52 feature1: triangle feature2: square row_css: info info: second_level_value: 22 - code: Purple value1: 12 value2: 22 value3: 62 value4: 52 feature1: square feature2: circle info: second_level_value: 32 - code: Brown value1: 42 value2: 26 value3: 62 value4: 52 feature1: block feature2: pyramid info: second_level_value: 16 - code: Baseline value1: 62 value2: 32 value3: 62 value4: 52 feature1: triangle feature2: circle baseline: true row_css: active info: second_level_value: 54
{ "content_hash": "3c8039ebada658136037d3ebd7d6d207", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 592, "avg_line_length": 30.327659574468086, "alnum_prop": 0.5100322716430475, "repo_name": "toni-heittola/pelican-datatable", "id": "eaf7087cee2c6d81f471284dee822fd06c854994", "size": "7127", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "20684" } ], "symlink_target": "" }
<?php declare(strict_types = 1); namespace KoolKode\Expression\Parser; /** * Parsed unary operator. * * @author Martin Schröder */ class UnaryOperator extends Node { public $operator; public $operand; public function __construct(string $operator, Node $operand) { $this->operator = $operator; $this->operand = $operand; } }
{ "content_hash": "fbb81ec96968045c96f656b41ef82e54", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 64, "avg_line_length": 15.16, "alnum_prop": 0.6226912928759895, "repo_name": "koolkode/expression", "id": "a373d6628e0af969f82bd60730c0b974dd81270a", "size": "625", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Parser/UnaryOperator.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "149722" } ], "symlink_target": "" }
if (Meteor.isClient) { // This code only runs on the client Template.addBeer.helpers({ beers: function () { return Beer.find({}); } }); Template.addBeer.events({ "submit .add-a-beer": function (event) { // Prevent default browser form submit event.preventDefault(); // Get value from form element var beerName = event.target.beerName.value; var brewery = event.target.brewery.value; var beerType = event.target.beerType.value; console.log(beerName + " " + beerType + " " + brewery); // Insert a task into the collection Beer.insert({ beerName: beerName, brewery: brewery, beerType: beerType, createdAt: new Date() // current time }); event.target.beerName.value = ""; event.target.brewery.value = ""; event.target.beerType.value = ""; } }); }
{ "content_hash": "09348670446c5b1d680c700dfa0d54e0", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 61, "avg_line_length": 26.939393939393938, "alnum_prop": 0.5973003374578177, "repo_name": "gitaboard/beer-thirty", "id": "f027045a56695430b30ade4761f35d46955582d6", "size": "889", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "client/beer-thirty-client.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "33689" }, { "name": "HTML", "bytes": "1890" }, { "name": "JavaScript", "bytes": "1028" } ], "symlink_target": "" }
// Copyright 2017 DAIMTO ([Linda Lawton](https://twitter.com/LindaLawtonDK)) : [www.daimto.com](http://www.daimto.com/) // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by DAIMTO-Google-apis-Sample-generator 1.0.0 // Template File Name: APIKey.tt // Build date: 2017-10-08 // C# generater version: 1.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ // About // // Unoffical sample for the Translate v2 API for C#. // This sample is designed to be used with the Google .Net client library. (https://github.com/google/google-api-dotnet-client) // // API Description: The Google Cloud Translation API lets websites and programs integrate with Google Translate programmatically. // API Documentation Link https://code.google.com/apis/language/translate/v2/getting_started.html // // Discovery Doc https://www.googleapis.com/discovery/v1/apis/Translate/v2/rest // //------------------------------------------------------------------------------ // Installation // // This sample code uses the Google .Net client library (https://github.com/google/google-api-dotnet-client) // // NuGet package: // // Location: https://www.nuget.org/packages/Google.Apis.Translate.v2/ // Install Command: PM> Install-Package Google.Apis.Translate.v2 // //------------------------------------------------------------------------------ using Google.Apis.Translate.v2; using Google.Apis.Services; using System; namespace GoogleSamplecSharpSample.Translatev2.Auth { /// <summary> /// When calling APIs that do not access private user data, you can use simple API keys. These keys are used to authenticate your /// application for accounting purposes. The Google API Console documentation also describes API keys. /// https://support.google.com/cloud/answer/6158857 /// </summary> public static class ApiKeyExample { /// <summary> /// Get a valid TranslateService for a public API Key. /// </summary> /// <param name="apiKey">API key from Google Developer console</param> /// <returns>TranslateService</returns> public static TranslateService GetService(string apiKey) { try { if (string.IsNullOrEmpty(apiKey)) throw new ArgumentNullException("api Key"); return new TranslateService(new BaseClientService.Initializer() { ApiKey = apiKey, ApplicationName = string.Format("{0} API key example", System.Diagnostics.Process.GetCurrentProcess().ProcessName), }); } catch (Exception ex) { throw new Exception("Failed to create new Translate Service", ex); } } } }
{ "content_hash": "cac7e2da7bf966ca252388bd8a3b8d0a", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 135, "avg_line_length": 44.5375, "alnum_prop": 0.6129666011787819, "repo_name": "LindaLawton/Google-Dotnet-Samples", "id": "a1c38262bd3e23bc08126f2a1db92d03b482d79c", "size": "3565", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Samples/Google Cloud Translation API/v2/APIKey.cs", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Square Frame 1")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Square Frame 1")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("c07b5303-78e6-4aad-bf17-e0c6411bf416")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "f2ab57b9af422d17c6ba120296ac0fb3", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 38.916666666666664, "alnum_prop": 0.7430406852248393, "repo_name": "anedyalkov/Programming-Basics", "id": "0c33670ce49230110fd8829d791804f688fde510", "size": "1404", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Drawing Figures with Loops/Square Frame 1/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "217568" } ], "symlink_target": "" }
struct FrozenSetTree : public Tree { // Nothing. }; extern "C" PyTypeObject FrozenSetTreeType; #endif // #ifndef FROZEN_SET_TREE_HPP
{ "content_hash": "75f62e439ea01b39c22a5a76d79d66bf", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 42, "avg_line_length": 14.4, "alnum_prop": 0.6875, "repo_name": "pyannote/pyannote-banyan", "id": "cd032fe9f3e426667545100f8fdd0873d5128850", "size": "263", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "banyan/frozen_set_tree.hpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C++", "bytes": "324494" }, { "name": "Python", "bytes": "185400" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "85ef629c94bfcde60948bb296ea33b65", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "1b4dc4bfcc844367334c7485a656fec1f9e92a48", "size": "175", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Pteridophyta/Polypodiopsida/Cyatheales/Cyatheaceae/Cyathea/Cyathea abreviata/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
import '@ngrx/core/add/operator/select'; import 'rxjs/add/operator/map'; import { Observable } from 'rxjs/Observable'; import { Action } from '@ngrx/store'; import {ActionTypes} from '../../actions/execution' import {AnalysisCall} from "../../models/analysis/analysisCall"; import * as execution from '../../actions/execution'; export interface State { loading: boolean; execution: AnalysisCall; } const initialState: State = { loading:false, execution: null }; export function reducer(state = initialState, action: execution.Actions|any): State { switch (action.type) { case ActionTypes.EXECUTE: { const execution: AnalysisCall = action.execution; return { execution: null, loading: true }; } case ActionTypes.EXECUTE_COMPLETE : { return { execution: null, loading: false }; } default: { return state; } } } /** * Because the data structure is defined within the reducer it is optimal to * locate our selector functions at this level. If store is to be thought of * as a database, and reducers the tables, selectors can be considered the * queries into said database. Remember to keep your selectors small and * focused so they can be combined and composed to fit each particular * use-case. */ export function getExecution(state$: Observable<State>) { return state$ .select(s => s.execution); } export function getLoading(state$: Observable<State>) { return state$.select(state => { return state.loading; }); }
{ "content_hash": "d7feca54bf9984be2530518ff8e4d424", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 86, "avg_line_length": 22.434782608695652, "alnum_prop": 0.6789405684754521, "repo_name": "larjohn/obeu-indicators", "id": "cc9a91a08e3d3c43685731a3b65f601be0292063", "size": "1548", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/app/reducers/execution/execution.ts", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "11607" }, { "name": "JavaScript", "bytes": "3658" }, { "name": "TypeScript", "bytes": "158442" } ], "symlink_target": "" }
<?php namespace Agms\Exception; class UpgradeRequiredException extends AgmsException { }
{ "content_hash": "ceeb0818f00ac13556482fcb8e797985", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 53, "avg_line_length": 10.444444444444445, "alnum_prop": 0.7872340425531915, "repo_name": "agmscode/agms_php", "id": "9d0052e7d76ae64f33f28611a4ca6991d0094c13", "size": "257", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/Agms/Exception/UpgradeRequiredException.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "146833" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_35) on Sat Jun 29 01:13:28 PDT 2013 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> StatefulJob (Quartz Enterprise Job Scheduler 2.2.0 API) </TITLE> <META NAME="date" CONTENT="2013-06-29"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="StatefulJob (Quartz Enterprise Job Scheduler 2.2.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/StatefulJob.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../org/quartz/SimpleTrigger.html" title="interface in org.quartz"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../org/quartz/TimeOfDay.html" title="class in org.quartz"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?org/quartz/StatefulJob.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="StatefulJob.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.quartz</FONT> <BR> Interface StatefulJob</H2> <DL> <DT><B>All Superinterfaces:</B> <DD><A HREF="../../org/quartz/Job.html" title="interface in org.quartz">Job</A></DD> </DL> <HR> <B>Deprecated.</B>&nbsp;<I>use DisallowConcurrentExecution and/or PersistJobDataAfterExecution annotations instead.</I> <P> <DL> <DT><PRE><FONT SIZE="-1"><A HREF="../../org/quartz/PersistJobDataAfterExecution.html" title="annotation in org.quartz">@PersistJobDataAfterExecution</A> <A HREF="../../org/quartz/DisallowConcurrentExecution.html" title="annotation in org.quartz">@DisallowConcurrentExecution</A> </FONT>public interface <B>StatefulJob</B><DT>extends <A HREF="../../org/quartz/Job.html" title="interface in org.quartz">Job</A></DL> </PRE> <P> A marker interface for <code><A HREF="../../org/quartz/JobDetail.html" title="interface in org.quartz"><CODE>JobDetail</CODE></A></code> s that wish to have their state maintained between executions. <p> <code>StatefulJob</code> instances follow slightly different rules from regular <code>Job</code> instances. The key difference is that their associated <code><A HREF="../../org/quartz/JobDataMap.html" title="class in org.quartz"><CODE>JobDataMap</CODE></A></code> is re-persisted after every execution of the job, thus preserving state for the next execution. The other difference is that stateful jobs are not allowed to execute concurrently, which means new triggers that occur before the completion of the <code>execute(xx)</code> method will be delayed. </p> <P> <P> <DL> <DT><B>Author:</B></DT> <DD>James House</DD> <DT><B>See Also:</B><DD><A HREF="../../org/quartz/DisallowConcurrentExecution.html" title="annotation in org.quartz"><CODE>DisallowConcurrentExecution</CODE></A>, <A HREF="../../org/quartz/PersistJobDataAfterExecution.html" title="annotation in org.quartz"><CODE>PersistJobDataAfterExecution</CODE></A>, <A HREF="../../org/quartz/Job.html" title="interface in org.quartz"><CODE>Job</CODE></A>, <A HREF="../../org/quartz/JobDetail.html" title="interface in org.quartz"><CODE>JobDetail</CODE></A>, <A HREF="../../org/quartz/JobDataMap.html" title="class in org.quartz"><CODE>JobDataMap</CODE></A>, <A HREF="../../org/quartz/Scheduler.html" title="interface in org.quartz"><CODE>Scheduler</CODE></A></DL> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_org.quartz.Job"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from interface org.quartz.<A HREF="../../org/quartz/Job.html" title="interface in org.quartz">Job</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../org/quartz/Job.html#execute(org.quartz.JobExecutionContext)">execute</A></CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/StatefulJob.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../org/quartz/SimpleTrigger.html" title="interface in org.quartz"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../org/quartz/TimeOfDay.html" title="class in org.quartz"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?org/quartz/StatefulJob.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="StatefulJob.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright 2001-2013, Terracotta, Inc. </BODY> </HTML>
{ "content_hash": "8331356cfbc83d749e112c44a6fb33c5", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 163, "avg_line_length": 44.24657534246575, "alnum_prop": 0.6504643962848298, "repo_name": "suthat/signal", "id": "c8ccc6b57dbf87dab2c05356ad3087be2c581658", "size": "9690", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/quartz-2.2.0/javadoc/org/quartz/StatefulJob.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1834" }, { "name": "HTML", "bytes": "3023" }, { "name": "Java", "bytes": "415229" }, { "name": "JavaScript", "bytes": "7733" }, { "name": "Python", "bytes": "1410" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in Flore mycologique de la France et des pays limitrophes 478 (1888) #### Original name Agaricus capnoides Fr., 1818 ### Remarks null
{ "content_hash": "19a3b1ec086506d68519bfca9332b411", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 65, "avg_line_length": 16.76923076923077, "alnum_prop": 0.7339449541284404, "repo_name": "mdoering/backbone", "id": "2b14352b7aef27c4473427995d19d4b2692871c9", "size": "298", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Strophariaceae/Psilocybe/Hypholoma capnoides/ Syn. Dryophila fascicularis capnoides/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
from dataclasses import dataclass from datetime import datetime @dataclass class AuthResponse: email: str image_access: bool search_access: bool created: datetime modified: datetime @dataclass class FontResponse: filename: str id: str alias: str _self: str @dataclass class MemeRequest: template_id: str style: list[str] text: list[str] layout: str font: str extension: str redirect: bool @dataclass class CustomRequest: background: str style: str text: list[str] layout: str font: str extension: str redirect: bool @dataclass class MemeTemplateRequest: style: list[str] text: list[str] layout: str font: str extension: str redirect: bool @dataclass class AutomaticRequest: text: str safe: bool redirect: bool @dataclass class MemeResponse: url: str @dataclass class ExampleResponse: url: str template: str @dataclass class _Example: text: list[str] url: str @dataclass class TemplateResponse: id: str name: str lines: int overlays: int styles: list[str] blank: str example: _Example source: str _self: str @dataclass class ErrorResponse: error: str
{ "content_hash": "3a73912caf99411510756569296cda66", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 33, "avg_line_length": 13.548387096774194, "alnum_prop": 0.6547619047619048, "repo_name": "jacebrowning/memegen", "id": "adb38f00812911ea11092a6a947bbfc1bb5056a5", "size": "1260", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "app/views/schemas.py", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "1209" }, { "name": "Makefile", "bytes": "3723" }, { "name": "Procfile", "bytes": "215" }, { "name": "Python", "bytes": "174752" }, { "name": "Shell", "bytes": "544" } ], "symlink_target": "" }
package com.facebook.csslayout; /** * Generated constants used in {@link LayoutEngineTest}. */ public class TestConstants { /** START_GENERATED **/ public static final float SMALL_WIDTH = 35f; public static final float SMALL_HEIGHT = 18f; public static final float BIG_WIDTH = 172f; public static final float BIG_HEIGHT = 36f; public static final float BIG_MIN_WIDTH = 100f; public static final String SMALL_TEXT = "small"; public static final String LONG_TEXT = "loooooooooong with space"; public static final String MEASURE_WITH_RATIO_2 = "measureWithRatio2"; public static final String MEASURE_WITH_MATCH_PARENT = "measureWithMatchParent"; /** END_GENERATED **/ }
{ "content_hash": "a072434c5bd5a7e83cdc594c1bcb1b42", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 82, "avg_line_length": 34.7, "alnum_prop": 0.7363112391930836, "repo_name": "pragmatrix/css-layout", "id": "41cce20977f4cc8bdd06811ef6398051ae651090", "size": "994", "binary": false, "copies": "4", "ref": "refs/heads/nuget", "path": "src/java/tests/com/facebook/csslayout/TestConstants.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "380714" }, { "name": "C#", "bytes": "374392" }, { "name": "Java", "bytes": "361724" }, { "name": "JavaScript", "bytes": "225242" }, { "name": "Makefile", "bytes": "797" } ], "symlink_target": "" }
document.addEventListener('DOMContentLoaded', function () { $.validator.setDefaults({ highlight: function(element) { $(element) .closest('.form-group') .addClass('has-warning'); }, unhighlight: function(element) { $(element) .closest('.form-group') .removeClass('has-warning'); } }); $('#forgotUsernameForm').validate({ rules: { email: { required: true, email: true, remote : { url: '/api/v1.0/users/check/email', type: "GET", data: { email: function() { return $('#email').val(); } } } } }, messages: { email: { remote: $.validator.format("Email {0} doesn't exist in the database") } }, submitHandler: function () { forgotUsername(); } }); function forgotUsername() { $('.alert').remove(); var forgotUsernameDTO = {"email":$('#email').val()}; $.ajax({ type: 'PUT', url: '/api/v1.0/users/attributes/username_recovery', contentType: "application/json; charset=utf-8", dataType: "json", data: JSON.stringify(forgotUsernameDTO), complete: function (event) { if(event.status === 204) { $('#forgotUsernameForm') .before('<div class="alert alert-dismissable alert-success">' + '<span th:text="#{forgotUsername.success}">An e-mail has been successfully sent. Please allow a few minutes for it to get to your inbox!</span>' + '</div>'); } else { $('#forgotUsernameForm') .before('<div class="alert alert-dismissable alert-danger">' + '<span th:text="#{forgotUsername.error}">No username found associated with that e-mail!</span>' + '</div>'); } } }); } });
{ "content_hash": "14cf36ddb983e831f3bd41acce7ca830", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 176, "avg_line_length": 36.34920634920635, "alnum_prop": 0.42882096069868997, "repo_name": "JonkiPro/REST-Web-Services", "id": "36b350dd4f71f20f9abd8f05c3e2695799548b5d", "size": "2290", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/src/main/resources/static/js/forgotUsername.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10797" }, { "name": "HTML", "bytes": "58341" }, { "name": "Java", "bytes": "661593" }, { "name": "JavaScript", "bytes": "36979" } ], "symlink_target": "" }
* It was overwhelming at first to juggle the dynamics of managing branches both local and remote at the same time. It eventually lead to a merge error occuring prematurely during the session. * How to better display command prompt and how to properly manage and merge branches. * How to make a better display for GPS. What commands should be done on what branches. * Why choose between cloning or fetching. * Despite the struggles and initial nervousness, this was very fun and an engaging way to collaborate with fellow cohorts to work around a problem.
{ "content_hash": "9e3c91c3fc41bfb3809d007988ea6113", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 191, "avg_line_length": 56.8, "alnum_prop": 0.7834507042253521, "repo_name": "Jalindner/phase-0-gps-1", "id": "99974415c1d384b15c63348fb4e18c8c81bc459a", "size": "592", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Lindner-reflection.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
@interface Tier2 : Tier1 @end
{ "content_hash": "361383d981c4e89fa58faaea6962b151", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 24, "avg_line_length": 10.333333333333334, "alnum_prop": 0.7096774193548387, "repo_name": "xareelee/XAspect", "id": "ac94c51148c9edf4eae1b4fe6a22e3687248e0d4", "size": "175", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "XAspectDev/XAspectDevTests/Tier2.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "53361" }, { "name": "C++", "bytes": "53572" }, { "name": "Objective-C", "bytes": "420428" }, { "name": "Ruby", "bytes": "1234" }, { "name": "Shell", "bytes": "9174" } ], "symlink_target": "" }
pyiid\.experiments\.elasticscatter\.gpu\_wrappers package ========================================================= Submodules ---------- pyiid\.experiments\.elasticscatter\.gpu\_wrappers\.gpu\_wrap module ------------------------------------------------------------------- .. automodule:: pyiid.experiments.elasticscatter.gpu_wrappers.gpu_wrap :members: :undoc-members: :show-inheritance: Module contents --------------- .. automodule:: pyiid.experiments.elasticscatter.gpu_wrappers :members: :undoc-members: :show-inheritance:
{ "content_hash": "c8f7208508b301de865f75a1903aa278", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 70, "avg_line_length": 25.40909090909091, "alnum_prop": 0.5420393559928444, "repo_name": "CJ-Wright/pyIID", "id": "89dd78056202d8433c274cbc6ef442b5e1a3ecc1", "size": "559", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/pyiid.experiments.elasticscatter.gpu_wrappers.rst", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "244316" } ], "symlink_target": "" }
Welcome to the Ingen.io & UniGraph Documentation. Head over to the [Wiki ](https://github.com/unigraph/api-docs/wiki) to get started! [Request an API Key](mailto:api@ingen.io) Use the issues to report bugs and request new features. Happy hacking!
{ "content_hash": "e71c67dc4485e5755322fb6a6f7e6806", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 83, "avg_line_length": 31.5, "alnum_prop": 0.753968253968254, "repo_name": "unigraph/docs", "id": "7de7a4fa11acdb4bba595f15550a2c75a39d5d01", "size": "293", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
/// <reference path='../built/pxtlib.d.ts' /> /// <reference path='../built/pxtcompiler.d.ts' /> namespace pxt.py { export enum VarModifier { NonLocal, Global } export interface ParameterDesc extends pxtc.ParameterDesc { pyType?: Type; } export interface SymbolInfo extends pxtc.SymbolInfo, VarDescOptions { pyRetType?: Type; pySymbolType?: Type; pyInstanceType?: Type; parameters: ParameterDesc[]; pyAST?: AST; isProtected?: boolean; moduleTypeMarker?: {}; isStatic?: boolean; declared?: number; // A reference to the current iteration; used for detecting duplicate functions } export interface TypeOptions { unifyWith?: Type; classType?: SymbolInfo; // instance type moduleType?: SymbolInfo; // class/static member type primType?: string; typeArgs?: Type[]; anyType?: boolean; } export interface Type extends TypeOptions { tid: number; } export interface VarDescOptions { expandsTo?: string; isImportStar?: boolean; isPlainImport?: boolean; isLocal?: boolean; isParam?: boolean; isImport?: SymbolInfo; } // based on grammar at https://docs.python.org/3/library/ast.html export interface AST { startPos: number; endPos: number; kind: string; } export interface Stmt extends AST { _stmtBrand: void; _comments?: Token[]; } export interface Symbol extends Stmt { _symbolBrand: void; symInfo: SymbolInfo; } export interface Expr extends AST { tsType?: Type; symbolInfo?: SymbolInfo; inCalledPosition?: boolean; // it's an f in f(...) forTargetEndPos?: number; // it's X in "for X in ..." and this is the position of the end of that for _exprBrand: void; } export type expr_context = "Load" | "Store" | "Del" | "AugLoad" | "AugStore" | "Param" export type boolop = "And" | "Or" export type operator = "Add" | "Sub" | "Mult" | "MatMult" | "Div" | "Mod" | "Pow" | "LShift" | "RShift" | "BitOr" | "BitXor" | "BitAnd" | "FloorDiv" export type unaryop = "Invert" | "Not" | "UAdd" | "USub" export type cmpop = "Eq" | "NotEq" | "Lt" | "LtE" | "Gt" | "GtE" | "Is" | "IsNot" | "In" | "NotIn" export type identifier = string export type int = number export interface Arg extends AST { kind: "Arg"; arg: identifier; annotation?: Expr; } export interface Arguments extends AST { kind: "Arguments"; args: Arg[]; vararg?: Arg; kwonlyargs: Arg[]; kw_defaults: Expr[]; kwarg?: Arg; defaults: Expr[]; } // keyword arguments supplied to call (NULL identifier for **kwargs) export interface Keyword extends AST { kind: "Keyword"; arg?: identifier; value: Expr; } export interface Comprehension extends AST { kind: "Comprehension"; target: Expr; iter: Expr; ifs: Expr[]; is_async: int; } export interface Module extends Symbol, ScopeDef { kind: "Module"; body: Stmt[]; name?: string; source: string; tsFilename: string; tsBody?: pxtc.SymbolInfo[]; } export interface ExceptHandler extends AST { kind: "ExceptHandler"; type?: Expr; name?: identifier; body: Stmt[]; } // import name with optional 'as' alias. export interface Alias extends AST { kind: "Alias"; name: identifier; asname?: identifier; } export interface WithItem extends AST { kind: "WithItem"; context_expr: Expr; optional_vars?: Expr; } export interface AnySlice extends AST { _anySliceBrand: void; } export interface Slice extends AnySlice { kind: "Slice"; lower?: Expr; upper?: Expr; step?: Expr; } export interface ExtSlice extends AnySlice { kind: "ExtSlice"; dims: AnySlice[]; } export interface Index extends AnySlice { kind: "Index"; value: Expr; } export interface ScopeSymbolInfo { /* usage information */ firstRefPos?: number; lastRefPos?: number; firstAssignPos?: number; firstAssignDepth?: number; forVariableEndPos?: number; /* global/nonlocal */ modifier?: VarModifier; symbol: SymbolInfo, } export interface ScopeDef extends Stmt { vars: Map<ScopeSymbolInfo>; parent?: ScopeDef; blockDepth?: number; } export interface FunctionDef extends Symbol, ScopeDef { kind: "FunctionDef"; name: identifier; args: Arguments; body: Stmt[]; decorator_list: Expr[]; returns?: Expr; alwaysThrows?: boolean; callers?: Expr[]; } export interface AsyncFunctionDef extends Stmt { kind: "AsyncFunctionDef"; name: identifier; args: Arguments; body: Stmt[]; decorator_list: Expr[]; returns?: Expr; } export interface ClassDef extends Symbol, ScopeDef { kind: "ClassDef"; name: identifier; bases: Expr[]; keywords: Keyword[]; body: Stmt[]; decorator_list: Expr[]; baseClass?: SymbolInfo; isEnum?: boolean; isNamespace?: boolean; } export interface Return extends Stmt { kind: "Return"; value?: Expr; } export interface Delete extends Stmt { kind: "Delete"; targets: Expr[]; } export interface Assign extends Symbol { kind: "Assign"; targets: Expr[]; value: Expr; } export interface AugAssign extends Stmt { kind: "AugAssign"; target: Expr; op: operator; value: Expr; } export interface AnnAssign extends Stmt { kind: "AnnAssign"; target: Expr; annotation: Expr; value?: Expr; simple: int; // 'simple' indicates that we annotate simple name without parens } export interface For extends Stmt { kind: "For"; target: Expr; iter: Expr; body: Stmt[]; orelse: Stmt[]; // use 'orelse' because else is a keyword in target languages } export interface AsyncFor extends Stmt { kind: "AsyncFor"; target: Expr; iter: Expr; body: Stmt[]; orelse: Stmt[]; } export interface While extends Stmt { kind: "While"; test: Expr; body: Stmt[]; orelse: Stmt[]; } export interface If extends Stmt { kind: "If"; test: Expr; body: Stmt[]; orelse: Stmt[]; } export interface With extends Stmt { kind: "With"; items: WithItem[]; body: Stmt[]; } export interface AsyncWith extends Stmt { kind: "AsyncWith"; items: WithItem[]; body: Stmt[]; } export interface Raise extends Stmt { kind: "Raise"; exc?: Expr; cause?: Expr; } export interface Try extends Stmt { kind: "Try"; body: Stmt[]; handlers: ExceptHandler[]; orelse: Stmt[]; finalbody: Stmt[]; } export interface Assert extends Stmt { kind: "Assert"; test: Expr; msg?: Expr; } export interface Import extends Stmt { kind: "Import"; names: Alias[]; } export interface ImportFrom extends Stmt { kind: "ImportFrom"; module?: identifier; names: Alias[]; level?: int; } export interface Global extends Stmt { kind: "Global"; names: identifier[]; } export interface Nonlocal extends Stmt { kind: "Nonlocal"; names: identifier[]; } export interface ExprStmt extends Stmt { kind: "ExprStmt"; value: Expr; } export interface Pass extends Stmt { kind: "Pass"; } export interface Break extends Stmt { kind: "Break"; } export interface Continue extends Stmt { kind: "Continue"; } export interface BoolOp extends Expr { kind: "BoolOp"; op: boolop; values: Expr[]; } export interface BinOp extends Expr { kind: "BinOp"; left: Expr; op: operator; right: Expr; } export interface UnaryOp extends Expr { kind: "UnaryOp"; op: unaryop; operand: Expr; } export interface Lambda extends Expr { kind: "Lambda"; args: Arguments; body: Expr; } export interface IfExp extends Expr { kind: "IfExp"; test: Expr; body: Expr; orelse: Expr; } export interface Dict extends Expr { kind: "Dict"; keys: (Expr | undefined)[]; values: Expr[]; } export interface Set extends Expr { kind: "Set"; elts: Expr[]; } export interface ListComp extends Expr { kind: "ListComp"; elt: Expr; generators: Comprehension[]; } export interface SetComp extends Expr { kind: "SetComp"; elt: Expr; generators: Comprehension[]; } export interface DictComp extends Expr { kind: "DictComp"; key: Expr; value: Expr; generators: Comprehension[]; } export interface GeneratorExp extends Expr { kind: "GeneratorExp"; elt: Expr; generators: Comprehension[]; } export interface Await extends Expr { kind: "Await"; value: Expr; } export interface Yield extends Expr { kind: "Yield"; value?: Expr; } export interface YieldFrom extends Expr { kind: "YieldFrom"; value: Expr; } // need sequences for compare to distinguish between x < 4 < 3 and (x < 4) < 3 export interface Compare extends Expr { kind: "Compare"; left: Expr; ops: cmpop[]; comparators: Expr[]; } export interface Call extends Expr { kind: "Call"; func: Expr; args: Expr[]; keywords: Keyword[]; } export interface Num extends Expr { kind: "Num"; n: number; ns: string; } export interface Str extends Expr { kind: "Str"; s: string; } export interface FormattedValue extends Expr { kind: "FormattedValue"; value: Expr; conversion?: int; format_spec?: Expr; } export interface JoinedStr extends Expr { kind: "JoinedStr"; values: Expr[]; } export interface Bytes extends Expr { kind: "Bytes"; s: number[]; } export interface NameConstant extends Expr { kind: "NameConstant"; value: boolean | null; // null=None, True, False } export interface Ellipsis extends Expr { kind: "Ellipsis"; } export interface Constant extends Expr { kind: "Constant"; value: any; // ??? } // the following expression can appear in assignment context export interface AssignmentExpr extends Expr { ctx: expr_context; } export interface Attribute extends AssignmentExpr { kind: "Attribute"; value: Expr; attr: identifier; } export interface Subscript extends AssignmentExpr { kind: "Subscript"; value: Expr; slice: AnySlice; } export interface Starred extends AssignmentExpr { kind: "Starred"; value: Expr; } export interface Name extends AssignmentExpr { kind: "Name"; id: identifier; isdef?: boolean; } export interface List extends AssignmentExpr { kind: "List"; elts: Expr[]; } export interface Tuple extends AssignmentExpr { kind: "Tuple"; elts: Expr[]; } export function isIndex(e: AST): e is Index { return e.kind === "Index" } export function isSubscript(e: Expr): e is Subscript { return e.kind === "Subscript" } }
{ "content_hash": "92aee3c28ef5c87092d6a1b437be6da9", "timestamp": "", "source": "github", "line_count": 474, "max_line_length": 109, "avg_line_length": 25.98945147679325, "alnum_prop": 0.555077522526179, "repo_name": "Microsoft/pxt", "id": "540e287bf15de9fbc1e82b4e8073cdd96bae4b5d", "size": "12319", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pxtpy/ast.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "142135" }, { "name": "HTML", "bytes": "134785" }, { "name": "JavaScript", "bytes": "130358" }, { "name": "Makefile", "bytes": "98" }, { "name": "Python", "bytes": "25261" }, { "name": "Shell", "bytes": "3605" }, { "name": "TypeScript", "bytes": "4344063" } ], "symlink_target": "" }
<bill session="110" type="hr" number="894" updated="2009-01-09T09:43:26-05:00"> <status><calendar date="1198123440" datetime="2007-12-19T12:04:00-05:00" /></status> <introduced date="1198040400" datetime="2007-12-19"/> <titles> <title type="official" as="introduced">Providing for consideration of the Senate amendment to the bill (H.R. 3996) to amend the Internal Revenue Code of 1986 to extend certain expiring provisions, and for other purposes.</title> </titles> <sponsor id="400378"/> <cosponsors> </cosponsors> <actions> <action date="1198123440" datetime="2007-12-19T12:04:00-05:00"><text>The House Committee on Rules reported an original measure, H. Rept. 110-499, by Ms. Slaughter.</text></action> <action date="1198123440" datetime="2007-12-19T12:04:00-05:00"><text>Rule provides for consideration of H.R. 3996 with 1 hour of general debate. Previous question shall be considered as ordered without intervening motions. Measure will be considered read. Bill is closed to amendments.</text></action> <calendar date="1198123440" datetime="2007-12-19T12:04:00-05:00" ><text>Placed on the House Calendar, Calendar No. 176.</text></calendar> <action date="1200580740" datetime="2008-01-17T10:39:00-05:00"><text>Pursuant to the provisions of H. Res. 922, H. Res. 894 is laid on the table.</text></action> </actions> <committees> </committees> <relatedbills> </relatedbills> <subjects> </subjects> <amendments> </amendments> <summary> 12/19/2007--Reported to House without amendment. Sets forth the rule for consideration of the Senate amendment to the bill (H.R. 3996) to amend the Internal Revenue Code of 1986 to extend certain expiring provisions.<br/> </summary> </bill>
{ "content_hash": "d7871e82bbd6baa9aeb8e5d37a4cd3a2", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 303, "avg_line_length": 51.96969696969697, "alnum_prop": 0.7364431486880466, "repo_name": "hashrocket/localpolitics.in", "id": "4a300b90d260352ed678c96aef8e860faf742a93", "size": "1715", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/govtrack/110_bills/hr894.xml", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "155887" }, { "name": "Ruby", "bytes": "147059" } ], "symlink_target": "" }
Upgrading Hashie ================ ### Upgrading to 3.2.1 #### Possible coercion changes The improvements made to coercions in version 3.2.1 [issue #200](https://github.com/intridea/hashie/pull/200) do not break the documented API, but are significant enough that changes may effect undocumented side-effects. Applications that depended on those side-effects will need to be updated. **Change**: Type coercion no longer creates new objects if the input matches the target type. Previously coerced properties always resulted in the creation of a new object, even when it wasn't necessary. This had the effect of a `dup` or `clone` on coerced properties but not uncoerced ones. If necessary, `dup` or `clone` your own objects. Do not assume Hashie will do it for you. **Change**: Failed coercion attempts now raise Hashie::CoercionError. Hashie now raises a Hashie::CoercionError that details on the property that could not be coerced, the source and target type of the coercion, and the internal error. Previously only the internal error was raised. Applications that were attempting to rescuing the internal errors should be updated to rescue Hashie::CoercionError instead. ### Upgrading to 3.0 #### Compatibility with Rails 4 Strong Parameters Version 2.1 introduced support to prevent default Rails 4 mass-assignment protection behavior. This was [issue #89](https://github.com/intridea/hashie/issues/89), resolved in [#104](https://github.com/intridea/hashie/pull/104). In version 2.2 this behavior has been removed in [#147](https://github.com/intridea/hashie/pull/147) in favor of a mixin and finally extracted into a separate gem in Hashie 3.0. To enable 2.1 compatible behavior with Rails 4, use the [hashie_rails](http://rubygems.org/gems/hashie_rails) gem. ``` gem 'hashie_rails' ``` See [#154](https://github.com/intridea/hashie/pull/154) and [Mash and Rails 4 Strong Parameters](README.md#mash-and-rails-4-strong-parameters) for more details. #### Key Conversions in Hashie::Dash and Hashie::Trash Version 2.1 and older of Hashie::Dash and Hashie::Trash converted keys to strings by default. This is no longer the case in 2.2. Consider the following code. ```ruby class Person < Hashie::Dash property :name end p = Person.new(name: 'dB.') ``` Version 2.1 behaves as follows. ```ruby p.name # => 'dB.' p[:name] # => 'dB.' p['name'] # => 'dB.' # not what I put in p.inspect # => { 'name' => 'dB.' } p.to_hash # => { 'name' => 'dB.' } ``` It was not possible to achieve the behavior of preserving keys, as described in [issue #151](https://github.com/intridea/hashie/issues/151). Version 2.2 does not perform this conversion by default. ```ruby p.name # => 'dB.' p[:name] # => 'dB.' # p['name'] # => NoMethodError p.inspect # => { :name => 'dB.' } p.to_hash # => { :name => 'dB.' } ``` To enable behavior compatible with older versions, use `Hashie::Extensions::Dash::IndifferentAccess`. ```ruby class Person < Hashie::Dash include Hashie::Extensions::Dash::IndifferentAccess property :name end ``` #### Key Conversions in Hashie::Hash#to_hash Version 2.1 or older of Hash#to_hash converted keys to strings automatically. ```ruby instance = Hashie::Hash[first: 'First', 'last' => 'Last'] instance.to_hash # => { "first" => 'First', "last" => 'Last' } ``` It was possible to symbolize keys by passing `:symbolize_keys`, however it was not possible to retrieve the hash with initial key values. ```ruby instance.to_hash(symbolize_keys: true) # => { :first => 'First', :last => 'Last' } instance.to_hash(stringify_keys: true) # => { "first" => 'First', "last" => 'Last' } ``` Version 2.2 no longer converts keys by default. ```ruby instance = Hashie::Hash[first: 'First', 'last' => 'Last'] instance.to_hash # => { :first => 'First', "last" => 'Last' } ``` The behavior with `symbolize_keys` and `stringify_keys` is unchanged. See [#152](https://github.com/intridea/hashie/pull/152) for more information.
{ "content_hash": "922d58c45ffe4a122600c9afe8fed71f", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 405, "avg_line_length": 36.26605504587156, "alnum_prop": 0.7111054895016443, "repo_name": "PerfectMemory/hashie", "id": "25e8a849289394e8eead53c376c8d97fcb964edc", "size": "3953", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UPGRADING.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
require File.join(File.dirname(__FILE__), *%w[.. .. lib xcode_snippets]) require File.join(File.dirname(__FILE__), *%w[runner]) require 'ruby-debug' def configuration @configuration ||= OpenStruct.new end
{ "content_hash": "44077cc6da068cc1af6e6eea0c1b9574", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 72, "avg_line_length": 26.125, "alnum_prop": 0.69377990430622, "repo_name": "lukeredpath/xcodesnippets", "id": "2449d1bbc73b011bd9f21818e3803edeb1d00cce", "size": "209", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "features/support/env.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "32211" } ], "symlink_target": "" }
title: sqlalchemy.orm composite Example Code category: page slug: sqlalchemy-orm-composite-examples sortorder: 500031066 toc: False sidebartitle: sqlalchemy.orm composite meta: Python example code that shows how to use the composite callable from the sqlalchemy.orm module of the SQLAlchemy project. `composite` is a callable within the `sqlalchemy.orm` module of the SQLAlchemy project. <a href="/sqlalchemy-orm-columnproperty-examples.html">ColumnProperty</a>, <a href="/sqlalchemy-orm-compositeproperty-examples.html">CompositeProperty</a>, <a href="/sqlalchemy-orm-load-examples.html">Load</a>, <a href="/sqlalchemy-orm-mapper-examples.html">Mapper</a>, <a href="/sqlalchemy-orm-query-examples.html">Query</a>, <a href="/sqlalchemy-orm-relationshipproperty-examples.html">RelationshipProperty</a>, <a href="/sqlalchemy-orm-session-examples.html">Session</a>, <a href="/sqlalchemy-orm-synonymproperty-examples.html">SynonymProperty</a>, <a href="/sqlalchemy-orm-aliased-examples.html">aliased</a>, <a href="/sqlalchemy-orm-attributes-examples.html">attributes</a>, <a href="/sqlalchemy-orm-backref-examples.html">backref</a>, <a href="/sqlalchemy-orm-class-mapper-examples.html">class_mapper</a>, <a href="/sqlalchemy-orm-column-property-examples.html">column_property</a>, <a href="/sqlalchemy-orm-interfaces-examples.html">interfaces</a>, <a href="/sqlalchemy-orm-mapper-examples.html">mapper</a>, <a href="/sqlalchemy-orm-mapperlib-examples.html">mapperlib</a>, <a href="/sqlalchemy-orm-object-mapper-examples.html">object_mapper</a>, <a href="/sqlalchemy-orm-object-session-examples.html">object_session</a>, <a href="/sqlalchemy-orm-query-examples.html">query</a>, <a href="/sqlalchemy-orm-relationship-examples.html">relationship</a>, <a href="/sqlalchemy-orm-session-examples.html">session</a>, <a href="/sqlalchemy-orm-sessionmaker-examples.html">sessionmaker</a>, and <a href="/sqlalchemy-orm-strategies-examples.html">strategies</a> are several other callables with code examples from the same `sqlalchemy.orm` package. ## Example 1 from graphene-sqlalchemy [graphene-sqlalchemy](https://github.com/graphql-python/graphene-sqlalchemy) ([project documentation](https://docs.graphene-python.org/projects/sqlalchemy/en/latest/) and [PyPI package information](https://pypi.org/project/graphene-sqlalchemy/)) is a [SQLAlchemy](/sqlalchemy.html) integration for [Graphene](https://graphene-python.org/), which makes it easier to build GraphQL-based [APIs](/application-programming-interfaces.html) into Python [web applications](/web-development.html). The package allows you to subclass SQLAlchemy classes and build queries around them with custom code to match the backend queries with the GraphQL-based request queries. The project is provided as open source under the [MIT license](https://github.com/graphql-python/graphene-sqlalchemy/blob/master/LICENSE.md). [**graphene-sqlalchemy / graphene_sqlalchemy / tests / models.py**](https://github.com/graphql-python/graphene-sqlalchemy/blob/master/graphene_sqlalchemy/tests/models.py) ```python # models.py from __future__ import absolute_import import enum from sqlalchemy import (Column, Date, Enum, ForeignKey, Integer, String, Table, func, select) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.hybrid import hybrid_property ~~from sqlalchemy.orm import column_property, composite, mapper, relationship PetKind = Enum("cat", "dog", name="pet_kind") class HairKind(enum.Enum): LONG = 'long' SHORT = 'short' Base = declarative_base() association_table = Table( "association", Base.metadata, Column("pet_id", Integer, ForeignKey("pets.id")), Column("reporter_id", Integer, ForeignKey("reporters.id")), ) class Editor(Base): __tablename__ = "editors" editor_id = Column(Integer(), primary_key=True) name = Column(String(100)) ## ... source file abbreviated to get to composite examples ... def __repr__(self): return "{} {}".format(self.first_name, self.last_name) class Reporter(Base): __tablename__ = "reporters" id = Column(Integer(), primary_key=True) first_name = Column(String(30), doc="First name") last_name = Column(String(30), doc="Last name") email = Column(String(), doc="Email") favorite_pet_kind = Column(PetKind) pets = relationship("Pet", secondary=association_table, backref="reporters", order_by="Pet.id") articles = relationship("Article", backref="reporter") favorite_article = relationship("Article", uselist=False) @hybrid_property def hybrid_prop(self): return self.first_name column_prop = column_property( select([func.cast(func.count(id), Integer)]), doc="Column property" ) ~~ composite_prop = composite(CompositeFullName, first_name, last_name, doc="Composite") class Article(Base): __tablename__ = "articles" id = Column(Integer(), primary_key=True) headline = Column(String(100)) pub_date = Column(Date()) reporter_id = Column(Integer(), ForeignKey("reporters.id")) class ReflectedEditor(type): @classmethod def __subclasses__(cls): return [] editor_table = Table("editors", Base.metadata, autoload=True) mapper(ReflectedEditor, editor_table) ## ... source file continues with no further composite examples... ```
{ "content_hash": "096f43466db7870d9aa91ed95a25e3b6", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 170, "avg_line_length": 36.90344827586207, "alnum_prop": 0.7320127079050645, "repo_name": "mattmakai/fullstackpython.com", "id": "3848c031ff6620e90fefd8286d252c545ad651ec", "size": "5351", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "content/pages/examples/sqlalchemy/sqlalchemy-orm-composite.markdown", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "35549" }, { "name": "HTML", "bytes": "774951" }, { "name": "Makefile", "bytes": "3701" }, { "name": "Python", "bytes": "23705" }, { "name": "Shell", "bytes": "63" } ], "symlink_target": "" }
package com.diyanfilipov.potlach; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import org.springframework.security.core.GrantedAuthority; @Entity public class UserAuthority implements GrantedAuthority{ private static final long serialVersionUID = -7516193374704733588L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String authority; public UserAuthority(){} public UserAuthority(String role){ authority = role; } public long getId() { return id; } public void setId(long id) { this.id = id; } public void setAuthority(String authority) { this.authority = authority; } @Override public String getAuthority() { return authority; } }
{ "content_hash": "4be69d877bea97ab1dc5190dfc6b3ae4", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 68, "avg_line_length": 19.5609756097561, "alnum_prop": 0.7668329177057357, "repo_name": "diyanfilipov/potlach-server", "id": "0f09b4169fce6e39164f1ccfe862201951f4a815", "size": "802", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/diyanfilipov/potlach/UserAuthority.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "78243" } ], "symlink_target": "" }
package org.develnext.jphp.ext.httpserver.classes; import javax.servlet.RequestDispatcher; import org.develnext.jphp.ext.httpserver.HttpServerExtension; import org.eclipse.jetty.server.*; import org.eclipse.jetty.server.handler.*; import org.eclipse.jetty.server.session.DefaultSessionIdManager; import org.eclipse.jetty.server.session.SessionHandler; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.*; import org.eclipse.jetty.websocket.server.WebSocketHandler; import org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest; import org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse; import org.eclipse.jetty.websocket.servlet.WebSocketCreator; import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory; import php.runtime.Memory; import php.runtime.annotation.Reflection.Name; import php.runtime.annotation.Reflection.Namespace; import php.runtime.annotation.Reflection.Nullable; import php.runtime.annotation.Reflection.Signature; import php.runtime.env.Environment; import php.runtime.invoke.Invoker; import php.runtime.lang.BaseObject; import php.runtime.memory.*; import php.runtime.reflection.ClassEntity; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; @Name("HttpServer") @Namespace(HttpServerExtension.NS) public class PHttpServer extends BaseObject { private Server server; private HandlerList handlers = new HandlerList(); private HandlerList filters = new HandlerList(); private SessionIdManager idmanager; private QueuedThreadPool threadPool; public PHttpServer(Environment env, Server server) { super(env); this.server = server; } public PHttpServer(Environment env, ClassEntity clazz) { super(env, clazz); } @Signature public void __construct() { threadPool = new QueuedThreadPool(); server = new Server(threadPool); initSessionManager(); } @Signature public void __construct(int port) { __construct(port, null); } private void initSessionManager() { idmanager = new DefaultSessionIdManager(server); server.setSessionIdManager(idmanager); SessionHandler sessions = new SessionHandler(); sessions.setSessionIdManager(idmanager); filters.addHandler(sessions); } @Signature public void __construct(int port, String host) { threadPool = new QueuedThreadPool(); server = new Server(threadPool); if (host == null || host.isEmpty()) { listen(LongMemory.valueOf(port)); } else { listen(StringMemory.valueOf(host + ":" + port)); } initSessionManager(); } @Signature public void minThreads(int minThreads) { threadPool.setMinThreads(minThreads); } @Signature public int minThreads() { return threadPool.getMinThreads(); } @Signature public void maxThreads(int maxThreads) { threadPool.setMaxThreads(maxThreads); } @Signature public int maxThreads() { return threadPool.getMaxThreads(); } @Signature public void threadIdleTimeout(int timeout) { threadPool.setIdleTimeout(timeout); } @Signature public int threadIdleTimeout() { return threadPool.getIdleTimeout(); } @Signature public boolean stopAtShutdown() { return server.getStopAtShutdown(); } @Signature public void stopAtShutdown(boolean val) { server.setStopAtShutdown(val); } @Signature public void clearHandlers() { handlers.setHandlers(new Handler[0]); } @Signature public void addWebSocket(Environment env, String path, ArrayMemory _handlers) { WebSocketParam param = _handlers.toBean(env, WebSocketParam.class); ContextHandler contextHandler = new ContextHandler(path); contextHandler.setHandler(new WebSocketHandler() { @Override public void configure(WebSocketServletFactory factory) { factory.setCreator(new WebSocketCreator() { @Override public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp) { return new WebSocket(env, param); } }); } }); handlers.addHandler(contextHandler); } @Signature public void addHandler(final Invoker invoker) { handlers.addHandler(new InvokeHandler(invoker)); } @Signature public void addFilter(final Invoker invoker) { filters.addHandler(new InvokeHandler(invoker)); } @Signature public Memory handlers() { ArrayMemory result = ArrayMemory.createListed(handlers.getHandlers().length); for (Handler handler : handlers.getHandlers()) { if (handler instanceof InvokeHandler) { Invoker invoker = ((InvokeHandler) handler).getInvoker(); result.add(invoker.getMemory().toImmutable()); } } return result.toImmutable(); } @Signature public Memory filters() { ArrayMemory result = ArrayMemory.createListed(filters.getHandlers().length); for (Handler handler : filters.getHandlers()) { if (handler instanceof InvokeHandler) { Invoker invoker = ((InvokeHandler) handler).getInvoker(); result.add(invoker.getMemory().toImmutable()); } } return result.toImmutable(); } @Signature public PHttpRouteFilter filtrate(Environment env, Memory methods, String path, Memory invoker) { PHttpRouteFilter routeHandler = new PHttpRouteFilter(env); routeHandler.reset(env, methods, path, invoker); filters.addHandler(new InvokeHandler(Invoker.create(env, ObjectMemory.valueOf(routeHandler)))); return routeHandler; } @Signature public PHttpRouteHandler route(Environment env, Memory methods, String path, Memory invoker) { PHttpRouteHandler routeHandler = new PHttpRouteHandler(env); routeHandler.reset(env, methods, path, invoker); addHandler(Invoker.create(env, ObjectMemory.valueOf(routeHandler))); return routeHandler; } @Signature public PHttpRouteHandler any(Environment env, String path, Memory invoker) { return route(env, StringMemory.valueOf("*"), path, invoker); } @Signature public PHttpRouteHandler get(Environment env, String path, Memory invoker) { return route(env, StringMemory.valueOf("GET"), path, invoker); } @Signature public PHttpRouteHandler post(Environment env, String path, Memory invoker) { return route(env, StringMemory.valueOf("POST"), path, invoker); } @Signature public PHttpRouteHandler put(Environment env, String path, Memory invoker) { return route(env, StringMemory.valueOf("PUT"), path, invoker); } @Signature public PHttpRouteHandler delete(Environment env, String path, Memory invoker) { return route(env, StringMemory.valueOf("DELETE"), path, invoker); } @Signature public PHttpRouteHandler options(Environment env, String path, Memory invoker) { return route(env, StringMemory.valueOf("OPTIONS"), path, invoker); } @Signature public PHttpRouteHandler patch(Environment env, String path, Memory invoker) { return route(env, StringMemory.valueOf("PATCH"), path, invoker); } @Signature public PHttpRouteHandler head(Environment env, String path, Memory invoker) { return route(env, StringMemory.valueOf("HEAD"), path, invoker); } @Signature public void listen(Memory value) { listen(value, null); } @Signature public void listen(Memory value, ArrayMemory sslSettings) { ServerConnector connector; if (sslSettings != null) { SslContextFactory contextFactory = new SslContextFactory(); // key store if (sslSettings.containsKey("keyStorePath")) contextFactory.setKeyStorePath(sslSettings.valueOfIndex("keyStorePath").toString()); if (sslSettings.containsKey("keyStorePassword")) contextFactory.setKeyStoreType(sslSettings.valueOfIndex("keyStorePassword").toString()); if (sslSettings.containsKey("keyStoreType")) contextFactory.setKeyStoreType(sslSettings.valueOfIndex("keyStoreType").toString()); if (sslSettings.containsKey("keyStoreProvider")) contextFactory.setKeyStoreProvider(sslSettings.valueOfIndex("keyStoreProvider").toString()); // trust store if (sslSettings.containsKey("trustStorePath")) contextFactory.setTrustStorePath(sslSettings.valueOfIndex("trustStorePath").toString()); if (sslSettings.containsKey("trustStorePassword")) contextFactory.setTrustStoreType(sslSettings.valueOfIndex("trustStorePassword").toString()); if (sslSettings.containsKey("trustStoreType")) contextFactory.setTrustStoreType(sslSettings.valueOfIndex("trustStoreType").toString()); if (sslSettings.containsKey("trustStoreProvider")) contextFactory.setTrustStoreProvider(sslSettings.valueOfIndex("trustStoreProvider").toString()); if (sslSettings.containsKey("trustAll")) contextFactory.setTrustAll(sslSettings.valueOfIndex("trustAll").toBoolean()); if (sslSettings.containsKey("trustManagerFactoryAlgorithm")) contextFactory.setTrustManagerFactoryAlgorithm(sslSettings.valueOfIndex("trustManagerFactoryAlgorithm").toString()); // key manager if (sslSettings.containsKey("keyManagerFactoryAlgorithm")) contextFactory.setKeyManagerFactoryAlgorithm(sslSettings.valueOfIndex("keyManagerFactoryAlgorithm").toString()); if (sslSettings.containsKey("keyManagerPassword")) contextFactory.setKeyManagerPassword(sslSettings.valueOfIndex("keyManagerPassword").toString()); // other if (sslSettings.containsKey("certAlias")) contextFactory.setCertAlias(sslSettings.valueOfIndex("certAlias").toString()); if (sslSettings.containsKey("protocol")) contextFactory.setProtocol(sslSettings.valueOfIndex("protocol").toString()); if (sslSettings.containsKey("provider")) contextFactory.setProvider(sslSettings.valueOfIndex("provider").toString()); if (sslSettings.containsKey("validateCerts")) contextFactory.setValidateCerts(sslSettings.valueOfIndex("validateCerts").toBoolean()); connector = new ServerConnector(server, contextFactory); } else { connector = new ServerConnector(server); } if (value.isNumber()) { connector.setName("0.0.0.0:" + value.toInteger()); connector.setPort(value.toInteger()); } else { String[] strings = value.toString().split("\\:"); if (strings.length < 2) { throw new IllegalArgumentException("Invalid listen value: " + value); } connector.setHost(strings[0]); connector.setPort(Integer.parseInt(strings[1])); connector.setName(strings[0] + ":" + strings[1]); } server.addConnector(connector); } @Signature public boolean unlisten(Environment env, String value) { if (server.isRunning()) { env.exception("Unable to unlisten() for running server"); } String host = "0.0.0.0"; String port = "80"; if (value.contains(":")) { String[] strings = value.split("\\:"); host = strings[0]; if (strings.length > 1) { port = strings[1]; } } for (Connector connector : server.getConnectors()) { if (connector.getName().equals(host + ":" + port)) { server.removeConnector(connector); return true; } } return false; } @Signature public Memory connectors() { Connector[] connectors = server.getConnectors(); ArrayMemory arrayMemory = ArrayMemory.createListed(connectors.length); for (Connector connector : connectors) { arrayMemory.add(connector.getName()); } return arrayMemory.toImmutable(); } @Signature public void runInBackground() throws Exception { server.setErrorHandler(new ErrorHandler() { @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { super.handle(target, baseRequest, request, response); } }); HandlerList handlerList = new HandlerList(); for (Handler handler : filters.getHandlers()) { handlerList.addHandler(handler); } for (Handler handler : handlers.getHandlers()) { handlerList.addHandler(handler); } server.setHandler(handlerList); server.start(); } @Signature public void run() throws Exception { runInBackground(); server.join(); } @Signature public void shutdown() throws Exception { server.stop(); } @Signature public boolean isRunning() { return server.isRunning(); } @Signature public boolean isFailed() { return server.isFailed(); } @Signature public boolean isStarting() { return server.isStarting(); } @Signature public boolean isStopping() { return server.isStopping(); } @Signature public boolean isStopped() { return server.isStopped(); } @Signature public void setRequestLogHandler(Environment env, @Nullable Invoker invoker) { if (invoker == null) { server.setRequestLog(null); } else { server.setRequestLog((request, response) -> { invoker.callAny(new PHttpServerRequest(env, request), new PHttpServerResponse(env, response)); }); } } @Signature public void setErrorHandler(Environment env, @Nullable Invoker invoker) { if (invoker == null) { server.setErrorHandler(null); } else { ErrorHandler errorHandler = new ErrorHandler(); server.setErrorHandler(new ErrorHandler() { @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException { Throwable th = (Throwable)request.getAttribute(RequestDispatcher.ERROR_EXCEPTION); invoker.callAny(th, new PHttpServerRequest(env, Request.getBaseRequest(request)), new PHttpServerResponse(env, response)); } }); } } public static class InvokeHandler extends AbstractHandler { private final Invoker invoker; public InvokeHandler(Invoker invoker) { this.invoker = invoker; } public Invoker getInvoker() { return invoker; } @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { try { invoker.callAny(new PHttpServerRequest(invoker.getEnvironment(), baseRequest), new PHttpServerResponse(invoker.getEnvironment(), response)); } catch (Throwable e) { Environment.catchThrowable(e, invoker.getEnvironment()); } } } public static class WebSocketParam { private Invoker onConnect; private Invoker onClose; private Invoker onError; private Invoker onMessage; private Invoker onBinaryMessage; public Invoker getOnConnect() { return onConnect; } public void setOnConnect(Invoker onConnect) { this.onConnect = onConnect; } public Invoker getOnClose() { return onClose; } public void setOnClose(Invoker onClose) { this.onClose = onClose; } public Invoker getOnError() { return onError; } public void setOnError(Invoker onError) { this.onError = onError; } public Invoker getOnMessage() { return onMessage; } public void setOnMessage(Invoker onMessage) { this.onMessage = onMessage; } public Invoker getOnBinaryMessage() { return onBinaryMessage; } public void setOnBinaryMessage(Invoker onBinaryMessage) { this.onBinaryMessage = onBinaryMessage; } } @org.eclipse.jetty.websocket.api.annotations.WebSocket public static class WebSocket { private final Environment env; private final WebSocketParam param; public WebSocket(Environment env, WebSocketParam param) { this.env = env; this.param = param; } @OnWebSocketConnect public void onConnect(Session session) { if (param.onConnect != null) { param.onConnect.callAny(session); } } @OnWebSocketClose public void onClose(Session session, int statusCode, String reason) { if (param.onClose != null) { param.onClose.callAny(session, statusCode, reason); } } @OnWebSocketError public void onError(Session session, Throwable throwable) { if (param.onError != null) { param.onError.callAny(session, throwable); } } @OnWebSocketMessage public void onMessage(Session session, String text) { if (param.onMessage != null) { param.onMessage.callAny(session, text); } } @OnWebSocketMessage public void onBinaryMessage(Session session, InputStream stream) { if (param.onBinaryMessage != null) { param.onBinaryMessage.callAny(session, stream); } } } }
{ "content_hash": "410c651a74b86d38b36c3ac7686e34d8", "timestamp": "", "source": "github", "line_count": 577, "max_line_length": 163, "avg_line_length": 32.570190641247834, "alnum_prop": 0.638642047570904, "repo_name": "jphp-compiler/jphp", "id": "1ea5dce3d451ba45b3a775972d7cdb86b36263ae", "size": "18793", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "exts/jphp-httpserver-ext/src/main/java/org/develnext/jphp/ext/httpserver/classes/PHttpServer.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2124" }, { "name": "HTML", "bytes": "4259" }, { "name": "Inno Setup", "bytes": "2041" }, { "name": "Java", "bytes": "4396883" }, { "name": "PHP", "bytes": "1570052" }, { "name": "Shell", "bytes": "5234" } ], "symlink_target": "" }
using UnityEngine; using System.Collections; using System.Collections.Generic; public abstract class Spell{ public abstract string name { get; } public abstract float cooldown { get; } // Time in seconds public virtual float castTime { get { return 0; } } // Time in seconds public virtual float channelTime { get { return 0; } } // How long can the spell be channeled for. public int ID { get; set; } protected Timer channelTimer = new Timer(); public abstract void effect(GameObject player); protected GM gm; protected List<GameObject> assets = new List<GameObject>(); // Contains public Spell(GM gm) { this.gm = gm; } protected void getAsset(string name) { /* * Get assets from the associated gameObject's child. */ GameObject obj = GameObject.Find(name); foreach (Transform child in obj.transform) { assets.Add(child.gameObject); } } protected IEnumerator channel(Player playerScr, GameObject projectile) { /* Encapsulator function, returns the coroutine*/ IEnumerator ret = _channel(playerScr, projectile); gm.RunCoroutine(ret); return ret; } protected virtual IEnumerator _channel(Player playerScr, GameObject projectile) { /* * Channel the spell, putting the player in the state of channeling. * Channeling ends when the player release the channel button, or the timer finish. * Do not run this method, but run channel(...) instead. */ channelTimer.Set(channelTime); playerScr.channelTimer = channelTimer; playerScr.currentState = PlayerState.CHANNEL; while (playerScr.currentState == PlayerState.CHANNEL && !channelTimer.IsDone()) { channelTimer.Tick(); yield return null; } if (playerScr.currentState == PlayerState.CHANNEL) { // To prevent the case when the player release button and currentState already went back to free and then set back again. playerScr.currentState = PlayerState.FINISH; } Object.Destroy(projectile); } }
{ "content_hash": "535f2c9037e9a0581738562dc0709103", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 177, "avg_line_length": 35.01754385964912, "alnum_prop": 0.7054108216432866, "repo_name": "tinlun123/Card-Wizards", "id": "f648875d1e86b3fd78a013d06d09a27852185c4c", "size": "1998", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Assets/Scripts/Spell.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "22029" } ], "symlink_target": "" }
/* (c) British Telecommunications plc, 2009, All Rights Reserved */ package com.bt.pi.sss; import java.security.SignatureException; import java.util.List; import javax.annotation.Resource; import javax.security.sasl.AuthenticationException; import javax.ws.rs.core.MultivaluedMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.stereotype.Component; import com.bt.pi.app.common.entities.User; import com.bt.pi.sss.util.AWSAuthHelper; import com.sun.jersey.spi.container.ContainerRequest; @Component public class AWSQueryAuthenticationHandler implements AuthenticationHandler { private static final String USER_S_IS_NOT_ENABLED = "User %s is not enabled"; private static final String BAD_SECRET_KEY = "Bad secret key"; private static final String THE_SECRET_KEY_WAS_BAD_FOR = "The secret key was bad for "; private static final String COLON = ":"; private static final String NEW_LINE = "\n"; private static final String AWS = "AWS"; private static final String DATE_KEY = "Date"; private static final String AUTHORIZATION_KEY = "Authorization"; private static final Log LOG = LogFactory.getLog(AWSQueryAuthenticationHandler.class); private static final String NEWLINE = NEW_LINE; private static final String SIGNATURE_KEY = "Signature"; private static final String EXPIRES_KEY = "Expires"; private static final String AWSACCESS_KEY_ID = "AWSAccessKeyId"; private UserManager userManager; private AWSAuthHelper authHelper; public AWSQueryAuthenticationHandler() { userManager = null; authHelper = null; } @Resource public void setUserManager(UserManager value) { userManager = value; } @Resource public void setAWSAuthHelper(AWSAuthHelper value) { authHelper = value; } @Override public User authenticate(ContainerRequest request) throws AuthenticationException { if (!canHandle(request)) throw new IllegalArgumentException("Unable to handle that request."); MultivaluedMap<String, String> queryParams = request.getQueryParameters(); String key = getAccessKey(request, queryParams); User user = userManager.getUserByAccessKey(key); if (!user.isEnabled()) { LOG.info(String.format(USER_S_IS_NOT_ENABLED, user.getUsername())); throw new AuthenticationException(String.format(USER_S_IS_NOT_ENABLED, user.getUsername())); } String providedSignature = getSignature(request, queryParams); String resource = authHelper.getCanonicalizedResource(request); String amzHeaders = authHelper.getCanonicalizedAmzHeaders(request); String verb = request.getMethod(); String contentMd5 = getFromHeadersOrQuery("Content-MD5", queryParams, request); String contentType = getFromHeadersOrQuery("Content-Type", queryParams, request); String expires = getExpiresOrDate(request, queryParams); String toSign = createStringToSign(resource, amzHeaders, verb, contentMd5, contentType, expires); String calculatedSignature; try { calculatedSignature = authHelper.getSignature(user.getApiSecretKey(), toSign); } catch (SignatureException ex) { LOG.warn(THE_SECRET_KEY_WAS_BAD_FOR + user.getUsername(), ex); throw new AuthenticationException(BAD_SECRET_KEY, ex); } /**************************************************** * nasty addition to allow walrus-signed end points * ****************************************************/ String walrusToSign = createStringToSign("/services/Walrus" + resource, amzHeaders, verb, contentMd5, contentType, expires); String walrusCalculatedSignature; try { walrusCalculatedSignature = authHelper.getSignature(user.getApiSecretKey(), walrusToSign); } catch (SignatureException ex) { LOG.warn(THE_SECRET_KEY_WAS_BAD_FOR + user.getUsername(), ex); throw new AuthenticationException(BAD_SECRET_KEY, ex); } /******************** * End of nastiness * ********************/ if (!providedSignature.equals(calculatedSignature)) { // additional check to allow walrus-signed end points if (!providedSignature.equals(walrusCalculatedSignature)) { LOG.debug("Signatures do not match for request to " + request.getAbsolutePath() + " by user " + user.getUsername()); LOG.debug("Expected " + calculatedSignature + " but received " + providedSignature); LOG.debug("The string used for signing was " + toSign.replace(NEW_LINE, "\\n")); throw new AuthenticationException("Signatures do not match"); } } return user; } @Override public boolean canHandle(ContainerRequest request) { MultivaluedMap<String, String> queryParams = request.getQueryParameters(); try { String sig = getSignature(request, queryParams); String exp = getExpiresOrDate(request, queryParams); String key = getAccessKey(request, queryParams); if (isNullOrEmpty(sig) || isNullOrEmpty(exp) || isNullOrEmpty(key)) { return false; } return true; } catch (NullPointerException ex) { return false; } } private String getSignature(ContainerRequest request, MultivaluedMap<String, String> queryParams) { String sig = getFromHeadersOrQuery(SIGNATURE_KEY, queryParams, request); if (isNullOrEmpty(sig)) { sig = request.getHeaderValue(AUTHORIZATION_KEY); if (null != sig && sig.startsWith(AWS)) { sig = sig.substring(sig.indexOf(COLON) + 1); } else { sig = null; } } return sig; } private String getAccessKey(ContainerRequest request, MultivaluedMap<String, String> queryParams) { final int STARTPOS = 4; String accessKey = getFromHeadersOrQuery(AWSACCESS_KEY_ID, queryParams, request); if (isNullOrEmpty(accessKey)) { accessKey = request.getHeaderValue(AUTHORIZATION_KEY); if (null != accessKey && accessKey.startsWith(AWS)) { accessKey = accessKey.substring(STARTPOS, accessKey.indexOf(COLON)); } else { accessKey = null; } } return accessKey; } private String getExpiresOrDate(ContainerRequest request, MultivaluedMap<String, String> queryParams) { String date = getFromHeadersOrQuery(EXPIRES_KEY, queryParams, request); if (isNullOrEmpty(date)) { date = request.getHeaderValue(DATE_KEY); } return date; } private String getFromHeadersOrQuery(String key, MultivaluedMap<String, String> queryParams, ContainerRequest request) { List<String> paramValues = queryParams.get(key); if (null != paramValues) { return paramValues.get(0); } else { return request.getHeaderValue(key); } } private String createStringToSign(String resource, String amzHeaders, String verb, String contentMd5, String contentType, String expires) { String toSign = verb + NEWLINE + replaceNullForEmtpy(contentMd5) + NEWLINE + replaceNullForEmtpy(contentType) + NEWLINE + replaceNullForEmtpy(expires) + NEWLINE + amzHeaders + resource; return toSign; } private String replaceNullForEmtpy(String value) { if (null == value) { return ""; } else { return value; } } private boolean isNullOrEmpty(String str) { return !((null != str) && (str.length() > 0)); } }
{ "content_hash": "021930ce47edac0e6c3b4ad51cb552e7", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 193, "avg_line_length": 40.3948717948718, "alnum_prop": 0.6469468071600863, "repo_name": "barnyard/pi", "id": "114a213163dcb6a4c946ec82c9e87a5a67e1d2f2", "size": "7877", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "pi-sss/src/main/java/com/bt/pi/sss/AWSQueryAuthenticationHandler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "159216" }, { "name": "Groovy", "bytes": "16983" }, { "name": "Java", "bytes": "14463429" }, { "name": "JavaScript", "bytes": "40735" }, { "name": "Perl", "bytes": "229367" }, { "name": "Racket", "bytes": "725" }, { "name": "Ruby", "bytes": "1855569" }, { "name": "Shell", "bytes": "165580" } ], "symlink_target": "" }
<html lang="en"> <head> <meta charset="utf-8"> <title>Refreshing box</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"/> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous"/> <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/smoothness/jquery-ui.css" /> <link rel="stylesheet" href="../dist/jquery.refreshingBox.css" /> </head> <body> <div class="container"> <h2>The refreshing-box demo</h2> <p>Simple use:</p> <pre><code> $('.refreshing-box').refreshingBox({ description: 'Aggiorna automaticamente', table: true, checkBoxId: '', interval: 1000, //checked: true, onRefresh: function() { $('#console').append(new Date() + '&lt;br/&gt;'); }, onStart: function() { $('#console').append('started' + '&lt;br/&gt;'); }, onStop: function() { $('#console').append('stopped' + '&lt;br/&gt;'); } }); </code></pre> </div> <div class="container refreshing-box"></div> <div class="container"> <button id="point">Toggle Value Programmatically</button> </div> <div id="console" class="container" style="max-height:120px;"></div> <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script> <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"></script> <script src="../dist/jquery.refreshingBox.js"></script> <script> $(document).ready(function(){ $('.refreshing-box').refreshingBox({ description: 'Auto update', table: true, checkBoxId: '', interval: 1000, //checked: true, onRefresh: function() { $('#console').append(new Date() + '<br/>'); }, onStart: function() { $('#console').append('started' + '<br/>'); }, onStop: function() { $('#console').append('stopped' + '<br/>'); } }); $('#point').click(function(){ var oo = $('.refreshing-box').refreshingBox('value'); $('.refreshing-box').refreshingBox('value', !oo); }); }); </script> </body>
{ "content_hash": "d0b54755ecc47987f584effe8e121fe5", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 216, "avg_line_length": 31.337662337662337, "alnum_prop": 0.6663903854123497, "repo_name": "peterboccia/refreshing-box", "id": "04b804d62cd77f69856a9576414921f99125b1f5", "size": "2413", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/demo.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2393" } ], "symlink_target": "" }
<!-- Creator : groff version 1.21 --> <!-- CreationDate: Sat Feb 9 12:24:04 2013 --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta name="generator" content="groff -Thtml, see www.gnu.org"> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="Content-Style" content="text/css"> <style type="text/css"> p { margin-top: 0; margin-bottom: 0; vertical-align: top } pre { margin-top: 0; margin-bottom: 0; vertical-align: top } table { margin-top: 0; margin-bottom: 0; vertical-align: top } h1 { text-align: center } </style> <title></title> </head> <body> <hr> <p>ARCHIVE_READ_EXTRACT(3) BSD Library Functions Manual ARCHIVE_READ_EXTRACT(3)</p> <p style="margin-top: 1em"><b>NAME</b></p> <p style="margin-left:6%;"><b>archive_read_extract</b>, <b>archive_read_extract2</b>, <b>archive_read_extract_set_progress_callback</b> &mdash; functions for reading streaming archives</p> <p style="margin-top: 1em"><b>LIBRARY</b></p> <p style="margin-left:6%;">Streaming Archive Library (libarchive, -larchive)</p> <p style="margin-top: 1em"><b>SYNOPSIS</b></p> <p style="margin-left:6%;"><b>#include &lt;archive.h&gt;</b></p> <p style="margin-left:6%; margin-top: 1em"><i>int</i></p> <p><b>archive_read_extract</b>(<i>struct&nbsp;archive&nbsp;*</i>, <i>struct&nbsp;archive_entry&nbsp;*</i>, <i>int&nbsp;flags</i>);</p> <p style="margin-left:6%; margin-top: 1em"><i>int</i></p> <p><b>archive_read_extract2</b>(<i>struct&nbsp;archive&nbsp;*src</i>, <i>struct&nbsp;archive_entry&nbsp;*</i>, <i>struct&nbsp;archive&nbsp;*dest</i>);</p> <p style="margin-left:6%; margin-top: 1em"><i>void</i></p> <p><b>archive_read_extract_set_progress_callback</b>(<i>struct&nbsp;archive&nbsp;*</i>, <i>void&nbsp;(*func)(void&nbsp;*)</i>, <i>void&nbsp;*user_data</i>);</p> <p style="margin-top: 1em"><b>DESCRIPTION <br> archive_read_extract</b>(), <b>archive_read_extract_set_skip_file</b>()</p> <p style="margin-left:17%;">A convenience function that wraps the corresponding archive_write_disk(3) interfaces. The first call to <b>archive_read_extract</b>() creates a restore object using archive_write_disk_new(3) and archive_write_disk_set_standard_lookup(3), then transparently invokes archive_write_disk_set_options(3), archive_write_header(3), archive_write_data(3), and archive_write_finish_entry(3) to create the entry on disk and copy data into it. The <i>flags</i> argument is passed unmodified to archive_write_disk_set_options(3).</p> <p><b>archive_read_extract2</b>()</p> <p style="margin-left:17%;">This is another version of <b>archive_read_extract</b>() that allows you to provide your own restore object. In particular, this allows you to override the standard lookup functions using archive_write_disk_set_group_lookup(3), and archive_write_disk_set_user_lookup(3). Note that <b>archive_read_extract2</b>() does not accept a <i>flags</i> argument; you should use <b>archive_write_disk_set_options</b>() to set the restore options yourself.</p> <p><b>archive_read_extract_set_progress_callback</b>()</p> <p style="margin-left:17%;">Sets a pointer to a user-defined callback that can be used for updating progress displays during extraction. The progress function will be invoked during the extraction of large regular files. The progress function will be invoked with the pointer provided to this call. Generally, the data pointed to should include a reference to the archive object and the archive_entry object so that various statistics can be retrieved for the progress display.</p> <p style="margin-top: 1em"><b>RETURN VALUES</b></p> <p style="margin-left:6%;">Most functions return zero on success, non-zero on error. The possible return codes include: <b>ARCHIVE_OK</b> (the operation succeeded), <b>ARCHIVE_WARN</b> (the operation succeeded but a non-critical error was encountered), <b>ARCHIVE_EOF</b> (end-of-archive was encountered), <b>ARCHIVE_RETRY</b> (the operation failed but can be retried), and <b>ARCHIVE_FATAL</b> (there was a fatal error; the archive should be closed immediately).</p> <p style="margin-top: 1em"><b>ERRORS</b></p> <p style="margin-left:6%;">Detailed error codes and textual descriptions are available from the <b>archive_errno</b>() and <b>archive_error_string</b>() functions.</p> <p style="margin-top: 1em"><b>SEE ALSO</b></p> <p style="margin-left:6%;">tar(1), libarchive(3), archive_read(3), archive_read_data(3), archive_read_filter(3), archive_read_format(3), archive_read_open(3), archive_read_set_options(3), archive_util(3), tar(5)</p> <p style="margin-left:6%; margin-top: 1em">BSD February&nbsp;2, 2012 BSD</p> <hr> </body> </html>
{ "content_hash": "a01da9f5ffa34bbd5c3ff0202eca2aa3", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 87, "avg_line_length": 35.42537313432836, "alnum_prop": 0.7017063408468507, "repo_name": "IngwiePhoenix/d0p", "id": "bbb4606f57bf299e8f86f9a334cab62bf50c6abe", "size": "4747", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "libarchive-3.1.2/doc/html/archive_read_extract.3.html", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "13989" }, { "name": "Awk", "bytes": "21380" }, { "name": "C", "bytes": "6566911" }, { "name": "C++", "bytes": "325687" }, { "name": "Objective-C", "bytes": "63515" }, { "name": "PHP", "bytes": "3556" }, { "name": "Shell", "bytes": "1313904" } ], "symlink_target": "" }
<?php require_once('Streamer.php'); $ft = new File_Streamer(); $ft->receive();
{ "content_hash": "b3ac0ec2fed5d2c646a603fb3fa69afe", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 29, "avg_line_length": 13.333333333333334, "alnum_prop": 0.6375, "repo_name": "marx8926/Dicars", "id": "4531bea644722267b1407aa0b19a4a5d410522ac", "size": "80", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/extensiones/upload.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1147081" }, { "name": "JavaScript", "bytes": "182013" }, { "name": "PHP", "bytes": "4784092" } ], "symlink_target": "" }
#ifndef __types__currency_h__ #define __types__currency_h__ #include <cstddef> #include <ratio> #include <type_traits> #include <boost/preprocessor/cat.hpp> #include "jml/utils/exc_assert.h" #include "jml/utils/compact_vector.h" #include "jml/utils/unnamed_bool.h" #include "jml/db/persistent.h" #include "soa/jsoncpp/json.h" #include "soa/types/value_description.h" namespace RTBKIT { enum class CurrencyCode : std::uint32_t { CC_NONE = 'N' << 24 | 'O' << 16 | 'N' << 8 | 'E', CC_USD = 'U' << 24 | 'S' << 16 | 'D' << 8, // micro dollars CC_EUR = 'E' << 24 | 'U' << 16 | 'R' << 8, // micro euros CC_IMP = 'I' << 24 | 'M' << 16 | 'P' << 8, CC_CLK = 'C' << 24 | 'L' << 16 | 'K' << 8, CC_WIN = 'W' << 24 | 'I' << 16 | 'N' << 8 }; std::string toString(CurrencyCode code); CurrencyCode parseCurrencyCode(const std::string & code); CurrencyCode jsonDecode(const Json::Value & j, CurrencyCode * = 0); Json::Value jsonEncode(CurrencyCode code); /*****************************************************************************/ /* AMOUNT */ /*****************************************************************************/ struct Amount { Amount(CurrencyCode currencyCode = CurrencyCode::CC_NONE, int64_t value = 0) : value(value), currencyCode(currencyCode) { if (currencyCode == CurrencyCode::CC_NONE) ExcAssertEqual(value, 0); } Amount(const std::string & currencyStr, int64_t value = 0) : value(value), currencyCode(parseCurrency(currencyStr)) { if (currencyCode == CurrencyCode::CC_NONE) ExcAssertEqual(value, 0); } bool isZero() const { return value == 0; } bool isNonNegative() const { return value >= 0; } bool isNegative() const { return value < 0; } /** Returns the minimum of the two amounts. */ Amount limit(const Amount & other) const { assertCurrencyIsCompatible(other); return Amount(currencyCode, std::min(value, other.value)); } JML_IMPLEMENT_OPERATOR_BOOL(!isZero()); Amount & operator += (const Amount & other) { if (!other) return *this; else if (!*this) *this = other; else { ExcAssertEqual(currencyCode, other.currencyCode); value += other.value; } return *this; } Amount operator + (const Amount & other) const { Amount result = *this; result += other; return result; } Amount & operator -= (const Amount & other) { if (!other) return *this; else if (!*this) *this = -other; else { if (currencyCode != other.currencyCode) { using namespace std; cerr << this->toString() << " - " << other.toString() << endl; } ExcAssertEqual(currencyCode, other.currencyCode); value -= other.value; } return *this; } Amount operator - (const Amount & other) const { Amount result = *this; result -= other; return result; } Amount operator * (double factor) const { double result = static_cast<double>(value) * factor; return Amount(currencyCode, static_cast<int64_t>(result)); } bool currencyIsCompatible(const Amount & other) const { if (currencyCode == other.currencyCode) return true; if (currencyCode == CurrencyCode::CC_NONE && value == 0) return true; if (other.currencyCode == CurrencyCode::CC_NONE && other.value == 0) return true; return false; } void assertCurrencyIsCompatible(const Amount & other) const; /** They compare equal if: - Both currency code and amount are equal, OR - Both is zero (no currency, no amount), OR - One is zero with a currency code and one is zero with no code */ bool operator == (const Amount & other) const { return value == other.value && (currencyCode == other.currencyCode || (value == 0 && (currencyCode == CurrencyCode::CC_NONE || other.currencyCode == CurrencyCode::CC_NONE))); } bool operator != (const Amount & other) const { return ! operator == (other); } bool operator < (const Amount & other) const; bool operator <= (const Amount & other) const; bool operator > (const Amount & other) const; bool operator >= (const Amount & other) const; Amount operator - () const { Amount result = *this; result.value = -result.value; return result; } static std::string getCurrencyStr(CurrencyCode currencyCode); std::string getCurrencyStr() const; static CurrencyCode parseCurrency(const std::string & currency); std::string toString() const; Json::Value toJson() const; static Amount fromJson(const Json::Value & json); static Amount parse(const std::string & value); void serialize(ML::DB::Store_Writer & store) const; void reconstitute(ML::DB::Store_Reader & store); int64_t value; CurrencyCode currencyCode; }; std::ostream & operator << (std::ostream & stream, Amount amount); IMPL_SERIALIZE_RECONSTITUTE(Amount); typedef std::ratio<1, 1> Micro; typedef std::ratio<std::micro::den, std::micro::num> NaturalCurrency; typedef std::ratio<std::micro::den / 1000, std::micro::num> CPM; typedef std::ratio_multiply<std::micro, std::ratio<1000, 1>> MicroCPM; template <typename Ratio> struct PriceIntegerType { typedef typename std::conditional<(Ratio::den > Ratio::num), double, int64_t>::type type; }; #define CHECK_PRICE_INTEGER_TYPE(price_ratio, result_type) \ static_assert( \ std::is_same< \ /* ratio reverted because we want make sure that the way back has */ \ /* the proper type */ \ typename PriceIntegerType<std::ratio<price_ratio::den, price_ratio::num>>::type, \ result_type>::value, \ "Something's wrong") CHECK_PRICE_INTEGER_TYPE(Micro, int64_t); CHECK_PRICE_INTEGER_TYPE(NaturalCurrency, double); CHECK_PRICE_INTEGER_TYPE(CPM, double); CHECK_PRICE_INTEGER_TYPE(MicroCPM, int64_t); #undef CHECK_PRICE_INTEGER_TYPE template <CurrencyCode CURRENCY, typename Ratio> struct CurrencyTemplate : public Amount { template <typename T> static inline T currentRatioToBaseRatio(T value) { return (value * Ratio::num) / Ratio::den; } CurrencyTemplate() : Amount(CURRENCY, 0) { } template <typename T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type> CurrencyTemplate(T value) : Amount(CURRENCY, currentRatioToBaseRatio(value)) { } CurrencyTemplate(const Amount& amount) : Amount(amount) { if (amount) ExcAssertEqual(currencyCode, CURRENCY); } template <typename R> bool operator==(const CurrencyTemplate<CURRENCY, R>& rhs) const { return Amount::operator==(rhs); } template <typename T> operator T() const; }; namespace detail { template <typename Ratio> struct CurrencyConverter { typedef std::ratio<Ratio::den, Ratio::num> RevertedRatio; typedef decltype(std::declval<Amount>().value) ValueType; template <CurrencyCode code> CurrencyConverter(const CurrencyTemplate<code, Ratio>& currency) : value(currency.value) , code(currency.currencyCode) { } template <typename T, typename ReturnType = typename PriceIntegerType<RevertedRatio>::type, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type> inline ReturnType baseRatioToCurrentRatio(T value) const { static_assert(std::is_same<ReturnType, T>::value, "Invalid type cast required"); return (ReturnType(value) * Ratio::den) / Ratio::num; } template <typename T, typename ReturnType = typename std::decay<T>::type> inline ReturnType baseRatioToCurrentRatio(...) const { static_assert(std::is_convertible<Amount, ReturnType>::value, "Cast is impossible"); return Amount{code, value}; } template <typename T> operator T() const { return baseRatioToCurrentRatio<T>(value); } ValueType value; CurrencyCode code; }; } // namespace detail template <CurrencyCode CURRENCY, typename Ratio> template <typename T> CurrencyTemplate<CURRENCY, Ratio>::operator T() const { return detail::CurrencyConverter<Ratio>(*this); } template <CurrencyCode, typename Ratio> inline detail::CurrencyConverter<Ratio> amountToCurrencyRatio(const Amount& amount); #define CURRENCY EUR #include "currency.h.in" #undef CURRENCY #define CURRENCY USD #include "currency.h.in" #undef CURRENCY template<typename Ratio = Micro> inline detail::CurrencyConverter<Ratio> getAmountIn(CurrencyCode currency, const Amount& amount) { switch (currency) { case CurrencyCode::CC_EUR: return amountToCurrencyRatio<CurrencyCode::CC_EUR, Ratio>(amount); case CurrencyCode::CC_USD: return amountToCurrencyRatio<CurrencyCode::CC_USD, Ratio>(amount); default: throw std::runtime_error("Cannot convert amount to currency: " + toString(currency)); }; } template<typename Ratio = Micro> inline detail::CurrencyConverter<Ratio> getAmountIn(const Amount& amount) { return getAmountIn<Ratio>(amount.currencyCode, amount); } template <CurrencyCode CURRENCY, typename Ratio, typename Integer> inline Amount createAmount(Integer amount) { return CurrencyTemplate<CURRENCY, Ratio>(amount); } template <typename Ratio, typename Integer> Amount createAmount(Integer amount, CurrencyCode currency) { switch (currency) { case CurrencyCode::CC_EUR: return createAmount<CurrencyCode::CC_EUR, Ratio>(amount); case CurrencyCode::CC_USD: return createAmount<CurrencyCode::CC_USD, Ratio>(amount); default: throw std::runtime_error("Cannot convert create amount of: " + toString(currency)); }; } /*****************************************************************************/ /* CURRENCY POOL */ /*****************************************************************************/ /** This aggregates amounts over multiple currencies. The values are kept separately so that they can be combined according to application specific logic. */ struct CurrencyPool { void clear() { currencyAmounts.clear(); } bool empty() const { return currencyAmounts.empty(); } CurrencyPool() { } CurrencyPool(const Amount & amount) : currencyAmounts(1, amount) { if (!amount) currencyAmounts.clear(); } CurrencyPool & operator += (const Amount & amount) { if (!amount) return *this; for (auto & am: currencyAmounts) { if (am.currencyCode == amount.currencyCode) { am += amount; return *this; } } currencyAmounts.push_back(amount); std::sort(currencyAmounts.begin(), currencyAmounts.end(), [] (Amount am1, Amount am2) { return am1.currencyCode < am2.currencyCode; }); return *this; } CurrencyPool & operator -= (const Amount & amount) { return operator += (-amount); } CurrencyPool operator + (const Amount & amount) const { CurrencyPool result = *this; result += amount; return result; } CurrencyPool operator - (const Amount & amount) const { CurrencyPool result = *this; result -= amount; return result; } CurrencyPool & operator += (const CurrencyPool & other) { for (auto & am: other.currencyAmounts) operator += (am); return *this; } CurrencyPool & operator -= (const CurrencyPool & other) { for (auto & am: other.currencyAmounts) operator -= (am); return *this; } CurrencyPool operator *= (double factor) { for (auto & am: currencyAmounts) am = am * factor; return *this; } CurrencyPool operator + (const CurrencyPool & spend) const { CurrencyPool result = *this; result += spend; return result; } CurrencyPool operator - (const CurrencyPool & spend) const { CurrencyPool result = *this; result -= spend; return result; } CurrencyPool operator * (double factor) const { CurrencyPool result = *this; result *= factor; return result; } /** Limits the other amount so that none of its entries are higher than the current pool. */ CurrencyPool limit(const CurrencyPool & other) const { CurrencyPool result; for (auto & am: other.currencyAmounts) { Amount a = getAvailable(am.currencyCode).limit(am); if (a) result.currencyAmounts.push_back(a); } return result; } /** Return the maximum of 0 or the amount for each entry. */ CurrencyPool nonNegative() const { CurrencyPool result; for (auto & am: currencyAmounts) { if (am.isNonNegative()) result.currencyAmounts.push_back(am); } return result; } bool operator == (const Amount & other) const { return operator == (CurrencyPool(other)); } bool operator != (const Amount & other) const { return ! operator == (other); } bool operator == (const CurrencyPool & other) const; bool operator != (const CurrencyPool & other) const { return ! operator == (other); } /** Return if there is enough available to cover the given request. */ bool hasAvailable(const Amount & amount) const; /** Return the amount available in the given currency code. */ Amount getAvailable(const CurrencyCode & currency) const; bool isNonNegative() const { for (auto & am: currencyAmounts) if (!am.isNonNegative()) return false; return true; } bool isZero() const { for (auto & am: currencyAmounts) if (!am.isZero()) return false; return true; } void serialize(ML::DB::Store_Writer & store) const; void reconstitute(ML::DB::Store_Reader & store); ML::compact_vector<Amount, 1> currencyAmounts; /// Amounts per currency Json::Value toJson() const; std::string toString() const; static CurrencyPool fromJson(const Json::Value & json); bool isSameOrPastVersion(const CurrencyPool & otherPool) const; }; std::ostream & operator << (std::ostream & stream, CurrencyPool pool); IMPL_SERIALIZE_RECONSTITUTE(CurrencyPool); /*****************************************************************************/ /* LINE ITEMS */ /*****************************************************************************/ /** Maintains a spend per "line item". */ struct LineItems { bool isZero() const { for (const auto & e: entries) if (!e.second.isZero()) return false; return true; } void clear() { entries.clear(); } bool empty() const { for (auto & e: entries) { if (!e.second.empty()) return false; } return true; } /** Aggregate total spend over line items. */ CurrencyPool total() const; CurrencyPool & operator [] (std::string item) { return entries[item]; } CurrencyPool operator [] (std::string item) const { auto it = entries.find(item); if (it == entries.end()) return CurrencyPool(); return it->second; } static LineItems fromJson(const Json::Value & json); Json::Value toJson() const; bool operator == (const LineItems & other) const; bool operator != (const LineItems & other) const { return ! operator == (other); } LineItems & operator += (const LineItems & other); void serialize(ML::DB::Store_Writer & store) const; void reconstitute(ML::DB::Store_Reader & store); std::map<std::string, CurrencyPool> entries; }; inline std::ostream & operator << (std::ostream & stream, const LineItems & li) { return stream << li.toJson(); } IMPL_SERIALIZE_RECONSTITUTE(LineItems); Datacratic::ValueDescriptionT<LineItems> * getDefaultDescription(LineItems * = 0); Datacratic::ValueDescriptionT<CurrencyCode> * getDefaultDescription(CurrencyCode * = 0); Datacratic::ValueDescriptionT<CurrencyPool> * getDefaultDescription(CurrencyPool * = 0); Datacratic::ValueDescriptionT<Amount> * getDefaultDescription(Amount * = 0); } // namespace RTBKIT namespace std { template<> struct hash<RTBKIT::CurrencyCode> { size_t operator() (const RTBKIT::CurrencyCode & code) const { return static_cast<int>(code); } }; } #endif /* __types__currency_h__ */
{ "content_hash": "1a5d76c87a6edf21935f9243ca8d3ec2", "timestamp": "", "source": "github", "line_count": 646, "max_line_length": 96, "avg_line_length": 27.478328173374614, "alnum_prop": 0.575347867725762, "repo_name": "sergey104/rtbkit", "id": "e588989077637c92ffc84d86d1704754f42743f5", "size": "17926", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "rtbkit/common/currency.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "311625" }, { "name": "C++", "bytes": "10741489" }, { "name": "CMake", "bytes": "2737" }, { "name": "CSS", "bytes": "1127" }, { "name": "CoffeeScript", "bytes": "8599" }, { "name": "FORTRAN", "bytes": "16349" }, { "name": "HTML", "bytes": "177275" }, { "name": "JavaScript", "bytes": "62214" }, { "name": "Makefile", "bytes": "113035" }, { "name": "Objective-C", "bytes": "815" }, { "name": "Protocol Buffer", "bytes": "33587" }, { "name": "Python", "bytes": "97915" }, { "name": "Ruby", "bytes": "70059" }, { "name": "Shell", "bytes": "17401" } ], "symlink_target": "" }
(function () { 'use strict'; var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); var setDir = function (editor, dir) { var dom = editor.dom; var curDir; var blocks = editor.selection.getSelectedBlocks(); if (blocks.length) { curDir = dom.getAttrib(blocks[0], 'dir'); global$1.each(blocks, function (block) { if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) { dom.setAttrib(block, 'dir', curDir !== dir ? dir : null); } }); editor.nodeChanged(); } }; var register = function (editor) { editor.addCommand('mceDirectionLTR', function () { setDir(editor, 'ltr'); }); editor.addCommand('mceDirectionRTL', function () { setDir(editor, 'rtl'); }); }; var isSimpleType = function (type) { return function (value) { return typeof value === type; }; }; var isNullable = function (a) { return a === null || a === undefined; }; var isNonNullable = function (a) { return !isNullable(a); }; var isFunction = isSimpleType('function'); var noop = function () { }; var compose1 = function (fbc, fab) { return function (a) { return fbc(fab(a)); }; }; var constant = function (value) { return function () { return value; }; }; var never = constant(false); var always = constant(true); var none = function () { return NONE; }; var NONE = function () { var eq = function (o) { return o.isNone(); }; var call = function (thunk) { return thunk(); }; var id = function (n) { return n; }; var me = { fold: function (n, _s) { return n(); }, is: never, isSome: never, isNone: always, getOr: id, getOrThunk: call, getOrDie: function (msg) { throw new Error(msg || 'error: getOrDie called on none.'); }, getOrNull: constant(null), getOrUndefined: constant(undefined), or: id, orThunk: call, map: none, each: noop, bind: none, exists: never, forall: always, filter: none, equals: eq, equals_: eq, toArray: function () { return []; }, toString: constant('none()') }; return me; }(); var some = function (a) { var constant_a = constant(a); var self = function () { return me; }; var bind = function (f) { return f(a); }; var me = { fold: function (n, s) { return s(a); }, is: function (v) { return a === v; }, isSome: always, isNone: never, getOr: constant_a, getOrThunk: constant_a, getOrDie: constant_a, getOrNull: constant_a, getOrUndefined: constant_a, or: self, orThunk: self, map: function (f) { return some(f(a)); }, each: function (f) { f(a); }, bind: bind, exists: bind, forall: bind, filter: function (f) { return f(a) ? me : NONE; }, toArray: function () { return [a]; }, toString: function () { return 'some(' + a + ')'; }, equals: function (o) { return o.is(a); }, equals_: function (o, elementEq) { return o.fold(never, function (b) { return elementEq(a, b); }); } }; return me; }; var from = function (value) { return value === null || value === undefined ? NONE : some(value); }; var Optional = { some: some, none: none, from: from }; var isSupported = function (dom) { return dom.style !== undefined && isFunction(dom.style.getPropertyValue); }; var fromHtml = function (html, scope) { var doc = scope || document; var div = doc.createElement('div'); div.innerHTML = html; if (!div.hasChildNodes() || div.childNodes.length > 1) { console.error('HTML does not have a single root node', html); throw new Error('HTML must have a single root node'); } return fromDom(div.childNodes[0]); }; var fromTag = function (tag, scope) { var doc = scope || document; var node = doc.createElement(tag); return fromDom(node); }; var fromText = function (text, scope) { var doc = scope || document; var node = doc.createTextNode(text); return fromDom(node); }; var fromDom = function (node) { if (node === null || node === undefined) { throw new Error('Node cannot be null or undefined'); } return { dom: node }; }; var fromPoint = function (docElm, x, y) { return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); }; var SugarElement = { fromHtml: fromHtml, fromTag: fromTag, fromText: fromText, fromDom: fromDom, fromPoint: fromPoint }; var Global = typeof window !== 'undefined' ? window : Function('return this;')(); var DOCUMENT = 9; var DOCUMENT_FRAGMENT = 11; var TEXT = 3; var type = function (element) { return element.dom.nodeType; }; var isType = function (t) { return function (element) { return type(element) === t; }; }; var isText = isType(TEXT); var isDocument = isType(DOCUMENT); var isDocumentFragment = isType(DOCUMENT_FRAGMENT); var owner = function (element) { return SugarElement.fromDom(element.dom.ownerDocument); }; var documentOrOwner = function (dos) { return isDocument(dos) ? dos : owner(dos); }; var isShadowRoot = function (dos) { return isDocumentFragment(dos) && isNonNullable(dos.dom.host); }; var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); var getRootNode = supported ? function (e) { return SugarElement.fromDom(e.dom.getRootNode()); } : documentOrOwner; var getShadowRoot = function (e) { var r = getRootNode(e); return isShadowRoot(r) ? Optional.some(r) : Optional.none(); }; var getShadowHost = function (e) { return SugarElement.fromDom(e.dom.host); }; var inBody = function (element) { var dom = isText(element) ? element.dom.parentNode : element.dom; if (dom === undefined || dom === null || dom.ownerDocument === null) { return false; } var doc = dom.ownerDocument; return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { return doc.body.contains(dom); }, compose1(inBody, getShadowHost)); }; var get = function (element, property) { var dom = element.dom; var styles = window.getComputedStyle(dom); var r = styles.getPropertyValue(property); return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; }; var getUnsafeProperty = function (dom, property) { return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; }; var getDirection = function (element) { return get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; }; var getNodeChangeHandler = function (editor, dir) { return function (api) { var nodeChangeHandler = function (e) { var element = SugarElement.fromDom(e.element); api.setActive(getDirection(element) === dir); }; editor.on('NodeChange', nodeChangeHandler); return function () { return editor.off('NodeChange', nodeChangeHandler); }; }; }; var register$1 = function (editor) { editor.ui.registry.addToggleButton('ltr', { tooltip: 'Left to right', icon: 'ltr', onAction: function () { return editor.execCommand('mceDirectionLTR'); }, onSetup: getNodeChangeHandler(editor, 'ltr') }); editor.ui.registry.addToggleButton('rtl', { tooltip: 'Right to left', icon: 'rtl', onAction: function () { return editor.execCommand('mceDirectionRTL'); }, onSetup: getNodeChangeHandler(editor, 'rtl') }); }; function Plugin () { global.add('directionality', function (editor) { register(editor); register$1(editor); }); } Plugin(); }());
{ "content_hash": "20709767193f2d674c4cf8362f4a4f9e", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 105, "avg_line_length": 27.86581469648562, "alnum_prop": 0.5400137583123137, "repo_name": "Laravel-Backpack/crud", "id": "36b6fbe7000300afd90d225c2c6454ab124160d6", "size": "9005", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "src/public/packages/tinymce/plugins/directionality/plugin.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "96093" }, { "name": "HTML", "bytes": "73244" }, { "name": "JavaScript", "bytes": "740565" }, { "name": "PHP", "bytes": "155920" }, { "name": "Shell", "bytes": "1490" } ], "symlink_target": "" }
/* Generated SBE (Simple Binary Encoding) message codec */ package io.rsocket.aeron.internal.reactivestreams.messages; import org.agrona.MutableDirectBuffer; import org.agrona.DirectBuffer; @javax.annotation.Generated(value = {"io.rsocket.aeron.internal.reactivestreams.messages.ConnectDecoder"}) @SuppressWarnings("all") public class ConnectDecoder { public static final int BLOCK_LENGTH = 20; public static final int TEMPLATE_ID = 1; public static final int SCHEMA_ID = 1; public static final int SCHEMA_VERSION = 0; private final ConnectDecoder parentMessage = this; private DirectBuffer buffer; protected int offset; protected int limit; protected int actingBlockLength; protected int actingVersion; public int sbeBlockLength() { return BLOCK_LENGTH; } public int sbeTemplateId() { return TEMPLATE_ID; } public int sbeSchemaId() { return SCHEMA_ID; } public int sbeSchemaVersion() { return SCHEMA_VERSION; } public String sbeSemanticType() { return ""; } public int offset() { return offset; } public ConnectDecoder wrap( final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) { this.buffer = buffer; this.offset = offset; this.actingBlockLength = actingBlockLength; this.actingVersion = actingVersion; limit(offset + actingBlockLength); return this; } public int encodedLength() { return limit - offset; } public int limit() { return limit; } public void limit(final int limit) { this.limit = limit; } public static int channelIdId() { return 1; } public static String channelIdMetaAttribute(final MetaAttribute metaAttribute) { switch (metaAttribute) { case EPOCH: return "unix"; case TIME_UNIT: return "nanosecond"; case SEMANTIC_TYPE: return ""; } return ""; } public static long channelIdNullValue() { return -9223372036854775808L; } public static long channelIdMinValue() { return -9223372036854775807L; } public static long channelIdMaxValue() { return 9223372036854775807L; } public long channelId() { return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); } public static int sendingStreamIdId() { return 2; } public static String sendingStreamIdMetaAttribute(final MetaAttribute metaAttribute) { switch (metaAttribute) { case EPOCH: return "unix"; case TIME_UNIT: return "nanosecond"; case SEMANTIC_TYPE: return ""; } return ""; } public static int sendingStreamIdNullValue() { return -2147483648; } public static int sendingStreamIdMinValue() { return -2147483647; } public static int sendingStreamIdMaxValue() { return 2147483647; } public int sendingStreamId() { return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); } public static int receivingStreamIdId() { return 3; } public static String receivingStreamIdMetaAttribute(final MetaAttribute metaAttribute) { switch (metaAttribute) { case EPOCH: return "unix"; case TIME_UNIT: return "nanosecond"; case SEMANTIC_TYPE: return ""; } return ""; } public static int receivingStreamIdNullValue() { return -2147483648; } public static int receivingStreamIdMinValue() { return -2147483647; } public static int receivingStreamIdMaxValue() { return 2147483647; } public int receivingStreamId() { return buffer.getInt(offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN); } public static int clientSessionIdId() { return 4; } public static String clientSessionIdMetaAttribute(final MetaAttribute metaAttribute) { switch (metaAttribute) { case EPOCH: return "unix"; case TIME_UNIT: return "nanosecond"; case SEMANTIC_TYPE: return ""; } return ""; } public static int clientSessionIdNullValue() { return -2147483648; } public static int clientSessionIdMinValue() { return -2147483647; } public static int clientSessionIdMaxValue() { return 2147483647; } public int clientSessionId() { return buffer.getInt(offset + 16, java.nio.ByteOrder.LITTLE_ENDIAN); } public static int sendingChannelId() { return 5; } public static String sendingChannelCharacterEncoding() { return "UTF-8"; } public static String sendingChannelMetaAttribute(final MetaAttribute metaAttribute) { switch (metaAttribute) { case EPOCH: return "unix"; case TIME_UNIT: return "nanosecond"; case SEMANTIC_TYPE: return ""; } return ""; } public static int sendingChannelHeaderLength() { return 4; } public int sendingChannelLength() { final int limit = parentMessage.limit(); return (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); } public int getSendingChannel(final MutableDirectBuffer dst, final int dstOffset, final int length) { final int headerLength = 4; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; } public int getSendingChannel(final byte[] dst, final int dstOffset, final int length) { final int headerLength = 4; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; } public String sendingChannel() { final int headerLength = 4; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); parentMessage.limit(limit + headerLength + dataLength); final byte[] tmp = new byte[dataLength]; buffer.getBytes(limit + headerLength, tmp, 0, dataLength); final String value; try { value = new String(tmp, "UTF-8"); } catch (final java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } return value; } public static int receivingChannelId() { return 6; } public static String receivingChannelCharacterEncoding() { return "UTF-8"; } public static String receivingChannelMetaAttribute(final MetaAttribute metaAttribute) { switch (metaAttribute) { case EPOCH: return "unix"; case TIME_UNIT: return "nanosecond"; case SEMANTIC_TYPE: return ""; } return ""; } public static int receivingChannelHeaderLength() { return 4; } public int receivingChannelLength() { final int limit = parentMessage.limit(); return (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); } public int getReceivingChannel(final MutableDirectBuffer dst, final int dstOffset, final int length) { final int headerLength = 4; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; } public int getReceivingChannel(final byte[] dst, final int dstOffset, final int length) { final int headerLength = 4; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; } public String receivingChannel() { final int headerLength = 4; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); parentMessage.limit(limit + headerLength + dataLength); final byte[] tmp = new byte[dataLength]; buffer.getBytes(limit + headerLength, tmp, 0, dataLength); final String value; try { value = new String(tmp, "UTF-8"); } catch (final java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } return value; } public static int clientManagementChannelId() { return 6; } public static String clientManagementChannelCharacterEncoding() { return "UTF-8"; } public static String clientManagementChannelMetaAttribute(final MetaAttribute metaAttribute) { switch (metaAttribute) { case EPOCH: return "unix"; case TIME_UNIT: return "nanosecond"; case SEMANTIC_TYPE: return ""; } return ""; } public static int clientManagementChannelHeaderLength() { return 4; } public int clientManagementChannelLength() { final int limit = parentMessage.limit(); return (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); } public int getClientManagementChannel(final MutableDirectBuffer dst, final int dstOffset, final int length) { final int headerLength = 4; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; } public int getClientManagementChannel(final byte[] dst, final int dstOffset, final int length) { final int headerLength = 4; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); final int bytesCopied = Math.min(length, dataLength); parentMessage.limit(limit + headerLength + dataLength); buffer.getBytes(limit + headerLength, dst, dstOffset, bytesCopied); return bytesCopied; } public String clientManagementChannel() { final int headerLength = 4; final int limit = parentMessage.limit(); final int dataLength = (int)(buffer.getInt(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); parentMessage.limit(limit + headerLength + dataLength); final byte[] tmp = new byte[dataLength]; buffer.getBytes(limit + headerLength, tmp, 0, dataLength); final String value; try { value = new String(tmp, "UTF-8"); } catch (final java.io.UnsupportedEncodingException ex) { throw new RuntimeException(ex); } return value; } public String toString() { return appendTo(new StringBuilder(100)).toString(); } public StringBuilder appendTo(final StringBuilder builder) { final int originalLimit = limit(); limit(offset + actingBlockLength); builder.append("[Connect](sbeTemplateId="); builder.append(TEMPLATE_ID); builder.append("|sbeSchemaId="); builder.append(SCHEMA_ID); builder.append("|sbeSchemaVersion="); if (actingVersion != SCHEMA_VERSION) { builder.append(actingVersion); builder.append('/'); } builder.append(SCHEMA_VERSION); builder.append("|sbeBlockLength="); if (actingBlockLength != BLOCK_LENGTH) { builder.append(actingBlockLength); builder.append('/'); } builder.append(BLOCK_LENGTH); builder.append("):"); //Token{signal=BEGIN_FIELD, name='channelId', description='The AeronChannel id', id=1, version=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} //Token{signal=ENCODING, name='int64', description='The AeronChannel id', id=-1, version=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} builder.append("channelId="); builder.append(channelId()); builder.append('|'); //Token{signal=BEGIN_FIELD, name='sendingStreamId', description='The stream id the connecting client will send traffic on', id=2, version=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} //Token{signal=ENCODING, name='int32', description='The stream id the connecting client will send traffic on', id=-1, version=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} builder.append("sendingStreamId="); builder.append(sendingStreamId()); builder.append('|'); //Token{signal=BEGIN_FIELD, name='receivingStreamId', description='The stream id the connecting client will receive data on', id=3, version=0, encodedLength=0, offset=12, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} //Token{signal=ENCODING, name='int32', description='The stream id the connecting client will receive data on', id=-1, version=0, encodedLength=4, offset=12, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} builder.append("receivingStreamId="); builder.append(receivingStreamId()); builder.append('|'); //Token{signal=BEGIN_FIELD, name='clientSessionId', description='The session id for the client publication', id=4, version=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} //Token{signal=ENCODING, name='int32', description='The session id for the client publication', id=-1, version=0, encodedLength=4, offset=16, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} builder.append("clientSessionId="); builder.append(clientSessionId()); builder.append('|'); //Token{signal=BEGIN_VAR_DATA, name='sendingChannel', description='The Aeron channel the client will send data on', id=5, version=0, encodedLength=0, offset=20, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} builder.append("sendingChannel="); builder.append(sendingChannel()); builder.append('|'); //Token{signal=BEGIN_VAR_DATA, name='receivingChannel', description='The Aeron channel the client will receive data on', id=6, version=0, encodedLength=0, offset=-1, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} builder.append("receivingChannel="); builder.append(receivingChannel()); builder.append('|'); //Token{signal=BEGIN_VAR_DATA, name='clientManagementChannel', description='The channel the client listens for management data on', id=6, version=0, encodedLength=0, offset=-1, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='null'}} builder.append("clientManagementChannel="); builder.append(clientManagementChannel()); limit(originalLimit); return builder; } }
{ "content_hash": "79d45c237394ab2d67b95aaa5a470133", "timestamp": "", "source": "github", "line_count": 535, "max_line_length": 435, "avg_line_length": 34.98317757009346, "alnum_prop": 0.6584740329130156, "repo_name": "somasun/reactivesocket-java", "id": "ce91d33a9c1eae0388d8c197630f3e3de26d0f59", "size": "19308", "binary": false, "copies": "1", "ref": "refs/heads/1.0.x", "path": "rsocket-transport-aeron/src/main/java/io/rsocket/aeron/internal/reactivestreams/messages/ConnectDecoder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "756218" }, { "name": "Shell", "bytes": "1355" } ], "symlink_target": "" }
"use strict"; const { expect } = require("chai"); const { show, SourcePos, ErrorMessageType, ErrorMessage, StrictParseError, Config, State, Result, } = $core; const { LanguageDef } = $language; const { makeTokenParser } = $token; describe("colon", () => { it("should be a parser that parsea a colon", () => { const def = LanguageDef.create({}); const { colon } = makeTokenParser(def); expect(colon).to.be.a.parser; // csucc { const initState = new State( new Config({ tabWidth: 8 }), ": ABC", new SourcePos("main", 1, 1), "none" ); const res = colon.run(initState); expect(res).to.be.an.equalResultTo(Result.csucc( new StrictParseError( new SourcePos("main", 1, 3), [ ErrorMessage.create(ErrorMessageType.SYSTEM_UNEXPECT, show("A")), ErrorMessage.create(ErrorMessageType.EXPECT, ""), ] ), ":", new State( new Config({ tabWidth: 8 }), "ABC", new SourcePos("main", 1, 3), "none" ) )); } { const initState = new State( new Config({ tabWidth: 8 }), ":ABC", new SourcePos("main", 1, 1), "none" ); const res = colon.run(initState); expect(res).to.be.an.equalResultTo(Result.csucc( new StrictParseError( new SourcePos("main", 1, 2), [ ErrorMessage.create(ErrorMessageType.SYSTEM_UNEXPECT, show("A")), ErrorMessage.create(ErrorMessageType.EXPECT, ""), ] ), ":", new State( new Config({ tabWidth: 8 }), "ABC", new SourcePos("main", 1, 2), "none" ) )); } // efail { const initState = new State( new Config({ tabWidth: 8 }), "ABC", new SourcePos("main", 1, 1), "none" ); const res = colon.run(initState); expect(res).to.be.an.equalResultTo(Result.efail( new StrictParseError( new SourcePos("main", 1, 1), [ ErrorMessage.create(ErrorMessageType.SYSTEM_UNEXPECT, show("A")), ErrorMessage.create(ErrorMessageType.EXPECT, show(":")), ] ) )); } }); });
{ "content_hash": "7ac2f44272a20328b9a8a0e02f565af5", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 77, "avg_line_length": 24.51578947368421, "alnum_prop": 0.5053671103477888, "repo_name": "susisu/Loquat", "id": "2f4de55102d0a7430f53283fbca919b5365ff4af", "size": "2329", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/token/test/token/makeTokenParser/colon.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1992184" } ], "symlink_target": "" }
<!DOCTYPE html> <html class="mdc-typography"> <head> <title>Game News</title> <link rel="stylesheet" href="node_modules/material-components-web/dist/material-components-web.css"> <link rel="stylesheet" type="text/css" href="header.css"> <link rel="stylesheet" type="text/css" href="gerenciarUsuarios.css"> </head> <body onload="preencherTable()"> <header id="cabecalho"> <h2 id="logo" class="mdc-typography--display2">Game News</h2> <table id="tableMainMenu" class="button-main-menu"> <tr> <td> <button class="mdc-button button-main-menu">Inicio</button> </td> <td> <button id="bNewPost" class="mdc-button button-main-menu">Novo&nbspPost </button> </td> <td> <a href="criacaoConta.html"><button id="signUp" class="mdc-button button-main-menu">Criar&nbspconta </button></a> </td> <td id="tdMainMenuMidCell"> </td> <td> <div class="mdc-form-field mdc-form-field--align-end"> <div class="mdc-textfield" data-demo-no-auto-js> <input type="text" class="mdc-textfield__input" id="txtLogin" placeholder="exemplo@furb.br"> </div> <label for="css-only-textfield">Email:</label> </div> </td> <td> <div class="mdc-form-field mdc-form-field--align-end"> <div class="mdc-textfield" data-demo-no-auto-js> <input type="password" class="mdc-textfield__input" id="txtSenha" placeholder="Senha"> </div> <label for="css-only-textfield">Senha:</label> </div> </td> <td> <button class="mdc-button login-button-main-menu" onclick="logar(txtLogin.value, txtSenha.value)">Login </button> </td> </tr> </table> </header> <section class="fundo" id="GerenciamentoUser"> <div id="separator"> </div> <div id="tabela"> <table id="TableContend"> <tr> <th>Nome</th> <th>Email</th> <th>Senha</th> <th>Cargo</th> <th>Mudar Cargo</th> </tr> </table> </div> </section> <script src="node_modules/material-components-web/dist/material-components-web.js"></script> <script>mdc.autoInit()</script> <script> function logar(login, senha){ if(login && senha){ var jsonUser; jsonUser = procuraConta(login); if(jsonUser){ alert("login efetuado com sucesso"); }else{ alert("login ou senha não encontrado"); } }else{ alert("preencha todos os campos"); } } function loadUser(){ var json, objUser; json = localStorage.getItem("testJSON"); objUser = JSON.parse(json); return objUser; } function procuraConta(login){ var i, objLoad, result; objLoad = loadUser(); for(i=0; i<objLoad.user.length;i++){ if(login == objLoad.user[i].email){ result = objLoad.user[i]; return result; } } return result; } function preencherTable(){ var objUser, table, tr, td, cell; objUser = loadUser(); if(objUser){ table = document.getElementById("TableContend"); for(var i = 0;i<objUser.user.length; i++){ tr = document.createElement("TR"); document.getElementById("TableContend").appendChild(tr); td = document.createElement("TD"); cell = document.createTextNode(objUser.user[i].nome); td.appendChild(cell); document.getElementById("TableContend").appendChild(td); td = document.createElement("TD"); cell = document.createTextNode(objUser.user[i].email); td.appendChild(cell); document.getElementById("TableContend").appendChild(td); td = document.createElement("TD"); cell = document.createTextNode(objUser.user[i].senha); td.appendChild(cell); document.getElementById("TableContend").appendChild(td); td = document.createElement("TD"); cell = document.createTextNode(objUser.user[i].cargo); td.appendChild(cell); document.getElementById("TableContend").appendChild(td); td = document.createElement("TD"); cell = document.createElement("button"); cell.setAttribute("class", "mdc-button button-main-menu"); cell.setAttribute("onclick", "transformaAdm("+i+")"); var text = document.createTextNode("Transformar em ADM"); cell.appendChild(text); td.appendChild(cell); document.getElementById("TableContend").appendChild(td); } }else{ document.getElementById("tabela").innerHTML += '<p>Não existe usuarios cadastrados</p>'; } } function preencheTabela(){ var objUser; objUser = loadUser(); if(objUser){ var table; table="<table><tr>"+ "<th>Nome</th>"+ "<th>Email</th>"+ "<th>Senha</th>"+ "<th>Cargo</th>"+ "<th>Mudar Cargo</th>"+ "</tr>"; for(var i = 0;i<objUser.user.length; i++){ table += "<tr>"+ "<td>"+ objUser.user[i].nome+ "</td>"+ "<td>"+ objUser.user[i].email+ "</td>"+ "<td>"+ objUser.user[i].senha+ "</td>"+ "<td>"+ objUser.user[i].cargo+ "</td>"+ "<td>"+ "<button class='mdc-button button-main-menu' onclick='transformaAdm("+i+")>Transforma&nbspADM</button>"+ "</td>"+ "</tr>"; } document.getElementById("tabela").innerHTML = table+"</table>"; }else{ document.getElementById("tabela").innerHTML += '<p>Não existe usuarios cadastrados</p>'; } } function transformaAdm(id){ var objUser; objUser = loadUser(); objUser.user[id].cargo = "admin"; localStorage.setItem("testJSON", objUser); alert("transformado em admin com sucesso"); } </script> </body> </html>
{ "content_hash": "425b3f6703ff52162138dcd4a259c912", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 118, "avg_line_length": 27.91919191919192, "alnum_prop": 0.6154124457308249, "repo_name": "drmartini7/programacaoIII", "id": "3428cf2e4058f57c28e900a8521c36c6e713f2fa", "size": "5531", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "htmls/gerenciarUsuarios.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "39462" }, { "name": "HTML", "bytes": "103561" }, { "name": "Java", "bytes": "22031" }, { "name": "JavaScript", "bytes": "28611" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "b4c33f11d644680f2d7d857430d330a2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "89b9416259b3b12648008895245bc34fb564d108", "size": "197", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Pseudosclerochloa/Pseudosclerochloa rupestris/ Syn. Sclerochloa procumbens/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.smart.smartchart.utils; import android.content.Context; import android.widget.Toast; /** * Created by Gs on 2016/5/25. */ public class ToastHelper { /** * 短时间显示Toast * * @param mContext * @param msg */ public static void shortToast(Context mContext, String msg) { showToast(mContext, msg, Toast.LENGTH_SHORT); } /** * 短时间显示Toast * * @param mContext * @param msgResId */ public static void shortToast(Context mContext, int msgResId) { showToast(mContext, msgResId, Toast.LENGTH_SHORT); } /** * 长时间显示Toast * * @param mContext * @param msg */ public static void longToast(Context mContext, String msg) { showToast(mContext, msg, Toast.LENGTH_LONG); } /** * 长时间显示Toast * * @param mContext * @param msgResId */ public static void longToast(Context mContext, int msgResId) { showToast(mContext, msgResId, Toast.LENGTH_LONG); } /** * 自定义显示Toast时间 * * @param mContext * @param msg * @param duration */ public static void showToast(Context mContext, String msg, int duration) { Toast.makeText(mContext, msg, duration).show(); } /** * 自定义显示Toast时间 * * @param mContext * @param msgResId * @param duration */ public static void showToast(Context mContext, int msgResId, int duration) { Toast.makeText(mContext, msgResId, duration).show(); } //*****************WITH GRAVITY************************// public static void showToastWithGravity(Context ctx, int resID, int gravity) { showToastWithGravity(ctx, Toast.LENGTH_SHORT, resID, gravity); } public static void showToastWithGravity(Context ctx, String text, int gravity) { showToastWithGravity(ctx, Toast.LENGTH_SHORT, text, gravity); } public static void showToastWithGravity(Context ctx, int duration, int resID, int gravity) { showToastWithGravity(ctx, duration, ctx.getString(resID), gravity); } public static void showToastWithGravity(Context ctx, int duration, String text, int gravity) { Toast toast = Toast.makeText(ctx, text, duration); toast.setGravity(gravity, 0, 250); toast.show(); } }
{ "content_hash": "c6680c40362a30fa02109be47e53dba9", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 98, "avg_line_length": 25.315217391304348, "alnum_prop": 0.61356805495921, "repo_name": "huashengzzz/SmartChart", "id": "416a244f9d019d7441d25a6300e10ca9b79235f3", "size": "2397", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/smart/smartchart/utils/ToastHelper.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1066559" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>mathcomp-fingroup: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.9.1 / mathcomp-fingroup - 1.6.4</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> mathcomp-fingroup <small> 1.6.4 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-05 13:07:18 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-05 13:07:18 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.9.1 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.04.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.04.2 Official 4.04.2 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; name: &quot;coq-mathcomp-fingroup&quot; version: &quot;1.6.4&quot; maintainer: &quot;Mathematical Components &lt;mathcomp-dev@sympa.inria.fr&gt;&quot; homepage: &quot;http://math-comp.github.io/math-comp/&quot; bug-reports: &quot;Mathematical Components &lt;mathcomp-dev@sympa.inria.fr&gt;&quot; license: &quot;CeCILL-B&quot; build: [ make &quot;-C&quot; &quot;mathcomp/fingroup&quot; &quot;-j&quot; &quot;%{jobs}%&quot; ] install: [ make &quot;-C&quot; &quot;mathcomp/fingroup&quot; &quot;install&quot; ] remove: [ &quot;sh&quot; &quot;-c&quot; &quot;rm -rf &#39;%{lib}%/coq/user-contrib/mathcomp/fingroup&#39;&quot; ] depends: [ &quot;ocaml&quot; &quot;coq-mathcomp-ssreflect&quot; {= &quot;1.6.4&quot;} ] tags: [ &quot;keyword:finite groups&quot; &quot;keyword:small scale reflection&quot; &quot;keyword:mathematical components&quot; &quot;keyword:odd order theorem&quot; ] authors: [ &quot;Jeremy Avigad &lt;&gt;&quot; &quot;Andrea Asperti &lt;&gt;&quot; &quot;Stephane Le Roux &lt;&gt;&quot; &quot;Yves Bertot &lt;&gt;&quot; &quot;Laurence Rideau &lt;&gt;&quot; &quot;Enrico Tassi &lt;&gt;&quot; &quot;Ioana Pasca &lt;&gt;&quot; &quot;Georges Gonthier &lt;&gt;&quot; &quot;Sidi Ould Biha &lt;&gt;&quot; &quot;Cyril Cohen &lt;&gt;&quot; &quot;Francois Garillot &lt;&gt;&quot; &quot;Alexey Solovyev &lt;&gt;&quot; &quot;Russell O&#39;Connor &lt;&gt;&quot; &quot;Laurent Théry &lt;&gt;&quot; &quot;Assia Mahboubi &lt;&gt;&quot; ] synopsis: &quot;Mathematical Components Library on finite groups&quot; description: &quot;&quot;&quot; This library contains definitions and theorems about finite groups, group quotients, group morphisms, group presentation, group action...&quot;&quot;&quot; url { src: &quot;http://github.com/math-comp/math-comp/archive/mathcomp-1.6.4.tar.gz&quot; checksum: &quot;md5=29362a734d183301e2ce839b0ad14bd9&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-mathcomp-fingroup.1.6.4 coq.8.9.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.9.1). The following dependencies couldn&#39;t be met: - coq-mathcomp-fingroup -&gt; coq-mathcomp-ssreflect = 1.6.4 -&gt; coq &lt; 8.8~ -&gt; ocaml &lt; 4.03.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mathcomp-fingroup.1.6.4</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "a76affe72f6de569d83d38add290446b", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 554, "avg_line_length": 46.706586826347305, "alnum_prop": 0.5605128205128205, "repo_name": "coq-bench/coq-bench.github.io", "id": "fba8e4921e901f251507e5bc05ff07f23430b326", "size": "7826", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.04.2-2.0.5/released/8.9.1/mathcomp-fingroup/1.6.4.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
#include "Shader.h" /** Given a shader program, validateProgram will request from OpenGL, any information related to the validation or linking of the program with it's attached shaders. It will then output any issues that have occurred. */ static void validateProgram(GLuint program) { const unsigned int BUFFER_SIZE = 512; char buffer[BUFFER_SIZE]; memset(buffer, 0, BUFFER_SIZE); GLsizei length = 0; glGetProgramInfoLog(program, BUFFER_SIZE, &length, buffer); // Ask OpenGL to give us the log associated with the program if (length > 0) // If we have any information to display std::cerr << "Program " << program << " link error: " << buffer << std::endl; // Output the information glValidateProgram(program); // Get OpenGL to try validating the program GLint status; glGetProgramiv(program, GL_VALIDATE_STATUS, &status); // Find out if the shader program validated correctly if (status == GL_FALSE) // If there was a problem validating std::cerr << "Error validating shader " << program << std::endl; // Output which program had the error } Shader::Shader() { //ctor } Shader::Shader(const std::string& vsFileName, const std::string& fsFileName){ inited = false; // Shader has not been initialized init(vsFileName, fsFileName); } void Shader::init(const std::string& vsFileName, const std::string& fsFileName){ if (inited) // If we have already initialized the shader return; inited = true; // Mark that we have initialized the shader hVertexShader.id = glCreateShader(GL_VERTEX_SHADER); // Create a vertex shader and assign id to our hVertexShader ID variable hFragmentShader.id = glCreateShader(GL_FRAGMENT_SHADER); // Create a fragment shader and assign id to our hVertexShader ID variable hVertexShader.source = readFile(vsFileName); // Read in our vertex shader hFragmentShader.source = readFile(fsFileName); // Read in our fragment shader if (hVertexShader.source.empty() || hFragmentShader.source.empty()) // Make sure the shader files are not empty { std::cerr << "Could not initialize the shaders." << std::endl; // Output error to debug terminal return; } const GLchar* tmp = static_cast<const GLchar*>(hVertexShader.source.c_str()); glShaderSource(hVertexShader.id, 1, (const GLchar**)&tmp, NULL); tmp = static_cast<const GLchar*>(hFragmentShader.source.c_str()); glShaderSource(hFragmentShader.id, 1, (const GLchar**)&tmp, NULL); if (!Shader::compileShader(hVertexShader) || !Shader::compileShader(hFragmentShader)) { std::cerr << "Shaders are invalid! Could not compile shaders." << std::endl; std::cerr << "Could not initialize shaders." << std::endl; return; } hShaderProgram = glCreateProgram(); glAttachShader(hShaderProgram, hVertexShader.id); glAttachShader(hShaderProgram, hFragmentShader.id); //Bind the attribute locations glBindAttribLocation(hShaderProgram, 0, "in_Position"); // Bind a constant attribute location for positions of vertices glBindAttribLocation(hShaderProgram, 1, "in_Color"); // Bind a constant attribute location for color glLinkProgram(hShaderProgram); validateProgram(hShaderProgram); } string Shader::readFile(const string& filename) { ifstream fileIn(filename.c_str()); if (!fileIn.good()) { std::cerr << "Could not load shader: " << filename << std::endl; return string(); } string stringBuffer(std::istreambuf_iterator<char>(fileIn), (std::istreambuf_iterator<char>())); return stringBuffer; } bool Shader::compileShader(const Shader::hShader& shader) { glCompileShader(shader.id); GLint result = GL_FALSE; glGetShaderiv(shader.id, GL_COMPILE_STATUS, &result); if (!result) { std::cout << "Could not compile shader: " << shader.id << std::endl; echoShaderLog(shader.id); return false; } return true; } void Shader::echoShaderLog(unsigned int shaderID) { vector<char> infoLog; GLint infoLen; glGetShaderiv(shaderID, GL_INFO_LOG_LENGTH, &infoLen); infoLog.resize(infoLen); std::cerr << "Shader contains errors!" << std::endl; glGetShaderInfoLog(shaderID, sizeof(infoLog), &infoLen, &infoLog[0]); std::cerr << string(infoLog.begin(), infoLog.end()) << std::endl; } GLuint Shader::id(){ return hShaderProgram; } void Shader::Bind(){ glUseProgram(hShaderProgram); //Enable our shader } void Shader::unbind(){ glUseProgram(0); } Shader::~Shader() { glDetachShader(hShaderProgram, hVertexShader.id); glDetachShader(hShaderProgram, hFragmentShader.id); glDeleteShader(hVertexShader.id); glDeleteShader(hFragmentShader.id); glDeleteProgram(hShaderProgram); }
{ "content_hash": "94b515ed35e5171453e3e45c18e79b8f", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 138, "avg_line_length": 32.26973684210526, "alnum_prop": 0.6770642201834862, "repo_name": "godvalve/Demo", "id": "735e0be89fc56e3da512c230edfd2592b2a3e6d1", "size": "4905", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Shader.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2315" }, { "name": "C++", "bytes": "62915" }, { "name": "GLSL", "bytes": "869" } ], "symlink_target": "" }
module ToolMountPoint class Agreements < Base EN_ID = 'agreements'.freeze CY_ID = 'agreements'.freeze end end
{ "content_hash": "5f70553d6f47fd01d7a19db1a21ee70f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 31, "avg_line_length": 20.333333333333332, "alnum_prop": 0.6967213114754098, "repo_name": "moneyadviceservice/frontend", "id": "5fdc96b2469dbe07e6092cd9fff2bf8937447705", "size": "122", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/tool_mount_point/agreements.rb", "mode": "33188", "license": "mit", "language": [ { "name": "API Blueprint", "bytes": "12181" }, { "name": "CoffeeScript", "bytes": "14933" }, { "name": "Gherkin", "bytes": "36711" }, { "name": "HTML", "bytes": "620089" }, { "name": "JavaScript", "bytes": "214705" }, { "name": "Procfile", "bytes": "64" }, { "name": "Ruby", "bytes": "824139" }, { "name": "SCSS", "bytes": "294401" }, { "name": "Shell", "bytes": "2615" } ], "symlink_target": "" }
/** * Created by Oleg Galaburda on 11.01.2015. * @exports aw.components.utils.ComponentScopeRegistry */ //TODO add Function.bind fallback with angular.bind for phantomjs /* * Component instance registry, holds all created component instances * and their scopes. Also, after adding new component will resolve its * connection to parent component. */ /** * @namespace aw.components */ aw.components = aw.components || {}; /** * @namespace aw.components.utils */ aw.components.utils = aw.components.utils || {}; function ComponentScopeRegistry() { /** * @type {ComponentScopeRegistry} */ var registry = this; /** * Component scope objects * @type {Object[]} * @private */ var scopes = []; /** * Component instances * @type {aw.components.Component[]} * @private */ var components = []; /** * Component interfaces * @type {aw.components.utils.ComponentInterface[]} * @private */ var interfaces = []; /** * @param {Object} $scope * @returns {aw.components.utils.ComponentInterface} * @private */ function getInterface($scope) { if ($scope.$$interface instanceof aw.components.utils.ComponentInterface) return $scope.$$interface; var index = scopes.indexOf($scope); var result; if (index >= 0) { result = interfaces[index]; } return result; } /** * Find parent component index in registry lists * @function * @param {Object} $scope * @returns {number} * @private */ function findParentIndex($scope) { var index = -1; var $child; var $current = $scope.$parent || $scope.$root; while ($current && $current != $child) { index = scopes.indexOf($current); if (index >= 0) break; else { $child = $current; $current = $child.$parent || $child.$root; } } return index; } //------------------------------------------------------------ Public /** * Add component instance to registry. This will be * automatically done while component initialization. * @function * @name aw.components.utils.ComponentScopeRegistry#add * @param {Object} $scope * @param {aw.components.Component} component * @param {aw.components.utils.ComponentInterface} componentInterface * @instance */ this.add = function ComponentScopeRegistry_add($scope, component, componentInterface) { if (!$scope || !component) return; scopes.push($scope); components.push(component); interfaces.push(componentInterface); $scope.$on('$destroy', function () { registry.remove(component); }); var parentIndex = findParentIndex($scope); if (parentIndex >= 0) { interfaces[parentIndex].addChild(component); componentInterface.setParent(parent); } }; /** * Find parent component. * @function * @name aw.components.utils.ComponentScopeRegistry#parent * @param {aw.components.Component|Object} componentOrScope * @returns {*} */ this.parent = function ComponentScopeRegistry_parent(componentOrScope) { var index = -1; if (componentOrScope instanceof aw.components.Component) { index = components.indexOf(componentOrScope); } else { index = scopes.indexOf(componentOrScope); } return index >= 0 ? interfaces[index].getParent() : null; }; /** * Remove component instance from registry. * @function * @name aw.components.utils.ComponentScopeRegistry#remove * @param {aw.components.Component} component * @instance */ this.remove = function ComponentScopeRegistry_remove(component) { var index = components.indexOf(component); var $scope = scopes[index]; /** * @type {aw.components.utils.ComponentInterface} */ var componentInterface = interfaces[index]; scopes.splice(index, 1); components.splice(index, 1); interfaces.splice(index, 1); var parent = this.parentByScope($scope); if (parent) { parent.$$removeChild(component); componentInterface.setParent(null); } } /** * @function * @name aw.components.utils.ComponentScopeRegistry#getScope * @param {aw.components.Component} component * @instance */ this.getScope = function ComponentScopeRegistry_getScope(component) { var index = components.indexOf(component); var result; if (index >= 0) { result = scopes[index]; } return result; }; /** * @function * @name aw.components.utils.ComponentScopeRegistry#get * @param {Object} $scope * @returns {aw.components.Component} */ this.get = function ComponentScopeRegistry_get($scope) { if ($scope.$$component instanceof aw.components.Component) return $scope.$$component; var index = scopes.indexOf($scope); var result; if (index >= 0) { result = components[index]; } return result; }; } aw.components.utils.ComponentScopeRegistry = new ComponentScopeRegistry();
{ "content_hash": "097b2f7715ffd7856ce7ec579dd92db4", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 104, "avg_line_length": 29.310344827586206, "alnum_prop": 0.6237254901960785, "repo_name": "burdiuz/angular-components-api", "id": "9f39caf31c590ad84263863b5f5d12e0cb4ceff1", "size": "5100", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/utils/componentregistry.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2863" }, { "name": "JavaScript", "bytes": "83846" } ], "symlink_target": "" }
package org.apache.karaf.tooling.exam.regression; import static junit.framework.Assert.assertTrue; import static org.apache.karaf.tooling.exam.options.KarafDistributionOption.karafDistributionConfiguration; import static org.ops4j.pax.exam.CoreOptions.maven; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.Configuration; import org.ops4j.pax.exam.junit.ExamReactorStrategy; import org.ops4j.pax.exam.junit.JUnit4TestRunner; import org.ops4j.pax.exam.options.extra.VMOption; import org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactorFactory; @RunWith(JUnit4TestRunner.class) @ExamReactorStrategy(AllConfinedStagedReactorFactory.class) public class VmSettingsTest { @Configuration public Option[] config() { return new Option[]{ karafDistributionConfiguration().frameworkUrl( maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip") .versionAsInProject()), new VMOption("-Xmx1024m"), new VMOption("-XX:MaxPermSize=56m") }; } @Test public void test() throws Exception { assertTrue(true); } }
{ "content_hash": "e56d3ae65f332e02cc16ec149ff319cc", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 109, "avg_line_length": 33.8, "alnum_prop": 0.7497886728655959, "repo_name": "soluvas/karaf", "id": "344ef43ad0e0e102596dddc7b7725c36f8388441", "size": "1985", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tooling/exam/regression/src/test/java/org/apache/karaf/tooling/exam/regression/VmSettingsTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2878953" }, { "name": "JavaScript", "bytes": "27869" }, { "name": "Shell", "bytes": "18728" }, { "name": "Visual Basic", "bytes": "4147" } ], "symlink_target": "" }
package net.bican.iplib; import java.util.Comparator; import com.google.common.collect.Range; class IPAddressRangeComparator implements Comparator<Range<IPAddress>> { private final static IPAddressRangeComparator instance = new IPAddressRangeComparator(); @Override public int compare(Range<IPAddress> o1, Range<IPAddress> o2) { if (o1.equals(o2)) { return 0; } Range<IPAddress> oo1 = IPAddresses.canonical(o1, o1.lowerEndpoint() .getDomain()); Range<IPAddress> oo2 = IPAddresses.canonical(o2, o2.lowerEndpoint() .getDomain()); return oo1.lowerEndpoint().compareTo(oo2.lowerEndpoint()); } private IPAddressRangeComparator() { // forbidden } public static Comparator<Range<IPAddress>> getComparator() { return instance; } }
{ "content_hash": "374d313d4a40e9491f16a506c3c1c4f1", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 90, "avg_line_length": 25.25, "alnum_prop": 0.7029702970297029, "repo_name": "canbican/jiplib", "id": "408f0920cbaa4429f1f34d9bded64bcd12637ed2", "size": "985", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/net/bican/iplib/IPAddressRangeComparator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "52368" } ], "symlink_target": "" }
use rustc_serialize::json; //use chrono::datetime::DateTime; //use chrono::offset::fixed::FixedOffset; #[derive(Debug)] pub struct EtcdNode { /// key: the HTTP path to which the request was made. etcd uses a file-system-like structure to represent the /// key-value pairs, therefore all keys start with /. pub key: String, /// createdIndex: an index is a unique, monotonically-incrementing integer created for each change to etcd. This /// specific index reflects the point in the etcd state member at which a given key was created.There are internal /// commands that also change the state behind the scenes, like adding and syncing servers. pub created_index: i64, /// modifiedIndex: like node.createdIndex, this attribute is also an etcd index. Actions that cause the value to /// change include set, delete, update, create, compareAndSwap and compareAndDelete. Since the get and watch /// commands do not change state in the store, they do not change the value of node.modifiedIndex. pub modified_index: i64, /// value: the value of the key after resolving the request. pub value: Option<String>, /// The expiration is the time at which this key will expire and be deleted. pub expiration: Option<String>, /// The ttl is the specified time to live for the key, in seconds. pub ttl: Option<i64>, /// this a directory pub dir: bool, // todo, should this be a map with the key derived from the path of the parent? /// the list of nodes in the directory pub nodes: Option<Vec<EtcdNode>>, } impl EtcdNode { pub fn from_json(obj: &json::Object) -> EtcdNode { return EtcdNode { key: obj.get("key").unwrap().as_string().unwrap().to_string(), created_index: obj.get("createdIndex").unwrap().as_i64().unwrap(), modified_index: obj.get("modifiedIndex").unwrap().as_i64().unwrap(), value: if let Some(j) = obj.get("value") { Some(j.as_string().unwrap().to_string()) } else { None }, expiration: if let Some(j) = obj.get("expiration") { Some(j.as_string().unwrap().to_string()) } else { None }, ttl: if let Some(j) = obj.get("ttl") { j.as_i64() } else { None }, dir: if let Some(j) = obj.get("dir") { j.as_boolean().unwrap() } else { false }, nodes: if let Some(j) = obj.get("nodes") { let arr: &Vec<json::Json> = j.as_array().unwrap(); let mut list: Vec<EtcdNode> = Vec::with_capacity(arr.len()); for n in arr { // these should be node list.push(EtcdNode::from_json(n.as_object().unwrap())); } Some(list) // the value } else { None }, } } } //// "20133-12-04T12:01:21.874888581-08:00" /*fn decode_tm_from_str<D: Decoder>(d: &mut D) -> Result<DateTime<FixedOffset>, D::Error> { let time_str = try!(d.read_str()); let parse_result = DateTime::parse_from_rfc3339(&time_str); println!("parse_result {:?}", parse_result); match parse_result { Ok(t) => return Ok(t), Err(e) => return Err(d.error(e.description())), } }*/ #[cfg(test)] mod tests { use rustc_serialize::json; use super::EtcdNode; static NODE_JSON: &'static str = "{ \"createdIndex\": 2, \"key\": \"/queue/2\", \"modifiedIndex\": 2, \"value\": \"Job1\" }"; static COMPLEX_NODE_JSON: &'static str = "{ \"createdIndex\": 2, \"dir\": true, \"key\": \"/queue\", \"modifiedIndex\": 2, \"nodes\": [ { \"createdIndex\": 2, \"key\": \"/queue/2\", \"modifiedIndex\": 2, \"value\": \"Job1\" }, { \"createdIndex\": 3, \"key\": \"/queue/3\", \"modifiedIndex\": 3, \"value\": \"Job2\" } ] }"; #[test] fn decode_node_json_test() { let json_tree = json::Json::from_str(NODE_JSON).unwrap(); let etcd_node = EtcdNode::from_json(json_tree.as_object().unwrap()); assert_eq!(&etcd_node.key as &str, "/queue/2"); assert_eq!(etcd_node.dir, false); assert_eq!(etcd_node.created_index, 2); assert_eq!(etcd_node.modified_index, 2); assert_eq!(&etcd_node.value.unwrap() as &str, "Job1"); } #[test] fn decode_complex_node_json_test() { let json_tree = json::Json::from_str(COMPLEX_NODE_JSON).unwrap(); let etcd_node = EtcdNode::from_json(json_tree.as_object().unwrap()); assert_eq!(&etcd_node.key as &str, "/queue"); assert_eq!(etcd_node.dir, true); assert_eq!(etcd_node.created_index, 2); assert_eq!(etcd_node.modified_index, 2); assert_eq!(etcd_node.value, None); let ref nodes = etcd_node.nodes.unwrap(); assert_eq!((&nodes[0]).created_index, 2); assert_eq!(&(&nodes[0]).key as &str, "/queue/2"); assert_eq!((&nodes[0]).modified_index, 2); assert_eq!((&nodes[0]).value.as_ref().unwrap() as &str, "Job1"); assert_eq!((&nodes[1]).created_index, 3); assert_eq!((&nodes[1]).key, "/queue/3".to_string()); assert_eq!((&nodes[1]).modified_index, 3); assert_eq!((&nodes[1]).value.as_ref().unwrap()as &str, "Job2"); } }
{ "content_hash": "b5fb8d9f9edb6a77bba55ff96c9d16ff", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 118, "avg_line_length": 35.84722222222222, "alnum_prop": 0.5925997675319643, "repo_name": "bluejekyll/etcd-rs", "id": "953145ced0a690f2c7c2f9c4e2ce687df4b68631", "size": "5162", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/etcd/etcd_node.rs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Rust", "bytes": "26248" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Sporastatia cinerea var. scandinavica H. Magn. ### Remarks null
{ "content_hash": "70a755e9b16446e6d7f4ff64ca397f29", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 46, "avg_line_length": 11.615384615384615, "alnum_prop": 0.7152317880794702, "repo_name": "mdoering/backbone", "id": "6db3df5d268bebf19dd191efe1b067f133a6ac6e", "size": "230", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Biatorellaceae/Biatorella/Biatorella cinerea/Biatorella cinerea scandinavica/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_45) on Thu Oct 02 16:39:53 BST 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Class com.hp.hpl.jena.sparql.modify.UpdateEngineWorker (Apache Jena ARQ)</title> <meta name="date" content="2014-10-02"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.hp.hpl.jena.sparql.modify.UpdateEngineWorker (Apache Jena ARQ)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../com/hp/hpl/jena/sparql/modify/UpdateEngineWorker.html" title="class in com.hp.hpl.jena.sparql.modify">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/hp/hpl/jena/sparql/modify/class-use/UpdateEngineWorker.html" target="_top">Frames</a></li> <li><a href="UpdateEngineWorker.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class com.hp.hpl.jena.sparql.modify.UpdateEngineWorker" class="title">Uses of Class<br>com.hp.hpl.jena.sparql.modify.UpdateEngineWorker</h2> </div> <div class="classUseContainer">No usage of com.hp.hpl.jena.sparql.modify.UpdateEngineWorker</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../com/hp/hpl/jena/sparql/modify/UpdateEngineWorker.html" title="class in com.hp.hpl.jena.sparql.modify">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?com/hp/hpl/jena/sparql/modify/class-use/UpdateEngineWorker.html" target="_top">Frames</a></li> <li><a href="UpdateEngineWorker.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Licenced under the Apache License, Version 2.0</small></p> </body> </html>
{ "content_hash": "4d59c7cd6a93cea0b96e09daaba4f392", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 159, "avg_line_length": 38.76068376068376, "alnum_prop": 0.6101433296582139, "repo_name": "renzoar/RDFExplorer", "id": "3b0aae87c924b5fc370a1b96cb9b7d5dab4bab62", "size": "4535", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/Jena/javadoc-arq/com/hp/hpl/jena/sparql/modify/class-use/UpdateEngineWorker.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "33417" }, { "name": "HTML", "bytes": "78226018" }, { "name": "Java", "bytes": "141759" } ], "symlink_target": "" }
package com.wemote.scorpio.modules.utils; import com.wemote.scorpio.modules.security.utils.Digests; import org.junit.Test; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import java.io.IOException; public class DigestsTest { @Test public void digestString() { String input = "user"; byte[] sha1Result = Digests.sha1(input.getBytes()); System.out.println("sha1 in hex result :" + Encodes.encodeHex(sha1Result)); byte[] salt = Digests.generateSalt(8); System.out.println("salt in hex :" + Encodes.encodeHex(salt)); sha1Result = Digests.sha1(input.getBytes(), salt); System.out.println("sha1 in hex result with salt :" + Encodes.encodeHex(sha1Result)); sha1Result = Digests.sha1(input.getBytes(), salt, 1024); System.out.println("sha1 in hex result with salt and 1024 interations:" + Encodes.encodeHex(sha1Result)); } @Test public void digestFile() throws IOException { Resource resource = new ClassPathResource("/logback.xml"); byte[] md5result = Digests.md5(resource.getInputStream()); byte[] sha1result = Digests.sha1(resource.getInputStream()); System.out.println("md5: " + Encodes.encodeHex(md5result)); System.out.println("sha1:" + Encodes.encodeHex(sha1result)); } }
{ "content_hash": "8927803f5e6a4604ea45e8ad53e32470", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 107, "avg_line_length": 37.55555555555556, "alnum_prop": 0.6937869822485208, "repo_name": "wemote/scorpio", "id": "a0b7ef7545120eb7acac3c8b088c13d8fca4a63e", "size": "1352", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scorpio-core/src/test/java/com/wemote/scorpio/modules/utils/DigestsTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "258891" } ], "symlink_target": "" }
$.formUtils.addValidator({ name : 'credit_card_number', validatorFunction : function(value, $el, config, language, $form) { return Stripe.card.validateCardNumber(value); }, errorMessage : 'Credit card number is incorrect', errorMessageKey : 'badCreditCardNumber' }); $.formUtils.addValidator({ name : 'credit_card_expiry', validatorFunction : function(value, $el, config, language, $form) { return Stripe.card.validateExpiry(value); }, errorMessage : 'Credit card expiration date is incorrect', errorMessageKey : 'badCreditCardEpiry' }); // Validate the form. If successful proceed to token creation $.validate({ form : '#dues-form', onSuccess : function() { // Create Stripe single use token $('#submit-btn').prop('disabled', true); Stripe.card.createToken({ name : $('#inputName').val(), number : $('#inputCardNum').val(), exp : $('#inputExpiration').val(), cvc : $('#inputCVC').val() }, stripeResponseHandler); // Prevent the form from submitting with the default action return false; } }); // Handle response from Stripe function stripeResponseHandler(status, response) { var $form = $('#dues-form'); if (response.error) { // Show the errors on the form $('#errors').text(response.error.message); $('#errors').show(); $('#submit-btn').prop('disabled', false); } else { // Response contains id and card, which contains additional card details var token = response.id; // Insert the token into the form so it gets submitted to the server $form.append($('<input type="hidden" name="stripeToken" />').val(token)); // Submit $form.get(0).submit(); } }
{ "content_hash": "382601cb2afe880babffb35dce55a241", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 75, "avg_line_length": 28.912280701754387, "alnum_prop": 0.6711165048543689, "repo_name": "bananana/iww-dues", "id": "fb805d556d3c673156d928875b7d4204018786cc", "size": "1669", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/form-validation.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "61" }, { "name": "CSS", "bytes": "336" }, { "name": "HTML", "bytes": "7054" }, { "name": "JavaScript", "bytes": "2553" }, { "name": "PHP", "bytes": "17503" } ], "symlink_target": "" }
module Tct.Trs.Data ( module M , TrsStrategy , TrsDeclaration ) where import Tct.Trs.Data.DependencyGraph as M (DependencyGraph, DG, CDG, NodeId) import Tct.Trs.Data.Problem as M (Problem, Trs) import Tct.Trs.Data.ProblemKind as M (StartTerms, Strategy) import Tct.Trs.Data.RuleSelector as M (ExpressionSelector, RuleSelector) import Tct.Trs.Data.RuleSet as M (RuleSet) import Tct.Trs.Data.Signature as M (Signature, Symbols) import Tct.Trs.Data.Symbol as M (F, V, Fun) import Tct.Trs.Data.Rules as M (Rules) import Tct.Trs.Data.ComplexityPair as M (IsComplexityPair, ComplexityPair, ComplexityPairProof) import Tct.Trs.Data.Precedence as M (Order, Precedence) import qualified Tct.Core.Data as T -- | Type synonym for Trs strategies. type TrsStrategy = T.Strategy Trs Trs -- | Type synonym for Trs declarations. type TrsDeclaration = T.StrategyDeclaration Trs Trs
{ "content_hash": "aa919fd083cda62bda198029aed476d3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 96, "avg_line_length": 36.19230769230769, "alnum_prop": 0.7215727948990436, "repo_name": "ComputationWithBoundedResources/tct-trs", "id": "b38b94f8b46f06f936a6a464270b95b90242290c", "size": "1024", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Tct/Trs/Data.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Haskell", "bytes": "487472" } ], "symlink_target": "" }
module.exports = { updateFightSkill: function(dbclient, val, cb) { var sql = 'update FightSkill set level = ? where id = ?'; var args = [val.level, val.id]; dbclient.query(sql, args, function(err, res) { if (err) { console.error('write mysql failed! ' + sql + ' ' + JSON.stringify(val)); } cb(!!err); }); } };
{ "content_hash": "df644ffd08f04aa5b5ec3f6403551c25", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 80, "avg_line_length": 25.571428571428573, "alnum_prop": 0.553072625698324, "repo_name": "py8765/lordofpomelo", "id": "93ad6cd8769e58ddf65c4703468833505b86aff4", "size": "360", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "game-server/app/dao/mapping/fightskillSync.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }