code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
/*! * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) */ /* FONT PATH * -------------------------- */ @font-face { font-family: 'FontAwesome'; src: url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'); font-weight: normal; font-style: normal; } .fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } /* makes the font 33% larger relative to the icon container */ .fa-lg { font-size: 1.33333333em; line-height: 0.75em; vertical-align: -15%; } .fa-2x { font-size: 2em; } .fa-3x { font-size: 3em; } .fa-4x { font-size: 4em; } .fa-5x { font-size: 5em; } .fa-fw { width: 1.28571429em; text-align: center; } .fa-ul { padding-left: 0; margin-left: 2.14285714em; list-style-type: none; } .fa-ul > li { position: relative; } .fa-li { position: absolute; left: -2.14285714em; width: 2.14285714em; top: 0.14285714em; text-align: center; } .fa-li.fa-lg { left: -1.85714286em; } .fa-border { padding: .2em .25em .15em; border: solid 0.08em #eeeeee; border-radius: .1em; } .fa-pull-left { float: left; } .fa-pull-right { float: right; } .fa.fa-pull-left { margin-right: .3em; } .fa.fa-pull-right { margin-left: .3em; } /* Deprecated as of 4.4.0 */ .pull-right { float: right; } .pull-left { float: left; } .fa.pull-left { margin-right: .3em; } .fa.pull-right { margin-left: .3em; } .fa-spin { -webkit-animation: fa-spin 2s infinite linear; animation: fa-spin 2s infinite linear; } .fa-pulse { -webkit-animation: fa-spin 1s infinite steps(8); animation: fa-spin 1s infinite steps(8); } @-webkit-keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } @keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } .fa-rotate-90 { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"; -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } .fa-rotate-180 { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } .fa-rotate-270 { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"; -webkit-transform: rotate(270deg); -ms-transform: rotate(270deg); transform: rotate(270deg); } .fa-flip-horizontal { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)"; -webkit-transform: scale(-1, 1); -ms-transform: scale(-1, 1); transform: scale(-1, 1); } .fa-flip-vertical { -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; -webkit-transform: scale(1, -1); -ms-transform: scale(1, -1); transform: scale(1, -1); } :root .fa-rotate-90, :root .fa-rotate-180, :root .fa-rotate-270, :root .fa-flip-horizontal, :root .fa-flip-vertical { filter: none; } .fa-stack { position: relative; display: inline-block; width: 2em; height: 2em; line-height: 2em; vertical-align: middle; } .fa-stack-1x, .fa-stack-2x { position: absolute; left: 0; width: 100%; text-align: center; } .fa-stack-1x { line-height: inherit; } .fa-stack-2x { font-size: 2em; } .fa-inverse { color: #ffffff; } /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons */ .fa-glass:before { content: "\f000"; } .fa-music:before { content: "\f001"; } .fa-search:before { content: "\f002"; } .fa-envelope-o:before { content: "\f003"; } .fa-heart:before { content: "\f004"; } .fa-star:before { content: "\f005"; } .fa-star-o:before { content: "\f006"; } .fa-user:before { content: "\f007"; } .fa-film:before { content: "\f008"; } .fa-th-large:before { content: "\f009"; } .fa-th:before { content: "\f00a"; } .fa-th-list:before { content: "\f00b"; } .fa-check:before { content: "\f00c"; } .fa-remove:before, .fa-close:before, .fa-times:before { content: "\f00d"; } .fa-search-plus:before { content: "\f00e"; } .fa-search-minus:before { content: "\f010"; } .fa-power-off:before { content: "\f011"; } .fa-signal:before { content: "\f012"; } .fa-gear:before, .fa-cog:before { content: "\f013"; } .fa-trash-o:before { content: "\f014"; } .fa-home:before { content: "\f015"; } .fa-file-o:before { content: "\f016"; } .fa-clock-o:before { content: "\f017"; } .fa-road:before { content: "\f018"; } .fa-download:before { content: "\f019"; } .fa-arrow-circle-o-down:before { content: "\f01a"; } .fa-arrow-circle-o-up:before { content: "\f01b"; } .fa-inbox:before { content: "\f01c"; } .fa-play-circle-o:before { content: "\f01d"; } .fa-rotate-right:before, .fa-repeat:before { content: "\f01e"; } .fa-refresh:before { content: "\f021"; } .fa-list-alt:before { content: "\f022"; } .fa-lock:before { content: "\f023"; } .fa-flag:before { content: "\f024"; } .fa-headphones:before { content: "\f025"; } .fa-volume-off:before { content: "\f026"; } .fa-volume-down:before { content: "\f027"; } .fa-volume-up:before { content: "\f028"; } .fa-qrcode:before { content: "\f029"; } .fa-barcode:before { content: "\f02a"; } .fa-tag:before { content: "\f02b"; } .fa-tags:before { content: "\f02c"; } .fa-book:before { content: "\f02d"; } .fa-bookmark:before { content: "\f02e"; } .fa-print:before { content: "\f02f"; } .fa-camera:before { content: "\f030"; } .fa-font:before { content: "\f031"; } .fa-bold:before { content: "\f032"; } .fa-italic:before { content: "\f033"; } .fa-text-height:before { content: "\f034"; } .fa-text-width:before { content: "\f035"; } .fa-align-left:before { content: "\f036"; } .fa-align-center:before { content: "\f037"; } .fa-align-right:before { content: "\f038"; } .fa-align-justify:before { content: "\f039"; } .fa-list:before { content: "\f03a"; } .fa-dedent:before, .fa-outdent:before { content: "\f03b"; } .fa-indent:before { content: "\f03c"; } .fa-video-camera:before { content: "\f03d"; } .fa-photo:before, .fa-image:before, .fa-picture-o:before { content: "\f03e"; } .fa-pencil:before { content: "\f040"; } .fa-map-marker:before { content: "\f041"; } .fa-adjust:before { content: "\f042"; } .fa-tint:before { content: "\f043"; } .fa-edit:before, .fa-pencil-square-o:before { content: "\f044"; } .fa-share-square-o:before { content: "\f045"; } .fa-check-square-o:before { content: "\f046"; } .fa-arrows:before { content: "\f047"; } .fa-step-backward:before { content: "\f048"; } .fa-fast-backward:before { content: "\f049"; } .fa-backward:before { content: "\f04a"; } .fa-play:before { content: "\f04b"; } .fa-pause:before { content: "\f04c"; } .fa-stop:before { content: "\f04d"; } .fa-forward:before { content: "\f04e"; } .fa-fast-forward:before { content: "\f050"; } .fa-step-forward:before { content: "\f051"; } .fa-eject:before { content: "\f052"; } .fa-chevron-left:before { content: "\f053"; } .fa-chevron-right:before { content: "\f054"; } .fa-plus-circle:before { content: "\f055"; } .fa-minus-circle:before { content: "\f056"; } .fa-times-circle:before { content: "\f057"; } .fa-check-circle:before { content: "\f058"; } .fa-question-circle:before { content: "\f059"; } .fa-info-circle:before { content: "\f05a"; } .fa-crosshairs:before { content: "\f05b"; } .fa-times-circle-o:before { content: "\f05c"; } .fa-check-circle-o:before { content: "\f05d"; } .fa-ban:before { content: "\f05e"; } .fa-arrow-left:before { content: "\f060"; } .fa-arrow-right:before { content: "\f061"; } .fa-arrow-up:before { content: "\f062"; } .fa-arrow-down:before { content: "\f063"; } .fa-mail-forward:before, .fa-share:before { content: "\f064"; } .fa-expand:before { content: "\f065"; } .fa-compress:before { content: "\f066"; } .fa-plus:before { content: "\f067"; } .fa-minus:before { content: "\f068"; } .fa-asterisk:before { content: "\f069"; } .fa-exclamation-circle:before { content: "\f06a"; } .fa-gift:before { content: "\f06b"; } .fa-leaf:before { content: "\f06c"; } .fa-fire:before { content: "\f06d"; } .fa-eye:before { content: "\f06e"; } .fa-eye-slash:before { content: "\f070"; } .fa-warning:before, .fa-exclamation-triangle:before { content: "\f071"; } .fa-plane:before { content: "\f072"; } .fa-calendar:before { content: "\f073"; } .fa-random:before { content: "\f074"; } .fa-comment:before { content: "\f075"; } .fa-magnet:before { content: "\f076"; } .fa-chevron-up:before { content: "\f077"; } .fa-chevron-down:before { content: "\f078"; } .fa-retweet:before { content: "\f079"; } .fa-shopping-cart:before { content: "\f07a"; } .fa-folder:before { content: "\f07b"; } .fa-folder-open:before { content: "\f07c"; } .fa-arrows-v:before { content: "\f07d"; } .fa-arrows-h:before { content: "\f07e"; } .fa-bar-chart-o:before, .fa-bar-chart:before { content: "\f080"; } .fa-twitter-square:before { content: "\f081"; } .fa-facebook-square:before { content: "\f082"; } .fa-camera-retro:before { content: "\f083"; } .fa-key:before { content: "\f084"; } .fa-gears:before, .fa-cogs:before { content: "\f085"; } .fa-comments:before { content: "\f086"; } .fa-thumbs-o-up:before { content: "\f087"; } .fa-thumbs-o-down:before { content: "\f088"; } .fa-star-half:before { content: "\f089"; } .fa-heart-o:before { content: "\f08a"; } .fa-sign-out:before { content: "\f08b"; } .fa-linkedin-square:before { content: "\f08c"; } .fa-thumb-tack:before { content: "\f08d"; } .fa-external-link:before { content: "\f08e"; } .fa-sign-in:before { content: "\f090"; } .fa-trophy:before { content: "\f091"; } .fa-github-square:before { content: "\f092"; } .fa-upload:before { content: "\f093"; } .fa-lemon-o:before { content: "\f094"; } .fa-phone:before { content: "\f095"; } .fa-square-o:before { content: "\f096"; } .fa-bookmark-o:before { content: "\f097"; } .fa-phone-square:before { content: "\f098"; } .fa-twitter:before { content: "\f099"; } .fa-facebook-f:before, .fa-facebook:before { content: "\f09a"; } .fa-github:before { content: "\f09b"; } .fa-unlock:before { content: "\f09c"; } .fa-credit-card:before { content: "\f09d"; } .fa-feed:before, .fa-rss:before { content: "\f09e"; } .fa-hdd-o:before { content: "\f0a0"; } .fa-bullhorn:before { content: "\f0a1"; } .fa-bell:before { content: "\f0f3"; } .fa-certificate:before { content: "\f0a3"; } .fa-hand-o-right:before { content: "\f0a4"; } .fa-hand-o-left:before { content: "\f0a5"; } .fa-hand-o-up:before { content: "\f0a6"; } .fa-hand-o-down:before { content: "\f0a7"; } .fa-arrow-circle-left:before { content: "\f0a8"; } .fa-arrow-circle-right:before { content: "\f0a9"; } .fa-arrow-circle-up:before { content: "\f0aa"; } .fa-arrow-circle-down:before { content: "\f0ab"; } .fa-globe:before { content: "\f0ac"; } .fa-wrench:before { content: "\f0ad"; } .fa-tasks:before { content: "\f0ae"; } .fa-filter:before { content: "\f0b0"; } .fa-briefcase:before { content: "\f0b1"; } .fa-arrows-alt:before { content: "\f0b2"; } .fa-group:before, .fa-users:before { content: "\f0c0"; } .fa-chain:before, .fa-link:before { content: "\f0c1"; } .fa-cloud:before { content: "\f0c2"; } .fa-flask:before { content: "\f0c3"; } .fa-cut:before, .fa-scissors:before { content: "\f0c4"; } .fa-copy:before, .fa-files-o:before { content: "\f0c5"; } .fa-paperclip:before { content: "\f0c6"; } .fa-save:before, .fa-floppy-o:before { content: "\f0c7"; } .fa-square:before { content: "\f0c8"; } .fa-navicon:before, .fa-reorder:before, .fa-bars:before { content: "\f0c9"; } .fa-list-ul:before { content: "\f0ca"; } .fa-list-ol:before { content: "\f0cb"; } .fa-strikethrough:before { content: "\f0cc"; } .fa-underline:before { content: "\f0cd"; } .fa-table:before { content: "\f0ce"; } .fa-magic:before { content: "\f0d0"; } .fa-truck:before { content: "\f0d1"; } .fa-pinterest:before { content: "\f0d2"; } .fa-pinterest-square:before { content: "\f0d3"; } .fa-google-plus-square:before { content: "\f0d4"; } .fa-google-plus:before { content: "\f0d5"; } .fa-money:before { content: "\f0d6"; } .fa-caret-down:before { content: "\f0d7"; } .fa-caret-up:before { content: "\f0d8"; } .fa-caret-left:before { content: "\f0d9"; } .fa-caret-right:before { content: "\f0da"; } .fa-columns:before { content: "\f0db"; } .fa-unsorted:before, .fa-sort:before { content: "\f0dc"; } .fa-sort-down:before, .fa-sort-desc:before { content: "\f0dd"; } .fa-sort-up:before, .fa-sort-asc:before { content: "\f0de"; } .fa-envelope:before { content: "\f0e0"; } .fa-linkedin:before { content: "\f0e1"; } .fa-rotate-left:before, .fa-undo:before { content: "\f0e2"; } .fa-legal:before, .fa-gavel:before { content: "\f0e3"; } .fa-dashboard:before, .fa-tachometer:before { content: "\f0e4"; } .fa-comment-o:before { content: "\f0e5"; } .fa-comments-o:before { content: "\f0e6"; } .fa-flash:before, .fa-bolt:before { content: "\f0e7"; } .fa-sitemap:before { content: "\f0e8"; } .fa-umbrella:before { content: "\f0e9"; } .fa-paste:before, .fa-clipboard:before { content: "\f0ea"; } .fa-lightbulb-o:before { content: "\f0eb"; } .fa-exchange:before { content: "\f0ec"; } .fa-cloud-download:before { content: "\f0ed"; } .fa-cloud-upload:before { content: "\f0ee"; } .fa-user-md:before { content: "\f0f0"; } .fa-stethoscope:before { content: "\f0f1"; } .fa-suitcase:before { content: "\f0f2"; } .fa-bell-o:before { content: "\f0a2"; } .fa-coffee:before { content: "\f0f4"; } .fa-cutlery:before { content: "\f0f5"; } .fa-file-text-o:before { content: "\f0f6"; } .fa-building-o:before { content: "\f0f7"; } .fa-hospital-o:before { content: "\f0f8"; } .fa-ambulance:before { content: "\f0f9"; } .fa-medkit:before { content: "\f0fa"; } .fa-fighter-jet:before { content: "\f0fb"; } .fa-beer:before { content: "\f0fc"; } .fa-h-square:before { content: "\f0fd"; } .fa-plus-square:before { content: "\f0fe"; } .fa-angle-double-left:before { content: "\f100"; } .fa-angle-double-right:before { content: "\f101"; } .fa-angle-double-up:before { content: "\f102"; } .fa-angle-double-down:before { content: "\f103"; } .fa-angle-left:before { content: "\f104"; } .fa-angle-right:before { content: "\f105"; } .fa-angle-up:before { content: "\f106"; } .fa-angle-down:before { content: "\f107"; } .fa-desktop:before { content: "\f108"; } .fa-laptop:before { content: "\f109"; } .fa-tablet:before { content: "\f10a"; } .fa-mobile-phone:before, .fa-mobile:before { content: "\f10b"; } .fa-circle-o:before { content: "\f10c"; } .fa-quote-left:before { content: "\f10d"; } .fa-quote-right:before { content: "\f10e"; } .fa-spinner:before { content: "\f110"; } .fa-circle:before { content: "\f111"; } .fa-mail-reply:before, .fa-reply:before { content: "\f112"; } .fa-github-alt:before { content: "\f113"; } .fa-folder-o:before { content: "\f114"; } .fa-folder-open-o:before { content: "\f115"; } .fa-smile-o:before { content: "\f118"; } .fa-frown-o:before { content: "\f119"; } .fa-meh-o:before { content: "\f11a"; } .fa-gamepad:before { content: "\f11b"; } .fa-keyboard-o:before { content: "\f11c"; } .fa-flag-o:before { content: "\f11d"; } .fa-flag-checkered:before { content: "\f11e"; } .fa-terminal:before { content: "\f120"; } .fa-code:before { content: "\f121"; } .fa-mail-reply-all:before, .fa-reply-all:before { content: "\f122"; } .fa-star-half-empty:before, .fa-star-half-full:before, .fa-star-half-o:before { content: "\f123"; } .fa-location-arrow:before { content: "\f124"; } .fa-crop:before { content: "\f125"; } .fa-code-fork:before { content: "\f126"; } .fa-unlink:before, .fa-chain-broken:before { content: "\f127"; } .fa-question:before { content: "\f128"; } .fa-info:before { content: "\f129"; } .fa-exclamation:before { content: "\f12a"; } .fa-superscript:before { content: "\f12b"; } .fa-subscript:before { content: "\f12c"; } .fa-eraser:before { content: "\f12d"; } .fa-puzzle-piece:before { content: "\f12e"; } .fa-microphone:before { content: "\f130"; } .fa-microphone-slash:before { content: "\f131"; } .fa-shield:before { content: "\f132"; } .fa-calendar-o:before { content: "\f133"; } .fa-fire-extinguisher:before { content: "\f134"; } .fa-rocket:before { content: "\f135"; } .fa-maxcdn:before { content: "\f136"; } .fa-chevron-circle-left:before { content: "\f137"; } .fa-chevron-circle-right:before { content: "\f138"; } .fa-chevron-circle-up:before { content: "\f139"; } .fa-chevron-circle-down:before { content: "\f13a"; } .fa-html5:before { content: "\f13b"; } .fa-css3:before { content: "\f13c"; } .fa-anchor:before { content: "\f13d"; } .fa-unlock-alt:before { content: "\f13e"; } .fa-bullseye:before { content: "\f140"; } .fa-ellipsis-h:before { content: "\f141"; } .fa-ellipsis-v:before { content: "\f142"; } .fa-rss-square:before { content: "\f143"; } .fa-play-circle:before { content: "\f144"; } .fa-ticket:before { content: "\f145"; } .fa-minus-square:before { content: "\f146"; } .fa-minus-square-o:before { content: "\f147"; } .fa-level-up:before { content: "\f148"; } .fa-level-down:before { content: "\f149"; } .fa-check-square:before { content: "\f14a"; } .fa-pencil-square:before { content: "\f14b"; } .fa-external-link-square:before { content: "\f14c"; } .fa-share-square:before { content: "\f14d"; } .fa-compass:before { content: "\f14e"; } .fa-toggle-down:before, .fa-caret-square-o-down:before { content: "\f150"; } .fa-toggle-up:before, .fa-caret-square-o-up:before { content: "\f151"; } .fa-toggle-right:before, .fa-caret-square-o-right:before { content: "\f152"; } .fa-euro:before, .fa-eur:before { content: "\f153"; } .fa-gbp:before { content: "\f154"; } .fa-dollar:before, .fa-usd:before { content: "\f155"; } .fa-rupee:before, .fa-inr:before { content: "\f156"; } .fa-cny:before, .fa-rmb:before, .fa-yen:before, .fa-jpy:before { content: "\f157"; } .fa-ruble:before, .fa-rouble:before, .fa-rub:before { content: "\f158"; } .fa-won:before, .fa-krw:before { content: "\f159"; } .fa-bitcoin:before, .fa-btc:before { content: "\f15a"; } .fa-file:before { content: "\f15b"; } .fa-file-text:before { content: "\f15c"; } .fa-sort-alpha-asc:before { content: "\f15d"; } .fa-sort-alpha-desc:before { content: "\f15e"; } .fa-sort-amount-asc:before { content: "\f160"; } .fa-sort-amount-desc:before { content: "\f161"; } .fa-sort-numeric-asc:before { content: "\f162"; } .fa-sort-numeric-desc:before { content: "\f163"; } .fa-thumbs-up:before { content: "\f164"; } .fa-thumbs-down:before { content: "\f165"; } .fa-youtube-square:before { content: "\f166"; } .fa-youtube:before { content: "\f167"; } .fa-xing:before { content: "\f168"; } .fa-xing-square:before { content: "\f169"; } .fa-youtube-play:before { content: "\f16a"; } .fa-dropbox:before { content: "\f16b"; } .fa-stack-overflow:before { content: "\f16c"; } .fa-instagram:before { content: "\f16d"; } .fa-flickr:before { content: "\f16e"; } .fa-adn:before { content: "\f170"; } .fa-bitbucket:before { content: "\f171"; } .fa-bitbucket-square:before { content: "\f172"; } .fa-tumblr:before { content: "\f173"; } .fa-tumblr-square:before { content: "\f174"; } .fa-long-arrow-down:before { content: "\f175"; } .fa-long-arrow-up:before { content: "\f176"; } .fa-long-arrow-left:before { content: "\f177"; } .fa-long-arrow-right:before { content: "\f178"; } .fa-apple:before { content: "\f179"; } .fa-windows:before { content: "\f17a"; } .fa-android:before { content: "\f17b"; } .fa-linux:before { content: "\f17c"; } .fa-dribbble:before { content: "\f17d"; } .fa-skype:before { content: "\f17e"; } .fa-foursquare:before { content: "\f180"; } .fa-trello:before { content: "\f181"; } .fa-female:before { content: "\f182"; } .fa-male:before { content: "\f183"; } .fa-gittip:before, .fa-gratipay:before { content: "\f184"; } .fa-sun-o:before { content: "\f185"; } .fa-moon-o:before { content: "\f186"; } .fa-archive:before { content: "\f187"; } .fa-bug:before { content: "\f188"; } .fa-vk:before { content: "\f189"; } .fa-weibo:before { content: "\f18a"; } .fa-renren:before { content: "\f18b"; } .fa-pagelines:before { content: "\f18c"; } .fa-stack-exchange:before { content: "\f18d"; } .fa-arrow-circle-o-right:before { content: "\f18e"; } .fa-arrow-circle-o-left:before { content: "\f190"; } .fa-toggle-left:before, .fa-caret-square-o-left:before { content: "\f191"; } .fa-dot-circle-o:before { content: "\f192"; } .fa-wheelchair:before { content: "\f193"; } .fa-vimeo-square:before { content: "\f194"; } .fa-turkish-lira:before, .fa-try:before { content: "\f195"; } .fa-plus-square-o:before { content: "\f196"; } .fa-space-shuttle:before { content: "\f197"; } .fa-slack:before { content: "\f198"; } .fa-envelope-square:before { content: "\f199"; } .fa-wordpress:before { content: "\f19a"; } .fa-openid:before { content: "\f19b"; } .fa-institution:before, .fa-bank:before, .fa-university:before { content: "\f19c"; } .fa-mortar-board:before, .fa-graduation-cap:before { content: "\f19d"; } .fa-yahoo:before { content: "\f19e"; } .fa-google:before { content: "\f1a0"; } .fa-reddit:before { content: "\f1a1"; } .fa-reddit-square:before { content: "\f1a2"; } .fa-stumbleupon-circle:before { content: "\f1a3"; } .fa-stumbleupon:before { content: "\f1a4"; } .fa-delicious:before { content: "\f1a5"; } .fa-digg:before { content: "\f1a6"; } .fa-pied-piper-pp:before { content: "\f1a7"; } .fa-pied-piper-alt:before { content: "\f1a8"; } .fa-drupal:before { content: "\f1a9"; } .fa-joomla:before { content: "\f1aa"; } .fa-language:before { content: "\f1ab"; } .fa-fax:before { content: "\f1ac"; } .fa-building:before { content: "\f1ad"; } .fa-child:before { content: "\f1ae"; } .fa-paw:before { content: "\f1b0"; } .fa-spoon:before { content: "\f1b1"; } .fa-cube:before { content: "\f1b2"; } .fa-cubes:before { content: "\f1b3"; } .fa-behance:before { content: "\f1b4"; } .fa-behance-square:before { content: "\f1b5"; } .fa-steam:before { content: "\f1b6"; } .fa-steam-square:before { content: "\f1b7"; } .fa-recycle:before { content: "\f1b8"; } .fa-automobile:before, .fa-car:before { content: "\f1b9"; } .fa-cab:before, .fa-taxi:before { content: "\f1ba"; } .fa-tree:before { content: "\f1bb"; } .fa-spotify:before { content: "\f1bc"; } .fa-deviantart:before { content: "\f1bd"; } .fa-soundcloud:before { content: "\f1be"; } .fa-database:before { content: "\f1c0"; } .fa-file-pdf-o:before { content: "\f1c1"; } .fa-file-word-o:before { content: "\f1c2"; } .fa-file-excel-o:before { content: "\f1c3"; } .fa-file-powerpoint-o:before { content: "\f1c4"; } .fa-file-photo-o:before, .fa-file-picture-o:before, .fa-file-image-o:before { content: "\f1c5"; } .fa-file-zip-o:before, .fa-file-archive-o:before { content: "\f1c6"; } .fa-file-sound-o:before, .fa-file-audio-o:before { content: "\f1c7"; } .fa-file-movie-o:before, .fa-file-video-o:before { content: "\f1c8"; } .fa-file-code-o:before { content: "\f1c9"; } .fa-vine:before { content: "\f1ca"; } .fa-codepen:before { content: "\f1cb"; } .fa-jsfiddle:before { content: "\f1cc"; } .fa-life-bouy:before, .fa-life-buoy:before, .fa-life-saver:before, .fa-support:before, .fa-life-ring:before { content: "\f1cd"; } .fa-circle-o-notch:before { content: "\f1ce"; } .fa-ra:before, .fa-resistance:before, .fa-rebel:before { content: "\f1d0"; } .fa-ge:before, .fa-empire:before { content: "\f1d1"; } .fa-git-square:before { content: "\f1d2"; } .fa-git:before { content: "\f1d3"; } .fa-y-combinator-square:before, .fa-yc-square:before, .fa-hacker-news:before { content: "\f1d4"; } .fa-tencent-weibo:before { content: "\f1d5"; } .fa-qq:before { content: "\f1d6"; } .fa-wechat:before, .fa-weixin:before { content: "\f1d7"; } .fa-send:before, .fa-paper-plane:before { content: "\f1d8"; } .fa-send-o:before, .fa-paper-plane-o:before { content: "\f1d9"; } .fa-history:before { content: "\f1da"; } .fa-circle-thin:before { content: "\f1db"; } .fa-header:before { content: "\f1dc"; } .fa-paragraph:before { content: "\f1dd"; } .fa-sliders:before { content: "\f1de"; } .fa-share-alt:before { content: "\f1e0"; } .fa-share-alt-square:before { content: "\f1e1"; } .fa-bomb:before { content: "\f1e2"; } .fa-soccer-ball-o:before, .fa-futbol-o:before { content: "\f1e3"; } .fa-tty:before { content: "\f1e4"; } .fa-binoculars:before { content: "\f1e5"; } .fa-plug:before { content: "\f1e6"; } .fa-slideshare:before { content: "\f1e7"; } .fa-twitch:before { content: "\f1e8"; } .fa-yelp:before { content: "\f1e9"; } .fa-newspaper-o:before { content: "\f1ea"; } .fa-wifi:before { content: "\f1eb"; } .fa-calculator:before { content: "\f1ec"; } .fa-paypal:before { content: "\f1ed"; } .fa-google-wallet:before { content: "\f1ee"; } .fa-cc-visa:before { content: "\f1f0"; } .fa-cc-mastercard:before { content: "\f1f1"; } .fa-cc-discover:before { content: "\f1f2"; } .fa-cc-amex:before { content: "\f1f3"; } .fa-cc-paypal:before { content: "\f1f4"; } .fa-cc-stripe:before { content: "\f1f5"; } .fa-bell-slash:before { content: "\f1f6"; } .fa-bell-slash-o:before { content: "\f1f7"; } .fa-trash:before { content: "\f1f8"; } .fa-copyright:before { content: "\f1f9"; } .fa-at:before { content: "\f1fa"; } .fa-eyedropper:before { content: "\f1fb"; } .fa-paint-brush:before { content: "\f1fc"; } .fa-birthday-cake:before { content: "\f1fd"; } .fa-area-chart:before { content: "\f1fe"; } .fa-pie-chart:before { content: "\f200"; } .fa-line-chart:before { content: "\f201"; } .fa-lastfm:before { content: "\f202"; } .fa-lastfm-square:before { content: "\f203"; } .fa-toggle-off:before { content: "\f204"; } .fa-toggle-on:before { content: "\f205"; } .fa-bicycle:before { content: "\f206"; } .fa-bus:before { content: "\f207"; } .fa-ioxhost:before { content: "\f208"; } .fa-angellist:before { content: "\f209"; } .fa-cc:before { content: "\f20a"; } .fa-shekel:before, .fa-sheqel:before, .fa-ils:before { content: "\f20b"; } .fa-meanpath:before { content: "\f20c"; } .fa-buysellads:before { content: "\f20d"; } .fa-connectdevelop:before { content: "\f20e"; } .fa-dashcube:before { content: "\f210"; } .fa-forumbee:before { content: "\f211"; } .fa-leanpub:before { content: "\f212"; } .fa-sellsy:before { content: "\f213"; } .fa-shirtsinbulk:before { content: "\f214"; } .fa-simplybuilt:before { content: "\f215"; } .fa-skyatlas:before { content: "\f216"; } .fa-cart-plus:before { content: "\f217"; } .fa-cart-arrow-down:before { content: "\f218"; } .fa-diamond:before { content: "\f219"; } .fa-ship:before { content: "\f21a"; } .fa-user-secret:before { content: "\f21b"; } .fa-motorcycle:before { content: "\f21c"; } .fa-street-view:before { content: "\f21d"; } .fa-heartbeat:before { content: "\f21e"; } .fa-venus:before { content: "\f221"; } .fa-mars:before { content: "\f222"; } .fa-mercury:before { content: "\f223"; } .fa-intersex:before, .fa-transgender:before { content: "\f224"; } .fa-transgender-alt:before { content: "\f225"; } .fa-venus-double:before { content: "\f226"; } .fa-mars-double:before { content: "\f227"; } .fa-venus-mars:before { content: "\f228"; } .fa-mars-stroke:before { content: "\f229"; } .fa-mars-stroke-v:before { content: "\f22a"; } .fa-mars-stroke-h:before { content: "\f22b"; } .fa-neuter:before { content: "\f22c"; } .fa-genderless:before { content: "\f22d"; } .fa-facebook-official:before { content: "\f230"; } .fa-pinterest-p:before { content: "\f231"; } .fa-whatsapp:before { content: "\f232"; } .fa-server:before { content: "\f233"; } .fa-user-plus:before { content: "\f234"; } .fa-user-times:before { content: "\f235"; } .fa-hotel:before, .fa-bed:before { content: "\f236"; } .fa-viacoin:before { content: "\f237"; } .fa-train:before { content: "\f238"; } .fa-subway:before { content: "\f239"; } .fa-medium:before { content: "\f23a"; } .fa-yc:before, .fa-y-combinator:before { content: "\f23b"; } .fa-optin-monster:before { content: "\f23c"; } .fa-opencart:before { content: "\f23d"; } .fa-expeditedssl:before { content: "\f23e"; } .fa-battery-4:before, .fa-battery:before, .fa-battery-full:before { content: "\f240"; } .fa-battery-3:before, .fa-battery-three-quarters:before { content: "\f241"; } .fa-battery-2:before, .fa-battery-half:before { content: "\f242"; } .fa-battery-1:before, .fa-battery-quarter:before { content: "\f243"; } .fa-battery-0:before, .fa-battery-empty:before { content: "\f244"; } .fa-mouse-pointer:before { content: "\f245"; } .fa-i-cursor:before { content: "\f246"; } .fa-object-group:before { content: "\f247"; } .fa-object-ungroup:before { content: "\f248"; } .fa-sticky-note:before { content: "\f249"; } .fa-sticky-note-o:before { content: "\f24a"; } .fa-cc-jcb:before { content: "\f24b"; } .fa-cc-diners-club:before { content: "\f24c"; } .fa-clone:before { content: "\f24d"; } .fa-balance-scale:before { content: "\f24e"; } .fa-hourglass-o:before { content: "\f250"; } .fa-hourglass-1:before, .fa-hourglass-start:before { content: "\f251"; } .fa-hourglass-2:before, .fa-hourglass-half:before { content: "\f252"; } .fa-hourglass-3:before, .fa-hourglass-end:before { content: "\f253"; } .fa-hourglass:before { content: "\f254"; } .fa-hand-grab-o:before, .fa-hand-rock-o:before { content: "\f255"; } .fa-hand-stop-o:before, .fa-hand-paper-o:before { content: "\f256"; } .fa-hand-scissors-o:before { content: "\f257"; } .fa-hand-lizard-o:before { content: "\f258"; } .fa-hand-spock-o:before { content: "\f259"; } .fa-hand-pointer-o:before { content: "\f25a"; } .fa-hand-peace-o:before { content: "\f25b"; } .fa-trademark:before { content: "\f25c"; } .fa-registered:before { content: "\f25d"; } .fa-creative-commons:before { content: "\f25e"; } .fa-gg:before { content: "\f260"; } .fa-gg-circle:before { content: "\f261"; } .fa-tripadvisor:before { content: "\f262"; } .fa-odnoklassniki:before { content: "\f263"; } .fa-odnoklassniki-square:before { content: "\f264"; } .fa-get-pocket:before { content: "\f265"; } .fa-wikipedia-w:before { content: "\f266"; } .fa-safari:before { content: "\f267"; } .fa-chrome:before { content: "\f268"; } .fa-firefox:before { content: "\f269"; } .fa-opera:before { content: "\f26a"; } .fa-internet-explorer:before { content: "\f26b"; } .fa-tv:before, .fa-television:before { content: "\f26c"; } .fa-contao:before { content: "\f26d"; } .fa-500px:before { content: "\f26e"; } .fa-amazon:before { content: "\f270"; } .fa-calendar-plus-o:before { content: "\f271"; } .fa-calendar-minus-o:before { content: "\f272"; } .fa-calendar-times-o:before { content: "\f273"; } .fa-calendar-check-o:before { content: "\f274"; } .fa-industry:before { content: "\f275"; } .fa-map-pin:before { content: "\f276"; } .fa-map-signs:before { content: "\f277"; } .fa-map-o:before { content: "\f278"; } .fa-map:before { content: "\f279"; } .fa-commenting:before { content: "\f27a"; } .fa-commenting-o:before { content: "\f27b"; } .fa-houzz:before { content: "\f27c"; } .fa-vimeo:before { content: "\f27d"; } .fa-black-tie:before { content: "\f27e"; } .fa-fonticons:before { content: "\f280"; } .fa-reddit-alien:before { content: "\f281"; } .fa-edge:before { content: "\f282"; } .fa-credit-card-alt:before { content: "\f283"; } .fa-codiepie:before { content: "\f284"; } .fa-modx:before { content: "\f285"; } .fa-fort-awesome:before { content: "\f286"; } .fa-usb:before { content: "\f287"; } .fa-product-hunt:before { content: "\f288"; } .fa-mixcloud:before { content: "\f289"; } .fa-scribd:before { content: "\f28a"; } .fa-pause-circle:before { content: "\f28b"; } .fa-pause-circle-o:before { content: "\f28c"; } .fa-stop-circle:before { content: "\f28d"; } .fa-stop-circle-o:before { content: "\f28e"; } .fa-shopping-bag:before { content: "\f290"; } .fa-shopping-basket:before { content: "\f291"; } .fa-hashtag:before { content: "\f292"; } .fa-bluetooth:before { content: "\f293"; } .fa-bluetooth-b:before { content: "\f294"; } .fa-percent:before { content: "\f295"; } .fa-gitlab:before { content: "\f296"; } .fa-wpbeginner:before { content: "\f297"; } .fa-wpforms:before { content: "\f298"; } .fa-envira:before { content: "\f299"; } .fa-universal-access:before { content: "\f29a"; } .fa-wheelchair-alt:before { content: "\f29b"; } .fa-question-circle-o:before { content: "\f29c"; } .fa-blind:before { content: "\f29d"; } .fa-audio-description:before { content: "\f29e"; } .fa-volume-control-phone:before { content: "\f2a0"; } .fa-braille:before { content: "\f2a1"; } .fa-assistive-listening-systems:before { content: "\f2a2"; } .fa-asl-interpreting:before, .fa-american-sign-language-interpreting:before { content: "\f2a3"; } .fa-deafness:before, .fa-hard-of-hearing:before, .fa-deaf:before { content: "\f2a4"; } .fa-glide:before { content: "\f2a5"; } .fa-glide-g:before { content: "\f2a6"; } .fa-signing:before, .fa-sign-language:before { content: "\f2a7"; } .fa-low-vision:before { content: "\f2a8"; } .fa-viadeo:before { content: "\f2a9"; } .fa-viadeo-square:before { content: "\f2aa"; } .fa-snapchat:before { content: "\f2ab"; } .fa-snapchat-ghost:before { content: "\f2ac"; } .fa-snapchat-square:before { content: "\f2ad"; } .fa-pied-piper:before { content: "\f2ae"; } .fa-first-order:before { content: "\f2b0"; } .fa-yoast:before { content: "\f2b1"; } .fa-themeisle:before { content: "\f2b2"; } .fa-google-plus-circle:before, .fa-google-plus-official:before { content: "\f2b3"; } .fa-fa:before, .fa-font-awesome:before { content: "\f2b4"; } .fa-handshake-o:before { content: "\f2b5"; } .fa-envelope-open:before { content: "\f2b6"; } .fa-envelope-open-o:before { content: "\f2b7"; } .fa-linode:before { content: "\f2b8"; } .fa-address-book:before { content: "\f2b9"; } .fa-address-book-o:before { content: "\f2ba"; } .fa-vcard:before, .fa-address-card:before { content: "\f2bb"; } .fa-vcard-o:before, .fa-address-card-o:before { content: "\f2bc"; } .fa-user-circle:before { content: "\f2bd"; } .fa-user-circle-o:before { content: "\f2be"; } .fa-user-o:before { content: "\f2c0"; } .fa-id-badge:before { content: "\f2c1"; } .fa-drivers-license:before, .fa-id-card:before { content: "\f2c2"; } .fa-drivers-license-o:before, .fa-id-card-o:before { content: "\f2c3"; } .fa-quora:before { content: "\f2c4"; } .fa-free-code-camp:before { content: "\f2c5"; } .fa-telegram:before { content: "\f2c6"; } .fa-thermometer-4:before, .fa-thermometer:before, .fa-thermometer-full:before { content: "\f2c7"; } .fa-thermometer-3:before, .fa-thermometer-three-quarters:before { content: "\f2c8"; } .fa-thermometer-2:before, .fa-thermometer-half:before { content: "\f2c9"; } .fa-thermometer-1:before, .fa-thermometer-quarter:before { content: "\f2ca"; } .fa-thermometer-0:before, .fa-thermometer-empty:before { content: "\f2cb"; } .fa-shower:before { content: "\f2cc"; } .fa-bathtub:before, .fa-s15:before, .fa-bath:before { content: "\f2cd"; } .fa-podcast:before { content: "\f2ce"; } .fa-window-maximize:before { content: "\f2d0"; } .fa-window-minimize:before { content: "\f2d1"; } .fa-window-restore:before { content: "\f2d2"; } .fa-times-rectangle:before, .fa-window-close:before { content: "\f2d3"; } .fa-times-rectangle-o:before, .fa-window-close-o:before { content: "\f2d4"; } .fa-bandcamp:before { content: "\f2d5"; } .fa-grav:before { content: "\f2d6"; } .fa-etsy:before { content: "\f2d7"; } .fa-imdb:before { content: "\f2d8"; } .fa-ravelry:before { content: "\f2d9"; } .fa-eercast:before { content: "\f2da"; } .fa-microchip:before { content: "\f2db"; } .fa-snowflake-o:before { content: "\f2dc"; } .fa-superpowers:before { content: "\f2dd"; } .fa-wpexplorer:before { content: "\f2de"; } .fa-meetup:before { content: "\f2e0"; } .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } .sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
bit55/lcss
src/css/font-awesome.css
CSS
mit
37,192
from math import ceil class Pagination(object): def __init__(self, page, per_page, total_count): self.page = page self.per_page = per_page self.total_count = total_count @property def pages(self): return int(ceil(self.total_count / float(self.per_page))) @property def has_prev(self): return self.page > 1 @property def has_next(self): return self.page < self.pages def iter_pages(self, left_edge=2, left_current=2, right_current=5, right_edge=2): last = 0 for num in range(1, self.pages + 1): if num <= left_edge or \ (num > self.page - left_current - 1 and \ num < self.page + right_current) or \ num > self.pages - right_edge: if last + 1 != num: yield None yield num last = num
Nguyen-Dang-Thu/MSLA
src/msla/pagination.py
Python
mit
930
#! /usr/bin/env python3 # -*- encoding: utf-8 -*- """ __init__.py sessionの挙動確認 """ __author__ = 'Yoshiya Ito <[email protected]>' __version__ = '0.0.1' __date__ = '29 10 2015' from models import * from schemas import * from sqlalchemy import event @event.listens_for(Product, 'load') def show_status(target, value): print('LOAD DATA: product') @event.listens_for(Product, 'before_update') def show_status2(target, value, ini): print('BEFORE UPDATE: product') @event.listens_for(Product.msrp, 'set', named=True) def shoq_status3(**kw): print('set new value') session = Session() p1 = session.query(Product).filter_by(sku=101).one() p2 = session.query(Product).filter_by(sku=502).one() p2 = session.query(Product).get(502) print(p2.sku) #p1 = Product(sku=102, msrp=111) #p2 = Product(sku=505, msrp=121) p1.msrp -= 100 session.add(p1) session.commit() q = session.query(Product).outerjoin('categories').all() print(q) """ session.add(p1) session.add(p2) session.delete(p1) session.delete(p2) session.commit() """
yoshiya0503/SQLAlchemy-sample
7/__init__.py
Python
mit
1,040
/*jshint node: true*/ // Karma configuration // Generated on Wed Oct 15 2014 14:24:49 GMT+0900 (KST) module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['jasmine'], // list of files / patterns to load in the browser files: [ // bower:js 'bower_components/simple-inheritance/class.js', // endbower '*.js' ], // list of files to exclude exclude: [ 'node_modules', 'bower_components', 'Gruntfile.js' ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: false, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['PhantomJS'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false }); };
html5crew/simple-observer
karma.conf.js
JavaScript
mit
1,746
# coding=utf-8 # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. # # -------------------------------------------------------------------------- import logging import os from {{ namespace }} import {{ client_name }} from azure.identity import DefaultAzureCredential from azure.core.exceptions import HttpResponseError logging.basicConfig(level=logging.DEBUG) LOG = logging.getLogger() # Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: # AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, {{ test_prefix.upper() }}_ENDPOINT try: endpoint = os.environ["{{ test_prefix.upper() }}_ENDPOINT"] except KeyError: LOG.error("Missing environment variable '{{ test_prefix.upper() }}_ENDPOINT' - please set if before running the example") exit() # Build a client through AAD client = {{ client_name }}(credential=DefaultAzureCredential(), endpoint=endpoint) # write your sample here. For example: # try: # result = client.xxx.xx(...) # print(result) # except HttpResponseError as e: # print('Failed to send JSON message: {}'.format(e.response.json()))
Azure/azure-sdk-for-python
scripts/quickstart_tooling_llc/template_samples/sample.py
Python
mit
2,309
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) module RecipesApp class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de end end
clerb/refactor_recipe_app
config/application.rb
Ruby
mit
987
//go:generate go run -tags=dev assets_generate.go package assets
aqtrans/gothing
vfs/assets/assets.go
GO
mit
66
package server import ( "context" "github.com/motki/motkid/proto" ) func (srv *GRPCServer) GetRegion(ctx context.Context, req *proto.GetRegionRequest) (resp *proto.GetRegionResponse, err error) { defer func() { if err != nil { resp = &proto.GetRegionResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetRegion(int(req.RegionId)) if err != nil { return nil, err } return &proto.GetRegionResponse{ Result: successResult, Region: proto.RegionToProto(res), }, nil } func (srv *GRPCServer) GetRegions(ctx context.Context, req *proto.GetRegionsRequest) (resp *proto.GetRegionsResponse, err error) { defer func() { if err != nil { resp = &proto.GetRegionsResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetAllRegions() if err != nil { return nil, err } var results []*proto.Region for _, r := range res { results = append(results, proto.RegionToProto(r)) } return &proto.GetRegionsResponse{ Result: successResult, Region: results, }, nil } func (srv *GRPCServer) GetConstellation(ctx context.Context, req *proto.GetConstellationRequest) (resp *proto.GetConstellationResponse, err error) { defer func() { if err != nil { resp = &proto.GetConstellationResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetConstellation(int(req.ConstellationId)) if err != nil { return nil, err } return &proto.GetConstellationResponse{ Result: successResult, Constellation: proto.ConstellationToProto(res), }, nil } func (srv *GRPCServer) GetSystem(ctx context.Context, req *proto.GetSystemRequest) (resp *proto.GetSystemResponse, err error) { defer func() { if err != nil { resp = &proto.GetSystemResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetSystem(int(req.SystemId)) if err != nil { return nil, err } return &proto.GetSystemResponse{ Result: successResult, System: proto.SystemToProto(res), }, nil } func (srv *GRPCServer) GetRace(ctx context.Context, req *proto.GetRaceRequest) (resp *proto.GetRaceResponse, err error) { defer func() { if err != nil { resp = &proto.GetRaceResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetRace(int(req.RaceId)) if err != nil { return nil, err } return &proto.GetRaceResponse{ Result: successResult, Race: proto.RaceToProto(res), }, nil } func (srv *GRPCServer) GetRaces(ctx context.Context, req *proto.GetRacesRequest) (resp *proto.GetRacesResponse, err error) { defer func() { if err != nil { resp = &proto.GetRacesResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetRaces() if err != nil { return nil, err } var races []*proto.Race for _, r := range res { races = append(races, proto.RaceToProto(r)) } return &proto.GetRacesResponse{ Result: successResult, Race: races, }, nil } func (srv *GRPCServer) GetBloodline(ctx context.Context, req *proto.GetBloodlineRequest) (resp *proto.GetBloodlineResponse, err error) { defer func() { if err != nil { resp = &proto.GetBloodlineResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetBloodline(int(req.BloodlineId)) if err != nil { return nil, err } return &proto.GetBloodlineResponse{ Result: successResult, Bloodline: proto.BloodlineToProto(res), }, nil } func (srv *GRPCServer) GetAncestry(ctx context.Context, req *proto.GetAncestryRequest) (resp *proto.GetAncestryResponse, err error) { defer func() { if err != nil { resp = &proto.GetAncestryResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetAncestry(int(req.AncestryId)) if err != nil { return nil, err } return &proto.GetAncestryResponse{ Result: successResult, Ancestry: proto.AncestryToProto(res), }, nil } func (srv *GRPCServer) GetItemType(ctx context.Context, req *proto.GetItemTypeRequest) (resp *proto.GetItemTypeResponse, err error) { defer func() { if err != nil { resp = &proto.GetItemTypeResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetItemType(int(req.TypeId)) if err != nil { return nil, err } return &proto.GetItemTypeResponse{ Result: successResult, Type: proto.ItemTypeToProto(res), }, nil } func (srv *GRPCServer) GetItemTypeDetail(ctx context.Context, req *proto.GetItemTypeDetailRequest) (resp *proto.GetItemTypeDetailResponse, err error) { defer func() { if err != nil { resp = &proto.GetItemTypeDetailResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetItemTypeDetail(int(req.TypeId)) if err != nil { return nil, err } return &proto.GetItemTypeDetailResponse{ Result: successResult, Type: proto.ItemTypeDetailToProto(res), }, nil } func (srv *GRPCServer) QueryItemTypes(ctx context.Context, req *proto.QueryItemTypesRequest) (resp *proto.QueryItemTypesResponse, err error) { defer func() { if err != nil { resp = &proto.QueryItemTypesResponse{ Result: errorResult(err), } err = nil } }() var cats []int for _, c := range req.CategoryId { cats = append(cats, int(c)) } res, err := srv.evedb.QueryItemTypes(req.Query, cats...) if err != nil { return nil, err } var results []*proto.ItemType for _, r := range res { results = append(results, proto.ItemTypeToProto(r)) } return &proto.QueryItemTypesResponse{ Result: successResult, Types: results, }, nil } func (srv *GRPCServer) QueryItemTypeDetails(ctx context.Context, req *proto.QueryItemTypeDetailsRequest) (resp *proto.QueryItemTypeDetailsResponse, err error) { defer func() { if err != nil { resp = &proto.QueryItemTypeDetailsResponse{ Result: errorResult(err), } err = nil } }() var cats []int for _, c := range req.CategoryId { cats = append(cats, int(c)) } res, err := srv.evedb.QueryItemTypeDetails(req.Query, cats...) if err != nil { return nil, err } var results []*proto.ItemTypeDetail for _, r := range res { results = append(results, proto.ItemTypeDetailToProto(r)) } return &proto.QueryItemTypeDetailsResponse{ Result: successResult, Types: results, }, nil } func (srv *GRPCServer) GetMaterialSheet(ctx context.Context, req *proto.GetMaterialSheetRequest) (resp *proto.GetMaterialSheetResponse, err error) { defer func() { if err != nil { resp = &proto.GetMaterialSheetResponse{ Result: errorResult(err), } err = nil } }() res, err := srv.evedb.GetBlueprint(int(req.TypeId)) if err != nil { return nil, err } return &proto.GetMaterialSheetResponse{ Result: successResult, MatSheet: proto.MatSheetToProto(res), }, nil }
motki/motkid
proto/server/evedb.go
GO
mit
6,760
package org.jabref.logic.importer.fetcher; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; import org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter; import org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter; import org.jabref.logic.importer.FetcherException; import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.cleanup.FieldFormatterCleanup; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.field.StandardField; import org.apache.http.client.utils.URIBuilder; /** * Fetcher for ISBN using http://www.ebook.de. */ public class IsbnViaEbookDeFetcher extends AbstractIsbnFetcher { private static final String BASE_URL = "http://www.ebook.de/de/tools/isbn2bibtex"; public IsbnViaEbookDeFetcher(ImportFormatPreferences importFormatPreferences) { super(importFormatPreferences); } @Override public String getName() { return "ISBN (ebook.de)"; } @Override public URL getURLForID(String identifier) throws URISyntaxException, MalformedURLException, FetcherException { this.ensureThatIsbnIsValid(identifier); URIBuilder uriBuilder = new URIBuilder(BASE_URL); uriBuilder.addParameter("isbn", identifier); return uriBuilder.build().toURL(); } @Override public void doPostCleanup(BibEntry entry) { // We MUST NOT clean the URL. this is the deal with ebook.de // DO NOT add following code: // new FieldFormatterCleanup(StandardField.URL, new ClearFormatter()).cleanup(entry); // Fetcher returns page numbers as "30 Seiten" -> remove every non-digit character in the PAGETOTAL field entry.getField(StandardField.PAGETOTAL).ifPresent(pages -> entry.setField(StandardField.PAGETOTAL, pages.replaceAll("[\\D]", ""))); new FieldFormatterCleanup(StandardField.PAGETOTAL, new NormalizePagesFormatter()).cleanup(entry); new FieldFormatterCleanup(StandardField.AUTHOR, new NormalizeNamesFormatter()).cleanup(entry); } }
zellerdev/jabref
src/main/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcher.java
Java
mit
2,104
using TSqlBuilder.Builders.General; namespace TSqlBuilder.Builders.Select { public interface IOrderByBuilder : ITSqlBuilder { IComplexOrderByBuilder OrderBy(params string[] conditions); } }
tchrikch/TSqlBuilder
TSqlBuilder/Builders/Select/IOrderByBuilder.cs
C#
mit
210
# # Copyright (c) 2015 Red Hat, Inc. # # Author: Loic Dachary <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # import copy import datetime import json import logging import os import paramiko import re import socket import subprocess import tempfile import teuthology import types from subprocess import CalledProcessError from teuthology.contextutil import safe_while from teuthology.config import config as teuth_config from teuthology.config import set_config_attr from teuthology.orchestra import connection from teuthology import misc log = logging.getLogger(__name__) class OpenStackInstance(object): def __init__(self, name_or_id, info=None): self.name_or_id = name_or_id if info is None: self.set_info() else: self.info = dict(map(lambda (k,v): (k.lower(), v), info.iteritems())) def set_info(self): try: info = json.loads( misc.sh("openstack server show -f json " + self.name_or_id)) self.info = dict(map( lambda p: (p['Field'].lower(), p['Value']), info)) except CalledProcessError: self.info = None def __getitem__(self, name): return self.info[name.lower()] def get_created(self): now = datetime.datetime.now() created = datetime.datetime.strptime( self['created'], '%Y-%m-%dT%H:%M:%SZ') return (now - created).total_seconds() def exists(self): return self.info is not None def get_volumes(self): """ Return the uuid of the volumes attached to the name_or_id OpenStack instance. """ volumes = self['os-extended-volumes:volumes_attached'] return [volume['id'] for volume in volumes ] def get_addresses(self): """ Return the list of IPs associated with instance_id in OpenStack. """ with safe_while(sleep=2, tries=30, action="get ip " + self['id']) as proceed: while proceed(): found = re.match('.*\d+', self['addresses']) if found: return self['addresses'] self.set_info() def get_ip_neutron(self): subnets = json.loads(misc.sh("neutron subnet-list -f json -c id -c ip_version")) subnet_id = None for subnet in subnets: if subnet['ip_version'] == 4: subnet_id = subnet['id'] break if not subnet_id: raise Exception("no subnet with ip_version == 4") ports = json.loads(misc.sh("neutron port-list -f json -c fixed_ips -c device_id")) fixed_ips = None for port in ports: if port['device_id'] == self['id']: fixed_ips = port['fixed_ips'].split("\n") break if not fixed_ips: raise Exception("no fixed ip record found") ip = None for fixed_ip in fixed_ips: record = json.loads(fixed_ip) if record['subnet_id'] == subnet_id: ip = record['ip_address'] break if not ip: raise Exception("no ip") return ip def get_ip(self, network): """ Return the private IP of the OpenStack instance_id. """ try: return self.get_ip_neutron() except Exception as e: log.debug("ignoring get_ip_neutron exception " + str(e)) return re.findall(network + '=([\d.]+)', self.get_addresses())[0] def destroy(self): """ Delete the name_or_id OpenStack instance. """ if not self.exists(): return True volumes = self.get_volumes() misc.sh("openstack server set --name REMOVE-ME-" + self.name_or_id + " " + self['id']) misc.sh("openstack server delete --wait " + self['id'] + " || true") for volume in volumes: misc.sh("openstack volume set --name REMOVE-ME " + volume) misc.sh("openstack volume delete " + volume + " || true") return True class OpenStack(object): # wget -O debian-8.0.qcow2 http://cdimage.debian.org/cdimage/openstack/current/debian-8.1.0-openstack-amd64.qcow2 # wget -O ubuntu-12.04.qcow2 https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img # wget -O ubuntu-12.04-i386.qcow2 https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-i386-disk1.img # wget -O ubuntu-14.04.qcow2 https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img # wget -O ubuntu-14.04-i386.qcow2 https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-i386-disk1.img # wget -O ubuntu-15.04.qcow2 https://cloud-images.ubuntu.com/vivid/current/vivid-server-cloudimg-arm64-disk1.img # wget -O ubuntu-15.04-i386.qcow2 https://cloud-images.ubuntu.com/vivid/current/vivid-server-cloudimg-i386-disk1.img # wget -O opensuse-13.2 http://download.opensuse.org/repositories/Cloud:/Images:/openSUSE_13.2/images/openSUSE-13.2-OpenStack-Guest.x86_64.qcow2 # wget -O centos-7.0.qcow2 http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 # wget -O centos-6.6.qcow2 http://cloud.centos.org/centos/6/images/CentOS-6-x86_64-GenericCloud.qcow2 # wget -O fedora-22.qcow2 https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-22-20150521.x86_64.qcow2 # wget -O fedora-21.qcow2 http://fedora.mirrors.ovh.net/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.qcow2 # wget -O fedora-20.qcow2 http://fedora.mirrors.ovh.net/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2 image2url = { 'centos-6.5': 'http://cloud.centos.org/centos/6/images/CentOS-6-x86_64-GenericCloud-1508.qcow2', 'centos-7.0': 'http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1508.qcow2', 'ubuntu-14.04': 'https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img', 'debian-8.0': 'http://cdimage.debian.org/cdimage/openstack/current/debian-8.2.0-openstack-amd64.qcow2', } def __init__(self): self.key_filename = None self.username = 'ubuntu' self.up_string = "UNKNOWN" self.teuthology_suite = 'teuthology-suite' def set_provider(self): if 'OS_AUTH_URL' not in os.environ: raise Exception('no OS_AUTH_URL environment variable') providers = (('cloud.ovh.net', 'ovh'), ('entercloudsuite.com', 'entercloudsuite'), ('rackspacecloud.com', 'rackspace'), ('dream.io', 'dreamhost')) self.provider = None for (pattern, provider) in providers: if pattern in os.environ['OS_AUTH_URL']: self.provider = provider break return self.provider @staticmethod def get_value(result, field): """ Get the value of a field from a result returned by the openstack command in json format. :param result: A list of dicts in a format similar to the output of 'openstack server show' :param field: The name of the field whose value to retrieve. Case is ignored. """ filter_func = lambda v: v['Field'].lower() == field.lower() return filter(filter_func, result)[0]['Value'] def image_exists(self, image): """ Return true if the image exists in OpenStack. """ found = misc.sh("openstack image list -f json --property name='" + self.image_name(image) + "'") return len(json.loads(found)) > 0 def net_id(self, network): """ Return the uuid of the network in OpenStack. """ r = json.loads(misc.sh("openstack network show -f json " + network)) return self.get_value(r, 'id') def type_version(self, os_type, os_version): """ Return the string used to differentiate os_type and os_version in names. """ return os_type + '-' + os_version def image_name(self, name): """ Return the image name used by teuthology in OpenStack to avoid conflicts with existing names. """ return "teuthology-" + name def image_create(self, name): """ Upload an image into OpenStack with glance. """ misc.sh("wget -c -O " + name + ".qcow2 " + self.image2url[name]) self.set_provider() if self.provider == 'dreamhost': image = name + ".raw" disk_format = 'raw' misc.sh("qemu-img convert " + name + ".qcow2 " + image) else: image = name + ".qcow2" disk_format = 'qcow2' misc.sh("glance image-create --property ownedby=teuthology " + " --disk-format=" + disk_format + " --container-format=bare " + " --file " + image + " --name " + self.image_name(name)) def image(self, os_type, os_version): """ Return the image name for the given os_type and os_version. If the image does not exist it will be created. """ name = self.type_version(os_type, os_version) if not self.image_exists(name): self.image_create(name) return self.image_name(name) def flavor(self, hint, select): """ Return the smallest flavor that satisfies the desired size. """ flavors_string = misc.sh("openstack flavor list -f json") flavors = json.loads(flavors_string) found = [] for flavor in flavors: if select and not re.match(select, flavor['Name']): continue if (flavor['RAM'] >= hint['ram'] and flavor['VCPUs'] >= hint['cpus'] and flavor['Disk'] >= hint['disk']): found.append(flavor) if not found: raise Exception("openstack flavor list: " + flavors_string + " does not contain a flavor in which" + " the desired " + str(hint) + " can fit") def sort_flavor(a, b): return (a['VCPUs'] - b['VCPUs'] or a['RAM'] - b['RAM'] or a['Disk'] - b['Disk']) sorted_flavor = sorted(found, cmp=sort_flavor) log.debug("sorted flavor = " + str(sorted_flavor)) return sorted_flavor[0]['Name'] def interpret_hints(self, defaults, hints): """ Return a hint hash which is the interpretation of a list of hints """ result = copy.deepcopy(defaults) if not hints: return result if type(hints) is types.DictType: hints = [hints] # TODO: raise after converting all ceph-qa-suite to only use arrays (oct 2015) # raise Exception("openstack: " + str(hints) + " must be an array, not a dict") for hint in hints: for resource in ('machine', 'volumes'): if resource in hint: new = hint[resource] current = result[resource] for key, value in hint[resource].iteritems(): current[key] = max(current[key], new[key]) return result @staticmethod def list_instances(): ownedby = "ownedby='" + teuth_config.openstack['ip'] + "'" all = json.loads(misc.sh( "openstack server list -f json --long --name 'target'")) return filter(lambda instance: ownedby in instance['Properties'], all) @staticmethod def list_volumes(): ownedby = "ownedby='" + teuth_config.openstack['ip'] + "'" all = json.loads(misc.sh( "openstack volume list -f json --long")) def select(volume): return (ownedby in volume['Properties'] and volume['Display Name'].startswith('target')) return filter(select, all) def cloud_init_wait(self, name_or_ip): """ Wait for cloud-init to complete on the name_or_ip OpenStack instance. """ log.debug('cloud_init_wait ' + name_or_ip) client_args = { 'user_at_host': '@'.join((self.username, name_or_ip)), 'timeout': 240, 'retry': False, } if self.key_filename: log.debug("using key " + self.key_filename) client_args['key_filename'] = self.key_filename with safe_while(sleep=30, tries=100, action="cloud_init_wait " + name_or_ip) as proceed: success = False # CentOS 6.6 logs in /var/log/clout-init-output.log # CentOS 7.0 logs in /var/log/clout-init.log all_done = ("tail /var/log/cloud-init*.log ; " + " test -f /tmp/init.out && tail /tmp/init.out ; " + " grep '" + self.up_string + "' " + "/var/log/cloud-init*.log") while proceed(): try: client = connection.connect(**client_args) except paramiko.PasswordRequiredException as e: raise Exception( "The private key requires a passphrase.\n" "Create a new key with:" " openstack keypair create myself > myself.pem\n" " chmod 600 myself.pem\n" "and call teuthology-openstack with the options\n" " --key-name myself --key-filename myself.pem\n") except paramiko.AuthenticationException as e: log.debug('cloud_init_wait AuthenticationException ' + str(e)) continue except socket.timeout as e: log.debug('cloud_init_wait connect socket.timeout ' + str(e)) continue except socket.error as e: log.debug('cloud_init_wait connect socket.error ' + str(e)) continue except Exception as e: transients = ('Incompatible ssh peer', 'Unknown server') for transient in transients: if transient in str(e): continue log.exception('cloud_init_wait ' + name_or_ip) raise log.debug('cloud_init_wait ' + all_done) try: stdin, stdout, stderr = client.exec_command(all_done) stdout.channel.settimeout(5) out = stdout.read() log.debug('cloud_init_wait stdout ' + all_done + ' ' + out) except socket.timeout as e: client.close() log.debug('cloud_init_wait socket.timeout ' + all_done) continue except socket.error as e: client.close() log.debug('cloud_init_wait socket.error ' + str(e) + ' ' + all_done) continue log.debug('cloud_init_wait stderr ' + all_done + ' ' + stderr.read()) if stdout.channel.recv_exit_status() == 0: success = True client.close() if success: break return success def get_ip(self, instance_id, network): return OpenStackInstance(instance_id).get_ip(network) class TeuthologyOpenStack(OpenStack): def __init__(self, args, config, argv): """ args is of type argparse.Namespace as returned when parsing argv and config is the job configuration. The argv argument can be re-used to build the arguments list of teuthology-suite. """ super(TeuthologyOpenStack, self).__init__() self.argv = argv self.args = args self.config = config self.up_string = 'teuthology is up and running' self.user_data = 'teuthology/openstack/openstack-user-data.txt' def main(self): """ Entry point implementing the teuthology-openstack command. """ self.setup_logs() set_config_attr(self.args) self.key_filename = self.args.key_filename self.verify_openstack() ip = self.setup() if self.args.suite: self.run_suite() if self.args.key_filename: identity = '-i ' + self.args.key_filename + ' ' else: identity = '' if self.args.upload: upload = 'upload to : ' + self.args.archive_upload else: upload = '' log.info(""" pulpito web interface: http://{ip}:8081/ ssh access : ssh {identity}{username}@{ip} # logs in /usr/share/nginx/html {upload}""".format(ip=ip, username=self.username, identity=identity, upload=upload)) if self.args.teardown: self.teardown() def run_suite(self): """ Delegate running teuthology-suite to the OpenStack instance running the teuthology cluster. """ original_argv = self.argv[:] argv = [] while len(original_argv) > 0: if original_argv[0] in ('--name', '--archive-upload', '--key-name', '--key-filename', '--simultaneous-jobs'): del original_argv[0:2] elif original_argv[0] in ('--teardown', '--upload'): del original_argv[0] else: argv.append(original_argv.pop(0)) argv.append('/home/' + self.username + '/teuthology/teuthology/openstack/test/openstack.yaml') command = ( "source ~/.bashrc_teuthology ; " + self.teuthology_suite + " " + " --machine-type openstack " + " ".join(map(lambda x: "'" + x + "'", argv)) ) print self.ssh(command) def setup(self): """ Create the teuthology cluster if it does not already exists and return its IP address. """ if not self.cluster_exists(): if self.provider != 'rackspace': self.create_security_group() self.create_cluster() instance_id = self.get_instance_id(self.args.name) return self.get_floating_ip_or_ip(instance_id) def setup_logs(self): """ Setup the log level according to --verbose """ loglevel = logging.INFO if self.args.verbose: loglevel = logging.DEBUG logging.getLogger("paramiko.transport").setLevel(logging.DEBUG) teuthology.log.setLevel(loglevel) def ssh(self, command): """ Run a command in the OpenStack instance of the teuthology cluster. Return the stdout / stderr of the command. """ instance_id = self.get_instance_id(self.args.name) ip = self.get_floating_ip_or_ip(instance_id) client_args = { 'user_at_host': '@'.join((self.username, ip)), 'retry': False, 'timeout': 240, } if self.key_filename: log.debug("ssh overriding key with " + self.key_filename) client_args['key_filename'] = self.key_filename client = connection.connect(**client_args) stdin, stdout, stderr = client.exec_command(command) stdout.channel.settimeout(300) out = '' try: out = stdout.read() log.debug('ssh stdout ' + command + ' ' + out) except Exception: log.exception('ssh ' + command + ' failed') err = stderr.read() log.debug('ssh stderr ' + command + ' ' + err) return out + ' ' + err def verify_openstack(self): """ Check there is a working connection to an OpenStack cluster and set the provider data member if it is among those we know already. """ try: misc.sh("openstack server list") except subprocess.CalledProcessError: log.exception("openstack server list") raise Exception("verify openrc.sh has been sourced") self.set_provider() def flavor(self): """ Return an OpenStack flavor fit to run the teuthology cluster. The RAM size depends on the maximum number of workers that will run simultaneously. """ hint = { 'disk': 10, # GB 'ram': 1024, # MB 'cpus': 1, } if self.args.simultaneous_jobs >= 100: hint['ram'] = 30000 # MB elif self.args.simultaneous_jobs >= 25: hint['ram'] = 8000 # MB elif self.args.simultaneous_jobs >= 10: hint['ram'] = 4000 # MB select = None if self.provider == 'ovh': select = '^(vps|eg)-' return super(TeuthologyOpenStack, self).flavor(hint, select) def net(self): """ Return the network to be used when creating an OpenStack instance. By default it should not be set. But some providers such as entercloudsuite require it is. """ if self.provider == 'entercloudsuite': return "--nic net-id=default" else: return "" def get_user_data(self): """ Create a user-data.txt file to be used to spawn the teuthology cluster, based on a template where the OpenStack credentials and a few other values are substituted. """ path = tempfile.mktemp() if self.user_data.startswith('/'): user_data = self.user_data else: user_data = os.path.join(os.path.dirname(__file__), '../..', self.user_data) template = open(user_data).read() openrc = '' for (var, value) in os.environ.iteritems(): if var.startswith('OS_'): openrc += ' ' + var + '=' + value if self.args.upload: upload = '--archive-upload ' + self.args.archive_upload else: upload = '' clone = teuth_config.openstack['clone'] log.debug("OPENRC = " + openrc + " " + "TEUTHOLOGY_USERNAME = " + self.username + " " + "CLONE_OPENSTACK = " + clone + " " + "UPLOAD = " + upload + " " + "NWORKERS = " + str(self.args.simultaneous_jobs)) content = (template. replace('OPENRC', openrc). replace('TEUTHOLOGY_USERNAME', self.username). replace('CLONE_OPENSTACK', clone). replace('UPLOAD', upload). replace('NWORKERS', str(self.args.simultaneous_jobs))) open(path, 'w').write(content) log.debug("get_user_data: " + content + " written to " + path) return path def create_security_group(self): """ Create a security group that will be used by all teuthology created instances. This should not be necessary in most cases but some OpenStack providers enforce firewall restrictions even among instances created within the same tenant. """ try: misc.sh("openstack security group show teuthology") return except subprocess.CalledProcessError: pass # TODO(loic): this leaves the teuthology vm very exposed # it would be better to be very liberal for 192.168.0.0/16 # and 172.16.0.0/12 and 10.0.0.0/8 and only allow 80/8081/22 # for the rest. misc.sh(""" openstack security group create teuthology openstack security group rule create --dst-port 1:65535 teuthology openstack security group rule create --proto udp --dst-port 53 teuthology # dns """) @staticmethod def get_unassociated_floating_ip(): """ Return a floating IP address not associated with an instance or None. """ ips = json.loads(misc.sh("openstack ip floating list -f json")) for ip in ips: if not ip['Instance ID']: return ip['IP'] return None @staticmethod def create_floating_ip(): pools = json.loads(misc.sh("openstack ip floating pool list -f json")) if not pools: return None pool = pools[0]['Name'] try: ip = json.loads(misc.sh( "openstack ip floating create -f json '" + pool + "'")) return TeuthologyOpenStack.get_value(ip, 'ip') except subprocess.CalledProcessError: log.debug("create_floating_ip: not creating a floating ip") pass return None @staticmethod def associate_floating_ip(name_or_id): """ Associate a floating IP to the OpenStack instance or do nothing if no floating ip can be created. """ ip = TeuthologyOpenStack.get_unassociated_floating_ip() if not ip: ip = TeuthologyOpenStack.create_floating_ip() if ip: misc.sh("openstack ip floating add " + ip + " " + name_or_id) @staticmethod def get_floating_ip(instance_id): """ Return the floating IP of the OpenStack instance_id. """ ips = json.loads(misc.sh("openstack ip floating list -f json")) for ip in ips: if ip['Instance ID'] == instance_id: return ip['IP'] return None @staticmethod def get_floating_ip_id(ip): """ Return the id of a floating IP """ results = json.loads(misc.sh("openstack ip floating list -f json")) for result in results: if result['IP'] == ip: return str(result['ID']) return None @staticmethod def get_floating_ip_or_ip(instance_id): """ Return the floating ip, if any, otherwise return the last IP displayed with openstack server list. """ ip = TeuthologyOpenStack.get_floating_ip(instance_id) if not ip: ip = re.findall('([\d.]+)$', OpenStackInstance(instance_id).get_addresses())[0] return ip @staticmethod def get_instance_id(name): return OpenStackInstance(name)['id'] @staticmethod def delete_floating_ip(instance_id): """ Remove the floating ip from instance_id and delete it. """ ip = TeuthologyOpenStack.get_floating_ip(instance_id) if not ip: return misc.sh("openstack ip floating remove " + ip + " " + instance_id) ip_id = TeuthologyOpenStack.get_floating_ip_id(ip) misc.sh("openstack ip floating delete " + ip_id) def create_cluster(self): """ Create an OpenStack instance that runs the teuthology cluster and wait for it to come up. """ user_data = self.get_user_data() if self.provider == 'rackspace': security_group = '' else: security_group = " --security-group teuthology" instance = misc.sh( "openstack server create " + " --image '" + self.image('ubuntu', '14.04') + "' " + " --flavor '" + self.flavor() + "' " + " " + self.net() + " --key-name " + self.args.key_name + " --user-data " + user_data + security_group + " --wait " + self.args.name + " -f json") instance_id = self.get_value(json.loads(instance), 'id') os.unlink(user_data) self.associate_floating_ip(instance_id) ip = self.get_floating_ip_or_ip(instance_id) return self.cloud_init_wait(ip) def cluster_exists(self): """ Return true if there exists an instance running the teuthology cluster. """ instance = OpenStackInstance(self.args.name) if not instance.exists(): return False ip = self.get_floating_ip_or_ip(instance['id']) return self.cloud_init_wait(ip) def teardown(self): """ Delete all instances run by the teuthology cluster and delete the instance running the teuthology cluster. """ self.ssh("sudo /etc/init.d/teuthology stop || true") instance_id = self.get_instance_id(self.args.name) self.delete_floating_ip(instance_id) misc.sh("openstack server delete --wait " + self.args.name) def main(ctx, argv): return TeuthologyOpenStack(ctx, teuth_config, argv).main()
caibo2014/teuthology
teuthology/openstack/__init__.py
Python
mit
30,141
#ifndef COMMON_H #define COMMON_H #include "lib.h" #include "master-interface.h" #include "master-settings.h" extern uid_t master_uid; extern gid_t master_gid; extern bool core_dumps_disabled; extern const char *ssl_manual_key_password; extern int null_fd, master_dead_pipe_fd[2]; extern struct service_list *services; void process_exec(const char *cmd, const char *extra_args[]) ATTR_NORETURN; int get_uidgid(const char *user, uid_t *uid_r, gid_t *gid_r, const char **error_r); int get_gid(const char *group, gid_t *gid_r, const char **error_r); #endif
via/dovecot-clouddb
src/master/common.h
C
mit
567
const express = require('express'); const path = require('path'); const configurationFile = require('./config.json'); const logger = require('morgan'); const cookieParser = require('cookie-parser'); const bodyParser = require('body-parser'); const session = require('express-session'); const expressValidator = require('express-validator'); const flash = require('connect-flash'); // Setting up Firebase. const Firebase = require('firebase'); var config = { apiKey: configurationFile.apiKey, authDomain: configurationFile.authDomain, databaseURL: configurationFile.database_url, storageBucket: configurationFile.storageBucket, messagingSenderId: configurationFile.messagingSenderId }; Firebase.initializeApp(config); // App & Body-Parser setup. var app = express(); // Templating engine. app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'ejs'); // Logger setup. app.use(logger('dev')); // Body-parser app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); // Express-validation setup. app.use(expressValidator({ errorFormatter: function(param, msg, value) { var namespace = param.split('.') , root = namespace.shift() , formParam = root; while (namespace.length) { formParam += '[' + namespace.shift() + ']'; } return { param: formParam, msg: msg, value: value }; } })); // Express-session setup app.use(session({ secret: 'secret', resave: true, saveUninitialized: true })); // Connect-flash setup. app.use(flash()); app.use(function(req, res, next) { res.locals.success_msg = req.flash("success_msg"); res.locals.error_msg = req.flash("error_msg"); res.locals.error_message = req.flash("error_message"); res.locals.authdata = Firebase.auth().currentUser; res.locals.page = req.url; next(); }); app.get("*", function(req, res, next) { if (Firebase.auth().currentUser != null) { Firebase .database().ref('users') .orderByChild("uid") .startAt(Firebase.auth().currentUser.uid) .endAt(Firebase.auth().currentUser.uid) .on("child_added", function(snapshot) { res.locals.user = snapshot.val(); }); } next(); }); // Routing var users = require('./routes/users'); var routes = require('./routes/index'); var games = require('./routes/games'); var genres = require('./routes/genres'); app.use('/', routes); app.use('/users', users); app.use('/games', games); app.use('/genres', genres); // Directory setup. app.use(express.static(path.join(__dirname, 'public'))); // Set port and run server. app.set('port', configurationFile.port_number); app.listen(app.get('port'), function() { console.log("Server up and running on port: " + app.get('port')); });
mccroryp/video-game-collection
app.js
JavaScript
mit
2,895
/*``The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in * compliance with the License. You should have received a copy of the * Erlang Public License along with this software. If not, it can be * retrieved via the world wide web at http://www.erlang.org/. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Initial Developer of the Original Code is Ericsson Utvecklings AB. * Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings * AB. All Rights Reserved.'' * * Converted from Java to C# by Vlad Dumitrescu ([email protected]) */ namespace Otp { using System; /* * Represents a local OTP client or server node. It is used when you * want other nodes to be able to establish connections to this one. * * When you create an instance of this class, it will bind a socket to * a port so that incoming connections can be accepted. However the * port number will not be made available to other nodes wishing to * connect until you explicitely register with the port mapper daemon * by calling {@link #publishPort()}. * * <p> When the C# node will be connecting to a remote Erlang, C# * or C node, it must first identify itself as a node by creating an * instance of this class, after which it may connect to the remote * node. * * <p> Setting up a connection may be done as follows: * * * <pre> * OtpServer self = new OtpServer("server","cookie"); // identify self * self.publishPort(); // make port information available * * OtpConnection conn = self.accept(); // get incoming connection * </pre> * * @see OtpSelf * @deprecated the functionality of this class has been moved to {@link OtpSelf}. **/ public class OtpServer:OtpSelf { /*Create an {@link OtpServer} from an existing {@link OtpSelf}. * * @param self an existing self node. * * @exception C#.io.IOException if a ServerSocket could not be created. * **/ public OtpServer(OtpSelf self):base(self.node(), self.cookie()) { } /* * Create an OtpServer, using a vacant port chosen by the operating * system. To determine what port was chosen, call the object's * {@link #port()} method. * * @param node the name of the node. * * @param cookie the authorization cookie that will be used by this * node when accepts connections from remote nodes. * * @exception C#.io.IOException if a ServerSocket could not be created. * **/ public OtpServer(System.String node, System.String cookie):base(node, cookie) { } /* * Create an OtpServer, using the specified port number. * * @param node a name for this node, as above. * * @param cookie the authorization cookie that will be used by this * node when accepts connections from remote nodes. * * @param port the port number to bind the socket to. * * @exception C#.io.IOException if a ServerSocket could not be * created or if the chosen port number was not available. * **/ public OtpServer(System.String node, System.String cookie, int port):base(node, cookie, port) { } } }
spoconnor/ElixirMessagingServer
DotNet/OTP.NET-2010/Otp/OtpServer.cs
C#
mit
3,305
// import {GO_TO, CHANGE_USER_NAME, CHANGE_USER_HELP} from '../actions/login' // const init = { // uNameHelp: '', // userName:'' // } // //reducer其实也是个方法而已,参数是state和action,返回值是新的state // export default function counter(state = init , action) { // switch (action.type) { // case GO_TO: // console.log('action:' + JSON.stringify(action)); // return { // uNameHelp: action.uNameHelp, // userName: '' // } // case CHANGE_USER_NAME: // console.log('action:' + JSON.stringify(action)); // return { // uNameHelp: state.uNameHelp, // userName: action.userName // } // case CHANGE_USER_HELP: // console.log('action:' + JSON.stringify(action)); // return { // uNameHelp: action.uNameHelp, // userName: action.uNameHelp // } // default: // return state // } // }
Royzx/gallery-by-react
src/reducers/login.js
JavaScript
mit
955
/* * Copyright 2011-2013 the original author or authors. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package de.schildbach.wallet.goldcoin.ui; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.GZIPInputStream; import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Build; import android.os.Bundle; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.view.MenuItem; import com.google.goldcoin.core.ProtocolException; import com.google.goldcoin.core.Sha256Hash; import com.google.goldcoin.core.Transaction; import com.google.goldcoin.core.VerificationException; import com.google.goldcoin.core.Wallet; import de.schildbach.wallet.goldcoin.Constants; import de.schildbach.wallet.goldcoin.WalletApplication; import de.schildbach.wallet.goldcoin.util.Base43; import de.schildbach.wallet.goldcoin.util.NfcTools; import de.schildbach.wallet.goldcoin.R; /** * @author Andreas Schildbach */ public final class TransactionActivity extends AbstractWalletActivity { public static final String INTENT_EXTRA_TRANSACTION_HASH = "transaction_hash"; private static final String EXTRA_NDEF_MESSAGES = "android.nfc.extra.NDEF_MESSAGES"; // API level 10 private Object nfcManager; private Transaction tx; public static void show(final Context context, final Transaction tx) { final Intent intent = new Intent(context, TransactionActivity.class); intent.putExtra(TransactionActivity.INTENT_EXTRA_TRANSACTION_HASH, tx.getHash()); context.startActivity(intent); } @SuppressLint("InlinedApi") @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); nfcManager = getSystemService(Context.NFC_SERVICE); setContentView(R.layout.transaction_content); final ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); handleIntent(getIntent()); } @Override protected void onResume() { super.onResume(); updateView(); } @Override public void onPause() { if (nfcManager != null) NfcTools.unpublish(nfcManager, this); super.onPause(); } private void handleIntent(final Intent intent) { final Uri intentUri = intent.getData(); final String scheme = intentUri != null ? intentUri.getScheme() : null; if (intent.hasExtra(INTENT_EXTRA_TRANSACTION_HASH)) { final Wallet wallet = ((WalletApplication) getApplication()).getWallet(); tx = wallet.getTransaction((Sha256Hash) intent.getSerializableExtra(INTENT_EXTRA_TRANSACTION_HASH)); } else if (intentUri != null && "gldtx".equals(scheme)) { try { // decode transaction URI final String part = intentUri.getSchemeSpecificPart(); final boolean useCompression = part.charAt(0) == 'Z'; final byte[] bytes = Base43.decode(part.substring(1)); InputStream is = new ByteArrayInputStream(bytes); if (useCompression) is = new GZIPInputStream(is); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final byte[] buf = new byte[4096]; int read; while (-1 != (read = is.read(buf))) baos.write(buf, 0, read); baos.close(); is.close(); tx = new Transaction(Constants.NETWORK_PARAMETERS, baos.toByteArray()); processPendingTransaction(tx); } catch (final IOException x) { throw new RuntimeException(x); } catch (final ProtocolException x) { throw new RuntimeException(x); } } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD_MR1 && Constants.MIMETYPE_TRANSACTION.equals(intent.getType())) { final Object ndefMessage = intent.getParcelableArrayExtra(EXTRA_NDEF_MESSAGES)[0]; final byte[] payload = NfcTools.extractMimePayload(Constants.MIMETYPE_TRANSACTION, ndefMessage); try { tx = new Transaction(Constants.NETWORK_PARAMETERS, payload); processPendingTransaction(tx); } catch (final ProtocolException x) { throw new RuntimeException(x); } } if (tx == null) throw new IllegalArgumentException("no tx"); } @Override public boolean onOptionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; } return super.onOptionsItemSelected(item); } private void updateView() { final TransactionFragment transactionFragment = (TransactionFragment) getSupportFragmentManager().findFragmentById(R.id.transaction_fragment); transactionFragment.update(tx); if (nfcManager != null) NfcTools.publishMimeObject(nfcManager, this, Constants.MIMETYPE_TRANSACTION, tx.unsafeLitecoinSerialize(), false); } private void processPendingTransaction(final Transaction tx) { final Wallet wallet = ((WalletApplication) getApplication()).getWallet(); try { if (wallet.isTransactionRelevant(tx)) // TODO dependent transactions wallet.receivePending(tx, null); } catch (final VerificationException x) { throw new RuntimeException(x); } } }
goldcoin/goldcoin-android
goldcoin-wallet/wallet/src/de/schildbach/wallet/goldcoin/ui/TransactionActivity.java
Java
mit
5,714
# 持久化工具 ## mongo-driver/mongo mongo官方驱动 [项目地址](https://github.com/mongodb/mongo-go-driver) 使用要求 - Go 1.10 or higher - MongoDB 2.6 and higher ```bash dep ensure -v -add "go.mongodb.org/mongo-driver/mongo@~1.0.0" ``` ## yiigo golang 辅助库 支持 MySQL PostgreSQL mongo redis gomail toml sqlx zap 这些涉及持久化的工具 [项目地址](https://github.com/iiinsomnia/yiigo/tree/v3) - 支持多 [MySQL](https://github.com/go-sql-driver/mysql) 连接 - 支持多 [PostgreSQL](https://github.com/lib/pq) 连接 - 支持多 [mongo](https://github.com/mongodb/mongo-go-driver) 连接 - 支持多 [redis](https://github.com/gomodule/redigo) 连接 - 支持 [gomail](https://github.com/go-gomail/gomail) 邮件发送 - 支持 [toml](https://github.com/pelletier/go-toml) 文件配置 - 采用 [sqlx](https://github.com/jmoiron/sqlx) 处理SQL查询 - 采用 [zap](https://github.com/uber-go/zap) 日志记录 [文档地址](https://godoc.org/github.com/iiinsomnia/yiigo) ## kiteq 多种持久化方案的mq框架 [项目地址](https://github.com/blackbeans/kiteq) 介绍 - 基于zk/etcd维护发送方、订阅方、broker订阅发送关系、支持水平、垂直方面的扩展 - 基于与topic以及第二级messageType订阅消息 - 基于mysql、文件存储方式多重持久层消息存储 - 保证可靠异步投递 - 支持两阶段提交分布式事务 - 自定义group内的Topic级别的流控措施,保护订阅方安全 - kiteserver的流量保护 概念 - Binding:订阅关系,描述订阅某种消息类型的数据结构 - Consumer : 消息的消费方 - Producer : 消息的发送方 - Topic: 消息的主题比如 Trade则为消息主题,一般可以定义为某种业务类型 - MessageType: 第二级别的消息类型,比如Trade下存在支付成功的pay-succ-200的消息类型 ### Use - 编译安装 ```sh get clone [email protected]:blackbeans/kiteq.git cd kiteq build.sh ``` 安装装Zookeeper:省略(或者安装etcd) 修改文件 `kiteq.sh` ```sh ./kiteq -clusterName=集群名称 -configPath=配置文件路径 ./kiteq -bind=172.30.3.124:13800 -pport=13801 -db="mock://kiteq" -topics=trade,feed -zkhost=localhost:2181 ``` -bind //绑定本地IP:Port -pport //pprof的Http端口 -db //存储的协议地址 mock:// 启动mock模式 mysql:// mmap:// -topics //本机可以处理的topics列表逗号分隔 -zkhost //zk的地址 文件样例见[conf/cluster.toml](https://raw.githubusercontent.com/blackbeans/kiteq/master/conf/cluster.toml) - 使用 go客户端使用 KiteQClient需要实现消息监听器 ```golang type IListener interface { //接受投递消息的回调 OnMessage(msg *protocol.StringMessage) bool //接收事务回调 // 除非明确提交成功、其余都为不成功 // 有异常或者返回值为false均为不提交 OnMessageCheck(tx *protocol.TxResponse) error } ``` 启动Producer ```golang producer := client.NewKiteQClient(${zkhost}, ${groupId}, ${password}, &defualtListener{}) producer.SetTopics([]string{"trade"}) producer.Start() //构建消息 msg := &protocol.StringMessage{} msg.Header = &protocol.Header{ MessageId: proto.String(store.MessageId()), Topic: proto.String("trade"), MessageType: proto.String("pay-succ"), ExpiredTime: proto.Int64(time.Now().Unix()), DeliveryLimit: proto.Int32(-1), GroupId: proto.String("go-kite-test"), Commit: proto.Bool(true)} msg.Body = proto.String("echo") //发送消息 producer.SendStringMessage(msg) ``` 启动Consumer ```golang consumer:= client.NewKiteQClient(${zkhost}, ${groupId}, ${password}, &defualtListener{}) consumer.SetBindings([]*binding.Binding{ binding.Bind_Direct("s-mts-test", "trade", "pay-succ", 1000, true), }) consumer.Start() ``` ## blackbeans/flume-bridge flume的go语言客户端 使用redis作为缓存,zk作为服务发现,作为分布式的内容,协议使用thrift use redis queue integration thrift Server lookup use zk https://github.com/blackbeans/flume-bridge
sinlov/golang-open-project
zh/12.1-持久化工具.md
Markdown
mit
4,093
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Behat\Context\Ui; use Behat\Behat\Context\Context; use Sylius\Behat\Page\Admin\Channel\CreatePageInterface; use Sylius\Behat\Page\Shop\HomePageInterface; use Sylius\Behat\Service\Setter\ChannelContextSetterInterface; use Sylius\Component\Channel\Repository\ChannelRepositoryInterface; use Sylius\Component\Core\Model\ChannelInterface; use Sylius\Behat\Service\SharedStorageInterface; /** * @author Kamil Kokot <[email protected]> */ final class ChannelContext implements Context { /** * @var SharedStorageInterface */ private $sharedStorage; /** * @var ChannelContextSetterInterface */ private $channelContextSetter; /** * @var ChannelRepositoryInterface */ private $channelRepository; /** * @var CreatePageInterface */ private $channelCreatePage; /** * @var HomePageInterface */ private $homePage; /** * @param SharedStorageInterface $sharedStorage * @param ChannelContextSetterInterface $channelContextSetter * @param ChannelRepositoryInterface $channelRepository * @param CreatePageInterface $channelCreatePage * @param HomePageInterface $homePage */ public function __construct( SharedStorageInterface $sharedStorage, ChannelContextSetterInterface $channelContextSetter, ChannelRepositoryInterface $channelRepository, CreatePageInterface $channelCreatePage, HomePageInterface $homePage ) { $this->sharedStorage = $sharedStorage; $this->channelContextSetter = $channelContextSetter; $this->channelRepository = $channelRepository; $this->channelCreatePage = $channelCreatePage; $this->homePage = $homePage; } /** * @Given /^I changed (?:|back )my current (channel to "([^"]+)")$/ * @Given /^the customer changed (?:|back )current (channel to "([^"]+)")$/ * @When /^I change (?:|back )my current (channel to "([^"]+)")$/ */ public function iChangeMyCurrentChannelTo(ChannelInterface $channel) { $this->channelContextSetter->setChannel($channel); } /** * @When I create a new channel :channelName */ public function iCreateNewChannel($channelName) { $this->channelCreatePage->open(); $this->channelCreatePage->nameIt($channelName); $this->channelCreatePage->specifyCode($channelName); $this->channelCreatePage->create(); $channel = $this->channelRepository->findOneBy(['name' => $channelName]); $this->sharedStorage->set('channel', $channel); } /** * @When /^I visit (this channel)'s homepage$/ */ public function iVisitChannelHomepage(ChannelInterface $channel) { $this->channelContextSetter->setChannel($channel); $this->homePage->open(); } }
sweoggy/Sylius
src/Sylius/Behat/Context/Ui/ChannelContext.php
PHP
mit
3,077
require 'test_helper' class PasswordTest < ActiveSupport::TestCase test 'should create password hash' do assert hashed_password end test 'should return NullPassword for invalid hash' do assert_kind_of( MinimalistAuthentication::NullPassword, MinimalistAuthentication::Password.new('').bcrypt_password ) end test 'should return false for stale?' do refute hashed_password.stale? end test 'should return true for stale?' do password = hashed_password password.expects(:cost).returns(0) assert password.stale? end private def hashed_password MinimalistAuthentication::Password.create('testing') end end
wwidea/minimalist_authentication
test/password_test.rb
Ruby
mit
672
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('deal', '0005_deal_features_benefits'), ] operations = [ migrations.RenameField( model_name='deal', old_name='savings_unit', new_name='savings_per_unit', ), ]
raytung/Slice
deal/migrations/0006_auto_20141022_0056.py
Python
mit
402
using Microsoft.IdentityModel.Clients.ActiveDirectory; using Newtonsoft.Json; using System; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; namespace Microsoft_Graph_Mail_Console_App { public static class MailClient { // The Azure AD instance where you domain is hosted public static string AADInstance { get { return "https://login.microsoftonline.com"; } } // The Office 365 domain (e.g. contoso.microsoft.com) public static string Domain { get { return "[YOUR DOMAIN]"; } } // The authority for authentication; combining the AADInstance // and the domain. public static string Authority { get { return string.Format("{0}/{1}/", AADInstance, Domain); } } // The client Id of your native Azure AD application public static string ClientId { get { return "[YOUR CLIENT ID]"; } } // The redirect URI specified in the Azure AD application public static Uri RedirectUri { get { return new Uri("[YOUR REDIRECT URI]"); } } // The resource identifier for the Microsoft Graph public static string GraphResource { get { return "https://graph.microsoft.com/"; } } // The Microsoft Graph version, can be "v1.0" or "beta" public static string GraphVersion { get { return "v1.0"; } } // Get an access token for the Microsoft Graph using ADAL public static string GetAccessToken() { // Create the authentication context (ADAL) var authenticationContext = new AuthenticationContext(Authority); // Get the access token var authenticationResult = authenticationContext.AcquireToken(GraphResource, ClientId, RedirectUri, PromptBehavior.RefreshSession); var accessToken = authenticationResult.AccessToken; return accessToken; } // Prepare an HttpClient with the an authorization header (access token) public static HttpClient GetHttpClient(string accessToken) { // Create the HTTP client with the access token var httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); return httpClient; } // Get the current user using a prepared HttpClient (with an authorization header) public static async Task<UserModel> GetUserAsync(HttpClient httpClient) { // Get and deserialize the user var userResponse = await httpClient.GetStringAsync(GraphResource + GraphVersion + "/me/"); var user = JsonConvert.DeserializeObject<UserModel>(userResponse); return user; } // Create the mail structure needed to make a request to the Microsoft Graph public static MailModel CreateMail(string subject, string body, params string[] recipients) { var mail = new MailModel { Message = new MessageModel { ToRecipients = recipients.Select(recipient => new ToRecipientModel { EmailAddress = new EmailAddressModel { Address = recipient } }).ToList(), Subject = subject, Body = new BodyModel { ContentType = "html", Content = body } } }; return mail; } // Send a mail using a prepared HttpClient (with an authorization header) private static async Task<bool> SendMailAsync(HttpClient httpClient, MailModel mail) { // Serialize the mail var stringContent = JsonConvert.SerializeObject(mail); // Send using POST var response = await httpClient.PostAsync(GraphResource + GraphVersion + "/me/microsoft.graph.sendMail", new StringContent(stringContent, Encoding.UTF8, "application/json")); return response.IsSuccessStatusCode; } // Send a mail to the current user public static async Task SendMeAsync() { // Get an access token and configure the HttpClient var accessToken = GetAccessToken(); var httpClient = GetHttpClient(accessToken); // Get the current user (to extract the mail address) var user = await GetUserAsync(httpClient); // Create the mail (HTML) var mail = CreateMail("Hello #Office365Dev", "<strong>Lorem ipsum dolor sit amet</strong>, consectetur adipiscing " + "elit, sed do eiusmod tempor incididunt ut labore et dolore " + "magna aliqua. Ut enim ad minim veniam, quis nostrud " + "exercitation ullamco laboris nisi ut aliquip ex ea commodo " + "consequat. Duis aute irure dolor in reprehenderit in voluptate " + "velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint " + "occaecat cupidatat non proident, sunt in culpa qui officia deserunt " + "mollit anim id est laborum.", user.Mail); // Send the mail and check for success var isSuccess = await SendMailAsync(httpClient, mail); if (isSuccess) { Console.Write("Ooh... check your mailbox!"); } else { // TODO: Handle error Console.Write("Oops... something went wrong!"); } } } }
simonjaeger/OfficeDev-HOL
Microsoft-Graph-Mail-Console-App/Source/MailClient.cs
C#
mit
6,035
/*- * Copyright (c) 2009-2010 Brad Penoff * Copyright (c) 2009-2010 Humaira Kamal * Copyright (c) 2011-2012 Irene Ruengeler * Copyright (c) 2011-2012 Michael Tuexen * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* __Userspace__ */ #include <stdlib.h> #if !defined (__Userspace_os_Windows) #include BOSS_FAKEWIN_V_stdint_h //original-code:<stdint.h> #include BOSS_USRSCTP_V_netinet__sctp_os_userspace_h //original-code:<netinet/sctp_os_userspace.h> #endif #include BOSS_USRSCTP_V_user_environment_h //original-code:<user_environment.h> #include <sys/types.h> /* #include <sys/param.h> defines MIN */ #if !defined(MIN) #define MIN(arg1,arg2) ((arg1) < (arg2) ? (arg1) : (arg2)) #endif #include <string.h> #define uHZ 1000 /* See user_include/user_environment.h for comments about these variables */ int maxsockets = 25600; int hz = uHZ; int ip_defttl = 64; int ipport_firstauto = 49152, ipport_lastauto = 65535; int nmbclusters = 65536; /* Source ip_output.c. extern'd in ip_var.h */ u_short ip_id = 0; /*__Userspace__ TODO Should it be initialized to zero? */ /* used in user_include/user_atomic.h in order to make the operations * defined there truly atomic */ userland_mutex_t atomic_mtx; /* If the entropy device is not loaded, make a token effort to * provide _some_ kind of randomness. This should only be used * inside other RNG's, like arc4random(9). */ #if defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_Darwin) static int read_random_phony(void *buf, int count) { if (count >= 0) { arc4random_buf(buf, count); } return (count); } #else static int read_random_phony(void *buf, int count) { uint32_t randval; int size, i; /* srandom() is called in kern/init_main.c:proc0_post() */ /* Fill buf[] with random(9) output */ for (i = 0; i < count; i+= (int)sizeof(uint32_t)) { randval = random(); size = MIN(count - i, (int)sizeof(uint32_t)); memcpy(&((char *)buf)[i], &randval, (size_t)size); } return (count); } #endif static int (*read_func)(void *, int) = read_random_phony; /* Userland-visible version of read_random */ int read_random(void *buf, int count) { return ((*read_func)(buf, count)); }
koobonil/Boss2D
Boss2D/addon/usrsctp-0.9.3.0_for_boss/usrsctplib/user_environment.c
C
mit
3,427
from __future__ import division from __future__ import print_function from __future__ import absolute_import import traceback import sys def handle_exception(msg=''): """This function is the project's exception handler. There is currently no logic, but could be easily added in the future. :param msg: The message to print to the user. :return: Nothing, actually exits the program. """ print(msg) traceback.print_exc() sys.exit(1)
onfido/dependencies-resolver
dependencies_resolver/utils/exception_handler.py
Python
mit
469
[![Travis](https://travis-ci.org/pmoelgaard/address-validation-autocomplete.svg)](Travis) Node JavaScript wrapper for [the streetlayer API](https://streetlayer.com). Supports both traditional callbacks and Promises/A+. --- ## Installation npm install address-validation-autocomplete [--save] ## Configuration Before using the numverify API client you have to setup your account and obtain your API Access Key. You can get it by signing up at [https://streetlayer.com/product](https://streetlayer.com/product). --- ## Usage The general API is documented here: [https://streetlayer.com/documentation](https://streetlayer.com/documentation). You can find parameters, result set definitions and status codes documented here as well. ### Setup var API = require('address-validation-autocomplete'); var api = new API({ access_key: [ACCESS_KEY], secure: [true|false] (Optional, defaults to false) }); #### Optional Parameters ##### Secure (only available for Basic, Pro and Enterprise accounts) Boolean value to indicate if the calls to the API should use a secure protocol or insecure (HTTP/HTTPS). Defaults to false (HTTP, insecure). --- ## Callbacks vs. Promises The Promises/A+ implementation used for this is this excellent bare bones library: [https://www.npmjs.com/package/promise](https://www.npmjs.com/package/promise) The phone-number-validation library supports either mode and use of either one is not mutually exclusive to the alternative, so it's possible to use one exclusively or a combination, even in the same call, both the callback will be called and the promise handlers invoked. --- ## API Overview All endpoints in the public API is available through this library. - validate - autocomplete - reverse --- ## validate Verify an address. ###### Define Query var query = { address1: '767 5th Ave', postal_code: '10153', locality: 'New York', country_code: 'US' }; ###### Simple Request (using Callback) api.validate(query, function (err, result) { if (err) { return console.log('Validate Callback (Error): ' + JSON.stringify(err)); } console.log('Validate Callback (Success): ' + JSON.stringify(result)); }); ###### Response ``` { "validation_status": "valid", "address_components": { "country_code_alpha2": "US", "country_code_alpha3": "USA", "country": "United States", "county": "New York County", "locality": "New York", "postal_code": "10153", "region": "New York", "street": "5 Avenue", "housenumber": "767", "neighbourhood": "Midtown" }, "validation_result": { "locality": true, "county": null, "region": null, "postal_code": true, "street": true, "housenumber": true }, "formatted_address": [ "5 Avenue 767", "New York, 10153", "United States" ], "coordinates": { "latitude": 40.763554, "longitude": -73.972839 } } ``` ## autocomplete Get address suggestions based on string. ###### Define Query var query = { text: '767 5th A', country_code: 'USA' }; ###### Simple Request (using Callback) api.autocomplete(function (err, result) { if (err) { return console.log('AutoComplete Callback (Error): ' + JSON.stringify(err)); } console.log('AutoComplete Callback (Success): ' + JSON.stringify(result)); }); ###### Response ``` { "success": true, "results": [ { "address_components": { "country_code_alpha2": "US", "country_code_alpha3": "USA", "country": "United States", "county": "San Diego County", "locality": "Chula Vista", "postal_code": "91910", "region": "California", "street": "5th Avenue", "housenumber": "767", "neighbourhood": "Mid-Broadway District" }, "formatted_address": [ "5th Avenue 767", "Chula Vista, 91910", "United States" ], "coordinates": { "latitude": 32.622941, "longitude": -117.081476 } }, { "address_components": { "country_code_alpha2": "US", "country_code_alpha3": "USA", "country": "United States", "county": "New York County", "locality": "New York", "postal_code": "10153", "region": "New York", "street": "5th Avenue", "housenumber": "767", "neighbourhood": "Midtown" }, "formatted_address": [ "5th Avenue 767", "New York, 10153", "United States" ], "coordinates": { "latitude": 40.763528, "longitude": -73.972801 } }, [...] ``` ## reverse Get address suggestions based on string. ###### Define Query var query = { latitude: 40.763528, longitude: -73.972801 }; ###### Simple Request (using Callback) api.reverse(function (err, result) { if (err) { return console.log('Reverse Callback (Error): ' + JSON.stringify(err)); } console.log('Reverse Callback (Success): ' + JSON.stringify(result)); }); ###### Response ``` { "success": true, "results": [ { "address_components": { "country_code_alpha2": "US", "country_code_alpha3": "USA", "country": "United States", "county": "New York County", "locality": "New York", "postal_code": "10153", "region": "New York", "street": "5 Avenue", "housenumber": "767", "neighbourhood": "Midtown" }, "formatted_address": [ "5 Avenue 767", "New York, 10153", "United States" ], "coordinates": { "latitude": 40.763554, "longitude": -73.972839 } }, { "address_components": { "country_code_alpha2": "US", "country_code_alpha3": "USA", "country": "United States", "county": "New York County", "locality": "New York", "postal_code": "10022", "region": "New York", "street": "East 58 Street", "housenumber": "12", "neighbourhood": "Midtown" }, "formatted_address": [ "East 58 Street 12", "New York, 10022", "United States" ], "coordinates": { "latitude": 40.763268, "longitude": -73.972842 } }, [...] ``` --- ## Customer Support Need any assistance? [Get in touch with Customer Support](mailto:[email protected]?subject=%streetlayer%5D). --- ## Updates Stay up to date by following [@apilayernet](https://twitter.com/apilayernet) on Twitter. --- ## Legal All usage of the numverify website, API, and services is subject to the [streetlayer Terms & Conditions](https://streetlayer.com/terms) and all annexed legal documents and agreements. --- ## Author Peter Andreas Moelgaard ([GitHub](https://github.com/pmoelgaard), [Twitter](https://twitter.com/petermoelgaard)) --- ## License Licensed under the The MIT License (MIT) Copyright (&copy;) 2017 Peter Andreas Moelgaard & apilayer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
pmoelgaard/address-validation-autocomplete
README.md
Markdown
mit
8,352
# -*- coding: utf-8 -*- """ handlers ~~~~~~~~ api. :copyright: 2010 by toomore_such project. :license: MIT, see LICENSE for more details. """ import logging import simplejson as json from google.appengine.ext import db from tipfy import RequestHandler, Response, render_json_response from tipfy.ext.acl import Acl, AclRules from werkzeug.exceptions import BadRequest, NotFound, InternalServerError from apps.api.models import PEDoc, AclRulesPlus from my_utils import render_escaped_json_response, ConflictError, \ required_admin_role class BaseHandler(RequestHandler): def _json_to_obj(self, doc): try: doc_values = json.loads(doc) except (TypeError, json.decoder.JSONDecodeError): self.abort(404) return doc_values def _get_doc_values(self, request): if self.request.is_xhr: doc_values = self.request.values.to_dict() else: try: doc = self.request.values.to_dict()['_doc'] try: doc_values = self._json_to_obj(doc) except NotFound: self.abort(404) except AttributeError: self.abort(404) return doc_values def _get_doc_values_and_id(self, request): doc_values = self._get_doc_values(request) try: doc_id = doc_values['_docId'] except KeyError: doc_id = None return (doc_values, doc_id) class DocHandler(BaseHandler): def _after( self, doc_id, doc_type, doc_values, ): if doc_id and PEDoc.get_by_key_name(doc_id): try: result = PEDoc.update_and_get_by_dict(doc_id, doc_type, doc_values) except ConflictError: return Response(status=409) except InternalServerError: return Response(status=500) else: try: result = PEDoc.create_and_get_by_dict(doc_id, doc_type, doc_values) except InternalServerError: return Response(status=500) return render_escaped_json_response(result) class DocByDocTypeHandler(DocHandler): def post(self, doc_type): try: (doc_values, doc_id) = self._get_doc_values_and_id(self.request) except NotFound: return Response(status=404) return self._after(doc_id, doc_type, doc_values) def put(self, doc_type): try: (doc_values, doc_id) = self._get_doc_values_and_id(self.request) except NotFound: return Response(status=404) if doc_id and PEDoc.get_by_key_name(doc_id) is None: return Response(status=404) return self._after(doc_id, doc_type, doc_values) def get(self, doc_type): models = PEDoc.gql('WHERE docType = :1', doc_type) try: result = {doc_type: [PEDoc.convert_dict(i) for i in models]} except AttributeError: return Response(status=404) return render_escaped_json_response(result) class DocByDocIdHandler(DocHandler): def post(self, doc_type, doc_id): if self.request.args.get('_method') == 'delete': return self.delete(doc_type, doc_id) try: doc_values = self._get_doc_values(self.request) except NotFound: return Response(status=404) return self._after(doc_id, doc_type, doc_values) def put(self, doc_type, doc_id): if PEDoc.get_by_key_name(doc_id) is None: return Response(status=404) try: doc_values = self._get_doc_values(self.request) except NotFound: return Response(status=404) return self._after(doc_id, doc_type, doc_values) def delete(self, doc_type, doc_id): updated_at = self.request.args.get('_checkUpdatesAfter') if updated_at is None: updated_at = self.request.args.get('_updatedAt') try: result = PEDoc.delete_in_txn(doc_id, updated_at) except NotFound: return Response(status=404) except ConflictError: return Response(status=409) except InternalServerError: return Response(status=500) return Response(status=200) def get(self, doc_type, doc_id): model = PEDoc.get_by_key_name(doc_id) try: result = PEDoc.convert_dict(model) except AttributeError: return Response(status=404) return render_escaped_json_response(result) class ACLHandler(BaseHandler): def _flatten_doc_values(self, docs): doc_values = {} for i in docs: try: doc_values.update(i) except ValueError: self.abort(404) return doc_values def _admins(self, acls): return frozenset([i.user for i in acls if Acl(i.area, i.user).is_one('admin')]) def _members(self, doc_values): return frozenset([key for key in doc_values.keys() if doc_values[key] != 'admin']) def _has_admin(self, doc_values): return True in [doc_values[key] == 'admin' for key in doc_values.keys()] def _400(self): return Response(response='{"error": "No Admin"}', status=400, mimetype='application/json') class ACLforDocTypeHandler(ACLHandler): def post(self, doc_type): acls_count = AclRulesPlus.get_by_area(doc_type).count() @required_admin_role(doc_type, acls_count) def inner(): try: docs = self._get_doc_values(self.request) doc_values = self._flatten_doc_values(docs) except NotFound: return Response(status=404) acls = AclRulesPlus.get_by_area(doc_type) no_admin = self._has_admin(doc_values) is False if acls.count() == 0: if no_admin: return self._400() else: if no_admin and self._members(doc_values) >= self._admins(acls): return self._400() for key in doc_values.keys(): AclRules.insert_or_update(doc_type, key, [doc_values[key]]) result = {doc_type: AclRulesPlus.get_by_list(doc_type)} return render_escaped_json_response(result) return inner() def put(self, doc_type): @required_admin_role(doc_type) def inner(): acls = AclRulesPlus.get_by_area(doc_type) if acls.count() == 0: return Response(status=404) return self.post(doc_type) return inner() def delete(self, doc_type): pass def get(self, doc_type): return Response(response='{"error": "No Admin"}', status=400, mimetype='application/json')
toomoresuch/pysonengine
app/apps/api/handlers.py
Python
mit
7,029
module HealthSeven::V2_5 class AdtA38 < ::HealthSeven::Message attribute :msh, Msh, position: "MSH", require: true attribute :sfts, Array[Sft], position: "SFT", multiple: true attribute :evn, Evn, position: "EVN", require: true attribute :pid, Pid, position: "PID", require: true attribute :pd1, Pd1, position: "PD1" attribute :pv1, Pv1, position: "PV1", require: true attribute :pv2, Pv2, position: "PV2" attribute :db1s, Array[Db1], position: "DB1", multiple: true attribute :obxes, Array[Obx], position: "OBX", multiple: true attribute :dg1s, Array[Dg1], position: "DG1", multiple: true attribute :drg, Drg, position: "DRG" end end
niquola/health_seven
lib/health_seven/2.5/messages/adt_a38.rb
Ruby
mit
656
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { // Public Properties logo: string = 'assets/logo.svg'; }
ehorodyski/ng2-tesla-range-calculator
src/app/app.component.ts
TypeScript
mit
246
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // ANTLR Version: 4.6.4 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ // Generated from C:\Users\dotne\source\repos\spectnetide\Assembler\AntlrZ80TestParserGenerator\AntlrZ80TestParserGenerator\Z80Test.g4 by ANTLR 4.6.4 // Unreachable code detected #pragma warning disable 0162 // The variable '...' is assigned but its value is never used #pragma warning disable 0219 // Missing XML comment for publicly visible type or member '...' #pragma warning disable 1591 // Ambiguous reference in cref attribute #pragma warning disable 419 namespace Spect.Net.TestParser.Generated { using Antlr4.Runtime.Misc; using IParseTreeListener = Antlr4.Runtime.Tree.IParseTreeListener; using IToken = Antlr4.Runtime.IToken; /// <summary> /// This interface defines a complete listener for a parse tree produced by /// <see cref="Z80TestParser"/>. /// </summary> [System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.6.4")] [System.CLSCompliant(false)] public interface IZ80TestListener : IParseTreeListener { /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.compileUnit"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterCompileUnit([NotNull] Z80TestParser.CompileUnitContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.compileUnit"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitCompileUnit([NotNull] Z80TestParser.CompileUnitContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.testSet"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterTestSet([NotNull] Z80TestParser.TestSetContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.testSet"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitTestSet([NotNull] Z80TestParser.TestSetContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.sp48Mode"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterSp48Mode([NotNull] Z80TestParser.Sp48ModeContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.sp48Mode"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitSp48Mode([NotNull] Z80TestParser.Sp48ModeContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.sourceContext"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterSourceContext([NotNull] Z80TestParser.SourceContextContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.sourceContext"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitSourceContext([NotNull] Z80TestParser.SourceContextContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.callstub"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterCallstub([NotNull] Z80TestParser.CallstubContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.callstub"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitCallstub([NotNull] Z80TestParser.CallstubContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.testOptions"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterTestOptions([NotNull] Z80TestParser.TestOptionsContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.testOptions"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitTestOptions([NotNull] Z80TestParser.TestOptionsContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.testOption"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterTestOption([NotNull] Z80TestParser.TestOptionContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.testOption"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitTestOption([NotNull] Z80TestParser.TestOptionContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.dataBlock"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterDataBlock([NotNull] Z80TestParser.DataBlockContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.dataBlock"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitDataBlock([NotNull] Z80TestParser.DataBlockContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.dataBlockBody"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterDataBlockBody([NotNull] Z80TestParser.DataBlockBodyContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.dataBlockBody"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitDataBlockBody([NotNull] Z80TestParser.DataBlockBodyContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.valueDef"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterValueDef([NotNull] Z80TestParser.ValueDefContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.valueDef"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitValueDef([NotNull] Z80TestParser.ValueDefContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.memPattern"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterMemPattern([NotNull] Z80TestParser.MemPatternContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.memPattern"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitMemPattern([NotNull] Z80TestParser.MemPatternContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.memPatternBody"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterMemPatternBody([NotNull] Z80TestParser.MemPatternBodyContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.memPatternBody"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitMemPatternBody([NotNull] Z80TestParser.MemPatternBodyContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.byteSet"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterByteSet([NotNull] Z80TestParser.ByteSetContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.byteSet"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitByteSet([NotNull] Z80TestParser.ByteSetContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.wordSet"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterWordSet([NotNull] Z80TestParser.WordSetContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.wordSet"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitWordSet([NotNull] Z80TestParser.WordSetContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.text"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterText([NotNull] Z80TestParser.TextContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.text"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitText([NotNull] Z80TestParser.TextContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.portMock"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterPortMock([NotNull] Z80TestParser.PortMockContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.portMock"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitPortMock([NotNull] Z80TestParser.PortMockContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.portPulse"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterPortPulse([NotNull] Z80TestParser.PortPulseContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.portPulse"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitPortPulse([NotNull] Z80TestParser.PortPulseContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.initSettings"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterInitSettings([NotNull] Z80TestParser.InitSettingsContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.initSettings"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitInitSettings([NotNull] Z80TestParser.InitSettingsContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.setupCode"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterSetupCode([NotNull] Z80TestParser.SetupCodeContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.setupCode"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitSetupCode([NotNull] Z80TestParser.SetupCodeContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.cleanupCode"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterCleanupCode([NotNull] Z80TestParser.CleanupCodeContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.cleanupCode"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitCleanupCode([NotNull] Z80TestParser.CleanupCodeContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.invokeCode"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterInvokeCode([NotNull] Z80TestParser.InvokeCodeContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.invokeCode"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitInvokeCode([NotNull] Z80TestParser.InvokeCodeContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.testBlock"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterTestBlock([NotNull] Z80TestParser.TestBlockContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.testBlock"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitTestBlock([NotNull] Z80TestParser.TestBlockContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.testParams"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterTestParams([NotNull] Z80TestParser.TestParamsContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.testParams"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitTestParams([NotNull] Z80TestParser.TestParamsContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.testCase"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterTestCase([NotNull] Z80TestParser.TestCaseContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.testCase"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitTestCase([NotNull] Z80TestParser.TestCaseContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.arrange"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterArrange([NotNull] Z80TestParser.ArrangeContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.arrange"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitArrange([NotNull] Z80TestParser.ArrangeContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.assignment"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterAssignment([NotNull] Z80TestParser.AssignmentContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.assignment"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitAssignment([NotNull] Z80TestParser.AssignmentContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.regAssignment"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterRegAssignment([NotNull] Z80TestParser.RegAssignmentContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.regAssignment"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitRegAssignment([NotNull] Z80TestParser.RegAssignmentContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.flagStatus"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterFlagStatus([NotNull] Z80TestParser.FlagStatusContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.flagStatus"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitFlagStatus([NotNull] Z80TestParser.FlagStatusContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.memAssignment"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterMemAssignment([NotNull] Z80TestParser.MemAssignmentContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.memAssignment"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitMemAssignment([NotNull] Z80TestParser.MemAssignmentContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.act"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterAct([NotNull] Z80TestParser.ActContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.act"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitAct([NotNull] Z80TestParser.ActContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.breakpoint"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterBreakpoint([NotNull] Z80TestParser.BreakpointContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.breakpoint"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitBreakpoint([NotNull] Z80TestParser.BreakpointContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.assert"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterAssert([NotNull] Z80TestParser.AssertContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.assert"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitAssert([NotNull] Z80TestParser.AssertContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.reg8"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterReg8([NotNull] Z80TestParser.Reg8Context context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.reg8"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitReg8([NotNull] Z80TestParser.Reg8Context context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.reg8Idx"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterReg8Idx([NotNull] Z80TestParser.Reg8IdxContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.reg8Idx"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitReg8Idx([NotNull] Z80TestParser.Reg8IdxContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.reg8Spec"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterReg8Spec([NotNull] Z80TestParser.Reg8SpecContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.reg8Spec"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitReg8Spec([NotNull] Z80TestParser.Reg8SpecContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.reg16"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterReg16([NotNull] Z80TestParser.Reg16Context context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.reg16"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitReg16([NotNull] Z80TestParser.Reg16Context context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.reg16Idx"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterReg16Idx([NotNull] Z80TestParser.Reg16IdxContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.reg16Idx"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitReg16Idx([NotNull] Z80TestParser.Reg16IdxContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.reg16Spec"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterReg16Spec([NotNull] Z80TestParser.Reg16SpecContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.reg16Spec"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitReg16Spec([NotNull] Z80TestParser.Reg16SpecContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.flag"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterFlag([NotNull] Z80TestParser.FlagContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.flag"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitFlag([NotNull] Z80TestParser.FlagContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.expr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterExpr([NotNull] Z80TestParser.ExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.expr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitExpr([NotNull] Z80TestParser.ExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.orExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterOrExpr([NotNull] Z80TestParser.OrExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.orExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitOrExpr([NotNull] Z80TestParser.OrExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.xorExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterXorExpr([NotNull] Z80TestParser.XorExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.xorExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitXorExpr([NotNull] Z80TestParser.XorExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.andExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterAndExpr([NotNull] Z80TestParser.AndExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.andExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitAndExpr([NotNull] Z80TestParser.AndExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.equExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterEquExpr([NotNull] Z80TestParser.EquExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.equExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitEquExpr([NotNull] Z80TestParser.EquExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.relExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterRelExpr([NotNull] Z80TestParser.RelExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.relExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitRelExpr([NotNull] Z80TestParser.RelExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.shiftExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterShiftExpr([NotNull] Z80TestParser.ShiftExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.shiftExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitShiftExpr([NotNull] Z80TestParser.ShiftExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.addExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterAddExpr([NotNull] Z80TestParser.AddExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.addExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitAddExpr([NotNull] Z80TestParser.AddExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.multExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterMultExpr([NotNull] Z80TestParser.MultExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.multExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitMultExpr([NotNull] Z80TestParser.MultExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.unaryExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterUnaryExpr([NotNull] Z80TestParser.UnaryExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.unaryExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitUnaryExpr([NotNull] Z80TestParser.UnaryExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.literalExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterLiteralExpr([NotNull] Z80TestParser.LiteralExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.literalExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitLiteralExpr([NotNull] Z80TestParser.LiteralExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.symbolExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterSymbolExpr([NotNull] Z80TestParser.SymbolExprContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.symbolExpr"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitSymbolExpr([NotNull] Z80TestParser.SymbolExprContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.registerSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterRegisterSpec([NotNull] Z80TestParser.RegisterSpecContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.registerSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitRegisterSpec([NotNull] Z80TestParser.RegisterSpecContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.addrSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterAddrSpec([NotNull] Z80TestParser.AddrSpecContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.addrSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitAddrSpec([NotNull] Z80TestParser.AddrSpecContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.reachSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterReachSpec([NotNull] Z80TestParser.ReachSpecContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.reachSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitReachSpec([NotNull] Z80TestParser.ReachSpecContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.memReadSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterMemReadSpec([NotNull] Z80TestParser.MemReadSpecContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.memReadSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitMemReadSpec([NotNull] Z80TestParser.MemReadSpecContext context); /// <summary> /// Enter a parse tree produced by <see cref="Z80TestParser.memWriteSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void EnterMemWriteSpec([NotNull] Z80TestParser.MemWriteSpecContext context); /// <summary> /// Exit a parse tree produced by <see cref="Z80TestParser.memWriteSpec"/>. /// </summary> /// <param name="context">The parse tree.</param> void ExitMemWriteSpec([NotNull] Z80TestParser.MemWriteSpecContext context); } } // namespace Spect.Net.TestParser.Generated
Dotneteer/spectnetide
Assembler/Spect.Net.TestParser/Generated/Z80TestListener.cs
C#
mit
26,845
require 'openlab/version' require 'openlab/client' require 'openlab/projects' module Openlab class << self attr_accessor :config def config @config ||= Config.new end end def self.configure yield config end class Config attr_accessor :app_secret, :base_uri attr_reader :api_version_path def initialize @base_uri = 'https://openprojects.fab-manager.com' @api_version_path = '/api/v1' end end end
LaCasemate/open-lab-projects-ruby
lib/openlab_ruby.rb
Ruby
mit
462
# coding: utf8 from __future__ import unicode_literals, print_function import os from .util import color, supports_ansi, NO_UTF8 LINE_EDGE = "└─" if not NO_UTF8 else "|_" LINE_FORK = "├─" if not NO_UTF8 else "|__" LINE_PATH = "──" if not NO_UTF8 else "__" class TracebackPrinter(object): def __init__( self, color_error="red", color_tb="blue", color_highlight="yellow", indent=2, tb_base=None, tb_exclude=tuple(), tb_range_start=-5, tb_range_end=-2, ): """Initialize a traceback printer. color_error (unicode / int): Color name or code for errors. color_tb (unicode / int): Color name or code for traceback headline. color_highlight (unicode / int): Color name or code for highlights. indent (int): Indentation in spaces. tb_base (unicode): Name of directory to use to show relative paths. For example, "thinc" will look for the last occurence of "/thinc/" in a path and only show path to the right of it. tb_exclude (tuple): List of filenames to exclude from traceback. tb_range_start (int): The starting index from a traceback to include. tb_range_end (int): The final index from a traceback to include. If None the traceback will continue until the last record. RETURNS (TracebackPrinter): The traceback printer. """ self.color_error = color_error self.color_tb = color_tb self.color_highlight = color_highlight self.indent = " " * indent if tb_base == ".": tb_base = "{}{}".format(os.getcwd(), os.path.sep) elif tb_base is not None: tb_base = "/{}/".format(tb_base) self.tb_base = tb_base self.tb_exclude = tuple(tb_exclude) self.tb_range_start = tb_range_start self.tb_range_end = tb_range_end self.supports_ansi = supports_ansi() def __call__(self, title, *texts, **settings): """Output custom formatted tracebacks and errors. title (unicode): The message title. *texts (unicode): The texts to print (one per line). highlight (unicode): Optional sequence to highlight in the traceback, e.g. the bad value that caused the error. tb (iterable): The traceback, e.g. generated by traceback.extract_stack(). RETURNS (unicode): The formatted traceback. Can be printed or raised by custom exception. """ highlight = settings.get("highlight", False) tb = settings.get("tb", None) if self.supports_ansi: # use first line as title title = color(title, fg=self.color_error, bold=True) info = "\n" + "\n".join([self.indent + text for text in texts]) if texts else "" tb = self._get_traceback(tb, highlight) if tb else "" msg = "\n\n{}{}{}{}\n".format(self.indent, title, info, tb) return msg def _get_traceback(self, tb, highlight): # Exclude certain file names from traceback tb = [record for record in tb if not record[0].endswith(self.tb_exclude)] tb_range = ( tb[self.tb_range_start : self.tb_range_end] if self.tb_range_end is not None else tb[self.tb_range_start :] ) tb_list = [ self._format_traceback(path, line, fn, text, i, len(tb_range), highlight) for i, (path, line, fn, text) in enumerate(tb_range) ] tb_data = "\n".join(tb_list).strip() title = "Traceback:" if self.supports_ansi: title = color(title, fg=self.color_tb, bold=True) return "\n\n{indent}{title}\n{indent}{tb}".format( title=title, tb=tb_data, indent=self.indent ) def _format_traceback(self, path, line, fn, text, i, count, highlight): template = "{base_indent}{indent} {fn} in {path}:{line}{text}" indent = (LINE_EDGE if i == count - 1 else LINE_FORK) + LINE_PATH * i if self.tb_base and self.tb_base in path: path = path.rsplit(self.tb_base, 1)[1] text = self._format_user_error(text, i, highlight) if i == count - 1 else "" if self.supports_ansi: fn = color(fn, bold=True) path = color(path, underline=True) return template.format( base_indent=self.indent, line=line, indent=indent, text=text, fn=fn, path=path, ) def _format_user_error(self, text, i, highlight): spacing = " " * i + " >>>" if self.supports_ansi: spacing = color(spacing, fg=self.color_error) if highlight and self.supports_ansi: formatted_highlight = color(highlight, fg=self.color_highlight) text = text.replace(highlight, formatted_highlight) return "\n{} {} {}".format(self.indent, spacing, text)
ines/wasabi
wasabi/traceback_printer.py
Python
mit
4,953
/****************************************************************************** * $Id: bencode.c 1780 2007-04-23 19:26:19Z titer $ * * Copyright (c) 2005-2007 Transmission authors and contributors * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *****************************************************************************/ #include "transmission.h" /* setting to 1 to help expose bugs with tr_bencListAdd and tr_bencDictAdd */ #define LIST_SIZE 20 /* number of items to increment list/dict buffer by */ static int makeroom( benc_val_t * val, int count ) { int len; void * new; assert( TYPE_LIST == val->type || TYPE_DICT == val->type ); if( val->val.l.count + count <= val->val.l.alloc ) { return 0; } /* We need a bigger boat */ len = val->val.l.alloc + count + ( count % LIST_SIZE ? LIST_SIZE - ( count % LIST_SIZE ) : 0 ); new = realloc( val->val.l.vals, len * sizeof( benc_val_t ) ); if( NULL == new ) { return 1; } val->val.l.alloc = len; val->val.l.vals = new; return 0; } int _tr_bencLoad( char * buf, int len, benc_val_t * val, char ** end ) { char * p, * e, * foo; if( NULL == buf || 1 >= len ) { return 1; } if( !end ) { /* So we only have to check once */ end = &foo; } if( buf[0] == 'i' ) { int64_t num; e = memchr( &buf[1], 'e', len - 1 ); if( NULL == e ) { return 1; } /* Integer: i1242e */ *e = '\0'; num = strtoll( &buf[1], &p, 10 ); *e = 'e'; if( p != e ) { return 1; } tr_bencInitInt( val, num ); *end = p + 1; } else if( buf[0] == 'l' || buf[0] == 'd' ) { /* List: l<item1><item2>e Dict: d<string1><item1><string2><item2>e A dictionary is just a special kind of list with an even count of items, and where even items are strings. */ char * cur; char is_dict; char str_expected; is_dict = ( buf[0] == 'd' ); cur = &buf[1]; str_expected = 1; tr_bencInit( val, ( is_dict ? TYPE_DICT : TYPE_LIST ) ); while( cur - buf < len && cur[0] != 'e' ) { if( makeroom( val, 1 ) || tr_bencLoad( cur, len - (cur - buf), &val->val.l.vals[val->val.l.count], &p ) ) { tr_bencFree( val ); return 1; } val->val.l.count++; if( is_dict && str_expected && val->val.l.vals[val->val.l.count - 1].type != TYPE_STR ) { tr_bencFree( val ); return 1; } str_expected = !str_expected; cur = p; } if( is_dict && ( val->val.l.count & 1 ) ) { tr_bencFree( val ); return 1; } *end = cur + 1; } else { int slen; char * sbuf; e = memchr( buf, ':', len ); if( NULL == e ) { return 1; } /* String: 12:whateverword */ e[0] = '\0'; slen = strtol( buf, &p, 10 ); e[0] = ':'; if( p != e || 0 > slen || len - ( ( p + 1 ) - buf ) < slen ) { return 1; } sbuf = malloc( slen + 1 ); if( NULL == sbuf ) { return 1; } memcpy( sbuf, p + 1, slen ); sbuf[slen] = '\0'; tr_bencInitStr( val, sbuf, slen, 0 ); *end = p + 1 + val->val.s.i; } val->begin = buf; val->end = *end; return 0; } static void __bencPrint( benc_val_t * val, int space ) { int ii; for( ii = 0; ii < space; ii++ ) { putc( ' ', stderr ); } switch( val->type ) { case TYPE_INT: fprintf( stderr, "int: %"PRIu64"\n", val->val.i ); break; case TYPE_STR: for( ii = 0; val->val.s.i > ii; ii++ ) { if( '\\' == val->val.s.s[ii] ) { putc( '\\', stderr ); putc( '\\', stderr ); } else if( isprint( val->val.s.s[ii] ) ) { putc( val->val.s.s[ii], stderr ); } else { fprintf( stderr, "\\x%02x", val->val.s.s[ii] ); } } putc( '\n', stderr ); break; case TYPE_LIST: fprintf( stderr, "list\n" ); for( ii = 0; ii < val->val.l.count; ii++ ) { __bencPrint( &val->val.l.vals[ii], space + 1 ); } break; case TYPE_DICT: fprintf( stderr, "dict\n" ); for( ii = 0; ii < val->val.l.count; ii++ ) { __bencPrint( &val->val.l.vals[ii], space + 1 ); } break; } } void tr_bencPrint( benc_val_t * val ) { __bencPrint( val, 0 ); } void tr_bencFree( benc_val_t * val ) { int i; switch( val->type ) { case TYPE_INT: break; case TYPE_STR: if( !val->val.s.nofree ) { free( val->val.s.s ); } break; case TYPE_LIST: case TYPE_DICT: for( i = 0; i < val->val.l.count; i++ ) { tr_bencFree( &val->val.l.vals[i] ); } free( val->val.l.vals ); break; } } benc_val_t * tr_bencDictFind( benc_val_t * val, const char * key ) { int len, ii; if( val->type != TYPE_DICT ) { return NULL; } len = strlen( key ); for( ii = 0; ii + 1 < val->val.l.count; ii += 2 ) { if( TYPE_STR != val->val.l.vals[ii].type || len != val->val.l.vals[ii].val.s.i || 0 != memcmp( val->val.l.vals[ii].val.s.s, key, len ) ) { continue; } return &val->val.l.vals[ii+1]; } return NULL; } benc_val_t * tr_bencDictFindFirst( benc_val_t * val, ... ) { const char * key; benc_val_t * ret; va_list ap; ret = NULL; va_start( ap, val ); while( ( key = va_arg( ap, const char * ) ) ) { ret = tr_bencDictFind( val, key ); if( NULL != ret ) { break; } } va_end( ap ); return ret; } char * tr_bencStealStr( benc_val_t * val ) { assert( TYPE_STR == val->type ); val->val.s.nofree = 1; return val->val.s.s; } void _tr_bencInitStr( benc_val_t * val, char * str, int len, int nofree ) { tr_bencInit( val, TYPE_STR ); val->val.s.s = str; val->val.s.nofree = nofree; if( 0 >= len ) { len = ( NULL == str ? 0 : strlen( str ) ); } val->val.s.i = len; } int tr_bencInitStrDup( benc_val_t * val, const char * str ) { char * new = NULL; if( NULL != str ) { new = strdup( str ); if( NULL == new ) { return 1; } } _tr_bencInitStr( val, new, 0, 0 ); return 0; } void tr_bencInitInt( benc_val_t * val, int64_t num ) { tr_bencInit( val, TYPE_INT ); val->val.i = num; } int tr_bencListReserve( benc_val_t * val, int count ) { assert( TYPE_LIST == val->type ); if( makeroom( val, count ) ) { return 1; } return 0; } int tr_bencDictReserve( benc_val_t * val, int count ) { assert( TYPE_DICT == val->type ); if( makeroom( val, count * 2 ) ) { return 1; } return 0; } benc_val_t * tr_bencListAdd( benc_val_t * list ) { benc_val_t * item; assert( TYPE_LIST == list->type ); assert( list->val.l.count < list->val.l.alloc ); item = &list->val.l.vals[list->val.l.count]; list->val.l.count++; tr_bencInit( item, TYPE_INT ); return item; } benc_val_t * tr_bencDictAdd( benc_val_t * dict, const char * key ) { benc_val_t * keyval, * itemval; assert( TYPE_DICT == dict->type ); assert( dict->val.l.count + 2 <= dict->val.l.alloc ); keyval = &dict->val.l.vals[dict->val.l.count]; dict->val.l.count++; itemval = &dict->val.l.vals[dict->val.l.count]; dict->val.l.count++; tr_bencInitStr( keyval, key, -1, 1 ); tr_bencInit( itemval, TYPE_INT ); return itemval; } char * tr_bencSaveMalloc( benc_val_t * val, int * len ) { char * buf = NULL; int alloc = 0; *len = 0; if( tr_bencSave( val, &buf, len, &alloc ) ) { if( NULL != buf ) { free(buf); } *len = 0; return NULL; } return buf; } int tr_bencSave( benc_val_t * val, char ** buf, int * used, int * max ) { int ii; switch( val->type ) { case TYPE_INT: if( tr_sprintf( buf, used, max, "i%"PRIu64"e", val->val.i ) ) { return 1; } break; case TYPE_STR: if( tr_sprintf( buf, used, max, "%i:", val->val.s.i ) || tr_concat( buf, used, max, val->val.s.s, val->val.s.i ) ) { return 1; } break; case TYPE_LIST: case TYPE_DICT: if( tr_sprintf( buf, used, max, (TYPE_LIST == val->type ? "l" : "d") ) ) { return 1; } for( ii = 0; val->val.l.count > ii; ii++ ) { if( tr_bencSave( val->val.l.vals + ii, buf, used, max ) ) { return 1; } } if( tr_sprintf( buf, used, max, "e" ) ) { return 1; } break; } return 0; }
sauloal/linuxscripts
apache/var/www/html/saulo/torrent/clients/transmission/Transmission-0.72_tfCLI-svn3318/libtransmission/bencode.c
C
mit
10,960
<?php /** * @copyright Copyright (c) 2017 Dmitriy Bashkarev * @license https://github.com/bashkarev/email/blob/master/LICENSE * @link https://github.com/bashkarev/email#readme */ namespace bashkarev\email\tests\messages; use bashkarev\email\Message; use bashkarev\email\messages\Feedback; use bashkarev\email\tests\TestCase; /** * * @see https://tools.ietf.org/html/rfc5965 * @author Dmitriy Bashkarev <[email protected]> */ class FeedbackTest extends TestCase { public function testComplaints() { $this ->field('/complaints/aol.eml', function (Message $container) { /** * @var Feedback $feedback */ $feedback = null; foreach ($container->getAttachments() as $attachment) { if ($attachment->getMimeType() === 'message/feedback-report') { $feedback = $attachment->getMessage(); } } $this->assertEquals(Feedback::TYPE_ABUSE, $feedback->getType()); $this->assertEquals('AOL SComp', $feedback->getUserAgent()); $this->assertEquals('0.1', $feedback->getVersion()); $this->assertNull($feedback->getOriginalEnvelopeId()); }) ->field('/complaints/yahoo.eml', function (Message $container) { /** * @var Feedback $feedback */ $feedback = null; foreach ($container->getAttachments() as $attachment) { if ($attachment->getMimeType() === 'message/feedback-report') { $feedback = $attachment->getMessage(); } } $this->assertEquals(Feedback::TYPE_ABUSE, $feedback->getType()); $this->assertEquals('0.1', $feedback->getVersion()); $this->assertEquals('Yahoo!-Mail-Feedback/1.0', $feedback->getUserAgent()); $this->assertEquals('[email protected]', $feedback->getOriginalMailFrom()->email); }); } }
bashkarev/email
tests/messages/FeedbackTest.php
PHP
mit
2,146
; Program 7.2 ; SCAS - MASM (32-bit) ; Copyright (c) 2017 Hall & Slonka .386 .MODEL FLAT, stdcall .STACK 4096 ExitProcess PROTO, dwExitCode:DWORD .data src BYTE "Test sentence",0 lenSrc EQU ($ - src) search BYTE "s" .code _main PROC xor eax, eax mov al, search lea edi, src mov ecx, lenSrc cld repne scasb ; after SCAS, test for success jnz notfound ; found things jmp done notfound: ; non-found things done: INVOKE ExitProcess, 0 _main ENDP END
brianrhall/Assembly
Chapter_7/Program 7.2/x86/Program_7.2_MASM.asm
Assembly
mit
454
<div class="skybrud-redirects-inbound-redirects" ng-controller="Skybrud.Umbraco.Redirects.InboundRedirects.Controller as vm"> <redirects-node node="vm.node" config="model.config" title="model.label" description="model.description"></redirects-node> </div>
skybrud/Skybrud.Umbraco.Redirects
src/Skybrud.Umbraco.Redirects/App_Plugins/Skybrud.Umbraco.Redirects/Views/Editors/Inbound.html
HTML
mit
262
var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.render('index'); }); router.get("/*", function(req, res, next) { res.render('index'); }); module.exports = router;
zzbennett/fathers-day-card
routes/index.js
JavaScript
mit
255
import React from 'react'; import style from './style.clock'; import events from '../utils/events'; import prefixer from '../utils/prefixer'; import utils from '../utils/utils'; class Hand extends React.Component { static propTypes = { angle: React.PropTypes.number, className: React.PropTypes.string, length: React.PropTypes.number, onMove: React.PropTypes.func, onMoved: React.PropTypes.func, origin: React.PropTypes.object, step: React.PropTypes.number }; static defaultProps = { className: '', angle: 0, length: 0, origin: {} }; state = { knobWidth: 0 }; componentDidMount () { setTimeout(() => { this.setState({knobWidth: this.refs.knob.offsetWidth}); }); } componentWillUnmount () { events.removeEventsFromDocument(this.getMouseEventMap()); events.removeEventsFromDocument(this.getTouchEventMap()); } getMouseEventMap () { return { mousemove: this.handleMouseMove, mouseup: this.handleMouseUp }; } getTouchEventMap () { return { touchmove: this.handleTouchMove, touchend: this.handleTouchEnd }; } handleMouseMove = (event) => { this.move(events.getMousePosition(event)); }; handleTouchMove = (event) => { this.move(events.getTouchPosition(event)); }; handleMouseUp = () => { this.end(this.getMouseEventMap()); }; handleTouchEnd = () => { this.end(this.getTouchEventMap()); }; mouseStart (event) { events.addEventsToDocument(this.getMouseEventMap()); this.move(events.getMousePosition(event)); } touchStart (event) { events.addEventsToDocument(this.getTouchEventMap()); this.move(events.getTouchPosition(event)); events.pauseEvent(event); } getPositionRadius (position) { const x = this.props.origin.x - position.x; const y = this.props.origin.y - position.y; return Math.sqrt(x * x + y * y); } trimAngleToValue (angle) { return this.props.step * Math.round(angle / this.props.step); } positionToAngle (position) { return utils.angle360FromPositions(this.props.origin.x, this.props.origin.y, position.x, position.y); } end (evts) { if (this.props.onMoved) this.props.onMoved(); events.removeEventsFromDocument(evts); } move (position) { const degrees = this.trimAngleToValue(this.positionToAngle(position)); const radius = this.getPositionRadius(position); if (this.props.onMove) this.props.onMove(degrees === 360 ? 0 : degrees, radius); } render () { const className = `${style.hand} ${this.props.className}`; const handStyle = prefixer({ height: this.props.length - this.state.knobWidth / 2, transform: `rotate(${this.props.angle}deg)` }); return ( <div className={className} style={handStyle}> <div ref='knob' className={style.knob}></div> </div> ); } } export default Hand;
KerenChandran/react-toolbox
components/time_picker/ClockHand.js
JavaScript
mit
2,918
<?php function echo_utf8($str) { echo utf8_encode($str); } function http_get($p, $def = '') { return isset($_GET[$p]) ? $_GET[$p] : $def; } function getTemplateContent($tmpl_name) { $path = "_templates/$tmpl_name.tmpl.html"; if (is_file($path)) { return file_get_contents($path); } else { trigger_error("template [$path] not found", E_USER_ERROR); } } function replaceData($content, $key, $value) { return preg_replace('/\$\{' .$key . '\}/i', $value, $content); } function jsonAsHTML($json) { $j2 = ''; $j2 = $json; //$j2 = str_replace('{', '{<br>&nbsp;&nbsp;&nbsp;&nbsp;', $j2); $j2 = print_r(json_decode($json, true), true); return $j2; } function getScriptName() { return filter_input(INPUT_SERVER, 'SCRIPT_NAME', FILTER_SANITIZE_STRING); } function select_to_table($conn, $sql, $table_attribs = array()) { $stmt = $conn->query($sql); $fields = $rs->fetch_fields(); //print_r($fields); $tmpl_table = getTemplateContent('table'); $tmpl_tr = getTemplateContent('tr'); $tmpl_td = getTemplateContent('td'); $tmpl_th = getTemplateContent('th'); $table_head_html = ""; foreach($fields as $f) { $table_head_html .= replaceData($tmpl_th, 'content', $f->name); } $table_head_tr_html = replaceData($tmpl_tr, 'tds', $table_head_html); $table_html = replaceData($tmpl_table, 'thead', $table_head_tr_html); $table_html = replaceData($table_html, 'tfoot', ''); $table_body_html = ''; while($row = $rs->fetch_assoc()) { $tr = ''; foreach($row as $v) { $td = replaceData($tmpl_td, 'content', $v); $tr .= $td; } $table_body_html .= replaceData($tmpl_tr, 'tds', $tr); } $table_html = replaceData($table_html, 'tbody', $table_body_html); $atts = arrayToTagAttribs($table_attribs); if ($atts) { $atts = ' ' . $atts; } $table_html = replaceData($table_html, 'attribs', $atts); echo $table_html; } function arrayToTagAttribs($attribs, $delim = '"') { if (!$attribs) {return '';} $list = array(); foreach($attribs as $k => $v) { $list[] = $k . '=' . $delim . $v . $delim; } return implode(' ', $list); } function arrayToList($arr) { echo "<ul>"; foreach($arr as $k => $v) { echo '<li>' . $k; $v_type = gettype($v); if ($v_type != 'string') { echo " ($v_type)"; } echo ' => '; if ($v_type == 'array') { arrayToList($v); } elseif ($v_type == 'object') { arrayToList((array) $v); } else { echo $v; } echo '</li>' . PHP_EOL; } echo "</ul>"; }
jorgepinho/wordpress-DB-browser
incs/funcs.php
PHP
mit
2,698
/*! * Materialize v0.96.1 (http://materializecss.com) * Copyright 2014-2015 Materialize * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE) */ .materialize-red.lighten-5 { background-color: #fdeaeb !important; } .materialize-red-text.text-lighten-5 { color: #fdeaeb !important; } .materialize-red.lighten-4 { background-color: #f8c1c3 !important; } .materialize-red-text.text-lighten-4 { color: #f8c1c3 !important; } .materialize-red.lighten-3 { background-color: #f3989b !important; } .materialize-red-text.text-lighten-3 { color: #f3989b !important; } .materialize-red.lighten-2 { background-color: #ee6e73 !important; } .materialize-red-text.text-lighten-2 { color: #ee6e73 !important; } .materialize-red.lighten-1 { background-color: #ea454b !important; } .materialize-red-text.text-lighten-1 { color: #ea454b !important; } .materialize-red { background-color: #e51c23 !important; } .materialize-red-text { color: #e51c23 !important; } .materialize-red.darken-1 { background-color: #d0181e !important; } .materialize-red-text.text-darken-1 { color: #d0181e !important; } .materialize-red.darken-2 { background-color: #b9151b !important; } .materialize-red-text.text-darken-2 { color: #b9151b !important; } .materialize-red.darken-3 { background-color: #a21318 !important; } .materialize-red-text.text-darken-3 { color: #a21318 !important; } .materialize-red.darken-4 { background-color: #8b1014 !important; } .materialize-red-text.text-darken-4 { color: #8b1014 !important; } .red.lighten-5 { background-color: #FFEBEE !important; } .red-text.text-lighten-5 { color: #FFEBEE !important; } .red.lighten-4 { background-color: #FFCDD2 !important; } .red-text.text-lighten-4 { color: #FFCDD2 !important; } .red.lighten-3 { background-color: #EF9A9A !important; } .red-text.text-lighten-3 { color: #EF9A9A !important; } .red.lighten-2 { background-color: #E57373 !important; } .red-text.text-lighten-2 { color: #E57373 !important; } .red.lighten-1 { background-color: #EF5350 !important; } .red-text.text-lighten-1 { color: #EF5350 !important; } .red { background-color: #F44336 !important; } .red-text { color: #F44336 !important; } .red.darken-1 { background-color: #E53935 !important; } .red-text.text-darken-1 { color: #E53935 !important; } .red.darken-2 { background-color: #D32F2F !important; } .red-text.text-darken-2 { color: #D32F2F !important; } .red.darken-3 { background-color: #C62828 !important; } .red-text.text-darken-3 { color: #C62828 !important; } .red.darken-4 { background-color: #B71C1C !important; } .red-text.text-darken-4 { color: #B71C1C !important; } .red.accent-1 { background-color: #FF8A80 !important; } .red-text.text-accent-1 { color: #FF8A80 !important; } .red.accent-2 { background-color: #FF5252 !important; } .red-text.text-accent-2 { color: #FF5252 !important; } .red.accent-3 { background-color: #FF1744 !important; } .red-text.text-accent-3 { color: #FF1744 !important; } .red.accent-4 { background-color: #D50000 !important; } .red-text.text-accent-4 { color: #D50000 !important; } .pink.lighten-5 { background-color: #fce4ec !important; } .pink-text.text-lighten-5 { color: #fce4ec !important; } .pink.lighten-4 { background-color: #f8bbd0 !important; } .pink-text.text-lighten-4 { color: #f8bbd0 !important; } .pink.lighten-3 { background-color: #f48fb1 !important; } .pink-text.text-lighten-3 { color: #f48fb1 !important; } .pink.lighten-2 { background-color: #f06292 !important; } .pink-text.text-lighten-2 { color: #f06292 !important; } .pink.lighten-1 { background-color: #ec407a !important; } .pink-text.text-lighten-1 { color: #ec407a !important; } .pink { background-color: #e91e63 !important; } .pink-text { color: #e91e63 !important; } .pink.darken-1 { background-color: #d81b60 !important; } .pink-text.text-darken-1 { color: #d81b60 !important; } .pink.darken-2 { background-color: #c2185b !important; } .pink-text.text-darken-2 { color: #c2185b !important; } .pink.darken-3 { background-color: #ad1457 !important; } .pink-text.text-darken-3 { color: #ad1457 !important; } .pink.darken-4 { background-color: #880e4f !important; } .pink-text.text-darken-4 { color: #880e4f !important; } .pink.accent-1 { background-color: #ff80ab !important; } .pink-text.text-accent-1 { color: #ff80ab !important; } .pink.accent-2 { background-color: #ff4081 !important; } .pink-text.text-accent-2 { color: #ff4081 !important; } .pink.accent-3 { background-color: #f50057 !important; } .pink-text.text-accent-3 { color: #f50057 !important; } .pink.accent-4 { background-color: #c51162 !important; } .pink-text.text-accent-4 { color: #c51162 !important; } .purple.lighten-5 { background-color: #f3e5f5 !important; } .purple-text.text-lighten-5 { color: #f3e5f5 !important; } .purple.lighten-4 { background-color: #e1bee7 !important; } .purple-text.text-lighten-4 { color: #e1bee7 !important; } .purple.lighten-3 { background-color: #ce93d8 !important; } .purple-text.text-lighten-3 { color: #ce93d8 !important; } .purple.lighten-2 { background-color: #ba68c8 !important; } .purple-text.text-lighten-2 { color: #ba68c8 !important; } .purple.lighten-1 { background-color: #ab47bc !important; } .purple-text.text-lighten-1 { color: #ab47bc !important; } .purple { background-color: #9c27b0 !important; } .purple-text { color: #9c27b0 !important; } .purple.darken-1 { background-color: #8e24aa !important; } .purple-text.text-darken-1 { color: #8e24aa !important; } .purple.darken-2 { background-color: #7b1fa2 !important; } .purple-text.text-darken-2 { color: #7b1fa2 !important; } .purple.darken-3 { background-color: #6a1b9a !important; } .purple-text.text-darken-3 { color: #6a1b9a !important; } .purple.darken-4 { background-color: #4a148c !important; } .purple-text.text-darken-4 { color: #4a148c !important; } .purple.accent-1 { background-color: #ea80fc !important; } .purple-text.text-accent-1 { color: #ea80fc !important; } .purple.accent-2 { background-color: #e040fb !important; } .purple-text.text-accent-2 { color: #e040fb !important; } .purple.accent-3 { background-color: #d500f9 !important; } .purple-text.text-accent-3 { color: #d500f9 !important; } .purple.accent-4 { background-color: #aa00ff !important; } .purple-text.text-accent-4 { color: #aa00ff !important; } .deep-purple.lighten-5 { background-color: #ede7f6 !important; } .deep-purple-text.text-lighten-5 { color: #ede7f6 !important; } .deep-purple.lighten-4 { background-color: #d1c4e9 !important; } .deep-purple-text.text-lighten-4 { color: #d1c4e9 !important; } .deep-purple.lighten-3 { background-color: #b39ddb !important; } .deep-purple-text.text-lighten-3 { color: #b39ddb !important; } .deep-purple.lighten-2 { background-color: #9575cd !important; } .deep-purple-text.text-lighten-2 { color: #9575cd !important; } .deep-purple.lighten-1 { background-color: #7e57c2 !important; } .deep-purple-text.text-lighten-1 { color: #7e57c2 !important; } .deep-purple { background-color: #673ab7 !important; } .deep-purple-text { color: #673ab7 !important; } .deep-purple.darken-1 { background-color: #5e35b1 !important; } .deep-purple-text.text-darken-1 { color: #5e35b1 !important; } .deep-purple.darken-2 { background-color: #512da8 !important; } .deep-purple-text.text-darken-2 { color: #512da8 !important; } .deep-purple.darken-3 { background-color: #4527a0 !important; } .deep-purple-text.text-darken-3 { color: #4527a0 !important; } .deep-purple.darken-4 { background-color: #311b92 !important; } .deep-purple-text.text-darken-4 { color: #311b92 !important; } .deep-purple.accent-1 { background-color: #b388ff !important; } .deep-purple-text.text-accent-1 { color: #b388ff !important; } .deep-purple.accent-2 { background-color: #7c4dff !important; } .deep-purple-text.text-accent-2 { color: #7c4dff !important; } .deep-purple.accent-3 { background-color: #651fff !important; } .deep-purple-text.text-accent-3 { color: #651fff !important; } .deep-purple.accent-4 { background-color: #6200ea !important; } .deep-purple-text.text-accent-4 { color: #6200ea !important; } .indigo.lighten-5 { background-color: #e8eaf6 !important; } .indigo-text.text-lighten-5 { color: #e8eaf6 !important; } .indigo.lighten-4 { background-color: #c5cae9 !important; } .indigo-text.text-lighten-4 { color: #c5cae9 !important; } .indigo.lighten-3 { background-color: #9fa8da !important; } .indigo-text.text-lighten-3 { color: #9fa8da !important; } .indigo.lighten-2 { background-color: #7986cb !important; } .indigo-text.text-lighten-2 { color: #7986cb !important; } .indigo.lighten-1 { background-color: #5c6bc0 !important; } .indigo-text.text-lighten-1 { color: #5c6bc0 !important; } .indigo { background-color: #3f51b5 !important; } .indigo-text { color: #3f51b5 !important; } .indigo.darken-1 { background-color: #3949ab !important; } .indigo-text.text-darken-1 { color: #3949ab !important; } .indigo.darken-2 { background-color: #303f9f !important; } .indigo-text.text-darken-2 { color: #303f9f !important; } .indigo.darken-3 { background-color: #283593 !important; } .indigo-text.text-darken-3 { color: #283593 !important; } .indigo.darken-4 { background-color: #1a237e !important; } .indigo-text.text-darken-4 { color: #1a237e !important; } .indigo.accent-1 { background-color: #8c9eff !important; } .indigo-text.text-accent-1 { color: #8c9eff !important; } .indigo.accent-2 { background-color: #536dfe !important; } .indigo-text.text-accent-2 { color: #536dfe !important; } .indigo.accent-3 { background-color: #3d5afe !important; } .indigo-text.text-accent-3 { color: #3d5afe !important; } .indigo.accent-4 { background-color: #304ffe !important; } .indigo-text.text-accent-4 { color: #304ffe !important; } .blue.lighten-5 { background-color: #E3F2FD !important; } .blue-text.text-lighten-5 { color: #E3F2FD !important; } .blue.lighten-4 { background-color: #BBDEFB !important; } .blue-text.text-lighten-4 { color: #BBDEFB !important; } .blue.lighten-3 { background-color: #90CAF9 !important; } .blue-text.text-lighten-3 { color: #90CAF9 !important; } .blue.lighten-2 { background-color: #64B5F6 !important; } .blue-text.text-lighten-2 { color: #64B5F6 !important; } .blue.lighten-1 { background-color: #42A5F5 !important; } .blue-text.text-lighten-1 { color: #42A5F5 !important; } .blue { background-color: #2196F3 !important; } .blue-text { color: #2196F3 !important; } .blue.darken-1 { background-color: #1E88E5 !important; } .blue-text.text-darken-1 { color: #1E88E5 !important; } .blue.darken-2 { background-color: #1976D2 !important; } .blue-text.text-darken-2 { color: #1976D2 !important; } .blue.darken-3 { background-color: #1565C0 !important; } .blue-text.text-darken-3 { color: #1565C0 !important; } .blue.darken-4 { background-color: #0D47A1 !important; } .blue-text.text-darken-4 { color: #0D47A1 !important; } .blue.accent-1 { background-color: #82B1FF !important; } .blue-text.text-accent-1 { color: #82B1FF !important; } .blue.accent-2 { background-color: #448AFF !important; } .blue-text.text-accent-2 { color: #448AFF !important; } .blue.accent-3 { background-color: #2979FF !important; } .blue-text.text-accent-3 { color: #2979FF !important; } .blue.accent-4 { background-color: #2962FF !important; } .blue-text.text-accent-4 { color: #2962FF !important; } .light-blue.lighten-5 { background-color: #e1f5fe !important; } .light-blue-text.text-lighten-5 { color: #e1f5fe !important; } .light-blue.lighten-4 { background-color: #b3e5fc !important; } .light-blue-text.text-lighten-4 { color: #b3e5fc !important; } .light-blue.lighten-3 { background-color: #81d4fa !important; } .light-blue-text.text-lighten-3 { color: #81d4fa !important; } .light-blue.lighten-2 { background-color: #4fc3f7 !important; } .light-blue-text.text-lighten-2 { color: #4fc3f7 !important; } .light-blue.lighten-1 { background-color: #29b6f6 !important; } .light-blue-text.text-lighten-1 { color: #29b6f6 !important; } .light-blue { background-color: #03a9f4 !important; } .light-blue-text { color: #03a9f4 !important; } .light-blue.darken-1 { background-color: #039be5 !important; } .light-blue-text.text-darken-1 { color: #039be5 !important; } .light-blue.darken-2 { background-color: #0288d1 !important; } .light-blue-text.text-darken-2 { color: #0288d1 !important; } .light-blue.darken-3 { background-color: #0277bd !important; } .light-blue-text.text-darken-3 { color: #0277bd !important; } .light-blue.darken-4 { background-color: #01579b !important; } .light-blue-text.text-darken-4 { color: #01579b !important; } .light-blue.accent-1 { background-color: #80d8ff !important; } .light-blue-text.text-accent-1 { color: #80d8ff !important; } .light-blue.accent-2 { background-color: #40c4ff !important; } .light-blue-text.text-accent-2 { color: #40c4ff !important; } .light-blue.accent-3 { background-color: #00b0ff !important; } .light-blue-text.text-accent-3 { color: #00b0ff !important; } .light-blue.accent-4 { background-color: #0091ea !important; } .light-blue-text.text-accent-4 { color: #0091ea !important; } .cyan.lighten-5 { background-color: #e0f7fa !important; } .cyan-text.text-lighten-5 { color: #e0f7fa !important; } .cyan.lighten-4 { background-color: #b2ebf2 !important; } .cyan-text.text-lighten-4 { color: #b2ebf2 !important; } .cyan.lighten-3 { background-color: #80deea !important; } .cyan-text.text-lighten-3 { color: #80deea !important; } .cyan.lighten-2 { background-color: #4dd0e1 !important; } .cyan-text.text-lighten-2 { color: #4dd0e1 !important; } .cyan.lighten-1 { background-color: #26c6da !important; } .cyan-text.text-lighten-1 { color: #26c6da !important; } .cyan { background-color: #00bcd4 !important; } .cyan-text { color: #00bcd4 !important; } .cyan.darken-1 { background-color: #00acc1 !important; } .cyan-text.text-darken-1 { color: #00acc1 !important; } .cyan.darken-2 { background-color: #0097a7 !important; } .cyan-text.text-darken-2 { color: #0097a7 !important; } .cyan.darken-3 { background-color: #00838f !important; } .cyan-text.text-darken-3 { color: #00838f !important; } .cyan.darken-4 { background-color: #006064 !important; } .cyan-text.text-darken-4 { color: #006064 !important; } .cyan.accent-1 { background-color: #84ffff !important; } .cyan-text.text-accent-1 { color: #84ffff !important; } .cyan.accent-2 { background-color: #18ffff !important; } .cyan-text.text-accent-2 { color: #18ffff !important; } .cyan.accent-3 { background-color: #00e5ff !important; } .cyan-text.text-accent-3 { color: #00e5ff !important; } .cyan.accent-4 { background-color: #00b8d4 !important; } .cyan-text.text-accent-4 { color: #00b8d4 !important; } .teal.lighten-5 { background-color: #e0f2f1 !important; } .teal-text.text-lighten-5 { color: #e0f2f1 !important; } .teal.lighten-4 { background-color: #b2dfdb !important; } .teal-text.text-lighten-4 { color: #b2dfdb !important; } .teal.lighten-3 { background-color: #80cbc4 !important; } .teal-text.text-lighten-3 { color: #80cbc4 !important; } .teal.lighten-2 { background-color: #4db6ac !important; } .teal-text.text-lighten-2 { color: #4db6ac !important; } .teal.lighten-1 { background-color: #26a69a !important; } .teal-text.text-lighten-1 { color: #26a69a !important; } .teal { background-color: #009688 !important; } .teal-text { color: #009688 !important; } .teal.darken-1 { background-color: #00897b !important; } .teal-text.text-darken-1 { color: #00897b !important; } .teal.darken-2 { background-color: #00796b !important; } .teal-text.text-darken-2 { color: #00796b !important; } .teal.darken-3 { background-color: #00695c !important; } .teal-text.text-darken-3 { color: #00695c !important; } .teal.darken-4 { background-color: #004d40 !important; } .teal-text.text-darken-4 { color: #004d40 !important; } .teal.accent-1 { background-color: #a7ffeb !important; } .teal-text.text-accent-1 { color: #a7ffeb !important; } .teal.accent-2 { background-color: #64ffda !important; } .teal-text.text-accent-2 { color: #64ffda !important; } .teal.accent-3 { background-color: #1de9b6 !important; } .teal-text.text-accent-3 { color: #1de9b6 !important; } .teal.accent-4 { background-color: #00bfa5 !important; } .teal-text.text-accent-4 { color: #00bfa5 !important; } .green.lighten-5 { background-color: #E8F5E9 !important; } .green-text.text-lighten-5 { color: #E8F5E9 !important; } .green.lighten-4 { background-color: #C8E6C9 !important; } .green-text.text-lighten-4 { color: #C8E6C9 !important; } .green.lighten-3 { background-color: #A5D6A7 !important; } .green-text.text-lighten-3 { color: #A5D6A7 !important; } .green.lighten-2 { background-color: #81C784 !important; } .green-text.text-lighten-2 { color: #81C784 !important; } .green.lighten-1 { background-color: #66BB6A !important; } .green-text.text-lighten-1 { color: #66BB6A !important; } .green { background-color: #4CAF50 !important; } .green-text { color: #4CAF50 !important; } .green.darken-1 { background-color: #43A047 !important; } .green-text.text-darken-1 { color: #43A047 !important; } .green.darken-2 { background-color: #388E3C !important; } .green-text.text-darken-2 { color: #388E3C !important; } .green.darken-3 { background-color: #2E7D32 !important; } .green-text.text-darken-3 { color: #2E7D32 !important; } .green.darken-4 { background-color: #1B5E20 !important; } .green-text.text-darken-4 { color: #1B5E20 !important; } .green.accent-1 { background-color: #B9F6CA !important; } .green-text.text-accent-1 { color: #B9F6CA !important; } .green.accent-2 { background-color: #69F0AE !important; } .green-text.text-accent-2 { color: #69F0AE !important; } .green.accent-3 { background-color: #00E676 !important; } .green-text.text-accent-3 { color: #00E676 !important; } .green.accent-4 { background-color: #00C853 !important; } .green-text.text-accent-4 { color: #00C853 !important; } .light-green.lighten-5 { background-color: #f1f8e9 !important; } .light-green-text.text-lighten-5 { color: #f1f8e9 !important; } .light-green.lighten-4 { background-color: #dcedc8 !important; } .light-green-text.text-lighten-4 { color: #dcedc8 !important; } .light-green.lighten-3 { background-color: #c5e1a5 !important; } .light-green-text.text-lighten-3 { color: #c5e1a5 !important; } .light-green.lighten-2 { background-color: #aed581 !important; } .light-green-text.text-lighten-2 { color: #aed581 !important; } .light-green.lighten-1 { background-color: #9ccc65 !important; } .light-green-text.text-lighten-1 { color: #9ccc65 !important; } .light-green { background-color: #8bc34a !important; } .light-green-text { color: #8bc34a !important; } .light-green.darken-1 { background-color: #7cb342 !important; } .light-green-text.text-darken-1 { color: #7cb342 !important; } .light-green.darken-2 { background-color: #689f38 !important; } .light-green-text.text-darken-2 { color: #689f38 !important; } .light-green.darken-3 { background-color: #558b2f !important; } .light-green-text.text-darken-3 { color: #558b2f !important; } .light-green.darken-4 { background-color: #33691e !important; } .light-green-text.text-darken-4 { color: #33691e !important; } .light-green.accent-1 { background-color: #ccff90 !important; } .light-green-text.text-accent-1 { color: #ccff90 !important; } .light-green.accent-2 { background-color: #b2ff59 !important; } .light-green-text.text-accent-2 { color: #b2ff59 !important; } .light-green.accent-3 { background-color: #76ff03 !important; } .light-green-text.text-accent-3 { color: #76ff03 !important; } .light-green.accent-4 { background-color: #64dd17 !important; } .light-green-text.text-accent-4 { color: #64dd17 !important; } .lime.lighten-5 { background-color: #f9fbe7 !important; } .lime-text.text-lighten-5 { color: #f9fbe7 !important; } .lime.lighten-4 { background-color: #f0f4c3 !important; } .lime-text.text-lighten-4 { color: #f0f4c3 !important; } .lime.lighten-3 { background-color: #e6ee9c !important; } .lime-text.text-lighten-3 { color: #e6ee9c !important; } .lime.lighten-2 { background-color: #dce775 !important; } .lime-text.text-lighten-2 { color: #dce775 !important; } .lime.lighten-1 { background-color: #d4e157 !important; } .lime-text.text-lighten-1 { color: #d4e157 !important; } .lime { background-color: #cddc39 !important; } .lime-text { color: #cddc39 !important; } .lime.darken-1 { background-color: #c0ca33 !important; } .lime-text.text-darken-1 { color: #c0ca33 !important; } .lime.darken-2 { background-color: #afb42b !important; } .lime-text.text-darken-2 { color: #afb42b !important; } .lime.darken-3 { background-color: #9e9d24 !important; } .lime-text.text-darken-3 { color: #9e9d24 !important; } .lime.darken-4 { background-color: #827717 !important; } .lime-text.text-darken-4 { color: #827717 !important; } .lime.accent-1 { background-color: #f4ff81 !important; } .lime-text.text-accent-1 { color: #f4ff81 !important; } .lime.accent-2 { background-color: #eeff41 !important; } .lime-text.text-accent-2 { color: #eeff41 !important; } .lime.accent-3 { background-color: #c6ff00 !important; } .lime-text.text-accent-3 { color: #c6ff00 !important; } .lime.accent-4 { background-color: #aeea00 !important; } .lime-text.text-accent-4 { color: #aeea00 !important; } .yellow.lighten-5 { background-color: #fffde7 !important; } .yellow-text.text-lighten-5 { color: #fffde7 !important; } .yellow.lighten-4 { background-color: #fff9c4 !important; } .yellow-text.text-lighten-4 { color: #fff9c4 !important; } .yellow.lighten-3 { background-color: #fff59d !important; } .yellow-text.text-lighten-3 { color: #fff59d !important; } .yellow.lighten-2 { background-color: #fff176 !important; } .yellow-text.text-lighten-2 { color: #fff176 !important; } .yellow.lighten-1 { background-color: #ffee58 !important; } .yellow-text.text-lighten-1 { color: #ffee58 !important; } .yellow { background-color: #ffeb3b !important; } .yellow-text { color: #ffeb3b !important; } .yellow.darken-1 { background-color: #fdd835 !important; } .yellow-text.text-darken-1 { color: #fdd835 !important; } .yellow.darken-2 { background-color: #fbc02d !important; } .yellow-text.text-darken-2 { color: #fbc02d !important; } .yellow.darken-3 { background-color: #f9a825 !important; } .yellow-text.text-darken-3 { color: #f9a825 !important; } .yellow.darken-4 { background-color: #f57f17 !important; } .yellow-text.text-darken-4 { color: #f57f17 !important; } .yellow.accent-1 { background-color: #ffff8d !important; } .yellow-text.text-accent-1 { color: #ffff8d !important; } .yellow.accent-2 { background-color: #ffff00 !important; } .yellow-text.text-accent-2 { color: #ffff00 !important; } .yellow.accent-3 { background-color: #ffea00 !important; } .yellow-text.text-accent-3 { color: #ffea00 !important; } .yellow.accent-4 { background-color: #ffd600 !important; } .yellow-text.text-accent-4 { color: #ffd600 !important; } .amber.lighten-5 { background-color: #fff8e1 !important; } .amber-text.text-lighten-5 { color: #fff8e1 !important; } .amber.lighten-4 { background-color: #ffecb3 !important; } .amber-text.text-lighten-4 { color: #ffecb3 !important; } .amber.lighten-3 { background-color: #ffe082 !important; } .amber-text.text-lighten-3 { color: #ffe082 !important; } .amber.lighten-2 { background-color: #ffd54f !important; } .amber-text.text-lighten-2 { color: #ffd54f !important; } .amber.lighten-1 { background-color: #ffca28 !important; } .amber-text.text-lighten-1 { color: #ffca28 !important; } .amber { background-color: #ffc107 !important; } .amber-text { color: #ffc107 !important; } .amber.darken-1 { background-color: #ffb300 !important; } .amber-text.text-darken-1 { color: #ffb300 !important; } .amber.darken-2 { background-color: #ffa000 !important; } .amber-text.text-darken-2 { color: #ffa000 !important; } .amber.darken-3 { background-color: #ff8f00 !important; } .amber-text.text-darken-3 { color: #ff8f00 !important; } .amber.darken-4 { background-color: #ff6f00 !important; } .amber-text.text-darken-4 { color: #ff6f00 !important; } .amber.accent-1 { background-color: #ffe57f !important; } .amber-text.text-accent-1 { color: #ffe57f !important; } .amber.accent-2 { background-color: #ffd740 !important; } .amber-text.text-accent-2 { color: #ffd740 !important; } .amber.accent-3 { background-color: #ffc400 !important; } .amber-text.text-accent-3 { color: #ffc400 !important; } .amber.accent-4 { background-color: #ffab00 !important; } .amber-text.text-accent-4 { color: #ffab00 !important; } .orange.lighten-5 { background-color: #fff3e0 !important; } .orange-text.text-lighten-5 { color: #fff3e0 !important; } .orange.lighten-4 { background-color: #ffe0b2 !important; } .orange-text.text-lighten-4 { color: #ffe0b2 !important; } .orange.lighten-3 { background-color: #ffcc80 !important; } .orange-text.text-lighten-3 { color: #ffcc80 !important; } .orange.lighten-2 { background-color: #ffb74d !important; } .orange-text.text-lighten-2 { color: #ffb74d !important; } .orange.lighten-1 { background-color: #ffa726 !important; } .orange-text.text-lighten-1 { color: #ffa726 !important; } .orange { background-color: #ff9800 !important; } .orange-text { color: #ff9800 !important; } .orange.darken-1 { background-color: #fb8c00 !important; } .orange-text.text-darken-1 { color: #fb8c00 !important; } .orange.darken-2 { background-color: #f57c00 !important; } .orange-text.text-darken-2 { color: #f57c00 !important; } .orange.darken-3 { background-color: #ef6c00 !important; } .orange-text.text-darken-3 { color: #ef6c00 !important; } .orange.darken-4 { background-color: #e65100 !important; } .orange-text.text-darken-4 { color: #e65100 !important; } .orange.accent-1 { background-color: #ffd180 !important; } .orange-text.text-accent-1 { color: #ffd180 !important; } .orange.accent-2 { background-color: #ffab40 !important; } .orange-text.text-accent-2 { color: #ffab40 !important; } .orange.accent-3 { background-color: #ff9100 !important; } .orange-text.text-accent-3 { color: #ff9100 !important; } .orange.accent-4 { background-color: #ff6d00 !important; } .orange-text.text-accent-4 { color: #ff6d00 !important; } .deep-orange.lighten-5 { background-color: #fbe9e7 !important; } .deep-orange-text.text-lighten-5 { color: #fbe9e7 !important; } .deep-orange.lighten-4 { background-color: #ffccbc !important; } .deep-orange-text.text-lighten-4 { color: #ffccbc !important; } .deep-orange.lighten-3 { background-color: #ffab91 !important; } .deep-orange-text.text-lighten-3 { color: #ffab91 !important; } .deep-orange.lighten-2 { background-color: #ff8a65 !important; } .deep-orange-text.text-lighten-2 { color: #ff8a65 !important; } .deep-orange.lighten-1 { background-color: #ff7043 !important; } .deep-orange-text.text-lighten-1 { color: #ff7043 !important; } .deep-orange { background-color: #ff5722 !important; } .deep-orange-text { color: #ff5722 !important; } .deep-orange.darken-1 { background-color: #f4511e !important; } .deep-orange-text.text-darken-1 { color: #f4511e !important; } .deep-orange.darken-2 { background-color: #e64a19 !important; } .deep-orange-text.text-darken-2 { color: #e64a19 !important; } .deep-orange.darken-3 { background-color: #d84315 !important; } .deep-orange-text.text-darken-3 { color: #d84315 !important; } .deep-orange.darken-4 { background-color: #bf360c !important; } .deep-orange-text.text-darken-4 { color: #bf360c !important; } .deep-orange.accent-1 { background-color: #ff9e80 !important; } .deep-orange-text.text-accent-1 { color: #ff9e80 !important; } .deep-orange.accent-2 { background-color: #ff6e40 !important; } .deep-orange-text.text-accent-2 { color: #ff6e40 !important; } .deep-orange.accent-3 { background-color: #ff3d00 !important; } .deep-orange-text.text-accent-3 { color: #ff3d00 !important; } .deep-orange.accent-4 { background-color: #dd2c00 !important; } .deep-orange-text.text-accent-4 { color: #dd2c00 !important; } .brown.lighten-5 { background-color: #efebe9 !important; } .brown-text.text-lighten-5 { color: #efebe9 !important; } .brown.lighten-4 { background-color: #d7ccc8 !important; } .brown-text.text-lighten-4 { color: #d7ccc8 !important; } .brown.lighten-3 { background-color: #bcaaa4 !important; } .brown-text.text-lighten-3 { color: #bcaaa4 !important; } .brown.lighten-2 { background-color: #a1887f !important; } .brown-text.text-lighten-2 { color: #a1887f !important; } .brown.lighten-1 { background-color: #8d6e63 !important; } .brown-text.text-lighten-1 { color: #8d6e63 !important; } .brown { background-color: #795548 !important; } .brown-text { color: #795548 !important; } .brown.darken-1 { background-color: #6d4c41 !important; } .brown-text.text-darken-1 { color: #6d4c41 !important; } .brown.darken-2 { background-color: #5d4037 !important; } .brown-text.text-darken-2 { color: #5d4037 !important; } .brown.darken-3 { background-color: #4e342e !important; } .brown-text.text-darken-3 { color: #4e342e !important; } .brown.darken-4 { background-color: #3e2723 !important; } .brown-text.text-darken-4 { color: #3e2723 !important; } .blue-grey.lighten-5 { background-color: #eceff1 !important; } .blue-grey-text.text-lighten-5 { color: #eceff1 !important; } .blue-grey.lighten-4 { background-color: #cfd8dc !important; } .blue-grey-text.text-lighten-4 { color: #cfd8dc !important; } .blue-grey.lighten-3 { background-color: #b0bec5 !important; } .blue-grey-text.text-lighten-3 { color: #b0bec5 !important; } .blue-grey.lighten-2 { background-color: #90a4ae !important; } .blue-grey-text.text-lighten-2 { color: #90a4ae !important; } .blue-grey.lighten-1 { background-color: #78909c !important; } .blue-grey-text.text-lighten-1 { color: #78909c !important; } .blue-grey { background-color: #607d8b !important; } .blue-grey-text { color: #607d8b !important; } .blue-grey.darken-1 { background-color: #546e7a !important; } .blue-grey-text.text-darken-1 { color: #546e7a !important; } .blue-grey.darken-2 { background-color: #455a64 !important; } .blue-grey-text.text-darken-2 { color: #455a64 !important; } .blue-grey.darken-3 { background-color: #37474f !important; } .blue-grey-text.text-darken-3 { color: #37474f !important; } .blue-grey.darken-4 { background-color: #263238 !important; } .blue-grey-text.text-darken-4 { color: #263238 !important; } .grey.lighten-5 { background-color: #fafafa !important; } .grey-text.text-lighten-5 { color: #fafafa !important; } .grey.lighten-4 { background-color: #f5f5f5 !important; } .grey-text.text-lighten-4 { color: #f5f5f5 !important; } .grey.lighten-3 { background-color: #eeeeee !important; } .grey-text.text-lighten-3 { color: #eeeeee !important; } .grey.lighten-2 { background-color: #e0e0e0 !important; } .grey-text.text-lighten-2 { color: #e0e0e0 !important; } .grey.lighten-1 { background-color: #bdbdbd !important; } .grey-text.text-lighten-1 { color: #bdbdbd !important; } .grey { background-color: #9e9e9e !important; } .grey-text { color: #9e9e9e !important; } .grey.darken-1 { background-color: #757575 !important; } .grey-text.text-darken-1 { color: #757575 !important; } .grey.darken-2 { background-color: #616161 !important; } .grey-text.text-darken-2 { color: #616161 !important; } .grey.darken-3 { background-color: #424242 !important; } .grey-text.text-darken-3 { color: #424242 !important; } .grey.darken-4 { background-color: #212121 !important; } .grey-text.text-darken-4 { color: #212121 !important; } .shades.black { background-color: #000000 !important; } .shades-text.text-black { color: #000000 !important; } .shades.white { background-color: #FFFFFF !important; } .shades-text.text-white { color: #FFFFFF !important; } .shades.transparent { background-color: transparent !important; } .shades-text.text-transparent { color: transparent !important; } .black { background-color: #000000 !important; } .black-text { color: #000000 !important; } .white { background-color: #FFFFFF !important; } .white-text { color: #FFFFFF !important; } .transparent { background-color: transparent !important; } .transparent-text { color: transparent !important; } /*** Colors ***/ /*** Badges ***/ /*** Buttons ***/ /*** Cards ***/ /*** Collapsible ***/ /*** Dropdown ***/ /*** Fonts ***/ /*** Forms ***/ /*** Global ***/ /*** Navbar ***/ /*** SideNav ***/ /*** Tabs ***/ /*** Tables ***/ /*** Toasts ***/ /*** Typography ***/ /*** Collections ***/ /* Progress Bar */ /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ /** * 1. Set default font family to sans-serif. * 2. Prevent iOS text size adjust after orientation change, without disabling * user zoom. */ html { font-family: sans-serif; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */ } /** * Remove default margin. */ body { margin: 0; } /* HTML5 display definitions ========================================================================== */ /** * Correct `block` display not defined for any HTML5 element in IE 8/9. * Correct `block` display not defined for `details` or `summary` in IE 10/11 * and Firefox. * Correct `block` display not defined for `main` in IE 11. */ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } /** * 1. Correct `inline-block` display not defined in IE 8/9. * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. */ audio, canvas, progress, video { display: inline-block; /* 1 */ vertical-align: baseline; /* 2 */ } /** * Prevent modern browsers from displaying `audio` without controls. * Remove excess height in iOS 5 devices. */ audio:not([controls]) { display: none; height: 0; } /** * Address `[hidden]` styling not present in IE 8/9/10. * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. */ [hidden], template { display: none; } /* Links ========================================================================== */ /** * Remove the gray background color from active links in IE 10. */ a { background-color: transparent; } /** * Improve readability when focused and also mouse hovered in all browsers. */ a:active, a:hover { outline: 0; } /* Text-level semantics ========================================================================== */ /** * Address styling not present in IE 8/9/10/11, Safari, and Chrome. */ abbr[title] { border-bottom: 1px dotted; } /** * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. */ b, strong { font-weight: bold; } /** * Address styling not present in Safari and Chrome. */ dfn { font-style: italic; } /** * Address variable `h1` font-size and margin within `section` and `article` * contexts in Firefox 4+, Safari, and Chrome. */ h1 { font-size: 2em; margin: 0.67em 0; } /** * Address styling not present in IE 8/9. */ mark { background: #ff0; color: #000; } /** * Address inconsistent and variable font size in all browsers. */ small { font-size: 80%; } /** * Prevent `sub` and `sup` affecting `line-height` in all browsers. */ sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } /* Embedded content ========================================================================== */ /** * Remove border when inside `a` element in IE 8/9/10. */ img { border: 0; } /** * Correct overflow not hidden in IE 9/10/11. */ svg:not(:root) { overflow: hidden; } /* Grouping content ========================================================================== */ /** * Address margin not present in IE 8/9 and Safari. */ figure { margin: 1em 40px; } /** * Address differences between Firefox and other browsers. */ hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; } /** * Contain overflow in all browsers. */ pre { overflow: auto; } /** * Address odd `em`-unit font size rendering in all browsers. */ code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } /* Forms ========================================================================== */ /** * Known limitation: by default, Chrome and Safari on OS X allow very limited * styling of `select`, unless a `border` property is set. */ /** * 1. Correct color not being inherited. * Known issue: affects color of disabled elements. * 2. Correct font properties not being inherited. * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. */ button, input, optgroup, select, textarea { color: inherit; /* 1 */ font: inherit; /* 2 */ margin: 0; /* 3 */ } /** * Address `overflow` set to `hidden` in IE 8/9/10/11. */ button { overflow: visible; } /** * Address inconsistent `text-transform` inheritance for `button` and `select`. * All other form control elements do not inherit `text-transform` values. * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. * Correct `select` style inheritance in Firefox. */ button, select { text-transform: none; } /** * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` * and `video` controls. * 2. Correct inability to style clickable `input` types in iOS. * 3. Improve usability and consistency of cursor style between image-type * `input` and others. */ /* 1 */ html input[type="button"], button, input[type="reset"], input[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ } /** * Re-set default cursor for disabled elements. */ button[disabled], html input[disabled] { cursor: default; } /** * Remove inner padding and border in Firefox 4+. */ button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } /** * Address Firefox 4+ setting `line-height` on `input` using `!important` in * the UA stylesheet. */ input { line-height: normal; } /** * It's recommended that you don't attempt to style these elements. * Firefox's implementation doesn't respect box-sizing, padding, or width. * * 1. Address box sizing set to `content-box` in IE 8/9/10. * 2. Remove excess padding in IE 8/9/10. */ input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ } /** * Fix the cursor style for Chrome's increment/decrement buttons. For certain * `font-size` values of the `input`, it causes the cursor style of the * decrement button to change from `default` to `text`. */ input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } /** * 1. Address `appearance` set to `searchfield` in Safari and Chrome. * 2. Address `box-sizing` set to `border-box` in Safari and Chrome * (include `-moz` to future-proof). */ input[type="search"] { -webkit-appearance: textfield; /* 1 */ -moz-box-sizing: content-box; -webkit-box-sizing: content-box; /* 2 */ box-sizing: content-box; } /** * Remove inner padding and search cancel button in Safari and Chrome on OS X. * Safari (but not Chrome) clips the cancel button when the search input has * padding (and `textfield` appearance). */ input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } /** * Define consistent border, margin, and padding. */ fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } /** * 1. Correct `color` not being inherited in IE 8/9/10/11. * 2. Remove padding so people aren't caught out if they zero out fieldsets. */ legend { border: 0; /* 1 */ padding: 0; /* 2 */ } /** * Remove default vertical scrollbar in IE 8/9/10/11. */ textarea { overflow: auto; } /** * Don't inherit the `font-weight` (applied by a rule above). * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. */ optgroup { font-weight: bold; } /* Tables ========================================================================== */ /** * Remove most spacing between table cells. */ table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; } html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } ul { list-style-type: none; } a { color: #039be5; text-decoration: none; -webkit-tap-highlight-color: transparent; } .valign-wrapper { display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-flex-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center; } .valign-wrapper .valign { display: block; } ul { padding: 0; } ul li { list-style-type: none; } .clearfix { clear: both; } .z-depth-1, nav, .card-panel, .card, .toast, .btn, .btn-large, .btn-floating, .dropdown-content, .collapsible, .side-nav { -webkit-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); -moz-box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); } .z-depth-1-half, .btn:hover, .btn-large:hover, .btn-floating:hover { -webkit-box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15); box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15); } .z-depth-2 { -webkit-box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); -moz-box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); } .z-depth-3 { -webkit-box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19); -moz-box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19); box-shadow: 0 12px 15px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19); } .z-depth-4, .modal { -webkit-box-shadow: 0 16px 28px 0 rgba(0, 0, 0, 0.22), 0 25px 55px 0 rgba(0, 0, 0, 0.21); -moz-box-shadow: 0 16px 28px 0 rgba(0, 0, 0, 0.22), 0 25px 55px 0 rgba(0, 0, 0, 0.21); box-shadow: 0 16px 28px 0 rgba(0, 0, 0, 0.22), 0 25px 55px 0 rgba(0, 0, 0, 0.21); } .z-depth-5 { -webkit-box-shadow: 0 27px 24px 0 rgba(0, 0, 0, 0.2), 0 40px 77px 0 rgba(0, 0, 0, 0.22); -moz-box-shadow: 0 27px 24px 0 rgba(0, 0, 0, 0.2), 0 40px 77px 0 rgba(0, 0, 0, 0.22); box-shadow: 0 27px 24px 0 rgba(0, 0, 0, 0.2), 0 40px 77px 0 rgba(0, 0, 0, 0.22); } .divider { height: 1px; overflow: hidden; background-color: #e0e0e0; } blockquote { margin: 20px 0; padding-left: 1.5rem; border-left: 5px solid #EF9A9A; } i { line-height: inherit; } i.left { float: left; margin-right: 15px; } i.right { float: right; margin-left: 15px; } i.tiny { font-size: 1rem; } i.small { font-size: 2rem; } i.medium { font-size: 4rem; } i.large { font-size: 6rem; } img.responsive-img, video.responsive-video { max-width: 100%; height: auto; } .pagination li { font-size: 1.2rem; float: left; width: 30px; height: 30px; margin: 0 10px; border-radius: 2px; text-align: center; } .pagination li a { color: #444; } .pagination li.active a { color: #fff; } .pagination li.active { background-color: #ee6e73; } .pagination li.disabled a { color: #999; } .pagination li i { font-size: 2rem; line-height: 1.8rem; } .parallax-container { position: relative; overflow: hidden; height: 500px; } .parallax { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; } .parallax img { display: none; position: absolute; left: 50%; bottom: 0; min-width: 100%; min-height: 100%; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); transform: translateX(-50%); } .pin-top, .pin-bottom { position: relative; } .pinned { position: fixed !important; } /********************* Transition Classes **********************/ ul.staggered-list li { opacity: 0; } .fade-in { opacity: 0; transform-origin: 0 50%; } /********************* Media Query Classes **********************/ @media only screen and (max-width : 600px) { .hide-on-small-only, .hide-on-small-and-down { display: none !important; } } @media only screen and (max-width : 992px) { .hide-on-med-and-down { display: none !important; } } @media only screen and (min-width : 601px) { .hide-on-med-and-up { display: none !important; } } @media only screen and (min-width: 600px) and (max-width: 992px) { .hide-on-med-only { display: none !important; } } @media only screen and (min-width : 993px) { .hide-on-large-only { display: none !important; } } @media only screen and (min-width : 993px) { .show-on-large { display: initial !important; } } @media only screen and (min-width: 600px) and (max-width: 992px) { .show-on-medium { display: initial !important; } } @media only screen and (max-width : 600px) { .show-on-small { display: initial !important; } } @media only screen and (min-width : 601px) { .show-on-medium-and-up { display: initial !important; } } @media only screen and (max-width : 992px) { .show-on-medium-and-down { display: initial !important; } } @media only screen and (max-width : 600px) { .center-on-small-only { text-align: center; } } footer.page-footer { margin-top: 20px; padding-top: 20px; background-color: #ee6e73; } footer.page-footer .footer-copyright { overflow: hidden; height: 50px; line-height: 50px; color: rgba(255, 255, 255, 0.8); background-color: rgba(51, 51, 51, 0.08); } table, th, td { border: none; } table { width: 100%; display: table; } table.bordered tr { border-bottom: 1px solid #d0d0d0; } table.striped tbody tr:nth-child(odd) { background-color: #f2f2f2; } table.hoverable tbody tr { -webkit-transition: background-color .25s ease; -moz-transition: background-color .25s ease; -o-transition: background-color .25s ease; -ms-transition: background-color .25s ease; transition: background-color .25s ease; } table.hoverable tbody tr:hover { background-color: #f2f2f2; } table.centered thead tr th, table.centered tbody tr td { text-align: center; } thead { border-bottom: 1px solid #d0d0d0; } td, th { padding: 15px 5px; display: table-cell; text-align: left; vertical-align: middle; border-radius: 2px; } @media only screen and (max-width : 992px) { table.responsive-table { width: 100%; border-collapse: collapse; border-spacing: 0; display: block; position: relative; /* sort out borders */ } table.responsive-table th, table.responsive-table td { margin: 0; vertical-align: top; } table.responsive-table th { text-align: left; } table.responsive-table thead { display: block; float: left; } table.responsive-table thead tr { display: block; padding: 0 10px 0 0; } table.responsive-table thead tr th::before { content: "\00a0"; } table.responsive-table tbody { display: block; width: auto; position: relative; overflow-x: auto; white-space: nowrap; } table.responsive-table tbody tr { display: inline-block; vertical-align: top; } table.responsive-table th { display: block; text-align: right; } table.responsive-table td { display: block; min-height: 1.25em; text-align: left; } table.responsive-table tr { padding: 0 10px; } table.responsive-table thead { border: 0; border-right: 1px solid #d0d0d0; } table.responsive-table.bordered th { border-bottom: 0; border-left: 0; } table.responsive-table.bordered td { border-left: 0; border-right: 0; border-bottom: 0; } table.responsive-table.bordered tr { border: 0; } table.responsive-table.bordered tbody tr { border-right: 1px solid #d0d0d0; } } .collection { margin: 0.5rem 0 1rem 0; border: 1px solid #e0e0e0; border-radius: 2px; overflow: hidden; position: relative; } .collection .collection-item { background-color: #fff; line-height: 1.5rem; padding: 10px 20px; margin: 0; border-bottom: 1px solid #e0e0e0; } .collection .collection-item.avatar { height: 84px; padding-left: 72px; position: relative; } .collection .collection-item.avatar .circle { position: absolute; width: 42px; height: 42px; overflow: hidden; left: 15px; display: inline-block; vertical-align: middle; } .collection .collection-item.avatar i.circle { font-size: 18px; line-height: 42px; color: #fff; background-color: #999; text-align: center; } .collection .collection-item.avatar .title { font-size: 16px; } .collection .collection-item.avatar p { margin: 0; } .collection .collection-item.avatar .secondary-content { position: absolute; top: 16px; right: 16px; } .collection .collection-item:last-child { border-bottom: none; } .collection .collection-item.active { background-color: #26a69a; color: #eafaf9; } .collection a.collection-item { display: block; -webkit-transition: 0.25s; -moz-transition: 0.25s; -o-transition: 0.25s; -ms-transition: 0.25s; transition: 0.25s; color: #26a69a; } .collection a.collection-item:not(.active):hover { background-color: #ddd; } .collection.with-header .collection-header { background-color: #fff; border-bottom: 1px solid #e0e0e0; padding: 10px 20px; } .collection.with-header .collection-item { padding-left: 30px; } .secondary-content { float: right; color: #26a69a; } span.badge { min-width: 3rem; padding: 0 6px; text-align: center; font-size: 1rem; line-height: inherit; color: #757575; position: absolute; right: 15px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } span.badge.new { font-weight: 300; font-size: 0.8rem; color: #fff; background-color: #26a69a; border-radius: 2px; } span.badge.new:after { content: " new"; } .video-container { position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden; } .video-container.no-controls { padding-top: 0; } .video-container iframe, .video-container object, .video-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .progress { position: relative; height: 4px; display: block; width: 100%; background-color: #acece6; border-radius: 2px; margin: 0.5rem 0 1rem 0; overflow: hidden; } .progress .determinate { position: absolute; background-color: inherit; top: 0; bottom: 0; background-color: #26a69a; -webkit-transition: width .3s linear; -moz-transition: width .3s linear; -o-transition: width .3s linear; -ms-transition: width .3s linear; transition: width .3s linear; } .progress .indeterminate { background-color: #26a69a; } .progress .indeterminate:before { content: ''; position: absolute; background-color: inherit; top: 0; left: 0; bottom: 0; will-change: left, right; -webkit-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; -moz-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; -ms-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; -o-animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; } .progress .indeterminate:after { content: ''; position: absolute; background-color: inherit; top: 0; left: 0; bottom: 0; will-change: left, right; -webkit-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; -moz-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; -ms-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; -o-animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; -webkit-animation-delay: 1.15s; -moz-animation-delay: 1.15s; -ms-animation-delay: 1.15s; -o-animation-delay: 1.15s; animation-delay: 1.15s; } @-webkit-keyframes indeterminate { 0% { left: -35%; right: 100%; } 60% { left: 100%; right: -90%; } 100% { left: 100%; right: -90%; } } @-moz-keyframes indeterminate { 0% { left: -35%; right: 100%; } 60% { left: 100%; right: -90%; } 100% { left: 100%; right: -90%; } } @keyframes indeterminate { 0% { left: -35%; right: 100%; } 60% { left: 100%; right: -90%; } 100% { left: 100%; right: -90%; } } @-webkit-keyframes indeterminate-short { 0% { left: -200%; right: 100%; } 60% { left: 107%; right: -8%; } 100% { left: 107%; right: -8%; } } @-moz-keyframes indeterminate-short { 0% { left: -200%; right: 100%; } 60% { left: 107%; right: -8%; } 100% { left: 107%; right: -8%; } } @keyframes indeterminate-short { 0% { left: -200%; right: 100%; } 60% { left: 107%; right: -8%; } 100% { left: 107%; right: -8%; } } /******************* Utility Classes *******************/ .hide { display: none !important; } .left-align { text-align: left; } .right-align { text-align: right; } .center, .center-align { text-align: center; } .left { float: left !important; } .right { float: right !important; } .no-select, input[type=range], input[type=range] + .thumb { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .circle { border-radius: 50%; } .center-block { display: block; margin-left: auto; margin-right: auto; } .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .no-padding { padding: 0 !important; } @font-face { font-family: "Material-Design-Icons"; src: url("../font/material-design-icons/Material-Design-Icons.eot?#iefix") format("embedded-opentype"), url("../font/material-design-icons/Material-Design-Icons.woff2") format("woff2"), url("../font/material-design-icons/Material-Design-Icons.woff") format("woff"), url("../font/material-design-icons/Material-Design-Icons.ttf") format("truetype"), url("../font/material-design-icons/Material-Design-Icons.svg#Material-Design-Icons") format("svg"); font-weight: normal; font-style: normal; } [class^="mdi-"], [class*=" mdi-"] { font-family: "Material-Design-Icons"; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; text-rendering: auto; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .mdi-action-3d-rotation:before { content: "\e600"; } .mdi-action-accessibility:before { content: "\e601"; } .mdi-action-account-balance:before { content: "\e602"; } .mdi-action-account-balance-wallet:before { content: "\e603"; } .mdi-action-account-box:before { content: "\e604"; } .mdi-action-account-child:before { content: "\e605"; } .mdi-action-account-circle:before { content: "\e606"; } .mdi-action-add-shopping-cart:before { content: "\e607"; } .mdi-action-alarm:before { content: "\e608"; } .mdi-action-alarm-add:before { content: "\e609"; } .mdi-action-alarm-off:before { content: "\e60a"; } .mdi-action-alarm-on:before { content: "\e60b"; } .mdi-action-android:before { content: "\e60c"; } .mdi-action-announcement:before { content: "\e60d"; } .mdi-action-aspect-ratio:before { content: "\e60e"; } .mdi-action-assessment:before { content: "\e60f"; } .mdi-action-assignment:before { content: "\e610"; } .mdi-action-assignment-ind:before { content: "\e611"; } .mdi-action-assignment-late:before { content: "\e612"; } .mdi-action-assignment-return:before { content: "\e613"; } .mdi-action-assignment-returned:before { content: "\e614"; } .mdi-action-assignment-turned-in:before { content: "\e615"; } .mdi-action-autorenew:before { content: "\e616"; } .mdi-action-backup:before { content: "\e617"; } .mdi-action-book:before { content: "\e618"; } .mdi-action-bookmark:before { content: "\e619"; } .mdi-action-bookmark-outline:before { content: "\e61a"; } .mdi-action-bug-report:before { content: "\e61b"; } .mdi-action-cached:before { content: "\e61c"; } .mdi-action-class:before { content: "\e61d"; } .mdi-action-credit-card:before { content: "\e61e"; } .mdi-action-dashboard:before { content: "\e61f"; } .mdi-action-delete:before { content: "\e620"; } .mdi-action-description:before { content: "\e621"; } .mdi-action-dns:before { content: "\e622"; } .mdi-action-done:before { content: "\e623"; } .mdi-action-done-all:before { content: "\e624"; } .mdi-action-event:before { content: "\e625"; } .mdi-action-exit-to-app:before { content: "\e626"; } .mdi-action-explore:before { content: "\e627"; } .mdi-action-extension:before { content: "\e628"; } .mdi-action-face-unlock:before { content: "\e629"; } .mdi-action-favorite:before { content: "\e62a"; } .mdi-action-favorite-outline:before { content: "\e62b"; } .mdi-action-find-in-page:before { content: "\e62c"; } .mdi-action-find-replace:before { content: "\e62d"; } .mdi-action-flip-to-back:before { content: "\e62e"; } .mdi-action-flip-to-front:before { content: "\e62f"; } .mdi-action-get-app:before { content: "\e630"; } .mdi-action-grade:before { content: "\e631"; } .mdi-action-group-work:before { content: "\e632"; } .mdi-action-help:before { content: "\e633"; } .mdi-action-highlight-remove:before { content: "\e634"; } .mdi-action-history:before { content: "\e635"; } .mdi-action-home:before { content: "\e636"; } .mdi-action-https:before { content: "\e637"; } .mdi-action-info:before { content: "\e638"; } .mdi-action-info-outline:before { content: "\e639"; } .mdi-action-input:before { content: "\e63a"; } .mdi-action-invert-colors:before { content: "\e63b"; } .mdi-action-label:before { content: "\e63c"; } .mdi-action-label-outline:before { content: "\e63d"; } .mdi-action-language:before { content: "\e63e"; } .mdi-action-launch:before { content: "\e63f"; } .mdi-action-list:before { content: "\e640"; } .mdi-action-lock:before { content: "\e641"; } .mdi-action-lock-open:before { content: "\e642"; } .mdi-action-lock-outline:before { content: "\e643"; } .mdi-action-loyalty:before { content: "\e644"; } .mdi-action-markunread-mailbox:before { content: "\e645"; } .mdi-action-note-add:before { content: "\e646"; } .mdi-action-open-in-browser:before { content: "\e647"; } .mdi-action-open-in-new:before { content: "\e648"; } .mdi-action-open-with:before { content: "\e649"; } .mdi-action-pageview:before { content: "\e64a"; } .mdi-action-payment:before { content: "\e64b"; } .mdi-action-perm-camera-mic:before { content: "\e64c"; } .mdi-action-perm-contact-cal:before { content: "\e64d"; } .mdi-action-perm-data-setting:before { content: "\e64e"; } .mdi-action-perm-device-info:before { content: "\e64f"; } .mdi-action-perm-identity:before { content: "\e650"; } .mdi-action-perm-media:before { content: "\e651"; } .mdi-action-perm-phone-msg:before { content: "\e652"; } .mdi-action-perm-scan-wifi:before { content: "\e653"; } .mdi-action-picture-in-picture:before { content: "\e654"; } .mdi-action-polymer:before { content: "\e655"; } .mdi-action-print:before { content: "\e656"; } .mdi-action-query-builder:before { content: "\e657"; } .mdi-action-question-answer:before { content: "\e658"; } .mdi-action-receipt:before { content: "\e659"; } .mdi-action-redeem:before { content: "\e65a"; } .mdi-action-report-problem:before { content: "\e65b"; } .mdi-action-restore:before { content: "\e65c"; } .mdi-action-room:before { content: "\e65d"; } .mdi-action-schedule:before { content: "\e65e"; } .mdi-action-search:before { content: "\e65f"; } .mdi-action-settings:before { content: "\e660"; } .mdi-action-settings-applications:before { content: "\e661"; } .mdi-action-settings-backup-restore:before { content: "\e662"; } .mdi-action-settings-bluetooth:before { content: "\e663"; } .mdi-action-settings-cell:before { content: "\e664"; } .mdi-action-settings-display:before { content: "\e665"; } .mdi-action-settings-ethernet:before { content: "\e666"; } .mdi-action-settings-input-antenna:before { content: "\e667"; } .mdi-action-settings-input-component:before { content: "\e668"; } .mdi-action-settings-input-composite:before { content: "\e669"; } .mdi-action-settings-input-hdmi:before { content: "\e66a"; } .mdi-action-settings-input-svideo:before { content: "\e66b"; } .mdi-action-settings-overscan:before { content: "\e66c"; } .mdi-action-settings-phone:before { content: "\e66d"; } .mdi-action-settings-power:before { content: "\e66e"; } .mdi-action-settings-remote:before { content: "\e66f"; } .mdi-action-settings-voice:before { content: "\e670"; } .mdi-action-shop:before { content: "\e671"; } .mdi-action-shopping-basket:before { content: "\e672"; } .mdi-action-shopping-cart:before { content: "\e673"; } .mdi-action-shop-two:before { content: "\e674"; } .mdi-action-speaker-notes:before { content: "\e675"; } .mdi-action-spellcheck:before { content: "\e676"; } .mdi-action-star-rate:before { content: "\e677"; } .mdi-action-stars:before { content: "\e678"; } .mdi-action-store:before { content: "\e679"; } .mdi-action-subject:before { content: "\e67a"; } .mdi-action-swap-horiz:before { content: "\e67b"; } .mdi-action-swap-vert:before { content: "\e67c"; } .mdi-action-swap-vert-circle:before { content: "\e67d"; } .mdi-action-system-update-tv:before { content: "\e67e"; } .mdi-action-tab:before { content: "\e67f"; } .mdi-action-tab-unselected:before { content: "\e680"; } .mdi-action-theaters:before { content: "\e681"; } .mdi-action-thumb-down:before { content: "\e682"; } .mdi-action-thumbs-up-down:before { content: "\e683"; } .mdi-action-thumb-up:before { content: "\e684"; } .mdi-action-toc:before { content: "\e685"; } .mdi-action-today:before { content: "\e686"; } .mdi-action-track-changes:before { content: "\e687"; } .mdi-action-translate:before { content: "\e688"; } .mdi-action-trending-down:before { content: "\e689"; } .mdi-action-trending-neutral:before { content: "\e68a"; } .mdi-action-trending-up:before { content: "\e68b"; } .mdi-action-turned-in:before { content: "\e68c"; } .mdi-action-turned-in-not:before { content: "\e68d"; } .mdi-action-verified-user:before { content: "\e68e"; } .mdi-action-view-agenda:before { content: "\e68f"; } .mdi-action-view-array:before { content: "\e690"; } .mdi-action-view-carousel:before { content: "\e691"; } .mdi-action-view-column:before { content: "\e692"; } .mdi-action-view-day:before { content: "\e693"; } .mdi-action-view-headline:before { content: "\e694"; } .mdi-action-view-list:before { content: "\e695"; } .mdi-action-view-module:before { content: "\e696"; } .mdi-action-view-quilt:before { content: "\e697"; } .mdi-action-view-stream:before { content: "\e698"; } .mdi-action-view-week:before { content: "\e699"; } .mdi-action-visibility:before { content: "\e69a"; } .mdi-action-visibility-off:before { content: "\e69b"; } .mdi-action-wallet-giftcard:before { content: "\e69c"; } .mdi-action-wallet-membership:before { content: "\e69d"; } .mdi-action-wallet-travel:before { content: "\e69e"; } .mdi-action-work:before { content: "\e69f"; } .mdi-alert-error:before { content: "\e6a0"; } .mdi-alert-warning:before { content: "\e6a1"; } .mdi-av-album:before { content: "\e6a2"; } .mdi-av-timer:before { content: "\e6a3"; } .mdi-av-closed-caption:before { content: "\e6a4"; } .mdi-av-equalizer:before { content: "\e6a5"; } .mdi-av-explicit:before { content: "\e6a6"; } .mdi-av-fast-forward:before { content: "\e6a7"; } .mdi-av-fast-rewind:before { content: "\e6a8"; } .mdi-av-games:before { content: "\e6a9"; } .mdi-av-hearing:before { content: "\e6aa"; } .mdi-av-high-quality:before { content: "\e6ab"; } .mdi-av-loop:before { content: "\e6ac"; } .mdi-av-mic:before { content: "\e6ad"; } .mdi-av-mic-none:before { content: "\e6ae"; } .mdi-av-mic-off:before { content: "\e6af"; } .mdi-av-movie:before { content: "\e6b0"; } .mdi-av-my-library-add:before { content: "\e6b1"; } .mdi-av-my-library-books:before { content: "\e6b2"; } .mdi-av-my-library-music:before { content: "\e6b3"; } .mdi-av-new-releases:before { content: "\e6b4"; } .mdi-av-not-interested:before { content: "\e6b5"; } .mdi-av-pause:before { content: "\e6b6"; } .mdi-av-pause-circle-fill:before { content: "\e6b7"; } .mdi-av-pause-circle-outline:before { content: "\e6b8"; } .mdi-av-play-arrow:before { content: "\e6b9"; } .mdi-av-play-circle-fill:before { content: "\e6ba"; } .mdi-av-play-circle-outline:before { content: "\e6bb"; } .mdi-av-playlist-add:before { content: "\e6bc"; } .mdi-av-play-shopping-bag:before { content: "\e6bd"; } .mdi-av-queue:before { content: "\e6be"; } .mdi-av-queue-music:before { content: "\e6bf"; } .mdi-av-radio:before { content: "\e6c0"; } .mdi-av-recent-actors:before { content: "\e6c1"; } .mdi-av-repeat:before { content: "\e6c2"; } .mdi-av-repeat-one:before { content: "\e6c3"; } .mdi-av-replay:before { content: "\e6c4"; } .mdi-av-shuffle:before { content: "\e6c5"; } .mdi-av-skip-next:before { content: "\e6c6"; } .mdi-av-skip-previous:before { content: "\e6c7"; } .mdi-av-snooze:before { content: "\e6c8"; } .mdi-av-stop:before { content: "\e6c9"; } .mdi-av-subtitles:before { content: "\e6ca"; } .mdi-av-surround-sound:before { content: "\e6cb"; } .mdi-av-videocam:before { content: "\e6cc"; } .mdi-av-videocam-off:before { content: "\e6cd"; } .mdi-av-video-collection:before { content: "\e6ce"; } .mdi-av-volume-down:before { content: "\e6cf"; } .mdi-av-volume-mute:before { content: "\e6d0"; } .mdi-av-volume-off:before { content: "\e6d1"; } .mdi-av-volume-up:before { content: "\e6d2"; } .mdi-av-web:before { content: "\e6d3"; } .mdi-communication-business:before { content: "\e6d4"; } .mdi-communication-call:before { content: "\e6d5"; } .mdi-communication-call-end:before { content: "\e6d6"; } .mdi-communication-call-made:before { content: "\e6d7"; } .mdi-communication-call-merge:before { content: "\e6d8"; } .mdi-communication-call-missed:before { content: "\e6d9"; } .mdi-communication-call-received:before { content: "\e6da"; } .mdi-communication-call-split:before { content: "\e6db"; } .mdi-communication-chat:before { content: "\e6dc"; } .mdi-communication-clear-all:before { content: "\e6dd"; } .mdi-communication-comment:before { content: "\e6de"; } .mdi-communication-contacts:before { content: "\e6df"; } .mdi-communication-dialer-sip:before { content: "\e6e0"; } .mdi-communication-dialpad:before { content: "\e6e1"; } .mdi-communication-dnd-on:before { content: "\e6e2"; } .mdi-communication-email:before { content: "\e6e3"; } .mdi-communication-forum:before { content: "\e6e4"; } .mdi-communication-import-export:before { content: "\e6e5"; } .mdi-communication-invert-colors-off:before { content: "\e6e6"; } .mdi-communication-invert-colors-on:before { content: "\e6e7"; } .mdi-communication-live-help:before { content: "\e6e8"; } .mdi-communication-location-off:before { content: "\e6e9"; } .mdi-communication-location-on:before { content: "\e6ea"; } .mdi-communication-message:before { content: "\e6eb"; } .mdi-communication-messenger:before { content: "\e6ec"; } .mdi-communication-no-sim:before { content: "\e6ed"; } .mdi-communication-phone:before { content: "\e6ee"; } .mdi-communication-portable-wifi-off:before { content: "\e6ef"; } .mdi-communication-quick-contacts-dialer:before { content: "\e6f0"; } .mdi-communication-quick-contacts-mail:before { content: "\e6f1"; } .mdi-communication-ring-volume:before { content: "\e6f2"; } .mdi-communication-stay-current-landscape:before { content: "\e6f3"; } .mdi-communication-stay-current-portrait:before { content: "\e6f4"; } .mdi-communication-stay-primary-landscape:before { content: "\e6f5"; } .mdi-communication-stay-primary-portrait:before { content: "\e6f6"; } .mdi-communication-swap-calls:before { content: "\e6f7"; } .mdi-communication-textsms:before { content: "\e6f8"; } .mdi-communication-voicemail:before { content: "\e6f9"; } .mdi-communication-vpn-key:before { content: "\e6fa"; } .mdi-content-add:before { content: "\e6fb"; } .mdi-content-add-box:before { content: "\e6fc"; } .mdi-content-add-circle:before { content: "\e6fd"; } .mdi-content-add-circle-outline:before { content: "\e6fe"; } .mdi-content-archive:before { content: "\e6ff"; } .mdi-content-backspace:before { content: "\e700"; } .mdi-content-block:before { content: "\e701"; } .mdi-content-clear:before { content: "\e702"; } .mdi-content-content-copy:before { content: "\e703"; } .mdi-content-content-cut:before { content: "\e704"; } .mdi-content-content-paste:before { content: "\e705"; } .mdi-content-create:before { content: "\e706"; } .mdi-content-drafts:before { content: "\e707"; } .mdi-content-filter-list:before { content: "\e708"; } .mdi-content-flag:before { content: "\e709"; } .mdi-content-forward:before { content: "\e70a"; } .mdi-content-gesture:before { content: "\e70b"; } .mdi-content-inbox:before { content: "\e70c"; } .mdi-content-link:before { content: "\e70d"; } .mdi-content-mail:before { content: "\e70e"; } .mdi-content-markunread:before { content: "\e70f"; } .mdi-content-redo:before { content: "\e710"; } .mdi-content-remove:before { content: "\e711"; } .mdi-content-remove-circle:before { content: "\e712"; } .mdi-content-remove-circle-outline:before { content: "\e713"; } .mdi-content-reply:before { content: "\e714"; } .mdi-content-reply-all:before { content: "\e715"; } .mdi-content-report:before { content: "\e716"; } .mdi-content-save:before { content: "\e717"; } .mdi-content-select-all:before { content: "\e718"; } .mdi-content-send:before { content: "\e719"; } .mdi-content-sort:before { content: "\e71a"; } .mdi-content-text-format:before { content: "\e71b"; } .mdi-content-undo:before { content: "\e71c"; } .mdi-device-access-alarm:before { content: "\e71d"; } .mdi-device-access-alarms:before { content: "\e71e"; } .mdi-device-access-time:before { content: "\e71f"; } .mdi-device-add-alarm:before { content: "\e720"; } .mdi-device-airplanemode-off:before { content: "\e721"; } .mdi-device-airplanemode-on:before { content: "\e722"; } .mdi-device-battery-20:before { content: "\e723"; } .mdi-device-battery-30:before { content: "\e724"; } .mdi-device-battery-50:before { content: "\e725"; } .mdi-device-battery-60:before { content: "\e726"; } .mdi-device-battery-80:before { content: "\e727"; } .mdi-device-battery-90:before { content: "\e728"; } .mdi-device-battery-alert:before { content: "\e729"; } .mdi-device-battery-charging-20:before { content: "\e72a"; } .mdi-device-battery-charging-30:before { content: "\e72b"; } .mdi-device-battery-charging-50:before { content: "\e72c"; } .mdi-device-battery-charging-60:before { content: "\e72d"; } .mdi-device-battery-charging-80:before { content: "\e72e"; } .mdi-device-battery-charging-90:before { content: "\e72f"; } .mdi-device-battery-charging-full:before { content: "\e730"; } .mdi-device-battery-full:before { content: "\e731"; } .mdi-device-battery-std:before { content: "\e732"; } .mdi-device-battery-unknown:before { content: "\e733"; } .mdi-device-bluetooth:before { content: "\e734"; } .mdi-device-bluetooth-connected:before { content: "\e735"; } .mdi-device-bluetooth-disabled:before { content: "\e736"; } .mdi-device-bluetooth-searching:before { content: "\e737"; } .mdi-device-brightness-auto:before { content: "\e738"; } .mdi-device-brightness-high:before { content: "\e739"; } .mdi-device-brightness-low:before { content: "\e73a"; } .mdi-device-brightness-medium:before { content: "\e73b"; } .mdi-device-data-usage:before { content: "\e73c"; } .mdi-device-developer-mode:before { content: "\e73d"; } .mdi-device-devices:before { content: "\e73e"; } .mdi-device-dvr:before { content: "\e73f"; } .mdi-device-gps-fixed:before { content: "\e740"; } .mdi-device-gps-not-fixed:before { content: "\e741"; } .mdi-device-gps-off:before { content: "\e742"; } .mdi-device-location-disabled:before { content: "\e743"; } .mdi-device-location-searching:before { content: "\e744"; } .mdi-device-multitrack-audio:before { content: "\e745"; } .mdi-device-network-cell:before { content: "\e746"; } .mdi-device-network-wifi:before { content: "\e747"; } .mdi-device-nfc:before { content: "\e748"; } .mdi-device-now-wallpaper:before { content: "\e749"; } .mdi-device-now-widgets:before { content: "\e74a"; } .mdi-device-screen-lock-landscape:before { content: "\e74b"; } .mdi-device-screen-lock-portrait:before { content: "\e74c"; } .mdi-device-screen-lock-rotation:before { content: "\e74d"; } .mdi-device-screen-rotation:before { content: "\e74e"; } .mdi-device-sd-storage:before { content: "\e74f"; } .mdi-device-settings-system-daydream:before { content: "\e750"; } .mdi-device-signal-cellular-0-bar:before { content: "\e751"; } .mdi-device-signal-cellular-1-bar:before { content: "\e752"; } .mdi-device-signal-cellular-2-bar:before { content: "\e753"; } .mdi-device-signal-cellular-3-bar:before { content: "\e754"; } .mdi-device-signal-cellular-4-bar:before { content: "\e755"; } .mdi-device-signal-cellular-connected-no-internet-0-bar:before { content: "\e756"; } .mdi-device-signal-cellular-connected-no-internet-1-bar:before { content: "\e757"; } .mdi-device-signal-cellular-connected-no-internet-2-bar:before { content: "\e758"; } .mdi-device-signal-cellular-connected-no-internet-3-bar:before { content: "\e759"; } .mdi-device-signal-cellular-connected-no-internet-4-bar:before { content: "\e75a"; } .mdi-device-signal-cellular-no-sim:before { content: "\e75b"; } .mdi-device-signal-cellular-null:before { content: "\e75c"; } .mdi-device-signal-cellular-off:before { content: "\e75d"; } .mdi-device-signal-wifi-0-bar:before { content: "\e75e"; } .mdi-device-signal-wifi-1-bar:before { content: "\e75f"; } .mdi-device-signal-wifi-2-bar:before { content: "\e760"; } .mdi-device-signal-wifi-3-bar:before { content: "\e761"; } .mdi-device-signal-wifi-4-bar:before { content: "\e762"; } .mdi-device-signal-wifi-off:before { content: "\e763"; } .mdi-device-storage:before { content: "\e764"; } .mdi-device-usb:before { content: "\e765"; } .mdi-device-wifi-lock:before { content: "\e766"; } .mdi-device-wifi-tethering:before { content: "\e767"; } .mdi-editor-attach-file:before { content: "\e768"; } .mdi-editor-attach-money:before { content: "\e769"; } .mdi-editor-border-all:before { content: "\e76a"; } .mdi-editor-border-bottom:before { content: "\e76b"; } .mdi-editor-border-clear:before { content: "\e76c"; } .mdi-editor-border-color:before { content: "\e76d"; } .mdi-editor-border-horizontal:before { content: "\e76e"; } .mdi-editor-border-inner:before { content: "\e76f"; } .mdi-editor-border-left:before { content: "\e770"; } .mdi-editor-border-outer:before { content: "\e771"; } .mdi-editor-border-right:before { content: "\e772"; } .mdi-editor-border-style:before { content: "\e773"; } .mdi-editor-border-top:before { content: "\e774"; } .mdi-editor-border-vertical:before { content: "\e775"; } .mdi-editor-format-align-center:before { content: "\e776"; } .mdi-editor-format-align-justify:before { content: "\e777"; } .mdi-editor-format-align-left:before { content: "\e778"; } .mdi-editor-format-align-right:before { content: "\e779"; } .mdi-editor-format-bold:before { content: "\e77a"; } .mdi-editor-format-clear:before { content: "\e77b"; } .mdi-editor-format-color-fill:before { content: "\e77c"; } .mdi-editor-format-color-reset:before { content: "\e77d"; } .mdi-editor-format-color-text:before { content: "\e77e"; } .mdi-editor-format-indent-decrease:before { content: "\e77f"; } .mdi-editor-format-indent-increase:before { content: "\e780"; } .mdi-editor-format-italic:before { content: "\e781"; } .mdi-editor-format-line-spacing:before { content: "\e782"; } .mdi-editor-format-list-bulleted:before { content: "\e783"; } .mdi-editor-format-list-numbered:before { content: "\e784"; } .mdi-editor-format-paint:before { content: "\e785"; } .mdi-editor-format-quote:before { content: "\e786"; } .mdi-editor-format-size:before { content: "\e787"; } .mdi-editor-format-strikethrough:before { content: "\e788"; } .mdi-editor-functions:before { content: "\e789"; } .mdi-editor-format-textdirection-l-to-r:before { content: "\e78a"; } .mdi-editor-format-underline:before { content: "\e78b"; } .mdi-editor-format-textdirection-r-to-l:before { content: "\e78c"; } .mdi-editor-insert-chart:before { content: "\e78d"; } .mdi-editor-insert-comment:before { content: "\e78e"; } .mdi-editor-insert-drive-file:before { content: "\e78f"; } .mdi-editor-insert-emoticon:before { content: "\e790"; } .mdi-editor-insert-invitation:before { content: "\e791"; } .mdi-editor-insert-link:before { content: "\e792"; } .mdi-editor-insert-photo:before { content: "\e793"; } .mdi-editor-merge-type:before { content: "\e794"; } .mdi-editor-mode-comment:before { content: "\e795"; } .mdi-editor-mode-edit:before { content: "\e796"; } .mdi-editor-publish:before { content: "\e797"; } .mdi-editor-vertical-align-bottom:before { content: "\e798"; } .mdi-editor-vertical-align-center:before { content: "\e799"; } .mdi-editor-vertical-align-top:before { content: "\e79a"; } .mdi-editor-wrap-text:before { content: "\e79b"; } .mdi-file-attachment:before { content: "\e79c"; } .mdi-file-cloud:before { content: "\e79d"; } .mdi-file-cloud-circle:before { content: "\e79e"; } .mdi-file-cloud-done:before { content: "\e79f"; } .mdi-file-cloud-download:before { content: "\e7a0"; } .mdi-file-cloud-off:before { content: "\e7a1"; } .mdi-file-cloud-queue:before { content: "\e7a2"; } .mdi-file-cloud-upload:before { content: "\e7a3"; } .mdi-file-file-download:before { content: "\e7a4"; } .mdi-file-file-upload:before { content: "\e7a5"; } .mdi-file-folder:before { content: "\e7a6"; } .mdi-file-folder-open:before { content: "\e7a7"; } .mdi-file-folder-shared:before { content: "\e7a8"; } .mdi-hardware-cast:before { content: "\e7a9"; } .mdi-hardware-cast-connected:before { content: "\e7aa"; } .mdi-hardware-computer:before { content: "\e7ab"; } .mdi-hardware-desktop-mac:before { content: "\e7ac"; } .mdi-hardware-desktop-windows:before { content: "\e7ad"; } .mdi-hardware-dock:before { content: "\e7ae"; } .mdi-hardware-gamepad:before { content: "\e7af"; } .mdi-hardware-headset:before { content: "\e7b0"; } .mdi-hardware-headset-mic:before { content: "\e7b1"; } .mdi-hardware-keyboard:before { content: "\e7b2"; } .mdi-hardware-keyboard-alt:before { content: "\e7b3"; } .mdi-hardware-keyboard-arrow-down:before { content: "\e7b4"; } .mdi-hardware-keyboard-arrow-left:before { content: "\e7b5"; } .mdi-hardware-keyboard-arrow-right:before { content: "\e7b6"; } .mdi-hardware-keyboard-arrow-up:before { content: "\e7b7"; } .mdi-hardware-keyboard-backspace:before { content: "\e7b8"; } .mdi-hardware-keyboard-capslock:before { content: "\e7b9"; } .mdi-hardware-keyboard-control:before { content: "\e7ba"; } .mdi-hardware-keyboard-hide:before { content: "\e7bb"; } .mdi-hardware-keyboard-return:before { content: "\e7bc"; } .mdi-hardware-keyboard-tab:before { content: "\e7bd"; } .mdi-hardware-keyboard-voice:before { content: "\e7be"; } .mdi-hardware-laptop:before { content: "\e7bf"; } .mdi-hardware-laptop-chromebook:before { content: "\e7c0"; } .mdi-hardware-laptop-mac:before { content: "\e7c1"; } .mdi-hardware-laptop-windows:before { content: "\e7c2"; } .mdi-hardware-memory:before { content: "\e7c3"; } .mdi-hardware-mouse:before { content: "\e7c4"; } .mdi-hardware-phone-android:before { content: "\e7c5"; } .mdi-hardware-phone-iphone:before { content: "\e7c6"; } .mdi-hardware-phonelink:before { content: "\e7c7"; } .mdi-hardware-phonelink-off:before { content: "\e7c8"; } .mdi-hardware-security:before { content: "\e7c9"; } .mdi-hardware-sim-card:before { content: "\e7ca"; } .mdi-hardware-smartphone:before { content: "\e7cb"; } .mdi-hardware-speaker:before { content: "\e7cc"; } .mdi-hardware-tablet:before { content: "\e7cd"; } .mdi-hardware-tablet-android:before { content: "\e7ce"; } .mdi-hardware-tablet-mac:before { content: "\e7cf"; } .mdi-hardware-tv:before { content: "\e7d0"; } .mdi-hardware-watch:before { content: "\e7d1"; } .mdi-image-add-to-photos:before { content: "\e7d2"; } .mdi-image-adjust:before { content: "\e7d3"; } .mdi-image-assistant-photo:before { content: "\e7d4"; } .mdi-image-audiotrack:before { content: "\e7d5"; } .mdi-image-blur-circular:before { content: "\e7d6"; } .mdi-image-blur-linear:before { content: "\e7d7"; } .mdi-image-blur-off:before { content: "\e7d8"; } .mdi-image-blur-on:before { content: "\e7d9"; } .mdi-image-brightness-1:before { content: "\e7da"; } .mdi-image-brightness-2:before { content: "\e7db"; } .mdi-image-brightness-3:before { content: "\e7dc"; } .mdi-image-brightness-4:before { content: "\e7dd"; } .mdi-image-brightness-5:before { content: "\e7de"; } .mdi-image-brightness-6:before { content: "\e7df"; } .mdi-image-brightness-7:before { content: "\e7e0"; } .mdi-image-brush:before { content: "\e7e1"; } .mdi-image-camera:before { content: "\e7e2"; } .mdi-image-camera-alt:before { content: "\e7e3"; } .mdi-image-camera-front:before { content: "\e7e4"; } .mdi-image-camera-rear:before { content: "\e7e5"; } .mdi-image-camera-roll:before { content: "\e7e6"; } .mdi-image-center-focus-strong:before { content: "\e7e7"; } .mdi-image-center-focus-weak:before { content: "\e7e8"; } .mdi-image-collections:before { content: "\e7e9"; } .mdi-image-colorize:before { content: "\e7ea"; } .mdi-image-color-lens:before { content: "\e7eb"; } .mdi-image-compare:before { content: "\e7ec"; } .mdi-image-control-point:before { content: "\e7ed"; } .mdi-image-control-point-duplicate:before { content: "\e7ee"; } .mdi-image-crop:before { content: "\e7ef"; } .mdi-image-crop-3-2:before { content: "\e7f0"; } .mdi-image-crop-5-4:before { content: "\e7f1"; } .mdi-image-crop-7-5:before { content: "\e7f2"; } .mdi-image-crop-16-9:before { content: "\e7f3"; } .mdi-image-crop-din:before { content: "\e7f4"; } .mdi-image-crop-free:before { content: "\e7f5"; } .mdi-image-crop-landscape:before { content: "\e7f6"; } .mdi-image-crop-original:before { content: "\e7f7"; } .mdi-image-crop-portrait:before { content: "\e7f8"; } .mdi-image-crop-square:before { content: "\e7f9"; } .mdi-image-dehaze:before { content: "\e7fa"; } .mdi-image-details:before { content: "\e7fb"; } .mdi-image-edit:before { content: "\e7fc"; } .mdi-image-exposure:before { content: "\e7fd"; } .mdi-image-exposure-minus-1:before { content: "\e7fe"; } .mdi-image-exposure-minus-2:before { content: "\e7ff"; } .mdi-image-exposure-plus-1:before { content: "\e800"; } .mdi-image-exposure-plus-2:before { content: "\e801"; } .mdi-image-exposure-zero:before { content: "\e802"; } .mdi-image-filter:before { content: "\e803"; } .mdi-image-filter-1:before { content: "\e804"; } .mdi-image-filter-2:before { content: "\e805"; } .mdi-image-filter-3:before { content: "\e806"; } .mdi-image-filter-4:before { content: "\e807"; } .mdi-image-filter-5:before { content: "\e808"; } .mdi-image-filter-6:before { content: "\e809"; } .mdi-image-filter-7:before { content: "\e80a"; } .mdi-image-filter-8:before { content: "\e80b"; } .mdi-image-filter-9:before { content: "\e80c"; } .mdi-image-filter-9-plus:before { content: "\e80d"; } .mdi-image-filter-b-and-w:before { content: "\e80e"; } .mdi-image-filter-center-focus:before { content: "\e80f"; } .mdi-image-filter-drama:before { content: "\e810"; } .mdi-image-filter-frames:before { content: "\e811"; } .mdi-image-filter-hdr:before { content: "\e812"; } .mdi-image-filter-none:before { content: "\e813"; } .mdi-image-filter-tilt-shift:before { content: "\e814"; } .mdi-image-filter-vintage:before { content: "\e815"; } .mdi-image-flare:before { content: "\e816"; } .mdi-image-flash-auto:before { content: "\e817"; } .mdi-image-flash-off:before { content: "\e818"; } .mdi-image-flash-on:before { content: "\e819"; } .mdi-image-flip:before { content: "\e81a"; } .mdi-image-gradient:before { content: "\e81b"; } .mdi-image-grain:before { content: "\e81c"; } .mdi-image-grid-off:before { content: "\e81d"; } .mdi-image-grid-on:before { content: "\e81e"; } .mdi-image-hdr-off:before { content: "\e81f"; } .mdi-image-hdr-on:before { content: "\e820"; } .mdi-image-hdr-strong:before { content: "\e821"; } .mdi-image-hdr-weak:before { content: "\e822"; } .mdi-image-healing:before { content: "\e823"; } .mdi-image-image:before { content: "\e824"; } .mdi-image-image-aspect-ratio:before { content: "\e825"; } .mdi-image-iso:before { content: "\e826"; } .mdi-image-landscape:before { content: "\e827"; } .mdi-image-leak-add:before { content: "\e828"; } .mdi-image-leak-remove:before { content: "\e829"; } .mdi-image-lens:before { content: "\e82a"; } .mdi-image-looks:before { content: "\e82b"; } .mdi-image-looks-3:before { content: "\e82c"; } .mdi-image-looks-4:before { content: "\e82d"; } .mdi-image-looks-5:before { content: "\e82e"; } .mdi-image-looks-6:before { content: "\e82f"; } .mdi-image-looks-one:before { content: "\e830"; } .mdi-image-looks-two:before { content: "\e831"; } .mdi-image-loupe:before { content: "\e832"; } .mdi-image-movie-creation:before { content: "\e833"; } .mdi-image-nature:before { content: "\e834"; } .mdi-image-nature-people:before { content: "\e835"; } .mdi-image-navigate-before:before { content: "\e836"; } .mdi-image-navigate-next:before { content: "\e837"; } .mdi-image-palette:before { content: "\e838"; } .mdi-image-panorama:before { content: "\e839"; } .mdi-image-panorama-fisheye:before { content: "\e83a"; } .mdi-image-panorama-horizontal:before { content: "\e83b"; } .mdi-image-panorama-vertical:before { content: "\e83c"; } .mdi-image-panorama-wide-angle:before { content: "\e83d"; } .mdi-image-photo:before { content: "\e83e"; } .mdi-image-photo-album:before { content: "\e83f"; } .mdi-image-photo-camera:before { content: "\e840"; } .mdi-image-photo-library:before { content: "\e841"; } .mdi-image-portrait:before { content: "\e842"; } .mdi-image-remove-red-eye:before { content: "\e843"; } .mdi-image-rotate-left:before { content: "\e844"; } .mdi-image-rotate-right:before { content: "\e845"; } .mdi-image-slideshow:before { content: "\e846"; } .mdi-image-straighten:before { content: "\e847"; } .mdi-image-style:before { content: "\e848"; } .mdi-image-switch-camera:before { content: "\e849"; } .mdi-image-switch-video:before { content: "\e84a"; } .mdi-image-tag-faces:before { content: "\e84b"; } .mdi-image-texture:before { content: "\e84c"; } .mdi-image-timelapse:before { content: "\e84d"; } .mdi-image-timer:before { content: "\e84e"; } .mdi-image-timer-3:before { content: "\e84f"; } .mdi-image-timer-10:before { content: "\e850"; } .mdi-image-timer-auto:before { content: "\e851"; } .mdi-image-timer-off:before { content: "\e852"; } .mdi-image-tonality:before { content: "\e853"; } .mdi-image-transform:before { content: "\e854"; } .mdi-image-tune:before { content: "\e855"; } .mdi-image-wb-auto:before { content: "\e856"; } .mdi-image-wb-cloudy:before { content: "\e857"; } .mdi-image-wb-incandescent:before { content: "\e858"; } .mdi-image-wb-irradescent:before { content: "\e859"; } .mdi-image-wb-sunny:before { content: "\e85a"; } .mdi-maps-beenhere:before { content: "\e85b"; } .mdi-maps-directions:before { content: "\e85c"; } .mdi-maps-directions-bike:before { content: "\e85d"; } .mdi-maps-directions-bus:before { content: "\e85e"; } .mdi-maps-directions-car:before { content: "\e85f"; } .mdi-maps-directions-ferry:before { content: "\e860"; } .mdi-maps-directions-subway:before { content: "\e861"; } .mdi-maps-directions-train:before { content: "\e862"; } .mdi-maps-directions-transit:before { content: "\e863"; } .mdi-maps-directions-walk:before { content: "\e864"; } .mdi-maps-flight:before { content: "\e865"; } .mdi-maps-hotel:before { content: "\e866"; } .mdi-maps-layers:before { content: "\e867"; } .mdi-maps-layers-clear:before { content: "\e868"; } .mdi-maps-local-airport:before { content: "\e869"; } .mdi-maps-local-atm:before { content: "\e86a"; } .mdi-maps-local-attraction:before { content: "\e86b"; } .mdi-maps-local-bar:before { content: "\e86c"; } .mdi-maps-local-cafe:before { content: "\e86d"; } .mdi-maps-local-car-wash:before { content: "\e86e"; } .mdi-maps-local-convenience-store:before { content: "\e86f"; } .mdi-maps-local-drink:before { content: "\e870"; } .mdi-maps-local-florist:before { content: "\e871"; } .mdi-maps-local-gas-station:before { content: "\e872"; } .mdi-maps-local-grocery-store:before { content: "\e873"; } .mdi-maps-local-hospital:before { content: "\e874"; } .mdi-maps-local-hotel:before { content: "\e875"; } .mdi-maps-local-laundry-service:before { content: "\e876"; } .mdi-maps-local-library:before { content: "\e877"; } .mdi-maps-local-mall:before { content: "\e878"; } .mdi-maps-local-movies:before { content: "\e879"; } .mdi-maps-local-offer:before { content: "\e87a"; } .mdi-maps-local-parking:before { content: "\e87b"; } .mdi-maps-local-pharmacy:before { content: "\e87c"; } .mdi-maps-local-phone:before { content: "\e87d"; } .mdi-maps-local-pizza:before { content: "\e87e"; } .mdi-maps-local-play:before { content: "\e87f"; } .mdi-maps-local-post-office:before { content: "\e880"; } .mdi-maps-local-print-shop:before { content: "\e881"; } .mdi-maps-local-restaurant:before { content: "\e882"; } .mdi-maps-local-see:before { content: "\e883"; } .mdi-maps-local-shipping:before { content: "\e884"; } .mdi-maps-local-taxi:before { content: "\e885"; } .mdi-maps-location-history:before { content: "\e886"; } .mdi-maps-map:before { content: "\e887"; } .mdi-maps-my-location:before { content: "\e888"; } .mdi-maps-navigation:before { content: "\e889"; } .mdi-maps-pin-drop:before { content: "\e88a"; } .mdi-maps-place:before { content: "\e88b"; } .mdi-maps-rate-review:before { content: "\e88c"; } .mdi-maps-restaurant-menu:before { content: "\e88d"; } .mdi-maps-satellite:before { content: "\e88e"; } .mdi-maps-store-mall-directory:before { content: "\e88f"; } .mdi-maps-terrain:before { content: "\e890"; } .mdi-maps-traffic:before { content: "\e891"; } .mdi-navigation-apps:before { content: "\e892"; } .mdi-navigation-arrow-back:before { content: "\e893"; } .mdi-navigation-arrow-drop-down:before { content: "\e894"; } .mdi-navigation-arrow-drop-down-circle:before { content: "\e895"; } .mdi-navigation-arrow-drop-up:before { content: "\e896"; } .mdi-navigation-arrow-forward:before { content: "\e897"; } .mdi-navigation-cancel:before { content: "\e898"; } .mdi-navigation-check:before { content: "\e899"; } .mdi-navigation-chevron-left:before { content: "\e89a"; } .mdi-navigation-chevron-right:before { content: "\e89b"; } .mdi-navigation-close:before { content: "\e89c"; } .mdi-navigation-expand-less:before { content: "\e89d"; } .mdi-navigation-expand-more:before { content: "\e89e"; } .mdi-navigation-fullscreen:before { content: "\e89f"; } .mdi-navigation-fullscreen-exit:before { content: "\e8a0"; } .mdi-navigation-menu:before { content: "\e8a1"; } .mdi-navigation-more-horiz:before { content: "\e8a2"; } .mdi-navigation-more-vert:before { content: "\e8a3"; } .mdi-navigation-refresh:before { content: "\e8a4"; } .mdi-navigation-unfold-less:before { content: "\e8a5"; } .mdi-navigation-unfold-more:before { content: "\e8a6"; } .mdi-notification-adb:before { content: "\e8a7"; } .mdi-notification-bluetooth-audio:before { content: "\e8a8"; } .mdi-notification-disc-full:before { content: "\e8a9"; } .mdi-notification-dnd-forwardslash:before { content: "\e8aa"; } .mdi-notification-do-not-disturb:before { content: "\e8ab"; } .mdi-notification-drive-eta:before { content: "\e8ac"; } .mdi-notification-event-available:before { content: "\e8ad"; } .mdi-notification-event-busy:before { content: "\e8ae"; } .mdi-notification-event-note:before { content: "\e8af"; } .mdi-notification-folder-special:before { content: "\e8b0"; } .mdi-notification-mms:before { content: "\e8b1"; } .mdi-notification-more:before { content: "\e8b2"; } .mdi-notification-network-locked:before { content: "\e8b3"; } .mdi-notification-phone-bluetooth-speaker:before { content: "\e8b4"; } .mdi-notification-phone-forwarded:before { content: "\e8b5"; } .mdi-notification-phone-in-talk:before { content: "\e8b6"; } .mdi-notification-phone-locked:before { content: "\e8b7"; } .mdi-notification-phone-missed:before { content: "\e8b8"; } .mdi-notification-phone-paused:before { content: "\e8b9"; } .mdi-notification-play-download:before { content: "\e8ba"; } .mdi-notification-play-install:before { content: "\e8bb"; } .mdi-notification-sd-card:before { content: "\e8bc"; } .mdi-notification-sim-card-alert:before { content: "\e8bd"; } .mdi-notification-sms:before { content: "\e8be"; } .mdi-notification-sms-failed:before { content: "\e8bf"; } .mdi-notification-sync:before { content: "\e8c0"; } .mdi-notification-sync-disabled:before { content: "\e8c1"; } .mdi-notification-sync-problem:before { content: "\e8c2"; } .mdi-notification-system-update:before { content: "\e8c3"; } .mdi-notification-tap-and-play:before { content: "\e8c4"; } .mdi-notification-time-to-leave:before { content: "\e8c5"; } .mdi-notification-vibration:before { content: "\e8c6"; } .mdi-notification-voice-chat:before { content: "\e8c7"; } .mdi-notification-vpn-lock:before { content: "\e8c8"; } .mdi-social-cake:before { content: "\e8c9"; } .mdi-social-domain:before { content: "\e8ca"; } .mdi-social-group:before { content: "\e8cb"; } .mdi-social-group-add:before { content: "\e8cc"; } .mdi-social-location-city:before { content: "\e8cd"; } .mdi-social-mood:before { content: "\e8ce"; } .mdi-social-notifications:before { content: "\e8cf"; } .mdi-social-notifications-none:before { content: "\e8d0"; } .mdi-social-notifications-off:before { content: "\e8d1"; } .mdi-social-notifications-on:before { content: "\e8d2"; } .mdi-social-notifications-paused:before { content: "\e8d3"; } .mdi-social-pages:before { content: "\e8d4"; } .mdi-social-party-mode:before { content: "\e8d5"; } .mdi-social-people:before { content: "\e8d6"; } .mdi-social-people-outline:before { content: "\e8d7"; } .mdi-social-person:before { content: "\e8d8"; } .mdi-social-person-add:before { content: "\e8d9"; } .mdi-social-person-outline:before { content: "\e8da"; } .mdi-social-plus-one:before { content: "\e8db"; } .mdi-social-poll:before { content: "\e8dc"; } .mdi-social-public:before { content: "\e8dd"; } .mdi-social-school:before { content: "\e8de"; } .mdi-social-share:before { content: "\e8df"; } .mdi-social-whatshot:before { content: "\e8e0"; } .mdi-toggle-check-box:before { content: "\e8e1"; } .mdi-toggle-check-box-outline-blank:before { content: "\e8e2"; } .mdi-toggle-radio-button-off:before { content: "\e8e3"; } .mdi-toggle-radio-button-on:before { content: "\e8e4"; } .container { padding: 0 1.5rem; margin: 0 auto; max-width: 1280px; width: 90%; } @media only screen and (min-width : 601px) { .container { width: 85%; } } @media only screen and (min-width : 993px) { .container { width: 70%; } } .container .row { margin-left: -0.75rem; margin-right: -0.75rem; } .section { padding-top: 1rem; padding-bottom: 1rem; } .section.no-pad { padding: 0; } .section.no-pad-bot { padding-bottom: 0; } .section.no-pad-top { padding-top: 0; } .row { margin-left: auto; margin-right: auto; margin-bottom: 20px; } .row:after { content: ""; display: table; clear: both; } .row .col { float: left; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 0 0.75rem; } .row .col.s1 { width: 8.33333%; margin-left: 0; } .row .col.s2 { width: 16.66667%; margin-left: 0; } .row .col.s3 { width: 25%; margin-left: 0; } .row .col.s4 { width: 33.33333%; margin-left: 0; } .row .col.s5 { width: 41.66667%; margin-left: 0; } .row .col.s6 { width: 50%; margin-left: 0; } .row .col.s7 { width: 58.33333%; margin-left: 0; } .row .col.s8 { width: 66.66667%; margin-left: 0; } .row .col.s9 { width: 75%; margin-left: 0; } .row .col.s10 { width: 83.33333%; margin-left: 0; } .row .col.s11 { width: 91.66667%; margin-left: 0; } .row .col.s12 { width: 100%; margin-left: 0; } .row .col.offset-s1 { margin-left: 8.33333%; } .row .col.offset-s2 { margin-left: 16.66667%; } .row .col.offset-s3 { margin-left: 25%; } .row .col.offset-s4 { margin-left: 33.33333%; } .row .col.offset-s5 { margin-left: 41.66667%; } .row .col.offset-s6 { margin-left: 50%; } .row .col.offset-s7 { margin-left: 58.33333%; } .row .col.offset-s8 { margin-left: 66.66667%; } .row .col.offset-s9 { margin-left: 75%; } .row .col.offset-s10 { margin-left: 83.33333%; } .row .col.offset-s11 { margin-left: 91.66667%; } .row .col.offset-s12 { margin-left: 100%; } @media only screen and (min-width : 601px) { .row .col.m1 { width: 8.33333%; margin-left: 0; } .row .col.m2 { width: 16.66667%; margin-left: 0; } .row .col.m3 { width: 25%; margin-left: 0; } .row .col.m4 { width: 33.33333%; margin-left: 0; } .row .col.m5 { width: 41.66667%; margin-left: 0; } .row .col.m6 { width: 50%; margin-left: 0; } .row .col.m7 { width: 58.33333%; margin-left: 0; } .row .col.m8 { width: 66.66667%; margin-left: 0; } .row .col.m9 { width: 75%; margin-left: 0; } .row .col.m10 { width: 83.33333%; margin-left: 0; } .row .col.m11 { width: 91.66667%; margin-left: 0; } .row .col.m12 { width: 100%; margin-left: 0; } .row .col.offset-m1 { margin-left: 8.33333%; } .row .col.offset-m2 { margin-left: 16.66667%; } .row .col.offset-m3 { margin-left: 25%; } .row .col.offset-m4 { margin-left: 33.33333%; } .row .col.offset-m5 { margin-left: 41.66667%; } .row .col.offset-m6 { margin-left: 50%; } .row .col.offset-m7 { margin-left: 58.33333%; } .row .col.offset-m8 { margin-left: 66.66667%; } .row .col.offset-m9 { margin-left: 75%; } .row .col.offset-m10 { margin-left: 83.33333%; } .row .col.offset-m11 { margin-left: 91.66667%; } .row .col.offset-m12 { margin-left: 100%; } } @media only screen and (min-width : 993px) { .row .col.l1 { width: 8.33333%; margin-left: 0; } .row .col.l2 { width: 16.66667%; margin-left: 0; } .row .col.l3 { width: 25%; margin-left: 0; } .row .col.l4 { width: 33.33333%; margin-left: 0; } .row .col.l5 { width: 41.66667%; margin-left: 0; } .row .col.l6 { width: 50%; margin-left: 0; } .row .col.l7 { width: 58.33333%; margin-left: 0; } .row .col.l8 { width: 66.66667%; margin-left: 0; } .row .col.l9 { width: 75%; margin-left: 0; } .row .col.l10 { width: 83.33333%; margin-left: 0; } .row .col.l11 { width: 91.66667%; margin-left: 0; } .row .col.l12 { width: 100%; margin-left: 0; } .row .col.offset-l1 { margin-left: 8.33333%; } .row .col.offset-l2 { margin-left: 16.66667%; } .row .col.offset-l3 { margin-left: 25%; } .row .col.offset-l4 { margin-left: 33.33333%; } .row .col.offset-l5 { margin-left: 41.66667%; } .row .col.offset-l6 { margin-left: 50%; } .row .col.offset-l7 { margin-left: 58.33333%; } .row .col.offset-l8 { margin-left: 66.66667%; } .row .col.offset-l9 { margin-left: 75%; } .row .col.offset-l10 { margin-left: 83.33333%; } .row .col.offset-l11 { margin-left: 91.66667%; } .row .col.offset-l12 { margin-left: 100%; } } nav { color: #fff; background-color: #ee6e73; width: 100%; height: 56px; line-height: 56px; } nav a { color: #fff; } nav .nav-wrapper { position: relative; height: 100%; color: white; } nav .nav-wrapper i { display: block; font-size: 2rem; } @media only screen and (min-width : 993px) { nav a.button-collapse { display: none; } } nav .button-collapse { float: left; position: relative; z-index: 1; height: 56px; } nav .button-collapse i { font-size: 2.7rem; height: 56px; line-height: 56px; } nav .brand-logo { position: absolute; color: #fff; display: inline-block; font-size: 2.1rem; padding: 0; } nav .brand-logo.center { left: 50%; -webkit-transform: translateX(-50%); -moz-transform: translateX(-50%); -ms-transform: translateX(-50%); -o-transform: translateX(-50%); transform: translateX(-50%); } @media only screen and (max-width : 992px) { nav .brand-logo { left: 50%; -webkit-transform: translateX(-50%); -moz-transform: translateX(-50%); -ms-transform: translateX(-50%); -o-transform: translateX(-50%); transform: translateX(-50%); } } nav .brand-logo.right { right: 0.5rem; padding: 0; } nav ul { margin: 0; } nav ul li { -webkit-transition: background-color .3s; -moz-transition: background-color .3s; -o-transition: background-color .3s; -ms-transition: background-color .3s; transition: background-color .3s; float: left; padding: 0; } nav ul li:hover, nav ul li.active { background-color: rgba(0, 0, 0, 0.1); } nav ul a { font-size: 1rem; color: #fff; display: block; padding: 0 15px; } nav ul.left { float: left; } nav .input-field { margin: 0; } nav .input-field input { height: 100%; font-size: 1.2rem; border: none; padding-left: 2rem; } nav .input-field input:focus, nav .input-field input[type=text]:valid, nav .input-field input[type=password]:valid, nav .input-field input[type=email]:valid, nav .input-field input[type=url]:valid, nav .input-field input[type=date]:valid { border: none; box-shadow: none; } nav .input-field label { top: 0; left: 0; } nav .input-field label i { color: rgba(255, 255, 255, 0.7); -webkit-transition: color .3s; -moz-transition: color .3s; -o-transition: color .3s; -ms-transition: color .3s; transition: color .3s; } nav .input-field label.active i { color: #fff; } nav .input-field label.active { -webkit-transform: translateY(0); -moz-transform: translateY(0); -ms-transform: translateY(0); -o-transform: translateY(0); transform: translateY(0); } .navbar-fixed { position: relative; height: 56px; z-index: 998; } .navbar-fixed nav { position: fixed; } @media only screen and (min-width : 601px) { nav, nav .nav-wrapper i, nav a.button-collapse, nav a.button-collapse i { height: 64px; line-height: 64px; } .navbar-fixed { height: 64px; } } @font-face { font-family: "Roboto"; src: url("../font/roboto/Roboto-Thin.woff2") format("woff2"), url("../font/roboto/Roboto-Thin.woff") format("woff"), url("../font/roboto/Roboto-Thin.ttf") format("truetype"); font-weight: 200; } @font-face { font-family: "Roboto"; src: url("../font/roboto/Roboto-Light.woff2") format("woff2"), url("../font/roboto/Roboto-Light.woff") format("woff"), url("../font/roboto/Roboto-Light.ttf") format("truetype"); font-weight: 300; } @font-face { font-family: "Roboto"; src: url("../font/roboto/Roboto-Regular.woff2") format("woff2"), url("../font/roboto/Roboto-Regular.woff") format("woff"), url("../font/roboto/Roboto-Regular.ttf") format("truetype"); font-weight: 400; } @font-face { font-family: "Roboto"; src: url("../font/roboto/Roboto-Medium.woff2") format("woff2"), url("../font/roboto/Roboto-Medium.woff") format("woff"), url("../font/roboto/Roboto-Medium.ttf") format("truetype"); font-weight: 500; } @font-face { font-family: "Roboto"; src: url("../font/roboto/Roboto-Bold.woff2") format("woff2"), url("../font/roboto/Roboto-Bold.woff") format("woff"), url("../font/roboto/Roboto-Bold.ttf") format("truetype"); font-weight: 700; } a { text-decoration: none; } html { line-height: 1.5; font-family: "Roboto", sans-serif; font-weight: normal; color: rgba(0, 0, 0, 0.87); } @media only screen and (min-width: 0) { html { font-size: 14px; } } @media only screen and (min-width: 992px) { html { font-size: 14.5px; } } @media only screen and (min-width: 1200px) { html { font-size: 15px; } } h1, h2, h3, h4, h5, h6 { font-weight: 400; } h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-weight: inherit; } h1 { font-size: 4.2rem; line-height: 4.62rem; margin: 2.1rem 0 1.68rem 0; } h2 { font-size: 3.56rem; line-height: 3.916rem; margin: 1.78rem 0 1.424rem 0; } h3 { font-size: 2.92rem; line-height: 3.212rem; margin: 1.46rem 0 1.168rem 0; } h4 { font-size: 2.28rem; line-height: 2.508rem; margin: 1.14rem 0 0.912rem 0; } h5 { font-size: 1.64rem; line-height: 1.804rem; margin: 0.82rem 0 0.656rem 0; } h6 { font-size: 1rem; line-height: 1.1rem; margin: 0.5rem 0 0.4rem 0; } em { font-style: italic; } strong { font-weight: 500; } small { font-size: 75%; } .light, footer.page-footer .footer-copyright { font-weight: 300; } .thin { font-weight: 200; } .flow-text { font-weight: 300; } @media only screen and (min-width: 360px) { .flow-text { font-size: 1.2rem; } } @media only screen and (min-width: 0px) { .flow-text { line-height: .8rem; } } @media only screen and (min-width: 390px) { .flow-text { font-size: 1.224rem; } } @media only screen and (min-width: 30px) { .flow-text { line-height: .904rem; } } @media only screen and (min-width: 420px) { .flow-text { font-size: 1.248rem; } } @media only screen and (min-width: 60px) { .flow-text { line-height: 1.008rem; } } @media only screen and (min-width: 450px) { .flow-text { font-size: 1.272rem; } } @media only screen and (min-width: 90px) { .flow-text { line-height: 1.112rem; } } @media only screen and (min-width: 480px) { .flow-text { font-size: 1.296rem; } } @media only screen and (min-width: 120px) { .flow-text { line-height: 1.216rem; } } @media only screen and (min-width: 510px) { .flow-text { font-size: 1.32rem; } } @media only screen and (min-width: 150px) { .flow-text { line-height: 1.32rem; } } @media only screen and (min-width: 540px) { .flow-text { font-size: 1.344rem; } } @media only screen and (min-width: 180px) { .flow-text { line-height: 1.424rem; } } @media only screen and (min-width: 570px) { .flow-text { font-size: 1.368rem; } } @media only screen and (min-width: 210px) { .flow-text { line-height: 1.528rem; } } @media only screen and (min-width: 600px) { .flow-text { font-size: 1.392rem; } } @media only screen and (min-width: 240px) { .flow-text { line-height: 1.632rem; } } @media only screen and (min-width: 630px) { .flow-text { font-size: 1.416rem; } } @media only screen and (min-width: 270px) { .flow-text { line-height: 1.736rem; } } @media only screen and (min-width: 660px) { .flow-text { font-size: 1.44rem; } } @media only screen and (min-width: 300px) { .flow-text { line-height: 1.84rem; } } @media only screen and (min-width: 690px) { .flow-text { font-size: 1.464rem; } } @media only screen and (min-width: 330px) { .flow-text { line-height: 1.944rem; } } @media only screen and (min-width: 720px) { .flow-text { font-size: 1.488rem; } } @media only screen and (min-width: 360px) { .flow-text { line-height: 2.048rem; } } @media only screen and (min-width: 750px) { .flow-text { font-size: 1.512rem; } } @media only screen and (min-width: 390px) { .flow-text { line-height: 2.152rem; } } @media only screen and (min-width: 780px) { .flow-text { font-size: 1.536rem; } } @media only screen and (min-width: 420px) { .flow-text { line-height: 2.256rem; } } @media only screen and (min-width: 810px) { .flow-text { font-size: 1.56rem; } } @media only screen and (min-width: 450px) { .flow-text { line-height: 2.36rem; } } @media only screen and (min-width: 840px) { .flow-text { font-size: 1.584rem; } } @media only screen and (min-width: 480px) { .flow-text { line-height: 2.464rem; } } @media only screen and (min-width: 870px) { .flow-text { font-size: 1.608rem; } } @media only screen and (min-width: 510px) { .flow-text { line-height: 2.568rem; } } @media only screen and (min-width: 900px) { .flow-text { font-size: 1.632rem; } } @media only screen and (min-width: 540px) { .flow-text { line-height: 2.672rem; } } @media only screen and (min-width: 930px) { .flow-text { font-size: 1.656rem; } } @media only screen and (min-width: 570px) { .flow-text { line-height: 2.776rem; } } @media only screen and (min-width: 960px) { .flow-text { font-size: 1.68rem; } } @media only screen and (min-width: 600px) { .flow-text { line-height: 2.88rem; } } .card-panel { padding: 20px; margin: 0.5rem 0 1rem 0; border-radius: 2px; background-color: #fff; } .card { position: relative; overflow: hidden; margin: 0.5rem 0 1rem 0; background-color: #fff; border-radius: 2px; } .card .card-title { color: #fff; font-size: 24px; font-weight: 300; } .card .card-title.activator { cursor: pointer; } .card.small, .card.medium, .card.large { position: relative; } .card.small .card-image, .card.medium .card-image, .card.large .card-image { overflow: hidden; } .card.small .card-content, .card.medium .card-content, .card.large .card-content { overflow: hidden; } .card.small .card-action, .card.medium .card-action, .card.large .card-action { position: absolute; bottom: 0; left: 0; right: 0; } .card.small { height: 300px; } .card.small .card-image { height: 150px; } .card.small .card-content { height: 150px; } .card.medium { height: 400px; } .card.medium .card-image { height: 250px; } .card.medium .card-content { height: 150px; } .card.large { height: 500px; } .card.large .card-image { height: 330px; } .card.large .card-content { height: 170px; } .card .card-image { position: relative; } .card .card-image img { border-radius: 2px 2px 0 0; position: relative; left: 0; right: 0; top: 0; bottom: 0; width: 100%; } .card .card-image .card-title { position: absolute; bottom: 0; left: 0; padding: 20px; } .card .card-content { padding: 20px; border-radius: 0 0 2px 2px; } .card .card-content p { margin: 0; color: inherit; } .card .card-content .card-title { line-height: 48px; } .card .card-action { border-top: 1px solid rgba(160, 160, 160, 0.2); padding: 20px; } .card .card-action a { color: #ffab40; margin-right: 20px; -webkit-transition: color .3s ease; -moz-transition: color .3s ease; -o-transition: color .3s ease; -ms-transition: color .3s ease; transition: color .3s ease; text-transform: uppercase; } .card .card-action a:hover { color: #ffd8a6; } .card .card-reveal { padding: 20px; position: absolute; background-color: #FFF; width: 100%; overflow-y: auto; top: 100%; height: 100%; z-index: 1; display: none; } .card .card-reveal .card-title { cursor: pointer; display: block; } #toast-container { display: block; position: fixed; z-index: 1001; } @media only screen and (max-width : 600px) { #toast-container { min-width: 100%; bottom: 0%; } } @media only screen and (min-width : 601px) and (max-width : 992px) { #toast-container { min-width: 30%; left: 5%; bottom: 7%; } } @media only screen and (min-width : 993px) { #toast-container { min-width: 8%; top: 10%; right: 7%; } } .toast { border-radius: 2px; top: 0; width: auto; clear: both; margin-top: 10px; position: relative; max-width: 100%; height: 48px; line-height: 48px; background-color: #323232; padding: 0 25px; font-size: 1.1rem; font-weight: 300; color: #fff; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-flex-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center; -webkit-justify-content: space-between; justify-content: space-between; } .toast .btn, .toast .btn-large, .toast .btn-flat { margin: 0; margin-left: 3rem; } .toast.rounded { border-radius: 24px; } @media only screen and (max-width : 600px) { .toast { width: 100%; border-radius: 0; } } @media only screen and (min-width : 601px) and (max-width : 992px) { .toast { float: left; } } @media only screen and (min-width : 993px) { .toast { float: right; } } .tabs { position: relative; height: 48px; background-color: #fff; margin: 0 auto; width: 100%; white-space: nowrap; } .tabs .tab { display: block; float: left; text-align: center; line-height: 48px; height: 48px; padding: 0 20px; margin: 0; text-transform: uppercase; letter-spacing: .8px; width: 15%; } .tabs .tab a { color: #ee6e73; display: block; width: 100%; height: 100%; -webkit-transition: color .28s ease; -moz-transition: color .28s ease; -o-transition: color .28s ease; -ms-transition: color .28s ease; transition: color .28s ease; } .tabs .tab a:hover { color: #f9c9cb; } .tabs .indicator { position: absolute; bottom: 0; height: 2px; background-color: #f6b2b5; will-change: left, right; } .tabs .tab { padding: 0; } .material-tooltip { padding: 10px 8px; font-size: 1rem; z-index: 1000; background-color: transparent; border-radius: 2px; color: #fff; min-height: 36px; line-height: 1rem; opacity: 0; display: none; position: absolute; text-align: center; overflow: hidden; left: 0; top: 0; will-change: top, left; } .backdrop { position: absolute; opacity: 0; display: none; height: 7px; width: 14px; border-radius: 0 0 14px 14px; background-color: #323232; z-index: -1; -webkit-transform-origin: 50% 10%; -moz-transform-origin: 50% 10%; -ms-transform-origin: 50% 10%; -o-transform-origin: 50% 10%; transform-origin: 50% 10%; will-change: transform, opacity; } .btn, .btn-large, .btn-flat { border: none; border-radius: 2px; display: inline-block; height: 36px; line-height: 36px; outline: 0; padding: 0 2rem; text-transform: uppercase; vertical-align: middle; -webkit-tap-highlight-color: transparent; } .btn.disabled, .disabled.btn-large, .btn-floating.disabled, .btn-large.disabled, .btn:disabled, .btn-large:disabled, .btn-large:disabled, .btn-floating:disabled { background-color: #DFDFDF; box-shadow: none; color: #9F9F9F; cursor: default; } .btn.disabled *, .disabled.btn-large *, .btn-floating.disabled *, .btn-large.disabled *, .btn:disabled *, .btn-large:disabled *, .btn-large:disabled *, .btn-floating:disabled * { pointer-events: none; } .btn.disabled:hover, .disabled.btn-large:hover, .btn-floating.disabled:hover, .btn-large.disabled:hover, .btn:disabled:hover, .btn-large:disabled:hover, .btn-large:disabled:hover, .btn-floating:disabled:hover { background-color: #DFDFDF; color: #9F9F9F; } .btn i, .btn-large i, .btn-floating i, .btn-large i, .btn-flat i { font-size: 1.3rem; line-height: inherit; } .btn, .btn-large { text-decoration: none; color: #FFF; background-color: #26a69a; text-align: center; letter-spacing: .5px; -webkit-transition: .2s ease-out; -moz-transition: .2s ease-out; -o-transition: .2s ease-out; -ms-transition: .2s ease-out; transition: .2s ease-out; cursor: pointer; } .btn:hover, .btn-large:hover { background-color: #2bbbad; } .btn-floating { display: inline-block; color: #FFF; position: relative; overflow: hidden; z-index: 1; width: 37px; height: 37px; line-height: 37px; padding: 0; background-color: #26a69a; border-radius: 50%; transition: .3s; cursor: pointer; vertical-align: middle; } .btn-floating i { width: inherit; display: inline-block; text-align: center; color: #FFF; font-size: 1.6rem; line-height: 37px; } .btn-floating:before { border-radius: 0; } .btn-floating.btn-large { width: 55.5px; height: 55.5px; } .btn-floating.btn-large i { line-height: 55.5px; } button.btn-floating { border: none; } .fixed-action-btn { position: fixed; right: 23px; bottom: 23px; padding-top: 15px; margin-bottom: 0; z-index: 998; } .fixed-action-btn ul { left: 0; right: 0; text-align: center; position: absolute; bottom: 64px; } .fixed-action-btn ul li { margin-bottom: 15px; } .fixed-action-btn ul a.btn-floating { opacity: 0; } .btn-flat { box-shadow: none; background-color: transparent; color: #343434; cursor: pointer; } .btn-flat.disabled { color: #b3b3b3; cursor: default; } .btn-large { height: 54px; line-height: 56px; } .btn-large i { font-size: 1.6rem; } .dropdown-content { background-color: #FFFFFF; margin: 0; display: none; min-width: 100px; max-height: 650px; overflow-y: auto; opacity: 0; position: absolute; white-space: nowrap; z-index: 1; will-change: width, height; } .dropdown-content li { clear: both; color: rgba(0, 0, 0, 0.87); cursor: pointer; line-height: 1.5rem; width: 100%; text-align: left; text-transform: none; } .dropdown-content li:hover, .dropdown-content li.active { background-color: #eee; } .dropdown-content li > a, .dropdown-content li > span { font-size: 1.2rem; color: #26a69a; display: block; padding: 1rem 1rem; } /*! * Waves v0.6.0 * http://fian.my.id/Waves * * Copyright 2014 Alfiana E. Sibuea and other contributors * Released under the MIT license * https://github.com/fians/Waves/blob/master/LICENSE */ .waves-effect { position: relative; cursor: pointer; display: inline-block; overflow: hidden; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; vertical-align: middle; z-index: 1; will-change: opacity, transform; -webkit-transition: all .3s ease-out; -moz-transition: all .3s ease-out; -o-transition: all .3s ease-out; -ms-transition: all .3s ease-out; transition: all .3s ease-out; } .waves-effect .waves-ripple { position: absolute; border-radius: 50%; width: 20px; height: 20px; margin-top: -10px; margin-left: -10px; opacity: 0; background: rgba(0, 0, 0, 0.2); -webkit-transition: all 0.7s ease-out; -moz-transition: all 0.7s ease-out; -o-transition: all 0.7s ease-out; -ms-transition: all 0.7s ease-out; transition: all 0.7s ease-out; -webkit-transition-property: -webkit-transform, opacity; -moz-transition-property: -moz-transform, opacity; -o-transition-property: -o-transform, opacity; transition-property: transform, opacity; -webkit-transform: scale(0); -moz-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); pointer-events: none; } .waves-effect.waves-light .waves-ripple { background-color: rgba(255, 255, 255, 0.45); } .waves-effect.waves-red .waves-ripple { background-color: rgba(244, 67, 54, 0.7); } .waves-effect.waves-yellow .waves-ripple { background-color: rgba(255, 235, 59, 0.7); } .waves-effect.waves-orange .waves-ripple { background-color: rgba(255, 152, 0, 0.7); } .waves-effect.waves-purple .waves-ripple { background-color: rgba(156, 39, 176, 0.7); } .waves-effect.waves-green .waves-ripple { background-color: rgba(76, 175, 80, 0.7); } .waves-effect.waves-teal .waves-ripple { background-color: rgba(0, 150, 136, 0.7); } .waves-notransition { -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; -ms-transition: none !important; transition: none !important; } .waves-circle { -webkit-transform: translateZ(0); -moz-transform: translateZ(0); -ms-transform: translateZ(0); -o-transform: translateZ(0); transform: translateZ(0); -webkit-mask-image: -webkit-radial-gradient(circle, white 100%, black 100%); } .waves-input-wrapper { border-radius: 0.2em; vertical-align: bottom; } .waves-input-wrapper .waves-button-input { position: relative; top: 0; left: 0; z-index: 1; } .waves-circle { text-align: center; width: 2.5em; height: 2.5em; line-height: 2.5em; border-radius: 50%; -webkit-mask-image: none; } .waves-block { display: block; } /* Firefox Bug: link not triggered */ a.waves-effect .waves-ripple { z-index: -1; } .modal { display: none; position: fixed; left: 0; right: 0; background-color: #fafafa; padding: 0; max-height: 70%; width: 55%; margin: auto; overflow-y: auto; z-index: 1000; border-radius: 2px; -webkit-transform: translate(0); -moz-transform: translate(0); -ms-transform: translate(0); -o-transform: translate(0); transform: translate(0); will-change: top, opacity; } @media only screen and (max-width : 992px) { .modal { width: 80%; } } .modal h1, .modal h2, .modal h3, .modal h4 { margin-top: 0; } .modal .modal-content { padding: 24px; } .modal .modal-footer { border-radius: 0 0 2px 2px; background-color: #fafafa; padding: 4px 6px; height: 56px; width: 100%; } .modal .modal-footer .btn, .modal .modal-footer .btn-large, .modal .modal-footer .btn-flat { float: right; margin: 6px 0; } #lean-overlay { position: fixed; z-index: 999; top: 0; left: 0; bottom: 0; right: 0; height: 115%; width: 100%; background: #000; display: none; will-change: opacity; } .modal.modal-fixed-footer { padding: 0; height: 70%; } .modal.modal-fixed-footer .modal-content { position: fixed; max-height: 100%; padding-bottom: 64px; width: 100%; overflow-y: auto; } .modal.modal-fixed-footer .modal-footer { border-top: 1px solid rgba(0, 0, 0, 0.1); position: fixed; bottom: 0; } .modal.bottom-sheet { top: auto; bottom: -100%; margin: 0; width: 100%; max-height: 45%; border-radius: 0; will-change: bottom, opacity; } /*.collapsible { border-top: 1px solid #ddd; border-right: 1px solid #ddd; border-left: 1px solid #ddd; margin: 0.5rem 0 1rem 0; } .collapsible-header { display: block; cursor: pointer; height: 3rem; line-height: 3rem; padding: 0 1rem; background-color: #fff; border-bottom: 1px solid #ddd; } .collapsible-header i { width: 2rem; font-size: 1.6rem; line-height: 3rem; display: block; float: left; text-align: center; margin-right: 1rem; }*/ .collapsible-body { overflow: hidden; display: none; /*border-bottom: 1px solid #ddd;*/ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .collapsible-body p { margin: 0; padding: 2rem; } .side-nav .collapsible { border: none; box-shadow: none; } .side-nav .collapsible li { padding: 0; } .side-nav .collapsible-header { background-color: transparent; border: none; line-height: inherit; height: inherit; margin: 0 1rem; } .side-nav .collapsible-header i { line-height: inherit; } .side-nav .collapsible-body { border: 0; background-color: #FFF; } .side-nav .collapsible-body li a { margin: 0 1rem 0 2rem; } .collapsible.popout { border: none; box-shadow: none; } .collapsible.popout > li { box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); transform: scaleX(.92) translate3d(0, 0, 0); transition: margin .35s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform .35s cubic-bezier(0.25, 0.46, 0.45, 0.94); } .collapsible.popout > li:hover { will-change: margin, transform; } .collapsible.popout > li.active { box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15); margin: 16px 0; transform: scaleX(1) translate3d(0, 0, 0); } .materialboxed { cursor: zoom-in; position: relative; -webkit-transition: opacity .4s; -moz-transition: opacity .4s; -o-transition: opacity .4s; -ms-transition: opacity .4s; transition: opacity .4s; } .materialboxed:hover { will-change: left, top, width, height; } .materialboxed:hover:not(.active) { opacity: .8; } .materialboxed.active { cursor: zoom-out; } #materialbox-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: #292929; z-index: 999; will-change: opacity; } .materialbox-caption { position: fixed; display: none; color: #fff; line-height: 50px; bottom: 0; width: 100%; text-align: center; padding: 0% 15%; height: 50px; z-index: 1000; -webkit-font-smoothing: antialiased; } /* Remove Focus Boxes */ select:focus { outline: 1px solid #c9f3ef; } button:focus { outline: none; background-color: #2ab7a9; } label { font-size: 0.8rem; color: #9e9e9e; } /*************************** Text Inputs + Textarea ****************************/ ::-webkit-input-placeholder { color: #d1d1d1; } :-moz-placeholder { /* Firefox 18- */ color: #d1d1d1; } ::-moz-placeholder { /* Firefox 19+ */ color: #d1d1d1; } :-ms-input-placeholder { color: #d1d1d1; } input[type=text], input[type=password], input[type=email], input[type=url], input[type=time], input[type=date], input[type=datetime-local], input[type=tel], input[type=number], input[type=search], textarea.materialize-textarea { background-color: transparent; border: none; border-bottom: 1px solid #9e9e9e; border-radius: 0; outline: none; height: 3rem; width: 100%; font-size: 1rem; margin: 0 0 15px 0; padding: 0; box-shadow: none; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; transition: all .3s; } input[type=text]:disabled, input[type=text][readonly="readonly"], input[type=password]:disabled, input[type=password][readonly="readonly"], input[type=email]:disabled, input[type=email][readonly="readonly"], input[type=url]:disabled, input[type=url][readonly="readonly"], input[type=time]:disabled, input[type=time][readonly="readonly"], input[type=date]:disabled, input[type=date][readonly="readonly"], input[type=datetime-local]:disabled, input[type=datetime-local][readonly="readonly"], input[type=tel]:disabled, input[type=tel][readonly="readonly"], input[type=number]:disabled, input[type=number][readonly="readonly"], input[type=search]:disabled, input[type=search][readonly="readonly"], textarea.materialize-textarea:disabled, textarea.materialize-textarea[readonly="readonly"] { color: rgba(0, 0, 0, 0.26); border-bottom: 1px dotted rgba(0, 0, 0, 0.26); } input[type=text]:disabled + label, input[type=text][readonly="readonly"] + label, input[type=password]:disabled + label, input[type=password][readonly="readonly"] + label, input[type=email]:disabled + label, input[type=email][readonly="readonly"] + label, input[type=url]:disabled + label, input[type=url][readonly="readonly"] + label, input[type=time]:disabled + label, input[type=time][readonly="readonly"] + label, input[type=date]:disabled + label, input[type=date][readonly="readonly"] + label, input[type=datetime-local]:disabled + label, input[type=datetime-local][readonly="readonly"] + label, input[type=tel]:disabled + label, input[type=tel][readonly="readonly"] + label, input[type=number]:disabled + label, input[type=number][readonly="readonly"] + label, input[type=search]:disabled + label, input[type=search][readonly="readonly"] + label, textarea.materialize-textarea:disabled + label, textarea.materialize-textarea[readonly="readonly"] + label { color: rgba(0, 0, 0, 0.26); } input[type=text]:focus:not([readonly]), input[type=password]:focus:not([readonly]), input[type=email]:focus:not([readonly]), input[type=url]:focus:not([readonly]), input[type=time]:focus:not([readonly]), input[type=date]:focus:not([readonly]), input[type=datetime-local]:focus:not([readonly]), input[type=tel]:focus:not([readonly]), input[type=number]:focus:not([readonly]), input[type=search]:focus:not([readonly]), textarea.materialize-textarea:focus:not([readonly]) { border-bottom: 1px solid #26a69a; box-shadow: 0 1px 0 0 #26a69a; } input[type=text]:focus:not([readonly]) + label, input[type=password]:focus:not([readonly]) + label, input[type=email]:focus:not([readonly]) + label, input[type=url]:focus:not([readonly]) + label, input[type=time]:focus:not([readonly]) + label, input[type=date]:focus:not([readonly]) + label, input[type=datetime-local]:focus:not([readonly]) + label, input[type=tel]:focus:not([readonly]) + label, input[type=number]:focus:not([readonly]) + label, input[type=search]:focus:not([readonly]) + label, textarea.materialize-textarea:focus:not([readonly]) + label { color: #26a69a; } input[type=text].valid, input[type=text]:focus.valid, input[type=password].valid, input[type=password]:focus.valid, input[type=email].valid, input[type=email]:focus.valid, input[type=url].valid, input[type=url]:focus.valid, input[type=time].valid, input[type=time]:focus.valid, input[type=date].valid, input[type=date]:focus.valid, input[type=datetime-local].valid, input[type=datetime-local]:focus.valid, input[type=tel].valid, input[type=tel]:focus.valid, input[type=number].valid, input[type=number]:focus.valid, input[type=search].valid, input[type=search]:focus.valid, textarea.materialize-textarea.valid, textarea.materialize-textarea:focus.valid { border-bottom: 1px solid #4CAF50; box-shadow: 0 1px 0 0 #4CAF50; } input[type=text].invalid, input[type=text]:focus.invalid, input[type=password].invalid, input[type=password]:focus.invalid, input[type=email].invalid, input[type=email]:focus.invalid, input[type=url].invalid, input[type=url]:focus.invalid, input[type=time].invalid, input[type=time]:focus.invalid, input[type=date].invalid, input[type=date]:focus.invalid, input[type=datetime-local].invalid, input[type=datetime-local]:focus.invalid, input[type=tel].invalid, input[type=tel]:focus.invalid, input[type=number].invalid, input[type=number]:focus.invalid, input[type=search].invalid, input[type=search]:focus.invalid, textarea.materialize-textarea.invalid, textarea.materialize-textarea:focus.invalid { border-bottom: 1px solid #F44336; box-shadow: 0 1px 0 0 #F44336; } .input-field { position: relative; margin-top: 1rem; } .input-field label { color: #9e9e9e; position: absolute; top: 0.8rem; left: 0.75rem; font-size: 1rem; cursor: text; -webkit-transition: .2s ease-out; -moz-transition: .2s ease-out; -o-transition: .2s ease-out; -ms-transition: .2s ease-out; transition: .2s ease-out; } .input-field label.active { font-size: 0.8rem; -webkit-transform: translateY(-140%); -moz-transform: translateY(-140%); -ms-transform: translateY(-140%); -o-transform: translateY(-140%); transform: translateY(-140%); } .input-field .prefix { position: absolute; width: 3rem; font-size: 2rem; -webkit-transition: color .2s; -moz-transition: color .2s; -o-transition: color .2s; -ms-transition: color .2s; transition: color .2s; } .input-field .prefix.active { color: #26a69a; } .input-field .prefix ~ input, .input-field .prefix ~ textarea { margin-left: 3rem; width: 92%; width: calc(100% - 3rem); } .input-field .prefix ~ textarea { padding-top: .8rem; } .input-field .prefix ~ label { margin-left: 3rem; } @media only screen and (max-width : 992px) { .input-field .prefix ~ input { width: 86%; width: calc(100% - 3rem); } } @media only screen and (max-width : 600px) { .input-field .prefix ~ input { width: 80%; width: calc(100% - 3rem); } } .input-field input[type=search] { display: block; line-height: inherit; padding-left: 4rem; width: calc(100% - 4rem); } .input-field input[type=search]:focus { background-color: #FFF; border: 0; box-shadow: none; color: #444; } .input-field input[type=search]:focus + label i, .input-field input[type=search]:focus ~ .mdi-navigation-close { color: #444; } .input-field input[type=search] + label { left: 1rem; } .input-field input[type=search] ~ .mdi-navigation-close { position: absolute; top: 0; right: 1rem; color: transparent; cursor: pointer; font-size: 2rem; transition: .3s color; } textarea { width: 100%; height: 3rem; background-color: transparent; } textarea.materialize-textarea { overflow-y: hidden; /* prevents scroll bar flash */ padding: 1.6rem 0; /* prevents text jump on Enter keypress */ resize: none; min-height: 3rem; } .hiddendiv { display: none; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; /* future version of deprecated 'word-wrap' */ padding-top: 1.2rem; /* prevents text jump on Enter keypress */ } /*************** Radio Buttons ***************/ /* Remove default Radio Buttons */ [type="radio"]:not(:checked), [type="radio"]:checked { position: absolute; left: -9999px; visibility: hidden; } [type="radio"]:not(:checked) + label, [type="radio"]:checked + label { position: relative; padding-left: 35px; cursor: pointer; display: inline-block; height: 25px; line-height: 25px; font-size: 1rem; -webkit-transition: .28s ease; -moz-transition: .28s ease; -o-transition: .28s ease; -ms-transition: .28s ease; transition: .28s ease; -webkit-user-select: none; /* webkit (safari, chrome) browsers */ -moz-user-select: none; /* mozilla browsers */ -khtml-user-select: none; /* webkit (konqueror) browsers */ -ms-user-select: none; /* IE10+ */ } [type="radio"] + label:before, [type="radio"] + label:after { content: ''; position: absolute; left: 0; top: 0; margin: 4px; width: 16px; height: 16px; z-index: 0; -webkit-transition: .28s ease; -moz-transition: .28s ease; -o-transition: .28s ease; -ms-transition: .28s ease; transition: .28s ease; } /* Unchecked styles */ [type="radio"]:not(:checked) + label:before { border-radius: 50%; border: 2px solid #5a5a5a; } [type="radio"]:not(:checked) + label:after { border-radius: 50%; border: 2px solid #5a5a5a; z-index: -1; -webkit-transform: scale(0); -moz-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); } /* Checked styles */ [type="radio"]:checked + label:before { border-radius: 50%; border: 2px solid transparent; } [type="radio"]:checked + label:after { border-radius: 50%; border: 2px solid #26a69a; background-color: #26a69a; z-index: 0; -webkit-transform: scale(1.02); -moz-transform: scale(1.02); -ms-transform: scale(1.02); -o-transform: scale(1.02); transform: scale(1.02); } /* Radio With gap */ [type="radio"].with-gap:checked + label:before { border-radius: 50%; border: 2px solid #26a69a; } [type="radio"].with-gap:checked + label:after { border-radius: 50%; border: 2px solid #26a69a; background-color: #26a69a; z-index: 0; -webkit-transform: scale(.5); -moz-transform: scale(.5); -ms-transform: scale(.5); -o-transform: scale(.5); transform: scale(.5); } /* Disabled style */ [type="radio"]:disabled:not(:checked) + label:before, [type="radio"]:disabled:checked + label:before { background-color: transparent; border-color: rgba(0, 0, 0, 0.26); } [type="radio"]:disabled + label { color: rgba(0, 0, 0, 0.26); } [type="radio"]:disabled:not(:checked) + label:hover:before { border-color: rgba(0, 0, 0, 0.26); } /*************** Checkboxes ***************/ /* CUSTOM CSS CHECKBOXES */ form p { margin-bottom: 10px; text-align: left; } form p:last-child { margin-bottom: 0; } /* Remove default checkbox */ [type="checkbox"]:not(:checked), [type="checkbox"]:checked { position: absolute; left: -9999px; } [type="checkbox"] { /* checkbox aspect */ } [type="checkbox"] + label { position: relative; padding-left: 35px; cursor: pointer; display: inline-block; height: 25px; line-height: 25px; font-size: 1rem; -webkit-user-select: none; /* webkit (safari, chrome) browsers */ -moz-user-select: none; /* mozilla browsers */ -khtml-user-select: none; /* webkit (konqueror) browsers */ -ms-user-select: none; /* IE10+ */ } [type="checkbox"] + label:before { content: ''; position: absolute; top: 0; left: 0; width: 18px; height: 18px; z-index: 0; border: 2px solid #5a5a5a; border-radius: 1px; margin-top: 2px; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; -ms-transition: 0.2s; transition: 0.2s; } [type="checkbox"]:not(:checked):disabled + label:before { border: none; background-color: rgba(0, 0, 0, 0.26); } [type="checkbox"]:checked + label:before { top: -4px; left: -3px; width: 12px; height: 22px; border-top: 2px solid transparent; border-left: 2px solid transparent; border-right: 2px solid #26a69a; border-bottom: 2px solid #26a69a; -webkit-transform: rotate(40deg); -moz-transform: rotate(40deg); -ms-transform: rotate(40deg); -o-transform: rotate(40deg); transform: rotate(40deg); -webkit-backface-visibility: hidden; -webkit-transform-origin: 100% 100%; -moz-transform-origin: 100% 100%; -ms-transform-origin: 100% 100%; -o-transform-origin: 100% 100%; transform-origin: 100% 100%; } [type="checkbox"]:checked:disabled + label:before { border-right: 2px solid rgba(0, 0, 0, 0.26); border-bottom: 2px solid rgba(0, 0, 0, 0.26); } /* Indeterminate checkbox */ [type="checkbox"]:indeterminate + label:before { left: -10px; top: -11px; width: 10px; height: 22px; border-top: none; border-left: none; border-right: 2px solid #26a69a; border-bottom: none; -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -ms-transform: rotate(90deg); -o-transform: rotate(90deg); transform: rotate(90deg); -webkit-backface-visibility: hidden; -webkit-transform-origin: 100% 100%; -moz-transform-origin: 100% 100%; -ms-transform-origin: 100% 100%; -o-transform-origin: 100% 100%; transform-origin: 100% 100%; } [type="checkbox"]:indeterminate:disabled + label:before { border-right: 2px solid rgba(0, 0, 0, 0.26); background-color: transparent; } [type="checkbox"].filled-in + label:after { border-radius: 2px; } [type="checkbox"].filled-in + label:before, [type="checkbox"].filled-in + label:after { content: ''; left: 0; position: absolute; /* .1s delay is for check animation */ transition: border .25s, background-color .25s, width .2s .1s, height .2s .1s, top .2s .1s, left .2s .1s; z-index: 1; } [type="checkbox"].filled-in:not(:checked) + label:before { width: 0; height: 0; border: 3px solid transparent; left: 6px; top: 10px; -webkit-transform: rotateZ(37deg); transform: rotateZ(37deg); -webkit-transform-origin: 20% 40%; transform-origin: 100% 100%; } [type="checkbox"].filled-in:not(:checked) + label:after { height: 20px; width: 20px; background-color: transparent; border: 2px solid #5a5a5a; top: 0px; z-index: 0; } [type="checkbox"].filled-in:checked + label:before { top: 0; left: 1px; width: 8px; height: 13px; border-top: 2px solid transparent; border-left: 2px solid transparent; border-right: 2px solid #fff; border-bottom: 2px solid #fff; -webkit-transform: rotateZ(37deg); transform: rotateZ(37deg); -webkit-transform-origin: 100% 100%; transform-origin: 100% 100%; } [type="checkbox"].filled-in:checked + label:after { top: 0px; width: 20px; height: 20px; border: 2px solid #26a69a; background-color: #26a69a; z-index: 0; } [type="checkbox"].filled-in:disabled:not(:checked) + label:before { background-color: transparent; border: 2px solid transparent; } [type="checkbox"].filled-in:disabled:not(:checked) + label:after { border-color: transparent; background-color: #BDBDBD; } [type="checkbox"].filled-in:disabled:checked + label:before { background-color: transparent; } [type="checkbox"].filled-in:disabled:checked + label:after { background-color: #BDBDBD; border-color: #BDBDBD; } /*************** Switch ***************/ .switch, .switch * { -webkit-user-select: none; -moz-user-select: none; -khtml-user-select: none; -ms-user-select: none; } .switch label { cursor: pointer; } .switch label input[type=checkbox] { opacity: 0; width: 0; height: 0; } .switch label input[type=checkbox]:checked + .lever { background-color: #84c7c1; } .switch label input[type=checkbox]:checked + .lever:after { background-color: #26a69a; } .switch label .lever { content: ""; display: inline-block; position: relative; width: 40px; height: 15px; background-color: #818181; border-radius: 15px; margin-right: 10px; transition: background 0.3s ease; vertical-align: middle; margin: 0 16px; } .switch label .lever:after { content: ""; position: absolute; display: inline-block; width: 21px; height: 21px; background-color: #F1F1F1; border-radius: 21px; box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4); left: -5px; top: -3px; transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease; } input[type=checkbox]:checked:not(:disabled) ~ .lever:active:after { box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(38, 166, 154, 0.1); } input[type=checkbox]:not(:disabled) ~ .lever:active:after { box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 0, 0, 0.08); } .switch label input[type=checkbox]:checked + .lever:after { left: 24px; } .switch input[type=checkbox][disabled] + .lever { cursor: default; } .switch label input[type=checkbox][disabled] + .lever:after, .switch label input[type=checkbox][disabled]:checked + .lever:after { background-color: #BDBDBD; } /*************** Select Field ***************/ .select-label { position: absolute; } .select-wrapper { position: relative; } .select-wrapper input.select-dropdown { position: relative; cursor: pointer; background-color: transparent; border: none; border-bottom: 1px solid #9e9e9e; outline: none; height: 3rem; line-height: 3rem; width: 100%; font-size: 1rem; margin: 0 0 15px 0; padding: 0; display: block; } .select-wrapper .mdi-navigation-arrow-drop-down { color: initial; position: absolute; right: 0; top: 0; font-size: 23px; } .select-wrapper .mdi-navigation-arrow-drop-down.disabled { color: rgba(0, 0, 0, 0.26); } .select-wrapper + label { position: absolute; top: -14px; font-size: 0.8rem; } select { display: none; } select.browser-default { display: block; } select:disabled { color: rgba(0, 0, 0, 0.3); } .select-wrapper input.select-dropdown:disabled { color: rgba(0, 0, 0, 0.3); cursor: default; -webkit-user-select: none; /* webkit (safari, chrome) browsers */ -moz-user-select: none; /* mozilla browsers */ -ms-user-select: none; /* IE10+ */ border-bottom: 1px solid rgba(0, 0, 0, 0.3); } .select-wrapper i { color: rgba(0, 0, 0, 0.3); } .select-dropdown li.disabled { color: rgba(0, 0, 0, 0.3); background-color: transparent; } /********************* File Input **********************/ .file-field { position: relative; } .file-field input.file-path { margin-left: 100px; width: calc(100% - 100px); } .file-field .btn, .file-field .btn-large { position: absolute; top: 0; left: 0; height: 3rem; line-height: 3rem; } .file-field span { cursor: pointer; } .file-field input[type=file] { position: absolute; top: 0; right: 0; left: 0; bottom: 0; width: 100%; margin: 0; padding: 0; font-size: 20px; cursor: pointer; opacity: 0; filter: alpha(opacity=0); } /*************** Range ***************/ .range-field { position: relative; } input[type=range], input[type=range] + .thumb { cursor: pointer; } input[type=range] { position: relative; background-color: transparent; border: none; outline: none; width: 100%; margin: 15px 0px; padding: 0; } input[type=range] + .thumb { position: absolute; border: none; height: 0; width: 0; border-radius: 50%; background-color: #26a69a; top: 10px; margin-left: -6px; -webkit-transform-origin: 50% 50%; -moz-transform-origin: 50% 50%; -ms-transform-origin: 50% 50%; -o-transform-origin: 50% 50%; transform-origin: 50% 50%; -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -ms-transform: rotate(-45deg); -o-transform: rotate(-45deg); transform: rotate(-45deg); } input[type=range] + .thumb .value { display: block; width: 30px; text-align: center; color: #26a69a; font-size: 0; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } input[type=range] + .thumb.active { border-radius: 50% 50% 50% 0; } input[type=range] + .thumb.active .value { color: #fff; margin-left: -1px; margin-top: 8px; font-size: 10px; } input[type=range]:focus { outline: none; } input[type=range] { -webkit-appearance: none; } input[type=range]::-webkit-slider-runnable-track { height: 3px; background: #c2c0c2; border: none; } input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; border: none; height: 14px; width: 14px; border-radius: 50%; background-color: #26a69a; transform-origin: 50% 50%; margin: -5px 0 0 0; -webkit-transition: 0.3s; -moz-transition: 0.3s; -o-transition: 0.3s; -ms-transition: 0.3s; transition: 0.3s; } input[type=range]:focus::-webkit-slider-runnable-track { background: #ccc; } input[type=range] { /* fix for FF unable to apply focus style bug */ border: 1px solid white; /*required for proper track sizing in FF*/ } input[type=range]::-moz-range-track { height: 3px; background: #ddd; border: none; } input[type=range]::-moz-range-thumb { border: none; height: 14px; width: 14px; border-radius: 50%; background: #26a69a; margin-top: -5px; } /*hide the outline behind the border*/ input[type=range]:-moz-focusring { outline: 1px solid white; outline-offset: -1px; } input[type=range]:focus::-moz-range-track { background: #ccc; } input[type=range]::-ms-track { height: 3px; /*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */ background: transparent; /*leave room for the larger thumb to overflow with a transparent border */ border-color: transparent; border-width: 6px 0; /*remove default tick marks*/ color: transparent; } input[type=range]::-ms-fill-lower { background: #777; } input[type=range]::-ms-fill-upper { background: #ddd; } input[type=range]::-ms-thumb { border: none; height: 14px; width: 14px; border-radius: 50%; background: #26a69a; } input[type=range]:focus::-ms-fill-lower { background: #888; } input[type=range]:focus::-ms-fill-upper { background: #ccc; } /*************************** Text Inputs + Textarea ****************************/ select { background-color: rgba(255, 255, 255, 0.9); width: 100%; padding: 5px; border: 1px solid #f2f2f2; border-radius: 2px; height: 3rem; } /*************** Nav List ***************/ .table-of-contents.fixed { position: fixed; } .table-of-contents li { padding: 2px 0; } .table-of-contents a { display: inline-block; font-weight: 300; color: #757575; padding-left: 20px; height: 1.5rem; line-height: 1.5rem; letter-spacing: .4; display: inline-block; } .table-of-contents a:hover { color: #a8a8a8; padding-left: 19px; border-left: 1px solid #ea4a4f; } .table-of-contents a.active { font-weight: 500; padding-left: 18px; border-left: 2px solid #ea4a4f; } .side-nav { position: fixed; width: 240px; left: -105%; top: 0; margin: 0; height: 100%; height: calc(100% + 60px); height: -moz-calc(100%); padding-bottom: 60px; background-color: #FFF; z-index: 999; overflow-y: auto; will-change: left; } .side-nav.right-aligned { will-change: right; right: -105%; left: auto; } .side-nav .collapsible { margin: 0; } .side-nav li { float: none; padding: 0 15px; } .side-nav li:hover, .side-nav li.active { background-color: #ddd; } .side-nav a { color: #444; display: block; font-size: 1rem; height: 64px; line-height: 64px; padding: 0 15px; } .drag-target { height: 100%; width: 10px; position: fixed; top: 0; z-index: 998; } .side-nav.fixed a { display: block; padding: 0 15px; color: #444; } .side-nav.fixed { left: 0; position: fixed; } .side-nav.fixed.right-aligned { right: 0; left: auto; } @media only screen and (max-width : 992px) { .side-nav.fixed { left: -105%; } .side-nav.fixed.right-aligned { right: -105%; left: auto; } } .side-nav .collapsible-body li.active, .side-nav.fixed .collapsible-body li.active { background-color: #ee6e73; } .side-nav .collapsible-body li.active a, .side-nav.fixed .collapsible-body li.active a { color: #fff; } #sidenav-overlay { position: fixed; top: 0; left: 0; right: 0; height: 120vh; background-color: rgba(0, 0, 0, 0.5); z-index: 997; will-change: opacity; } /* @license Copyright (c) 2014 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ /**************************/ /* STYLES FOR THE SPINNER */ /**************************/ /* * Constants: * STROKEWIDTH = 3px * ARCSIZE = 270 degrees (amount of circle the arc takes up) * ARCTIME = 1333ms (time it takes to expand and contract arc) * ARCSTARTROT = 216 degrees (how much the start location of the arc * should rotate each time, 216 gives us a * 5 pointed star shape (it's 360/5 * 3). * For a 7 pointed star, we might do * 360/7 * 3 = 154.286) * CONTAINERWIDTH = 28px * SHRINK_TIME = 400ms */ .preloader-wrapper { display: inline-block; position: relative; width: 48px; height: 48px; } .preloader-wrapper.small { width: 36px; height: 36px; } .preloader-wrapper.big { width: 64px; height: 64px; } .preloader-wrapper.active { /* duration: 360 * ARCTIME / (ARCSTARTROT + (360-ARCSIZE)) */ -webkit-animation: container-rotate 1568ms linear infinite; animation: container-rotate 1568ms linear infinite; } @-webkit-keyframes container-rotate { to { -webkit-transform: rotate(360deg); } } @keyframes container-rotate { to { transform: rotate(360deg); } } .spinner-layer { position: absolute; width: 100%; height: 100%; opacity: 0; } .spinner-blue, .spinner-blue-only { border-color: #4285f4; } .spinner-red, .spinner-red-only { border-color: #db4437; } .spinner-yellow, .spinner-yellow-only { border-color: #f4b400; } .spinner-green, .spinner-green-only { border-color: #0f9d58; } /** * IMPORTANT NOTE ABOUT CSS ANIMATION PROPERTIES (keanulee): * * iOS Safari (tested on iOS 8.1) does not handle animation-delay very well - it doesn't * guarantee that the animation will start _exactly_ after that value. So we avoid using * animation-delay and instead set custom keyframes for each color (as redundant as it * seems). * * We write out each animation in full (instead of separating animation-name, * animation-duration, etc.) because under the polyfill, Safari does not recognize those * specific properties properly, treats them as -webkit-animation, and overrides the * other animation rules. See https://github.com/Polymer/platform/issues/53. */ .active .spinner-layer.spinner-blue { /* durations: 4 * ARCTIME */ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; } .active .spinner-layer.spinner-red { /* durations: 4 * ARCTIME */ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; } .active .spinner-layer.spinner-yellow { /* durations: 4 * ARCTIME */ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; } .active .spinner-layer.spinner-green { /* durations: 4 * ARCTIME */ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; } .active .spinner-layer.spinner-blue-only, .active .spinner-layer.spinner-red-only, .active .spinner-layer.spinner-yellow-only, .active .spinner-layer.spinner-green-only { /* durations: 4 * ARCTIME */ opacity: 1; -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; } @-webkit-keyframes fill-unfill-rotate { /* 0.5 * ARCSIZE */ /* 1 * ARCSIZE */ /* 1.5 * ARCSIZE */ /* 2 * ARCSIZE */ /* 2.5 * ARCSIZE */ /* 3 * ARCSIZE */ /* 3.5 * ARCSIZE */ /* 4 * ARCSIZE */ 12.5% { -webkit-transform: rotate(135deg); } 25% { -webkit-transform: rotate(270deg); } 37.5% { -webkit-transform: rotate(405deg); } 50% { -webkit-transform: rotate(540deg); } 62.5% { -webkit-transform: rotate(675deg); } 75% { -webkit-transform: rotate(810deg); } 87.5% { -webkit-transform: rotate(945deg); } to { -webkit-transform: rotate(1080deg); } } @keyframes fill-unfill-rotate { /* 0.5 * ARCSIZE */ /* 1 * ARCSIZE */ /* 1.5 * ARCSIZE */ /* 2 * ARCSIZE */ /* 2.5 * ARCSIZE */ /* 3 * ARCSIZE */ /* 3.5 * ARCSIZE */ /* 4 * ARCSIZE */ 12.5% { transform: rotate(135deg); } 25% { transform: rotate(270deg); } 37.5% { transform: rotate(405deg); } 50% { transform: rotate(540deg); } 62.5% { transform: rotate(675deg); } 75% { transform: rotate(810deg); } 87.5% { transform: rotate(945deg); } to { transform: rotate(1080deg); } } @-webkit-keyframes blue-fade-in-out { from { opacity: 1; } 25% { opacity: 1; } 26% { opacity: 0; } 89% { opacity: 0; } 90% { opacity: 1; } 100% { opacity: 1; } } @keyframes blue-fade-in-out { from { opacity: 1; } 25% { opacity: 1; } 26% { opacity: 0; } 89% { opacity: 0; } 90% { opacity: 1; } 100% { opacity: 1; } } @-webkit-keyframes red-fade-in-out { from { opacity: 0; } 15% { opacity: 0; } 25% { opacity: 1; } 50% { opacity: 1; } 51% { opacity: 0; } } @keyframes red-fade-in-out { from { opacity: 0; } 15% { opacity: 0; } 25% { opacity: 1; } 50% { opacity: 1; } 51% { opacity: 0; } } @-webkit-keyframes yellow-fade-in-out { from { opacity: 0; } 40% { opacity: 0; } 50% { opacity: 1; } 75% { opacity: 1; } 76% { opacity: 0; } } @keyframes yellow-fade-in-out { from { opacity: 0; } 40% { opacity: 0; } 50% { opacity: 1; } 75% { opacity: 1; } 76% { opacity: 0; } } @-webkit-keyframes green-fade-in-out { from { opacity: 0; } 65% { opacity: 0; } 75% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } } @keyframes green-fade-in-out { from { opacity: 0; } 65% { opacity: 0; } 75% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } } /** * Patch the gap that appear between the two adjacent div.circle-clipper while the * spinner is rotating (appears on Chrome 38, Safari 7.1, and IE 11). */ .gap-patch { position: absolute; top: 0; left: 45%; width: 10%; height: 100%; overflow: hidden; border-color: inherit; } .gap-patch .circle { width: 1000%; left: -450%; } .circle-clipper { display: inline-block; position: relative; width: 50%; height: 100%; overflow: hidden; border-color: inherit; } .circle-clipper .circle { width: 200%; height: 100%; border-width: 3px; /* STROKEWIDTH */ border-style: solid; border-color: inherit; border-bottom-color: transparent !important; border-radius: 50%; -webkit-animation: none; animation: none; position: absolute; top: 0; right: 0; bottom: 0; } .circle-clipper.left .circle { left: 0; border-right-color: transparent !important; -webkit-transform: rotate(129deg); transform: rotate(129deg); } .circle-clipper.right .circle { left: -100%; border-left-color: transparent !important; -webkit-transform: rotate(-129deg); transform: rotate(-129deg); } .active .circle-clipper.left .circle { /* duration: ARCTIME */ -webkit-animation: left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; animation: left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; } .active .circle-clipper.right .circle { /* duration: ARCTIME */ -webkit-animation: right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; animation: right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; } @-webkit-keyframes left-spin { from { -webkit-transform: rotate(130deg); } 50% { -webkit-transform: rotate(-5deg); } to { -webkit-transform: rotate(130deg); } } @keyframes left-spin { from { transform: rotate(130deg); } 50% { transform: rotate(-5deg); } to { transform: rotate(130deg); } } @-webkit-keyframes right-spin { from { -webkit-transform: rotate(-130deg); } 50% { -webkit-transform: rotate(5deg); } to { -webkit-transform: rotate(-130deg); } } @keyframes right-spin { from { transform: rotate(-130deg); } 50% { transform: rotate(5deg); } to { transform: rotate(-130deg); } } #spinnerContainer.cooldown { /* duration: SHRINK_TIME */ -webkit-animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0, 0.2, 1); animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0, 0.2, 1); } @-webkit-keyframes fade-out { from { opacity: 1; } to { opacity: 0; } } @keyframes fade-out { from { opacity: 1; } to { opacity: 0; } } .slider { position: relative; height: 440px; width: 100%; } .slider.fullscreen { height: 100%; width: 100%; position: absolute; top: 0; left: 0; right: 0; bottom: 0; } .slider.fullscreen ul.slides { height: 100%; } .slider.fullscreen ul.indicators { z-index: 2; bottom: 30px; } .slider .slides { background-color: #9e9e9e; margin: 0; height: 400px; } .slider .slides li { opacity: 0; position: absolute; top: 0; left: 0; z-index: 1; width: 100%; height: inherit; overflow: hidden; } .slider .slides li img { height: 100%; width: 100%; background-size: cover; background-position: center; } .slider .slides li .caption { color: #fff; position: absolute; top: 15%; left: 15%; width: 70%; opacity: 0; } .slider .slides li .caption p { color: #e0e0e0; } .slider .slides li.active { z-index: 2; } .slider .indicators { position: absolute; text-align: center; left: 0; right: 0; bottom: 0; margin: 0; } .slider .indicators .indicator-item { display: inline-block; position: relative; cursor: pointer; height: 16px; width: 16px; margin: 0 12px; background-color: #e0e0e0; -webkit-transition: background-color .3s; -moz-transition: background-color .3s; -o-transition: background-color .3s; -ms-transition: background-color .3s; transition: background-color .3s; border-radius: 50%; } .slider .indicators .indicator-item.active { background-color: #4CAF50; } /* ========================================================================== $BASE-PICKER ========================================================================== */ /** * Note: the root picker element should *NOT* be styled more than what's here. */ .picker { font-size: 16px; text-align: left; line-height: 1.2; color: #000000; position: absolute; z-index: 10000; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } /** * The picker input element. */ .picker__input { cursor: default; } /** * When the picker is opened, the input element is "activated". */ .picker__input.picker__input--active { border-color: #0089ec; } /** * The holder is the only "scrollable" top-level container element. */ .picker__holder { width: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; } /*! * Default mobile-first, responsive styling for pickadate.js * Demo: http://amsul.github.io/pickadate.js */ /** * Note: the root picker element should *NOT* be styled more than what's here. */ /** * Make the holder and frame fullscreen. */ .picker__holder, .picker__frame { bottom: 0; left: 0; right: 0; top: 100%; } /** * The holder should overlay the entire screen. */ .picker__holder { position: fixed; -webkit-transition: background 0.15s ease-out, top 0s 0.15s; -moz-transition: background 0.15s ease-out, top 0s 0.15s; transition: background 0.15s ease-out, top 0s 0.15s; -webkit-backface-visibility: hidden; } /** * The frame that bounds the box contents of the picker. */ .picker__frame { position: absolute; margin: 0 auto; min-width: 256px; max-width: 300px; max-height: 350px; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); -moz-opacity: 0; opacity: 0; -webkit-transition: all 0.15s ease-out; -moz-transition: all 0.15s ease-out; transition: all 0.15s ease-out; } @media (min-height: 28.875em) { .picker__frame { overflow: visible; top: auto; bottom: -100%; max-height: 80%; } } @media (min-height: 40.125em) { .picker__frame { margin-bottom: 7.5%; } } /** * The wrapper sets the stage to vertically align the box contents. */ .picker__wrap { display: table; width: 100%; height: 100%; } @media (min-height: 28.875em) { .picker__wrap { display: block; } } /** * The box contains all the picker contents. */ .picker__box { background: #ffffff; display: table-cell; vertical-align: middle; } @media (min-height: 28.875em) { .picker__box { display: block; border: 1px solid #777777; border-top-color: #898989; border-bottom-width: 0; -webkit-border-radius: 5px 5px 0 0; -moz-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; -webkit-box-shadow: 0 12px 36px 16px rgba(0, 0, 0, 0.24); -moz-box-shadow: 0 12px 36px 16px rgba(0, 0, 0, 0.24); box-shadow: 0 12px 36px 16px rgba(0, 0, 0, 0.24); } } /** * When the picker opens... */ .picker--opened .picker__holder { top: 0; background: transparent; -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#1E000000,endColorstr=#1E000000)"; zoom: 1; background: rgba(0, 0, 0, 0.32); -webkit-transition: background 0.15s ease-out; -moz-transition: background 0.15s ease-out; transition: background 0.15s ease-out; } .picker--opened .picker__frame { top: 0; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); -moz-opacity: 1; opacity: 1; } @media (min-height: 35.875em) { .picker--opened .picker__frame { top: 10%; bottom: 20% auto; } } /** * For `large` screens, transform into an inline picker. */ /* ========================================================================== CUSTOM MATERIALIZE STYLES ========================================================================== */ .picker__input.picker__input--active { border-color: #E3F2FD; } .picker__frame { margin: 0 auto; max-width: 325px; } @media (min-height: 38.875em) { .picker--opened .picker__frame { top: 10%; bottom: auto; } } /* ========================================================================== $BASE-DATE-PICKER ========================================================================== */ /** * The picker box. */ .picker__box { padding: 0 1em; } /** * The header containing the month and year stuff. */ .picker__header { text-align: center; position: relative; margin-top: .75em; } /** * The month and year labels. */ .picker__month, .picker__year { display: inline-block; margin-left: .25em; margin-right: .25em; } /** * The month and year selectors. */ .picker__select--month, .picker__select--year { height: 2em; padding: 0; margin-left: .25em; margin-right: .25em; } .picker__select--month.browser-default { display: inline; background-color: #FFFFFF; width: 40%; } .picker__select--year.browser-default { display: inline; background-color: #FFFFFF; width: 25%; } .picker__select--month:focus, .picker__select--year:focus { border-color: rgba(0, 0, 0, 0.05); } /** * The month navigation buttons. */ .picker__nav--prev, .picker__nav--next { position: absolute; padding: .5em 1.25em; width: 1em; height: 1em; box-sizing: content-box; top: -0.25em; } .picker__nav--prev { left: -1em; padding-right: 1.25em; } .picker__nav--next { right: -1em; padding-left: 1.25em; } .picker__nav--disabled, .picker__nav--disabled:hover, .picker__nav--disabled:before, .picker__nav--disabled:before:hover { cursor: default; background: none; border-right-color: #f5f5f5; border-left-color: #f5f5f5; } /** * The calendar table of dates */ .picker__table { text-align: center; border-collapse: collapse; border-spacing: 0; table-layout: fixed; font-size: 1rem; width: 100%; margin-top: .75em; margin-bottom: .5em; } .picker__table th, .picker__table td { text-align: center; } .picker__table td { margin: 0; padding: 0; } /** * The weekday labels */ .picker__weekday { width: 14.285714286%; font-size: .75em; padding-bottom: .25em; color: #999999; font-weight: 500; /* Increase the spacing a tad */ } @media (min-height: 33.875em) { .picker__weekday { padding-bottom: .5em; } } /** * The days on the calendar */ .picker__day--today { position: relative; color: #595959; letter-spacing: -.3; padding: .75rem 0; font-weight: 400; border: 1px solid transparent; } .picker__day--disabled:before { border-top-color: #aaaaaa; } .picker__day--infocus:hover { cursor: pointer; color: #000; font-weight: 500; } .picker__day--outfocus { display: none; padding: .75rem 0; color: #fff; } .picker__day--outfocus:hover { cursor: pointer; color: #dddddd; font-weight: 500; } .picker__day--highlighted:hover, .picker--focused .picker__day--highlighted { cursor: pointer; } .picker__day--selected, .picker__day--selected:hover, .picker--focused .picker__day--selected { border-radius: 50%; -webkit-transform: scale(.75); -moz-transform: scale(.75); -ms-transform: scale(.75); -o-transform: scale(.75); transform: scale(.75); background: #0089ec; color: #ffffff; } .picker__day--disabled, .picker__day--disabled:hover, .picker--focused .picker__day--disabled { background: #f5f5f5; border-color: #f5f5f5; color: #dddddd; cursor: default; } .picker__day--highlighted.picker__day--disabled, .picker__day--highlighted.picker__day--disabled:hover { background: #bbbbbb; } /** * The footer containing the "today", "clear", and "close" buttons. */ .picker__footer { text-align: center; display: flex; align-items: center; justify-content: space-between; } .picker__button--today, .picker__button--clear, .picker__button--close { border: 1px solid #ffffff; background: #ffffff; font-size: .8em; padding: .66em 0; font-weight: bold; width: 33%; display: inline-block; vertical-align: bottom; } .picker__button--today:hover, .picker__button--clear:hover, .picker__button--close:hover { cursor: pointer; color: #000000; background: #b1dcfb; border-bottom-color: #b1dcfb; } .picker__button--today:focus, .picker__button--clear:focus, .picker__button--close:focus { background: #b1dcfb; border-color: rgba(0, 0, 0, 0.05); outline: none; } .picker__button--today:before, .picker__button--clear:before, .picker__button--close:before { position: relative; display: inline-block; height: 0; } .picker__button--today:before, .picker__button--clear:before { content: " "; margin-right: .45em; } .picker__button--today:before { top: -0.05em; width: 0; border-top: 0.66em solid #0059bc; border-left: .66em solid transparent; } .picker__button--clear:before { top: -0.25em; width: .66em; border-top: 3px solid #ee2200; } .picker__button--close:before { content: "\D7"; top: -0.1em; vertical-align: top; font-size: 1.1em; margin-right: .35em; color: #777777; } .picker__button--today[disabled], .picker__button--today[disabled]:hover { background: #f5f5f5; border-color: #f5f5f5; color: #dddddd; cursor: default; } .picker__button--today[disabled]:before { border-top-color: #aaaaaa; } /* ========================================================================== CUSTOM MATERIALIZE STYLES ========================================================================== */ .picker__box { border-radius: 2px; overflow: hidden; } .picker__date-display { text-align: center; background-color: #26a69a; color: #fff; padding-bottom: 15px; font-weight: 300; } .picker__nav--prev:hover, .picker__nav--next:hover { cursor: pointer; color: #000000; background: #a1ded8; } .picker__weekday-display { background-color: #1f897f; padding: 10px; font-weight: 200; letter-spacing: .5; font-size: 1rem; margin-bottom: 15px; } .picker__month-display { text-transform: uppercase; font-size: 2rem; } .picker__day-display { font-size: 4.5rem; font-weight: 400; } .picker__year-display { font-size: 1.8rem; color: rgba(255, 255, 255, 0.4); } .picker__box { padding: 0; } .picker__calendar-container { padding: 0 1rem; } .picker__calendar-container thead { border: none; } .picker__table { margin-top: 0; margin-bottom: .5em; } .picker__day--infocus { color: #595959; letter-spacing: -.3; padding: .75rem 0; font-weight: 400; border: 1px solid transparent; } .picker__day.picker__day--today { color: #26a69a; } .picker__day.picker__day--today.picker__day--selected { color: #fff; } .picker__weekday { font-size: .9rem; } .picker__day--selected, .picker__day--selected:hover, .picker--focused .picker__day--selected { border-radius: 50%; -webkit-transform: scale(.9); -moz-transform: scale(.9); -ms-transform: scale(.9); -o-transform: scale(.9); transform: scale(.9); background-color: #26a69a; color: #ffffff; } .picker__day--selected.picker__day--outfocus, .picker__day--selected:hover.picker__day--outfocus, .picker--focused .picker__day--selected.picker__day--outfocus { background-color: #a1ded8; } .picker__footer { text-align: right; padding: 5px 10px; } .picker__close, .picker__today { font-size: 1.1rem; padding: 0 1rem; color: #26a69a; } .picker__nav--prev:before, .picker__nav--next:before { content: " "; border-top: .5em solid transparent; border-bottom: .5em solid transparent; border-right: 0.75em solid #676767; width: 0; height: 0; display: block; margin: 0 auto; } .picker__nav--next:before { border-right: 0; border-left: 0.75em solid #676767; } button.picker__today:focus, button.picker__clear:focus, button.picker__close:focus { background-color: #a1ded8; } /* ========================================================================== $BASE-TIME-PICKER ========================================================================== */ /** * The list of times. */ .picker__list { list-style: none; padding: 0.75em 0 4.2em; margin: 0; } /** * The times on the clock. */ .picker__list-item { border-bottom: 1px solid #dddddd; border-top: 1px solid #dddddd; margin-bottom: -1px; position: relative; background: #ffffff; padding: .75em 1.25em; } @media (min-height: 46.75em) { .picker__list-item { padding: .5em 1em; } } /* Hovered time */ .picker__list-item:hover { cursor: pointer; color: #000000; background: #b1dcfb; border-color: #0089ec; z-index: 10; } /* Highlighted and hovered/focused time */ .picker__list-item--highlighted { border-color: #0089ec; z-index: 10; } .picker__list-item--highlighted:hover, .picker--focused .picker__list-item--highlighted { cursor: pointer; color: #000000; background: #b1dcfb; } /* Selected and hovered/focused time */ .picker__list-item--selected, .picker__list-item--selected:hover, .picker--focused .picker__list-item--selected { background: #0089ec; color: #ffffff; z-index: 10; } /* Disabled time */ .picker__list-item--disabled, .picker__list-item--disabled:hover, .picker--focused .picker__list-item--disabled { background: #f5f5f5; border-color: #f5f5f5; color: #dddddd; cursor: default; border-color: #dddddd; z-index: auto; } /** * The clear button */ .picker--time .picker__button--clear { display: block; width: 80%; margin: 1em auto 0; padding: 1em 1.25em; background: none; border: 0; font-weight: 500; font-size: .67em; text-align: center; text-transform: uppercase; color: #666; } .picker--time .picker__button--clear:hover, .picker--time .picker__button--clear:focus { color: #000000; background: #b1dcfb; background: #ee2200; border-color: #ee2200; cursor: pointer; color: #ffffff; outline: none; } .picker--time .picker__button--clear:before { top: -0.25em; color: #666; font-size: 1.25em; font-weight: bold; } .picker--time .picker__button--clear:hover:before, .picker--time .picker__button--clear:focus:before { color: #ffffff; } /* ========================================================================== $DEFAULT-TIME-PICKER ========================================================================== */ /** * The frame the bounds the time picker. */ .picker--time .picker__frame { min-width: 256px; max-width: 320px; } /** * The picker box. */ .picker--time .picker__box { font-size: 1em; background: #f2f2f2; padding: 0; } @media (min-height: 40.125em) { .picker--time .picker__box { margin-bottom: 5em; } }
eventotal/eventotal.github.io
css/materialize.css
CSS
mit
181,727
const DataType = require("./DataType"); const codeGenMixin = require("../CodeGenMixins/TupleType"); class TupleType extends codeGenMixin(DataType) { constructor() { super(); } }//end TupleType module.exports = TupleType;
evonox/NodeMDA-OCL-to-JavaScript-compiler
ocl/TupleType.js
JavaScript
mit
237
<html> <head> <title>Module Example</title> <script src="lib/basic.js"></script> <script> // // Define a module. This should be placed in the folder gizur/MyModule.js // var gizur; if(!gizur) gizur = {}; // A simple module gizur.modules = (function () { // A private constructor function MyModule() { this._myString = ""; // a private variable } MyModule.prototype.getString = function() { return this._myString; } MyModule.prototype.setString = function(str) { this._myString = str; } return { MyModule: MyModule }; // make the module public by returning the constructors }()); window.onload = function(){ test("Testing the module MyModule.", function(){ var _myModule = new gizur.modules.MyModule(); // create a MyModule object (by cloning the gizur.modules.MyModule) _myModule.setString("testing"); assert( _myModule.getString() == "testing", "Make sure that custom setter and getter works" ); }); }; </script> <style> #results li.pass { color: green; } #results li.fail { color: red; } </style> </head> <body> <ul id="results"></ul> </body> </html>
karmiphuc/wip
JavaScript/ModuleExample.html
HTML
mit
1,155
window.WebPirate_MessageListenerObject = function() { navigator.qt.onmessage = this.onMessage.bind(this); }; window.WebPirate_MessageListenerObject.prototype.onMessage = function(message) { var obj = JSON.parse(message.data); var data = obj.data; if(obj.type === "readermodehandler_enable") WebPirate_ReaderModeHandler.switchMode(true); }; window.WebPirate_MessageListener = new window.WebPirate_MessageListenerObject();
Maledictus/LinksBag
qml/pages/helpers/MessageListener.js
JavaScript
mit
448
// // KXHttpResponse.h // HttpExample // // Created by yang yue on 14-2-11. // Copyright (c) 2014年 zhangpeihao. All rights reserved. // #import <Foundation/Foundation.h> extern NSString * const HTTPTokenInvalidNotification; @interface KXHttpResponse : NSObject @property (nonatomic,assign) NSInteger ret; @property (nonatomic, copy) NSString *msg; @property (nonatomic, strong) NSObject *data; @property (nonatomic, strong) NSObject *get; @property (nonatomic,strong) NSDictionary *filesDic; @property (nonatomic,strong) NSDictionary *fieldsDic; @property (nonatomic,strong) NSDictionary *userInfo; @property (nonatomic,strong) NSDictionary *requestInfo; @end
yyn1110/net
Net/KXHttpResponse.h
C
mit
685
<<<<<<< HEAD <<<<<<< HEAD """distutils.command.build_py Implements the Distutils 'build_py' command.""" import os import importlib.util import sys from glob import glob from distutils.core import Command from distutils.errors import * from distutils.util import convert_path, Mixin2to3 from distutils import log class build_py (Command): description = "\"build\" pure Python modules (copy to build directory)" user_options = [ ('build-lib=', 'd', "directory to \"build\" (copy) to"), ('compile', 'c', "compile .py to .pyc"), ('no-compile', None, "don't compile .py files [default]"), ('optimize=', 'O', "also compile with optimization: -O1 for \"python -O\", " "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), ('force', 'f', "forcibly build everything (ignore file timestamps)"), ] boolean_options = ['compile', 'force'] negative_opt = {'no-compile' : 'compile'} def initialize_options(self): self.build_lib = None self.py_modules = None self.package = None self.package_data = None self.package_dir = None self.compile = 0 self.optimize = 0 self.force = None def finalize_options(self): self.set_undefined_options('build', ('build_lib', 'build_lib'), ('force', 'force')) # Get the distribution options that are aliases for build_py # options -- list of packages and list of modules. self.packages = self.distribution.packages self.py_modules = self.distribution.py_modules self.package_data = self.distribution.package_data self.package_dir = {} if self.distribution.package_dir: for name, path in self.distribution.package_dir.items(): self.package_dir[name] = convert_path(path) self.data_files = self.get_data_files() # Ick, copied straight from install_lib.py (fancy_getopt needs a # type system! Hell, *everything* needs a type system!!!) if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) assert 0 <= self.optimize <= 2 except (ValueError, AssertionError): raise DistutilsOptionError("optimize must be 0, 1, or 2") def run(self): # XXX copy_file by default preserves atime and mtime. IMHO this is # the right thing to do, but perhaps it should be an option -- in # particular, a site administrator might want installed files to # reflect the time of installation rather than the last # modification time before the installed release. # XXX copy_file by default preserves mode, which appears to be the # wrong thing to do: if a file is read-only in the working # directory, we want it to be installed read/write so that the next # installation of the same module distribution can overwrite it # without problems. (This might be a Unix-specific issue.) Thus # we turn off 'preserve_mode' when copying to the build directory, # since the build directory is supposed to be exactly what the # installation will look like (ie. we preserve mode when # installing). # Two options control which modules will be installed: 'packages' # and 'py_modules'. The former lets us work with whole packages, not # specifying individual modules at all; the latter is for # specifying modules one-at-a-time. if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_data() self.byte_compile(self.get_outputs(include_bytecode=0)) def get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" data = [] if not self.packages: return data for package in self.packages: # Locate package source directory src_dir = self.get_package_dir(package) # Compute package build directory build_dir = os.path.join(*([self.build_lib] + package.split('.'))) # Length of path to strip from found files plen = 0 if src_dir: plen = len(src_dir)+1 # Strip directory from globbed filenames filenames = [ file[plen:] for file in self.find_data_files(package, src_dir) ] data.append((package, src_dir, build_dir, filenames)) return data def find_data_files(self, package, src_dir): """Return filenames for package's data files in 'src_dir'""" globs = (self.package_data.get('', []) + self.package_data.get(package, [])) files = [] for pattern in globs: # Each pattern has to be converted to a platform-specific path filelist = glob(os.path.join(src_dir, convert_path(pattern))) # Files that match more than one pattern are only added once files.extend([fn for fn in filelist if fn not in files and os.path.isfile(fn)]) return files def build_package_data(self): """Copy data files into build directory""" lastdir = None for package, src_dir, build_dir, filenames in self.data_files: for filename in filenames: target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(target)) self.copy_file(os.path.join(src_dir, filename), target, preserve_mode=False) def get_package_dir(self, package): """Return the directory, relative to the top of the source distribution, where package 'package' should be found (at least according to the 'package_dir' option, if any).""" path = package.split('.') if not self.package_dir: if path: return os.path.join(*path) else: return '' else: tail = [] while path: try: pdir = self.package_dir['.'.join(path)] except KeyError: tail.insert(0, path[-1]) del path[-1] else: tail.insert(0, pdir) return os.path.join(*tail) else: # Oops, got all the way through 'path' without finding a # match in package_dir. If package_dir defines a directory # for the root (nameless) package, then fallback on it; # otherwise, we might as well have not consulted # package_dir at all, as we just use the directory implied # by 'tail' (which should be the same as the original value # of 'path' at this point). pdir = self.package_dir.get('') if pdir is not None: tail.insert(0, pdir) if tail: return os.path.join(*tail) else: return '' def check_package(self, package, package_dir): # Empty dir name means current directory, which we can probably # assume exists. Also, os.path.exists and isdir don't know about # my "empty string means current dir" convention, so we have to # circumvent them. if package_dir != "": if not os.path.exists(package_dir): raise DistutilsFileError( "package directory '%s' does not exist" % package_dir) if not os.path.isdir(package_dir): raise DistutilsFileError( "supposed package directory '%s' exists, " "but is not a directory" % package_dir) # Require __init__.py for all but the "root package" if package: init_py = os.path.join(package_dir, "__init__.py") if os.path.isfile(init_py): return init_py else: log.warn(("package init file '%s' not found " + "(or not a regular file)"), init_py) # Either not in a package at all (__init__.py not expected), or # __init__.py doesn't exist -- so don't return the filename. return None def check_module(self, module, module_file): if not os.path.isfile(module_file): log.warn("file %s (for module %s) not found", module_file, module) return False else: return True def find_package_modules(self, package, package_dir): self.check_package(package, package_dir) module_files = glob(os.path.join(package_dir, "*.py")) modules = [] setup_script = os.path.abspath(self.distribution.script_name) for f in module_files: abs_f = os.path.abspath(f) if abs_f != setup_script: module = os.path.splitext(os.path.basename(f))[0] modules.append((package, module, f)) else: self.debug_print("excluding %s" % setup_script) return modules def find_modules(self): """Finds individually-specified Python modules, ie. those listed by module name in 'self.py_modules'. Returns a list of tuples (package, module_base, filename): 'package' is a tuple of the path through package-space to the module; 'module_base' is the bare (no packages, no dots) module name, and 'filename' is the path to the ".py" file (relative to the distribution root) that implements the module. """ # Map package names to tuples of useful info about the package: # (package_dir, checked) # package_dir - the directory where we'll find source files for # this package # checked - true if we have checked that the package directory # is valid (exists, contains __init__.py, ... ?) packages = {} # List of (package, module, filename) tuples to return modules = [] # We treat modules-in-packages almost the same as toplevel modules, # just the "package" for a toplevel is empty (either an empty # string or empty list, depending on context). Differences: # - don't check for __init__.py in directory for empty package for module in self.py_modules: path = module.split('.') package = '.'.join(path[0:-1]) module_base = path[-1] try: (package_dir, checked) = packages[package] except KeyError: package_dir = self.get_package_dir(package) checked = 0 if not checked: init_py = self.check_package(package, package_dir) packages[package] = (package_dir, 1) if init_py: modules.append((package, "__init__", init_py)) # XXX perhaps we should also check for just .pyc files # (so greedy closed-source bastards can distribute Python # modules too) module_file = os.path.join(package_dir, module_base + ".py") if not self.check_module(module, module_file): continue modules.append((package, module_base, module_file)) return modules def find_all_modules(self): """Compute the list of all modules that will be built, whether they are specified one-module-at-a-time ('self.py_modules') or by whole packages ('self.packages'). Return a list of tuples (package, module, module_file), just like 'find_modules()' and 'find_package_modules()' do.""" modules = [] if self.py_modules: modules.extend(self.find_modules()) if self.packages: for package in self.packages: package_dir = self.get_package_dir(package) m = self.find_package_modules(package, package_dir) modules.extend(m) return modules def get_source_files(self): return [module[-1] for module in self.find_all_modules()] def get_module_outfile(self, build_dir, package, module): outfile_path = [build_dir] + list(package) + [module + ".py"] return os.path.join(*outfile_path) def get_outputs(self, include_bytecode=1): modules = self.find_all_modules() outputs = [] for (package, module, module_file) in modules: package = package.split('.') filename = self.get_module_outfile(self.build_lib, package, module) outputs.append(filename) if include_bytecode: if self.compile: outputs.append(importlib.util.cache_from_source( filename, debug_override=True)) if self.optimize > 0: outputs.append(importlib.util.cache_from_source( filename, debug_override=False)) outputs += [ os.path.join(build_dir, filename) for package, src_dir, build_dir, filenames in self.data_files for filename in filenames ] return outputs def build_module(self, module, module_file, package): if isinstance(package, str): package = package.split('.') elif not isinstance(package, (list, tuple)): raise TypeError( "'package' must be a string (dot-separated), list, or tuple") # Now put the module source file into the "build" area -- this is # easy, we just copy it somewhere under self.build_lib (the build # directory for Python source). outfile = self.get_module_outfile(self.build_lib, package, module) dir = os.path.dirname(outfile) self.mkpath(dir) return self.copy_file(module_file, outfile, preserve_mode=0) def build_modules(self): modules = self.find_modules() for (package, module, module_file) in modules: # Now "build" the module -- ie. copy the source file to # self.build_lib (the build directory for Python source). # (Actually, it gets copied to the directory for this package # under self.build_lib.) self.build_module(module, module_file, package) def build_packages(self): for package in self.packages: # Get list of (package, module, module_file) tuples based on # scanning the package directory. 'package' is only included # in the tuple so that 'find_modules()' and # 'find_package_tuples()' have a consistent interface; it's # ignored here (apart from a sanity check). Also, 'module' is # the *unqualified* module name (ie. no dots, no package -- we # already know its package!), and 'module_file' is the path to # the .py file, relative to the current directory # (ie. including 'package_dir'). package_dir = self.get_package_dir(package) modules = self.find_package_modules(package, package_dir) # Now loop over the modules we found, "building" each one (just # copy it to self.build_lib). for (package_, module, module_file) in modules: assert package == package_ self.build_module(module, module_file, package) def byte_compile(self, files): if sys.dont_write_bytecode: self.warn('byte-compiling is disabled, skipping.') return from distutils.util import byte_compile prefix = self.build_lib if prefix[-1] != os.sep: prefix = prefix + os.sep # XXX this code is essentially the same as the 'byte_compile() # method of the "install_lib" command, except for the determination # of the 'prefix' string. Hmmm. if self.compile: byte_compile(files, optimize=0, force=self.force, prefix=prefix, dry_run=self.dry_run) if self.optimize > 0: byte_compile(files, optimize=self.optimize, force=self.force, prefix=prefix, dry_run=self.dry_run) class build_py_2to3(build_py, Mixin2to3): def run(self): self.updated_files = [] # Base class code if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_data() # 2to3 self.run_2to3(self.updated_files) # Remaining base class code self.byte_compile(self.get_outputs(include_bytecode=0)) def build_module(self, module, module_file, package): res = build_py.build_module(self, module, module_file, package) if res[1]: # file was copied self.updated_files.append(res[0]) return res ======= """distutils.command.build_py Implements the Distutils 'build_py' command.""" import os import importlib.util import sys from glob import glob from distutils.core import Command from distutils.errors import * from distutils.util import convert_path, Mixin2to3 from distutils import log class build_py (Command): description = "\"build\" pure Python modules (copy to build directory)" user_options = [ ('build-lib=', 'd', "directory to \"build\" (copy) to"), ('compile', 'c', "compile .py to .pyc"), ('no-compile', None, "don't compile .py files [default]"), ('optimize=', 'O', "also compile with optimization: -O1 for \"python -O\", " "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), ('force', 'f', "forcibly build everything (ignore file timestamps)"), ] boolean_options = ['compile', 'force'] negative_opt = {'no-compile' : 'compile'} def initialize_options(self): self.build_lib = None self.py_modules = None self.package = None self.package_data = None self.package_dir = None self.compile = 0 self.optimize = 0 self.force = None def finalize_options(self): self.set_undefined_options('build', ('build_lib', 'build_lib'), ('force', 'force')) # Get the distribution options that are aliases for build_py # options -- list of packages and list of modules. self.packages = self.distribution.packages self.py_modules = self.distribution.py_modules self.package_data = self.distribution.package_data self.package_dir = {} if self.distribution.package_dir: for name, path in self.distribution.package_dir.items(): self.package_dir[name] = convert_path(path) self.data_files = self.get_data_files() # Ick, copied straight from install_lib.py (fancy_getopt needs a # type system! Hell, *everything* needs a type system!!!) if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) assert 0 <= self.optimize <= 2 except (ValueError, AssertionError): raise DistutilsOptionError("optimize must be 0, 1, or 2") def run(self): # XXX copy_file by default preserves atime and mtime. IMHO this is # the right thing to do, but perhaps it should be an option -- in # particular, a site administrator might want installed files to # reflect the time of installation rather than the last # modification time before the installed release. # XXX copy_file by default preserves mode, which appears to be the # wrong thing to do: if a file is read-only in the working # directory, we want it to be installed read/write so that the next # installation of the same module distribution can overwrite it # without problems. (This might be a Unix-specific issue.) Thus # we turn off 'preserve_mode' when copying to the build directory, # since the build directory is supposed to be exactly what the # installation will look like (ie. we preserve mode when # installing). # Two options control which modules will be installed: 'packages' # and 'py_modules'. The former lets us work with whole packages, not # specifying individual modules at all; the latter is for # specifying modules one-at-a-time. if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_data() self.byte_compile(self.get_outputs(include_bytecode=0)) def get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" data = [] if not self.packages: return data for package in self.packages: # Locate package source directory src_dir = self.get_package_dir(package) # Compute package build directory build_dir = os.path.join(*([self.build_lib] + package.split('.'))) # Length of path to strip from found files plen = 0 if src_dir: plen = len(src_dir)+1 # Strip directory from globbed filenames filenames = [ file[plen:] for file in self.find_data_files(package, src_dir) ] data.append((package, src_dir, build_dir, filenames)) return data def find_data_files(self, package, src_dir): """Return filenames for package's data files in 'src_dir'""" globs = (self.package_data.get('', []) + self.package_data.get(package, [])) files = [] for pattern in globs: # Each pattern has to be converted to a platform-specific path filelist = glob(os.path.join(src_dir, convert_path(pattern))) # Files that match more than one pattern are only added once files.extend([fn for fn in filelist if fn not in files and os.path.isfile(fn)]) return files def build_package_data(self): """Copy data files into build directory""" lastdir = None for package, src_dir, build_dir, filenames in self.data_files: for filename in filenames: target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(target)) self.copy_file(os.path.join(src_dir, filename), target, preserve_mode=False) def get_package_dir(self, package): """Return the directory, relative to the top of the source distribution, where package 'package' should be found (at least according to the 'package_dir' option, if any).""" path = package.split('.') if not self.package_dir: if path: return os.path.join(*path) else: return '' else: tail = [] while path: try: pdir = self.package_dir['.'.join(path)] except KeyError: tail.insert(0, path[-1]) del path[-1] else: tail.insert(0, pdir) return os.path.join(*tail) else: # Oops, got all the way through 'path' without finding a # match in package_dir. If package_dir defines a directory # for the root (nameless) package, then fallback on it; # otherwise, we might as well have not consulted # package_dir at all, as we just use the directory implied # by 'tail' (which should be the same as the original value # of 'path' at this point). pdir = self.package_dir.get('') if pdir is not None: tail.insert(0, pdir) if tail: return os.path.join(*tail) else: return '' def check_package(self, package, package_dir): # Empty dir name means current directory, which we can probably # assume exists. Also, os.path.exists and isdir don't know about # my "empty string means current dir" convention, so we have to # circumvent them. if package_dir != "": if not os.path.exists(package_dir): raise DistutilsFileError( "package directory '%s' does not exist" % package_dir) if not os.path.isdir(package_dir): raise DistutilsFileError( "supposed package directory '%s' exists, " "but is not a directory" % package_dir) # Require __init__.py for all but the "root package" if package: init_py = os.path.join(package_dir, "__init__.py") if os.path.isfile(init_py): return init_py else: log.warn(("package init file '%s' not found " + "(or not a regular file)"), init_py) # Either not in a package at all (__init__.py not expected), or # __init__.py doesn't exist -- so don't return the filename. return None def check_module(self, module, module_file): if not os.path.isfile(module_file): log.warn("file %s (for module %s) not found", module_file, module) return False else: return True def find_package_modules(self, package, package_dir): self.check_package(package, package_dir) module_files = glob(os.path.join(package_dir, "*.py")) modules = [] setup_script = os.path.abspath(self.distribution.script_name) for f in module_files: abs_f = os.path.abspath(f) if abs_f != setup_script: module = os.path.splitext(os.path.basename(f))[0] modules.append((package, module, f)) else: self.debug_print("excluding %s" % setup_script) return modules def find_modules(self): """Finds individually-specified Python modules, ie. those listed by module name in 'self.py_modules'. Returns a list of tuples (package, module_base, filename): 'package' is a tuple of the path through package-space to the module; 'module_base' is the bare (no packages, no dots) module name, and 'filename' is the path to the ".py" file (relative to the distribution root) that implements the module. """ # Map package names to tuples of useful info about the package: # (package_dir, checked) # package_dir - the directory where we'll find source files for # this package # checked - true if we have checked that the package directory # is valid (exists, contains __init__.py, ... ?) packages = {} # List of (package, module, filename) tuples to return modules = [] # We treat modules-in-packages almost the same as toplevel modules, # just the "package" for a toplevel is empty (either an empty # string or empty list, depending on context). Differences: # - don't check for __init__.py in directory for empty package for module in self.py_modules: path = module.split('.') package = '.'.join(path[0:-1]) module_base = path[-1] try: (package_dir, checked) = packages[package] except KeyError: package_dir = self.get_package_dir(package) checked = 0 if not checked: init_py = self.check_package(package, package_dir) packages[package] = (package_dir, 1) if init_py: modules.append((package, "__init__", init_py)) # XXX perhaps we should also check for just .pyc files # (so greedy closed-source bastards can distribute Python # modules too) module_file = os.path.join(package_dir, module_base + ".py") if not self.check_module(module, module_file): continue modules.append((package, module_base, module_file)) return modules def find_all_modules(self): """Compute the list of all modules that will be built, whether they are specified one-module-at-a-time ('self.py_modules') or by whole packages ('self.packages'). Return a list of tuples (package, module, module_file), just like 'find_modules()' and 'find_package_modules()' do.""" modules = [] if self.py_modules: modules.extend(self.find_modules()) if self.packages: for package in self.packages: package_dir = self.get_package_dir(package) m = self.find_package_modules(package, package_dir) modules.extend(m) return modules def get_source_files(self): return [module[-1] for module in self.find_all_modules()] def get_module_outfile(self, build_dir, package, module): outfile_path = [build_dir] + list(package) + [module + ".py"] return os.path.join(*outfile_path) def get_outputs(self, include_bytecode=1): modules = self.find_all_modules() outputs = [] for (package, module, module_file) in modules: package = package.split('.') filename = self.get_module_outfile(self.build_lib, package, module) outputs.append(filename) if include_bytecode: if self.compile: outputs.append(importlib.util.cache_from_source( filename, debug_override=True)) if self.optimize > 0: outputs.append(importlib.util.cache_from_source( filename, debug_override=False)) outputs += [ os.path.join(build_dir, filename) for package, src_dir, build_dir, filenames in self.data_files for filename in filenames ] return outputs def build_module(self, module, module_file, package): if isinstance(package, str): package = package.split('.') elif not isinstance(package, (list, tuple)): raise TypeError( "'package' must be a string (dot-separated), list, or tuple") # Now put the module source file into the "build" area -- this is # easy, we just copy it somewhere under self.build_lib (the build # directory for Python source). outfile = self.get_module_outfile(self.build_lib, package, module) dir = os.path.dirname(outfile) self.mkpath(dir) return self.copy_file(module_file, outfile, preserve_mode=0) def build_modules(self): modules = self.find_modules() for (package, module, module_file) in modules: # Now "build" the module -- ie. copy the source file to # self.build_lib (the build directory for Python source). # (Actually, it gets copied to the directory for this package # under self.build_lib.) self.build_module(module, module_file, package) def build_packages(self): for package in self.packages: # Get list of (package, module, module_file) tuples based on # scanning the package directory. 'package' is only included # in the tuple so that 'find_modules()' and # 'find_package_tuples()' have a consistent interface; it's # ignored here (apart from a sanity check). Also, 'module' is # the *unqualified* module name (ie. no dots, no package -- we # already know its package!), and 'module_file' is the path to # the .py file, relative to the current directory # (ie. including 'package_dir'). package_dir = self.get_package_dir(package) modules = self.find_package_modules(package, package_dir) # Now loop over the modules we found, "building" each one (just # copy it to self.build_lib). for (package_, module, module_file) in modules: assert package == package_ self.build_module(module, module_file, package) def byte_compile(self, files): if sys.dont_write_bytecode: self.warn('byte-compiling is disabled, skipping.') return from distutils.util import byte_compile prefix = self.build_lib if prefix[-1] != os.sep: prefix = prefix + os.sep # XXX this code is essentially the same as the 'byte_compile() # method of the "install_lib" command, except for the determination # of the 'prefix' string. Hmmm. if self.compile: byte_compile(files, optimize=0, force=self.force, prefix=prefix, dry_run=self.dry_run) if self.optimize > 0: byte_compile(files, optimize=self.optimize, force=self.force, prefix=prefix, dry_run=self.dry_run) class build_py_2to3(build_py, Mixin2to3): def run(self): self.updated_files = [] # Base class code if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_data() # 2to3 self.run_2to3(self.updated_files) # Remaining base class code self.byte_compile(self.get_outputs(include_bytecode=0)) def build_module(self, module, module_file, package): res = build_py.build_module(self, module, module_file, package) if res[1]: # file was copied self.updated_files.append(res[0]) return res >>>>>>> b875702c9c06ab5012e52ff4337439b03918f453 ======= """distutils.command.build_py Implements the Distutils 'build_py' command.""" import os import importlib.util import sys from glob import glob from distutils.core import Command from distutils.errors import * from distutils.util import convert_path, Mixin2to3 from distutils import log class build_py (Command): description = "\"build\" pure Python modules (copy to build directory)" user_options = [ ('build-lib=', 'd', "directory to \"build\" (copy) to"), ('compile', 'c', "compile .py to .pyc"), ('no-compile', None, "don't compile .py files [default]"), ('optimize=', 'O', "also compile with optimization: -O1 for \"python -O\", " "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"), ('force', 'f', "forcibly build everything (ignore file timestamps)"), ] boolean_options = ['compile', 'force'] negative_opt = {'no-compile' : 'compile'} def initialize_options(self): self.build_lib = None self.py_modules = None self.package = None self.package_data = None self.package_dir = None self.compile = 0 self.optimize = 0 self.force = None def finalize_options(self): self.set_undefined_options('build', ('build_lib', 'build_lib'), ('force', 'force')) # Get the distribution options that are aliases for build_py # options -- list of packages and list of modules. self.packages = self.distribution.packages self.py_modules = self.distribution.py_modules self.package_data = self.distribution.package_data self.package_dir = {} if self.distribution.package_dir: for name, path in self.distribution.package_dir.items(): self.package_dir[name] = convert_path(path) self.data_files = self.get_data_files() # Ick, copied straight from install_lib.py (fancy_getopt needs a # type system! Hell, *everything* needs a type system!!!) if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) assert 0 <= self.optimize <= 2 except (ValueError, AssertionError): raise DistutilsOptionError("optimize must be 0, 1, or 2") def run(self): # XXX copy_file by default preserves atime and mtime. IMHO this is # the right thing to do, but perhaps it should be an option -- in # particular, a site administrator might want installed files to # reflect the time of installation rather than the last # modification time before the installed release. # XXX copy_file by default preserves mode, which appears to be the # wrong thing to do: if a file is read-only in the working # directory, we want it to be installed read/write so that the next # installation of the same module distribution can overwrite it # without problems. (This might be a Unix-specific issue.) Thus # we turn off 'preserve_mode' when copying to the build directory, # since the build directory is supposed to be exactly what the # installation will look like (ie. we preserve mode when # installing). # Two options control which modules will be installed: 'packages' # and 'py_modules'. The former lets us work with whole packages, not # specifying individual modules at all; the latter is for # specifying modules one-at-a-time. if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_data() self.byte_compile(self.get_outputs(include_bytecode=0)) def get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" data = [] if not self.packages: return data for package in self.packages: # Locate package source directory src_dir = self.get_package_dir(package) # Compute package build directory build_dir = os.path.join(*([self.build_lib] + package.split('.'))) # Length of path to strip from found files plen = 0 if src_dir: plen = len(src_dir)+1 # Strip directory from globbed filenames filenames = [ file[plen:] for file in self.find_data_files(package, src_dir) ] data.append((package, src_dir, build_dir, filenames)) return data def find_data_files(self, package, src_dir): """Return filenames for package's data files in 'src_dir'""" globs = (self.package_data.get('', []) + self.package_data.get(package, [])) files = [] for pattern in globs: # Each pattern has to be converted to a platform-specific path filelist = glob(os.path.join(src_dir, convert_path(pattern))) # Files that match more than one pattern are only added once files.extend([fn for fn in filelist if fn not in files and os.path.isfile(fn)]) return files def build_package_data(self): """Copy data files into build directory""" lastdir = None for package, src_dir, build_dir, filenames in self.data_files: for filename in filenames: target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(target)) self.copy_file(os.path.join(src_dir, filename), target, preserve_mode=False) def get_package_dir(self, package): """Return the directory, relative to the top of the source distribution, where package 'package' should be found (at least according to the 'package_dir' option, if any).""" path = package.split('.') if not self.package_dir: if path: return os.path.join(*path) else: return '' else: tail = [] while path: try: pdir = self.package_dir['.'.join(path)] except KeyError: tail.insert(0, path[-1]) del path[-1] else: tail.insert(0, pdir) return os.path.join(*tail) else: # Oops, got all the way through 'path' without finding a # match in package_dir. If package_dir defines a directory # for the root (nameless) package, then fallback on it; # otherwise, we might as well have not consulted # package_dir at all, as we just use the directory implied # by 'tail' (which should be the same as the original value # of 'path' at this point). pdir = self.package_dir.get('') if pdir is not None: tail.insert(0, pdir) if tail: return os.path.join(*tail) else: return '' def check_package(self, package, package_dir): # Empty dir name means current directory, which we can probably # assume exists. Also, os.path.exists and isdir don't know about # my "empty string means current dir" convention, so we have to # circumvent them. if package_dir != "": if not os.path.exists(package_dir): raise DistutilsFileError( "package directory '%s' does not exist" % package_dir) if not os.path.isdir(package_dir): raise DistutilsFileError( "supposed package directory '%s' exists, " "but is not a directory" % package_dir) # Require __init__.py for all but the "root package" if package: init_py = os.path.join(package_dir, "__init__.py") if os.path.isfile(init_py): return init_py else: log.warn(("package init file '%s' not found " + "(or not a regular file)"), init_py) # Either not in a package at all (__init__.py not expected), or # __init__.py doesn't exist -- so don't return the filename. return None def check_module(self, module, module_file): if not os.path.isfile(module_file): log.warn("file %s (for module %s) not found", module_file, module) return False else: return True def find_package_modules(self, package, package_dir): self.check_package(package, package_dir) module_files = glob(os.path.join(package_dir, "*.py")) modules = [] setup_script = os.path.abspath(self.distribution.script_name) for f in module_files: abs_f = os.path.abspath(f) if abs_f != setup_script: module = os.path.splitext(os.path.basename(f))[0] modules.append((package, module, f)) else: self.debug_print("excluding %s" % setup_script) return modules def find_modules(self): """Finds individually-specified Python modules, ie. those listed by module name in 'self.py_modules'. Returns a list of tuples (package, module_base, filename): 'package' is a tuple of the path through package-space to the module; 'module_base' is the bare (no packages, no dots) module name, and 'filename' is the path to the ".py" file (relative to the distribution root) that implements the module. """ # Map package names to tuples of useful info about the package: # (package_dir, checked) # package_dir - the directory where we'll find source files for # this package # checked - true if we have checked that the package directory # is valid (exists, contains __init__.py, ... ?) packages = {} # List of (package, module, filename) tuples to return modules = [] # We treat modules-in-packages almost the same as toplevel modules, # just the "package" for a toplevel is empty (either an empty # string or empty list, depending on context). Differences: # - don't check for __init__.py in directory for empty package for module in self.py_modules: path = module.split('.') package = '.'.join(path[0:-1]) module_base = path[-1] try: (package_dir, checked) = packages[package] except KeyError: package_dir = self.get_package_dir(package) checked = 0 if not checked: init_py = self.check_package(package, package_dir) packages[package] = (package_dir, 1) if init_py: modules.append((package, "__init__", init_py)) # XXX perhaps we should also check for just .pyc files # (so greedy closed-source bastards can distribute Python # modules too) module_file = os.path.join(package_dir, module_base + ".py") if not self.check_module(module, module_file): continue modules.append((package, module_base, module_file)) return modules def find_all_modules(self): """Compute the list of all modules that will be built, whether they are specified one-module-at-a-time ('self.py_modules') or by whole packages ('self.packages'). Return a list of tuples (package, module, module_file), just like 'find_modules()' and 'find_package_modules()' do.""" modules = [] if self.py_modules: modules.extend(self.find_modules()) if self.packages: for package in self.packages: package_dir = self.get_package_dir(package) m = self.find_package_modules(package, package_dir) modules.extend(m) return modules def get_source_files(self): return [module[-1] for module in self.find_all_modules()] def get_module_outfile(self, build_dir, package, module): outfile_path = [build_dir] + list(package) + [module + ".py"] return os.path.join(*outfile_path) def get_outputs(self, include_bytecode=1): modules = self.find_all_modules() outputs = [] for (package, module, module_file) in modules: package = package.split('.') filename = self.get_module_outfile(self.build_lib, package, module) outputs.append(filename) if include_bytecode: if self.compile: outputs.append(importlib.util.cache_from_source( filename, debug_override=True)) if self.optimize > 0: outputs.append(importlib.util.cache_from_source( filename, debug_override=False)) outputs += [ os.path.join(build_dir, filename) for package, src_dir, build_dir, filenames in self.data_files for filename in filenames ] return outputs def build_module(self, module, module_file, package): if isinstance(package, str): package = package.split('.') elif not isinstance(package, (list, tuple)): raise TypeError( "'package' must be a string (dot-separated), list, or tuple") # Now put the module source file into the "build" area -- this is # easy, we just copy it somewhere under self.build_lib (the build # directory for Python source). outfile = self.get_module_outfile(self.build_lib, package, module) dir = os.path.dirname(outfile) self.mkpath(dir) return self.copy_file(module_file, outfile, preserve_mode=0) def build_modules(self): modules = self.find_modules() for (package, module, module_file) in modules: # Now "build" the module -- ie. copy the source file to # self.build_lib (the build directory for Python source). # (Actually, it gets copied to the directory for this package # under self.build_lib.) self.build_module(module, module_file, package) def build_packages(self): for package in self.packages: # Get list of (package, module, module_file) tuples based on # scanning the package directory. 'package' is only included # in the tuple so that 'find_modules()' and # 'find_package_tuples()' have a consistent interface; it's # ignored here (apart from a sanity check). Also, 'module' is # the *unqualified* module name (ie. no dots, no package -- we # already know its package!), and 'module_file' is the path to # the .py file, relative to the current directory # (ie. including 'package_dir'). package_dir = self.get_package_dir(package) modules = self.find_package_modules(package, package_dir) # Now loop over the modules we found, "building" each one (just # copy it to self.build_lib). for (package_, module, module_file) in modules: assert package == package_ self.build_module(module, module_file, package) def byte_compile(self, files): if sys.dont_write_bytecode: self.warn('byte-compiling is disabled, skipping.') return from distutils.util import byte_compile prefix = self.build_lib if prefix[-1] != os.sep: prefix = prefix + os.sep # XXX this code is essentially the same as the 'byte_compile() # method of the "install_lib" command, except for the determination # of the 'prefix' string. Hmmm. if self.compile: byte_compile(files, optimize=0, force=self.force, prefix=prefix, dry_run=self.dry_run) if self.optimize > 0: byte_compile(files, optimize=self.optimize, force=self.force, prefix=prefix, dry_run=self.dry_run) class build_py_2to3(build_py, Mixin2to3): def run(self): self.updated_files = [] # Base class code if self.py_modules: self.build_modules() if self.packages: self.build_packages() self.build_package_data() # 2to3 self.run_2to3(self.updated_files) # Remaining base class code self.byte_compile(self.get_outputs(include_bytecode=0)) def build_module(self, module, module_file, package): res = build_py.build_module(self, module, module_file, package) if res[1]: # file was copied self.updated_files.append(res[0]) return res >>>>>>> b875702c9c06ab5012e52ff4337439b03918f453
ArcherSys/ArcherSys
Lib/distutils/command/build_py.py
Python
mit
51,626
describe Match do describe Match::Runner do let(:keychain) { 'login.keychain' } before do allow(ENV).to receive(:[]).and_call_original allow(ENV).to receive(:[]).with('MATCH_KEYCHAIN_NAME').and_return(keychain) allow(ENV).to receive(:[]).with('MATCH_KEYCHAIN_PASSWORD').and_return(nil) end it "creates a new profile and certificate if it doesn't exist yet", requires_security: true do git_url = "https://github.com/fastlane/fastlane/tree/master/certificates" values = { app_identifier: "tools.fastlane.app", type: "appstore", git_url: git_url, shallow_clone: true } config = FastlaneCore::Configuration.create(Match::Options.available_options, values) repo_dir = Dir.mktmpdir cert_path = File.join(repo_dir, "something.cer") profile_path = "./match/spec/fixtures/test.mobileprovision" destination = File.expand_path("~/Library/MobileDevice/Provisioning Profiles/98264c6b-5151-4349-8d0f-66691e48ae35.mobileprovision") expect(Match::GitHelper).to receive(:clone).with(git_url, true, skip_docs: false, branch: "master", git_full_name: nil, git_user_email: nil, clone_branch_directly: false).and_return(repo_dir) expect(Match::Generator).to receive(:generate_certificate).with(config, :distribution).and_return(cert_path) expect(Match::Generator).to receive(:generate_provisioning_profile).with(params: config, prov_type: :appstore, certificate_id: "something", app_identifier: values[:app_identifier]).and_return(profile_path) expect(FastlaneCore::ProvisioningProfile).to receive(:install).with(profile_path).and_return(destination) expect(Match::GitHelper).to receive(:commit_changes).with( repo_dir, "[fastlane] Updated appstore and platform ios", git_url, "master", [ File.join(repo_dir, "something.cer"), File.join(repo_dir, "something.p12"), # this is important, as a cert consists out of 2 files "./match/spec/fixtures/test.mobileprovision" ] ) spaceship = "spaceship" expect(Match::SpaceshipEnsure).to receive(:new).and_return(spaceship) expect(spaceship).to receive(:certificate_exists).and_return(true) expect(spaceship).to receive(:profile_exists).and_return(true) expect(spaceship).to receive(:bundle_identifier_exists).and_return(true) Match::Runner.new.run(config) expect(ENV[Match::Utils.environment_variable_name(app_identifier: "tools.fastlane.app", type: "appstore")]).to eql('98264c6b-5151-4349-8d0f-66691e48ae35') expect(ENV[Match::Utils.environment_variable_name_team_id(app_identifier: "tools.fastlane.app", type: "appstore")]).to eql('439BBM9367') expect(ENV[Match::Utils.environment_variable_name_profile_name(app_identifier: "tools.fastlane.app", type: "appstore")]).to eql('tools.fastlane.app AppStore') profile_path = File.expand_path('~/Library/MobileDevice/Provisioning Profiles/98264c6b-5151-4349-8d0f-66691e48ae35.mobileprovision') expect(ENV[Match::Utils.environment_variable_name_profile_path(app_identifier: "tools.fastlane.app", type: "appstore")]).to eql(profile_path) end it "uses existing certificates and profiles if they exist", requires_security: true do git_url = "https://github.com/fastlane/fastlane/tree/master/certificates" values = { app_identifier: "tools.fastlane.app", type: "appstore", git_url: git_url } config = FastlaneCore::Configuration.create(Match::Options.available_options, values) repo_dir = "./match/spec/fixtures/existing" cert_path = "./match/spec/fixtures/existing/certs/distribution/E7P4EE896K.cer" key_path = "./match/spec/fixtures/existing/certs/distribution/E7P4EE896K.p12" expect(Match::GitHelper).to receive(:clone).with(git_url, false, skip_docs: false, branch: "master", git_full_name: nil, git_user_email: nil, clone_branch_directly: false).and_return(repo_dir) expect(Match::Utils).to receive(:import).with(key_path, keychain, password: nil).and_return(nil) expect(Match::GitHelper).to_not receive(:commit_changes) # To also install the certificate, fake that expect(FastlaneCore::CertChecker).to receive(:installed?).with(cert_path).and_return(false) expect(Match::Utils).to receive(:import).with(cert_path, keychain, password: nil).and_return(nil) spaceship = "spaceship" expect(Match::SpaceshipEnsure).to receive(:new).and_return(spaceship) expect(spaceship).to receive(:certificate_exists).and_return(true) expect(spaceship).to receive(:profile_exists).and_return(true) expect(spaceship).to receive(:bundle_identifier_exists).and_return(true) Match::Runner.new.run(config) expect(ENV[Match::Utils.environment_variable_name(app_identifier: "tools.fastlane.app", type: "appstore")]).to eql('736590c3-dfe8-4c25-b2eb-2404b8e65fb8') expect(ENV[Match::Utils.environment_variable_name_team_id(app_identifier: "tools.fastlane.app", type: "appstore")]).to eql('439BBM9367') expect(ENV[Match::Utils.environment_variable_name_profile_name(app_identifier: "tools.fastlane.app", type: "appstore")]).to eql('match AppStore tools.fastlane.app 1449198835') profile_path = File.expand_path('~/Library/MobileDevice/Provisioning Profiles/736590c3-dfe8-4c25-b2eb-2404b8e65fb8.mobileprovision') expect(ENV[Match::Utils.environment_variable_name_profile_path(app_identifier: "tools.fastlane.app", type: "appstore")]).to eql(profile_path) end end end
hjanuschka/fastlane
match/spec/runner_spec.rb
Ruby
mit
6,329
## Next version (Unreleased) FEATURES: IMPROVEMENTS: BUG FIXES: ## 2.0.2 (January 29, 2018) FEATURES: - core: Provide mechanism for removing sensitive data from output [GH-9276] - core: Relax Ruby constraints to include 2.5 [GH-9363] - core: Hide sensitive values in output [GH-9369] - command/init: Support custom Vagrantfile templates [GH-9202] - guests: Add support for the Haiku operating system [GH-7805, GH-9245] - synced_folders/smb: Add support for macOS hosts [GH-9294] - vagrant-spec: Update vagrant-spec to include Windows platforms and updated linux boxes [GH-9183] IMPROVEMENTS: - config/ssh: Deprecate :paranoid in favor of :verify_host_key [GH-9341] - core: Add optional timestamp prefix on log output [GH-9269] - core: Print more helpful error message for NameEror exceptions in Vagrantfiles [GH-9252] - core: Update checkpoint implementation to announce updates and support notifications [GH-9380] - core: Use Ruby's Resolv by default [GH-9394] - docs: Include virtualbox 5.2.x as supported in docs [GH-9237] - docs: Improve how to pipe debug log on powershell [GH-9330] - guests/amazon: Improve guest detection [GH-9307] - guests/debian: Update guest configure networks [GH-9338] - guests/dragonflybsd: Base guest on FreeBSD to inherit more functionality [GH-9205] - guests/linux: Improve NFS service name detection and interactions [GH-9274] - guests/linux: Support mount option overrides for SMB mounts [GH-9366] - guests/linux: Use `ip` for reading guest address if available [GH-9315] - guests/solaris: Improve guest detection for alternatives [GH-9295] - hosts/windows: Check credentials during SMB prepare [GH-9365] - providers/hyper-v: Ensure Hyper-V cmdlets are fully qualified [GH-8863] - middleware/authentication: Add app.vagrantup.com to allowed hosts [GH-9145] - provisioners/shell: Support hiding environment variable values in output [GH-9367] - providers/virtualbox: Add a clean error message for invalid IP addresses [GH-9275] - providers/virtualbox: Introduce flag for SharedFoldersEnableSymlinksCreate setting [GH-9354] - providers/virtualbox: Provide warning for SharedFoldersEnableSymlinksCreate setting [GH-9389] - provisioners/salt: Fixes timeout issue in salt bootstrapping for windows [GH-8992] - synced_folders/smb: Update Windows implementation [GH-9294] - util/ssh: Attempt to locate local ssh client before attempting installer provided [GH-9400] BUG FIXES: - commands/box: Show all box providers with `update outdated --global` [GH-9347] - commands/destroy: Exit 0 if vagrant destroy finds no running vms [GH-9251] - commands/package: Fix --output path with specified folder [GH-9131] - guests/suse: Do not use full name when setting hostname [GH-9212] - providers/hyper-v: Fix enable virtualization extensions on import [GH-9255] - provisioners/ansible(both): Fix broken 'ask_sudo_pass' option [GH-9173] ## 2.0.1 (November 2, 2017) FEATURES: - core: Introduce Ruby 2.4 to Vagrant [GH-9102] - providers/virtualbox: Virtualbox 5.2 support [GH-8955] IMPROVEMENTS: - command/destroy: Introduce parallel destroy for certain providers [GH-9127] - communicators/winrm: Include APIPA check within ready check [GH-8997] - core: Clear POSIXLY_CORRECT when using optparse [GH-8685] - docs: Add auto_start_action and auto_stop_action to docs. [GH-9029] - docs: Fix typo in box format doc [GH-9100] - provisioners/chef: Handle chef provisioner reboot request [GH-8874] - providers/salt: Support Windows Salt Minions greater than 2016.x.x [GH-8926] - provisioners/salt: Add wget to bootstrap_salt options when fetching installer file [GH-9112] - provisioners/shell: Use ui.detail for displaying output [GH-8983] - util/downloader: Use CURL_CA_BUNDLE environment variable [GH-9135] BUG FIXES: - communicators/ssh: Retry on Errno::EPIPE exceptions [GH-9065] - core: Rescue more exceptions when checking if port is open [GH-8517] - guests/solaris11: Inherit from Solaris guest and keep solaris11 specific methods [GH-9034] - guests/windows: Split out cygwin path helper for msys2/cygwin paths and ensure cygpath exists [GH-8972] - guests/windows: Specify expected shell when executing on guest (fixes winssh communicator usage) [GH-9012] - guests/windows: Include WinSSH Communicator when using insert_public_key [GH-9105] - hosts/windows: Check for vagrant.exe when validating versions within WSL [GH-9107, GH-8962] - providers/docker: Isolate windows check within executor to handle running through VM [GH-8921] - providers/hyper-v: Properly invoke Auto stop action [GH-9000] - provisioners/puppet: Fix winssh communicator support in puppet provisioner [GH-9014] - virtualbox/synced_folders: Allow synced folders to contain spaces in the guest path [GH-8995] ## 2.0.0 (September 7, 2017) IMPROVEMENTS: - commands/login: Add support for two-factor authentication [GH-8935] - commands/ssh-config: Properly display windows path if invoked from msys2 or cygwin [GH-8915] - guests/alt: Add support for ALT Linux [GH-8746] - guests/kali: Fix file permissions on guest plugin ruby files [GH-8950] - hosts/linux: Provide common systemd detection for services interaction, fix NFS host interactions [GH-8938] - providers/salt: Remove duplicate stdout, stderr output from salt [GH-8767] - providers/salt: Introduce salt_call_args and salt_args option for salt provisioner [GH-8927] - providers/virtualbox: Improving resilience of some VirtualBox commands [GH-8951] - provisioners/ansible(both): Add the compatibility_mode option, with auto-detection enabled by default [GH-8913, GH-6570] - provisioners/ansible: Add the version option to the host-based provisioner [GH-8913, GH-8914] - provisioners/ansible(both): Add the become and become_user options with deprecation of sudo and sudo_user options [GH-8913, GH-6570] - provisioners/ansible: Add the ask_become_pass option with deprecation of the ask_sudo_pass option [GH-8913, GH-6570] BUG FIXES: - guests/shell_expand_guest_path : Properly expand guest paths that include relative path alias [GH-8918] - hosts/linux: Remove duplicate export folders before writing /etc/exports [GH-8945] - provisioners/ansible(both): Add single quotes to the inventory host variables, only when necessary [GH-8597] - provisioners/ansible(both): Add the "all:vars" section to the inventory when defined in `groups` option [GH-7730] - provisioners/ansible_local: Extra variables are no longer truncated when a dollar ($) character is present [GH-7735] - provisioners/file: Align file provisioner functionality on all platforms [GH-8939] - util/ssh: Properly quote key path for IdentityFile option to allow for spaces [GH-8924] BREAKING CHANGES: - Both Ansible provisioners are now capable of automatically setting the compatibility_mode that best fits with the Ansible version in use. You may encounter some compatibility issues when upgrading. If you were using Ansible 2.x and referring to the _ssh-prefixed variables present in the generated inventory (e.g. `ansible_ssh_host`). In this case, you can fix your Vagrant setup by setting compatibility_mode = "1.8", or by migrating to the new variable names (e.g. ansible_host). ## 1.9.8 (August 23, 2017) IMPROVEMENTS: - bash: Add box prune to contrib bash completion [GH-8806] - commands/login: Ask for description of Vagrant Cloud token [GH-8876] - commands/validate: Improve functionality of the validate command [GH-8889]n - core: Updated Vagrants rspec gem to 3.5.0 [GH-8850] - core: Validate powershell availability and version before use [GH-8839] - core: Introduce extra_args setting for ssh configs [GH-8895] - docs: Align contrib/sudoers file for ubuntu linux with docs [GH-8842] - provider/hyperv: Prefer IPv4 guest address [GH-8831, GH-8759] - provisioners/chef: Add config option omnibus_url for chef provisioners [GH-8682] - provisioners/chef: Improve exception handling around missing folder paths [GH-8775] BUG FIXES: - box/update: Add force flag for box upgrade command [GH-8871] - commands/rsync-auto: Ensure relative dirs are still rsync'd if defined [GH-8781] - commands/up: Disable install providers when using global id on vagrant up [GH-8910] - communicators/winssh: Fix public key insertion to retain ACL [GH-8790] - core: Update util/ssh to use `-o` for identity files [GH-8786] - guests/freebsd: Fix regex for listing network devices on some FreeBSD boxes. [GH-8760] - hosts/windows: Prevent control characters in version check for WSL [GH-8902, GH-8901] - providers/docker: Split String type links into Array when using compose [GH-8837, GH-8821] - providers/docker: Expand relative volume paths correctly [GH-8838, GH-8822] - providers/docker: Error when compose option enabled with force_host_vm [GH-8911] - provisioners/ansible: Update to use `-o` for identity files [GH-8786] - provisioners/file: Ensure remote folder exists prior to scp file or folder [GH-8880] - provisioners/salt: Fix error case when github is unreachable for installer [GH-8864] - provisioners/shell: Allow frozen string scripts [GH-8875] - provisioners/puppet: Remove `--manifestdir` flag from puppet apply in provisioner [GH-8797] - synced_folders/rsync: Correctly format IPv6 host [GH-8840, GH-8809] ## 1.9.7 (July 7, 2017) FEATURES: - core: Add support for preferred providers [GH-8558] IMPROVEMENTS: - guests/bsd: Invoke `tee` with explicit path [GH-8740] - guests/smartos: Guest updates for host name and nfs capabilities [GH-8695] - guests/windows: Add public key capabilities for WinSSH communicator [GH-8761] - hosts/windows: Log command exec encoding failures and use original string on failure [GH-8820] - providers/virtualbox: Filter machine IPs when preparing NFS settings [GH-8819] BUG FIXES: - communicators/winssh: Make script upload directory configurable [GH-8761] - core: Update cygwin detection to prevent PATH related errors [GH-8749, GH-6788] - core: Fix URI parsing of box names to prevent errors [GH-8762, GH-8758] - provider/docker: Only rsync-auto current working dir with docker provider [GH-8756] ## 1.9.6 (June 28, 2017) IMPROVEMENTS: - commands/snapshot: Enforce unique snapshot names and introduce `--force` flag [GH-7810] - commands/ssh: Introduce tty flag for `vagrant ssh -c` [GH-6827] - core: Warn about vagrant CWD changes for a machine [GH-3921] - core: Allow Compression and DSAAuthentication ssh flags to be configurable [GH-8693] - core/box: Warn if user sets box as url [GH-7118] - core/bundler: Enforce stict constraints on vendored libraries [GH-8692] - guests/kali: Add support for guest [GH-8553] - guests/smartos: Update halt capability and add public key insert and remove capabilities [GH-8618] - provisioners/ansible: Fix SSH keys only behavior to be consistent with Vagrant [GH-8467] - providers/docker: Add post install provisioner for docker setup [GH-8722] - snapshot/delete: Improve error message when given snapshot doesn't exist [GH-8653] - snapshot/list: Raise exception if provider does not support snapshots [GH-8619] - snapshot/restore: Improve error message when given snapshot doesn't exist [GH-8653] - snapshot/save: Raise exception if provider does not support snapshots [GH-8619] BUG FIXES: - communicators/ssh: Move `none` cipher to end of default cipher list in Net::SSH [GH-8661] - core: Add unique identifier to provisioner objects [GH-8680] - core: Stop config loader from loading dupe config if home and project dir are equal [GH-8707] - core/bundler: Impose constraints on update and allow system plugins to properly update [GH-8729] - guests/linux: Strip whitespace from GID [GH-8666, GH-8664] - guests/solaris: Do not use UNC style path for shared folders from windows hosts [GH-7723] - guests/windows: Fix directory creation when using rsync for synced folders [GH-8588] - hosts/windows: Force common encoding when running system commands [GH-8725] - providers/docker: Fix check for docker-compose [GH-8659, GH-8660] - providers/docker: Fix SSH under docker provider [GH-8706] - providers/hyperv: Fix box import [GH-8678, GH-8677] - provisioners/ansible_local: Catch pip_args in FreeBSD's and SUSE's ansible_install [GH-8676] - provisioners/salt: Fix minion ID configuration [GH-7865, GH-7454] - snapshot/restore: Exit 1 if vm has not been created when command is invoked [GH-8653] ## 1.9.5 (May 15, 2017) FEATURES: - hosts/windows: Support running within WSL [GH-8570, GH-8582] IMPROVEMENTS: - communicators/ssh: Retry on aborted connections [GH-8526, GH-8520] - communicators/winssh: Enabling shared folders and networking setup [GH-8567] - core: Remove nokogiri dependency and constraint [GH-8571] - guests: Do not modify existing /etc/hosts content [GH-8506, GH-7794] - guests/redhat: Update network configuration capability to properly handle NM [GH-8531] - hosts/windows: Check for elevated shell for Hyper-V [GH-8548, GH-8510] - hosts/windows: Fix invalid share names on Windows guests from Windows hosts [GH-8433] - providers: Return errors from docker/hyperv on ssh when not available [GH-8565, GH-8508] - providers/docker: Add support for driving provider with docker-compose [GH-8576] BUG FIXES: - guests/debian: Fix use_dhcp_assigned_default_route [GH-8577, GH-8575] - provisioners/shell: Fix Windows batch file provisioning [GH-8539, GH-8535] - providers/docker: Fall back to old style for SSH info lookup [GH-8566, GH-8552] - providers/hyperv: Fix import script [GH-8529] - providers/hyperv: Use string comparison for conditional checks in import scripts [GH-8568, GH-8444] ## 1.9.4 (April 24, 2017) FEATURES: - command/validate: Add Vagrantfile validation command [GH-8264, GH-8151] - communicators/winssh: Add WinSSH communicator for Win32-OpenSSH [GH-8485] - provider/hyperv: Support integration services configuration [GH-8379, GH-8378] IMPROVEMENTS: - core: Update internal dependencies [GH-8329, GH-8456] - core/bundler: Warn when plugin require fails instead of generating hard failure [GH-8400, GH-8392] - core/bundler: Error when configured plugin sources are unavailable [GH-8442] - guests/elementary: Add support for new guest "Elementary OS" [GH-8472] - guests/esxi: Add public_key capability [GH-8310] - guests/freebsd: Add chef_install and chef_installed? capabilities [GH-8443] - guests/gentoo: Add support for systemd in network configuration [GH-8407, GH-8406] - guests/windows: Support mounting synced folders via SSH on windows [GH-7425, GH-6220] - hosts/windows: Improve user permission detection [GH-7797] - provider/docker: Improve IP and port detection [GH-7840, GH-7651] - provider/docker: Do not force docker host VM on Darwin or Windows [GH-8437, GH-7895] - provisioners/ansible_local: Add `pip_args` option to define additional parameters when installing Ansible via pip [GH-8170, GH-8405] - provisioners/ansible_local: Add `:pip_args_only` install mode to allow full custom pip installations [GH-8405] - provisioners/salt: Update minion version installed to 2016.11.3 [GH-8448] BUG FIXES: - command/box: Remove extraneous sort from box list prior to display [GH-8422] - command/box: Properly handle local paths with spaces for box add [GH-8503, GH-6825] - command/up: Prevent other provider installation when explicitly defined [GH-8393, GH-8389] - communicators/ssh: Do not yield empty output data [GH-8495, GH-8259] - core: Provide fallback and retry when 0.0.0.0 is unavailable during port check [GH-8399, GH-8395] - core: Support port checker methods that do not expect inclusion of host_ip [GH-8497, GH-8423] - core/bundler: Check if source is local path and prevent addition to remote sources [GH-8401] - core/ui: Prevent deadlock detection errors [GH-8414, GH-8125] - guests/debian: Remove hardcoded device name in interface template [GH-8336, GH-7960] - guests/linux: Fix SMB mount capbability [GH-8410, GH-8404] - hosts/windows: Fix issues with Windows encoding [GH-8385, GH-8380, GH-8212, GH-8207, GH-7516] - hosts/windows: Fix UNC path generation when UNC path is provided [GH-8504] - provisioners/salt: Allow Salt version to match 2 digit month [GH-8428] - provisioners/shell: Properly handle remote paths on Windows that include spaces [GH-8498, GH-7234] ## 1.9.3 (March 21, 2017) IMPROVEMENTS: - command/plugin: Remove requirement for paths with no spaces [GH-7967] - core: Support host_ip for forwarded ports [GH-7035, GH-8350] - core: Include disk space hint in box install failure message [GH-8089] - core/bundler: Allow vagrant constraint matching in prerelease mode [GH-8341] - provisioner/docker: Include /bin/docker as valid path [GH-8390] - provider/hyperv: Support enabling Hyper-V nested virtualization [GH-8325, GH-7738] BUG FIXES: - communicator/winrm: Prevent inaccurate WinRM address [GH-7983, GH-8073] - contrib/bash: Handle path spaces in bash completion [GH-8337] - core: Fix box sorting on find and list [GH-7956, GH-8334] - core/bundler: Force path as preferred source on install [GH-8327] - core/provision: Update "never" behavior to match documentation [GH-8366, GH-8016] - plugins/push: Isolate deprecation to Atlas strategy only - plugins/synced_folders: Give UID/GID precedence if found within mount options [GH-8122, GH-8064, GH-7859] ## 1.9.2 (February 27, 2017) FEATURES: - providers/hyperv: Support packaging of Hyper-V boxes [GH-7867] - util/command_deprecation: Add utility module for command deprecation [GH-8300] - util/subprocess: Add #stop and #running? methods [GH-8270] IMPROVEMENTS: - commands/expunge: Display default value on prompt and validate input [GH-8192, GH-8171] - communicator/winrm: Refactor WinRM communicator to use latest WinRM gems and V2 API [GH-8102] - core: Scrub URL credentials from output when adding boxes [GH-8194, GH-8117] - providers/hyperv: Prefer VMCX over XML configuration when VMCX is supported [GH-8119] BUG FIXES: - command/init: Include box version when using minimal option [GH-8283, GH-8282] - command/package: Fix SecureRandom constant error [GH-8159] - communicator/ssh: Remove any STDERR output prior to command execution [GH-8291, GH-8288] - core/bundler: Prevent pristine warning messages [GH-8191, GH-8190, GH-8147] - core/bundler: Fix local installations of pre-release plugins [GH-8252, GH-8253] - core/bundler: Prefer user defined source when installing plugins [GH-8273, GH-8210] - core/environment: Prevent persisting original environment variable if name is empty [GH-8198, GH-8126] - core/environment: Fix gems_path location [GH-8248] - core/environment: Properly expand dotfile path [GH-8196, GH-8108] - guests/arch: Fix configuring multiple network interfaces [GH-8165] - guests/linux: Fix guest detection for names with spaces [GH-8092] - guests/redhat: Fix network interface configuration [GH-8148] DEPRECATIONS: - command/push: Disable push command [GH-8300] ## 1.9.1 (December 7, 2016) IMPROVEMENTS: - core: Disable Vagrantfile loading when running plugin commands [GH-8066] - guests/redhat: Detect and restart NetworkManager service if in use [GH-8052, GH-7994] BUG FIXES: - core: Detect load failures within install solution sets and retry [GH-8068] - core: Prevent interactive shell on plugin uninstall [GH-8086, GH-8087] - core: Remove bundler usage from Util::Env [GH-8090, GH-8094] - guests/linux: Prevent stderr output on init version check for synced folders [GH-8051] ## 1.9.0 (November 28, 2016) FEATURES: - commands/box: Add `prune` subcommand for removing outdated boxes [GH-7978] - core: Remove Bundler integration for handling internal plugins [GH-7793, GH-8000, GH-8011, GH-8031] - providers/hyperv: Add support for Hyper-V binary configuration format [GH-7854, GH-7706, GH-6102] - provisioners/shell: Support MD5/SHA1 checksum validation of remote scripts [GH-7985, GH-6323] IMPROVEMENTS: - commands/plugin: Retain name sorted output when listing plugins [GH-8028] - communicator/ssh: Support custom environment variable export template [GH-7976, GH-6747] - provisioners/ansible(both): Add `config_file` option to point the location of an `ansible.cfg` file via ANSIBLE_CONFIG environment variable [GH-7195, GH-7918] - synced_folders: Support custom naming and disable auto-mount [GH-7980, GH-6836] BUG FIXES: - guests/linux: Do not match interfaces with special characters when sorting [GH-7989, GH-7988] - provisioner/salt: Fix Hash construction for constant [GH-7986, GH-7981] ## 1.8.7 (November 4, 2016) IMPROVEMENTS: - guests/linux: Place ethernet devices at start of network devices list [GH-7848] - guests/linux: Provide more consistent guest detection [GH-7887, GH-7827] - guests/openbsd: Validate guest rsync installation success [GH-7929, GH-7898] - guests/redhat: Include Virtuozzo Linux 7 within flavor identification [GH-7818] - guests/windows: Allow vagrant to start Windows Nano without provisioning [GH-7831] - provisioners/ansible_local: Change the Ansible binary detection mechanism [GH-7536] - provisioners/ansible(both): Add the `playbook_command` option [GH-7881] - provisioners/puppet: Support custom environment variables [GH-7931, GH-7252, GH-2270] - util/safe_exec: Use subprocess for safe_exec on Windows [GH-7802] - util/subprocess: Allow closing STDIN [GH-7778] BUG FIXES: - communicators/winrm: Prevent connection leakage [GH-7712] - core: Prevent duplicate provider priorities [GH-7756] - core: Allow Numeric type for box version [GH-7874, GH-6960] - core: Provide friendly error when user environment is too large [GH-7889, GH-7857] - guests: Remove `set -e` usage for better shell compatibility [GH-7921, GH-7739] - guests/linux: Fix incorrectly configured private network [GH-7844, GH-7848] - guests/linux: Properly order network interfaces [GH-7866, GH-7876, GH-7858, GH-7876] - guests/linux: Only emit upstart event if initctl is available [GH-7813] - guests/netbsd: Fix rsync installation [GH-7922, GH-7901] - guests/photon: Fix networking setup [GH-7808, GH-7873] - guests/redhat: Properly configure network and restart service [GH-7751] - guests/redhat: Prevent NetworkManager from managing devices on initial start [GH-7926] - hosts/linux: Fix race condition in writing /etc/exports file for NFS configuration [GH-7947, GH-7938] - Thanks to Aron Griffis (@agriffis) for identifying this issue - plugins/rsync: Escape exclude paths [GH-7928, GH-7910] - providers/docker: Remove --interactive flag when pty is true [GH-7688] - provisioners/ansible_local: Use enquoted path for file/directory existence checks - provisioners/salt: Synchronize configuration defaults with documentation [GH-7907, GH-6624] - pushes/atlas: Fix atlas push on Windows platform [GH-6938, GH-7802] ## 1.8.6 (September 27, 2016) IMPROVEMENTS: - Add detection for DragonFly BSD [GH-7701] - Implement auto_start and auto_stop actions for Hyper-V [GH-7647] - communicators/ssh: Remove any content prepended to STDOUT [GH-7676, GH-7613] BUG FIXES: - commands/package: Provide machine data directory for base box package [GH-5070, GH-7725] - core: Fix windows path formatting [GH-6598] - core: Fixes for ssh-agent interactions [GH-7703, GH-7621, GH-7398] - core: Support VAGRANT_DOTFILE_PATH relative to the Vagrantfile [GH-7623] - guests: Prevent ssh disconnect errors on halt command [GH-7675] - guests/bsd: Remove Darwin matching [GH-7701] - guests/linux: Fix SSH key permissions [GH-7610, GH-7611] - guests/linux: Always sort discovered network interfaces [GH-7705, GH-7668] - guests/linux: Fixes for user and group ID lookups for virtualbox shared folders [GH-7616, GH-7662, GH-7720] - guests/openbsd: Add custom halt capability [GH-7701] - guests/ubuntu: Fix detection on older guests [GH-7632, GH-7524, GH-7625] - hosts/arch: Detect NFS server by service name on arch [GH-7630, GH-7629] - hosts/darwin: Fix generated RDP configuration file [GH-7698] - provisioners/ansible: Add support for `ssh.proxy_command` setting [GH-7752] - synced_folders/nfs: Display warning when configured for NFSv4 and UDP [GH-7740] - synced_folders/rsync: Properly ignore excluded files within synced directory from `chown` command. [GH-5256, GH-7726] ## 1.8.5 (July 18, 2016) FEATURES: - core: Provide a way to globally disable box update checks with the environment variable `VAGRANT_BOX_UPDATE_CHECK_DISABLE`. Setting this to any non-empty value will instruct Vagrant to not look for box updates when running `vagrant up`. Setting this environment variable has no effect on the `vagrant box` commands. IMPROVEMENTS: - guests/arch: Support installing synced folder clients [GH-7519] - guests/darwin: Allow ipv6 static networks [GH-7491] - providers/virtualbox: Add support for 5.1 [GH-7574] BUG FIXES: - core: Bump listen gem and Ruby version to improve rsync performance [GH-7453, GH-7441] - core: Check process stdout when detecting if a hyperv admin [GH-7465, GH-7467] - core: Ensure removal of temporary directory when box download fails [GH-7496, GH-7499] - core: Fix regression for installing plugins from path [GH-7505, GH-7493] - core: Skip checking conflicts on disabled ports [GH-7587] - core: Idempotent write-out for state file [GH-7550] - core/guests: Create common BSD guest for shared logic - core/guests: Ignore empty output from `/sbin/ip` [GH-7539, GH-7537, GH-7533, GH-7605] - synced_folders/nfs: Shellescape rsync paths [GH-7540, GH-7605] - synced_folders/nfs: Ensure retries take place [GH-6360, GH-7605] - synced_folders/rsync: Shellescape rsync paths [GH-7580, GH-6690, GH-7579, GH-7605] - synced_folders/rsync: Translate Windows paths [GH-7012, GH-6702, GH-6568, GH-7046] - guests/bsd: Consolidate core logic for mounting NFS folders [GH-7480, GH-7474, GH-7466] - guests/bsd: Consolidate core logic for public key management [GH-7481] - guests/bsd: Consolidate core logic for halting [GH-7484] - guests/centos: Use `ip` instead of `ifconfig` to detect network interfaces [GH-7460] - guests/debian: Ensure newline when inserting public key [GH-7456] - guests/linux: Ensure NFS retries during mounting [GH-7492] - guests/redhat: Use `/sbin/ip` to list and configure networks for compatability with older versions of CentOS [GH-7482] - guests/redhat: Ensure newline when inserting public key [GH-7598, GH-7605] - guests/ubuntu: Use /etc/os-release to detech [GH-7524] - guests/ubuntu: Use short hostname [GH-7488, GH-7605] - providers/hyperv: Fix version check and catch statement [GH-7447, GH-7487] ## 1.8.4 (June 13, 2016) BUG FIXES: - core: Fix bundler plugin issue and version constraint [GH-7418, GH-7415] - providers/virtualbox: Use 8 network interfaces (due to Windows limitation) [GH-7417, GH-7419] - provisioners/ansible(both): Honor "galaxy_roles_path" option when running ansible-playbook [GH-7269, GH-7420] - provisioners/ansible_local: Add quotes around "ansible-galaxy" arguments [GH-7420] IMPROVEMENTS: - guests/redhat: Add CloudLinux detection [GH-7428, GH-7427] ## 1.8.3 (June 10, 2016) BREAKING CHANGES: - The `winrm` communicator now shares the same upload behavior as the `ssh` communicator. This change should have no impact to most vagrant operations but may break behavior when uploading directories to an existing destination target. The `file` provisioner should be the only builtin provisioner affected by this change. When uploading a directory and the destination directory exists on the endpoint, the source base directory will be created below the destination directory on the endpoint and the source directory contents will be unzipped to that location. Prior to this release, the contents of the source directory would be unzipped to an existing destination directory without creating the source base directory. This new behavior is more consistent with SCP and other well known shell copy commands. - The Chef provisioner's `channel` default value has changed from "current" to "stable". The "current" channel includes nightly releases and should be opt-in only. Note that users wishing to download the Chef Development Kit will need to opt into the "current" channel until Chef Software promotes into the "stable" channel. - The Arch Linux host capability for NFS removed support for rc.d in favor or systemd which has been present since 2012. Please see GH-7181 for more information. FEATURES: - provider/docker: Allow non-linux users to opt-out of the host VM to run Docker containers by setting `config.force_host_vm = false` in the Vagrantfile. This is especially useful for customers who wish to use the beta builds for Mac and Windows, dlite, or a custom provider. [GH-7277, GH-7298, 8c11b53] - provider/docker: New command: `docker-exec` allows attaching to an already-running container. [GH-7377, GH-6566, GH-5193, GH-4904, GH-4057, GH-4179, GH-4903] IMPROVEMENTS: - core/downloader: increase box resume download limit to 24h [GH-7352, GH-7272] - core/package: run validations prior to packaging [GH-7353, GH-7351] - core/action: make `start` ("vagrant up") run provisioners [GH-4467, GH-4421] - commands/all: Make it clear that machine IDs can be specified [GH-7356, GH-7228] - commands/init: Add support for specifying the box version [GH-7363, GH-5004] - commands/login: Print a warning with both the environment variable and local login token are present [GH-7206, GH-7219] - communicators/winrm: Upgrade to latest WinRM gems [GH-6922] - provisioners/ansible_local: Allow to install Ansible from pip, with version selection capability [GH-6654, GH-7167] - provisioners/ansible_local: Use `provisioning_path` as working directory for `ansible-galaxy` execution - provisioners/ansible(both provisioners): Add basic config validators/converters on `raw_arguments` and `raw_ssh_args` options [GH-7103] - provisioners/chef: Add the ability to install on SUSE [GH-6806] - provisioners/chef: Support legacy solo mode [GH-7327] - provisioners/docker: Restart container if newer image is available [GH-7358, GH-6620] - hosts/arch: Remove sysvinit and assume systemd [GH-7181] - hosts/linux: Do not use a pager with systemctl commands [GH-7270] - hosts/darwin: Add `extra_args` support for RDP [GH-5523, GH-6602] - hosts/windows: Use SafeExec to capture history in Powershell [GH-6749] - guests/amazon: Add detection [GH-7395, GH-7254] - guests/freebsd: Add quotes around hostname [GH-6867] - guests/fedora: Add support for ipv6 static networks [GH-7275, GH-7276] - guests/tinycore: Add support for shared folders [GH-6977, GH-6968] - guests/trisquel: Add initial support [GH-6842, GH-6843] - guests/windows: Add support for automatic login (no password prompting) [GH-5670] - core: Add `--no-delete` and provisioning flags to snapshot restore/pop [GH-6879] - providers/docker: Allow TCP and UDP ports on the same number [GH-7365, GH-5527] - providers/hyperv: Add support for differencing disk [GH-7090] - providers/hyperv: Add support for snapshots [GH-7110] - providers/hyperv: Reinstate compatibility with PS 4 [GH-7108] - providers/virtualbox: Add linked clone support for Virtualbox 1.4 [GH-7050] - synced_folders/nfs: Read static and dynamic IPs [GH-7290, GH-7289] BUG FIXES: - core: Bump nokogiri version to fix windows bug [GH-6766, GH-6848] - core: Revert a change made to the output of the identify file [GH-6962, GH-6929, GH-6589] - core: Fix login command behind a proxy [GH-6898, GH-6899] - core: Fix support for regular expressions on multi-machine `up` [GH-6908, GH-6909] - core: Allow boxes to use pre-release versions [GH-6892, GH-6893] - core: Rescue `Errno:ENOTCONN` waiting for port to be open [GH-7182, GH-7184] - core: Properly authenticate metadata box URLs [GH-6776, GH-7158] - core: Do not run provisioners if already run on resume [GH-7059, GH-6787] - core: Implement better tracking of tempfiles and tmpdirs to identify file leaks [GH-7355] - core: Allow SSH forwarding on Windows [GH-7287, GH-7202] - core: Allow customizing `keys_only` SSH option [GH-7360, GH-4275] - core: Allow customizing `paranoid` SSH option [GH-7360, GH-4275] - command/box_update: Do not update the same box twice [GH-6042, GH-7379] - command/init: Remove unnecessary `sudo` from generated Vagrantfile [GH-7369, GH-7295] - docs & core: Be consistent about the "2" in the Vagrantfile version [GH-6961, GH-6963] - guests/all: Refactor guest capabilities to run in a single command - **please see GH-7393 for the complete list of changes!** - guests/arch: Restart network after configuration [GH-7120, GH-7119] - guests/debian: Do not return an error if ifdown fails [GH-7159, GH-7155, GH-6871] - guests/freebsd: Use `pkg` to install rsync [GH-6760] - guests/freebsd: Use `netif` to configure networks [GH-5852, GH-7093] - guests/coreos: Detect all interface names [GH-6608, GH-6610] - providers/hyperv: Only specify Hyper-V if the parameter is support [GH-7101, GH-7098] - providers/virtualbox: Set maximum network adapters to 36 [GH-7293, GH-7286] - providers/virtualbox: Do not fail when master VM from linked clone is missing [GH-7126, GH-6742] - providers/virtualbox: Use scoped overrides in preparring NFS [GH-7387, GH-7386] - provisioners/ansible: Fix a race condition in the concurrent generations of the ansible inventory file, while running `vagrant up --parallel` [GH-6526, GH-7190] - provisioners/ansible_local: Don't quote the Ansible arguments defined in the `raw_arguments` option [GH-7103] - provisioners/ansible_local: Format json `extra_vars` with double quotes [GH-6726, GH-7103] - provisioners/ansible_local: Fix errors in absolute paths to playbook or galaxy resources when running on a Windows host [GH-6740, GH-6757] - provisioners/ansible_local: Change the way to verify `ansible-galaxy` presence, to avoid a non-zero status code with Ansible 2.0 [GH-6793] - provisioners/ansible(both provisioners): The Ansible configuration files detection is only executed by the `provision` action [GH-6763, GH-6984] - provisioners/chef: Do not use double sudo when installing [GGH-6805, GH-6804] - provisioners/chef: Change the default channel to "stable" (previously it was "current") [GH-7001, GH-6979] - provisioners/chef: Default node_name to hostname if present [GH-7063, GH-7153] - provisioners/docker: Fix -no-trunc command option [GH-7085] - provisioners/docker: Allow provisioning when container name is specified [GH-7074, GH-7086] - provisioners/puppet: Use `where.exe` to locate puppet binary [GH-6912, GH-6876] - provisioners/salt: Move masterless config to apply to all platforms [GH-7207, Gh-6924, GH-6915] - pushes/ftp: Create parent directories when uploading [GH-7154, GH-6316] - synced_folders/smb: Do not interpolate configuration file [GH-6906] ## 1.8.1 (December 21, 2015) BUG FIXES: - core: Don't create ".bundle" directory in pwd [GH-6717] - core: Fix exception on installing VirtualBox [GH-6713] - core: Do not convert standalone drive letters such as "D:" to UNC paths [GH-6598] - core: Fix a crash in parsing the config in some cases with network configurations [GH-6730] - core: Clean up temporarily files created by bundler [GH-7354, GH-6301, GH-3469, GH-6231] - commands/up: Smarter logic about what provider to install, avoiding situations where VirtualBox was installed over the correct provider [GH-6731] - guests/debian: Fix Docker install [GH-6722] - provisioners/chef: convert chef version to a string before comparing for the command builder [GH-6709, GH-6711] - provisioners/shell: convert env var values to strings [GH-6714] ## 1.8.0 (December 21, 2015) FEATURES: - **New Command: `vagrant powershell`**: For machines that support it, this will open a PowerShell prompt. - **New Command: `vagrant port`**: For machines that support it, this will display the list of forwarded ports from the guest to the host. - **Linked Clones**: VirtualBox and VMware providers now support linked clones for very fast (millisecond) imports on up. [GH-4484] - **Snapshots**: The `vagrant snapshot` command can be used to checkpoint and restore point-in-time snapshots. - **IPv6 Private Networks**: Private networking now supports IPv6. This only works with VirtualBox and VMware at this point. [GH-6342] - New provisioner: `ansible_local` to execute Ansible from the guest machine. [GH-2103] BREAKING CHANGES: - The `ansible` provisioner now can override the effective ansible remote user (i.e. `ansible_ssh_user` setting) to always correspond to the vagrant ssh username. This change is enabled by default, but we expect this to affect only a tiny number of people as it corresponds to the common usage. If you however use multiple remote usernames in your Ansible plays, tasks, or custom inventories, you can simply set the option `force_remote_user` to false to make Vagrant behave the same as before. - provisioners/salt: the "config_dir" option has been removed. It has no effect in Vagrant 1.8. [GH-6073] IMPROVEMENTS: - core: allow removal of all box versions with `--all` flag [GH-3462] - core: prune entries from global status on non-existent cwd [GH-6535] - core: networking: allow specifying a DHCP IP [GH-6325] - core: run provisioner cleanup tasks before powering off the VM [GH-6553] - core: only run provisioner cleanup tasks if they're implemented [GH-6603] This improves UX, but wasn't a bug before. - command/plugin: Add `--plugin-clean-sources` flag to reset plugin install sources, primarily for corp firewalls. [GH-4738] - command/rsync-auto: SSH connection is cached for faster sync times [GH-6399] - command/up: provisioners are run on suspend resume [GH-5815] - communicators/ssh: allow specifying host environment variables to forward to guests [GH-4132, GH-6562] - communicators/winrm: Configurable execution time limit [GH-6213] - providers/virtualbox: cache version lookup, which caused significant slowdown on some Windows hosts [GH-6552] - providers/virtualbox: add `public_address` capability for virtualbox [GH-6583, GH-5978] - provisioners/chef: perform cleanup tasks on the guest instead of the host - provisioners/chef: automatically generate a node_name if one was not given [GH-6555] - provisioners/chef: install Chef automatically on Windows [GH-6557] - provisioners/chef: allow the user to specify the Chef product (such as the Chef Development Kit) [GH-6557] - provisioners/chef: allow data_bags_path to be an array [GH-5988, GH-6561] - provisioners/shell: Support interactive mode for elevated PowerShell scripts [GH-6185] - provisioners/shell: add `env` option [GH-6588, GH-6516] - provisioners/ansible+ansible_local: add support for ansible-galaxy [GH-2718] - provisioners/ansible+ansible_local: add support for group and host variables in the generated inventory [GH-6619] - provisioners/ansible+ansible_local: add support for alphanumeric patterns for groups in the generated inventory [GH-3539] - provisioners/ansible: add support for WinRM settings [GH-5086] - provisioners/ansible: add new `force_remote_user` option to control whether `ansible_ssh_user` parameter should be applied or not [GH-6348] - provisioners/ansible: show a warning when running from a Windows Host [GH-5292] - pushes/local-exec: add support for specifying script args [GH-6661, GH-6660] - guests/slackware: add support for networking [GH-6514] BUG FIXES: - core: Ctrl-C weirdness fixed where it would exit parent process before Vagrant finished cleaning up [GH-6085] - core: DHCP network configurations don't warn on IP addresses ending in ".1" [GH-6150] - core: only append `access_token` when it does not exist in the URL [GH-6395, GH-6534] - core: use the correct private key when packaging a box [GH-6406] - core: fix crash when using invalid box checksum type [GH-6327] - core: don't check for metadata if the download URL is not HTTP [GH-6540] - core: don't make custom dotfile path if there is no Vagrantfile [GH-6542] - core: more robust check for admin privs on Windows [GH-5616] - core: properly detect when HTTP server doesn't support byte ranges and retry from scratch [GH-4479] - core: line numbers show properly in Vagrantfile syntax errors on Windows [GH-6445] - core: catch errors setting env vars on Windows [GH-6017] - core: remove cached synced folders when they're removed from the Vagrantfile [GH-6567] - core: use case-insensitive comparison for box checksum validations [GH-6648, GH-6650] - commands/box: add command with `~` paths on Windows works [GH-5747] - commands/box: the update command supports CA settings [GH-4473] - commands/box: removing all versions and providers of a box will properly clean all directories in `~/.vagrant.d/boxes` [GH-3570] - commands/box: outdated global won't halt on metadata download failure [GH-6453] - commands/login: respect environment variables in `vagrant login` command [GH-6590, GH-6422] - commands/package: when re-packaging a packaged box, preserve the generated SSH key [GH-5780] - commands/plugin: retry plugin install automatically a few times to avoid network issues [GH-6097] - commands/rdp: prefer `xfreerdp` if it is available on Linux [GH-6475] - commands/up: the `--provision-with` flag works with provisioner names [GH-5981] - communicator/ssh: fix potential crash case with PTY [GH-6225] - communicator/ssh: escape IdentityFile path [GH-6428, GH-6589] - communicator/winrm: respect `boot_timeout` setting [GH-6229] - communicator/winrm: execute scheduled tasks immediately on Windows XP since elevation isn't required [GH-6195] - communicator/winrm: Decouple default port forwarding rules for "winrm" and "winrm-ssl" [GH-6581] - communicator/winrm: Hide progress bars from PowerShell v5 [GH-6309] - guests/arch: enable network device after setting it up [GH-5737] - guests/darwin: advanced networking works with more NICs [GH-6386] - guests/debian: graceful shutdown works properly with newer releases [GH-5986] - guests/fedora: Preserve `localhost` entry when changing hostname [GH-6203] - guests/fedora: Use dnf if it is available [GH-6288] - guests/linux: when replacing a public SSH key, use POSIX-compliant sed flags [GH-6565] - guests/suse: DHCP network interfaces properly configured [GH-6502] - hosts/slackware: Better detection of NFS [GH-6367] - providers/hyper-v: support generation 2 VMs [GH-6372] - providers/hyper-v: support VMs with more than one NIC [GH-4346] - providers/hyper-v: check if user is in the Hyper-V admin group if they're not a Windows admin [GH-6662] - providers/virtualbox: ignore "Unknown" status bridge interfaces [GH-6061] - providers/virtualbox: only fix ipv6 interfaces that are in use [GH-6586, GH-6552] - provisioners/ansible: use quotes for the `ansible_ssh_private_key_file` value in the generated inventory [GH-6209] - provisioners/ansible: use quotes when passing the private key files via OpenSSH `-i` command line arguments [GH-6671] - provisioners/ansible: don't show the `ansible-playbook` command when verbose option is an empty string - provisioners/chef: fix `nodes_path` for Chef Zero [GH-6025, GH-6049] - provisioners/chef: do not error when the `node_name` is unset [GH-6005, GH-6064, GH-6541] - provisioners/chef: only force the formatter on Chef 11 or higher [GH-6278, GH-6556] - provisioners/chef: require `nodes_path` to be set for Chef Zero [GH-6110, GH-6559] - provisioners/puppet: apply provisioner uses correct default manifests with environments. [GH-5987] - provisioners/puppet: remove broken backticks [GH-6404] - provisioners/puppet: find Puppet binary properly on Windows [GH-6259] - provisioners/puppet-server: works with Puppet Collection 1 [GH-6389] - provisioners/salt: call correct executables on Windows [GH-5999] - provisioners/salt: log level and colorize works for masterless [GH-6474] - push/local-exec: use subprocess on windows when fork does not exist [GH-5307, GH-6563] - push/heroku: use current branch [GH-6554] - synced\_folders/rsync: on Windows, replace all paths with Cygwin paths since all rsync implementations require this [GH-6160] - synced\_folders/smb: use credentials files to allow for more characters in password [GH-4230] PLUGIN AUTHOR CHANGES: - installer: Upgrade to Ruby 2.2.3 ## 1.7.4 (July 17, 2015) BUG FIXES: - communicators/winrm: catch timeout errors [GH-5971] - communicators/ssh: use the same SSH args for `vagrant ssh` with and without a command [GH-4986, GH-5928] - guests/fedora: networks can be configured without nmcli [GH-5931] - guests/fedora: biosdevname can return 4 or 127 [GH-6139] - guests/redhat: systemd detection should happen on guest [GH-5948] - guests/ubuntu: setting hostname fixed in 12.04 [GH-5937] - hosts/linux: NFS can be configured without `$TMP` set on the host [GH-5954] - hosts/linux: NFS will sudo copying back to `/etc/exports` [GH-5957] - providers/docker: Add `pull` setting, default to false [GH-5932] - providers/virtualbox: remove UNC path conversion on Windows since it caused mounting regressions [GH-5933] - provisioners/puppet: Windows Puppet 4 paths work correctly [GH-5967] - provisioners/puppet: Fix config merging errors [GH-5958] - provisioners/salt: fix "dummy config" error on bootstrap [GH-5936] ## 1.7.3 (July 10, 2015) FEATURES: - **New guest: `atomic`* - Project Atomic is supported as a guest - providers/virtualbox: add support for 5.0 [GH-5647] IMPROVEMENTS: - core: add password authentication to rdp_info hash [GH-4726] - core: improve error message when packaging fails [GH-5399] - core: improve message when adding a box from a file path [GH-5395] - core: add support for network gateways [GH-5721] - core: allow redirecting stdout and stderr in the UI [GH-5433] - core: update version of winrm-fs to 0.2.0 [GH-5738] - core: add option to enabled trusted http(s) redirects [GH-4422] - core: capture additional information such as line numbers during Vagrantfile loading [GH-4711, GH-5769] - core: add .color? to UI objects to see if they support color [GH-5771] - core: ignore hidden directories when searching for boxes [GH-5748, GH-5785] - core: use `config.ssh.sudo_command` to customize the sudo command format [GH-5573] - core: add `Vagrant.original_env` for Vagrant and plugins to restore or inspect the original environment when Vagrant is being run from the installer [GH-5910] - guests/darwin: support inserting generated key [GH-5204] - guests/darwin: support mounting SMB shares [GH-5750] - guests/fedora: support Fedora 21 [GH-5277] - guests/fedora: add capabilities for nfs and flavor [GH-5770, GH-4847] - guests/linux: specify user's domain as separate parameter [GH-3620, GH-5512] - guests/redhat: support Scientific Linux 7 [GH-5303] - guests/photon: initial support [GH-5612] - guests/solaris,solaris11: support inserting generated key [GH-5182] [GH-5290] - providers/docker: images are pulled prior to starting [GH-5249] - provisioners/ansible: store the first ssh private key in the auto-generated inventory [GH-5765] - provisioners/chef: add capability for checking if Chef is installed on Windows [GH-5669] - provisioners/docker: restart containers if arguments have changed [GH-3055, GH-5924] - provisioners/puppet: add support for Puppet 4 and configuration options [GH-5601] - provisioners/puppet: add support for `synced_folder_args` in apply [GH-5359] - provisioners/salt: add configurable `config_dir` [GH-3138] - provisioners/salt: add support for masterless configuration [GH-3235] - provisioners/salt: provider path to missing file in errors [GH-5637] - provisioners/salt: add ability to run salt orchestrations [GH-4371] - provisioners/salt: update to 2015.5.2 [GH-4152, GH-5437] - provisioners/salt: support specifying version to install [GH-5892] - provisioners/shell: add :name attribute to shell provisioner [GH-5607] - providers/docker: supports file downloads with the file provisioner [GH-5651] - providers/docker: support named Dockerfile [GH-5480] - providers/docker: don't remove image on reload so that build cache can be used fully [GH-5905] - providers/hyperv: select a Hyper-V switch based on a `network_name` [GH-5207] - providers/hyperv: allow configuring VladID [GH-5539] - providers/virtualbox: regexp supported for bridge configuration [GH-5320] - providers/virtualbox: handle a list of bridged NICs [GH-5691] - synced_folders/rsync: allow showing rsync output in debug mode [GH-4867] - synced_folders/rsync: set `rsync__rsync_path` to specify the remote command used to execute rsync [GH-3966] BUG FIXES: - core: push configurations are validated with global configs [GH-5130] - core: remove executable permissions on internal file [GH-5220] - core: check name and version in `has_plugin?` [GH-5218] - core: do not create duplicates when defining two private network addresses [GH-5325] - core: update ssh to check for Plink [GH-5604] - core: do not report plugins as installed when plugins are disabled [GH-5698, GH-5430] - core: Only take files when packaging a box to avoid duplicates [GH-5658, GH-5657] - core: escape curl urls and authentication [GH-5677] - core: fix crash if a value is missing for CLI arguments [GH-5550] - core: retry SSH key generation for transient RSA errors [GH-5056] - core: `ssh.private_key_path` will override the insecure key [GH-5632] - core: restore the original environment when shelling out to subprocesses outside of the installer [GH-5912] - core/cli: fix box checksum validation [GH-4665, GH-5221] - core/windows: allow Windows UNC paths to allow more than 256 characters [GH-4815] - command/rsync-auto: don't crash if rsync command fails [GH-4991] - communicators/winrm: improve error handling significantly and improve the error messages shown to be more human-friendly. [GH-4943] - communicators/winrm: remove plaintext passwords from files after provisioner is complete [GH-5818] - hosts/nfs: allow colons (`:`) in NFS IDs [GH-5222] - guests/darwin: remove dots from LocalHostName [GH-5558] - guests/debian: Halt works properly on Debian 8. [GH-5369] - guests/fedora: recognize future fedora releases [GH-5730] - guests/fedora: reload iface connection by NetworkManager [GH-5709] - guests/fedora: do not use biosdevname if it is not installed [GH-5707] - guests/freebsd: provide an argument to the backup file [GH-5516, GH-5517] - guests/funtoo: fix incorrect path in configure networks [GH-4812] - guests/linux: fix edge case exception where no home directory is available on guest [GH-5846] - guests/linux: copy NFS exports to tmpdir to do edits to guarantee permissions are available [GH-5773] - guests/openbsd: output newline after inserted public key [GH-5881] - guests/tinycore: fix change hostname functionality [GH-5623] - guests/ubuntu: use `hostnamectl` to set hostname on Ubuntu Vivid [GH-5753] - guests/windows: Create rsync folder prior to rsync-ing. [GH-5282] - guests/windows: Changing hostname requires reboot again since the non-reboot code path was crashing Windows server. [GH-5261] - guests/windows: ignore virtual NICs [GH-5478] - hosts/windows: More accurately get host IP address in VPNs. [GH-5349] - plugins/login: allow users to login with a token [GH-5145] - providers/docker: Build image from `/var/lib/docker` for more disk space on some systems. [GH-5302] - providers/docker: Fix crash that could occur in some scenarios when the host VM path changed. - providers/docker: Fix crash that could occur on container destroy with VirtualBox shared folders [GH-5143] - providers/hyperv: allow users to configure memory, cpu count, and vmname [GH-5183] - providers/hyperv: import respects secure boot. [GH-5209] - providers/hyperv: only set EFI secure boot for gen 2 machines [GH-5538] - providers/virtualbox: read netmask from dhcpservers [GH-5233] - providers/virtualbox: Fix exception when VirtualBox version is empty. [GH-5308] - providers/virtualbox: Fix exception when VBoxManage.exe can't be run on Windows [GH-1483] - providers/virtualbox: Error if another user is running after a VM is created to avoid issue with VirtualBox "losing" the VM [GH-5895] - providers/virtualbox: The "name" setting on private networks will choose an existing hostonly network [GH-5389] - provisioners/ansible: fix SSH settings to support more than 5 ssh keys [GH-5017] - provisioners/ansible: increase ansible connection timeout to 30 seconds [GH-5018] - provisioners/ansible: disable color if Vagrant is not colored [GH-5531, GH-5532] - provisioners/ansible: only show ansible-playbook command when `verbose` option is enabled [GH-5803] - provisioners/ansible: fix a race condition in the inventory file generation [GH-5551] - provisioners/docker: use `service` to restart Docker instad of upstart [GH-5245, GH-5577] - provisioners/docker: Only add docker user to group if exists. [GH-5315] - provisioners/docker: Use https for repo [GH-5749] - provisioners/docker: `apt-get update` before installing linux kernel images to get the correct version [GH-5860] - provisioners/chef: Fix shared folders missing error [GH-5199] - provisioners/chef: Use `command -v` to check for binary instead of `which` since that doesn't exist on some systems. [GH-5170] - provisioners/chef-zero: support more chef-zero/local mode attributes [GH-5339] - provisioners/chef: use windows-specific paths in Chef provisioners [GH-5913] - provisioners/docker: use docker.com instead of docker.io [GH-5216] - provisioners/docker: use `--restart` instead of `-r` on daemon [GH-4477] - provisioners/file: validation of source is relative to Vagrantfile [GH-5252] - pushes/atlas: send additional box metadata [GH-5283] - pushes/local-exec: fix "text file busy" error for inline [GH-5695] - pushes/ftp: improve check for remote directory existence [GH-5549] - synced\_folders/rsync: add `IdentitiesOnly=yes` to the rsync command. [GH-5175] - synced\_folders/smb: use correct `password` option [GH-5805] - synced\_folders/smb: prever IPv4 over IPv6 address to mount [GH-5798] - virtualbox/config: fix misleading error message for private_network [GH-5536, GH-5418] ## 1.7.2 (January 6, 2015) BREAKING CHANGES: - If you depended on the paths that Chef/Puppet provisioners use to store cookbooks (ex. "/tmp/vagrant-chef-1"), these will no longer be correct. Without this change, Chef/Puppet didn't work at all with `vagrant provision`. We expect this to affect only a minor number of people, since it's not something that was ever documented or recommended by Vagrant, or even meant to be supported. FEATURES: - provisioners/salt: add support for grains [GH-4895] IMPROVEMENTS: - commands/reload,up: `--provision-with` implies `--provision` [GH-5085] BUG FIXES: - core: private boxes still referencing vagrantcloud.com will have their vagrant login access token properly appended - core: push plugin configuration is properly validated - core: restore box packaging functionality - commands/package: fix crash - commands/push: push lookups are by user-defined name, not push strategy name [GH-4975] - commands/push: validate the configuration - communicators/winrm: detect parse errors in PowerShell and error - guests/arch: fix network configuration due to poor line breaks. [GH-4964] - guests/solaris: Merge configurations properly so configs can be set in default Vagrantfiles. [GH-5092] - installer: SSL cert bundle contains 1024-bit keys, fixing SSL verification for a lot of sites. - installer: vagrant executable properly `cygpaths` the SSL bundle path for Cygwin - installer: Nokogiri (XML lib used by Vagrant and dependencies) linker dependencies fixed, fixing load issues on some platforms - providers/docker: Symlinks in shared folders work. [GH-5093] - providers/hyperv: VM start errors turn into proper Vagrant errors. [GH-5101] - provisioners/chef: fix missing shared folder error [GH-4988] - provisioners/chef: remove Chef version check from solo.rb generation and make `roles_path` populate correctly - provisioners/chef: fix bad invocation of `with_clean_env` [GH-5021] - pushes/atlas: support more verbose logging - pushes/ftp: expand file paths relative to the Vagrantfile - pushes/ftp: improved debugging output - pushes/ftp: create parent directories if they do not exist on the remote server ## 1.7.1 (December 11, 2014) IMPROVEMENTS: - provisioners/ansible: Use Docker proxy if needed. [GH-4906] BUG FIXES: - providers/docker: Add support of SSH agent forwarding. [GH-4905] ## 1.7.0 (December 9, 2014) BREAKING CHANGES: - provisioners/ansible: `raw_arguments` has now highest priority - provisioners/ansible: only the `ssh` connection transport is supported (`paramiko` can be enabled with `raw_arguments` at your own risks) FEATURES: - **Vagrant Push**: Vagrant can now deploy! `vagrant push` is a single command to deploy your application. Deploy to Heroku, FTP, or HashiCorp's commercial product Atlas. New push strategies can be added with plugins. - **Named provisioners**: Provisioners can now be named. This name is used for output as well as `--provision-with` for better control. - Default provider logic improved: Providers in `config.vm.provider` blocks in your Vagrantfile now have higher priority than plugins. Earlier providers are chosen before later ones. [GH-3812] - If the default insecure keypair is used, Vagrant will automatically replace it with a randomly generated keypair on first `vagrant up`. [GH-2608] - Vagrant Login is now part of Vagrant core - Chef Zero provisioner: Use Chef 11's "local" mode to run recipes against an in-memory Chef Server - Chef Apply provisioner: Specify inline Chef recipes and recipe snippets using the Chef Apply provisioner IMPROVEMENTS: - core: `has_plugin?` function now takes a second argument which is a version constraint requirement. [GH-4650] - core: ".vagrantplugins" file in the same folder as your Vagrantfile will be loaded for defining inline plugins. [GH-3775] - commands/plugin: Plugin list machine-readable output contains the plugin name as the target for versions and other info. [GH-4506] - env/with_cleanenv: New helper for plugin developers to use when shelling out to another Ruby environment - guests/arch: Support predictable network interface naming. [GH-4468] - guests/suse: Support NFS client install, rsync setup. [GH-4492] - guests/tinycore: Support changing host names. [GH-4469] - guests/tinycore: Support DHCP-based networks. [GH-4710] - guests/windows: Hostname can be set without reboot. [GH-4687] - providers/docker: Build output is now shown. [GH-3739] - providers/docker: Can now start containers from private repositories more easily. Vagrant will login for you if you specify auth. [GH-4042] - providers/docker: `stop_timeout` can be used to modify the `docker stop` timeout. [GH-4504] - provisioners/chef: Automatically install Chef when using a Chef provisioner. - provisioners/ansible: Always show Ansible command executed when Vagrant log level is debug (even if ansible.verbose is false) - synced\_folders/nfs: Won't use `sudo` to write to /etc/exports if there are write privileges. [GH-2643] - synced\_folders/smb: Credentials from one SMB will be copied to the rest. [GH-4675] BUG FIXES: - core: Fix cases where sometimes SSH connection would hang. - core: On a graceful halt, force halt if capability "insert public key" is missing. [GH-4684] - core: Don't share `/vagrant` if any "." folder is shared. [GH-4675] - core: Fix SSH private key permissions more aggressively. [GH-4670] - core: Custom Vagrant Cloud server URL now respected in more cases. - core: On downloads, don't continue downloads if the remote server doesn't support byte ranges. [GH-4479] - core: Box downloads recognize more complex content types that include "application/json" [GH-4525] - core: If all sub-machines are `autostart: false`, don't start any. [GH-4552] - core: Update global-status state in more cases. [GH-4513] - core: Only delete machine state if the machine is not created in initialize - commands/box: `--cert` flag works properly. [GH-4691] - command/docker-logs: Won't crash if container is removed. [GH-3990] - command/docker-run: Synced folders will be attached properly. [GH-3873] - command/rsync: Sync to Docker containers properly. [GH-4066] - guests/darwin: Hostname sets bonjour name and local host name. [GH-4535] - guests/freebsd: NFS mounting can specify the version. [GH-4518] - guests/linux: More descriptive error message if SMB mount fails. [GH-4641] - guests/rhel: Hostname setting on 7.x series works properly. [GH-4527] - guests/rhel: Installing NFS client works properly on 7.x [GH-4499] - guests/solaris11: Static IP address preserved after restart. [GH-4621] - guests/ubuntu: Detect with `lsb_release` instead of `/etc/issue`. [GH-4565] - hosts/windows: RDP client shouldn't map all drives by default. [GH-4534] - providers/docker: Create args works. [GH-4526] - providers/docker: Nicer error if package is called. [GH-4595] - providers/docker: Host IP restriction is forwarded through. [GH-4505] - providers/docker: Protocol is now honored in direct `ports settings. - providers/docker: Images built using `build_dir` will more robustly capture the final image. [GH-4598] - providers/docker: NFS synced folders now work. [GH-4344] - providers/docker: Read the created container ID more robustly. - providers/docker: `vagrant share` uses correct IP of proxy VM if it exists. [GH-4342] - providers/docker: `vagrant_vagrantfile` expands home directory. [GH-4000] - providers/docker: Fix issue where multiple identical proxy VMs would be created. [GH-3963] - providers/docker: Multiple links with the same name work. [GH-4571] - providers/virtualbox: Show a human-friendly error if VirtualBox didn't clean up an existing VM. [GH-4681] - providers/virtualbox: Detect case when VirtualBox reports 0.0.0.0 as IP address and don't allow it. [GH-4671] - providers/virtualbox: Show more descriptive error if VirtualBox is reporting an empty version. [GH-4657] - provisioners/ansible: Force `ssh` (OpenSSH) connection by default [GH-3396] - provisioners/ansible: Don't use or modify `~/.ssh/known_hosts` file by default, similarly to native vagrant commands [GH-3900] - provisioners/ansible: Use intermediate Docker host when needed. [GH-4071] - provisioners/docker: Get GPG key over SSL. [GH-4597] - provisioners/docker: Search for docker binary in multiple places. [GH-4580] - provisioners/salt: Highstate works properly with a master. [GH-4471] - provisioners/shell: Retry getting SSH info a few times. [GH-3924] - provisioners/shell: PowerShell scripts can have args. [GH-4548] - synced\_folders/nfs: Don't modify NFS exports file if no exports. [GH-4619] - synced\_folders/nfs: Prune exports for file path IDs. [GH-3815] PLUGIN AUTHOR CHANGES: - `Machine#action` can be called with the option `lock: false` to not acquire a machine lock. - `Machine#reload` will now properly trigger the `machine_id_changed` callback on providers. ## 1.6.5 (September 4, 2014) BUG FIXES: - core: forward SSH even if WinRM is used. [GH-4437] - communicator/ssh: Fix crash when pty is enabled with SSH. [GH-4452] - guests/redhat: Detect various RedHat flavors. [GH-4462] - guests/redhat: Fix typo causing crash in configuring networks. [GH-4438] - guests/redhat: Fix typo causing hostnames to not set. [GH-4443] - providers/virtualbox: NFS works when using DHCP private network. [GH-4433] - provisioners/salt: Fix error when removing non-existent bootstrap script on Windows. [GH-4614] ## 1.6.4 (September 2, 2014) BACKWARDS INCOMPATIBILITIES: - commands/docker-run: Started containers are now deleted after run. Specify the new `--no-rm` flag to retain the original behavior. [GH-4327] - providers/virtualbox: Host IO cache is no longer enabled by default since it causes stale file issues. Please enable manually if you require this. [GH-3934] IMPROVEMENTS: - core: Added `config.vm.box_server_url` setting to point at a Vagrant Cloud instance. [GH-4282] - core: File checksumming performance has been improved by at least 100%. Memory requirements have gone down by half. [GH-4090] - commands/docker-run: Add the `--no-rm` flag. Containers are deleted by default. [GH-4327] - commands/plugin: Better error output is shown when plugin installation fails. - commands/reload: show post up messsage [GH-4168] - commands/rsync-auto: Add `--poll` flag. [GH-4392] - communicators/winrm: Show stdout/stderr if command fails. [GH-4094] - guests/nixos: Added better NFS support. [GH-3983] - providers/hyperv: Accept VHD disk format. [GH-4208] - providers/hyperv: Support generation 2 VMs. [GH-4324] - provisioners/docker: More verbose output. [GH-4377] - provisioners/salt: Get proper exit codes to detect failed runs. [GH-4304] BUG FIXES: - core: Downloading box files should resume in more cases since the temporary file is preserved in more cases. [GH-4301] - core: Windows is not detected as NixOS in some cases. [GH-4302] - core: Fix encoding issues with Windows. There are still some outlying but this fixes a few. [GH-4159] - core: Fix crash case when destroying with an invalid provisioner. [GH-4281] - core: Box names with colons work on Windows. [GH-4100] - core: Cleanup all temp files. [GH-4103] - core: User curlrc is not loaded, preventing strange download issues. [GH-4328] - core: VM names may no longer contain brackets, since they cause issues with some providers. [GH-4319] - core: Use "-f" to `rm` files in case pty is true. [GH-4410] - core: SSH key doesn't have to be owned by our user if we're running as root. [GH-4387] - core: "vagrant provision" will cause "vagrant up" to properly not reprovision. [GH-4393] - commands/box/add: "Content-Type" header is now case-insensitive when looking for metadata type. [GH-4369] - commands/docker-run: Named docker containers no longer conflict. [GH-4294] - commands/package: base package won't crash with exception [GH-4017] - commands/rsync-auto: Destroyed machines won't raise exceptions. [GH-4031] - commands/ssh: Extra args are passed through to Docker container. [GH-4378] - communicators/ssh: Nicer error if remote unexpectedly disconnects. [GH-4038] - communicators/ssh: Clean error when max sessions is hit. [GH-4044] - communicators/ssh: Fix many issues around PTY-enabled output parsing. [GH-4408] - communicators/winrm: Support `mkdir` [GH-4271] - communicators/winrm: Properly escape double quotes. [GH-4309] - communicators/winrm: Detect failed commands that aren't CLIs. [GH-4383] - guests/centos: Fix issues when NFS client is installed by restarting NFS [GH-4088] - guests/debian: Deleting default route on DHCP networks can fail. [GH-4262] - guests/fedora: Fix networks on Fedora 20 with libvirt. [GH-4104] - guests/freebsd: Rsync install for rsync synced folders work on FreeBSD 10. [GH-4008] - guests/freebsd: Configure vtnet devices properly [GH-4307] - guests/linux: Show more verbose error when shared folder mount fails. [GH-4403] - guests/redhat: NFS setup should use systemd for RH7+ [GH-4228] - guests/redhat: Detect RHEL 7 (and CentOS) and install Docker properly. [GH-4402] - guests/redhat: Configuring networks on EL7 works. [GH-4195] - guests/redhat: Setting hostname on EL7 works. [GH-4352] - guests/smartos: Use `pfexec` for rsync. [GH-4274] - guests/windows: Reboot after hostname change. [GH-3987] - hosts/arch: NFS works with latest versions. [GH-4224] - hosts/freebsd: NFS exports are proper syntax. [GH-4143] - hosts/gentoo: NFS works with latest versions. [GH-4418] - hosts/windows: RDP command works without crash. [GH-3962] - providers/docker: Port on its own will choose random host port. [GH-3991] - providers/docker: The proxy VM Vagrantfile can be in the same directory as the main Vagrantfile. [GH-4065] - providers/virtualbox: Increase network device limit to 36. [GH-4206] - providers/virtualbox: Error if can't detect VM name. [GH-4047] - provisioners/cfengine: Fix default Yum repo URL. [GH-4335] - provisioners/chef: Chef client cleanup should work. [GH-4099] - provisioners/puppet: Manifest file can be a directory. [GH-4169] - provisioners/puppet: Properly escape facter variables for PowerShell on Windows guests. [GH-3959] - provisioners/puppet: When provisioning fails, don't repeat all of stdout/stderr. [GH-4303] - provisioners/salt: Update salt minion version on Windows. [GH-3932] - provisioners/shell: If args is an array and contains numbers, it no longer crashes. [GH-4234] - provisioners/shell: If fails, the output/stderr isn't repeated again. [GH-4087] ## 1.6.3 (May 29, 2014) FEATURES: - **New Guest:** NixOS - Supports changing host names and setting networks. [GH-3830] IMPROVEMENTS: - core: A CA path can be specified in the Vagrantfile, not just a file, when using a custom CA. [GH-3848] - commands/box/add: `--capath` flag added for custom CA path. [GH-3848] - commands/halt: Halt in reverse order of up, like destroy. [GH-3790] - hosts/linux: Uses rdesktop to RDP into machines if available. [GH-3845] - providers/docker: Support for UDP forwarded ports. [GH-3886] - provisioners/salt: Works on Windows guests. [GH-3825] BUG FIXES: - core: Provider plugins more easily are compatible with global-status and should show less stale data. [GH-3808] - core: When setting a synced folder, it will assume it is not disabled unless explicitly specified. [GH-3783] - core: Ignore UDP forwarded ports for collision detection. [GH-3859] - commands/package: Package with `--base` for VirtualBox doesn't crash. [GH-3827] - guests/solaris11: Fix issue with public network and DHCP on newer Solaris releases. [GH-3874] - guests/windows: Private networks with static IPs work when there is more than one. [GH-3818] - guests/windows: Don't look up a forwarded port for WinRM if we're not accessing the local host. [GH-3861] - guests/windows: Fix errors with arg lists that are too long over WinRM in some cases. [GH-3816] - guests/windows: Powershell exits with proper exit code, fixing - issues where non-zero exit codes weren't properly detected. [GH-3922] - hosts/windows: Don't execute mstsc using PowerShell since it doesn't exit properly. [GH-3837] - hosts/windows: For RDP, don't remove the Tempfile right away. [GH-3875] - providers/docker: Never do graceful shutdown, always use `docker stop`. [GH-3798] - providers/docker: Better error messaging when SSH is not ready direct to container. [GH-3763] - providers/docker: Don't port map SSH port if container doesn't support SSH. [GH-3857] - providers/docker: Proper SSH info if using native driver. [GH-3799] - providers/docker: Verify host VM has SSH ready. [GH-3838] - providers/virtualbox: On Windows, check `VBOX_MSI_INSTALL_PATH` for VBoxManage path as well. [GH-3852] - provisioners/puppet: Fix setting facter vars with Windows guests. [GH-3776] - provisioners/puppet: On Windows, run in elevated prompt. [GH-3903] - guests/darwin: Respect mount options for NFS. [GH-3791] - guests/freebsd: Properly register the rsync_pre capability - guests/windows: Certain executed provisioners won't leave output and exit status behind. [GH-3729] - synced\_folders/rsync: `rsync__chown` can be set to `false` to disable recursive chown after sync. [GH-3810] - synced\_folders/rsync: Use a proper msys path if not in Cygwin. [GH-3804] - synced\_folders/rsync: Don't append args infinitely, clear out arg list on each run. [GH-3864] PLUGIN AUTHOR CHANGES: - Providers can now implement the `rdp_info` provider capability to get proper info for `vagrant rdp` to function. ## 1.6.2 (May 12, 2014) IMPROVEMENTS: - core: Automatically forward WinRM port if communicator is WinRM. [GH-3685] - command/rdp: Args after "--" are passed directly through to the RDP client. [GH-3686] - providers/docker: `build_args` config to specify extra args for `docker build`. [GH-3684] - providers/docker: Can specify options for the build dir synced folder when a host VM is in use. [GH-3727] - synced\_folders/nfs: Can tell Vagrant not to handle exporting by setting `nfs_export: false` [GH-3636] BUG FIXES: - core: Hostnames can be one character. [GH-3713] - core: Don't lock machines on SSH actions. [GH-3664] - core: Fixed crash when adding a box from Vagrant Cloud that was the same name as a real directory. [GH-3732] - core: Parallelization is more stable, doesn't crash due to to bad locks. [GH-3735] - commands/package: Don't double included files in package. [GH-3637] - guests/linux: Rsync chown ignores symlinks. [GH-3744] - provisioners/shell: Fix shell provisioner config validation when the `binary` option is set to false [GH-3712] - providers/docker: default proxy VM won't use HGFS [GH-3687] - providers/docker: fix container linking [GH-3719] - providers/docker: Port settings expose to host properly. [GH-3723] - provisioners/puppet: Separate module paths with ';' on Windows. [GH-3731] - synced\_folders\rsync: Copy symlinks as real files. [GH-3734] - synced\_folders/rsync: Remove non-portable '-v' flag from chown. [GH-3743] ## 1.6.1 (May 7, 2014) IMPROVEMENTS: - **New guest: Linux Mint** is now properly detected. [GH-3648] BUG FIXES: - core: Global control works from directories that don't have a Vagrantfile. - core: Plugins that define config methods that collide with Ruby Kernel/Object - methods are merged properly. [GH-3670] - commands/docker-run: `--help` works. [GH-3698] - commands/package: `--base` works without crashing for VirtualBox. - commands/reload: If `--provision` is specified, force provisioning. [GH-3657] - guests/redhat: Fix networking issues with CentOS. [GH-3649] - guests/windows: Human error if WinRM not in use to configure networks. [GH-3651] - guests/windows: Puppet exit code 2 doesn't cause Windows to raise an error. [GH-3677] - providers/docker: Show proper error message when on Linux. [GH-3654] - providers/docker: Proxy VM works properly even if default provider environmental variable set to "docker" [GH-3662] - providers/docker: Put sync folders in `/var/lib/docker` because it usually has disk space. [GH-3680] - synced\_folders/rsync: Create the directory before syncing. ## 1.6.0 (May 6, 2014) BACKWARDS INCOMPATIBILITIES: - Deprecated: `halt_timeout` and `halt_check_interval` settings for SmartOS, Solaris, and Solaris11 guests. These will be fully removed in 1.7. A warning will be shown if they're in use in 1.6. FEATURES: - **New guest: Windows**. Vagrant now fully supports Windows as a guest VM. WinRM can be used for communication (or SSH), and the shell provisioner, Chef, and Puppet all work with Windows VMs. - **New command: global-status**. This command shows the state of every created Vagrant environment on the system for that logged in user. - **New command: rdp**. This command connects to the running machine via the Remote Desktop Protocol. - **New command: version**. This outputs the currently installed version as well as the latest version of Vagrant available. - **New provider: Docker**. This provider will back your development environments with Docker containers. If you're not on Linux, it will automatically spin up a VM for you on any provider. You can even specify a specific Vagrantfile to use as the Docker container host. - Control Vagrant environments from any directory. Using the UUIDs given in `vagrant global-status`, you can issue commands from anywhere on your machine, not just that environment's directory. Example: `vagrant destroy UUID` from anywhere. - Can now specify a `post_up_message` in your Vagrantfile that is shown after a `vagrant up`. This is useful for putting some instructions of how to use the development environment. - Can configure provisioners to run "once" or "always" (defaults to "once"), so that subsequent `vagrant up` or `reload` calls will always run a provisioner. [GH-2421] - Multi-machine environments can specify an "autostart" option (default to true). `vagrant up` starts all machines that have enabled autostart. - Vagrant is smarter about choosing a default provider. If `VAGRANT_DEFAULT_PROVIDER` is set, it still takes priority, but otherwise Vagrant chooses a "best" provider. IMPROVEMENTS: - core: Vagrant locks machine access to one Vagrant process at a time. This will protect against two simultaneous `up` actions happening on the same environment. - core: Boxes can be compressed with LZMA now as well. - commands/box/remove: Warns if the box appears to be in use by an environment. Can be forced with `--force`. - commands/destroy: Exit codes changes. 0 means everything succeeded. 1 means everything was declined. 2 means some were declined. [GH-811] - commands/destroy: Doesn't require box to exist anymore. [GH-1629] - commands/init: force flag. [GH-3564] - commands/init: flag for minimal Vagrantfile creation (no comments). [GH-3611] - commands/rsync-auto: Picks up and syncs provisioner folders if provisioners are backed by rsync. - commands/rsync-auto: Detects when new synced folders were added and warns user they won't be synced until `vagrant reload`. - commands/ssh-config: Works without a target in multi-machine envs [GH-2844] - guests/freebsd: Support for virtio interfaces. [GH-3082] - guests/openbsd: Support for virtio interfaces. [GH-3082] - guests/redhat: Networking works for upcoming RHEL7 release. [GH-3643] - providers/hyperv: Implement `vagrant ssh -c` support. [GH-3615] - provisioners/ansible: Support for Ansible Vault. [GH-3338] - provisioners/ansible: Show Ansible command executed. [GH-3628] - provisioners/salt: Colorize option. [GH-3603] - provisioners/salt: Ability to specify log level. [GH-3603] - synced\_folders: nfs: Improve sudo commands used to make them sudoers friendly. Examples in docs. [GH-3638] BUG FIXES: - core: Adding a box from a network share on Windows works again. [GH-3279] - commands/plugin/install: Specific versions are now locked in. - commands/plugin/install: If insecure RubyGems.org is specified as a source, use that. [GH-3610] - commands/rsync-auto: Interrupt exits properly. [GH-3552] - commands/rsync-auto: Run properly on Windows. [GH-3547] - communicators/ssh: Detect if `config.ssh.shell` is invalid. [GH-3040] - guests/debian: Can set hostname if hosts doesn't contain an entry already for 127.0.1.1 [GH-3271] - guests/linux: For `read_ip_address` capability, set `LANG=en` so it works on international systems. [GH-3029] - providers/virtualbox: VirtalBox detection works properly again on Windows when the `VBOX_INSTALL_PATH` has multiple elements. [GH-3549] - providers/virtualbox: Forcing MAC address on private network works properly again. [GH-3588] - provisioners/chef-solo: Fix Chef version checking to work with prerelease versions. [GH-3604] - provisioners/salt: Always copy keys and configs on provision. [GH-3536] - provisioners/salt: Install args should always be present with bootstrap. - provisioners/salt: Overwrite keys properly on subsequent provisions [GH-3575] - provisioners/salt: Bootstrap uses raw GitHub URL rather than subdomain. [GH-3583] - synced\_folders/nfs: Acquires a process-level lock so exports don't collide with Vagrant running in parallel. - synced\_folders/nfs: Implement usability check so that hosts that don't support NFS get an error earlier. [GH-3625] - synced\_folders/rsync: Add UserKnownHostsFile option to not complain. [GH-3511] - synced\_folders/rsync: Proxy command is used properly if set. [GH-3553] - synced\_folders/rsync: Owner/group settings are respected. [GH-3544] - synced\_folders/smb: Passwords with symbols work. [GH-3642] PLUGIN AUTHOR CHANGES: - **New host capability:** "rdp\_client". This capability gets the RDP connection info and must launch the RDP client on the system. - core: The "Call" middleware now merges the resulting middleware stack into the current stack, rather than running it as a separate stack. The result is that ordering is preserved. - core: The "Message" middleware now takes a "post" option that will output the message on the return-side of the middleware stack. - core: Forwarded port collision repair works when Vagrant is run in parallel with other Vagrant processes. [GH-2966] - provider: Providers can now specify that boxes are optional. This lets you use the provider without a `config.vm.box`. Useful for providers like AWS or Docker. - provider: A new class-level `usable?` method can be implemented on the provider implementation. This returns or raises an error when the provider is not usable (i.e. VirtualBox isn't installed for VirtualBox) - synced\_folders: New "disable" method for removing synced folders from a running machine. ## 1.5.4 (April 21, 2014) IMPROVEMENTS: - commands/box/list: Doesn't parse Vagrantfile. [GH-3502] - providers/hyperv: Implement the provision command. [GH-3494] BUG FIXES: - core: Allow overriding of the default SSH port. [GH-3474] - commands/box/remove: Make output nicer. [GH-3470] - commands/box/update: Show currently installed version. [GH-3467] - command/rsync-auto: Works properly on Windows. - guests/coreos: Fix test for Docker daemon running. - guests/linux: Fix test for Docker provisioner whether Docker is running. - guests/linux: Fix regression where rsync owner/group stopped working. [GH-3485] - provisioners/docker: Fix issue where we weren't waiting for Docker to properly start before issuing commands. [GH-3482] - provisioners/shell: Better validation of master config path, results in no more stack traces at runtime. [GH-3505] ## 1.5.3 (April 14, 2014) IMPROVEMENTS: - core: 1.5 upgrade code gives users a chance to quit. [GH-3212] - commands/rsync-auto: An initial sync is done before watching folders. [GH-3327] - commands/rsync-auto: Exit immediately if there are no paths to watch. [GH-3446] - provisioners/ansible: custom vars/hosts files can be added in .vagrant/provisioners/ansible/inventory/ directory [GH-3436] BUG FIXES: - core: Randomize some filenames internally to improve the parallelism of Vagrant. [GH-3386] - core: Don't error if network problems cause box update check to fail [GH-3391] - core: `vagrant` on Windows cmd.exe doesn't always exit with exit code zero. [GH-3420] - core: Adding a box from a network share has nice error on Windows. [GH-3279] - core: Setting an ID on a provisioner now works. [GH-3424] - core: All synced folder paths containing symlinks are fully expanded before sharing. [GH-3444] - core: Windows no longer sees "process not started" errors rarely. - commands/box/repackage: Works again. [GH-3372] - commands/box/update: Update should check for updates from latest version. [GH-3452] - commands/package: Nice error if includes contain symlinks. [GH-3200] - commands/rsync-auto: Don't crash if the machine can't be communicated to. [GH-3419] - communicators/ssh: Throttle connection attempt warnings if the warnings are the same. [GH-3442] - guests/coreos: Docker provisioner works. [GH-3425] - guests/fedora: Fix hostname setting. [GH-3382] - guests/fedora: Support predictable network interface names for public/private networks. [GH-3207] - guests/linux: Rsync folders have proper group if owner not set. [GH-3223] - guests/linux: If SMB folder mounting fails, the password will no longer be shown in plaintext in the output. [GH-3203] - guests/linux: SMB mount works with passwords with symbols. [GH-3202] - providers/hyperv: Check for PowerShell features. [GH-3398] - provisioners/docker: Don't automatically generate container name with a forward slash. [GH-3216] - provisioners/shell: Empty shell scripts don't cause errors. [GH-3423] - synced\_folders/smb: Only set the chmod properly by default on Windows if it isn't already set. [GH-3394] - synced\_folders/smb: Sharing folders with odd characters like parens works properly now. [GH-3405] ## 1.5.2 (April 2, 2014) IMPROVEMENTS: - **New guest:** SmartOS - core: Change wording from "error" to "warning" on SSH retry output to convey actual meaning. - commands/plugin: Listing plugins now has machine-readable output. [GH-3293] - guests/omnios: Mount NFS capability [GH-3282] - synced\_folders/smb: Verify PowerShell v3 or later is running. [GH-3257] BUG FIXES: - core: Vagrant won't collide with newer versions of Bundler [GH-3193] - core: Allow provisioner plugins to not have a config class. [GH-3272] - core: Removing a specific box version that doesn't exist doesn't crash Vagrant. [GH-3364] - core: SSH commands are forced to be ASCII. - core: private networks with DHCP type work if type parameter is a string and not a symbol. [GH-3349] - core: Converting to cygwin path works for folders with spaces. [GH-3304] - core: Can add boxes with spaces in their path. [GH-3306] - core: Prerelease plugins installed are locked to that prerelease version. [GH-3301] - core: Better error message when adding a box with a malformed version. [GH-3332] - core: Fix a rare issue where vagrant up would complain it couldn't check version of a box that doesn't exist. [GH-3326] - core: Box version constraint can't be specified with old-style box. [GH-3260] - commands/box: Show versions when listing. [GH-3316] - commands/box: Outdated check can list local boxes that are newer. [GH-3321] - commands/status: Machine readable output contains the target. [GH-3218] - guests/arch: Reload udev rules after network change. [GH-3322] - guests/debian: Changing host name works properly. [GH-3283] - guests/suse: Shutdown works correctly on SLES [GH-2775] - hosts/linux: Don't hardcode `exportfs` path. Now searches the PATH. [GH-3292] - providers/hyperv: Resume command works properly. [GH-3336] - providers/virtualbox: Add missing translation for stopping status. [GH-3368] - providers/virtualbox: Host-only networks set cableconnected property to "yes" [GH-3365] - provisioners/docker: Use proper flags for 0.9. [GH-3356] - synced\_folders/rsync: Set chmod flag by default on Windows. [GH-3256] - synced\_folders/smb: IDs of synced folders are hashed to work better with VMware. [GH-3219] - synced\_folders/smb: Properly remove existing folders with the same name. [GH-3354] - synced\_folders/smb: Passwords with symbols now work. [GH-3242] - synced\_folders/smb: Exporting works for non-english locale Windows machines. [GH-3251] ## 1.5.1 (March 13, 2014) IMPROVEMENTS: - guests/tinycore: Will now auto-install rsync. - synced\_folders/rsync: rsync-auto will not watch filesystem for excluded paths. [GH-3159] BUG FIXES: - core: V1 Vagrantfiles can upgrade provisioners properly. [GH-3092] - core: Rare EINVAL errors on box adding are gone. [GH-3094] - core: Upgrading the home directory for Vagrant 1.5 uses the Vagrant temp dir. [GH-3095] - core: Assume a box isn't metadata if it exceeds 20 MB. [GH-3107] - core: Asking for input works even in consoles that don't support hiding input. [GH-3119] - core: Adding a box by path in Cygwin on Windos works. [GH-3132] - core: PowerShell scripts work when they're in a directory with spaces. [GH-3100] - core: If you add a box path that doesn't exist, error earlier. [GH-3091] - core: Validation on forwarded ports to make sure they're between 0 and 65535. [GH-3187] - core: Downloads with user/password use the curl `-u` flag. [GH-3183] - core: `vagrant help` no longer loads the Vagrantfile. [GH-3180] - guests/darwin: Fix an exception when configuring networks. [GH-3143] - guests/linux: Only chown folders/files in rsync if they don't have the proper owner. [GH-3186] - hosts/linux: Unusual sed delimiter to avoid conflicts. [GH-3167] - providers/virtualbox: Make more internal interactions with VBoxManage retryable to avoid spurious VirtualBox errors. [GH-2831] - providers/virtualbox: Import progress works again on Windows. - provisioners/ansible: Request SSH info within the provision method, when we know its available. [GH-3111] - synced\_folders/rsync: owner/group settings work. [GH-3163] ## 1.5.0 (March 10, 2014) BREAKING CHANGES: - provisioners/ansible: the machine name (taken from Vagrantfile) is now set as default limit to ensure that vagrant provision steps only affect the expected machine. DEPRECATIONS: - provisioners/chef-solo: The "nfs" setting has been replaced by `synced_folder_type`. The "nfs" setting will be removed in the next version. - provisioners/puppet: The "nfs" setting has been replaced by `synced_folder_type`. The "nfs" setting will be removed in the next version. FEATURES: - **New provider:** Hyper-V. If you're on a Windows machine with Hyper-V enabled, Vagrant can now manage Hyper-V virtual machines out of the box. - **New guest:** Funtoo (change host name and networks supported) - **New guest:** NetBSD - **New guest:** TinyCore Linux. This allows features such as networking, halting, rsync and more work with Boot2Docker. - **New synced folder type:** rsync - Does a one-time one-directional sync to the guest machine. New commands `vagrant rsync` and `vagrant rsync-auto` can resync the folders. - **New synced folder type:** SMB- Allows bi-directional folder syncing using SMB on Windows hosts with any guest. - Password-based SSH authentication. This lets you use almost any off-the-shelf virtual machine image with Vagrant. Additionally, Vagrant will automatically insert a keypair into the machine. - Plugin versions can now be constrained to a range of versions. Example: `vagrant plugin install foo --plugin-version "> 1.0, < 1.1"` - Host-specific operations now use a "host capabilities" system much like guests have used "guest capabilities" for a few releases now. This allows plugin developers to create pluggable host-specific capabilities and makes further integrating Vagrant with new operating systems even easier. - You can now override provisioners within sub-VM configuration and provider overrides. See documentation for more info. [GH-1113] - providers/virtualbox: Provider-specific configuration `cpus` can be used to set the number of CPUs on the VM [GH-2800] - provisioners/docker: Can now build images using `docker build`. [GH-2615] IMPROVEMENTS: - core: Added "error-exit" type to machine-readable output which contains error information that caused a non-zero exit status. [GH-2999] - command/destroy: confirmation will re-ask question if bad input. [GH-3027] - guests/solaris: More accurate Solaris >= 11, < 11 detection. [GH-2824] - provisioners/ansible: Generates a single inventory file, rather than one per machine. See docs for more info. [GH-2991] - provisioners/ansible: SSH forwarding support. [GH-2952] - provisioners/ansible: Multiple SSH keys can now be attempted [GH-2952] - provisioners/ansible: Disable SSH host key checking by default, which improves the experience. We believe this is a sane default for ephemeral dev machines. - provisioners/chef-solo: New config `synced_folder_type` replaces the `nfs` option. This can be used to set the synced folders the provisioner needs to any type. [GH-2709] - provisioners/chef-solo: `roles_paths` can now be an array of paths in Chef 11.8.0 and newer. [GH-2975] - provisioners/docker: Can start a container without daemonization. - provisioners/docker: Started containers are given names. [GH-3051] - provisioners/puppet: New config `synced_folder_type` replaces the `nfs` option. This can be used to set the synced folders the provisioner needs to any type. [GH-2709] - commands/plugin: `vagrant plugin update` will now update all installed plugins, respecting any constraints set. - commands/plugin: `vagrant plugin uninstall` can now uninstall multiple plugins. - commands/plugin: `vagrant plugin install` can now install multiple plugins. - hosts/redhat: Recognize Korora OS. [GH-2869] - synced\_folders/nfs: If the guest supports it, NFS clients will be automatically installed in the guest. BUG FIXES: - core: If an exception was raised while attempting to connect to SSH for the first time, it would get swallowed. It is properly raised now. - core: Plugin installation does not fail if your local gemrc file has syntax errors. - core: Plugins that fork within certain actions will no longer hang indefinitely. [GH-2756] - core: Windows checks home directory permissions more correctly to warn of potential issues. - core: Synced folders set to the default synced folder explicitly won't be deleted. [GH-2873] - core: Static IPs can end in ".1". A warning is now shown. [GH-2914] - core: Adding boxes that have directories in them works on Windows. - core: Vagrant will not think provisioning is already done if the VM is manually deleted outside of Vagrant. - core: Box file checksums of large files works properly on Windows. [GH-3045] - commands/box: Box add `--force` works with `--provider` flag. [GH-2757] - commands/box: Listing boxes with machine-readable output crash is gone. - commands/plugin: Plugin installation will fail if dependencies conflict, rather than at runtime. - commands/ssh: When using `-c` on Windows, no more TTY errors. - commands/ssh-config: ProxyCommand is included in output if it is set. [GH-2950] - guests/coreos: Restart etcd after configuring networks. [GH-2852] - guests/linux: Don't chown VirtualBox synced folders if mounting as readonly. [GH-2442] - guests/redhat: Set hostname to FQDN, per the documentation for RedHat. [GH-2792] - hosts/bsd: Don't invoke shell for NFS sudo calls. [GH-2808] - hosts/bsd: Sort NFS exports to avoid false validation errors. [GH-2927] - hosts/bsd: No more checkexports NFS errors if you're sharing the same directory. [GH-3023] - hosts/gentoo: Look for systemctl in `/usr/bin` [GH-2858] - hosts/linux: Properly escape regular expression to prune NFS exports, allowing VMware to work properly. [GH-2934] - hosts/opensuse: Start NFS server properly. [GH-2923] - providers/virtualbox: Enabling internal networks by just setting "true" works properly. [GH-2751] - providers/virtualbox: Make more internal interactions with VBoxManage retryable to avoid spurious VirtualBox errors. [GH-2831] - providers/virtualbox: Config validation catches invalid keys. [GH-2843] - providers/virtualbox: Fix network adapter configuration issue if using provider-specific config. [GH-2854] - providers/virtualbox: Bridge network adapters always have their "cable connected" properly. [GH-2906] - provisioners/chef: When chowning folders, don't follow symlinks. - provisioners/chef: Encrypted data bag secrets also in Chef solo are now uploaded to the provisioning path to avoid perm issues. [GH-2845] - provisioners/chef: Encrypted data bag secret is removed from the machine before and after provisioning also with Chef client. [GH-2845] - provisioners/chef: Set `encrypted_data_bag_secret` on the VM to `nil` if the secret is not specified. [GH-2984] - provisioners/chef: Fix loading of the custom configure file. [GH-876] - provisioners/docker: Only add SSH user to docker group if the user isn't already in it. [GH-2838] - provisioners/docker: Configuring autostart works properly with the newest versions of Docker. [GH-2874] - provisioners/puppet: Append default module path to the module paths always. [GH-2677] - provisioners/salt: Setting pillar data doesn't require `deep_merge` plugin anymore. [GH-2348] - provisioners/salt: Options can now set install type and install args. [GH-2766] - provisioners/salt: Fix case when salt would say "options only allowed before install arguments" [GH-3005] - provisioners/shell: Error if script is encoded incorrectly. [GH-3000] - synced\_folders/nfs: NFS entries are pruned on every `vagrant up`, if there are any to prune. [GH-2738] ## 1.4.3 (January 2, 2014) BUG FIXES: - providers/virtualbox: `vagrant package` works properly again. [GH-2739] ## 1.4.2 (December 31, 2013) IMPROVEMENTS: - guests/linux: emit upstart event when NFS folders are mounted. [GH-2705] - provisioners/chef-solo: Encrypted data bag secret is removed from the machine after provisioning. [GH-2712] BUG FIXES: - core: Ctrl-C no longer raises "trap context" exception. - core: The version for `Vagrant.configure` can now be an int. [GH-2689] - core: `Vagrant.has_plugin?` tries to use plugin's gem name before registered plugin name [GH-2617] - core: Fix exception if an EOFError was somehow raised by Ruby while checking a box checksum. [GH-2716] - core: Better error message if your plugin state file becomes corrupt somehow. [GH-2694] - core: Box add will fail early if the box already exists. [GH-2621] - hosts/bsd: Only run `nfsd checkexports` if there is an exports file. [GH-2714] - commands/plugin: Fix exception that could happen rarely when installing a plugin. - providers/virtualbox: Error when packaging if the package already exists _before_ the export is done. [GH-2380] - providers/virtualbox: NFS with static IP works even if VirtualBox guest additions aren't installed (regression). [GH-2674] - synced\_folders/nfs: sudo will only ask for password one at a time when using a parallel provider [GH-2680] ## 1.4.1 (December 18, 2013) IMPROVEMENTS: - hosts/bsd: check NFS exports file for issues prior to exporting - provisioners/ansible: Add ability to use Ansible groups in generated inventory [GH-2606] - provisioners/docker: Add support for using the provisioner with RedHat based guests [GH-2649] - provisioners/docker: Remove "Docker" prefix from Client and Installer classes [GH-2641] BUG FIXES: - core: box removal of a V1 box works - core: `vagrant ssh -c` commands are now executed in the context of a login shell (regression). [GH-2636] - core: specifying `-t` or `-T` to `vagrant ssh -c` as extra args will properly enable/disable a TTY for OpenSSH. [GH-2618] - commands/init: Error if can't write Vagrantfile to directory. [GH-2660] - guests/debian: fix `use_dhcp_assigned_default_route` to work properly. [GH-2648] - guests/debian,ubuntu: fix change\_host\_name for FQDNs with trailing dots [GH-2610] - guests/freebsd: configuring networks in the guest works properly [GH-2620] - guests/redhat: fix configure networks bringing down interfaces that don't exist. [GH-2614] - providers/virtualbox: Don't override NFS exports for all VMs when coming up. [GH-2645] - provisioners/ansible: Array arguments work for raw options [GH-2667] - provisioners/chef-client: Fix node/client deletion when node\_name is not set. [GH-2345] - provisioners/chef-solo: Force remove files to avoid cases where a prompt would be shown to users. [GH-2669] - provisioners/puppet: Don't prepend default module path for Puppet in case Puppet is managing its own paths. [GH-2677] ## 1.4.0 (December 9, 2013) FEATURES: - New provisioner: Docker. Install Docker, pull containers, and run containers easier than ever. - Machine readable output. Vagrant now has machine-friendly output by using the `--machine-readable` flag. - New plugin type: synced folder implementation. This allows new ways of syncing folders to be added as plugins to Vagrant. - The `Vagrant.require_version` function can be used at the top of a Vagrantfile to enforce a minimum/maximum Vagrant version. - Adding boxes via `vagrant box add` and the Vagrantfile both support providing checksums of the box files. - The `--debug` flag can be specified on any command now to get debug-level log output to ease reporting bugs. - You can now specify a memory using `vb.memory` setting with VirtualBox. - Plugin developers can now hook into `environment_plugins_loaded`, which is executed after plugins are loaded but before Vagrantfiles are parsed. - VirtualBox internal networks are now supported. [GH-2020] IMPROVEMENTS: - core: Support resumable downloads [GH-57] - core: owner/group of shared folders can be specified by integers. [GH-2390] - core: the VAGRANT\_NO\_COLOR environmental variable may be used to enable `--no-color` mode globally. [GH-2261] - core: box URL and add date is tracked and shown if `-i` flag is specified for `vagrant box list` [GH-2327] - core: Multiple SSH keys can be specified with `config.ssh.private_key_path` [GH-907] - core: `config.vm.box_url` can be an array of URLs. [GH-1958] - commands/box/add: Can now specify a custom CA cert for verifying certs from a custom CA. [GH-2337] - commands/box/add: Can now specify a client cert when downloading a box. [GH-1889] - commands/init: Add `--output` option for specifying output path, or "-" for stdin. [GH-1364] - commands/provision: Add `--no-parallel` option to disable provider parallelization if the provider supports it. [GH-2404] - commands/ssh: SSH compression is enabled by default. [GH-2456] - commands/ssh: Inline commands specified with "-c" are now executed using OpenSSH rather than pure-Ruby SSH. It is MUCH faster, and stdin works! - communicators/ssh: new configuration `config.ssh.pty` is a boolean for whether you want ot use a PTY for provisioning. - guests/linux: emit upstart event `vagrant-mounted` if upstart is available. [GH-2502] - guests/pld: support changing hostname [GH-2543] - providers/virtualbox: Enable symlinks for VirtualBox 4.1. [GH-2414] - providers/virtualbox: default VM name now includes milliseconds with a random number to try to avoid conflicts in CI environments. [GH-2482] - providers/virtualbox: customizations via VBoxManage are retried, avoiding VirtualBox flakiness [GH-2483] - providers/virtualbox: NFS works with DHCP host-only networks now. [GH-2560] - provisioners/ansible: allow files for extra vars [GH-2366] - provisioners/puppet: client cert and private key can now be specified for the puppet server provisioner. [GH-902] - provisioners/puppet: the manifests path can be in the VM. [GH-1805] - provisioners/shell: Added `keep_color` option to not automatically color output based on stdout/stderr. [GH-2505] - provisioners/shell: Arguments can now be an array of args. [GH-1949] - synced\_folders/nfs: Specify `nfs_udp` to false to disable UDP based NFS folders. [GH-2304] BUG FIXES: - core: Make sure machine IDs are always strings. [GH-2434] - core: 100% CPU spike when waiting for SSH is fixed. [GH-2401] - core: Command lookup works on systems where PATH is not valid UTF-8 [GH-2514] - core: Human-friendly error if box metadata.json becomes corrupted. [GH-2305] - core: Don't load Vagrantfile on `vagrant plugin` commands, allowing Vagrantfiles that use plugins to work. [GH-2388] - core: global flags are ignored past the "--" on the CLI. [GH-2491] - core: provisoining will properly happen if `up` failed. [GH-2488] - guests/freebsd: Mounting NFS folders works. [GH-2400] - guests/freebsd: Uses `sh` by default for shell. [GH-2485] - guests/linux: upstart events listening for `vagrant-mounted` won't wait for jobs to complete, fixing issues with blocking during vagrant up [GH-2564] - guests/redhat: `DHCP_HOSTNAME` is set to the hostname, not the FQDN. [GH-2441] - guests/redhat: Down interface before messing up configuration file for networking. [GH-1577] - guests/ubuntu: "localhost" is preserved when changing hostnames. [GH-2383] - hosts/bsd: Don't set mapall if maproot is set in NFS. [GH-2448] - hosts/gentoo: Support systemd for NFS startup. [GH-2382] - providers/virtualbox: Don't start new VM if VirtualBox has transient failure during `up` from suspended. [GH-2479] - provisioners/chef: Chef client encrypted data bag secrets are now uploaded to the provisioning path to avoid perm issues. [GH-1246] - provisioners/chef: Create/chown the cache and backup folders. [GH-2281] - provisioners/chef: Verify environment paths exist in config validation step. [GH-2381] - provisioners/puppet: Multiple puppet definitions in a Vagrantfile work correctly. - provisioners/salt: Bootstrap on FreeBSD systems work. [GH-2525] - provisioners/salt: Extra args for bootstrap are put in the proper location. [GH-2558] ## 1.3.5 (October 15, 2013) FEATURES: - VirtualBox 4.3 is now supported. [GH-2374] - ESXi is now a supported guest OS. [GH-2347] IMPROVEMENTS: - guests/redhat: Oracle Linux is now supported. [GH-2329] - provisioners/salt: Support running overstate. [GH-2313] BUG FIXES: - core: Fix some places where "no error message" errors were being reported when in fact there were errors. [GH-2328] - core: Disallow hyphens or periods for starting hostnames. [GH-2358] - guests/ubuntu: Setting hostname works properly. [GH-2334] - providers/virtualbox: Retryable VBoxManage commands are properly retried. [GH-2365] - provisioners/ansible: Verbosity won't be blank by default. [GH-2320] - provisioners/chef: Fix exception raised during Chef client node cleanup. [GH-2345] - provisioners/salt: Correct master seed file name. [GH-2359] ## 1.3.4 (October 2, 2013) FEATURES: - provisioners/shell: Specify the `binary` option as true and Vagrant won't automatically replace Windows line endings with Unix ones. [GH-2235] IMPROVEMENTS: - guests/suse: Support installing CFEngine. [GH-2273] BUG FIXES: - core: Don't output `\e[0K` anymore on Windows. [GH-2246] - core: Only modify `DYLD_LIBRARY_PATH` on Mac when executing commands in the installer context. [GH-2231] - core: Clear `DYLD_LIBRARY_PATH` on Mac if the subprocess is executing a setuid or setgid script. [GH-2243] - core: Defined action hook names can be strings now. They are converted to symbols internally. - guests/debian: FQDN is properly set when setting the hostname. [GH-2254] - guests/linux: Fix poor chown command for mounting VirtualBox folders. - guests/linux: Don't raise exception right away if mounting fails, allow retries. [GH-2234] - guests/redhat: Changing hostname changes DHCP_HOSTNAME. [GH-2267] - hosts/arch: Vagrant won't crash on Arch anymore. [GH-2233] - provisioners/ansible: Extra vars are converted to strings. [GH-2244] - provisioners/ansible: Output will show up on a task-by-task basis. [GH-2194] - provisioners/chef: Propagate disabling color if Vagrant has no color enabled. [GH-2246] - provisioners/chef: Delete from chef server exception fixed. [GH-2300] - provisioners/puppet: Work with restrictive umask. [GH-2241] - provisioners/salt: Remove bootstrap definition file on each run in order to avoid permissions issues. [GH-2290] ## 1.3.3 (September 18, 2013) BUG FIXES: - core: Fix issues with dynamic linker not finding symbols on OS X. [GH-2219] - core: Properly clean up machine directories on destroy. [GH-2223] - core: Add a timeout to waiting for SSH connection and server headers on SSH. [GH-2226] ## 1.3.2 (September 17, 2013) IMPROVEMENTS: - provisioners/ansible: Support more verbosity levels, better documentation. [GH-2153] - provisioners/ansible: Add `host_key_checking` configuration. [GH-2203] BUG FIXES: - core: Report the proper invalid state when waiting for the guest machine to be ready - core: `Guest#capability?` now works with strings as well - core: Fix NoMethodError in the new `Vagrant.has_plugin?` method [GH-2189] - core: Convert forwarded port parameters to integers. [GH-2173] - core: Don't spike CPU to 100% while waiting for machine to boot. [GH-2163] - core: Increase timeout for individual SSH connection to 60 seconds. [GH-2163] - core: Call realpath after creating directory so NFS directory creation works. [GH-2196] - core: Don't try to be clever about deleting the machine state directory anymore. Manually done in destroy actions. [GH-2201] - core: Find the root Vagrantfile only if Vagrantfile is a file, not a directory. [GH-2216] - guests/linux: Try `id -g` in addition to `getent` for mounting VirtualBox shared folders [GH-2197] - hosts/arch: NFS exporting works properly, no exceptions. [GH-2161] - hosts/bsd: Use only `sudo` for writing NFS exports. This lets NFS exports work if you have sudo privs but not `su`. [GH-2191] - hosts/fedora: Fix host detection encoding issues. [GH-1977] - hosts/linux: Fix NFS export problems with `no_subtree_check`. [GH-2156] - installer/mac: Vagrant works properly when a library conflicts from homebrew. [GH-2188] - installer/mac: deb/rpm packages now have an epoch of 1 so that new installers don't appear older. [GH-2179] - provisioners/ansible: Default output level is now verbose again. [GH-2194] - providers/virtualbox: Fix an issue where destroy middlewares weren't being properly called. [GH-2200] ## 1.3.1 (September 6, 2013) BUG FIXES: - core: Fix various issues where using the same options hash in a Vagrantfile can cause errors. - core: `VAGRANT_VAGRANTFILE` env var only applies to the project Vagrantfile name. [GH-2130] - core: Fix an issue where the data directory would be deleted too quickly in a multi-VM environment. - core: Handle the case where we get an EACCES cleaning up the .vagrant directory. - core: Fix exception on upgrade warnings from V1 to V2. [GH-2142] - guests/coreos: Proper IP detection. [GH-2146] - hosts/linux: NFS exporting works properly again. [GH-2137] - provisioners/chef: Work even with restrictive umask on user. [GH-2121] - provisioners/chef: Fix environment validation to be less restrictive. - provisioners/puppet: No more "shared folders cannot be found" error. [GH-2134] - provisioners/puppet: Work with restrictive umask on user by testing for folders with sudo. [GH-2121] ## 1.3.0 (September 5, 2013) BACKWARDS INCOMPATIBILITY: - `config.ssh.max_tries` is gone. Instead of maximum tries, Vagrant now uses a simple overall timeout value `config.vm.boot_timeout` to wait for the machine to boot up. - `config.vm.graceful_halt_retry_*` settings are gone. Instead, a single timeout is now used to wait for a graceful halt to work, specified by `config.vm.graceful_halt_timeout`. - The ':extra' flag to shared folders for specifying arbitrary mount options has been replaced with the `:mount_options` flag, which is now an array of mount options. - `vagrant up` will now only run provisioning by default the first time it is run. Subsequent `reload` or `up` will need to explicitly specify the `--provision` flag to provision. [GH-1776] FEATURES: - New command: `vagrant plugin update` to update specific installed plugins. - New provisioner: File provisioner. [GH-2112] - New provisioner: Salt provisioner. [GH-1626] - New guest: Mac OS X guest support. [GH-1914] - New guest: CoreOS guest support. Change host names and configure networks on CoreOS. [GH-2022] - New guest: Solaris 11 guest support. [GH-2052] - Support for environments in the Chef-solo provisioner. [GH-1915] - Provisioners can now define "cleanup" tasks that are executed on `vagrant destroy`. [GH-1302] - Chef Client provisioner will now clean up the node/client using `knife` if configured to do so. - `vagrant up` has a `--no-destroy-on-error` flag that will not destroy the VM if a fatal error occurs. [GH-2011] - NFS: Arbitrary mount options can be specified using the `mount_options` option on synced folders. [GH-1029] - NFS: Arbitrary export options can be specified using `bsd__nfs_options` and `linux__nfs_options`. [GH-1029] - Static IP can now be set on public networks. [GH-1745] - Add `Vagrant.has_plugin?` method for use in Vagrantfile to check if a plugin is installed. [GH-1736] - Support for remote shell provisioning scripts [GH-1787] IMPROVEMENTS: - core: add `--color` to any Vagrant command to FORCE color output. [GH-2027] - core: "config.vm.host_name" works again, just an alias to hostname. - core: Reboots via SSH are now handled gracefully (without exception). - core: Mark `disabled` as true on forwarded port to disable. [GH-1922] - core: NFS exports are now namespaced by user ID, so pruning NFS won't remove exports from other users. [GH-1511] - core: "vagrant -v" no longer loads the Vagrantfile - commands/box/remove: Fix stack trace that happens if no provider is specified. [GH-2100] - commands/plugin/install: Post install message of a plugin will be shown if available. [GH-1986] - commands/status: cosmetic improvement to better align names and statuses [GH-2016] - communicators/ssh: Support a proxy_command. [GH-1537] - guests/openbsd: support configuring networks, changing host name, and mounting NFS. [GH-2086] - guests/suse: Supports private/public networks. [GH-1689] - hosts/fedora: Support RHEL as a host. [GH-2088] - providers/virtualbox: "post-boot" customizations will run directly after boot, and before waiting for SSH. [GH-2048] - provisioners/ansible: Many more configuration options. [GH-1697] - provisioners/ansible: Ansible `inventory_path` can be a directory now. [GH-2035] - provisioners/ansible: Extra verbose option by setting `config.verbose` to `extra`. [GH-1979] - provisioners/ansible: `inventory_path` will be auto-generated if not specified. [GH-1907] - provisioners/puppet: Add `nfs` option to puppet provisioner. [GH-1308] - provisioners/shell: Set the `privileged` option to false to run without sudo. [GH-1370] BUG FIXES: - core: Clean up ".vagrant" folder more effectively. - core: strip newlines off of ID file values [GH-2024] - core: Multiple forwarded ports with different protocols but the same host port can be specified. [GH-2059] - core: `:nic_type` option for private networks is respected. [GH-1704] - commands/up: provision-with validates the provisioners given. [GH-1957] - guests/arch: use systemd way of setting host names. [GH-2041] - guests/debian: Force bring up eth0. Fixes hangs on setting hostname. [GH-2026] - guests/ubuntu: upstart events are properly emitted again. [GH-1717] - hosts/bsd: Nicer error if can't read NFS exports. [GH-2038] - hosts/fedora: properly detect later CentOS versions. [GH-2008] - providers/virtualbox: VirtualBox 4.2 now supports up to 36 network adapters. [GH-1886] - provisioners/ansible: Execute ansible with a cwd equal to the path where the Vagrantfile is. [GH-2051] - provisioners/all: invalid config keys will be properly reported. [GH-2117] - provisioners/ansible: No longer report failure on every run. [GH-2007] - provisioners/ansible: Properly handle extra vars with spaces. [GH-1984] - provisioners/chef: Formatter option works properly. [GH-2058] - provisioners/chef: Create/chown the provisioning folder before reading contents. [GH-2121] - provisioners/puppet: mount synced folders as root to avoid weirdness - provisioners/puppet: Run from the correct working directory. [GH-1967] with Puppet. [GH-2015] - providers/virtualbox: Use `getent` to get the group ID instead of `id` in case the name doesn't have a user. [GH-1801] - providers/virtualbox: Will only set the default name of the VM on initial `up`. [GH-1817] ## 1.2.7 (July 28, 2013) BUG FIXES: - On Windows, properly convert synced folder host path to a string so that separator replacement works properly. - Use `--color=false` for no color in Puppet to support older versions properly. [GH-2000] - Make sure the hostname configuration is a string. [GH-1999] - cURL downloads now contain a user agent which fixes some issues with downloading Vagrant through proxies. [GH-2003] - `vagrant plugin install` will now always properly show the actual installed gem name. [GH-1834] ## 1.2.6 (July 26, 2013) BUG FIXES: - Box collections with multiple formats work properly by converting the supported formats to symbols. [GH-1990] ## 1.2.5 (July 26, 2013) FEATURES: - `vagrant help <command>` now works. [GH-1578] - Added `config.vm.box_download_insecure` to allow the box_url setting to point to an https site that won't be validated. [GH-1712] - VirtualBox VBoxManage customizations can now be specified to run pre-boot (the default and existing functionality, pre-import, or post-boot. [GH-1247] - VirtualBox no longer destroys unused network interfaces by default. This didn't work across multi-user systems and required admin privileges on Windows, so it has been disabled by default. It can be enabled using the VirtualBox provider-specific `destroy_unused_network_interfaces` configuration by setting it to true. [GH-1324] IMPROVEMENTS: - Remote commands that fail will now show the stdout/stderr of the command that failed. [GH-1203] - Puppet will run without color if the UI is not colored. [GH-1344] - Chef supports the "formatter" configuration for setting the formatter. [GH-1250] - VAGRANT_DOTFILE_PATH environmental variable reintroduces the functionality removed in 1.1 from "config.dotfile_name" [GH-1524] - Vagrant will show an error if VirtualBox 4.2.14 is running. - Added provider to BoxNotFound error message. [GH-1692] - If Ansible fails to run properly, show an error message. [GH-1699] - Adding a box with the `--provider` flag will now allow a box for any of that provider's supported formats. - NFS mounts enable UDP by default, resulting in higher performance. (Because mount is over local network, packet loss is not an issue) [GH-1706] BUG FIXES: - `box_url` now handles the case where the provider doesn't perfectly match the provider in use, but the provider supports it. [GH-1752] - Fix uninitialized constant error when configuring Arch Linux network. [GH-1734] - Debian/Ubuntu change hostname works properly if eth0 is configured with hot-plugging. [GH-1929] - NFS exports with improper casing on Mac OS X work properly. [GH-1202] - Shared folders overriding '/vagrant' in multi-VM environments no longer all just use the last value. [GH-1935] - NFS export fsid's are now 32-bit integers, rather than UUIDs. This lets NFS exports work with Linux kernels older than 2.6.20. [GH-1127] - NFS export allows access from all private networks on the VM. [GH-1204] - Default VirtualBox VM name now contains the machine name as defined in the Vagrantfile, helping differentiate multi-VM. [GH-1281] - NFS works properly on CentOS hosts. [GH-1394] - Solaris guests actually shut down properly. [GH-1506] - All provisioners only output newlines when the provisioner sends a newline. This results in the output looking a lot nicer. - Sharing folders works properly if ".profile" contains an echo. [GH-1677] - `vagrant ssh-config` IdentityFile is only wrapped in quotes if it contains a space. [GH-1682] - Shared folder target path can be a Windows path. [GH-1688] - Forwarded ports don't auto-correct by default, and will raise an error properly if they collide. [GH-1701] - Retry SSH on ENETUNREACH error. [GH-1732] - NFS is silently ignored on Windows. [GH-1748] - Validation so that private network static IP does not end in ".1" [GH-1750] - With forward agent enabled and sudo being used, Vagrant will automatically discover and set `SSH_AUTH_SOCK` remotely so that forward agent works properly despite misconfigured sudoers. [GH-1307] - Synced folder paths on Windows containing '\' are replaced with '/' internally so that they work properly. - Unused config objects are finalized properly. [GH-1877] - Private networks work with Fedora guests once again. [GH-1738] - Default internal encoding of strings in Vagrant is now UTF-8, allowing detection of Fedora to work again (which contained a UTF-8 string). [GH-1977] ## 1.2.4 (July 16, 2013) FEATURES: - Chef solo and client provisioning now support a `custom_config_path` setting that accepts a path to a Ruby file to load as part of Chef configuration, allowing you to override any setting available. [GH-876] - CFEngine provisioner: you can now specify the package name to install, so CFEngine enterprise is supported. [GH-1920] IMPROVEMENTS: - `vagrant box remove` works with only the name of the box if that box exists only backed by one provider. [GH-1032] - `vagrant destroy` returns exit status 1 if any of the confirmations are declined. [GH-923] - Forwarded ports can specify a host IP and guest IP to bind to. [GH-1121] - You can now set the "ip" of a private network that uses DHCP. This will change the subnet and such that the DHCP server uses. - Add `file_cache_path` support for chef_solo. [GH-1897] BUG FIXES: - VBoxManage or any other executable missing from PATH properly reported. Regression from 1.2.2. [GH-1928] - Boxes downloaded as part of `vagrant up` are now done so _prior_ to config validation. This allows Vagrantfiles to references files that may be in the box itself. [GH-1061] - Chef removes dna.json and encrypted data bag secret file prior to uploading. [GH-1111] - NFS synced folders exporting sub-directories of other exported folders now works properly. [GH-785] - NFS shared folders properly dereference symlinks so that the real path is used, avoiding mount errors [GH-1101] - SSH channel is closed after the exit status is received, potentially eliminating any SSH hangs. [GH-603] - Fix regression where VirtualBox detection wasn't working anymore. [GH-1918] - NFS shared folders with single quotes in their name now work properly. [GH-1166] - Debian/Ubuntu request DHCP renewal when hostname changes, which will fix issues with FQDN detecting. [GH-1929] - SSH adds the "DSAAuthentication=yes" option in case that is disabled on the user's system. [GH-1900] ## 1.2.3 (July 9, 2013) FEATURES: - Puppet provisioner now supports Hiera by specifying a `hiera_config_path`. - Added a `working_directory` configuration option to the Puppet apply provisioner so you can specify the working directory when `puppet` is called, making it friendly to Hiera data and such. [GH-1670] - Ability to specify the host IP to bind forwarded ports to. [GH-1785] IMPROVEMENTS: - Setting hostnames works properly on OmniOS. [GH-1672] - Better VBoxManage error detection on Windows systems. This avoids some major issues where Vagrant would sometimes "lose" your VM. [GH-1669] - Better detection of missing VirtualBox kernel drivers on Linux systems. [GH-1671] - More precise detection of Ubuntu/Debian guests so that running Vagrant within an LXC container works properly now. - Allow strings in addition to symbols to more places in V1 configuration as well as V2 configuration. - Add `ARPCHECK=0` to RedHat OS family network configuration. [GH-1815] - Add SSH agent forwarding sample to initial Vagrantfile. [GH-1808] - VirtualBox: Only configure networks if there are any to configure. This allows linux's that don't implement this capability to work with Vagrant. [GH-1796] - Default SSH forwarded port now binds to 127.0.0.1 so only local connections are allowed. [GH-1785] - Use `netctl` for Arch Linux network configuration. [GH-1760] - Improve fedora host detection regular expression. [GH-1913] - SSH shows a proper error on EHOSTUNREACH. [GH-1911] BUG FIXES: - Ignore "guest not ready" errors when attempting to graceful halt and carry on checks whether the halt succeeded. [GH-1679] - Handle the case where a roles path for Chef solo isn't properly defined. [GH-1665] - Finding V1 boxes now works properly again to avoid "box not found" errors. [GH-1691] - Setting hostname on SLES 11 works again. [GH-1781] - `config.vm.guest` properly forces guests again. [GH-1800] - The `read_ip_address` capability for linux properly reads the IP of only the first network interface. [GH-1799] - Validate that an IP is given for a private network. [GH-1788] - Fix uninitialized constant error for Gentoo plugin. [GH-1698] ## 1.2.2 (April 23, 2013) FEATURES: - New `DestroyConfirm` built-in middleware for providers so they can more easily conform to the `destroy` action. IMPROVEMENTS: - No longer an error if the Chef run list is empty. It is now a warning. [GH-1620] - Better locking around handling the `box_url` parameter for parallel providers. - Solaris guest is now properly detected on SmartOS, OmniOS, etc. [GH-1639] - Guest addition version detection is more robust, attempting other routes to get the version, and also retrying a few times. [GH-1575] BUG FIXES: - `vagrant package --base` works again. [GH-1615] - Box overrides specified in provider config overrides no longer fail to detect the box. [GH-1617] - In a multi-machine environment, a box not found won't be downloaded multiple times. [GH-1467] - `vagrant box add` with a file path now works correctly on Windows when a drive letter is specified. - DOS line endings are converted to Unix line endings for the shell provisioner automatically. [GH-1495] ## 1.2.1 (April 17, 2013) FEATURES: - Add a `--[no-]parallel` flag to `vagrant up` to enable/disable parallelism. Vagrant will parallelize by default. IMPROVEMENTS: - Get rid of arbitrary 4 second sleep when connecting via SSH. The issue it was attempting to work around may be gone now. BUG FIXES: - Chef solo run list properly set. [GH-1608] - Follow 30x redirects when downloading boxes. [GH-1607] - Chef client config defaults are done properly. [GH-1609] - VirtualBox mounts shared folders with the proper owner/group. [GH-1611] - Use the Mozilla CA cert bundle for cURL so SSL validation works properly. ## 1.2.0 (April 16, 2013) BACKWARDS INCOMPATIBILITIES: - WINDOWS USERS: Vagrant now defaults to using the 'USERPROFILE' environmental variable for the home directory if it is set. This means that the default location for the Vagrant home directory is now `%USERPROFILE%/.vagrant.d`. On Cygwin, this will cause existing Cygwin users to "lose" their boxes. To work around this, either set `VAGRANT_HOME` to your Cygwin ".vagrant.d" folder or move your ".vagrant.d" folder to `USERPROFILE`. The latter is recommended for long-term support. - The constant `Vagrant::Environment::VAGRANT_HOME` was removed in favor of `Vagrant::Environment#default_vagrant_home`. FEATURES: - Providers can now parallelize! If they explicitly support it, Vagrant will run "up" and other commands in parallel. For providers such AWS, this means that your instances will come up in parallel. VirtualBox does not support this mode. - Box downloads are now done via `curl` rather than Ruby's built-in HTTP library. This results in massive speedups, support for SSL verification, FTP downloads, and more. - `config.vm.provider` now takes an optional second parameter to the block, allowing you to override any configuration value. These overrides are applied last, and therefore override any other configuration value. Note that while this feature is available, the "Vagrant way" is instead to use box manifests to ensure that the "box" for every provider matches, so these sorts of overrides are unnecessary. - A new "guest capabilities" system to replace the old "guest" system. This new abstraction allows plugins to define "capabilities" that certain guest operating systems can implement. This allows greater flexibility in doing guest-specific behavior. - Ansible provisioner support. [GH-1465] - Providers can now support multiple box formats by specifying the `box_format:` option. - CFEngine provisioner support. - `config.ssh.default` settings introduced to set SSH defaults that providers can still override. [GH-1479] IMPROVEMENTS: - Full Windows support in cmd.exe, PowerShell, Cygwin, and MingW based environments. - By adding the "disabled" boolean flag to synced folders you can disable them altogether. [GH-1004] - Specify the default provider with the `VAGRANT_DEFAULT_PROVIDER` environmental variable. [GH-1478] - Invalid settings are now caught and shown in a user-friendly way. [GH-1484] - Detect PuTTY Link SSH client on Windows and show an error. [GH-1518] - `vagrant ssh` in Cygwin won't output DOS path file warnings. - Add `--rtcuseutc on` as a sane default for VirtualBox. [GH-912] - SSH will send keep-alive packets every 5 seconds by default to keep connections alive. Can be disabled with `config.ssh.keep_alive`. [GH-516] - Show a message on `vagrant up` if the machine is already running. [GH-1558] - "Running provisioner" output now shoes the provisioner shortcut name, rather than the less-than-helpful class name. - Shared folders with the same guest path will overwrite each other. No more shared folder IDs. - Shell provisioner outputs script it is running. [GH-1568] - Automatically merge forwarded ports that share the same host port. BUG FIXES: - The `:mac` option for host-only networks is respected. [GH-1536] - Don't preserve modified time when untarring boxes. [GH-1539] - Forwarded port auto-correct will not auto-correct to a port that is also in use. - Cygwin will always output color by default. Specify `--no-color` to override this. - Assume Cygwin has a TTY for asking for input. [GH-1430] - Expand Cygwin paths to Windows paths for calls to VBoxManage and for VirtualBox shared folders. - Output the proper clear line text for shells in Cygwin when reporting dynamic progress. - When using `Builder` instances for hooks, the builders will be merged for the proper before/after chain. [GH-1555] - Use the Vagrant temporary directory again for temporary files since they can be quite large and were messing with tmpfs. [GH-1442] - Fix issue parsing extra SSH args in `vagrant ssh` in multi-machine environments. [GH-1545] - Networks come back up properly on RedHat systems after reboot. [GH-921] - `config.ssh` settings override all detected SSH settings (regression). [GH-1479] - `ssh-config` won't raise an exception if the VirtualBox machine is not created. [GH-1562] - Multiple machines defined in the same Vagrantfile with the same name will properly merge. - More robust hostname checking for RedHat. [GH-1566] - Cookbook path existence for Chef is no longer an error, so that things like librarian and berkshelf plugins work properly. [GH-1570] - Chef solo provisioner uses proper SSH username instead of hardcoded config. [GH-1576] - Shell provisioner takes ownership of uploaded files properly so that they can also be manually executed later. [GH-1576] ## 1.1.6 (April 3, 2013) BUG FIXES: - Fix SSH re-use connection logic to drop connection if an error occurs. ## 1.1.5 (April 2, 2013) IMPROVEMENTS: - More robust SSH connection close detection. - Don't load `vagrant plugin` installed plugins when in a Bundler environment. This happens during plugin development. This will make Vagrant errors much quieter when developing plugins. - Vagrant will detect Bundler environments, make assumptions that you're developing plugins, and will quiet its error output a bit. - More comprehensive synced folder configuration validation. - VBoxManage errors now show the output from the command so that users can potentially know what is wrong. BUG FIXES: - Proper error message if invalid provisioner is used. [GH-1515] - Don't error on graceful halt if machine just shut down very quickly. [GH-1505] - Error message if private key for SSH isn't owned by the proper user. [GH-1503] - Don't error too early when `config.vm.box` is not properly set. - Show a human-friendly error if VBoxManage is not found (exit status 126). [GH-934] - Action hook prepend/append will only prepend or append once. - Retry SSH on Errno::EACCES. - Show an error if an invalid network type is used. - Don't share Chef solo folder if it doesn't exist on host. ## 1.1.4 (March 25, 2013) BUG FIXES: - Default forwarded port adapter for VirtualBox should be 1. ## 1.1.3 (March 25, 2013) IMPROVEMENTS: - Puppet apply provisioner now retains the default module path even while specifying custom module paths. [GH-1207] - Re-added DHCP support for host-only networks. [GH-1466] - Ability to specify a plugin version, plugin sources, and pre-release versions using `--plugin-version`, `--plugin-source`, and `--plugin-prerelease`. [GH-1461] - Move VirtualBox guest addition checks to after the machine boots. [GH-1179] - Removed `Vagrant::TestHelpers` because it doesn't really work anymore. - Add PLX linux guest support. [GH-1490] BUG FIXES: - Attempt to re-establish SSH connection on `Net::SSH::Disconnect` - Allow any value that can convert to a string for `Vagrant.plugin` - Chef solo `recipe_url` works properly again. [GH-1467] - Port collision detection works properly in VirtualBox with auto-corrected ports. [GH-1472] - Fix obscure error when temp directory is world writable when adding boxes. - Improved error handling around network interface detection for VirtualBox [GH-1480] ## 1.1.2 (March 18, 2013) BUG FIXES: - When not specifying a cookbooks_path for chef-solo, an error won't be shown if "cookbooks" folder is missing. - Fix typo for exception when no host-only network with NFS. [GH-1448] - Use UNSET_VALUE/nil with args on shell provisioner by default since `[]` was too truthy. [GH-1447] ## 1.1.1 (March 18, 2013) IMPROVEMENTS: - Don't load plugins on any `vagrant plugin` command, so that errors are avoided. [GH-1418] - An error will be shown if you forward a port to the same host port multiple times. - Automatically convert network, provider, and provisioner names to symbols internally in case people define them as strings. - Using newer versions of net-ssh and net-scp. [GH-1436] BUG FIXES: - Quote keys to StringBlockEditor so keys with spaces, parens, and so on work properly. - When there is no route to host for SSH, re-establish a new connection. - `vagrant package` once again works, no more nil error. [GH-1423] - Human friendly error when "metadata.json" is missing in a box. - Don't use the full path to the manifest file with the Puppet provisioner because it exposes a bug with Puppet path lookup on VMware. - Fix bug in VirtualBox provider where port forwarding just didn't work if you attempted to forward to a port under 1024. [GH-1421] - Fix cross-device box adds for Windows. [GH-1424] - Fix minor issues with defaults of configuration of the shell provisioner. - Fix Puppet server using "host_name" instead of "hostname" [GH-1444] - Raise a proper error if no hostonly network is found for NFS with VirtualBox. [GH-1437] ## 1.1.0 (March 14, 2013) BACKWARDS INCOMPATIBILITIES: - Vagrantfiles from 1.0.x that _do not use_ any plugins are fully backwards compatible. If plugins are used, they must be removed prior to upgrading. The new plugin system in place will avoid this issue in the future. - Lots of changes introduced in the form of a new configuration version and format, but this is _opt-in_. Old Vagrantfile format continues to be supported, as promised. To use the new features that will be introduced throughout the 1.x series, you'll have to upgrade at some point. FEATURES: - Groundwork for **providers**, alternate backends for Vagrant that allow Vagrant to power systems other than VirtualBox. Much improvement and change will come to this throughout the 1.x lifecycle. The API will continue to change, features will be added, and more. Specifically, a revamped system for handling shared folders gracefully across providers will be introduced in a future release. - New plugin system which adds much more structure and stability to the overall API. The goal of this system is to make it easier to write powerful plugins for Vagrant while providing a backwards-compatible API so that plugins will always _load_ (though they will almost certainly not be _functional_ in future versions of Vagrant). - Plugins are now installed and managed using the `vagrant plugin` interface. - Allow "file://" URLs for box URLs. [GH-1087] - Emit "vagrant-mount" upstart event when NFS shares are mounted. [GH-1118] - Add a VirtualBox provider config `auto_nat_dns_proxy` which when set to false will not attempt to automatically manage NAT DNS proxy settings with VirtualBox. [GH-1313] - `vagrant provision` accepts the `--provision-with` flag [GH-1167] - Set the name of VirtualBox machines with `virtualbox.name` in the VirtualBox provider config. [GH-1126] - `vagrant ssh` will execute an `ssh` binary on Windows if it is on your PATH. [GH-933] - The environmental variable `VAGRANT_VAGRANTFILE` can be used to specify an alternate Vagrantfile filename. IMPROVEMENTS / BUG FIXES: - Vagrant works much better in Cygwin environments on Windows by properly resolving Cygwin paths. [GH-1366] - Improve the SSH "ready?" check by more gracefully handling timeouts. [GH-841] - Human friendly error if connection times out for HTTP downloads. [GH-849] - Detect when the VirtualBox installation is incomplete and error. [GH-846] - Detect when kernel modules for VirtualBox need to be installed on Gentoo systems and report a user-friendly error. [GH-710] - All `vagrant` commands that can take a target VM name can take one even if you're not in a multi-VM environment. [GH-894] - Hostname is set before networks are setup to avoid very slow `sudo` speeds on CentOS. [GH-922] - `config.ssh.shell` now includes the flags to pass to it, such as `-l` [GH-917] - The check for whether a port is open or not is more complete by catching ENETUNREACH errors. [GH-948] - SSH uses LogLevel FATAL so that errors are still shown. - Sending a SIGINT (Ctrl-C) very early on when executing `vagrant` no longer results in an ugly stack trace. - Chef JSON configuration output is now pretty-printed to be human readable. [GH-1146] that SSHing succeeds when booting a machine. - VMs in the "guru meditation" state can be destroyed now using `vagrant destroy`. - Fix issue where changing SSH key permissions didn't properly work. [GH-911] - Fix issue where Vagrant didn't properly detect VBoxManage on Windows if VBOX_INSTALL_PATH contained multiple paths. [GH-885] - Fix typo in setting host name for Gentoo guests. [GH-931] - Files that are included with `vagrant package --include` now properly preserve file attributes on earlier versions of Ruby. [GH-951] - Multiple interfaces now work with Arch linux guests. [GH-957] - Fix issue where subprocess execution would always spin CPU of Ruby process to 100%. [GH-832] - Fix issue where shell provisioner would sometimes never end. [GH-968] - Fix issue where puppet would reorder module paths. [GH-964] - When console input is asked for (destroying a VM, bridged interfaces, etc.), keystrokes such as ctrl-D and ctrl-C are more gracefully handled. [GH-1017] - Fixed bug where port check would use "localhost" on systems where "localhost" is not available. [GH-1057] - Add missing translation for "saving" state on VirtualBox. [GH-1110] - Proper error message if the remote end unexpectedly resets the connection while downloading a box over HTTP. [GH-1090] - Human-friendly error is raised if there are permission issues when using SCP to upload files. [GH-924] - Box adding doesn't use `/tmp` anymore which can avoid some cross-device copy issues. [GH-1199] - Vagrant works properly in folders with strange characters. [GH-1223] - Vagrant properly handles "paused" VirtualBox machines. [GH-1184] - Better behavior around permissions issues when copying insecure private key. [GH-580] ## 1.0.7 (March 13, 2013) - Detect if a newer version of Vagrant ran and error if it did, because we're not forward-compatible. - Check for guest additions version AFTER booting. [GH-1179] - Quote IdentityFile in `ssh-config` so private keys with spaces in the path work. [GH-1322] - Fix issue where multiple Puppet module paths can be re-ordered [GH-964] - Shell provisioner won't hang on Windows anymore due to unclosed tempfile. [GH-1040] - Retry setting default VM name, since it sometimes fails first time. [GH-1368] - Support setting hostname on Suse [GH-1063] ## 1.0.6 (December 21, 2012) - Shell provisioner outputs proper line endings on Windows [GH-1164] - SSH upload opens file to stream which fixes strange upload issues. - Check for proper exit codes for Puppet, since multiple exit codes can mean success. [GH-1180] - Fix issue where DNS doesn't resolve properly for 12.10. [GH-1176] - Allow hostname to be a substring of the box name for Ubuntu [GH-1163] - Use `puppet agent` instead of `puppetd` to be Puppet 3.x compatible. [GH-1169] - Work around bug in VirtualBox exposed by bug in OS X 10.8 where VirtualBox executables couldn't handle garbage being injected into stdout by OS X. ## 1.0.5 (September 18, 2012) - Work around a critical bug in VirtualBox 4.2.0 on Windows that causes Vagrant to not work. [GH-1130] - Plugin loading works better on Windows by using the proper file path separator. - NFS works on Fedora 16+. [GH-1140] - NFS works with newer versions of Arch hosts that use systemd. [GH-1142] ## 1.0.4 (September 13, 2012) - VirtualBox 4.2 driver. [GH-1120] - Correct `ssh-config` help to use `--host`, not `-h`. - Use "127.0.0.1" instead of "localhost" for port checking to fix problem where "localhost" is not properly setup. [GH-1057] - Disable read timeout on Net::HTTP to avoid `rbuf_fill` error. [GH-1072] - Retry SSH on `EHOSTUNREACH` errors. - Add missing translation for "saving" state. [GH-1110] ## 1.0.3 (May 1, 2012) - Don't enable NAT DNS proxy on machines where resolv.conf already points to localhost. This allows Vagrant to work once again with Ubuntu 12.04. [GH-909] ## 1.0.2 (March 25, 2012) - Provisioners will still mount folders and such if `--no-provision` is used, so that `vagrant provision` works. [GH-803] - Nicer error message if an unsupported SSH key type is used. [GH-805] - Gentoo guests can now have their host names changed. [GH-796] - Relative paths can be used for the `config.ssh.private_key_path` setting. [GH-808] - `vagrant ssh` now works on Solaris, where `IdentitiesOnly` was not an available option. [GH-820] - Output works properly in the face of broken pipes. [GH-819] - Enable Host IO Cache on the SATA controller by default. - Chef-solo provisioner now supports encrypted data bags. [GH-816] - Enable the NAT DNS proxy by default, allowing your DNS to continue working when you switch networks. [GH-834] - Checking for port forwarding collisions also checks for other applications that are potentially listening on that port as well. [GH-821] - Multiple VM names can be specified for the various commands now. For example: `vagrant up web db service`. [GH-795] - More robust error handling if a VM fails to boot. The error message is much clearer now. [GH-825] ## 1.0.1 (March 11, 2012) - Installers are now bundled with Ruby 1.9.3p125. Previously they were bundled with 1.9.3p0. This actually fixes some IO issues with Windows. - Windows installer now outputs a `vagrant` binary that will work in msys or Cygwin environments. - Fix crashing issue which manifested itself in multi-VM environments. - Add missing `rubygems` require in `environment.rb` to avoid possible load errors. [GH-781] - `vagrant destroy` shows a nice error when called without a TTY (and hence can't confirm). [GH-779] - Fix an issue with the `:vagrantfile_name` option to `Vagrant::Environment` not working properly. [GH-778] - `VAGRANT_CWD` environmental variable can be used to set the CWD to something other than the current directory. - Downloading boxes from servers that don't send a content-length now works properly. [GH-788] - The `:facter` option now works for puppet server. [GH-790] - The `--no-provision` and `--provision-with` flags are available to `vagrant reload` now. - `:openbsd` guest which supports only halting at the moment. [GH-773] - `ssh-config -h` now shows help, instead of assuming a host is being specified. For host, you can still use `--host`. [GH-793] ## 1.0.0 (March 6, 2012) - `vagrant gem` should now be used to install Vagrant plugins that are gems. This installs the gems to a private gem folder that Vagrant adds to its own load path. This isolates Vagrant-related gems from system gems. - Plugin loading no longer happens right when Vagrant is loaded, but when a Vagrant environment is loaded. I don't anticipate this causing any problems but it is a backwards incompatible change should a plugin depend on this (but I don't see any reason why they would). - `vagrant destroy` now asks for confirmation by default. This can be overridden with the `--force` flag. [GH-699] - Fix issue with Puppet config inheritance. [GH-722] - Fix issue where starting a VM on some systems was incorrectly treated as failing. [GH-720] - It is now an error to specify the packaging `output` as a directory. [GH-730] - Unix-style line endings are used properly for guest OS. [GH-727] - Retry certain VirtualBox operations, since they intermittently fail. [GH-726] - Fix issue where Vagrant would sometimes "lose" a VM if an exception occurred. [GH-725] - `vagrant destroy` destroys virtual machines in reverse order. [GH-739] - Add an `fsid` option to Linux NFS exports. [GH-736] - Fix edge case where an exception could be raised in networking code. [GH-742] - Add missing translation for the "guru meditation" state. [GH-745] - Check that VirtualBox exists before certain commands. [GH-746] - NIC type can be defined for host-only network adapters. [GH-750] - Fix issue where re-running chef-client would sometimes cause problems due to file permissions. [GH-748] - FreeBSD guests can now have their hostnames changed. [GH-757] - FreeBSD guests now support host only networking and bridged networking. [GH-762] - `VM#run_action` is now public so plugin-devs can hook into it. - Fix crashing bug when attempting to run commands on the "primary" VM in a multi-VM environment. [GH-761] - With puppet you can now specify `:facter` as a dictionary of facts to override what is generated by Puppet. [GH-753] - Automatically convert all arguments to `customize` to strings. - openSUSE host system. [GH-766] - Fix subprocess IO deadlock which would occur on Windows. [GH-765] - Fedora 16 guest support. [GH-772] ## 0.9.7 (February 9, 2012) - Fix regression where all subprocess IO simply didn't work with Windows. [GH-721] ## 0.9.6 (February 7, 2012) - Fix strange issue with inconsistent childprocess reads on JRuby. [GH-711] - `vagrant ssh` does a direct `exec()` syscall now instead of going through the shell. This makes it so things like shell expansion oddities no longer cause problems. [GH-715] - Fix crashing case if there are no ports to forward. - Fix issue surrounding improper configuration of host only networks on RedHat guests. [GH-719] - NFS should work properly on Gentoo. [GH-706] ## 0.9.5 (February 5, 2012) - Fix crashing case when all network options are `:auto_config false`. [GH-689] - Type of network adapter can be specified with `:nic_type`. [GH-690] - The NFS version can be specified with the `:nfs_version` option on shared folders. [GH-557] - Greatly improved FreeBSD guest and host support. [GH-695] - Fix instability with RedHat guests and host only and bridged networks. [GH-698] - When using bridged networking, only list the network interfaces that are up as choices. [GH-701] - More intelligent handling of the `certname` option for puppet server. [GH-702] - You may now explicitly set the network to bridge to in the Vagrantfile using the `:bridge` parameter. [GH-655] ## 0.9.4 (January 28, 2012) - Important internal changes to middlewares that make plugin developer's lives much easier. [GH-684] - Match VM names that have parens, brackets, etc. - Detect when the VirtualBox kernel module is not loaded and error. [GH-677] - Set `:auto_config` to false on any networking option to not automatically configure it on the guest. [GH-663] - NFS shared folder guest paths can now contain shell expansion characters such as `~`. - NFS shared folders with a `:create` flag will have their host folders properly created if they don't exist. [GH-667] - Fix the precedence for Arch, Ubuntu, and FreeBSD host classes so they are properly detected. [GH-683] - Fix issue where VM import sometimes made strange VirtualBox folder layouts. [GH-669] - Call proper `id` command on Solaris. [GH-679] - More accurate VBoxManage error detection. - Shared folders can now be marked as transient using the `:transient` flag. [GH-688] ## 0.9.3 (January 24, 2012) - Proper error handling for not enough arguments to `box` commands. - Fix issue causing crashes with bridged networking. [GH-673] - Ignore host only network interfaces that are "down." [GH-675] - Use "printf" instead of "echo" to determine shell expanded files paths which is more generally POSIX compliant. [GH-676] ## 0.9.2 (January 20, 2012) - Support shell expansions in shared folder guest paths again. [GH-656] - Fix issue where Chef solo always expected the host to have a "cookbooks" folder in their directory. [GH-638] - Fix `forward_agent` not working when outside of blocks. [GH-651] - Fix issue causing custom guest implementations to not load properly. - Filter clear screen character out of output on SSH. - Log output now goes on `stderr`, since it is utility information. - Get rid of case where a `NoMethodError` could be raised while determining VirtualBox version. [GH-658] - Debian/Ubuntu uses `ifdown` again, instead of `ifconfig xxx down`, since the behavior seems different/wrong. - Give a nice error if `:vagrant` is used as a JSON key, since Vagrant uses this. [GH-661] - If there is only one bridgable interface, use that without asking the user. [GH-655] - The shell will have color output if ANSICON is installed on Windows. [GH-666] ## 0.9.1 (January 18, 2012) - Use `ifconfig device down` instead of `ifdown`. [GH-649] - Clearer invalid log level error. [GH-645] - Fix exception raised with NFS `recover` method. - Fix `ui` `NoMethodError` exception in puppet server. - Fix `vagrant box help` on Ruby 1.8.7. [GH-647] ## 0.9.0 (January 17, 2012) - VirtualBox 4.0 support backported in addition to supporting VirtualBox 4.1. - `config.vm.network` syntax changed so that the first argument is now the type of argument. Previously where you had `config.vm.network "33.33.33.10"` you should now put `config.vm.network :hostonly, "33.33.33.10"`. This is in order to support bridged networking, as well. - `config.vm.forward_port` no longer requires a name parameter. - Bridged networking. `config.vm.network` with `:bridged` as the option will setup a bridged network. - Host only networks can be configured with DHCP now. Specify `:dhcp` as the IP and it will be done. - `config.vm.customize` now takes a command to send to `VBoxManage`, so any arbitrary command can be sent. The older style of passing a block no longer works and Vagrant will give a proper error message if it notices this old-style being used. - `config.ssh.forwarded_port_key` is gone. Vagrant no longer cares about forwarded port names for any reason. Please use `config.ssh.guest_port` (more below). - `config.ssh.forwarded_port_destination` has been replaced by `config.ssh.guest_port` which more accurately reflects what it is used for. Vagrant will automatically scan forwarded ports that match the guest port to find the SSH port. - Logging. The entire Vagrant source has had logging sprinkled throughout to make debugging issues easier. To enable logging, set the VAGRANT_LOG environmental variable to the log level you wish to see. By default, logging is silent. - `system` renamed to `guest` throughout the source. Any `config.vm.system` configurations must be changed to `config.vm.guest` - Puppet provisioner no longer defaults manifest to "box.pp." Instead, it is now "default.pp" - All Vagrant commands that take a VM name in a Multi-VM environment can now be given a regular expression. If the name starts and ends with a "/" then it is assumed to be a regular expression. [GH-573] - Added a "--plain" flag to `vagrant ssh` which will cause Vagrant to not perform any authentication. It will simply `ssh` into the proper IP and port of the virtual machine. - If a shared folder now has a `:create` flag set to `true`, the path on the host will be created if it doesn't exist. - Added `--force` flag to `box add`, which will overwite any existing boxes if they exist. [GH-631] - Added `--provision-with` to `up` which configures what provisioners run, by shortcut. [GH-367] - Arbitrary mount options can be passed with `:extra` to any shared folders. [GH-551] - Options passed after a `--` to `vagrant ssh` are now passed directly to `ssh`. [GH-554] - Ubuntu guests will now emit a `vagrant-mounted` upstart event after shared folders are mounted. - `attempts` is a new option on chef client and chef solo provisioners. This will run the provisioner multiple times until erroring about failing convergence. [GH-282] - Removed Thor as a dependency for the command line interfaces. This resulted in general speed increases across all command line commands. - Linux uses `shutdown -h` instead of `halt` to hopefully more consistently power off the system. [GH-575] - Tweaks to SSH to hopefully be more reliable in coming up. - Helpful error message when SCP is unavailable in the guest. [GH-568] - Error message for improperly packaged box files. [GH-198] - Copy insecure private key to user-owned directory so even `sudo` installed Vagrant installations work. [GH-580] - Provisioner stdout/stderr is now color coded based on stdout/stderr. stdout is green, stderr is red. [GH-595] - Chef solo now prompts users to run a `reload` if shared folders are not found on the VM. [GH-253] - "--no-provision" once again works for certain commands. [GH-591] - Resuming a VM from a saved state will show an error message if there would be port collisions. [GH-602] - `vagrant ssh -c` will now exit with the same exit code as the command run. [GH-598] - `vagrant ssh -c` will now send stderr to stderr and stdout to stdout on the host machine, instead of all output to stdout. - `vagrant box add` path now accepts unexpanded shell paths such as `~/foo` and will properly expand them. [GH-633] - Vagrant can now be interrupted during the "importing" step. - NFS exports will no longer be cleared when an expected error occurs. [GH-577] ## 0.8.10 (December 10, 2011) - Revert the SSH tweaks made in 0.8.8. It affected stability ## 0.8.8 (December 1, 2011) - Mount shared folders shortest to longest to avoid mounting subfolders first. [GH-525] - Support for basic HTTP auth in the URL for boxes. - Solaris support for host only networks. [GH-533] - `vagrant init` respects `Vagrant::Environment` cwd. [GH-528] - `vagrant` commands will not output color when stdout is not a TTY. - Fix issue where `box_url` set with multiple VMs could cause issues. [GH-564] - Chef provisioners no longer depend on a "v-root" share being available. [GH-556] - NFS should work for FreeBSD hosts now. [GH-510] - SSH executed methods respect `config.ssh.max_tries`. [GH-508] - `vagrant box add` now respects the "no_proxy" environmental variable. [GH-502] - Tweaks that should make "Waiting for VM to boot" slightly more reliable. - Add comments to Vagrantfile to make it detected as Ruby file for `vi` and `emacs`. [GH-515] - More correct guest addition version checking. [GH-514] - Chef solo support on Windows is improved. [GH-542] - Put encrypted data bag secret into `/tmp` by default so that permissions are almost certainly guaranteed. [GH-512] ## 0.8.7 (September 13, 2011) - Fix regression with remote paths from chef-solo. [GH-431] - Fix issue where Vagrant crashes if `.vagrant` file becomes invalid. [GH-496] - Issue a warning instead of an error for attempting to forward a port <= 1024. [GH-487] ## 0.8.6 (August 28, 2011) - Fix issue with download progress not properly clearing the line. [GH-476] - NFS should work properly on Fedora. [GH-450] - Arguments can be specified to the `shell` provisioner via the `args` option. [GH-475] - Vagrant behaves much better when there are "inaccessible" VMs. [GH-453] ## 0.8.5 (August 15, 2011) Note: 0.8.3 and 0.8.4 was yanked due to RubyGems encoding issue. - Fix SSH `exec!` to inherit proper `$PATH`. [GH-426] - Chef client now accepts an empty (`nil`) run list again. [GH-429] - Fix incorrect error message when running `provision` on halted VM. [GH-447] - Checking guest addition versions now ignores OSE. [GH-438] - Chef solo from a remote URL fixed. [GH-431] - Arch linux support: host only networks and changing the host name. [GH-439] [GH-448] - Chef solo `roles_path` and `data_bags_path` can only be single paths. [GH-446] - Fix `virtualbox_not_detected` error message to require 4.1.x. [GH-458] - Add shortname (`hostname -s`) for hostname setting on RHEL systems. [GH-456] - `vagrant ssh -c` output no longer has a prefix and respects newlines from the output. [GH-462] ## 0.8.2 (July 22, 2011) - Fix issue with SSH disconnects not reconnecting. - Fix chef solo simply not working with roles/data bags. [GH-425] - Multiple chef solo provisioners now work together. - Update Puppet provisioner so no deprecation warning is shown. [GH-421] - Removed error on "provisioner=" in config, as this has not existed for some time now. - Add better validation for networking. ## 0.8.1 (July 20, 2011) - Repush of 0.8.0 to fix a Ruby 1.9.2 RubyGems issue. ## 0.8.0 (July 20, 2011) - VirtualBox 4.1 support _only_. Previous versions of VirtualBox are supported by earlier versions of Vagrant. - Performance optimizations in `virtualbox` gem. Huge speed gains. - `:chef_server` provisioner is now `:chef_client`. [GH-359] - SSH connection is now cached after first access internally, speeding up `vagrant up`, `reload`, etc. quite a bit. - Actions which modify the VM now occur much more quickly, greatly speeding up `vagrant up`, `reload`, etc. - SUSE host only networking support. [GH-369] - Show nice error message for invalid HTTP responses for HTTP downloader. [GH-403] - New `:inline` option for shell provisioner to provide inline scripts as a string. [GH-395] - Host only network now properly works on multiple adapters. [GH-365] - Can now specify owner/group for regular shared folders. [GH-350] - `ssh_config` host name will use VM name if given. [GH-332] - `ssh` `-e` flag changed to `-c` to align with `ssh` standard behavior. [GH-323] - Forward agent and forward X11 settings properly appear in `ssh_config` output. [GH-105] - Chef JSON can now be set with `chef.json =` instead of the old `merge` technique. [GH-314] - Provisioner configuration is no longer cleared when the box needs to be downloaded during an `up`. [GH-308] - Multiple Chef provisioners no longer overwrite cookbook folders. [GH-407] - `package` won't delete previously existing file. [GH-408] - Vagrantfile can be lowercase now. [GH-399] - Only one copy of Vagrant may be running at any given time. [GH-364] - Default home directory for Vagrant moved to `~/.vagrant.d` [GH-333] - Specify a `forwarded_port_destination` for SSH configuration and SSH port searching will fall back to that if it can't find any other port. [GH-375] ## 0.7.8 (July 19, 2011) - Make sure VirtualBox version check verifies that it is 4.0.x. ## 0.7.7 (July 12, 2011) - Fix crashing bug with Psych and Ruby 1.9.2. [GH-411] ## 0.7.6 (July 2, 2011) - Run Chef commands in a single command. [GH-390] - Add `nfs` option for Chef to mount Chef folders via NFS. [GH-378] - Add translation for `aborted` state in VM. [GH-371] - Use full paths with the Chef provisioner so that restart cookbook will work. [GH-374] - Add "--no-color" as an argument and no colorized output will be used. [GH-379] - Added DEVICE option to the RedHat host only networking entry, which allows host only networking to work even if the VM has multiple NICs. [GH-382] - Touch the network configuration file for RedHat so that the `sed` works with host only networking. [GH-381] - Load prerelease versions of plugins if available. - Do not load a plugin if it depends on an invalid version of Vagrant. - Encrypted data bag support in Chef server provisioner. [GH-398] - Use the `-H` flag to set the proper home directory for `sudo`. [GH-370] ## 0.7.5 (May 16, 2011) - `config.ssh.port` can be specified and takes highest precedence if specified. Otherwise, Vagrant will still attempt to auto-detect the port. [GH-363] - Get rid of RubyGems deprecations introduced with RubyGems 1.8.x - Search in pre-release gems for plugins as well as release gems. - Support for Chef-solo `data_bags_path` [GH-362] - Can specify path to Chef binary using `binary_path` [GH-342] - Can specify additional environment data for Chef using `binary_env` [GH-342] ## 0.7.4 (May 12, 2011) - Chef environments support (for Chef 0.10) [GH-358] - Suppress the "added to known hosts" message for SSH [GH-354] - Ruby 1.8.6 support [GH-352] - Chef proxy settings now work for chef server [GH-335] ## 0.7.3 (April 19, 2011) - Retry all SSH on Net::SSH::Disconnect in case SSH is just restarting. [GH-313] - Add NFS shared folder support for Arch linux. [GH-346] - Fix issue with unknown terminal type output for sudo commands. - Forwarded port protocol can now be set as UDP. [GH-311] - Chef server file cache path and file backup path can be configured. [GH-310] - Setting hostname should work on Debian now. [GH-307] ## 0.7.2 (February 8, 2011) - Update JSON dependency to 1.5.1, which works with Ruby 1.9 on Windows. - Fix sudo issues on sudo < 1.7.0 (again). - Fix race condition in SSH, which specifically manifested itself in the chef server provisioner. [GH-295] - Change sudo shell to use `bash` (configurable). [GH-301] - Can now set mac address of host only network. [GH-294] - NFS shared folders with spaces now work properly. [GH-293] - Failed SSH commands now show output in error message. [GH-285] ## 0.7.1 (January 28, 2011) - Change error output with references to VirtualBox 3.2 to 4.0. - Internal SSH through net-ssh now uses `IdentitiesOnly` thanks to upstream net-ssh fix. - Fix issue causing warnings to show with `forwardx11` enabled for SSH. [GH-279] - FreeBSD support for host only networks, NFS, halting, etc. [GH-275] - Make SSH commands which use sudo compatible with sudo < 1.7.0. [GH-278] - Fix broken puppet server provisioner which called a nonexistent method. - Default SSH host changed from `localhost` to `127.0.0.1` since `localhost` is not always loopback. - New `shell` provisioner which simply uploads and executes a script as root on the VM. - Gentoo host only networking no longer fails if already setup. [GH-286] - Set the host name of your guest OS with `config.vm.host_name` [GH-273] - `vagrant ssh-config` now outputs the configured `config.ssh.host` ## 0.7.0 (January 19, 2011) - VirtualBox 4.0 support. Support for VirtualBox 3.2 is _dropped_, since the API is so different. Stay with the 0.6.x series if you have VirtualBox 3.2.x. - Puppet server provisioner. [GH-262] - Use numeric uid/gid in mounting shared folders to increase portability. [GH-252] - HTTP downloading follows redirects. [GH-163] - Downloaders have clearer output to note what they're doing. - Shared folders with no guest path are not automounted. [GH-184] - Boxes downloaded during `vagrant up` reload the Vagrantfile config, which fixes a problem with box settings not being properly loaded. [GH-231] - `config.ssh.forward_x11` to enable the ForwardX11 SSH option. [GH-255] - Vagrant source now has a `contrib` directory where contributions of miscellaneous addons for Vagrant will be added. - Vagrantfiles are now loaded only once (instead of 4+ times) [GH-238] - Ability to move home vagrant dir (~/.vagrant) by setting VAGRANT_HOME environmental variable. - Removed check and error for the "OSE" version of VirtualBox, since with VirtualBox 4 this distinction no longer exists. - Ability to specify proxy settings for chef. [GH-169] - Helpful error message shown if NFS mounting fails. [GH-135] - Gentoo guests now support host only networks. [GH-240] - RedHat (CentOS included) guests now support host only networks. [GH-260] - New Vagrantfile syntax for enabling and configuring provisioners. This change is not backwards compatible. [GH-265] - Provisioners are now RVM-friendly, meaning if you installed chef or puppet with an RVM managed Ruby, Vagrant now finds then. [GH-254] - Changed the unused host only network destroy mechanism to check for uselessness after the VM is destroyed. This should result in more accurate checks. - Networks are no longer disabled upon halt/destroy. With the above change, its unnecessary. - Puppet supports `module_path` configuration to mount local modules directory as a shared folder and configure puppet with it. [GH-270] - `ssh-config` now outputs `127.0.0.1` as the host instead of `localhost`. ## 0.6.9 (December 21, 2010) - Puppet provisioner. [GH-223] - Solaris system configurable to use `sudo`. - Solaris system registered, so it can be set with `:solaris`. - `vagrant package` include can be a directory name, which will cause the contents to be recursively copied into the package. [GH-241] - Arbitrary options to puppet binary can be set with `config.puppet.options`. [GH-242] - BSD hosts use proper GNU sed syntax for clearing NFS shares. [GH-243] - Enumerate VMs in a multi-VM environment in order they were defined. [GH-244] - Check for VM boot changed to use `timeout` library, which works better with Windows. - Show special error if VirtualBox not detected on 64-bit Windows. - Show error to Windows users attempting to use host only networking since it doesn't work yet. ## 0.6.8 (November 30, 2010) - Network interfaces are now up/down in distinct commands instead of just restarting "networking." [GH-192] - Add missing translation for chef binary missing. [GH-203] - Fix default settings for Opscode platform and comments. [GH-213] - Blank client name for chef server now uses FQDN by default, instead of "client" [GH-214] - Run list can now be nil, which will cause it to sync with chef server (when chef server is enabled). [GH-214] - Multiple NFS folders now work on linux. [GH-215] - Add translation for state "stuck" which is very rare. [GH-218] - virtualbox gem dependency minimum raised to 0.7.6 to verify FFI < 1.0.0 is used. - Fix issue where box downloading from `vagrant up` didn't reload the box collection. [GH-229] ## 0.6.7 (November 3, 2010) - Added validation to verify that a box is specified. - Proper error message when box is not found for `config.vm.box`. [GH-195] - Fix output of `vagrant status` with multi-vm to be correct. [GH-196] ## 0.6.6 (October 14, 2010) - `vagrant status NAME` works once again. [GH-191] - Conditional validation of Vagrantfile so that some commands don't validate. [GH-188] - Fix "junk" output for ssh-config. [GH-189] - Fix port collision handling with greater than two VMs. [GH-185] - Fix potential infinite loop with root path if bad CWD is given to environment. ## 0.6.5 (October 8, 2010) - Validations on base MAC address to avoid situation described in GH-166, GH-181 from ever happening again. - Properly load sub-VM configuration on first-pass of config loading. Solves a LOT of problems with multi-VM. [GH-166] [GH-181] - Configuration now only validates on final Vagrantfile proc, so multi-VM validates correctly. - A nice error message is given if ".vagrant" is a directory and therefore can't be accessed. [GH-172] - Fix plugin loading in a Rails 2.3.x project. [GH-176] ## 0.6.4 (October 4, 2010) - Default VM name is now properly the parent folder of the working directory of the environment. - Added method to `TestHelpers` to assist with testing new downloaders. - `up --no-provision` works again. This disables provisioning during the boot process. - Action warden doesn't do recovery process on `SystemExit` exceptions, allowing the double ctrl-C to work properly again. [related to GH-166] - Initial Vagrantfile is now heavily commented with various available options. [GH-171] - Box add checks if a box already exists before the download. [GH-170] - NFS no longer attempts to clean exports file if VM is not created, which was causing a stack trace during recovery. [related to GH-166] - Basic validation added for Chef configuration (both solo and server). - Top config class is now available in all `Vagrant::Config::Base` subclasses, which is useful for config validation. - Subcommand help shows proper full command in task listing. [GH-168] - SSH gives error message if `ssh` binary is not found. [GH-161] - SSH gives proper error message if VM is not running. [GH-167] - Fix some issues with undefined constants in command errors. ## 0.6.1, 0.6.2, 0.6.3 (September 27, 2010) A lot of quick releases which all were to fix issues with Ruby 1.8.7 compatibility. ## 0.6.0 (September 27, 2010) - VM name now defaults to the name of the containing folder, plus a timestamp. This should make it easier to identify VMs in the VirtualBox GUI. - Exposed Vagrant test helpers in `Vagrant::TestHelpers` for plugins to easily test themselves against Vagrant environments. - **Plugins** have landed. Plugins are simply gems which have a `vagrant_init.rb` file somewhere in their load path. Please read the documentation on vagrantup.com before attempting to create a plugin (which is very easy) for more information on how it all works and also some guidelines. - `vagrant package` now takes a `--vagrantfile` option to specify a Vagrantfile to package. The `--include` approach for including a Vagrantfile no longer works (previously built boxes will continue to work). - `vagrant package` has new logic with regards to the `--include` option depending on if the file path is relative or absolute (they can be intermixed): * _Relative_ paths are copied directly into the box, preserving their path. So `--include lib/foo` would be in the box as "lib/foo" * _Absolute_ paths are simply copied files into the root of the box. So `--include /lib/foo` would be in the box as "foo" - "vagrant_main" is no longer the default run list. Instead, chef run list starts empty. It is up to you to specify all recipes in the Vagrantfile now. - Fixed various issues with certain action middleware not working if the VM was not created. - SSH connection is retried 5 times if there is a connection refused. Related to GH-140. - If `http_proxy` environmental variable is set, it will be used as the proxy box adding via http. - Remove `config.ssh.password`. It hasn't been used for a few versions now and was only kept around to avoid exceptions in Vagrantfiles. - Configuration is now validated so improper input can be found in Vagrantfiles. - Fixed issue with not detecting Vagrantfile at root directory ("/"). - Vagrant now gives a nice error message if there is a syntax error in any Vagrantfile. [GH-154] - The format of the ".vagrant" file which stores persisted VMs has changed. This is **backwards incompatible**. Will provide an upgrade utility prior to 0.6 launch. - Every [expected] Vagrant error now exits with a clean error message and a unique exit status, and raises a unique exception (if you're scripting Vagrant). - Added I18n gem dependency for pulling strings into clean YML files. Vagrant is now localizable as a side effect! Translations welcome. - Fixed issue with "Waiting for cleanup" message appearing twice in some cases. [GH-145] - Converted CLI to use Thor. As a tradeoff, there are some backwards incompatibilities: * `vagrant package` - The `--include` flag now separates filenames by spaces, instead of by commas. e.g. `vagrant package --include x y z` * `vagrant ssh` - If you specify a command to execute using the `--execute` flag, you may now only specify one command (before you were able to specify an arbitrary amount). e.g. `vagrant ssh -e "echo hello"` * `vagrant ssh-config` has become `vagrant ssh_config` due to a limitation in Thor. ## 0.5.4 (September 7, 2010) - Fix issue with the "exec failed" by running on Tiger as well. - Give an error when downloading a box which already exists prior to actually downloading the box. ## 0.5.3 (August 23, 2010) - Add erubis as a dependency since its rendering of `erb` is sane. - Fixed poorly formatted Vagrantfile after `vagrant init`. [GH-142] - Fixed NFS not working properly with multiple NFS folders. - Fixed chef solo provision to work on Windows. It was expanding a linux path which prepended a drive letter onto it. ## 0.5.2 (August 3, 2010) - `vagrant up` can be used as a way to resume the VM as well (same as `vagrant resume`). [GH-134] - Sudo uses "-E" flag to preserve environment for chef provisioners. This fixes issues with CentOS. [GH-133] - Added "IdentitiesOnly yes" to options when `vagrant ssh` is run to avoid "Too Many Authentication Failures" error. [GH-131] - Fix regression with `package` not working. [GH-132] - Added ability to specify box url in `init`, which populates the Vagrantfile with the proper `config.vm.box_url`. ## 0.5.1 (July 31, 2010) - Allow specifying cookbook paths which exist only on the VM in `config.chef.cookbooks_path`. This is used for specifying cookbook paths when `config.chef.recipe_url` is used. [GH-130] See updated chef solo documentation for more information on this. - No longer show "Disabling host only networks..." if no host only networks are destroyed. Quiets `destroy`, `halt`, etc output a bit. - Updated getting started guide to be more up to date and generic. [GH-125] - Fixed error with doing a `vagrant up` when no Vagrantfile existed. [GH-128] - Fixed NFS erroring when NFS wasn't even enabled if `/etc/exports` doesn't exist. [GH-126] - Fixed `vagrant resume` to properly resume a suspended VM. [GH-122] - Fixed `halt`, `destroy`, `reload` to where they failed if the VM was in a saved state. [GH-123] - Added `config.chef.recipe_url` which allows you to specify a URL to a gzipped tar file for chef solo to download cookbooks. See the [chef-solo docs](https://docs.chef.io/chef_solo.html) for more information. [GH-121] - Added `vagrant box repackage` which repackages boxes which have been added. This is useful in case you want to redistribute a base box you have but may have lost the actual "box" file. [GH-120] ## Previous The changelog began with version 0.5.1 so any changes prior to that can be seen by checking the tagged releases and reading git commit messages.
taliesins/vagrant
CHANGELOG.md
Markdown
mit
179,836
'use strict' /* eslint no-useless-escape: 0 */ const rewire = require('rewire') const sinon = require('sinon') const expect = require('chai').expect const Promise = require('promise') const logger = require('../../lib/logger') const dependencies = rewire('../../lib/compliance/dependencies') describe('dependencies', function () { let sandbox let config beforeEach(() => { sandbox = sinon.sandbox.create() sandbox.stub(logger, 'error') config = { repo: 'some-test-repo', dependencies: { production: true, output: { directory: 'output-test-dir', ignore: 'output-ignore-file', repos: 'output-repos-file', requirements: 'output-reqs-file' }, additionalRepos: [ { pattern: '\\s+"(ember\\-frost\\-\\S+)"', url: 'https://github.com/ciena-frost/${REPO_NAME}.git' }, { pattern: '\\s+"(frost\\-\\S+)"', url: 'https://bitbucket.ciena.com/scm/bp_frost/${REPO_NAME}.git' } ] } } }) afterEach(function () { // remove all stubs/spies sandbox.restore() }) describe('parses a license', function () { it('for MIT', function () { const licenseObject = { text: 'MIT blah blah blah', filePath: '../some/MIT/path' } expect(dependencies._parseLicense(licenseObject)).to.eql('MIT') }) it('for ISC', function () { const licenseObject = { text: 'ISC blah blah blah', filePath: '../some/ISC/path' } expect(dependencies._parseLicense(licenseObject)).to.eql('ISC') }) it('for Apache', function () { const licenseObject = { text: 'Apache blah blah blah', filePath: '../some/Apache/path' } expect(dependencies._parseLicense(licenseObject)).to.eql('Apache') }) it('for unknown license', function () { const licenseObject = { text: 'Unknown blah blah blah', filePath: '../some/unknown/path' } expect(dependencies._parseLicense(licenseObject)).to.eql('UNKNOWN') }) }) describe('gets a license', function () { it('for package sources', function () { const licenseSources = { package: { sources: [ { license: 'MIT' }, { license: 'Apache' } ] } } const expected = 'MIT, Apache' expect(dependencies._getLicense(licenseSources)).to.eql(expected) }) it('for license sources', function () { const licenseSources = { package: { sources: [] }, license: { sources: [ { text: 'MIT' }, { text: 'Apache' }, { text: 'blargh' } ] } } const expected = 'MIT, Apache, UNKNOWN' expect(dependencies._getLicense(licenseSources)).to.eql(expected) }) }) describe('gets npm license data', function () { let findLicenseStub let writeFileStub beforeEach(function () { findLicenseStub = sandbox.stub(dependencies, 'findLicenses') findLicenseStub.returns(Promise.resolve([ { id: 'some-id', name: 'some-package-1', version: 1.0, licenseSources: undefined }, { id: 'some-other-id', name: 'some-package-2', version: 2.0, licenseSources: { package: { sources: [] }, license: { sources: [ { text: 'MIT' }, { text: 'Apache' }, { text: 'blargh' } ] } } } ])) writeFileStub = sandbox.stub(dependencies, 'writeFile') writeFileStub.returns(Promise.resolve()) }) it('respects the production option', function () { return dependencies.getNpmLicenseData('/some/path', '/some/output/path', config).then(() => { expect(findLicenseStub.firstCall.args[0].production).to.eql(true) }) }) it('and logs if there is none', function () { return dependencies.getNpmLicenseData('/some/path', '/some/output/path', config).then(() => { expect(logger.error.firstCall.args).to.eql(['ERROR: some-id has no licenseSources?']) }) }) it('attempts to write file with correct data', function () { const expectedData = [ { version: 2.0, name: 'some-package-2', license: 'MIT, Apache, UNKNOWN' } ] return dependencies.getNpmLicenseData('/some/path', '/some/output/path', config).then((value) => { expect(writeFileStub.lastCall.args).to.eql([ '/some/output/path', JSON.stringify({ 'schema-version': 1, data: expectedData }, null, ' ') ]) }) }) it('returns file written message', function () { return dependencies.getNpmLicenseData('/some/path', '/some/output/path', config).then((value) => { expect(value).to.eql('successfully wrote /some/output/path') }) }) it('logs file write error', function () { writeFileStub.returns(Promise.reject('some error')) return dependencies.getNpmLicenseData('/some/path', '/some/output/path', config).catch(() => { expect(logger.error.lastCall.args).to.eql(['(1) ERROR: writing /some/output/path', 'some error']) }) }) }) describe('gets package data', function () { let readFileStub let repos = ['"ember-frost-1"', '"frost-1"'] const fileData = ` ${repos.join('\n ')}\n` beforeEach(function () { readFileStub = sandbox.stub(dependencies, 'readFile') readFileStub.returns(Promise.resolve(fileData)) }) it('returns the correct repo paths', function () { const addlRepos = config.dependencies.additionalRepos const expectedUrl1 = addlRepos[1].url.split('${REPO_NAME}').join(repos[1].split('"').join('')) const expectedUrl2 = addlRepos[0].url.split('${REPO_NAME}').join(repos[0].split('"').join('')) const expected = `${expectedUrl1}\n${expectedUrl2}\n` return dependencies.getPackageData('/some/path', config).then((paths) => { expect(paths).to.eql(expected) }) }) }) })
cstolli/pr-bumper
tests/compliance/dependencies-spec.js
JavaScript
mit
6,307
{{ $ := .root }} {{ $page := .page }} {{ $columns := $page.Params.design.columns | default "2" }} <!-- Accomplishments widget --> <div class="col-12 {{if eq $columns "2"}}col-lg-8{{end}}"> {{ with $page.Content }}{{ . }}{{ end }} {{ if $page.Params.item }} {{ range $idx, $key := sort $page.Params.item ".date_start" "desc" }} <div class="card experience course"> <div class="card-body"> {{- with .url -}}<a href="{{.}}" target="_blank" rel="noopener">{{- end -}} <h4 class="card-title exp-title text-muted my-0">{{.title | markdownify | emojify}}</h4> {{- with .url -}}</a>{{- end -}} <div class="card-subtitle my-0 article-metadata"> {{- with .organization_url}}<a href="{{.}}" target="_blank" rel="noopener">{{end -}} {{- .organization | markdownify | emojify -}} {{- with .organization_url}}</a>{{end -}} <span class="middot-divider"></span> {{ (time .date_start).Format ($page.Params.date_format | default "Jan 2006") }} {{ if .date_end}} – {{ (time .date_end).Format ($page.Params.date_format | default "Jan 2006") }} {{end}} </div> {{with .description}} <div class="card-text">{{. | markdownify | emojify}}</div> {{end}} {{ with .certificate_url }} <a class="card-link" href="{{.}}" target="_blank" rel="noopener"> {{ i18n "see_certificate" | default "See certificate" }} </a> {{ end }} </div> </div> {{end}} {{end}} </div>
ShKlinkenberg/site
themes/github.com/wowchemy/wowchemy-hugo-modules/wowchemy/layouts/partials/widgets/accomplishments.html
HTML
mit
1,564
package ua.com.fielden.platform.web.utils; import static java.lang.Class.forName; import static java.lang.String.format; import static java.util.Locale.getDefault; import static java.util.Optional.empty; import static java.util.Optional.of; import static java.util.regex.Pattern.quote; import static org.apache.commons.lang.StringUtils.isEmpty; import static ua.com.fielden.platform.entity.AbstractEntity.DESC; import static ua.com.fielden.platform.entity.AbstractEntity.KEY; import static ua.com.fielden.platform.entity.factory.EntityFactory.newPlainEntity; import static ua.com.fielden.platform.entity.query.fluent.EntityQueryUtils.from; import static ua.com.fielden.platform.entity.query.fluent.EntityQueryUtils.select; import static ua.com.fielden.platform.error.Result.successful; import static ua.com.fielden.platform.reflection.AnnotationReflector.getPropertyAnnotation; import static ua.com.fielden.platform.reflection.Finder.getPropertyDescriptors; import static ua.com.fielden.platform.utils.EntityUtils.isCompositeEntity; import static ua.com.fielden.platform.utils.EntityUtils.isEntityType; import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; import java.util.ArrayList; import java.util.Arrays; import java.util.Currency; import java.util.Date; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import ua.com.fielden.platform.basic.autocompleter.PojoValueMatcher; import ua.com.fielden.platform.companion.IEntityReader; import ua.com.fielden.platform.criteria.generator.impl.CriteriaReflector; import ua.com.fielden.platform.dao.IEntityDao; import ua.com.fielden.platform.dao.QueryExecutionModel; import ua.com.fielden.platform.dao.exceptions.UnexpectedNumberOfReturnedEntities; import ua.com.fielden.platform.domaintree.centre.ICentreDomainTreeManager.ICentreDomainTreeManagerAndEnhancer; import ua.com.fielden.platform.entity.AbstractEntity; import ua.com.fielden.platform.entity.AbstractFunctionalEntityForCollectionModification; import ua.com.fielden.platform.entity.DynamicEntityKey; import ua.com.fielden.platform.entity.annotation.CritOnly; import ua.com.fielden.platform.entity.annotation.EntityType; import ua.com.fielden.platform.entity.annotation.IsProperty; import ua.com.fielden.platform.entity.factory.ICompanionObjectFinder; import ua.com.fielden.platform.entity.fetch.IFetchProvider; import ua.com.fielden.platform.entity.meta.PropertyDescriptor; import ua.com.fielden.platform.entity.proxy.MockNotFoundEntityMaker; import ua.com.fielden.platform.entity.query.fluent.fetch; import ua.com.fielden.platform.entity.query.model.EntityResultQueryModel; import ua.com.fielden.platform.entity.validation.EntityExistsValidator; import ua.com.fielden.platform.entity_centre.review.criteria.EntityQueryCriteria; import ua.com.fielden.platform.error.Result; import ua.com.fielden.platform.error.Warning; import ua.com.fielden.platform.reflection.AnnotationReflector; import ua.com.fielden.platform.reflection.Finder; import ua.com.fielden.platform.reflection.PropertyTypeDeterminator; import ua.com.fielden.platform.reflection.Reflector; import ua.com.fielden.platform.serialisation.jackson.deserialisers.EntityJsonDeserialiser; import ua.com.fielden.platform.types.Colour; import ua.com.fielden.platform.types.Hyperlink; import ua.com.fielden.platform.types.Money; import ua.com.fielden.platform.ui.menu.MiType; import ua.com.fielden.platform.ui.menu.MiWithConfigurationSupport; import ua.com.fielden.platform.utils.EntityUtils; import ua.com.fielden.platform.utils.MiscUtilities; /** * This utility class contains the methods that are shared across EntityResource and EntityValidationResource. * * @author TG Team * */ public class EntityResourceUtils { private static final String CONFLICT_WARNING = "This property has recently been changed by another user."; public static final String CENTRE_CONFIG_CONFLICT_WARNING = "Configuration with this title already exists."; private static final String RESOLVE_CONFLICT_INSTRUCTION = "Please either edit the value back to [%s] to resolve the conflict or cancel all of your changes."; /** * Used to indicate the start of 'not found mock' serialisation sequence. */ private static final String NOT_FOUND_MOCK_PREFIX = "__________NOT_FOUND__________"; private static final Logger logger = Logger.getLogger(EntityResourceUtils.class); /** * Standard {@link PropertyDescriptor}'s convertor to string. Includes handling for 'not found mock' instances. */ public static final Function<PropertyDescriptor<?>, String> PROPERTY_DESCRIPTOR_TO_STRING = entity -> entityWithMocksToString(pd -> pd.toString(), entity); /** * Standard {@link PropertyDescriptor}'s convertor from string. Includes handling for 'not found mock' instances. * <p> * Note that this is applicable only to restore uninstrumented {@link PropertyDescriptor}s. This is common case of {@link PropertyDescriptor} usage -- as a property value of some other entity. * However, we also have similar logic in {@link EntityJsonDeserialiser}, which also deserialises instrumented instances. */ public static final Function<String, PropertyDescriptor<?>> PROPERTY_DESCRIPTOR_FROM_STRING = str -> entityWithMocksFromString(PropertyDescriptor::fromString, str, PropertyDescriptor.class); private EntityResourceUtils() {} public static <T extends AbstractEntity<?>, V extends AbstractEntity<?>> IFetchProvider<V> fetchForProperty(final ICompanionObjectFinder coFinder, final Class<T> entityType, final String propertyName) { if (EntityQueryCriteria.class.isAssignableFrom(entityType)) { final Class<? extends AbstractEntity<?>> originalType = EntityResourceUtils.getOriginalType(entityType); final String originalPropertyName = EntityResourceUtils.getOriginalPropertyName(entityType, propertyName); final boolean isEntityItself = "".equals(originalPropertyName); // empty property means "entity itself" return isEntityItself ? (IFetchProvider<V>) coFinder.find(originalType).getFetchProvider() : fetchForPropertyOrDefault(coFinder, originalType, originalPropertyName); } else { return coFinder.find(entityType).getFetchProvider().fetchFor(propertyName); } } /** * Returns <code>true</code> in case where the <code>warning</code> does not represent special 'conflicting' warning, <code>false</code> otherwise. * * @param warning * @return */ public static boolean isNonConflicting(final Warning warning) { return !CONFLICT_WARNING.equals(warning.getMessage()) && !CENTRE_CONFIG_CONFLICT_WARNING.equals(warning.getMessage()); } /** * Returns fetch provider for property or, if the property should not be fetched according to default strategy, returns the 'default' property fetch provider with 'keys' * (simple an composite) and 'desc' (if 'desc' exists in domain entity). * * @param coFinder * @param entityType * @param propertyName * @return */ private static <V extends AbstractEntity<?>> IFetchProvider<V> fetchForPropertyOrDefault(final ICompanionObjectFinder coFinder, final Class<? extends AbstractEntity<?>> entityType, final String propertyName) { final IFetchProvider<? extends AbstractEntity<?>> fetchProvider = coFinder.find(entityType).getFetchProvider(); return fetchForPropertyOrDefault(fetchProvider, propertyName); } /** * Returns fetch provider for property or, if the property should not be fetched according to default strategy, returns the 'default' property fetch provider with 'keys' * (simple an composite) and 'desc' (if 'desc' exists in domain entity). * * @param fetchProvider * @param propertyName * @return */ public static <V extends AbstractEntity<?>> IFetchProvider<V> fetchForPropertyOrDefault(final IFetchProvider<? extends AbstractEntity<?>> fetchProvider, final String propertyName) { return fetchProvider.shouldFetch(propertyName) ? fetchProvider.fetchFor(propertyName) : fetchProvider.with(propertyName).fetchFor(propertyName); } /** * Determines the version that is shipped with 'modifiedPropertiesHolder'. * * @param modifiedPropertiesHolder * @return */ public static Long getVersion(final Map<String, Object> modifiedPropertiesHolder) { final Object arrivedVersionVal = modifiedPropertiesHolder.get(AbstractEntity.VERSION); return ((Integer) arrivedVersionVal).longValue(); } /** * Applies the values from <code>modifiedPropertiesHolder</code> into the <code>entity</code>. The values needs to be converted from the client-side component-specific form into * the values, which can be set into Java entity's property. * * @param modifiedPropertiesHolder * @param entity * @return */ public static <M extends AbstractEntity<?>> M apply(final Map<String, Object> modifiedPropertiesHolder, final M entity, final ICompanionObjectFinder companionFinder) { final Class<M> type = (Class<M>) entity.getType(); final boolean isEntityStale = entity.getVersion() > getVersion(modifiedPropertiesHolder); final boolean isCriteriaEntity = EntityQueryCriteria.class.isAssignableFrom(type); final Set<String> touchedProps = new LinkedHashSet<>((List<String>) modifiedPropertiesHolder.get("@@touchedProps")); // iterate through untouched properties first: // (the order of application does not really matter - untouched properties were really applied earlier through some definers, that originate from touched properties) for (final Map.Entry<String, Object> nameAndVal : modifiedPropertiesHolder.entrySet()) { final String name = nameAndVal.getKey(); if (!name.equals(AbstractEntity.ID) && !name.equals(AbstractEntity.VERSION) && !name.startsWith("@") /* custom properties disregarded */ && !touchedProps.contains(name)) { final Map<String, Object> valAndOrigVal = (Map<String, Object>) nameAndVal.getValue(); // The 'modified' properties are marked using the existence of "val" sub-property. if (valAndOrigVal.containsKey("val")) { // this is a modified property applyModifiedPropertyValue(type, name, valAndOrigVal, entity, companionFinder, isEntityStale, isCriteriaEntity); // logPropertyApplication(" Apply untouched modified", true, true, type, name, isEntityStale, valAndOrigVal, entity /* insert interested properties here for e.g. [, "propX", "propY", "prop1", "prop2"] */); } else { // this is unmodified property // IMPORTANT: // Untouched properties should not be applied, but validation for conflicts should be performed. validateUnmodifiedPropertyValue(type, name, valAndOrigVal, entity, companionFinder, isEntityStale, isCriteriaEntity); // logPropertyApplication("Validate untouched unmodified", false, true, type, name, isEntityStale, valAndOrigVal, entity /* insert interested properties here for e.g. [, "propX", "propY", "prop1", "prop2"] */); } } } // iterate through touched properties: // (the order of application is strictly the same as was done by the user in Web UI client - the only difference is // such that properties, that were touched twice or more times, will be applied only once) for (final String touchedProp : touchedProps) { final String name = touchedProp; final Map<String, Object> valAndOrigVal = (Map<String, Object>) modifiedPropertiesHolder.get(name); // The 'modified' properties are marked using the existence of "val" sub-property. if (valAndOrigVal.containsKey("val")) { // this is a modified property applyModifiedPropertyValue(type, name, valAndOrigVal, entity, companionFinder, isEntityStale, isCriteriaEntity); // logPropertyApplication(" Apply touched modified", true, true, type, name, isEntityStale, valAndOrigVal, entity /* insert interested properties here for e.g. [, "propX", "propY", "prop1", "prop2"] */); } else { // this is unmodified property // IMPORTANT: // Unlike to the case of untouched properties, all touched properties should be applied, // even unmodified ones. // This is necessary in order to mimic the user interaction with the entity (like was in Swing client) // to have the ACE handlers executed for all touched properties. applyUnmodifiedPropertyValue(type, name, valAndOrigVal, entity, companionFinder, isEntityStale, isCriteriaEntity); // logPropertyApplication(" Apply touched unmodified", true, true, type, name, isEntityStale, valAndOrigVal, entity /* insert interested properties here for e.g. [, "propX", "propY", "prop1", "prop2"] */); } } // IMPORTANT: the check for invalid will populate 'required' checks. // It is necessary in case when some property becomes required after the change of other properties. entity.isValid(); disregardCritOnlyRequiredProperties(entity); disregardUntouchedRequiredProperties(entity, touchedProps); disregardTouchedRequiredPropertiesWithEmptyValue(entity, touchedProps); return entity; } /** * Logs property application / validation in a table form to easily debug data flow in method 'apply'. * * @param actionCaption * @param apply * @param shortLog -- specifies shorter or wider (with 'type' and staleness) view of information * @param type * @param name * @param isEntityStale * @param valAndOrigVal * @param entity * @param propertiesToLogArray -- specifies what properties are interested */ @SuppressWarnings("unused") private static <M extends AbstractEntity<?>> void logPropertyApplication(final String actionCaption, final boolean apply, final boolean shortLog, final Class<M> type, final String name, final boolean isEntityStale, final Map<String, Object> valAndOrigVal, final M entity, final String... propertiesToLogArray) { final Set<String> propertiesToLog = new LinkedHashSet<>(Arrays.asList(propertiesToLogArray)); if (propertiesToLog.contains(name)) { final StringBuilder builder = new StringBuilder(actionCaption); builder.append(":\t"); if (!shortLog) { builder.append(format("type [%40s] ", type.getSimpleName())); } builder.append(format("name [%8s] ", name)); if (!shortLog) { builder.append(format("isEntityStale [%8s] ", isEntityStale)); } builder.append(format("val [%8s] ", valAndOrigVal.getOrDefault("val", ""))); builder.append(format("origVal [%8s] ", valAndOrigVal.get("origVal"))); if (apply) { builder.append("=>\t"); for (final String propertyToLog: propertiesToLog) { builder.append(format("%8s = %8s ", propertyToLog, entity.get(propertyToLog))); } } System.out.println(builder.toString()); // use logger instead of sysout if needed } } /** * Validates / applies the property value against the entity. * * @param apply - indicates whether property application should be performed; if <code>false</code> then only validation will be performed * @param shouldApplyOriginalValue - indicates whether the 'origVal' should be applied or 'val' * @param type * @param name * @param valAndOrigVal * @param entity * @param companionFinder * @param isEntityStale * @param isCriteriaEntity */ private static <M extends AbstractEntity<?>> void processPropertyValue(final boolean apply, final boolean shouldApplyOriginalValue, final Class<M> type, final String name, final Map<String, Object> valAndOrigVal, final M entity, final ICompanionObjectFinder companionFinder, final boolean isEntityStale, final boolean isCriteriaEntity) { if (apply) { // in case where application is necessary (modified touched, modified untouched, unmodified touched) the value (valueToBeApplied) should be checked on existence and then (if successful) it should be applied final String valueToBeAppliedName = shouldApplyOriginalValue ? "origVal" : "val"; final Object valToBeApplied = valAndOrigVal.get(valueToBeAppliedName); final Object convertedValue = convert(type, name, valToBeApplied, reflectedValueId(valAndOrigVal, valueToBeAppliedName), companionFinder); final Object valueToBeApplied; if (valToBeApplied != null && convertedValue == null) { final Class<?> propType = determinePropertyType(type, name); if (isEntityType(propType)) { valueToBeApplied = createMockNotFoundEntity((Class<AbstractEntity<?>>) propType, (String) valToBeApplied); // here valToBeApplied must be string; look at 'convert' method with 'reflectedValue' parameter always string for entity-typed 'propertyType' } else { valueToBeApplied = convertedValue; } } else { valueToBeApplied = convertedValue; } validateAnd(() -> { // Value application should be enforced. // This is necessary not only for 'touched unmodified' properties (made earlier), but also for 'touched modified' and 'untouched modified' (new logic, 2017-12). // This is necessary because without enforcement property application (with respective definers execution) could be avoided for seemingly 'modified' properties. // This is due to the fact that 'modified' property value is always different from original value, but could be equal to the actual value of the property immediately before application. // This situation occurs where the property was modified indirectly from definers of other properties in method 'apply'. // 'enforce == true' guarantees that property application with validators / definers will always be actioned. entity.getProperty(name).setValue(valueToBeApplied, true); }, () -> { return valueToBeApplied; }, () -> { return shouldApplyOriginalValue ? valueToBeApplied : convert(type, name, valAndOrigVal.get("origVal"), reflectedValueId(valAndOrigVal, "origVal"), companionFinder); }, type, name, valAndOrigVal, entity, companionFinder, isEntityStale, isCriteriaEntity); } else { // in case where no application is needed (unmodified untouched) the value should be validated only validateAnd(() -> { // do nothing }, () -> { return shouldApplyOriginalValue ? convert(type, name, valAndOrigVal.get("origVal"), reflectedValueId(valAndOrigVal, "origVal"), companionFinder) : convert(type, name, valAndOrigVal.get("val"), reflectedValueId(valAndOrigVal, "val"), companionFinder); }, () -> { return convert(type, name, valAndOrigVal.get("origVal"), reflectedValueId(valAndOrigVal, "origVal"), companionFinder); }, type, name, valAndOrigVal, entity, companionFinder, isEntityStale, isCriteriaEntity); } } /** * Creates lightweight mock entity instance which will be invalid against {@link EntityExistsValidator} due to empty ID. * ToString conversion will give us {@link AbstractEntity#KEY_NOT_ASSIGNED}. * <p> * This mock instance contains the string query by which the entity was not found. * * @param type * @param stringQuery -- string query by which the entity was not found * * @return */ public static AbstractEntity<?> createMockNotFoundEntity(final Class<? extends AbstractEntity> type, final String stringQuery) { if (isEmpty(stringQuery)) { throw new EntityResourceUtilsException("Mock 'not found' entity could not be created due to empty 'stringQuery'."); } return newPlainEntity(MockNotFoundEntityMaker.mock(type), null).setDesc(stringQuery); } /** * Creates a string that can be used for 'not found mock' entity serialisation. * * @param stringQuery * @return */ public static String createNotFoundMockString(final String stringQuery) { return NOT_FOUND_MOCK_PREFIX + stringQuery; } /** * Returns indication whether <code>obj</code> represents 'mock not found entity'. * * @param obj * @return */ public static boolean isMockNotFoundEntity(final Object obj) { return obj instanceof AbstractEntity && MockNotFoundEntityMaker.isMockNotFoundValue((AbstractEntity<?>)obj); } /** * Converts <code>entity</code> to serialisation string. * * @param specificConverter -- used to convert entity if it is not 'not found mock', otherwise the standard scheme for 'not found mocks' is used * @param entity * @return */ public static <T extends AbstractEntity<?>> String entityWithMocksToString(final Function<T, String> specificConverter, final T entity) { if (isMockNotFoundEntity(entity)) { return createNotFoundMockString(entity.get(DESC)); } else { return specificConverter.apply(entity); } } /** * Converts serialisation <code>str</code> to entity. * * @param specificConverter -- used to convert string if it does not represent 'not found mock', otherwise the standard scheme for 'not found mocks' is used * @param str * @param type * @return */ public static <T extends AbstractEntity<?>> T entityWithMocksFromString(final Function<String, T> specificConverter, final String str, final Class<? extends AbstractEntity> type) { if (str.startsWith(NOT_FOUND_MOCK_PREFIX)) { return (T) createMockNotFoundEntity(type, str.replaceFirst(quote(NOT_FOUND_MOCK_PREFIX), "")); } return specificConverter.apply(str); } /** * Validates the property on subject of conflicts and <code>perform[s]Action</code>. * * @param performAction -- the action to be performed in case of successful validation * @param calculateStaleNewValue -- function to lazily calculate 'staleNewValue' (heavy operation) * @param calculateStaleOriginalValue -- function to lazily calculate 'staleOriginalValue' (heavy operation) * @param type * @param name * @param valAndOrigVal * @param entity * @param companionFinder * @param isEntityStale * @param isCriteriaEntity */ private static <M extends AbstractEntity<?>> void validateAnd(final Runnable performAction, final Supplier<Object> calculateStaleNewValue, final Supplier<Object> calculateStaleOriginalValue, final Class<M> type, final String name, final Map<String, Object> valAndOrigVal, final M entity, final ICompanionObjectFinder companionFinder, final boolean isEntityStale, final boolean isCriteriaEntity) { if (!isEntityStale) { performAction.run(); } else { final Object staleOriginalValue = calculateStaleOriginalValue.get(); final Object freshValue = entity.get(name); final Object staleNewValue = calculateStaleNewValue.get(); if (!isCriteriaEntity && EntityUtils.isConflicting(staleNewValue, staleOriginalValue, freshValue)) { // 1) are we trying to revert the value to previous stale value to perform "recovery" to actual persisted value? (this is following of 'Please revert property value to resolve conflict' instruction) // or 2) has previously touched / untouched property value "recovered" to actual persisted value? if (EntityUtils.equalsEx(staleNewValue, staleOriginalValue)) { logger.info(format("Property [%s] has been recently changed by another user for type [%s] to the value [%s]. Original value is [%s].", name, entity.getClass().getSimpleName(), freshValue, staleOriginalValue)); entity.getProperty(name).setDomainValidationResult(Result.warning(entity, CONFLICT_WARNING)); } else { logger.info(format("Property [%s] has been recently changed by another user for type [%s] to the value [%s]. Stale original value is [%s], newValue is [%s]. Please revert property value to resolve conflict.", name, entity.getClass().getSimpleName(), freshValue, staleOriginalValue, staleNewValue)); entity.getProperty(name).setDomainValidationResult(new PropertyConflict(entity, CONFLICT_WARNING + " " + format(RESOLVE_CONFLICT_INSTRUCTION, staleOriginalValue == null ? "" : staleOriginalValue))); } } else { performAction.run(); } } } /** * Extracts reflected value ID for 'val' or 'origVal' reflectedValueName if it exists. * * @param valAndOrigVal * @param reflectedValueName * @return */ private static Optional<Long> reflectedValueId(final Map<String, Object> valAndOrigVal, final String reflectedValueName) { final Object reflectedValueId = valAndOrigVal.get(reflectedValueName + "Id"); if (reflectedValueId == null) { return Optional.empty(); } else { return Optional.of(extractLongValueFrom(reflectedValueId)); } } /** * Applies the modified (touched / untouched) property value ('val') against the entity. * * @param type * @param name * @param valAndOrigVal * @param entity * @param companionFinder * @param isEntityStale * @param isCriteriaEntity */ private static <M extends AbstractEntity<?>> void applyModifiedPropertyValue(final Class<M> type, final String name, final Map<String, Object> valAndOrigVal, final M entity, final ICompanionObjectFinder companionFinder, final boolean isEntityStale, final boolean isCriteriaEntity) { processPropertyValue(true, false, type, name, valAndOrigVal, entity, companionFinder, isEntityStale, isCriteriaEntity); } /** * Applies the unmodified (touched) property value ('origVal') against the entity (using 'enforced mutation'). * * @param type * @param name * @param valAndOrigVal * @param entity * @param companionFinder * @param isEntityStale * @param isCriteriaEntity */ private static <M extends AbstractEntity<?>> void applyUnmodifiedPropertyValue(final Class<M> type, final String name, final Map<String, Object> valAndOrigVal, final M entity, final ICompanionObjectFinder companionFinder, final boolean isEntityStale, final boolean isCriteriaEntity) { processPropertyValue(true, true, type, name, valAndOrigVal, entity, companionFinder, isEntityStale, isCriteriaEntity); } /** * Validates the unmodified (untouched) property value for 'changed by other user' warning. * * @param type * @param name * @param valAndOrigVal * @param entity * @param companionFinder * @param isEntityStale * @param isCriteriaEntity */ private static <M extends AbstractEntity<?>> void validateUnmodifiedPropertyValue(final Class<M> type, final String name, final Map<String, Object> valAndOrigVal, final M entity, final ICompanionObjectFinder companionFinder, final boolean isEntityStale, final boolean isCriteriaEntity) { processPropertyValue(false, true, type, name, valAndOrigVal, entity, companionFinder, isEntityStale, isCriteriaEntity); } /** * Disregards the 'required' errors for those properties, that were not 'touched' directly by the user (for both criteria and simple entities). * * @param entity * @param touchedProps -- list of 'touched' properties, i.e. those for which editing has occurred during validation lifecycle (maybe returning to original value thus making them unmodified) * @return */ public static <M extends AbstractEntity<?>> M disregardUntouchedRequiredProperties(final M entity, final Set<String> touchedProps) { // both criteria and simple entities will be affected entity.nonProxiedProperties().filter(mp -> mp.isRequired() && !touchedProps.contains(mp.getName())).forEach(mp -> { mp.setRequiredValidationResult(successful(entity)); }); return entity; } /** * Disregards the 'required' errors for those properties, that were provided with some value and then cleared back to empty value during editing of new entity. * * @param entity * @param touchedProps -- list of 'touched' properties, i.e. those for which editing has occurred during validation lifecycle (maybe returning to original value thus making them unmodified) * @return */ private static <M extends AbstractEntity<?>> M disregardTouchedRequiredPropertiesWithEmptyValue(final M entity, final Set<String> touchedProps) { // both criteria and simple non-persisted (new) entities will be affected if (!entity.isPersisted() || EntityQueryCriteria.class.isAssignableFrom(entity.getType())) { entity.nonProxiedProperties().filter(mp -> mp.isRequired() && touchedProps.contains(mp.getName()) && mp.getValue() == null).forEach(mp -> { mp.setRequiredValidationResult(successful(entity)); }); } return entity; } /** * Disregards the 'required' errors for crit-only properties on masters for non-criteria entity types. * * @param entity */ public static <M extends AbstractEntity<?>> void disregardCritOnlyRequiredProperties(final M entity) { final Class<?> managedType = entity.getType(); if (!EntityQueryCriteria.class.isAssignableFrom(managedType)) { entity.nonProxiedProperties().filter(mp -> mp.isRequired()).forEach(mp -> { final String prop = mp.getName(); final CritOnly critOnlyAnnotation = getPropertyAnnotation(CritOnly.class, managedType, prop); if (critOnlyAnnotation != null) { mp.setRequiredValidationResult(successful(entity)); } }); } } /** * Determines property type. * <p> * The exception from standard logic is only for "collection modification func action", where the type of <code>chosenIds</code>, <code>addedIds</code> and <code>removedIds</code> properties * is determined from the second type parameter of the func action type. This is required due to the generic nature of those types (see ID_TYPE parameter in {@link AbstractFunctionalEntityForCollectionModification}). * * @param type * @param propertyName * @return */ private static Class<?> determinePropertyType(final Class<?> type, final String propertyName) { final Class<?> propertyType; if (AbstractFunctionalEntityForCollectionModification.class.isAssignableFrom(type) && AbstractFunctionalEntityForCollectionModification.isCollectionOfIds(propertyName)) { if (type.getAnnotatedSuperclass() == null) { throw Result.failure(new IllegalStateException(format("The AnnotatedSuperclass of functional entity %s (for collection modification) is somehow not defined.", type.getSimpleName()))); } if (!(type.getAnnotatedSuperclass().getType() instanceof ParameterizedType)) { throw Result.failure(new IllegalStateException(format("The AnnotatedSuperclass's Type %s of functional entity %s (for collection modification) is somehow not ParameterizedType.", type.getAnnotatedSuperclass().getType(), type.getSimpleName()))); } final ParameterizedType parameterizedEntityType = (ParameterizedType) type.getAnnotatedSuperclass().getType(); if (parameterizedEntityType.getActualTypeArguments().length != 1 || !(parameterizedEntityType.getActualTypeArguments()[0] instanceof Class)) { throw Result.failure(new IllegalStateException(format("The type parameters %s of functional entity %s (for collection modification) is malformed.", Arrays.asList(parameterizedEntityType.getActualTypeArguments()), type.getSimpleName()))); } propertyType = (Class<?>) parameterizedEntityType.getActualTypeArguments()[0]; } else { propertyType = PropertyTypeDeterminator.determinePropertyType(type, propertyName); } return propertyType; } /** * Converts <code>reflectedValue</code>, which could be a string, a number, a boolean or a null, to a value of appropriate type (the type of the actual property). * * @param type * @param propertyName * @param reflectedValue * @param reflectedValueId -- in case where the property is entity-typed, this parameter represent an optional ID of the entity-typed value returned from the client application * * @return */ private static <M extends AbstractEntity<?>> Object convert(final Class<M> type, final String propertyName, final Object reflectedValue, final Optional<Long> reflectedValueId, final ICompanionObjectFinder companionFinder) { if (reflectedValue == null) { return null; } final Class<?> propertyType = determinePropertyType(type, propertyName); // NOTE: "missing value" for Java entities is also 'null' as for JS entities if (EntityUtils.isEntityType(propertyType)) { if (PropertyTypeDeterminator.isCollectional(type, propertyName)) { throw new UnsupportedOperationException(format("Unsupported conversion to [%s + %s] from reflected value [%s]. Entity-typed collectional properties are not supported.", type.getSimpleName(), propertyName, reflectedValue)); } final Class<AbstractEntity<?>> entityPropertyType = (Class<AbstractEntity<?>>) propertyType; final String reflectedValueAsString = (String) reflectedValue; if (EntityUtils.isPropertyDescriptor(entityPropertyType)) { final Class<AbstractEntity<?>> enclosingEntityType = (Class<AbstractEntity<?>>) AnnotationReflector.getPropertyAnnotation(IsProperty.class, type, propertyName).value(); return extractPropertyDescriptor(reflectedValueAsString, enclosingEntityType).orElse(null); } else { final fetch<AbstractEntity<?>> fetch = fetchForProperty(companionFinder, type, propertyName).fetchModel(); final IEntityDao<AbstractEntity<?>> propertyCompanion = companionFinder.<IEntityDao<AbstractEntity<?>>, AbstractEntity<?>> find(entityPropertyType, true); if (reflectedValueId.isPresent()) { logger.debug(format("ID-based restoration of value: type [%s] property [%s] propertyType [%s] id [%s] reflectedValue [%s].", type.getSimpleName(), propertyName, entityPropertyType.getSimpleName(), reflectedValueId.get(), reflectedValue)); // regardless of whether entityPropertyType is composite or not, the entity should be retrieved by non-empty reflectedValueId that has been arrived from the client application return propertyCompanion.findById(true, reflectedValueId.get(), fetch); } else { return findAndFetchBy(reflectedValueAsString, entityPropertyType, fetch, propertyCompanion); } } // prev implementation => return propertyCompanion.findByKeyAndFetch(getFetchProvider().fetchFor(propertyName).fetchModel(), reflectedValue); } else if (PropertyTypeDeterminator.isCollectional(type, propertyName)) { final Class<?> collectionType = Finder.findFieldByName(type, propertyName).getType(); final boolean isSet = Set.class.isAssignableFrom(collectionType); final boolean isList = List.class.isAssignableFrom(collectionType); final boolean isStringElem = String.class.isAssignableFrom(propertyType); final boolean isLongElem = Long.class.isAssignableFrom(propertyType); if (!isSet && !isList || !isStringElem && !isLongElem) { throw new UnsupportedOperationException(format("Unsupported conversion to [%s@%s] from reflected value [%s] of collectional type [%s] with [%s] elements. Only [Set / List] of [String / Long] elements are supported.", propertyName, type.getSimpleName(), reflectedValue, collectionType.getSimpleName(), propertyType.getSimpleName())); } final List<Object> list = (ArrayList<Object>) reflectedValue; final Stream<Object> stream = list.stream().map( item -> item == null ? null : isStringElem ? item.toString() : extractLongValueFrom(item) ); return stream.collect(Collectors.toCollection(isSet ? LinkedHashSet::new : ArrayList::new)); } else if (PropertyTypeDeterminator.isMap(type, propertyName)) { return reflectedValue; } else if (EntityUtils.isString(propertyType)) { return reflectedValue; } else if (Integer.class.isAssignableFrom(propertyType)) { if (reflectedValue instanceof Long || reflectedValue instanceof BigInteger) { throw new IllegalStateException("Too big."); } return reflectedValue; } else if (EntityUtils.isBoolean(propertyType)) { return reflectedValue; } else if (EntityUtils.isDate(propertyType)) { return reflectedValue instanceof Integer ? new Date(((Integer) reflectedValue).longValue()) : new Date((Long) reflectedValue); } else if (BigDecimal.class.isAssignableFrom(propertyType)) { final IsProperty isProperty = getPropertyAnnotation(IsProperty.class, type, propertyName); final CritOnly critOnly = getPropertyAnnotation(CritOnly.class, type, propertyName); final Integer propertyScale = isProperty != null && isProperty.scale() >= 0 ? ((int) isProperty.scale()) : (critOnly != null && critOnly.scale() >= 0 ? ((int) critOnly.scale()) : 2)/* default value from Hibernate */; if (reflectedValue instanceof Integer) { return new BigDecimal((Integer) reflectedValue).setScale(propertyScale, RoundingMode.HALF_UP); } else if (reflectedValue instanceof Long) { return BigDecimal.valueOf((Long) reflectedValue).setScale(propertyScale, RoundingMode.HALF_UP); } else if (reflectedValue instanceof BigInteger) { return new BigDecimal((BigInteger) reflectedValue).setScale(propertyScale, RoundingMode.HALF_UP); } else if (reflectedValue instanceof BigDecimal) { return ((BigDecimal) reflectedValue).setScale(propertyScale, RoundingMode.HALF_UP); } else { throw new IllegalStateException("Unknown number type for 'reflectedValue'."); } } else if (Money.class.isAssignableFrom(propertyType)) { final Map<String, Object> map = (Map<String, Object>) reflectedValue; final BigDecimal amount = new BigDecimal(map.get("amount").toString()); final String currencyStr = (String) map.get("currency"); final Integer taxPercentage = (Integer) map.get("taxPercent"); if (taxPercentage == null) { if (StringUtils.isEmpty(currencyStr)) { return new Money(amount); } else { return new Money(amount, Currency.getInstance(currencyStr)); } } else { if (StringUtils.isEmpty(currencyStr)) { return new Money(amount, taxPercentage, Currency.getInstance(getDefault())); } else { return new Money(amount, taxPercentage, Currency.getInstance(currencyStr)); } } } else if (Colour.class.isAssignableFrom(propertyType)) { final Map<String, Object> map = (Map<String, Object>) reflectedValue; final String hashlessUppercasedColourValue = (String) map.get("hashlessUppercasedColourValue"); return hashlessUppercasedColourValue == null ? null : new Colour(hashlessUppercasedColourValue); } else if (Hyperlink.class.isAssignableFrom(propertyType)) { final Map<String, Object> map = (Map<String, Object>) reflectedValue; final String linkValue = (String) map.get("value"); return linkValue == null ? null : new Hyperlink(linkValue); } else if (Long.class.isAssignableFrom(propertyType)) { return extractLongValueFrom(reflectedValue); } else if (Class.class.isAssignableFrom(propertyType)) { try { return forName((String) reflectedValue); // full class names for already registered server-side Class'es are supported } catch (final Exception ex) { throw new EntityResourceUtilsException(format("Conversion to [%s@%s] from reflected value [%s] of type [%s] failed.", propertyName, type.getSimpleName(), reflectedValue, propertyType.getSimpleName()), ex); } } else { throw new UnsupportedOperationException(format("Unsupported conversion to [%s@%s] from reflected value [%s] of type [%s].", propertyName, type.getSimpleName(), reflectedValue, propertyType.getSimpleName())); } } /** * Finds entity value by <code>searchString</code> from autocompleter. * <p> * This method takes care of proper composite entity search string decomposition (including situations with {@link PropertyDescriptor} as key member) and early checking for search string correctness. * * @param searchString * @param entityType -- the type of entity being looked for * @param fetch -- fetch model for resultant entity * @param companion -- companion for the entity being looked for * @return */ public static AbstractEntity<?> findAndFetchBy(final String searchString, final Class<AbstractEntity<?>> entityType, final fetch<AbstractEntity<?>> fetch, final IEntityDao<AbstractEntity<?>> companion) { if (isCompositeEntity(entityType)) { //logger.debug(format("KEY-based restoration of value: type [%s] property [%s] propertyType [%s] id [%s] reflectedValue [%s].", type.getSimpleName(), propertyName, entityPropertyType.getSimpleName(), reflectedValueId, reflectedValue)); final String compositeKeyAsString = MiscUtilities.prepare(prepSearchStringForCompositeKey(entityType, searchString)); final EntityResultQueryModel<AbstractEntity<?>> model = select(entityType).where().prop(KEY).iLike().val(compositeKeyAsString).model().setFilterable(true); final QueryExecutionModel<AbstractEntity<?>, EntityResultQueryModel<AbstractEntity<?>>> qem = from(model).with(fetch).model(); try { final AbstractEntity<?> converted = companion.getEntity(qem); return orElseFindByKey(converted, companion, fetch, compositeKeyAsString); } catch (final UnexpectedNumberOfReturnedEntities e) { return null; } } else { //logger.debug(format("KEY-based restoration of value: type [%s] property [%s] propertyType [%s] id [%s] reflectedValue [%s].", type.getSimpleName(), propertyName, entityPropertyType.getSimpleName(), reflectedValueId, reflectedValue)); final String[] keys = MiscUtilities.prepare(Arrays.asList(searchString)); final String key; if (keys.length > 1) { throw new IllegalArgumentException(format("Value [%s] does not represent a single key value, which is required for coversion to an instance of type [%s].", searchString, entityType.getName())); } else if (keys.length == 0) { key = ""; } else { key = keys[0]; } return companion.findByKeyAndFetch(true, fetch, key); } } /** * Returns {@code converted} is not {@code null}. Otherwise, tries to call {@link IEntityReader#findByKeyAndFetch(fetch, Object...)}. * If that call is unsuccessful then {@code null} is returned. * <p> * The main purpose of this behaviour is to support ad hoc creation of entities with composite keys, similar as for entities with simple keys. * * @param converted * @param propertyCompanion * @param fetchModel * @param compositeKeyAsString * @return */ private static AbstractEntity<?> orElseFindByKey(final AbstractEntity<?> converted, final IEntityDao<AbstractEntity<?>> propertyCompanion, final fetch<AbstractEntity<?>> fetchModel, final String compositeKeyAsString) { if (converted == null) { try { return propertyCompanion.findByKeyAndFetch(true, fetchModel, compositeKeyAsString); } catch (final Exception ex) { // we can safely ignore any exceptions in this case } } return converted; } /** * Extracts from number-like <code>reflectedValue</code> its {@link Long} representation. * * @param reflectedValue * @return */ private static Long extractLongValueFrom(final Object reflectedValue) { if (reflectedValue instanceof Integer) { return ((Integer) reflectedValue).longValue(); } else if (reflectedValue instanceof Long) { return (Long) reflectedValue; } else if (reflectedValue instanceof BigInteger) { return ((BigInteger) reflectedValue).longValue(); } else { throw new IllegalStateException(format("Unknown number type for 'reflectedValue' (%s) - can not convert to Long.", reflectedValue)); } } /** * This method prepares a search-by string to search for an entity of type {@code propertyType}, which has a composite key. * Special processing is required for some specific platform-level entity types such as {@link PropertyDescriptor}: * <ul> * <li>If one of the composite key members is of type {@link PropertyDescriptor} then the search-by value needs to be modified by converting the provided string representation * for property descriptors to the required form. * </ul> * * @param entityPropertyType * @param compositeKeyAsString * @return */ private static String prepSearchStringForCompositeKey(final Class<AbstractEntity<?>> entityPropertyType, final String compositeKeyAsString) { // if one or more composite key members are of type ProperyDescriptor then those values need to be converted to a DB aware representation // regrettable this process is error prone due to a potential use of the key member separator as part of property titles... final List<Field> keyMembers = Finder.getKeyMembers(entityPropertyType); final boolean hasPropDescKeyMembers = keyMembers.stream().anyMatch(f -> EntityUtils.isPropertyDescriptor(f.getType())); // do we have key members of type PropertyDescriptor if (!hasPropDescKeyMembers) { return compositeKeyAsString; } else { final StringBuilder convertedKeyValue = new StringBuilder(); String keyValues = compositeKeyAsString; // mutable! final Class<?> propertyType = entityPropertyType; final String keyMemberSeparator = Reflector.getKeyMemberSeparator((Class<? extends AbstractEntity<DynamicEntityKey>>) propertyType); for (int index = 0; index < keyMembers.size(); index++) { final boolean isLastKeyMember = index == keyMembers.size() - 1; final int separatorIndex = isLastKeyMember ? keyValues.length() : keyValues.indexOf(keyMemberSeparator); // there must be exactly keyMembers.size() - 1 separators // but just in case let's validate the found index if (separatorIndex < 0) { throw new IllegalArgumentException(format("Composite key value [%s] must have [%s] separators.", compositeKeyAsString, keyMembers.size() - 1)); } final String value = isLastKeyMember ? keyValues : keyValues.substring(0, separatorIndex); keyValues = isLastKeyMember ? "" : keyValues.substring(separatorIndex + 1); final Field field = keyMembers.get(index); if (EntityUtils.isPropertyDescriptor(field.getType())) { final Class<AbstractEntity<?>> enclosingEntityType = (Class<AbstractEntity<?>>) AnnotationReflector.getPropertyAnnotation(IsProperty.class, entityPropertyType, field.getName()).value(); final Optional<PropertyDescriptor<AbstractEntity<?>>> propDesc = extractPropertyDescriptor(value, enclosingEntityType); if (!propDesc.isPresent()) { throw new IllegalArgumentException(format("Could not convert value [%s] to a property descriptor within type [%s].", value, enclosingEntityType.getSimpleName())); } convertedKeyValue.append(propDesc.get().toString()); } else { convertedKeyValue.append(value); } if (index < keyMembers.size() - 1) { convertedKeyValue.append(keyMemberSeparator); } } return convertedKeyValue.toString(); } } /** * Tries to extract a property descriptor from a given string value. * * @param reflectedValue * @param matcher * @return */ private static Optional<PropertyDescriptor<AbstractEntity<?>>> extractPropertyDescriptor(final String value, final Class<AbstractEntity<?>> enclosingEntityType) { final List<PropertyDescriptor<AbstractEntity<?>>> allPropertyDescriptors = getPropertyDescriptors(enclosingEntityType); final List<PropertyDescriptor<AbstractEntity<?>>> matchedPropertyDescriptors = new PojoValueMatcher<>(allPropertyDescriptors, KEY, allPropertyDescriptors.size()).findMatches(value); if (matchedPropertyDescriptors.size() != 1) { return empty(); } return of(matchedPropertyDescriptors.get(0)); } /** * Determines the entity type for which criteria entity will be generated. * * @param miType * @return */ public static <T extends AbstractEntity<?>> Class<T> getEntityType(final Class<? extends MiWithConfigurationSupport<?>> miType) { final EntityType entityTypeAnnotation = miType.getAnnotation(EntityType.class); if (entityTypeAnnotation == null) { throw new IllegalStateException(format("The menu item type [%s] must be annotated with EntityType annotation", miType.getName())); } return (Class<T>) entityTypeAnnotation.value(); } /** * Determines the miType for which criteria entity was generated. * * @param miType * @return */ public static Class<? extends MiWithConfigurationSupport<?>> getMiType(final Class<? extends AbstractEntity<?>> criteriaType) { final MiType annotation = AnnotationReflector.getAnnotation(criteriaType, MiType.class); if (annotation == null) { throw new IllegalStateException(format("The criteria type [%s] should be annotated with MiType annotation.", criteriaType.getName())); } return annotation.value(); } /** * Determines the master type for which criteria entity was generated. * * @param criteriaType * @return */ public static Class<? extends AbstractEntity<?>> getOriginalType(final Class<? extends AbstractEntity<?>> criteriaType) { return getEntityType(getMiType(criteriaType)); } /** * Determines the property name of the property from which the criteria property was generated. This is only applicable for entity typed properties. * * @param propertyName * @return */ public static String getOriginalPropertyName(final Class<?> criteriaClass, final String propertyName) { return CriteriaReflector.getCriteriaProperty(criteriaClass, propertyName); } /** * Determines the managed (in cdtmae) counter-part for master type for which criteria entity was generated. * * @param criteriaType * @param cdtmae * @return */ public static Class<?> getOriginalManagedType(final Class<? extends AbstractEntity<?>> criteriaType, final ICentreDomainTreeManagerAndEnhancer cdtmae) { return cdtmae.getEnhancer().getManagedType(getOriginalType(criteriaType)); } public static String tabs(final int tabCount) { final StringBuilder sb = new StringBuilder(); for (int i = 0; i < tabCount; i++) { sb.append(" "); } return sb.toString(); } }
fieldenms/tg
platform-pojo-bl/src/main/java/ua/com/fielden/platform/web/utils/EntityResourceUtils.java
Java
mit
54,150
<!-- _ _ _ _ | | | (_) | | | |__| |_ _ __ ___ _ __ ___ ___| | | __ | | '__/ _ \ | '_ ` _ \ / _ \ | | | | | | | | __/ | | | | | | __/_| |_| |_|_|_| \___| |_| |_| |_|\___(_) Need a Front End Developer? Take my card. http://matt-harris.net/take-my-card.html --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>Outline Mail - Making HTML email easy.</title> <meta name="description" content="" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <!-- favicon --> <link rel="shortcut icon" href="favicon.ico" /> <link rel="apple-touch-icon-precomposed" href="favicon-152.png" /> <meta name="msapplication-TileColor" content="#38a1d6" /> <meta name="msapplication-TileImage" content="favicon-152.png" /> <!-- google fonts --> <link href="//fonts.googleapis.com/css?family=Lato:400,700,900|Merriweather:400,400italic,700,700italic" rel="stylesheet" type="text/css" /> <!-- site style --> <link href="css/outline.min.css" media="all" rel="stylesheet" type="text/css" /> <script src="js/min/modernizr.custom.js"></script> </head> <body> <div class="clearfix" role="main"> <div class="sidebar hide-for-medium-down"> <a class="logo" href="/"> <img src="img/min/logo-white.png" width="200" alt="Outline CSS framework" /> </a> <nav> <ul class="sidebar__nav list--unstyled"> <li> <a href="#get-started" data-scroll>Get started</a> <ul> <li> <a href="#overview" data-scroll>Overview</a> </li> </ul> </li> <li> <a href="#layouts" data-scroll>Layouts</a> </li> <li> <a href="#components" data-scroll>Components</a> <ul> <li> <a href="#header" data-scroll>Header</a> </li> <li> <a href="#hero" data-scroll>Hero</a> </li> <li> <a href="#list" data-scroll>List</a> </li> <li> <a href="#misc" data-scroll>Misc</a> </li> <li> <a href="#one-up" data-scroll>One up</a> </li> <li> <a href="#two-up" data-scroll>Two up</a> </li> <li> <a href="#three-up" data-scroll>Three up</a> </li> <li> <a href="#four-up" data-scroll>Four up</a> </li> <li> <a href="#gallery" data-scroll>Gallery</a> </li> <li> <a href="#article" data-scroll>Article</a> </li> <li> <a href="#ecommerce" data-scroll>eCommerce</a> </li> <li> <a href="#footer" data-scroll>Footer</a> </li> </ul> </li> </ul> </nav> </div> <div class="docs"> <div class="nav-bar clearfix"> <a class="logo hide-for-medium-up float-left" href="/"> <img src="img/min/logo.png" alt="Outline CSS framework" /> </a> <i class="nav-icon" id="trigger-overlay"></i> <div class="nav-overlay"> <i class="nav-close"></i> <nav class="nav"> <ul> <li class="nav__item"> <a href="/">Home</a> </li> <li class="nav__item"> <a href="get-started.html">Get started</a> </li> <li class="nav__item"> <a href="https://github.com/matt-harris/outline-mail">View on GitHub</a> </li> <li class="nav__item"> <a href="http://outline-css.surge.sh/" target="_blank">Outline CSS framework</a> </li> </ul> </nav> </div> </div> <div class="docs__content clearfix"> <section class="docs__item" id="get-started"> <h1 class="docs__heading">Get started</h1> <p>There are a few ways to get started with Outline Mail.</p> <p> Download the <a href="https://github.com/matt-harris/outline-mail/archive/master.zip" >latest release</a > from GitHub. </p> <p>Install with Bower</p> <pre><code>bower install outline-mail</code></pre> <p> To clone the <a href="https://github.com/matt-harris/outline-mail">git repository</a>. Just run the following command. </p> <pre><code>[sudo] git clone [email protected]:matt-harris/outline-mail.git</code></pre> </section> <section class="docs__item" id="overview"> <h2 class="docs__heading">Overview</h2> <p> Outline Mail is HTML email framework with a bunch of fully tested responsive components to provide you a solid foundation for your HTML email project. </p> <p> It allows you to mix and match content blocks to easily build an HTML email using todays best practices in minutes. </p> <p> You can let Gulp do its magic if you are in to that, or simply copy &amp; paste the component code into the master layout file. </p> <p> Outline Mail comes with a fully commented <code>gulpfile.js</code> and <code>package.json</code> file which lists the plugins used. For more information about getting sarted with gulp read this excellent <a href="http://markgoodyear.com/2014/01/getting-started-with-gulp/" >intro by Mark Goodyear</a >. </p> <p> Outline Mail's components are tested in <a href="https://litmus.com/">Litmus</a> in over 30+ email clients. </p> <p> Outline Mail's library of email components will keep on growing! If you have any requests please <a href="https://twitter.com/matty_h" target="_blank">get in touch.</a> </p> </section> <section class="docs__item" id="layouts"> <h2 class="docs__heading">Layouts</h2> <h4>Start creating your HTML email</h4> <p> I've included <code>layouts/index.tpl.html</code> (if you are using Gulp) or <code>dist/index.html</code> (if you are copying and pasting the component code), as a starting point. This has all base markup and styles needed to build your responsive email. You then just simply change / add text and images. </p> <p>You have two options to build your HTML email:-</p> <ol> <li> <p> Use Gulp and automate the build of your email (use <code>layouts/index.tpl.html</code>):- </p> <p>Gulp tasks included:-</p> <ul class="space-btm"> <li> Include partial files into email template (compiles to <code>dist/</code>) </li> <li>Compress images (compiles to <code>dist/</code>)</li> <li>Reload browser (Browser Sync)</li> <li> Send test emails (Requires <a href="https://www.mailgun.com/">Mailgun</a> API key) </li> </ul> <p> Just simply stack your email components in order to create your responsive email. </p> <p> For example to include a header - pick the style of your choice and then paste into the <code>index.tpl.html</code> </p> <pre><code>@@include('header/_header-full.html')</code></pre> </li> <li> <p> Copy and paste the component html straight into your <code>dist/index.html</code> file. Just hit the 'View code' button to view the source code for that component. </p> </li> </ol> <h4>Examples</h4> <p>Five example emails are included for reference.</p> <p>The build files are located in <code>templates/layouts/</code>.</p> <p>The final compiled files are located in <code>dist/</code>.</p> <h4>Example 1</h4> <img class="docs__image" src="img/min/example-email1.jpg" alt="Example Email" /> <a class="btn btn--component" href="/demo/emails/example-email1.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://github.com/matt-harris/outline-mail/blob/master/templates/layouts/example-email1.tpl.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Example 2</h4> <img class="docs__image" src="img/min/example-email2.jpg" alt="Example Email" /> <a class="btn btn--component" href="/demo/emails/example-email2.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://github.com/matt-harris/outline-mail/blob/master/templates/layouts/example-email2.tpl.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Example 3</h4> <img class="docs__image" src="img/min/example-email3.jpg" alt="Example Email" /> <a class="btn btn--component" href="/demo/emails/example-email3.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://github.com/matt-harris/outline-mail/blob/master/templates/layouts/example-email3.tpl.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Example 4</h4> <img class="docs__image" src="img/min/example-email4.jpg" alt="Example Email" /> <a class="btn btn--component" href="/demo/emails/example-email4.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://github.com/matt-harris/outline-mail/blob/master/templates/layouts/example-email4.tpl.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Example eCommerce</h4> <img class="docs__image" src="img/min/example-ecommerce.jpg" alt="Example ecommerce" /> <a class="btn btn--component" href="/demo/emails/example-ecommerce.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://github.com/matt-harris/outline-mail/blob/master/templates/layouts/example-ecommerce.tpl.html" target="_blank" role="button" >View code</a > </section> <div id="components"></div> <section class="docs__item" id="header"> <h2 class="docs__heading">Header</h2> <h4>Header <code>components/header/_header.html</code></h4> <p>A basic header with a logo aligned to the left.</p> <img class="docs__image" src="img/min/header.jpg" alt="Header" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('header/_header.html')</code></pre> <a class="btn btn--component" href="/demo/header/header.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/header/_header.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Header centre <code>components/header/_header-centre.html</code></h4> <p>A header with a logo aligned to the centre.</p> <img class="docs__image" src="img/min/header-centre.jpg" alt="Header centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('header/_header-centre.html')</code></pre> <a class="btn btn--component" href="/demo/header/header-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/header/_header-centre.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Header full <code>components/header/_header-full.html</code></h4> <p>A header with a full width background colour and logo aligned to the left.</p> <img class="docs__image" src="img/min/header-full.jpg" alt="Header full" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('header/_header-full.html')</code></pre> <a class="btn btn--component" href="/demo/header/header-full.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/header/_header-full.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Header full centre <code>components/header/_header-full-centre.html</code></h4> <p>A header with a full width background colour and logo aligned to the centre.</p> <img class="docs__image" src="img/min/header-full-centre.jpg" alt="Header full centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('header/_header-full-centre.html')</code></pre> <a class="btn btn--component" href="/demo/header/header-full-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/header/_header-full-centre.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Header text <code>components/header/_header-text.html</code></h4> <p>A text header aligned to the left.</p> <img class="docs__image" src="img/min/header-text.jpg" alt="Header text" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('header/_header-text.html')</code></pre> <a class="btn btn--component" href="/demo/header/header-text.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/header/_header-text.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Header text centre <code>components/header/_header-text-centre.html</code></h4> <p>A text header aligned to the centre.</p> <img class="docs__image" src="img/min/header-text-centre.jpg" alt="Header text centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('header/_header-text-centre.html')</code></pre> <a class="btn btn--component" href="/demo/header/header-text-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/header/_header-text-centre.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="hero"> <h2 class="docs__heading">Hero</h2> <h4> Hero - title, text and CTA <code>components/hero/_hero-title-text-cta.html</code> </h4> <p>A hero block with a title, text and CTA button aligned to the left.</p> <img class="docs__image" src="img/min/hero-title-text-cta.jpg" alt="Hero - title, text and CTA" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('hero/_hero-title-text-cta.html')</code></pre> <a class="btn btn--component" href="/demo/hero/hero-title-text-cta.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/hero/_hero-title-text-cta.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Hero - title, text and CTA centre <code>components/hero/_hero-title-text-cta-centre.html</code> </h4> <p>A hero block with a title, text and CTA button aligned to the centre.</p> <img class="docs__image" src="img/min/hero-title-text-cta-centre.jpg" alt="Hero - title, text and CTA centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('hero/_hero-title-text-cta-centre.html')</code></pre> <a class="btn btn--component" href="/demo/hero/hero-title-text-cta-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/hero/_hero-title-text-cta-centre.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Hero - image, title, text and CTA <code>components/hero/_hero-img-title-text-cta.html</code> </h4> <p>A hero block with an image, title, text and CTA button aligned to the left.</p> <img class="docs__image" src="img/min/hero-img-title-text-cta.jpg" alt="Hero - image, title, text and CTA" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('hero/_hero-img-title-text-cta.html')</code></pre> <a class="btn btn--component" href="/demo/hero/hero-img-title-text-cta.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/hero/_hero-img-title-text-cta.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Hero - image, title, text and CTA centre <code>components/hero/_hero-img-title-text-cta-centre.html</code> </h4> <p>A hero block with an image, title, text and CTA button aligned to the centre.</p> <img class="docs__image" src="img/min/hero-img-title-text-cta-centre.jpg" alt="Hero - image, title, text and CTA centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('hero/_hero-img-title-text-cta-centre.html')</code></pre> <a class="btn btn--component" href="/demo/hero/hero-img-title-text-cta-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/hero/_hero-img-title-text-cta-centre.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="list"> <h2 class="docs__heading">List</h2> <h4> List - image, title and author <code>components/list/_list-img-title-author.html</code> </h4> <p>A list style layout with section title, image, title and author.</p> <img class="docs__image" src="img/min/list-img-title-author.jpg" alt="List - image, title and author" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('list/_list-img-title-author.html')</code></pre> <a class="btn btn--component" href="/demo/list/list-img-title-author.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/list/_list-img-title-author.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>List - title and author <code>components/list/_list-title-author.html</code></h4> <p>A list style layout with section title, title and author.</p> <img class="docs__image" src="img/min/list-title-author.jpg" alt="List - title and author" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('list/_list-title-author.html')</code></pre> <a class="btn btn--component" href="/demo/list/list-title-author.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/list/_list-title-author.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="misc"> <h2 class="docs__heading">Misc</h2> <h4>Misc - Divider <code>components/misc/_divider.html</code></h4> <p>A full width dividing line.</p> <img class="docs__image" src="img/min/divider.jpg" alt="Misc - Divider" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('misc/_divider.html')</code></pre> <a class="btn btn--component" href="/demo/misc/divider.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/misc/_divider.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Misc - Section title centre <code>components/misc/_section-title-centre.html</code> </h4> <p> A section title aligned to the centre. Place this above a content component block (e.g Two up centre). </p> <img class="docs__image" src="img/min/section-title-centre.jpg" alt="Misc - Section title centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('misc/_section-title-centre.html')</code></pre> <a class="btn btn--component" href="/demo/misc/section-title-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/misc/_section-title-centre.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Misc - View in browser <code>components/misc/_view-in-browser.html</code></h4> <p>A basic full width block with text aligned to the centre.</p> <img class="docs__image" src="img/min/view-in-browser.jpg" alt="Misc - View in browser" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('misc/_view-in-browser.html')</code></pre> <a class="btn btn--component" href="/demo/misc/view-in-browser.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/misc/_view-in-browser.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="one-up"> <h2 class="docs__heading">One up</h2> <h4>One up - text <code>components/one-up/_one-up.html</code></h4> <p>A basic one column block.</p> <img class="docs__image" src="img/min/one-up.jpg" alt="One up" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('one-up/_one-up.html')</code></pre> <a class="btn btn--component" href="/demo/one-up/one-up.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/one-up/_one-up.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="two-up"> <h2 class="docs__heading">Two up</h2> <h4>Two up - text <code>components/two-up/_two-up-text.html</code></h4> <p>A two column text block aligned to the left.</p> <img class="docs__image" src="img/min/two-up-text.jpg" alt="Two up - text" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('two-up/_two-up-text.html')</code></pre> <a class="btn btn--component" href="/demo/two-up/two-up-text.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/two-up/_two-up-text.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Two up - title, text <code>components/two-up/_two-up-title-text.html</code></h4> <p>A two column text block with title aligned to the left.</p> <img class="docs__image" src="img/min/two-up-title-text.jpg" alt="Two up - title, text" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('two-up/_two-up-title-text.html')</code></pre> <a class="btn btn--component" href="/demo/two-up/two-up-title-text.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/two-up/_two-up-title-text.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Two up <code>components/two-up/_two-up.html</code></h4> <p>A two column block with image, title and text aligned to the left.</p> <img class="docs__image" src="img/min/two-up.jpg" alt="Two up" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('two-up/_two-up.html')</code></pre> <a class="btn btn--component" href="/demo/two-up/two-up.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/two-up/_two-up.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Two up - centre <code>components/two-up/_two-up-centre.html</code></h4> <p>A two column block with image, title and text aligned to the centre.</p> <img class="docs__image" src="img/min/two-up-centre.jpg" alt="Two up - centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('two-up/_two-up-centre.html')</code></pre> <a class="btn btn--component" href="/demo/two-up/two-up-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/two-up/_two-up-centre.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Two up - button <code>components/two-up/_two-up-button.html</code></h4> <p>A two column block with image, title, text and CTA button aligned to the left.</p> <img class="docs__image" src="img/min/two-up-button.jpg" alt="Two up - button" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('two-up/_two-up-button.html')</code></pre> <a class="btn btn--component" href="/demo/two-up/two-up-button.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/two-up/_two-up-button.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Two up - button centre <code>components/two-up/_two-up-button-centre.html</code> </h4> <p>A two column block with image, title, text and CTA button aligned to the centre.</p> <img class="docs__image" src="img/min/two-up-button-centre.jpg" alt="Two up - button centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('two-up/_two-up-button-centre.html')</code></pre> <a class="btn btn--component" href="/demo/two-up/two-up-button-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/two-up/_two-up-button-centre.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="three-up"> <h2 class="docs__heading">Three up</h2> <h4>Three up - text <code>components/three-up/_three-up-text.html</code></h4> <p>A three column text block aligned to the left.</p> <img class="docs__image" src="img/min/three-up-text.jpg" alt="Three up - text" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('three-up/_three-up-text.html')</code></pre> <a class="btn btn--component" href="/demo/three-up/three-up-text.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/three-up/_three-up-text.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Three up - title, text <code>components/three-up/_three-up-title-text.html</code> </h4> <p>A three column text block with title aligned to the left.</p> <img class="docs__image" src="img/min/three-up-title-text.jpg" alt="Three up - title, text" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('three-up/_three-up-title-text.html')</code></pre> <a class="btn btn--component" href="/demo/three-up/three-up-title-text.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/three-up/_three-up-title-text.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Three up <code>components/three-up/_three-up.html</code></h4> <p>A three column block with image, title and text aligned to the left.</p> <img class="docs__image" src="img/min/three-up.jpg" alt="Three up" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('three-up/_three-up.html')</code></pre> <a class="btn btn--component" href="/demo/three-up/three-up.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/three-up/_three-up.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Three up - centre <code>components/three-up/_three-up-centre.html</code></h4> <p>A three column block with image, title and text aligned to the centre.</p> <img class="docs__image" src="img/min/three-up-centre.jpg" alt="Three up - centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('three-up/_three-up-centre.html')</code></pre> <a class="btn btn--component" href="/demo/three-up/three-up-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/three-up/_three-up-centre.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Three up - button <code>components/three-up/_three-up-button.html</code></h4> <p>A three column block with image, title, text and CTA button aligned to the left.</p> <img class="docs__image" src="img/min/three-up-button.jpg" alt="Three up - button" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('three-up/_three-up-button.html')</code></pre> <a class="btn btn--component" href="/demo/three-up/three-up-button.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/three-up/_three-up-button.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Three up - button centre <code>components/three-up/_three-up-button-centre.html</code> </h4> <p> A three column block with image, title, text and CTA button aligned to the centre. </p> <img class="docs__image" src="img/min/three-up-button-centre.jpg" alt="Three up - button centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('three-up/_three-up-button-centre.html')</code></pre> <a class="btn btn--component" href="/demo/three-up/three-up-button-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/three-up/_three-up-button-centre.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="four-up"> <h2 class="docs__heading">Four up</h2> <h4>Four up <code>components/four-up/_four-up.html</code></h4> <p> A two column block with four items including image, title and text aligned to the left. </p> <img class="docs__image" src="img/min/four-up.jpg" alt="Four up" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('four-up/_four-up.html')</code></pre> <a class="btn btn--component" href="/demo/four-up/four-up.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/four-up/_four-up.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Four up - centre <code>components/four-up/_four-up-centre.html</code></h4> <p> A two column block with four items including image, title and text aligned to the centre. </p> <img class="docs__image" src="img/min/four-up-centre.jpg" alt="Four up - centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('four-up/_four-up-centre.html')</code></pre> <a class="btn btn--component" href="/demo/four-up/four-up-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/four-up/_four-up-centre.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Four up - button <code>components/four-up/_four-up-button.html</code></h4> <p> A two column block with four items including image, title, text and CTA button aligned to the left. </p> <img class="docs__image" src="img/min/four-up-button.jpg" alt="Four up - button" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('four-up/_four-up-button.html')</code></pre> <a class="btn btn--component" href="/demo/four-up/four-up-button.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/four-up/_four-up-button.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Four up - button centre <code>components/four-up/_four-up-button-centre.html</code> </h4> <p> A two column block with four items including image, title, text and CTA button aligned to the centre. </p> <img class="docs__image" src="img/min/four-up-button-centre.jpg" alt="Four up - button centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('four-up/_four-up-button-centre.html')</code></pre> <a class="btn btn--component" href="/demo/four-up/four-up-button-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/four-up/_four-up-button-centre.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="gallery"> <h2 class="docs__heading">Gallery</h2> <h4> Gallery - four up centre <code>components/gallery/_gallery-four-centre.html</code> </h4> <p>A two column gallery layout block including image, title and CTA button.</p> <img class="docs__image" src="img/min/gallery-four-centre.jpg" alt="Gallery - four up centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('gallery/_gallery-four-centre.html')</code></pre> <a class="btn btn--component" href="/demo/gallery/gallery-four-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/gallery/_gallery-four-centre.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="article"> <h2 class="docs__heading">Article</h2> <h4>Article <code>components/article/_article.html</code></h4> <p>A two column article layout block including image, title, text and CTA button.</p> <img class="docs__image" src="img/min/article.jpg" alt="Article" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('article/_article.html')</code></pre> <a class="btn btn--component" href="/demo/article/article.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/article/_article.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Article - multiple with title <code>components/article/_articles-title.html</code> </h4> <p> Multiple articles with a section heading including image, title, text and CTA button. </p> <img class="docs__image" src="img/min/articles-title.jpg" alt="Article - multiple with title" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('article/_articles-title.html')</code></pre> <a class="btn btn--component" href="/demo/article/articles-title.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/article/_articles-title.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="ecommerce"> <h2 class="docs__heading">eCommerce</h2> <h4>eCommerce Intro <code>components/ecommerce/_ecommerce-intro.html</code></h4> <p>A general eCommerce text introduction with CTA button.</p> <img class="docs__image" src="img/min/ecommerce-intro.jpg" alt="eCommerce Intro" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('ecommerce/_ecommerce-intro.html')</code></pre> <a class="btn btn--component" href="/demo/ecommerce/ecommerce-intro.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/ecommerce/_ecommerce-intro.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> eCommerce Order details <code>components/ecommerce/_ecommerce-order-details.html</code> </h4> <p>A general eCommerce product item with product image and description.</p> <img class="docs__image" src="img/min/ecommerce-order-details.jpg" alt="eCommerce Order details" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('ecommerce/_ecommerce-order-details.html')</code></pre> <a class="btn btn--component" href="/demo/ecommerce/ecommerce-order-details.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/ecommerce/_ecommerce-order-details.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> eCommerce Order total <code>components/ecommerce/_ecommerce-order-total.html</code> </h4> <p>A general eCommerce order total.</p> <img class="docs__image" src="img/min/ecommerce-order-total.jpg" alt="eCommerce Order total" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('ecommerce/_ecommerce-order-total.html')</code></pre> <a class="btn btn--component" href="/demo/ecommerce/ecommerce-order-total.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/ecommerce/_ecommerce-order-total.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> eCommerce Order delivery <code>components/ecommerce/_ecommerce-order-delivery.html</code> </h4> <p>An eCommerce two column order delivery section.</p> <img class="docs__image" src="img/min/ecommerce-order-total.jpg" alt="eCommerce Order delivery" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('ecommerce/_ecommerce-order-delivery.html')</code></pre> <a class="btn btn--component" href="/demo/ecommerce/ecommerce-order-delivery.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/ecommerce/_ecommerce-order-delivery.html" target="_blank" role="button" >View code</a > </section> <section class="docs__item" id="footer"> <h2 class="docs__heading">Footer</h2> <h4>Footer <code>components/footer/_footer.html</code></h4> <p>A text footer with text aligned to the left.</p> <img class="docs__image" src="img/min/footer.jpg" alt="Footer" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('footer/_footer.html')</code></pre> <a class="btn btn--component" href="/demo/footer/footer.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/footer/_footer.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Footer - centre <code>components/footer/_footer-centre.html</code></h4> <p>A text footer with text aligned to the centre.</p> <img class="docs__image" src="img/min/footer-centre.jpg" alt="Footer - centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('footer/_footer-centre.html')</code></pre> <a class="btn btn--component" href="/demo/footer/footer-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/footer/_footer-centre.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Footer full <code>components/footer/_footer-full.html</code></h4> <p>A text footer with a full width background colour aligned to the left.</p> <img class="docs__image" src="img/min/footer-full.jpg" alt="Footer full" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('footer/_footer-full.html')</code></pre> <a class="btn btn--component" href="/demo/footer/footer-full.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/footer/_footer-full.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Footer full - centre <code>components/footer/_footer-full-centre.html</code></h4> <p>A text footer with a full width background colour aligned to the centre.</p> <img class="docs__image" src="img/min/footer-full-centre.jpg" alt="Footer full - centre" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('footer/_footer-full-centre.html')</code></pre> <a class="btn btn--component" href="/demo/footer/footer-full-centre.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/footer/_footer-full-centre.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4> Footer full - logo and links <code>components/footer/_footer-full-logo-links.html</code> </h4> <p> A footer with a full width background colour. A logo aligned to the left and text aligned to the right. </p> <img class="docs__image" src="img/min/footer-full-logo-links.jpg" alt="Footer full - logo and links" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('footer/_footer-full-logo-links.html')</code></pre> <a class="btn btn--component" href="/demo/footer/footer-full-logo-links.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/footer/_footer-full-logo-links.html" target="_blank" role="button" >View code</a > <hr class="hr-alt" /> <h4>Footer - logo and links <code>components/footer/_footer-logo-links.html</code></h4> <p>A footer with a logo aligned to the left and text aligned to the right.</p> <img class="docs__image" src="img/min/footer-logo-links.jpg" alt="Footer - logo and links" /> <p>Copy and paste this into the main layout file.</p> <pre><code>@@include('footer/_footer-logo-links.html')</code></pre> <a class="btn btn--component" href="/demo/footer/footer-logo-links.html" target="_blank" role="button" >View demo</a > <a class="btn btn--code" href="https://raw.githubusercontent.com/matt-harris/outline-mail/master/templates/components/footer/_footer-logo-links.html" target="_blank" role="button" >View code</a > </section> <hr class="hr-alt" /> <footer class="footer docs__item clearfix"> <div class="container"> Outline Mail is a project by <a href="http://www.matt-harris.net">Matt Harris</a> </div> </footer> </div> </div> </div> <script> (function (i, s, o, g, r, a, m) { i.GoogleAnalyticsObject = r; (i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments); }), (i[r].l = 1 * new Date()); (a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]); a.async = 1; a.src = g; m.parentNode.insertBefore(a, m); })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); ga('create', 'UA-49516749-3', 'auto'); ga('send', 'pageview'); </script> <script src="js/min/bundle.js"></script> <script> smoothScroll.init({ speed: 800, easing: 'easeOutQuad', updateURL: false, }); </script> </body> </html>
matt-harris/outline-mail
site/get-started.html
HTML
mit
60,156
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WpfDataUi.DataTypes { public interface IMemberDefinition { string Name { get; } string Category { get; } Type MemberType { get; } } }
vchelaru/Gum
WpfDataUi/DataTypes/IMemberDefinition.cs
C#
mit
287
<?php /* FOSUserBundle:Security:login.html.twig */ class __TwigTemplate_383091f098980b9f7a3c205606bf588ec6cae4fb785430d477360b0c35dbad11 extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); // line 1 $this->parent = $this->loadTemplate("FOSUserBundle::layout.html.twig", "FOSUserBundle:Security:login.html.twig", 1); $this->blocks = array( 'fos_user_content' => array($this, 'block_fos_user_content'), ); } protected function doGetParent(array $context) { return "FOSUserBundle::layout.html.twig"; } protected function doDisplay(array $context, array $blocks = array()) { $__internal_c775830ac6ecaf92cfbf551e96fc8587445e400d85171ef65a5e049a34a65aad = $this->env->getExtension("native_profiler"); $__internal_c775830ac6ecaf92cfbf551e96fc8587445e400d85171ef65a5e049a34a65aad->enter($__internal_c775830ac6ecaf92cfbf551e96fc8587445e400d85171ef65a5e049a34a65aad_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "FOSUserBundle:Security:login.html.twig")); $this->parent->display($context, array_merge($this->blocks, $blocks)); $__internal_c775830ac6ecaf92cfbf551e96fc8587445e400d85171ef65a5e049a34a65aad->leave($__internal_c775830ac6ecaf92cfbf551e96fc8587445e400d85171ef65a5e049a34a65aad_prof); } // line 3 public function block_fos_user_content($context, array $blocks = array()) { $__internal_8754ff2f45c283e492a09401052d802e6d92f8496b512508a68c8deedb32be2b = $this->env->getExtension("native_profiler"); $__internal_8754ff2f45c283e492a09401052d802e6d92f8496b512508a68c8deedb32be2b->enter($__internal_8754ff2f45c283e492a09401052d802e6d92f8496b512508a68c8deedb32be2b_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "fos_user_content")); // line 4 if ((isset($context["error"]) ? $context["error"] : $this->getContext($context, "error"))) { // line 5 echo " <div>"; echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans((isset($context["error"]) ? $context["error"] : $this->getContext($context, "error")), array(), "FOSUserBundle"), "html", null, true); echo "</div> "; } // line 7 echo "<section class=\"login-page valign-wrapper\"> <div class=\"login-box valign\"> <h1 class=\"logo\"> StudyShare <br> <span>Université Joseph Fournier - <strong>Filière GTE</strong></span> </h1> <p>Connectez-vous pour accéder à votre espace StudyShare</p> <form action=\""; // line 13 echo $this->env->getExtension('routing')->getPath("fos_user_security_check"); echo "\" method=\"post\", id=\"LoginForm\"> <input type=\"hidden\" name=\"_csrf_token\" value=\""; // line 14 echo twig_escape_filter($this->env, (isset($context["csrf_token"]) ? $context["csrf_token"] : $this->getContext($context, "csrf_token")), "html", null, true); echo "\" /> <div class=\"input-field\"> <i class=\"material-icons prefix\">perm_identity</i> <label for=\"username\">"; // line 17 echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("security.login.username", array(), "FOSUserBundle"), "html", null, true); echo "</label> <input type=\"text\" id=\"username\" name=\"_username\" value=\""; // line 18 echo twig_escape_filter($this->env, (isset($context["last_username"]) ? $context["last_username"] : $this->getContext($context, "last_username")), "html", null, true); echo "\" required=\"required\" /> </div> <div class=\"input-field\"> <i class=\"material-icons prefix\">lock</i> <label for=\"password\">"; // line 22 echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("security.login.password", array(), "FOSUserBundle"), "html", null, true); echo "</label> <input type=\"password\" id=\"password\" name=\"_password\" required=\"required\" /> </div> <input type=\"checkbox\" id=\"remember_me\" name=\"_remember_me\" value=\"on\" /> <label for=\"remember_me\">"; // line 27 echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("security.login.remember_me", array(), "FOSUserBundle"), "html", null, true); echo "</label> <input type=\"submit\" id=\"_submit\" name=\"_submit\" value=\""; // line 29 echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("security.login.submit", array(), "FOSUserBundle"), "html", null, true); echo "\" /> </form> </div> </section> "; $__internal_8754ff2f45c283e492a09401052d802e6d92f8496b512508a68c8deedb32be2b->leave($__internal_8754ff2f45c283e492a09401052d802e6d92f8496b512508a68c8deedb32be2b_prof); } public function getTemplateName() { return "FOSUserBundle:Security:login.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 90 => 29, 85 => 27, 77 => 22, 70 => 18, 66 => 17, 60 => 14, 56 => 13, 48 => 7, 42 => 5, 40 => 4, 34 => 3, 11 => 1,); } } /* {% extends "FOSUserBundle::layout.html.twig" %}*/ /* */ /* {% block fos_user_content %}*/ /* {% if error %}*/ /* <div>{{ error|trans({}, 'FOSUserBundle') }}</div>*/ /* {% endif %}*/ /* <section class="login-page valign-wrapper">*/ /* <div class="login-box valign">*/ /* <h1 class="logo">*/ /* StudyShare <br> <span>Université Joseph Fournier - <strong>Filière GTE</strong></span>*/ /* </h1>*/ /* <p>Connectez-vous pour accéder à votre espace StudyShare</p>*/ /* <form action="{{ path("fos_user_security_check") }}" method="post", id="LoginForm">*/ /* <input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />*/ /* <div class="input-field">*/ /* <i class="material-icons prefix">perm_identity</i>*/ /* <label for="username">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>*/ /* <input type="text" id="username" name="_username" value="{{ last_username }}" required="required" />*/ /* </div>*/ /* <div class="input-field">*/ /* <i class="material-icons prefix">lock</i>*/ /* <label for="password">{{ 'security.login.password'|trans({}, 'FOSUserBundle') }}</label>*/ /* <input type="password" id="password" name="_password" required="required" />*/ /* </div>*/ /* */ /* <input type="checkbox" id="remember_me" name="_remember_me" value="on" />*/ /* <label for="remember_me">{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}</label>*/ /* */ /* <input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}" />*/ /* </form>*/ /* </div>*/ /* </section>*/ /* */ /* {% endblock fos_user_content %}*/ /* */
daniel-dahan/StudyShare
app/cache/dev/twig/8a/8a0071a6a820bb95804b0b51bd03cad36b7b2d14ba03bd6b95d694f56fd3e04c.php
PHP
mit
7,414
# Dash A web browser casual game. The rule is simple: send the panel to the correct direction, if you can! In DASH you must press the arrow accordingly to what is being shown within the remaining time and the number of lives. # Collaborations A project like this could not be possibly polished and tested without a little a help of some people! Special thanks to [Thiago Wittmann](http://thiagowittmann.github.io/), [Mateus Craveiro](http://mccraveiro.github.io/), [Alexandre Almeida](http://alexandrealmeida.io/) and [Rafael Tomazela](https://twitter.com/sohakes). # License MIT
brenolf/dash
README.md
Markdown
mit
583
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Input; namespace Ragnarok.Presentation.Control.WindowOperation { /// <summary> /// ウィンドウの移動を開始します。 /// </summary> class WindowMoverStarter : IWindowOperationStarter { private readonly MovableWindow window; public override Cursor GetCursor(Point wp) { return Cursors.Hand; } public override WindowOperationBase BeginOperation(Point wp) { var operation = new WindowMover(this.window); operation.Begin(wp); return operation; } public WindowMoverStarter(MovableWindow window) { this.window = window; } } /// <summary> /// ウィンドウの移動を行います。 /// </summary> class WindowMover : WindowOperationBase { private Point relativePoint; protected override void OnBegin(Point wp) { this.relativePoint = wp; } protected override void OnOperate(Point wp) { var devicePos = Window.PointToScreen(wp); var screenPos = WPFUtil.LogicalFromDevice(devicePos, Window); var leftTop = new Point( screenPos.X - this.relativePoint.X, screenPos.Y - this.relativePoint.Y); Window.Left = leftTop.X; Window.Top = leftTop.Y; } public WindowMover(MovableWindow window) : base(window) { } } }
ebifrier/Ragnarok
Ragnarok.Presentation/Control/WindowOperation/WindowMover.cs
C#
mit
1,637
#pragma once #include "BaseOptions.h" #include "SpellLib.h" #include "IChampion.h" #include "OnRender.cpp" class Jhin : public IChampion { public: void Menu() override { MainMenu = GPluginSDK->AddMenu("RyTaks_Jhin"); ComboMenu = MainMenu->AddMenu("Combo Settings"); ComboQ = ComboMenu->CheckBox("Use Q", true); ComboW = ComboMenu->CheckBox("Use W", true); ComboE = ComboMenu->CheckBox("Use E", true); ComboR = ComboMenu->CheckBox("Use R", true); HarassMenu = MainMenu->AddMenu("Harass Settings"); HarassQ = HarassMenu->CheckBox("Use Q", true); HarassW = HarassMenu->CheckBox("Use W", true); HarassE = HarassMenu->CheckBox("Use E", true); HarassMana = HarassMenu->AddFloat("Min. Mana", 0, 100, 60); LaneClearMenu = MainMenu->AddMenu("Farm Settings"); LaneClearQ = LaneClearMenu->CheckBox("Use Q", true); LaneClearW = LaneClearMenu->CheckBox("Use W", true); LaneClearE = LaneClearMenu->CheckBox("Use E", true); LaneClearMana = LaneClearMenu->AddFloat("Min. Mana", 0, 100, 40); KSMenu = MainMenu->AddMenu("Killsteal Settings"); KSQ = KSMenu->CheckBox("Killsteal with Q", true); KSW = KSMenu->CheckBox("Killsteal with W", true); KSE = KSMenu->CheckBox("Killsteal with E", true); KSR = KSMenu->CheckBox("Killsteal with R", true); DrawMenu = MainMenu->AddMenu("Drawing Settings"); DrawReady = DrawMenu->CheckBox("Draw Only Ready Spells", true); DrawOff = DrawMenu->CheckBox("Disable Drawings", false); DrawQ = DrawMenu->CheckBox("Draw Q", true); DrawW = DrawMenu->CheckBox("Draw W", true); DrawE = DrawMenu->CheckBox("Draw E", true); DrawR = DrawMenu->CheckBox("Draw R", true); } void Spells() override { SpellLib().Jhin(); } void Combo(IUnit* Target) override { if (GOrbwalking->GetOrbwalkingMode() == kModeCombo) { Target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, Q->Range()); for (auto Target : GEntityList->GetAllHeros(false, true)) if (ComboQ->Enabled() && Q->IsReady()) { Q->CastOnTarget(Target); } if (ComboW->Enabled() && W->IsReady()) { W->CastOnTarget(Target); } if (ComboE->Enabled() && E->IsReady()) { E->CastOnTarget(Target); } } } void Harass(IUnit* Target) override { if (GOrbwalking->GetOrbwalkingMode() == kModeMixed && GEntityList->Player()->ManaPercent() >= HarassMana->GetInteger()) { Target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, Q->Range()); for (auto Target : GEntityList->GetAllHeros(false, true)) if (HarassQ->Enabled() && Q->IsReady() && GEntityList->Player()->ManaPercent() >= HarassMana->GetInteger()) { Q->CastOnTarget(Target); } if (HarassW->Enabled() && W->IsReady() && GEntityList->Player()->ManaPercent() >= HarassMana->GetInteger()) { W->CastOnTarget(Target); } if (HarassE->Enabled() && E->IsReady() && GEntityList->Player()->ManaPercent() >= HarassMana->GetInteger()) { E->CastOnTarget(Target); } } } void LaneClear(IUnit* Target) override { if (GOrbwalking->GetOrbwalkingMode() == kModeLaneClear) { if (GEntityList->Player()->ManaPercent() >= LaneClearMana->GetFloat()) { minion = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, Q->Range()); for (auto minion : GEntityList->GetAllMinions(false, true, true)) { if (minion->IsTarget(GEntityList->Player()) && !minion->IsDead() && GEntityList->Player()->IsValidTarget(minion, Q->Range())) { if (LaneClearQ->Enabled() && Q->IsReady()) { Q->CastOnTarget(minion); } if (LaneClearW->Enabled() && W->IsReady()) { E->CastOnTarget(minion); } if (LaneClearE->Enabled() && E->IsReady()) { E->CastOnTarget(minion); } } } } } } void KS(IUnit* Target) override { Target = GTargetSelector->FindTarget(QuickestKill, PhysicalDamage, Q->Range()); for (auto Target : GEntityList->GetAllHeros(false, true)) { if (Target != nullptr && !Target->IsDead()) { if (KSQ->Enabled() && Q->IsReady()) { auto dmg = GHealthPrediction->GetKSDamage(Target, kSlotQ, Q->GetDelay(), true); if (Target->GetHealth() <= dmg) { Q->CastOnTarget(Target, kHitChanceHigh); } } if (KSW->Enabled() && W->IsReady()) { auto dmg = GHealthPrediction->GetKSDamage(Target, kSlotW, W->GetDelay(), true); if (Target->GetHealth() <= dmg) { W->CastOnTarget(Target, kHitChanceHigh); } } if (KSE->Enabled() && E->IsReady()) { auto dmg = GHealthPrediction->GetKSDamage(Target, kSlotE, E->GetDelay(), true); if (Target->GetHealth() <= dmg) { E->CastOnTarget(Target, kHitChanceHigh); } } if (KSR->Enabled() && R->IsReady()) { auto dmg = GHealthPrediction->GetKSDamage(Target, kSlotR, R->GetDelay(), true); Vec3 pos; int hit; GPrediction->FindBestCastPosition(R->Range(), R->Radius(), true, true, false, pos, hit); if (Target->GetHealth() <= dmg) { R->CastOnPosition(pos); } } } } } void OnRender() override { OnRenderClass().Render(); } void BeforeAttack(IUnit* Source, IUnit* Target) override { } void AfterAttack(IUnit* Source, IUnit* Target) override { } void OnGapCloser(GapCloserSpell const& Args) override { } void OnProcessSpell(CastedSpell const& Args) override { } void RRange() override { } void RDamage() override { } };
RyTak/LeaguePlusPlus
RyTakAIO/RyTakAIOv2/Jhin.cpp
C++
mit
5,642
<!doctype html> <html class="no-js" lang=""> <head> <title>Zabuun - Learn Egyptian Arabic for English speakers</title> <meta name="description" content=""> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/head.php';?> </head> <body> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/ie8.php';?> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/header.php';?> <div class="content"> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/side.php';?> <div class="main"> <div class="location"> <p class="breadcrumbs">Essays > Stuck in the Desert</p> <p class="expandcollapse"> <a href="">Expand All</a> | <a href="">Collapse All</a> </p> </div> <!-- begin essay --> <h1>Stuck in the Desert</h1> <p> Patricia asked for the cheapest car available at Acme Car Rental. She needed a car for 48 hours. Because it was the weekend, there was only one car available at the moment—an SUV. Patricia was an environmentalist. SUVs, which are big cars consuming a lot of gasoline, offended her greatly.</p> <!-- end essay --> </div> </div> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/footer.php';?> <?php include $_SERVER['DOCUMENT_ROOT'].'/layout/scripts.php';?> </body> </html>
javanigus/zabuun
essay/2160-stuck-in-the-desert.php
PHP
mit
1,240
var map; require([ "esri/map", "esri/layers/ArcGISDynamicMapServiceLayer", "esri/layers/FeatureLayer", "dojo/on", "dojo/dom", "dojo/query", "dojo/domReady!" ], function( Map, ArcGISDynamicMapServiceLayer, FeatureLayer, on, query, dom ) { map = new Map("map",{ basemap: "topo", center: [-121, 47.55], zoom: 11 }); var info = new FeatureLayer("http://services1.arcgis.com/mRXrgD3LWwGHJmpS/arcgis/rest/services/wenatchee_rec/FeatureServer/0",{ mode: FeatureLayer.MODE_ONDEMAND, outFields:["*"] }); var camp = new FeatureLayer("http://services1.arcgis.com/mRXrgD3LWwGHJmpS/arcgis/rest/services/wenatchee_rec/FeatureServer/5",{ mode: FeatureLayer.MODE_ONDEMAND, outFields:["*"] }); var trail = new FeatureLayer("http://services1.arcgis.com/mRXrgD3LWwGHJmpS/arcgis/rest/services/wenatchee_rec/FeatureServer/4",{ mode: FeatureLayer.MODE_ONDEMAND, outFields:["*"] }); var boat = new FeatureLayer("http://services1.arcgis.com/mRXrgD3LWwGHJmpS/arcgis/rest/services/wenatchee_rec/FeatureServer/3",{ mode: FeatureLayer.MODE_ONDEMAND, outFields:["*"] }); var picnic = new FeatureLayer("http://services1.arcgis.com/mRXrgD3LWwGHJmpS/arcgis/rest/services/wenatchee_rec/FeatureServer/2",{ mode: FeatureLayer.MODE_ONDEMAND, outFields:["*"] }); var ski = new FeatureLayer("http://services1.arcgis.com/mRXrgD3LWwGHJmpS/arcgis/rest/services/wenatchee_rec/FeatureServer/1",{ mode: FeatureLayer.MODE_ONDEMAND, outFields:["*"] }); map.addLayer(info); map.addLayer(camp); map.addLayer(trail); map.addLayer(boat); map.addLayer(picnic); map.addLayer(ski); //click event for layers //using dojo for the event and class toggling but could just as easily be jQuery or vanilla javascript on(dojo.byId("trail"), "click", function() { trail.visible ? trail.hide() : trail.show(); dojo.toggleClass(this, "visible"); dojo.query("#trail .visibility-icon").toggleClass("fa-picture-o").toggleClass("fa-ban"); }); on(dojo.byId("camp"), "click", function() { camp.visible ? camp.hide() : camp.show(); dojo.toggleClass(this, "visible"); dojo.query("#camp .visibility-icon").toggleClass("fa-picture-o").toggleClass("fa-ban"); }); on(dojo.byId("picnic"), "click", function() { picnic.visible ? picnic.hide() : picnic.show(); dojo.toggleClass(this, "visible"); dojo.query("#picnic .visibility-icon").toggleClass("fa-picture-o").toggleClass("fa-ban"); }); on(dojo.byId("ski"), "click", function() { ski.visible ? ski.hide() : ski.show(); dojo.toggleClass(this, "visible"); dojo.query("#ski .visibility-icon").toggleClass("fa-picture-o").toggleClass("fa-ban"); }); on(dojo.byId("boat"), "click", function() { boat.visible ? boat.hide() : boat.show(); dojo.toggleClass(this, "visible"); dojo.query("#boat .visibility-icon").toggleClass("fa-picture-o").toggleClass("fa-ban"); }); on(dojo.byId("info"), "click", function() { info.visible ? info.hide() : info.show(); dojo.toggleClass(this, "visible"); dojo.query("#info .visibility-icon").toggleClass("fa-picture-o").toggleClass("fa-ban"); }); trail.on("mouse-over", showInfo); trail.on("mouse-out", clearInfo); camp.on("mouse-over", showInfo); camp.on("mouse-out", clearInfo); picnic.on("mouse-over", showInfo); picnic.on("mouse-out", clearInfo); ski.on("mouse-over", showInfo); ski.on("mouse-out", clearInfo); boat.on("mouse-over", showInfo); boat.on("mouse-out", clearInfo); info.on("mouse-over", showInfo); info.on("mouse-out", clearInfo); function clearInfo(e) { dojo.byId("site-info").innerHTML = ""; } function showInfo(e) { dojo.byId("site-info").innerHTML = e.graphic.attributes.REC_NAME; } } );
brightrain/togglability
js/index.js
JavaScript
mit
4,450
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { SlidingBarComponent } from './sliding-bar.component'; @NgModule({ imports: [ CommonModule ], declarations: [ SlidingBarComponent, ], exports: [ SlidingBarComponent ] }) export class SlidingBarModule {}
mika-el/angular-loading-page
library/angular-loading-page/src/lib/loaders/sliding-bar/sliding-bar.module.ts
TypeScript
mit
327
<!doctype html> <html class="theme-next use-motion "> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <link href="/uniDog/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/> <link href='//fonts.googleapis.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext' rel='stylesheet' type='text/css'> <link href="/uniDog/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" /> <link href="/uniDog/css/main.css?v=0.4.5.2" rel="stylesheet" type="text/css" /> <meta name="keywords" content="Hexo, NexT, UVa, Luckycat, 翻譯, algorithm, 演算法" /> <link rel="shortcut icon" type="image/x-icon" href="/uniDog/uniDog/favicon.ico?v=0.4.5.2" /> <meta name="description" content="有 3 個桶子用來裝回收的玻璃瓶,玻璃瓶的顏色有三種:棕色 (Brown)、綠色 (Green)、透明色 (Clear)。在這個問題裡我們會告訴你每個桶子裏的玻璃瓶的顏色及數量,現在要搬移桶子裏的玻璃瓶使得最後每個桶子裡都只有單一顏色的玻璃瓶,以方便回收。你的任務就是要算出最小搬移的瓶子數。你可以假設每個桶子的容量無限大,並且總共搬移的瓶子數不會超過 $2^{31}$&amp;lt;!-- Has MathJa"> <meta property="og:type" content="article"> <meta property="og:title" content="102 - Ecological Bin Packing"> <meta property="og:url" content="http://pcshic.github.io/uniDog/problem/p102/index.html"> <meta property="og:site_name" content="uniDog 的 ACM 園地"> <meta property="og:description" content="有 3 個桶子用來裝回收的玻璃瓶,玻璃瓶的顏色有三種:棕色 (Brown)、綠色 (Green)、透明色 (Clear)。在這個問題裡我們會告訴你每個桶子裏的玻璃瓶的顏色及數量,現在要搬移桶子裏的玻璃瓶使得最後每個桶子裡都只有單一顏色的玻璃瓶,以方便回收。你的任務就是要算出最小搬移的瓶子數。你可以假設每個桶子的容量無限大,並且總共搬移的瓶子數不會超過 $2^{31}$&amp;lt;!-- Has MathJa"> <meta property="og:updated_time" content="2016-02-11T17:37:49.726Z"> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="102 - Ecological Bin Packing"> <meta name="twitter:description" content="有 3 個桶子用來裝回收的玻璃瓶,玻璃瓶的顏色有三種:棕色 (Brown)、綠色 (Green)、透明色 (Clear)。在這個問題裡我們會告訴你每個桶子裏的玻璃瓶的顏色及數量,現在要搬移桶子裏的玻璃瓶使得最後每個桶子裡都只有單一顏色的玻璃瓶,以方便回收。你的任務就是要算出最小搬移的瓶子數。你可以假設每個桶子的容量無限大,並且總共搬移的瓶子數不會超過 $2^{31}$&amp;lt;!-- Has MathJa"> <script type="text/javascript" id="hexo.configuration"> var CONFIG = { scheme: '', sidebar: 'post', motion: true }; </script> <title> 102 - Ecological Bin Packing | uniDog 的 ACM 園地 </title> </head> <body itemscope itemtype="http://schema.org/WebPage" lang="zh-TW"> <!--[if lte IE 8]> <div style=' clear: both; height: 59px; padding:0 0 0 15px; position: relative;margin:0 auto;'> <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"> <img src="http://7u2nvr.com1.z0.glb.clouddn.com/picouterie.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today or use other browser ,like chrome firefox safari." style='margin-left:auto;margin-right:auto;display: block;'/> </a> </div> <![endif]--> <div class="container one-column page-post-detail"> <div class="headband"></div> <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"><div class="site-meta "> <div class="custom-logo-site-title"> <a href="/uniDog/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <span class="site-title">uniDog 的 ACM 園地</span> <span class="logo-line-after"><i></i></span> </a> </div> <p class="site-subtitle"></p> </div> <div class="site-nav-toggle"> <button> <span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span> </button> </div> <nav class="site-nav"> <ul id="menu" class="menu "> <li class="menu-item menu-item-home"> <a href="/uniDog" rel="section"> <i class="menu-item-icon fa fa-home fa-fw"></i> <br /> 首頁 </a> </li> <li class="menu-item menu-item-categories"> <a href="/uniDog/categories" rel="section"> <i class="menu-item-icon fa fa-th fa-fw"></i> <br /> 分類 </a> </li> <li class="menu-item menu-item-archives"> <a href="/uniDog/archives" rel="section"> <i class="menu-item-icon fa fa-archive fa-fw"></i> <br /> 歸檔 </a> </li> <li class="menu-item menu-item-tags"> <a href="/uniDog/tags" rel="section"> <i class="menu-item-icon fa fa-tags fa-fw"></i> <br /> 標籤 </a> </li> </ul> </nav> </div> </header> <main id="main" class="main"> <div class="main-inner"> <div id="content" class="content"> <div id="posts" class="posts-expand"> <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article"> <header class="post-header"> <h1 class="post-title" itemprop="name headline"> 102 - Ecological Bin Packing </h1> <div class="post-meta"> <span class="post-translator"> <a href="/uniDog/problem/p102/"> <span>Luckycat</span> </a> </span> <span class="post-translate-url"> &nbsp; | &nbsp; 來自 <a href="http://luckycat.kshs.kh.edu.tw/homework/q102.htm" target="_blank"> <span>Lucky 貓</span> </a> </span> <span class="post-time"> &nbsp; | &nbsp; 發表於 <time itemprop="dateCreated" datetime="2002-02-04T00:00:00+08:00" content="2002-02-04"> 2002-02-04 </time> </span> <span class="post-category" > &nbsp; | &nbsp; 分類於 <span itemprop="about" itemscope itemtype="https://schema.org/Thing"> <a href="/uniDog/categories/Volume-001/" itemprop="url" rel="index"> <span itemprop="name">Volume - 001</span> </a> </span> </span> <span class="post-original" > &nbsp; | &nbsp; <a href="https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=38" target="_blank"> <span>UVa</span> </a> </span> </div> </header> <div class="post-body"> <span itemprop="articleBody"><p>有 3 個桶子用來裝回收的玻璃瓶,玻璃瓶的顏色有三種:棕色 (Brown)、綠色 (Green)、透明色 (Clear)。在這個問題裡我們會告訴你每個桶子裏的玻璃瓶的顏色及數量,現在要搬移桶子裏的玻璃瓶使得最後每個桶子裡都只有單一顏色的玻璃瓶,以方便回收。你的任務就是要算出最小搬移的瓶子數。你可以假設每個桶子的容量無限大,並且總共搬移的瓶子數不會超過 <span>$2^{31}$</span><!-- Has MathJax -->。</p> <a id="more"></a> <h2 id="Input">Input</h2><p>每筆測試資料一行,每行有 9 個整數,前 3 個代表第 1 個桶子裡 Brown、Green、Clear 顏色的瓶子數。接下來的 3 個數代表第 2 個桶子裡 Brown、Green、Clear 顏色的瓶子數。最後的 3 個數代表第 3 個桶子裡 Brown、Green、Clear 顏色的瓶子數。</p> <p>例如:10 15 20 30 12 8 15 8 31 表示有 20 個 Clear 色的玻璃瓶在第 1 個桶子裏,12 個 Green 色的玻璃瓶在第 2 個桶子裏,15 個 Brown 色的玻璃瓶在第 3 個桶子裏。</p> <h2 id="Output">Output</h2><p>對每一筆測試資料,輸出 3 個桶子內最後存放之玻璃瓶顏色,以及最小搬移的瓶子數。請以大寫的 <code>G</code>、<code>B</code>、<code>C</code> 分別代表綠色 (Green)、棕色 (Brown)、透明色 (Clear)。</p> <p>例如:BCG 30 代表最後搬移的結果第 1 個桶子內的玻璃瓶顏色為 Brown,第 2 個桶子內的玻璃瓶顏色為 Clear,第 3 個桶子內的玻璃瓶顏色為 Green。並且總共搬移了 30 個玻璃瓶。</p> <p>如果最小搬移瓶子數有一組以上的組合,請輸出字典順序最小的那一組答案。</p> <h2 id="Sample_input">Sample input</h2><pre><code><span class="number">1</span> <span class="number">2</span> <span class="number">3</span> <span class="number">4</span> <span class="number">5</span> <span class="number">6</span> <span class="number">7</span> <span class="number">8</span> <span class="number">9</span> <span class="number">5</span> <span class="number">10</span> <span class="number">5</span> <span class="number">20</span> <span class="number">10</span> <span class="number">5</span> <span class="number">10</span> <span class="number">20</span> <span class="number">10</span> </code></pre><h2 id="Sample_Output">Sample Output</h2><pre><code>BCG <span class="number">30</span> CBG <span class="number">50</span> </code></pre></span> </div> <footer class="post-footer"> <div class="post-nav"> <div class="post-nav-next post-nav-item"> <a href="/uniDog/problem/p10110/" rel="next" title="10110 - Light, more light"> <i class="fa fa-chevron-left"></i> 10110 - Light, more light </a> </div> <div class="post-nav-prev post-nav-item"> <a href="/uniDog/problem/p10189/" rel="prev" title="10189 - Minesweeper"> 10189 - Minesweeper <i class="fa fa-chevron-right"></i> </a> </div> </div> </footer> </article> <div class="post-spread"> </div> </div> </div> <div class="comments" id="comments"> </div> </div> <div class="sidebar-toggle"> <div class="sidebar-toggle-line-wrap"> <span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span> </div> </div> <aside id="sidebar" class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" > 文章目錄 </li> <li class="sidebar-nav-overview" data-target="site-overview"> 本站概覽 </li> </ul> <section class="site-overview sidebar-panel "> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" src="/uniDog/images/default_avatar.jpg" alt="uniDog 團隊 @ pcshic" itemprop="image"/> <p class="site-author-name" itemprop="name">uniDog 團隊 @ pcshic</p> </div> <p class="site-description motion-element" itemprop="description"></p> <nav class="site-state motion-element"> <div class="site-state-item site-state-posts"> <a href="/uniDog/archives"> <span class="site-state-item-count">206</span> <span class="site-state-item-name">文章</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/uniDog/categories"> <span class="site-state-item-count">33</span> <span class="site-state-item-name">分類</span> </a> </div> <div class="site-state-item site-state-tags"> <a href="/uniDog/tags"> <span class="site-state-item-count">40</span> <span class="site-state-item-name">標籤</span> </a> </div> </nav> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/pcshic" target="_blank"> <i class="fa fa-github"></i> GitHub </a> </span> </div> <div class="links-of-author motion-element"> </div> </section> <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active"> <div class="post-toc-indicator-top post-toc-indicator"> <i class="fa fa-angle-double-up"></i> </div> <div class="post-toc"> <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Input"><span class="nav-text">Input</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Output"><span class="nav-text">Output</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Sample_input"><span class="nav-text">Sample input</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Sample_Output"><span class="nav-text">Sample Output</span></a></li></ol></div> </div> <div class="post-toc-indicator-bottom post-toc-indicator"> <i class="fa fa-angle-double-down"></i> </div> </section> </div> </aside> </main> <footer id="footer" class="footer"> <div class="footer-inner"> <div class="copyright" > &copy; 2014 - <span itemprop="copyrightYear">2016</span> <span class="with-love"> <i class="icon-next-heart fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">uniDog 團隊 @ pcshic</span> </div> <div class="powered-by"> 由 <a class="theme-link" href="http://hexo.io">Hexo</a> 強力驅動 </div> <div class="theme-info"> 主題 - <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next"> NexT </a> </div> </div> </footer> <div class="back-to-top"></div> </div> <script type="text/javascript" src="/uniDog/vendors/jquery/index.js?v=2.1.3"></script> <script type="text/javascript" src="/uniDog/vendors/fancybox/source/jquery.fancybox.pack.js"></script> <script type="text/javascript" src="/uniDog/js/fancy-box.js?v=0.4.5.2"></script> <script type="text/javascript" src="/uniDog/js/helpers.js?v=0.4.5.2"></script> <script type="text/javascript" src="/uniDog/vendors/velocity/velocity.min.js"></script> <script type="text/javascript" src="/uniDog/vendors/velocity/velocity.ui.min.js"></script> <script type="text/javascript" src="/uniDog/js/motion.js?v=0.4.5.2" id="motion.global"></script> <script type="text/javascript" src="/uniDog/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script> <script type="text/javascript" src="/uniDog/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script> <script type="text/javascript" src="/uniDog/js/bootstrap.scrollspy.js?v=0.4.5.2" id="bootstrap.scrollspy.custom"></script> <script type="text/javascript" id="sidebar.toc.highlight"> $(document).ready(function () { var tocSelector = '.post-toc'; var $tocSelector = $(tocSelector); var activeCurrentSelector = '.active-current'; $tocSelector .on('activate.bs.scrollspy', function () { var $currentActiveElement = $(tocSelector + ' .active').last(); removeCurrentActiveClass(); $currentActiveElement.addClass('active-current'); $tocSelector[0].scrollTop = $currentActiveElement.position().top; }) .on('clear.bs.scrollspy', function () { removeCurrentActiveClass(); }); function removeCurrentActiveClass () { $(tocSelector + ' ' + activeCurrentSelector) .removeClass(activeCurrentSelector.substring(1)); } function processTOC () { getTOCMaxHeight(); toggleTOCOverflowIndicators(); } function getTOCMaxHeight () { var height = $('.sidebar').height() - $tocSelector.position().top - $('.post-toc-indicator-bottom').height(); $tocSelector.css('height', height); return height; } function toggleTOCOverflowIndicators () { tocOverflowIndicator( '.post-toc-indicator-top', $tocSelector.scrollTop() > 0 ? 'show' : 'hide' ); tocOverflowIndicator( '.post-toc-indicator-bottom', $tocSelector.scrollTop() >= $tocSelector.find('ol').height() - $tocSelector.height() ? 'hide' : 'show' ) } $(document).on('sidebar.motion.complete', function () { processTOC(); }); $('body').scrollspy({ target: tocSelector }); $(window).on('resize', function () { if ( $('.sidebar').hasClass('sidebar-active') ) { processTOC(); } }); onScroll($tocSelector); function onScroll (element) { element.on('mousewheel DOMMouseScroll', function (event) { var oe = event.originalEvent; var delta = oe.wheelDelta || -oe.detail; this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30; event.preventDefault(); toggleTOCOverflowIndicators(); }); } function tocOverflowIndicator (indicator, action) { var $indicator = $(indicator); var opacity = action === 'show' ? 1 : 0; $indicator.velocity ? $indicator.velocity('stop').velocity({ opacity: opacity }, { duration: 100 }) : $indicator.stop().animate({ opacity: opacity }, 100); } }); </script> <script type="text/javascript" id="sidebar.nav"> $(document).ready(function () { var html = $('html'); var TAB_ANIMATE_DURATION = 200; var hasVelocity = $.isFunction(html.velocity); $('.sidebar-nav li').on('click', function () { var item = $(this); var activeTabClassName = 'sidebar-nav-active'; var activePanelClassName = 'sidebar-panel-active'; if (item.hasClass(activeTabClassName)) { return; } var currentTarget = $('.' + activePanelClassName); var target = $('.' + item.data('target')); hasVelocity ? currentTarget.velocity('transition.slideUpOut', TAB_ANIMATE_DURATION, function () { target .velocity('stop') .velocity('transition.slideDownIn', TAB_ANIMATE_DURATION) .addClass(activePanelClassName); }) : currentTarget.animate({ opacity: 0 }, TAB_ANIMATE_DURATION, function () { currentTarget.hide(); target .stop() .css({'opacity': 0, 'display': 'block'}) .animate({ opacity: 1 }, TAB_ANIMATE_DURATION, function () { currentTarget.removeClass(activePanelClassName); target.addClass(activePanelClassName); }); }); item.siblings().removeClass(activeTabClassName); item.addClass(activeTabClassName); }); $('.post-toc a').on('click', function (e) { e.preventDefault(); var targetSelector = escapeSelector(this.getAttribute('href')); var offset = $(targetSelector).offset().top; hasVelocity ? html.velocity('stop').velocity('scroll', { offset: offset + 'px', mobileHA: false }) : $('html, body').stop().animate({ scrollTop: offset }, 500); }); // Expand sidebar on post detail page by default, when post has a toc. motionMiddleWares.sidebar = function () { var $tocContent = $('.post-toc-content'); if (CONFIG.sidebar === 'post') { if ($tocContent.length > 0 && $tocContent.html().trim().length > 0) { displaySidebar(); } } }; }); </script> <script type="text/javascript" src="/uniDog/js/bootstrap.js"></script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], processEscapes: true, skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'] } }); </script> <script type="text/x-mathjax-config"> MathJax.Hub.Queue(function() { var all = MathJax.Hub.getAllJax(), i; for (i=0; i < all.length; i += 1) { all[i].SourceElement().parentNode.className += ' has-jax'; } }); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <!-- mathjax config similar to math.stackexchange --> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], processEscapes: true } }); </script> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'] } }); </script> <script type="text/x-mathjax-config"> MathJax.Hub.Queue(function() { var all = MathJax.Hub.getAllJax(), i; for(i=0; i < all.length; i += 1) { all[i].SourceElement().parentNode.className += ' has-jax'; } }); </script> <script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> </body> </html>
pcshic/uniDog
problem/p102/index.html
HTML
mit
23,014
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ (function(global: any) { interface ScheduledFunction { endTime: number; id: number; func: Function; args: any[]; delay: number; isPeriodic: boolean; isRequestAnimationFrame: boolean; } interface MicroTaskScheduledFunction { func: Function; args?: any[]; target: any; } interface MacroTaskOptions { source: string; isPeriodic?: boolean; callbackArgs?: any; } const OriginalDate = global.Date; class FakeDate { constructor() { if (arguments.length === 0) { const d = new OriginalDate(); d.setTime(FakeDate.now()); return d; } else { const args = Array.prototype.slice.call(arguments); return new OriginalDate(...args); } } static now() { const fakeAsyncTestZoneSpec = Zone.current.get('FakeAsyncTestZoneSpec'); if (fakeAsyncTestZoneSpec) { return fakeAsyncTestZoneSpec.getCurrentRealTime() + fakeAsyncTestZoneSpec.getCurrentTime(); } return OriginalDate.now.apply(this, arguments); } } (FakeDate as any).UTC = OriginalDate.UTC; (FakeDate as any).parse = OriginalDate.parse; // keep a reference for zone patched timer function const timers = { setTimeout: global.setTimeout, setInterval: global.setInterval, clearTimeout: global.clearTimeout, clearInterval: global.clearInterval }; class Scheduler { // Next scheduler id. public static nextId: number = 1; // Scheduler queue with the tuple of end time and callback function - sorted by end time. private _schedulerQueue: ScheduledFunction[] = []; // Current simulated time in millis. private _currentTime: number = 0; // Current real time in millis. private _currentRealTime: number = OriginalDate.now(); // track requeuePeriodicTimer private _currentTickRequeuePeriodicEntries: any[] = []; constructor() {} getCurrentTime() { return this._currentTime; } getCurrentRealTime() { return this._currentRealTime; } setCurrentRealTime(realTime: number) { this._currentRealTime = realTime; } scheduleFunction(cb: Function, delay: number, options?: { args?: any[], isPeriodic?: boolean, isRequestAnimationFrame?: boolean, id?: number, isRequeuePeriodic?: boolean }): number { options = { ...{ args: [], isPeriodic: false, isRequestAnimationFrame: false, id: -1, isRequeuePeriodic: false }, ...options }; let currentId = options.id! < 0 ? Scheduler.nextId++ : options.id!; let endTime = this._currentTime + delay; // Insert so that scheduler queue remains sorted by end time. let newEntry: ScheduledFunction = { endTime: endTime, id: currentId, func: cb, args: options.args!, delay: delay, isPeriodic: options.isPeriodic!, isRequestAnimationFrame: options.isRequestAnimationFrame! }; if (options.isRequeuePeriodic!) { this._currentTickRequeuePeriodicEntries.push(newEntry); } let i = 0; for (; i < this._schedulerQueue.length; i++) { let currentEntry = this._schedulerQueue[i]; if (newEntry.endTime < currentEntry.endTime) { break; } } this._schedulerQueue.splice(i, 0, newEntry); return currentId; } removeScheduledFunctionWithId(id: number): void { for (let i = 0; i < this._schedulerQueue.length; i++) { if (this._schedulerQueue[i].id == id) { this._schedulerQueue.splice(i, 1); break; } } } tick(millis: number = 0, doTick?: (elapsed: number) => void, tickOptions?: { processNewMacroTasksSynchronously: boolean }): void { let finalTime = this._currentTime + millis; let lastCurrentTime = 0; tickOptions = Object.assign({processNewMacroTasksSynchronously: true}, tickOptions); // we need to copy the schedulerQueue so nested timeout // will not be wrongly called in the current tick // https://github.com/angular/angular/issues/33799 const schedulerQueue = tickOptions.processNewMacroTasksSynchronously ? this._schedulerQueue : this._schedulerQueue.slice(); if (schedulerQueue.length === 0 && doTick) { doTick(millis); return; } while (schedulerQueue.length > 0) { // clear requeueEntries before each loop this._currentTickRequeuePeriodicEntries = []; let current = schedulerQueue[0]; if (finalTime < current.endTime) { // Done processing the queue since it's sorted by endTime. break; } else { // Time to run scheduled function. Remove it from the head of queue. let current = schedulerQueue.shift()!; if (!tickOptions.processNewMacroTasksSynchronously) { const idx = this._schedulerQueue.indexOf(current); if (idx >= 0) { this._schedulerQueue.splice(idx, 1); } } lastCurrentTime = this._currentTime; this._currentTime = current.endTime; if (doTick) { doTick(this._currentTime - lastCurrentTime); } let retval = current.func.apply( global, current.isRequestAnimationFrame ? [this._currentTime] : current.args); if (!retval) { // Uncaught exception in the current scheduled function. Stop processing the queue. break; } // check is there any requeue periodic entry is added in // current loop, if there is, we need to add to current loop if (!tickOptions.processNewMacroTasksSynchronously) { this._currentTickRequeuePeriodicEntries.forEach(newEntry => { let i = 0; for (; i < schedulerQueue.length; i++) { const currentEntry = schedulerQueue[i]; if (newEntry.endTime < currentEntry.endTime) { break; } } schedulerQueue.splice(i, 0, newEntry); }); } } } lastCurrentTime = this._currentTime; this._currentTime = finalTime; if (doTick) { doTick(this._currentTime - lastCurrentTime); } } flush(limit = 20, flushPeriodic = false, doTick?: (elapsed: number) => void): number { if (flushPeriodic) { return this.flushPeriodic(doTick); } else { return this.flushNonPeriodic(limit, doTick); } } private flushPeriodic(doTick?: (elapsed: number) => void): number { if (this._schedulerQueue.length === 0) { return 0; } // Find the last task currently queued in the scheduler queue and tick // till that time. const startTime = this._currentTime; const lastTask = this._schedulerQueue[this._schedulerQueue.length - 1]; this.tick(lastTask.endTime - startTime, doTick); return this._currentTime - startTime; } private flushNonPeriodic(limit: number, doTick?: (elapsed: number) => void): number { const startTime = this._currentTime; let lastCurrentTime = 0; let count = 0; while (this._schedulerQueue.length > 0) { count++; if (count > limit) { throw new Error( 'flush failed after reaching the limit of ' + limit + ' tasks. Does your code use a polling timeout?'); } // flush only non-periodic timers. // If the only remaining tasks are periodic(or requestAnimationFrame), finish flushing. if (this._schedulerQueue.filter(task => !task.isPeriodic && !task.isRequestAnimationFrame) .length === 0) { break; } const current = this._schedulerQueue.shift()!; lastCurrentTime = this._currentTime; this._currentTime = current.endTime; if (doTick) { // Update any secondary schedulers like Jasmine mock Date. doTick(this._currentTime - lastCurrentTime); } const retval = current.func.apply(global, current.args); if (!retval) { // Uncaught exception in the current scheduled function. Stop processing the queue. break; } } return this._currentTime - startTime; } } class FakeAsyncTestZoneSpec implements ZoneSpec { static assertInZone(): void { if (Zone.current.get('FakeAsyncTestZoneSpec') == null) { throw new Error('The code should be running in the fakeAsync zone to call this function'); } } private _scheduler: Scheduler = new Scheduler(); private _microtasks: MicroTaskScheduledFunction[] = []; private _lastError: Error|null = null; private _uncaughtPromiseErrors: {rejection: any}[] = (Promise as any)[(Zone as any).__symbol__('uncaughtPromiseErrors')]; pendingPeriodicTimers: number[] = []; pendingTimers: number[] = []; private patchDateLocked = false; constructor( namePrefix: string, private trackPendingRequestAnimationFrame = false, private macroTaskOptions?: MacroTaskOptions[]) { this.name = 'fakeAsyncTestZone for ' + namePrefix; // in case user can't access the construction of FakeAsyncTestSpec // user can also define macroTaskOptions by define a global variable. if (!this.macroTaskOptions) { this.macroTaskOptions = global[Zone.__symbol__('FakeAsyncTestMacroTask')]; } } private _fnAndFlush(fn: Function, completers: {onSuccess?: Function, onError?: Function}): Function { return (...args: any[]): boolean => { fn.apply(global, args); if (this._lastError === null) { // Success if (completers.onSuccess != null) { completers.onSuccess.apply(global); } // Flush microtasks only on success. this.flushMicrotasks(); } else { // Failure if (completers.onError != null) { completers.onError.apply(global); } } // Return true if there were no errors, false otherwise. return this._lastError === null; }; } private static _removeTimer(timers: number[], id: number): void { let index = timers.indexOf(id); if (index > -1) { timers.splice(index, 1); } } private _dequeueTimer(id: number): Function { return () => { FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers, id); }; } private _requeuePeriodicTimer(fn: Function, interval: number, args: any[], id: number): Function { return () => { // Requeue the timer callback if it's not been canceled. if (this.pendingPeriodicTimers.indexOf(id) !== -1) { this._scheduler.scheduleFunction( fn, interval, {args, isPeriodic: true, id, isRequeuePeriodic: true}); } }; } private _dequeuePeriodicTimer(id: number): Function { return () => { FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers, id); }; } private _setTimeout(fn: Function, delay: number, args: any[], isTimer = true): number { let removeTimerFn = this._dequeueTimer(Scheduler.nextId); // Queue the callback and dequeue the timer on success and error. let cb = this._fnAndFlush(fn, {onSuccess: removeTimerFn, onError: removeTimerFn}); let id = this._scheduler.scheduleFunction(cb, delay, {args, isRequestAnimationFrame: !isTimer}); if (isTimer) { this.pendingTimers.push(id); } return id; } private _clearTimeout(id: number): void { FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers, id); this._scheduler.removeScheduledFunctionWithId(id); } private _setInterval(fn: Function, interval: number, args: any[]): number { let id = Scheduler.nextId; let completers = {onSuccess: null as any, onError: this._dequeuePeriodicTimer(id)}; let cb = this._fnAndFlush(fn, completers); // Use the callback created above to requeue on success. completers.onSuccess = this._requeuePeriodicTimer(cb, interval, args, id); // Queue the callback and dequeue the periodic timer only on error. this._scheduler.scheduleFunction(cb, interval, {args, isPeriodic: true}); this.pendingPeriodicTimers.push(id); return id; } private _clearInterval(id: number): void { FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers, id); this._scheduler.removeScheduledFunctionWithId(id); } private _resetLastErrorAndThrow(): void { let error = this._lastError || this._uncaughtPromiseErrors[0]; this._uncaughtPromiseErrors.length = 0; this._lastError = null; throw error; } getCurrentTime() { return this._scheduler.getCurrentTime(); } getCurrentRealTime() { return this._scheduler.getCurrentRealTime(); } setCurrentRealTime(realTime: number) { this._scheduler.setCurrentRealTime(realTime); } static patchDate() { if (!!global[Zone.__symbol__('disableDatePatching')]) { // we don't want to patch global Date // because in some case, global Date // is already being patched, we need to provide // an option to let user still use their // own version of Date. return; } if (global['Date'] === FakeDate) { // already patched return; } global['Date'] = FakeDate; FakeDate.prototype = OriginalDate.prototype; // try check and reset timers // because jasmine.clock().install() may // have replaced the global timer FakeAsyncTestZoneSpec.checkTimerPatch(); } static resetDate() { if (global['Date'] === FakeDate) { global['Date'] = OriginalDate; } } static checkTimerPatch() { if (global.setTimeout !== timers.setTimeout) { global.setTimeout = timers.setTimeout; global.clearTimeout = timers.clearTimeout; } if (global.setInterval !== timers.setInterval) { global.setInterval = timers.setInterval; global.clearInterval = timers.clearInterval; } } lockDatePatch() { this.patchDateLocked = true; FakeAsyncTestZoneSpec.patchDate(); } unlockDatePatch() { this.patchDateLocked = false; FakeAsyncTestZoneSpec.resetDate(); } tick(millis: number = 0, doTick?: (elapsed: number) => void, tickOptions: { processNewMacroTasksSynchronously: boolean } = {processNewMacroTasksSynchronously: true}): void { FakeAsyncTestZoneSpec.assertInZone(); this.flushMicrotasks(); this._scheduler.tick(millis, doTick, tickOptions); if (this._lastError !== null) { this._resetLastErrorAndThrow(); } } flushMicrotasks(): void { FakeAsyncTestZoneSpec.assertInZone(); const flushErrors = () => { if (this._lastError !== null || this._uncaughtPromiseErrors.length) { // If there is an error stop processing the microtask queue and rethrow the error. this._resetLastErrorAndThrow(); } }; while (this._microtasks.length > 0) { let microtask = this._microtasks.shift()!; microtask.func.apply(microtask.target, microtask.args); } flushErrors(); } flush(limit?: number, flushPeriodic?: boolean, doTick?: (elapsed: number) => void): number { FakeAsyncTestZoneSpec.assertInZone(); this.flushMicrotasks(); const elapsed = this._scheduler.flush(limit, flushPeriodic, doTick); if (this._lastError !== null) { this._resetLastErrorAndThrow(); } return elapsed; } // ZoneSpec implementation below. name: string; properties: {[key: string]: any} = {'FakeAsyncTestZoneSpec': this}; onScheduleTask(delegate: ZoneDelegate, current: Zone, target: Zone, task: Task): Task { switch (task.type) { case 'microTask': let args = task.data && (task.data as any).args; // should pass additional arguments to callback if have any // currently we know process.nextTick will have such additional // arguments let additionalArgs: any[]|undefined; if (args) { let callbackIndex = (task.data as any).cbIdx; if (typeof args.length === 'number' && args.length > callbackIndex + 1) { additionalArgs = Array.prototype.slice.call(args, callbackIndex + 1); } } this._microtasks.push({ func: task.invoke, args: additionalArgs, target: task.data && (task.data as any).target }); break; case 'macroTask': switch (task.source) { case 'setTimeout': task.data!['handleId'] = this._setTimeout( task.invoke, task.data!['delay']!, Array.prototype.slice.call((task.data as any)['args'], 2)); break; case 'setImmediate': task.data!['handleId'] = this._setTimeout( task.invoke, 0, Array.prototype.slice.call((task.data as any)['args'], 1)); break; case 'setInterval': task.data!['handleId'] = this._setInterval( task.invoke, task.data!['delay']!, Array.prototype.slice.call((task.data as any)['args'], 2)); break; case 'XMLHttpRequest.send': throw new Error( 'Cannot make XHRs from within a fake async test. Request URL: ' + (task.data as any)['url']); case 'requestAnimationFrame': case 'webkitRequestAnimationFrame': case 'mozRequestAnimationFrame': // Simulate a requestAnimationFrame by using a setTimeout with 16 ms. // (60 frames per second) task.data!['handleId'] = this._setTimeout( task.invoke, 16, (task.data as any)['args'], this.trackPendingRequestAnimationFrame); break; default: // user can define which macroTask they want to support by passing // macroTaskOptions const macroTaskOption = this.findMacroTaskOption(task); if (macroTaskOption) { const args = task.data && (task.data as any)['args']; const delay = args && args.length > 1 ? args[1] : 0; let callbackArgs = macroTaskOption.callbackArgs ? macroTaskOption.callbackArgs : args; if (!!macroTaskOption.isPeriodic) { // periodic macroTask, use setInterval to simulate task.data!['handleId'] = this._setInterval(task.invoke, delay, callbackArgs); task.data!.isPeriodic = true; } else { // not periodic, use setTimeout to simulate task.data!['handleId'] = this._setTimeout(task.invoke, delay, callbackArgs); } break; } throw new Error('Unknown macroTask scheduled in fake async test: ' + task.source); } break; case 'eventTask': task = delegate.scheduleTask(target, task); break; } return task; } onCancelTask(delegate: ZoneDelegate, current: Zone, target: Zone, task: Task): any { switch (task.source) { case 'setTimeout': case 'requestAnimationFrame': case 'webkitRequestAnimationFrame': case 'mozRequestAnimationFrame': return this._clearTimeout(<number>task.data!['handleId']); case 'setInterval': return this._clearInterval(<number>task.data!['handleId']); default: // user can define which macroTask they want to support by passing // macroTaskOptions const macroTaskOption = this.findMacroTaskOption(task); if (macroTaskOption) { const handleId: number = <number>task.data!['handleId']; return macroTaskOption.isPeriodic ? this._clearInterval(handleId) : this._clearTimeout(handleId); } return delegate.cancelTask(target, task); } } onInvoke( delegate: ZoneDelegate, current: Zone, target: Zone, callback: Function, applyThis: any, applyArgs?: any[], source?: string): any { try { FakeAsyncTestZoneSpec.patchDate(); return delegate.invoke(target, callback, applyThis, applyArgs, source); } finally { if (!this.patchDateLocked) { FakeAsyncTestZoneSpec.resetDate(); } } } findMacroTaskOption(task: Task) { if (!this.macroTaskOptions) { return null; } for (let i = 0; i < this.macroTaskOptions.length; i++) { const macroTaskOption = this.macroTaskOptions[i]; if (macroTaskOption.source === task.source) { return macroTaskOption; } } return null; } onHandleError(parentZoneDelegate: ZoneDelegate, currentZone: Zone, targetZone: Zone, error: any): boolean { this._lastError = error; return false; // Don't propagate error to parent zone. } } // Export the class so that new instances can be created with proper // constructor params. (Zone as any)['FakeAsyncTestZoneSpec'] = FakeAsyncTestZoneSpec; })(typeof window === 'object' && window || typeof self === 'object' && self || global);
matsko/angular
packages/zone.js/lib/zone-spec/fake-async-test.ts
TypeScript
mit
20,848
package kale.ast; import kale.Scope; import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; public class IfStatement extends Expression { final Expression condition; /** statements to execute if condition is true */ final Expression[] ifBlock; // Note: either 'nestedIf' or 'elseBlock' should be non-null /** 'else if' */ final Expression nestedIf; /** 'else' */ final Expression[] elseBlock; public IfStatement( Expression condition, Expression[] ifBlock, Expression nestedIf, Expression[] elseBlock ) { this.condition = condition; this.ifBlock = ifBlock; this.nestedIf = nestedIf; this.elseBlock = elseBlock; addChild( condition ); addChildren( ifBlock ); if( nestedIf != null ) { addChild( nestedIf ); } if( elseBlock != null ) { addChildren( elseBlock ); } } @Override public void inferType(Scope scope) { condition.inferType(scope); Scope ifBlockScope = scope.newFrameSubScope(); for( Expression statement : ifBlock ) { statement.inferType( ifBlockScope ); } if( nestedIf != null ) { Scope nestedIfScope = scope.newFrameSubScope(); nestedIf.inferType( nestedIfScope ); } if( elseBlock != null ) { Scope elseBlockScope = scope.newFrameSubScope(); for( Expression statement : elseBlock ) { statement.inferType( elseBlockScope ); } } } @Override public void emitBytecode(MethodVisitor mv) { // it's assumed the condition will push a boolean onto // the stack indicating its result condition.emitBytecode(mv); Label l0 = new Label(); mv.visitJumpInsn(Opcodes.IFEQ, l0); // emit bytecode for 'true' condition for( Expression statement : ifBlock ) { statement.emitBytecode(mv); } // emit bytecode for 'false' condition mv.visitLabel(l0); if( nestedIf != null ) { // if 'condition' is false, this should be called nestedIf.emitBytecode(mv); } else if( elseBlock != null ) { // if 'condition' is false, this should be branched to for( Expression statement : elseBlock ) { statement.emitBytecode(mv); } } } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("if ").append( this.condition ).append(" {\n"); for( Expression block : ifBlock ) { sb.append( block ); } sb.append("\n}\n"); if( this.nestedIf != null ) { sb.append("else "); sb.append( this.nestedIf ); } else if( this.elseBlock != null ) { sb.append("else {\n"); for( Expression block : elseBlock ) { sb.append( block ); } sb.append("\n}\n"); } return sb.toString(); } }
bpd/kale
src/kale/ast/IfStatement.java
Java
mit
2,704
from __future__ import unicode_literals, absolute_import from django.apps import AppConfig class CoreConfig(AppConfig): name = 'Internet_store.core'
maistrovas/Internet-Store
Internet_store/core/apps.py
Python
mit
154
package packet import ( "bytes" "io" ) // A PUBACK Packet is the response to a PUBLISH Packet with QoS level 1. type PubackPacket struct { PacketId Integer } func (p *PubackPacket) ControlType() Bit4 { return TypePUBACK } func (p *PubackPacket) FixedHeader() *FixedHeader { return &FixedHeader{ ControlType: TypePUBACK, Flags: 0, Remaining: 2, } } func (p *PubackPacket) VariableHeader() *VariableHeader { return &VariableHeader{ Vary: p.PacketId.Bytes(), } } func (p *PubackPacket) Payload() *Payload { return nil } func (p *PubackPacket) WriteTo(w io.Writer) (n int64, err error) { var buf bytes.Buffer buf.Write(p.FixedHeader().Bytes()) buf.Write(p.VariableHeader().Vary) return buf.WriteTo(w) } func ParsePubackPacketFromReader(r io.Reader, first byte) (p *PubackPacket, err error) { if 0 != first&0x0f { err = ErrFixedHeaderFlags return } b := make([]byte, 3) _, err = io.ReadFull(r, b) if err != nil { return } if b[0] != 2 { err = ErrRemainLength return } p = &PubackPacket{ PacketId: IntegerFrom(b[1], b[2]), } return } func ParsePubackPacket(b []byte) (p *PubackPacket, err error) { if len(b) < 4 { err = ErrLessData return } if byte(TypePUBACK<<4) != b[0] { err = ErrControlType return } if 2 != b[1] { err = ErrRemainLength return } p = &PubackPacket{ PacketId: IntegerFrom(b[2], b[3]), } return }
hilldan/mqtt
packet/puback.go
GO
mit
1,387
/* * The MIT License (MIT) * * Copyright (c) 2012-2014 Fredrik Holmstrom ([email protected]) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ using System; using System.Collections.Generic; using System.Threading; namespace UdpKit { public enum UdpSocketState : int { Created = 0, Running = 1, Shutdown = 2 } public partial class UdpSocket { /// <summary> /// The amount of redundant acks we should do, valid values are: /// 8, 16, 24, 32, 40, 48, 56, 64 /// </summary> public static int AckRedundancy { // do not change this number unless you know EXACTLY what you are doings get { return 64; } } /// <summary> /// If we should calculate network ping or not /// </summary> public static bool CalculateNetworkPing { // do not change this boolean unless you know EXACTLY what you are doings get { return true; } } /// <summary> /// The size of the udpkit internal header sent with each packet /// </summary> public static int HeaderBitSize { // do not change this code unless you know EXACTLY what you are doings get { return ((UdpHeader.SEQ_BITS + UdpHeader.SEQ_PADD) * 2) + AckRedundancy + (CalculateNetworkPing ? 16 : 0); } } readonly internal UdpConfig Config; volatile int frame; volatile UdpSocketState state; readonly Random random; readonly UdpStats stats; readonly Thread threadSocket; readonly UdpPlatform platform; readonly UdpStream readStream; readonly UdpStream writeStream; readonly UdpConfig configCopy; readonly UdpStreamPool streamPool; readonly AutoResetEvent availableEvent; readonly Queue<UdpEvent> eventQueueIn; readonly Queue<UdpEvent> eventQueueOut; readonly UdpSerializerFactory serializerFactory; readonly UdpSerializer serializer; readonly List<UdpConnection> connList = new List<UdpConnection>(); readonly UdpSet<UdpEndPoint> pendingConnections = new UdpSet<UdpEndPoint>(new UdpEndPoint.Comparer()); readonly Dictionary<UdpEndPoint, UdpConnection> connLookup = new Dictionary<UdpEndPoint, UdpConnection>(new UdpEndPoint.Comparer()); /// <summary> /// Local endpoint of this socket /// </summary> [Obsolete("Use LocalEndPoint instead")] public UdpEndPoint EndPoint { get { return platform.EndPoint; } } /// <summary> /// Local endpoint of this socket /// </summary> public UdpEndPoint LocalEndPoint { get { return platform.EndPoint; } } /// <summary> /// The current state of the socket /// </summary> public UdpSocketState State { get { return state; } } /// <summary> /// Statistics for the entire socket /// </summary> public UdpStats Statistics { get { return stats; } } /// <summary> /// Returns a copy of the active configuration. /// Changing values on this copy does nothing. /// </summary> public UdpConfig ConfigCopy { get { return this.configCopy; } } /// <summary> /// The precision time (in ms) of the underlying socket platform /// </summary> public uint PrecisionTime { get { return GetCurrentTime(); } } public UdpStreamPool StreamPool { get { return streamPool; } } /// <summary> /// A thread can wait on this event before calling Poll to make sure at least one event is available /// </summary> public AutoResetEvent EventsAvailable { get { return availableEvent; } } /// <summary> /// A user-assignable object /// </summary> public object UserToken { get; set; } UdpSocket (UdpPlatform platform, UdpSerializerFactory serializerFactory, UdpConfig config) { this.platform = platform; this.serializerFactory = serializerFactory; this.Config = config.Duplicate(); this.configCopy = config; serializer = CreateSerializer(); state = UdpSocketState.Created; random = new Random(); stats = new UdpStats(); availableEvent = new AutoResetEvent(false); if (this.Config.NoiseFunction == null) { this.Config.NoiseFunction = delegate() { return (float) random.NextDouble(); }; } readStream = new UdpStream(new byte[config.PacketSize * 2]); writeStream = new UdpStream(new byte[config.PacketSize * 2]); streamPool = new UdpStreamPool(this); eventQueueIn = new Queue<UdpEvent>(config.InitialEventQueueSize); eventQueueOut = new Queue<UdpEvent>(config.InitialEventQueueSize); threadSocket = new Thread(NetworkLoop); threadSocket.Name = "udpkit thread"; threadSocket.IsBackground = true; threadSocket.Start(); } /// <summary> /// Start this socket /// </summary> /// <param name="endpoint">The endpoint to bind to</param> public void Start (UdpEndPoint endpoint) { Raise(UdpEvent.INTERNAL_START, endpoint); } /// <summary> /// Close this socket /// </summary> public void Close () { Raise(UdpEvent.INTERNAL_CLOSE); } /// <summary> /// Connect to remote endpoint /// </summary> /// <param name="endpoint">The endpoint to connect to</param> public void Connect (UdpEndPoint endpoint) { Raise(UdpEvent.INTERNAL_CONNECT, endpoint); } /// <summary> /// Connect to remote endpoint /// </summary> /// <param name="endpoint">The endpoint to connect to</param> /// <param name="hailObject">An object to send along with the connect</param> public void Connect(UdpEndPoint endpoint, object hailObject) { Raise(UdpEvent.INTERNAL_CONNECT, endpoint, hailObject); } /// <summary> /// Cancel ongoing attempt to connect to endpoint /// </summary> /// <param name="endpoint">The endpoint to cancel connect attempt to</param> public void CancelConnect (UdpEndPoint endpoint) { Raise(UdpEvent.INTERNAL_CONNECT_CANCEL, endpoint); } /// <summary> /// Accept a connection request from a remote endpoint /// </summary> /// <param name="endpoint">The endpoint to accept</param> public void Accept (UdpEndPoint endpoint) { Raise(UdpEvent.INTERNAL_ACCEPT, endpoint); } public void Accept (UdpEndPoint endPoint, object replyObject) { Raise(UdpEvent.INTERNAL_ACCEPT, endPoint, replyObject); } /// <summary> /// Refuse a connection request from a remote endpoint /// </summary> /// <param name="endpoint">The endpoint to refuse</param> public void Refuse (UdpEndPoint endpoint) { Raise(UdpEvent.INTERNAL_REFUSE, endpoint); } /// <summary> /// Suspends the networking thread for N milliseconds. /// Usefull for simulating unusual networking conditions. /// </summary> /// <param name="milliseconds">How long to sleep</param> public void Sleep (int milliseconds) { #if DEBUG Raise(UdpEvent.INTERNAL_SLEEP, milliseconds); #else UdpLog.Warn("Calling UdpSocket.Sleep in non-debug build is not supported"); #endif } /// <summary> /// Poll socket for any events /// </summary> /// <param name="ev">The current event on this socket</param> /// <returns>True if a new event is available, False otherwise</returns> public bool Poll (out UdpEvent ev) { lock (eventQueueOut) { if (eventQueueOut.Count > 0) { ev = eventQueueOut.Dequeue(); return true; } } ev = default(UdpEvent); return false; } /// <summary> /// Peek the next event from the socket /// </summary> /// <param name="ev">The next event on this socket</param> /// <returns>True if an event is available, False otherwise</returns> public bool Peek (out UdpEvent ev) { lock (eventQueueOut) { if (eventQueueOut.Count > 0) { ev = eventQueueOut.Peek(); return true; } } ev = default(UdpEvent); return false; } internal void Raise (int eventType) { UdpEvent ev = new UdpEvent(); ev.Type = eventType; Raise(ev); } internal void Raise (int eventType, int intval) { UdpEvent ev = new UdpEvent(); ev.Type = eventType; ev.OptionIntValue = intval; Raise(ev); } internal void Raise (int eventType, UdpEndPoint endpoint) { UdpEvent ev = new UdpEvent(); ev.Type = eventType; ev.EndPoint = endpoint; Raise(ev); } internal void Raise(int eventType, UdpEndPoint endpoint, object obj) { UdpEvent ev = new UdpEvent(); ev.Type = eventType; ev.EndPoint = endpoint; ev.Object = obj; Raise(ev); } internal void Raise (int eventType, UdpConnection connection) { UdpEvent ev = new UdpEvent(); ev.Type = eventType; ev.Connection = connection; Raise(ev); } internal void Raise (int eventType, UdpConnection connection, object obj) { UdpEvent ev = new UdpEvent(); ev.Type = eventType; ev.Connection = connection; ev.Object = obj; Raise(ev); } internal void Raise (int eventType, UdpConnection connection, object obj, UdpSendFailReason reason) { UdpEvent ev = new UdpEvent(); ev.Type = eventType; ev.Connection = connection; ev.FailedReason = reason; ev.Object = obj; Raise(ev); } internal void Raise (int eventType, UdpConnection connection, UdpConnectionOption option, int value) { UdpEvent ev = new UdpEvent(); ev.Type = eventType; ev.Connection = connection; ev.Option = option; ev.OptionIntValue = value; Raise(ev); } internal bool Send (UdpEndPoint endpoint, byte[] buffer, int length) { if (state == UdpSocketState.Running || state == UdpSocketState.Created) { int bytesSent = 0; //UdpLog.Debug("sending packet to {0}", endpoint); return platform.SendTo(buffer, length, endpoint, ref bytesSent); } return false; } internal float RandomFloat () { return (float) random.NextDouble(); } internal UdpSerializer CreateSerializer () { return serializerFactory(); } internal UdpStream GetReadStream () { // clear data buffer every time Array.Clear(readStream.Data, 0, readStream.Data.Length); readStream.Ptr = 0; readStream.Length = 0; return readStream; } internal UdpStream GetWriteStream (int length, int offset) { // clear data buffer every time Array.Clear(writeStream.Data, 0, writeStream.Data.Length); writeStream.Ptr = offset; writeStream.Length = length; return writeStream; } internal uint GetCurrentTime () { return platform.PlatformPrecisionTime; } void Raise (UdpEvent ev) { if (ev.IsInternal) { lock (eventQueueIn) { eventQueueIn.Enqueue(ev); } } else { lock (eventQueueOut) { eventQueueOut.Enqueue(ev); } if (Config.UseAvailableEventEvent) { availableEvent.Set(); } } } void SendRefusedCommand (UdpEndPoint endpoint) { UdpStream stream = GetWriteStream(Config.PacketSize << 3, HeaderBitSize); stream.WriteByte((byte) UdpCommandType.Refused, 8); UdpHeader header = new UdpHeader(); header.IsObject = false; header.AckHistory = 0; header.AckSequence = 1; header.ObjSequence = 1; header.Now = 0; header.Pack(stream, this); if (Send(endpoint, stream.Data, UdpMath.BytesRequired(stream.Ptr)) == false) { // do something here? } } bool ChangeState (UdpSocketState from, UdpSocketState to) { if (CheckState(from)) { state = to; return true; } return false; } bool CheckState (UdpSocketState s) { if (state != s) { return false; } return true; } UdpConnection CreateConnection (UdpEndPoint endpoint, UdpConnectionMode mode, object hailMessage) { if (connLookup.ContainsKey(endpoint)) { UdpLog.Warn("connection for {0} already exists", endpoint); return default(UdpConnection); } UdpConnection cn = new UdpConnection(this, mode, endpoint, hailMessage); connLookup.Add(endpoint, cn); connList.Add(cn); return cn; } bool DestroyConnection (UdpConnection cn) { for (int i = 0; i < connList.Count; ++i) { if (connList[i] == cn) { connList.RemoveAt(i); connLookup.Remove(cn.RemoteEndPoint); cn.Destroy(); return true; } } return false; } void NetworkLoop () { bool created = false; bool started = false; while (state == UdpSocketState.Created || state == UdpSocketState.Running) { try { if (created == false) { UdpLog.Info("socket created"); created = true; } while (state == UdpSocketState.Created) { ProcessIncommingEvents(true); Thread.Sleep(1); } if (started == false) { UdpLog.Info("socket started"); started = true; } while (state == UdpSocketState.Running) { RecvDelayedPackets(); RecvNetworkData(); ProcessTimeouts(); ProcessIncommingEvents(false); frame += 1; } UdpLog.Info("socket closed"); return; } catch (Exception exn) { UdpLog.Error(exn.ToString()); } } } void ProcessIncommingEvents (bool returnOnStart) { while (true) { UdpEvent ev = default(UdpEvent); lock (eventQueueIn) { if (eventQueueIn.Count > 0) { ev = eventQueueIn.Dequeue(); } } if (ev.Type == 0) { return; } switch (ev.Type) { case UdpEvent.INTERNAL_START: OnEventStart(ev); if (returnOnStart) { return; } else { break; } case UdpEvent.INTERNAL_CONNECT: OnEventConnect(ev); break; case UdpEvent.INTERNAL_CONNECT_CANCEL: OnEventConnectCancel(ev); break; case UdpEvent.INTERNAL_ACCEPT: OnEventAccept(ev); break; case UdpEvent.INTERNAL_REFUSE: OnEventRefuse(ev); break; case UdpEvent.INTERNAL_DISCONNECT: OnEventDisconect(ev); break; case UdpEvent.INTERNAL_CLOSE: OnEventClose(ev); break; case UdpEvent.INTERNAL_SEND: OnEventSend(ev); break; case UdpEvent.INTERNAL_CONNECTION_OPTION: OnEventConnectionOption(ev); break; case UdpEvent.INTERNAL_SLEEP: OnEventSleep(ev); break; } } } void OnEventStart (UdpEvent ev) { UdpLog.Info("binding socket using platform '{0}'", platform.GetType()); if (ChangeState(UdpSocketState.Created, UdpSocketState.Running)) { if (platform.Bind(ev.EndPoint)) { // send started event Raise(UdpEvent.PUBLIC_STARTED, platform.EndPoint); // log that we started UdpLog.Info("socket bound to {0}", platform.EndPoint.ToString()); } else { // send started failed event Raise(UdpEvent.PUBLIC_START_FAILED); // log error UdpLog.Error("could not bind socket, platform code: {0}, platform error: {1}", platform.PlatformError.ToString(), platform.PlatformErrorString); } } } void OnEventConnect (UdpEvent ev) { if (CheckState(UdpSocketState.Running)) { UdpConnection cn = CreateConnection(ev.EndPoint, UdpConnectionMode.Client, ev.Object); if (cn == null) { UdpLog.Error("could not create connection for endpoint {0}", ev.EndPoint.ToString()); } else { UdpLog.Info("connecting to {0}", ev.EndPoint.ToString()); } } } void OnEventConnectCancel (UdpEvent ev) { if (CheckState(UdpSocketState.Running)) { UdpConnection cn; if (connLookup.TryGetValue(ev.EndPoint, out cn)) { // if we are connecting, destroy connection if (cn.CheckState(UdpConnectionState.Connecting)) { // notify user thread Raise(UdpEvent.PUBLIC_CONNECT_FAILED, ev.EndPoint); // destroy this connection cn.ChangeState(UdpConnectionState.Destroy); } // if we are connected, disconnect else if (ev.Connection.CheckState(UdpConnectionState.Connected)) { ev.Connection.SendCommand(UdpCommandType.Disconnected); ev.Connection.ChangeState(UdpConnectionState.Disconnected); } } } } void OnEventAccept (UdpEvent ev) { if (pendingConnections.Remove(ev.EndPoint)) { AcceptConnection(ev.EndPoint, ev.Object); } } void OnEventRefuse (UdpEvent ev) { if (pendingConnections.Remove(ev.EndPoint)) { SendRefusedCommand(ev.EndPoint); } } void OnEventDisconect (UdpEvent ev) { if (ev.Connection.CheckState(UdpConnectionState.Connected)) { ev.Connection.SendCommand(UdpCommandType.Disconnected); ev.Connection.ChangeState(UdpConnectionState.Disconnected); } } void OnEventClose (UdpEvent ev) { if (ChangeState(UdpSocketState.Running, UdpSocketState.Shutdown)) { for (int i = 0; i < connList.Count; ++i) { UdpConnection cn = connList[i]; cn.SendCommand(UdpCommandType.Disconnected); cn.ChangeState(UdpConnectionState.Disconnected); } if (platform.Close() == false) { UdpLog.Error("failed to shutdown socket interface, platform code: {0}", platform.PlatformError.ToString()); } connList.Clear(); connLookup.Clear(); eventQueueIn.Clear(); pendingConnections.Clear(); GetReadStream().Data = null; GetWriteStream(0, 0).Data = null; } } void OnEventSend (UdpEvent ev) { ev.Connection.SendObject(ev.Object); } void OnEventSleep (UdpEvent ev) { UdpLog.Debug("sleeping network thread for {0} ms", ev.OptionIntValue); Thread.Sleep(ev.OptionIntValue); } void OnEventConnectionOption (UdpEvent ev) { ev.Connection.OnEventConnectionOption(ev); } void AcceptConnection (UdpEndPoint ep, object replyObj) { UdpConnection cn = CreateConnection(ep, UdpConnectionMode.Server, replyObj); cn.ChangeState(UdpConnectionState.Connected); } void ProcessTimeouts () { if ((frame & 3) == 3) { uint now = GetCurrentTime(); for (int i = 0; i < connList.Count; ++i) { UdpConnection cn = connList[i]; switch (cn.state) { case UdpConnectionState.Connecting: cn.ProcessConnectingTimeouts(now); break; case UdpConnectionState.Connected: cn.ProcessConnectedTimeouts(now); break; case UdpConnectionState.Disconnected: cn.ChangeState(UdpConnectionState.Destroy); break; case UdpConnectionState.Destroy: if (DestroyConnection(cn)) { --i; } break; } } } } void RecvNetworkData () { if (platform.RecvPoll(1)) { int bytes = 0; UdpEndPoint ep = UdpEndPoint.Any; UdpStream stream = GetReadStream(); if (platform.RecvFrom(stream.Data, stream.Data.Length, ref bytes, ref ep)) { //UdpLog.Debug("received packet from {0}", ep.ToString()); #if DEBUG if (ShouldDropPacket) { return; } if (ShouldDelayPacket) { DelayPacket(ep, stream.Data, bytes); return; } #endif RecvNetworkPacket(ep, stream, bytes); } } } void RecvNetworkPacket (UdpEndPoint ep, UdpStream stream, int bytes) { // set stream length stream.Length = bytes << 3; // try to grab connection UdpConnection cn; if (connLookup.TryGetValue(ep, out cn)) { // deliver to connection cn.OnPacket(stream); } else { // handle unconnected data RecvUnconnectedPacket(stream, ep); } } void RecvUnconnectedPacket (UdpStream buffer, UdpEndPoint ep) { UdpAssert.Assert(buffer.Ptr == 0); buffer.Ptr = HeaderBitSize; if (buffer.ReadByte(8) == (byte) UdpCommandType.Connect) { if (Config.AllowIncommingConnections && ((connLookup.Count + pendingConnections.Count) < Config.ConnectionLimit || Config.ConnectionLimit == -1)) { if (Config.AutoAcceptIncommingConnections) { AcceptConnection(ep, null); } else { if (pendingConnections.Add(ep)) { object obj = null; if (buffer.ReadByte(8) == UdpEvent.INTERNAL_COMMAND_HASOBJECT) { //they've also sent an object along with their connection request serializer.Unpack(buffer, ref obj); } Raise(UdpEvent.PUBLIC_CONNECT_REQUEST, ep, obj); } } } else { SendRefusedCommand(ep); } } } #region Partial Methods partial void DelayPacket (UdpEndPoint ep, byte[] data, int length); partial void RecvDelayedPackets (); #endregion public static UdpSocket Create (UdpPlatform platform, UdpSerializerFactory serializer, UdpConfig config) { return new UdpSocket(platform, serializer, config); } public static UdpSocket Create (UdpPlatform platform, UdpSerializerFactory serializer) { return Create(platform, serializer, new UdpConfig()); } public static UdpSocket Create<TPlatform, TSerializer> (UdpConfig config) where TPlatform : UdpPlatform, new() where TSerializer : UdpSerializer, new() { return new UdpSocket(new TPlatform(), () => new TSerializer(), config); } public static UdpSocket Create<TPlatform, TSerializer> () where TPlatform : UdpPlatform, new() where TSerializer : UdpSerializer, new() { return Create<TPlatform, TSerializer>(new UdpConfig()); } public static UdpSocket Create (UdpPlatform platform, UdpConfig config) { return Create(platform, () => new UdpStreamSerializer(), config); } public static UdpSocket Create (UdpPlatform platform) { return Create(platform, new UdpConfig()); } public static UdpSocket Create<TPlatform> () where TPlatform : UdpPlatform, new() { return Create(new TPlatform(), new UdpConfig()); } public static UdpSocket Create<TPlatform> (UdpConfig config) where TPlatform : UdpPlatform, new() { return Create(new TPlatform(), config); } public static UdpSocketMultiplexer CreateMultiplexer (params UdpSocket[] sockets) { return new UdpSocketMultiplexer(sockets); } public static UdpSocketMultiplexer CreateMultiplexer<TPlatform, TSerializer> (UdpIPv4Address address, ushort portMin, ushort portMax) where TPlatform : UdpPlatform, new() where TSerializer : UdpSerializer, new() { return CreateMultiplexer<TPlatform, TSerializer>(address, portMin, portMax, new UdpConfig()); } public static UdpSocketMultiplexer CreateMultiplexer<TPlatform, TSerializer> (UdpIPv4Address address, ushort portMin, ushort portMax, UdpConfig config) where TPlatform : UdpPlatform, new() where TSerializer : UdpSerializer, new() { if (portMin > portMax) { throw new ArgumentOutOfRangeException("portMin was larger then portMax"); } List<UdpSocket> sockets = new List<UdpSocket>(); for (; portMin <= portMax; portMin += 1) { // create and start socket UdpSocket s = Create<TPlatform, TSerializer>(config); s.Start(new UdpEndPoint(address, portMin)); // add to list sockets.Add(s); } return CreateMultiplexer(sockets.ToArray()); } } }
jbruening/udpkit
src/managed/udpkit/udpSocket.cs
C#
mit
25,229
require_relative 'domain' class Word include Domain SEP = '||' attr_reader :identify, :pronounce, :trans, :extra_trans, :additional, :word_groups, :synonyms def initialize(identify, pronounce, trans, extra_trans, additional, word_groups, synonyms) @identify = identify # string @pronounce = pronounce # string @trans = trans # array @extra_trans = extra_trans # array @additional = additional # string @word_groups = word_groups # array @synonyms = synonyms # array # @TODO # @rel_word # 同根次 # @discriminate # 词语辨析 end class << self def table_name 'words' end def find_by_identify(identify) word = nil Domain.execute( "SELECT * FROM #{self.table_name} where identify = ?", [identify]) do |row| word = self.from_db_ins row end word end def from_db_ins(list) identify = list[0] pronounce = list[1] trans = field_split_from list[2] extra_trans = field_split_from list[3] additional = list[4] word_groups = field_split_from list[5] synonyms = field_split_from list[6] Word.new identify, pronounce, trans, extra_trans, additional, word_groups, synonyms end def field_split_from(ele) return nil unless ele ele.split SEP end end def save Domain.execute("INSERT INTO #{self.class.table_name} VALUES (?, ?, ?, ?, ?, ?, ?)", [@identify, @pronounce, @trans.join(SEP), @extra_trans.join(SEP), @additional, @word_groups.join(SEP), @synonyms.join(SEP)]) end def to_s "identify=#{identify}" end end
zeroleaf/secv
lib/secv/domain/word.rb
Ruby
mit
1,818
--- layout: page title: Dillon Limited Seminar date: 2016-05-24 author: Timothy Brock tags: weekly links, java status: published summary: Aenean varius sem quis turpis gravida. banner: images/banner/leisure-01.jpg booking: startDate: 07/29/2016 endDate: 08/03/2016 ctyhocn: HSVCLHX groupCode: DLS published: true --- In hac habitasse platea dictumst. Donec dapibus nulla ac placerat venenatis. Duis posuere interdum tortor, sed dignissim eros viverra vitae. Sed eget elit eu velit pulvinar tincidunt. Vivamus at lobortis justo. Curabitur in dui sollicitudin, faucibus diam vel, volutpat lacus. Donec sit amet ullamcorper massa. Nam dignissim, magna ultricies dignissim efficitur, odio ipsum cursus leo, non varius quam elit ut velit. Cras at gravida risus, eget vehicula tellus. Nullam arcu leo, ornare a lectus vel, sagittis dictum ex. Etiam a nibh diam. Quisque convallis, tortor quis rutrum molestie, dolor dolor elementum risus, sed lobortis nulla ligula sit amet eros. Curabitur rutrum erat et nulla posuere sodales. Nullam sodales quam at dui vulputate gravida. Aenean mollis dolor velit, in lacinia nulla interdum ut. * Donec interdum risus in placerat tristique * Curabitur semper ipsum non turpis ornare fermentum * Mauris eu risus ac magna dictum imperdiet * In posuere lorem et ante vestibulum, id maximus nunc tincidunt * Sed tristique risus pulvinar commodo suscipit. Nam blandit eget lectus fringilla venenatis. Curabitur at elementum ex. Vestibulum aliquam a massa eget venenatis. Ut congue cursus sem, ut scelerisque libero lacinia vitae. Ut tincidunt a orci ut pellentesque. Cras ac rutrum lacus. Aliquam erat volutpat. Phasellus interdum ultrices neque ac vulputate. Vivamus semper metus ut libero faucibus bibendum. Nullam bibendum orci nec metus commodo, a lacinia eros facilisis. Cras cursus sodales sapien in mollis. Suspendisse varius tortor suscipit purus eleifend eleifend. Donec in augue ut enim gravida finibus ut non tellus. Duis fringilla in tellus vel ornare. Cras viverra libero a arcu convallis, id euismod nisi sodales. Morbi dapibus libero ac nisl venenatis, vel vulputate justo interdum. Integer elementum scelerisque sagittis. Donec eu ex non elit volutpat blandit. Nulla odio erat, feugiat nec turpis id, hendrerit congue diam. Nunc vitae lorem scelerisque nunc semper porttitor at at ante. Aliquam dignissim laoreet malesuada. Cras interdum nibh eu arcu molestie blandit. Curabitur a cursus eros.
KlishGroup/prose-pogs
pogs/H/HSVCLHX/DLS/index.md
Markdown
mit
2,445
package main import ( "bytes" "fmt" "os" "os/exec" "path/filepath" ) const EnvGcliPath = "GCLI_PATH" // gcli is executable path var gcli string func init() { gcli = os.Getenv(EnvGcliPath) if gcli == "" { gcli = "../bin/gcli" } // Should be absolute path so that we can change dir var err error gcli, err = filepath.Abs(gcli) if err != nil { panic(err) } } // chdirSrcPath changes dirctory to $GOPATH/src/github.com/owner/ // It returns cleanup script to delete directory func chdirSrcPath(owner string) (func(), error) { gopath := os.Getenv("GOPATH") if gopath == "" { return nil, fmt.Errorf("can't found GOPATH env var") } srcPath := filepath.Join(gopath, "src", "github.com", owner) if _, err := os.Stat(srcPath); os.IsExist(err) { // TODO panic(err) } if err := os.MkdirAll(srcPath, 0777); err != nil { return nil, err } if err := os.Chdir(srcPath); err != nil { return nil, err } return func() { if err := os.RemoveAll(srcPath); err != nil { panic(err) } }, nil } // executeBin execute command and return output func executeBin(bin string, args []string) string { var stdout, stderr bytes.Buffer cmd := exec.Command("./"+bin, args...) cmd.Stderr = &stderr cmd.Stdout = &stdout // cmd.Wait() returns error _ = cmd.Run() return stdout.String() + stderr.String() } // runGcli runs gcli and return its stdout. If failed, returns error. func runGcli(args []string) (string, error) { var stdout, stderr bytes.Buffer cmd := exec.Command(gcli, args...) cmd.Stderr = &stderr cmd.Stdout = &stdout if err := cmd.Start(); err != nil { return "", fmt.Errorf("failed to start: %s\n\n %s", err, stderr.String()) } if err := cmd.Wait(); err != nil { return "", fmt.Errorf("failed to execute: %s\n\n %s", err, stderr.String()) } return stdout.String(), nil } func goTests(output string) error { // Change directory to artifact directory root if err := os.Chdir(output); err != nil { return err } defer func() { // Back to src directory if err := os.Chdir(".."); err != nil { // Should not reach here panic(err) } }() funcs := []func(output string) error{ goGet, goBuild, goTest, goVet, } for _, gf := range funcs { err := gf(output) if err != nil { return err } } return nil } // goGet runs go get on current directory. If failed, returns error. func goGet(output string) error { var stdout, stderr bytes.Buffer cmd := exec.Command("go", "get", "-v", "-d", "-t", "./...") cmd.Stderr = &stderr cmd.Stdout = &stdout if err := cmd.Start(); err != nil { return fmt.Errorf("failed to start `go get`: %s\n\n %s", err, stderr.String()) } if err := cmd.Wait(); err != nil { return fmt.Errorf("failed to execute `go get`: %s\n\n %s", err, stderr.String()) } return nil } // goBuild runs go build on current directory. If failed, returns error. func goBuild(output string) error { var stdout, stderr bytes.Buffer cmd := exec.Command("go", "build", "-o", output) cmd.Stderr = &stderr cmd.Stdout = &stdout if err := cmd.Start(); err != nil { return fmt.Errorf("failed to start `go build`: %s\n\n %s", err, stderr.String()) } if err := cmd.Wait(); err != nil { return fmt.Errorf("failed to execute `go build`: %s\n\n %s", err, stderr.String()) } return nil } // goTest runs go test on current directory. If failed, returns error. func goTest(output string) error { var stdout, stderr bytes.Buffer cmd := exec.Command("go", "test", "./...") cmd.Stderr = &stderr cmd.Stdout = &stdout if err := cmd.Start(); err != nil { return fmt.Errorf("failed to start `go test`: %s\n\n %s", err, stderr.String()) } if err := cmd.Wait(); err != nil { return fmt.Errorf("failed to execute `go test`: %s\n\n %s", err, stderr.String()) } return nil } // goVet runs go vet on current directory. If failed, returns error. func goVet(output string) error { var stdout, stderr bytes.Buffer cmd := exec.Command("go", "vet", "./...") cmd.Stderr = &stderr cmd.Stdout = &stdout if err := cmd.Start(); err != nil { return fmt.Errorf("failed to start `go vet`: %s\n\n %s", err, stderr.String()) } if err := cmd.Wait(); err != nil { return fmt.Errorf("failed to execute `go vet`: %s\n\n %s", err, stderr.String()) } return nil }
goonzoid/gcli
tests/helper_test.go
GO
mit
4,270
const redis = require('redis'); const Messenger = require("./Messenger"); module.exports = { /** * Creates and returns a messenger instance * @param {number} port - defaults to 6379 * @param {string} host - defaults to "127.0.0.1" * @param {import("redis").ClientOpts} [options] */ create: function(port, host, options){ const listener = redis.createClient(port||6379, host||'127.0.0.1', options); const sender = redis.createClient(port||6379, host||'127.0.0.1', options); const messenger = new Messenger(sender, listener); listener.on('message', function(channel, message){ var msg; try { msg = JSON.parse(message); } catch(e){ console.error(e); return console.error("Message Contents:", message); } messenger.emit(msg.eventName, msg.content, msg.from, channel); }); return messenger; } };
bberry6/redis-messenger
index.js
JavaScript
mit
947
/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'iframe', 'cy', { border: 'Dangos ymyl y ffrâm', noUrl: 'Rhowch URL yr iframe', scrolling: 'Galluogi bariau sgrolio', title: 'Priodweddau IFrame', toolbar: 'IFrame' } );
otto-torino/gino
ckeditor/plugins/iframe/lang/cy.js
JavaScript
mit
379
#!/bin/sh # # Name: backup-zip.sh # Description: Take given folder ($1) and create an encrypted tar archive # # Author: [email protected] # Version: 0.11 ## Debuging #set -x ## Put the passphrase for the symmetric gpg encryption into this file ## File is expected to be located in same directory as backup-[un]zip.sh script ## File needs to be owned by same user and needs permissions "600" ## Passphrase goes into first line (no other content) PASSPHRASE_FILENAME="backup-passphrase.txt" ## setup basics TAR="/bin/tar" GPG="/usr/bin/gpg" SED="/bin/sed" startTimer() { START_TIME=$(date) S_TIME=$(date +%s) } endTimer() { END_TIME=$(date) E_TIME=$(date +%s) DURATION=$(echo $((E_TIME - S_TIME))) #calculate overall completion time if [ ${DURATION} -le 60 ] ; then echo "Ended: "${END_TIME}" - Duration: ${DURATION} Seconds" else echo "Ended: "${END_TIME}" - Duration: $(awk 'BEGIN{ printf "%.2f\n", '${DURATION}'/60}') Minutes" fi } startTimer ## setup full path for passphrase file and check it SCRIPTPATH=$(dirname $0) PASSPHRASE_FILE_FULL_PATH=${SCRIPTPATH}/${PASSPHRASE_FILENAME} ## check that file exists if [ ! -f ${PASSPHRASE_FILE_FULL_PATH} ]; then printf "\033[1;31mPassphrase file \"${PASSPHRASE_FILE_FULL_PATH}\" does not exist! Exiting.\033[0m\n" exit 1; else ## check ownership if [ ! -O ${PASSPHRASE_FILE_FULL_PATH} ]; then printf "\033[1;31mPassphrase file is not owned by this user. Exiting.\033[0m\n" exit 1; else ## check strict permissions (600) if [ $(stat -c %a ${PASSPHRASE_FILE_FULL_PATH}) != 600 ]; then printf "\033[1;31mPassphrase file has wrong file permissions. Please set to 600. Exiting.\033[0m\n" exit 1; else ## check that file has exactly one line if [ $(cat ${PASSPHRASE_FILE_FULL_PATH} | wc -l) != 1 ]; then printf "\033[1;31mPassphrase file does not contain exactly one single line. Exiting.\033[0m\n" fi # // lines fi # // permissions fi # // ownership fi # // exists printf "\033[1;32mPassphrase file looks ok: ${PASSPHRASE_FILE_FULL_PATH}\033[0m\n" # remove exactly one trailing / (if there is one) VM_DIR=${1%/} printf "Packing up: %s to %s.gpg\n" "${VM_DIR}" "${VM_DIR}" ${TAR} c -v -S -C "${VM_DIR}" . | ${GPG} -c --passphrase-file "${PASSPHRASE_FILE_FULL_PATH}" --cipher-algo aes256 --compress-algo zlib --no-use-agent --batch --no-tty --yes -o "${VM_DIR}".gpg if [ $? = 0 ]; then # Return 0 -> so everything was ok printf "\033[1;32mSuccess\033[0m\n" else printf "\033[1;31mFailed\033[0m\n" fi printf "Resulting File: \033[1;33m$(ls -sh "${VM_DIR}".gpg)\033[0m\n" endTimer #EOF
frennkie/backup_scripts
backup-zip.sh
Shell
mit
2,724
-- select9.test -- -- execsql { -- CREATE TABLE t1(a, b, c); -- CREATE TABLE t2(d, e, f); -- BEGIN; -- INSERT INTO t1 VALUES(1, 'one', 'I'); -- INSERT INTO t1 VALUES(3, NULL, NULL); -- INSERT INTO t1 VALUES(5, 'five', 'V'); -- INSERT INTO t1 VALUES(7, 'seven', 'VII'); -- INSERT INTO t1 VALUES(9, NULL, NULL); -- INSERT INTO t1 VALUES(2, 'two', 'II'); -- INSERT INTO t1 VALUES(4, 'four', 'IV'); -- INSERT INTO t1 VALUES(6, NULL, NULL); -- INSERT INTO t1 VALUES(8, 'eight', 'VIII'); -- INSERT INTO t1 VALUES(10, 'ten', 'X'); -- -- INSERT INTO t2 VALUES(1, 'two', 'IV'); -- INSERT INTO t2 VALUES(2, 'four', 'VIII'); -- INSERT INTO t2 VALUES(3, NULL, NULL); -- INSERT INTO t2 VALUES(4, 'eight', 'XVI'); -- INSERT INTO t2 VALUES(5, 'ten', 'XX'); -- INSERT INTO t2 VALUES(6, NULL, NULL); -- INSERT INTO t2 VALUES(7, 'fourteen', 'XXVIII'); -- INSERT INTO t2 VALUES(8, 'sixteen', 'XXXII'); -- INSERT INTO t2 VALUES(9, NULL, NULL); -- INSERT INTO t2 VALUES(10, 'twenty', 'XL'); -- -- COMMIT; -- } CREATE TABLE t1(a, b, c); CREATE TABLE t2(d, e, f); BEGIN; INSERT INTO t1 VALUES(1, 'one', 'I'); INSERT INTO t1 VALUES(3, NULL, NULL); INSERT INTO t1 VALUES(5, 'five', 'V'); INSERT INTO t1 VALUES(7, 'seven', 'VII'); INSERT INTO t1 VALUES(9, NULL, NULL); INSERT INTO t1 VALUES(2, 'two', 'II'); INSERT INTO t1 VALUES(4, 'four', 'IV'); INSERT INTO t1 VALUES(6, NULL, NULL); INSERT INTO t1 VALUES(8, 'eight', 'VIII'); INSERT INTO t1 VALUES(10, 'ten', 'X'); INSERT INTO t2 VALUES(1, 'two', 'IV'); INSERT INTO t2 VALUES(2, 'four', 'VIII'); INSERT INTO t2 VALUES(3, NULL, NULL); INSERT INTO t2 VALUES(4, 'eight', 'XVI'); INSERT INTO t2 VALUES(5, 'ten', 'XX'); INSERT INTO t2 VALUES(6, NULL, NULL); INSERT INTO t2 VALUES(7, 'fourteen', 'XXVIII'); INSERT INTO t2 VALUES(8, 'sixteen', 'XXXII'); INSERT INTO t2 VALUES(9, NULL, NULL); INSERT INTO t2 VALUES(10, 'twenty', 'XL'); COMMIT;
bkiers/sqlite-parser
src/test/resources/select9.test_1.sql
SQL
mit
2,147
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="http://code.highcharts.com/highcharts.js"></script> <script src="http://code.highcharts.com/modules/exporting.js"></script> <style> body { background-color: white; font-family: Helvetica, Verdana, sans-serif; font-size: 10pt; } @media print { .no-print { display: none; } } #plot-wrapper { display: inline-block; } #placeholder { margin-top: 0.25em; } #info-text { text-align: center; position: absolute; z-index: 100; left: 170px; color: #bbb; } </style> <script> $(function () { var chart; $(document).ready(function() { chart = new Highcharts.Chart({ credits: { enabled: false }, chart: { backgroundColor: '#fff', renderTo: 'placeholder', type: 'line', zoomType: 'xy', height: 500, width: 600, spacingTop: 37 }, plotOptions: { line: { dashStyle: 'Solid', marker: { enabled: false } } }, title: { text: null }, xAxis: { gridLineWidth: 1, gridLineDashStyle: 'ShortDot', tickPosition: 'inside', maxPadding: 0, lineWidth: 0 }, yAxis: { gridLineWidth: 1, gridLineDashStyle: 'ShortDot', tickPosition: 'inside', title: { text: null } }, tooltip: { borderWidth: 1, formatter: function() { return 'At time ' + this.x + '<br><b>' + this.series.name + '<\/b> = ' + this.y; } }, legend: { borderWidth: 0, margin: 10, itemWidth: 140, itemMarginBottom: 10, symbolWidth: 45, symbolPadding: 5, x: 20 }, exporting: { buttons: { exportButton: { y: 5 }, printButton: { y: 5 } } }, series: [ { name: "S1", color: "#4572A7", dashStyle: "Solid", shadow: false, data: [ [0, 1.], [0.05, 0.9412052883849633], [0.1, 0.8890941842702648], [0.15, 0.8427255019058447], [0.2, 0.8013223155413801], [0.25, 0.7642376047393315], [0.3, 0.7415191015233668], [0.35, 0.727926378374008], [0.4, 0.715373585309425], [0.45, 0.703770228633589], [0.5, 0.6930351492003807], [0.55, 0.6830953644806931], [0.6, 0.6738850852090514], [0.65, 0.6653448669838381], [0.7, 0.6574208831097935], [0.75, 0.6500642938523428], [0.8, 0.643230697645876], [0.85, 0.6368796543166352], [0.9, 0.6309742773675189], [0.95, 0.6254808544357062], [1., 0.6203685449709279], [1.05, 0.6156090772355826], [1.1, 0.6111765195512354], [1.15, 0.607047041817334], [1.2, 0.6031987249231253], [1.25, 0.311839937747765], [1.3, 0.3182214236385607], [1.35, 0.3242332069395068], [1.4, 0.3298941514210924], [1.45, 0.3352224677101182], [1.5, 0.3402356956346629], [1.55, 0.3449506935390249], [1.6, 0.3493836338237952], [1.65, 0.3535500038932164], [1.7, 0.357464609005057], [1.75, 0.3611415832782656], [1.8, 0.3645943972238193], [1.85, 0.3678358772831726], [1.9, 0.3708782184709468], [1.95, 0.373733003022367], [2., 0.3764112195158091], [2.05, 0.3789232835254054], [2.1, 0.3812790586283385], [2.15, 0.3834878833578285], [2.2, 0.3855585646687023], [2.25, 0.3874994580290803], [2.3, 0.3893184274528631], [2.35, 0.3910228978142065], [2.4, 0.3926198718327874], [2.45, 0.3941159515451882], [2.5, 0.3955173537543773]] }, { name: "S2", color: "#AA4643", dashStyle: "Solid", shadow: false, data: [ [0, 2.], [0.05, 1.941205288384962], [0.1, 1.889094184270263], [0.15, 1.842725501905843], [0.2, 1.801322315541378], [0.25, 1.76423760473933], [0.3, 1.074423603113031], [0.35, 1.060830879963672], [0.4, 1.048278086899089], [0.45, 1.036674730223253], [0.5, 1.025939650790044], [0.55, 1.015999866070357], [0.6, 1.006789586798715], [0.65, 0.9982493685735017], [0.7, 0.9903253846994571], [0.75, 0.9829687954420065], [0.8, 0.9761351992355397], [0.85, 0.9697841559062989], [0.9, 0.9638787789571826], [0.95, 0.9583853560253698], [1., 0.9532730465605916], [1.05, 0.9485135788252463], [1.1, 0.944081021140899], [1.15, 0.9399515434069977], [1.2, 0.9361032265127889], [1.25, 0.9336415904126419], [1.3, 0.9400230763034376], [1.35, 0.9460348596043837], [1.4, 0.9516958040859693], [1.45, 0.957024120374995], [1.5, 0.9620373482995396], [1.55, 0.9667523462039017], [1.6, 0.9711852864886718], [1.65, 0.975351656558093], [1.7, 0.9792662616699335], [1.75, 0.9829432359431421], [1.8, 0.9863960498886958], [1.85, 0.9896375299480492], [1.9, 0.9926798711358234], [1.95, 0.9955346556872436], [2., 0.9982128721806858], [2.05, 1.000724936190282], [2.1, 1.003080711293215], [2.15, 1.005289536022705], [2.2, 1.007360217333578], [2.25, 1.009301110693956], [2.3, 1.011120080117739], [2.35, 1.012824550479082], [2.4, 1.014421524497663], [2.45, 1.015917604210064], [2.5, 1.017319006419253]] }, { name: "S3", color: "#89A54E", dashStyle: "Solid", shadow: false, data: [ [0, 1.], [0.05, 1.058794711615038], [0.1, 1.110905815729736], [0.15, 1.157274498094156], [0.2, 1.198677684458621], [0.25, 1.23576239526067], [0.3, 1.258480898476634], [0.35, 1.272073621625993], [0.4, 1.284626414690576], [0.45, 1.296229771366412], [0.5, 1.306964850799621], [0.55, 1.316904635519309], [0.6, 1.326114914790951], [0.65, 1.334655133016164], [0.7, 1.342579116890209], [0.75, 1.349935706147659], [0.8, 1.356769302354126], [0.85, 1.363120345683367], [0.9, 1.369025722632483], [0.95, 1.374519145564296], [1., 1.379631455029074], [1.05, 1.384390922764419], [1.1, 1.388823480448767], [1.15, 1.392952958182669], [1.2, 1.396801275076877], [1.25, 1.399262911177024], [1.3, 1.392881425286228], [1.35, 1.386869641985282], [1.4, 1.381208697503696], [1.45, 1.37588038121467], [1.5, 1.370867153290126], [1.55, 1.366152155385764], [1.6, 1.361719215100993], [1.65, 1.357552845031572], [1.7, 1.353638239919732], [1.75, 1.349961265646523], [1.8, 1.346508451700969], [1.85, 1.343266971641616], [1.9, 1.340224630453842], [1.95, 1.337369845902421], [2., 1.334691629408979], [2.05, 1.332179565399383], [2.1, 1.32982379029645], [2.15, 1.32761496556696], [2.2, 1.325544284256087], [2.25, 1.323603390895709], [2.3, 1.321784421471926], [2.35, 1.320079951110583], [2.4, 1.318482977092002], [2.45, 1.316986897379601], [2.5, 1.315585495170412]] } ] }); }); }); </script> <div id="plot-wrapper"> <div id="info-text" class="no-print"> Drag the mouse to zoom in on a rectangular region.<br> Click on variable names in the legend to toggle their visibility. </div> <div id="placeholder"></div> <div id="legend"></div> </div>
stanleygu/sbmltest2archive
sbml-test-cases/cases/semantic/00884/00884-plot.html
HTML
mit
7,033
# Sequel Sequel is a lightweight PDO wrapper that simplifies the PDO interface and enables foreach iteration. ```php foreach($Sql->query("SELECT * FROM A") as $row) { ... } ``` ### Instantiate a Sequel object. ```php $Sql = new Sequel(new PDO("your connection settings...")); ``` ## Sequel Methods ### query ```php $Sql->query(statement, values); ``` The query method takes a sql statement and array of corresponding values, and returns a response according to the statement type (select, update, insert, delete). - **SELECT** returns a Sequel_Results object. ```php //returns Sequel_Results object of rows with an id of 5 $Results = $Sql->query("SELECT * FROM table WHERE id = ?", array(5)); ``` - **UPDATE, DELETE** returns true if the operation was successful, else returns false. - **INSERT** returns insert id. ### one Returns the first row of a results set from a select statement. (associative array) ```php //equivalent of $Sql->query("SELECT ...", values)->next(); $row = $Sql->one("SELECT ...", values); ``` ### select ```php //equivalent of $Sql->query("SELECT * FROM table WHERE id = ?", array(5)) $Results = $Sql->select("table", array("id" => 5)); ``` ### selectOne Returns the first result of the select method. ```php //equivalent of $Sql->select("table", array("id" => 5))->next(); $row = $Sql->selectOne("table", array("id" => 5)); ``` ### insert ```php //equivalent of $Sql->query("INSERT INTO table (colA, colB) VALUES (?, ?)", array("foo", "bar")); $insertId = $Sql->insert("table", array("colA" => "foo", "colB" => "bar")); ``` ### update ```php //equivalent of $Sql->query("UPDATE table SET a = ? WHERE id = ?", array("baz", 5)); $isSuccess = $Sql->update("table", array("a" => "baz"), array("id" => 5)); ``` ### delete ```php //equivalent of $Sql->query("DELETE FROM table WHERE id = ?", array(5)); $isSuccess = $Sql->delete("table", array("id" => 5)); ``` ### beginTransaction calls PDO's beginTransaction ```php $Sql->beginTransaction(); ``` ### commit calls PDO's commit ```php $Sql->commit(); ``` ### rollBack calls PDO's rollBack ```php $Sql->rollBack(); ``` ## Sequel_Results Methods Sequel_Results objects are returned by Sequel's select methods. ```php $Results = $Sql->query("SELECT ...", array(...)); ``` ```php $Results = $Sql->select(...); ``` ### toArray returns all results as a PHP array ```php $arrayOfRows = $Results->toArray(); ``` ### count returns number of results ```php $numberOfRows = $Results->count(); ``` ### rewind rewind should not be used (will throw if not the first call to rewind and before any calls to the "next" method). It is only here to satisfy the Iterator interface (and thus allow Sequel_Results to be used in foreach loops). ### valid returns true as long as the current cursor position is pointing at a valid element. ### current returns the current element. ### key returns the cursor's index position. ### next Advances cursor position and returns the next row. Returns false when at the end of the list. ```php $row = $Results->next(); ```
DubFriend/Sequel
README.md
Markdown
mit
3,046
import { MLKitTranslationModelDownloadOptions, MLKitTranslationOptions } from "./"; declare const com: any; export function ensureTranslationModelDownloaded(options: MLKitTranslationModelDownloadOptions): Promise<void> { return new Promise<void>((resolve, reject) => { _downloadTranslationModelIfNeeded(options) .then(() => resolve()) .catch(reject); }); } export function translateText(options: MLKitTranslationOptions): Promise<string> { return new Promise<string>((resolve, reject) => { try { const onSuccessListener = new com.google.android.gms.tasks.OnSuccessListener({ onSuccess: (result: string) => resolve(result) }); const onFailureListener = new com.google.android.gms.tasks.OnFailureListener({ onFailure: exception => reject(exception.getMessage()) }); _downloadTranslationModelIfNeeded(options) .then(translator => { translator.translate(options.text) .addOnSuccessListener(onSuccessListener) .addOnFailureListener(onFailureListener); }) .catch(reject); } catch (ex) { console.log("Error in firebase.mlkit.translation.translateText: " + ex); reject(ex); } }); } function _downloadTranslationModelIfNeeded(options: MLKitTranslationModelDownloadOptions): Promise<com.google.firebase.ml.naturallanguage.translate.FirebaseTranslator> { return new Promise<com.google.firebase.ml.naturallanguage.translate.FirebaseTranslator>((resolve, reject) => { try { const source = +com.google.firebase.ml.naturallanguage.translate.FirebaseTranslateLanguage.languageForLanguageCode(options.from); const target = +com.google.firebase.ml.naturallanguage.translate.FirebaseTranslateLanguage.languageForLanguageCode(options.to); const firTranslatorOptions = new com.google.firebase.ml.naturallanguage.translate.FirebaseTranslatorOptions.Builder() .setSourceLanguage(source) .setTargetLanguage(target) .build(); const firTranslator = com.google.firebase.ml.naturallanguage.FirebaseNaturalLanguage.getInstance().getTranslator(firTranslatorOptions); const modelDownloadConditions = new com.google.firebase.ml.common.modeldownload.FirebaseModelDownloadConditions.Builder() .requireWifi() .build(); const onSuccessListener = new com.google.android.gms.tasks.OnSuccessListener({ onSuccess: () => resolve(firTranslator) }); const onFailureListener = new com.google.android.gms.tasks.OnFailureListener({ onFailure: exception => reject(exception.getMessage()) }); firTranslator.downloadModelIfNeeded(modelDownloadConditions) .addOnSuccessListener(onSuccessListener) .addOnFailureListener(onFailureListener); } catch (ex) { console.log("Error downloading translation model: " + ex); reject(ex); } }); }
EddyVerbruggen/nativescript-plugin-firebase
src/mlkit/translation/index.android.ts
TypeScript
mit
2,942
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'html/pipeline/hashtag'
mr-dxdy/html-pipeline-hashtag
spec/spec_helper.rb
Ruby
mit
91
using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Text.RegularExpressions; namespace GoldenEye.Extensions.Basic; public static class StringExtensions { private const int DefaultLimit = 50; public static string Limit(this string text) { return text.Limit(DefaultLimit); } public static string Limit(this string text, int limit) { if (text.Length <= limit) return text; return string.Format("{0}...", text.Substring(0, limit)); } public static string TrimStringToDemandedLength(this string message, int length) { return Limit(message, length); } public static bool IsNullOrEmpty(this string str) { return string.IsNullOrEmpty(str); } public static bool IsNullOrWhiteSpace(this string str) { return string.IsNullOrWhiteSpace(str); } public static List<string> SplitWithQuotes(this string str, char separator) { var foundParts = new List<string>(); var openedQuotes = false; var lastPart = 0; for (var i = 0; i < str.Length; ++i) if (str[i] == separator && !openedQuotes) { foundParts.Add(str.Substring(lastPart, i - lastPart).Replace("\"", string.Empty)); lastPart = i + 1; } else if (str[i] == '"') { openedQuotes = !openedQuotes; } foundParts.Add(str.Substring(lastPart).Replace("\"", string.Empty)); return foundParts; } public static string IfEmpty(this string str, string defaultString) { return str.IsNullOrWhiteSpace() ? defaultString : str; } public static string AttachIfTrue(this string str, bool doAttach) { return doAttach ? str : string.Empty; } /// <summary> /// Returns a substring, starting from specified text (included in resulting string); /// </summary> /// <param name="str"></param> /// <param name="needle">Text to be used as starting point.</param> public static string Substring(this string str, string needle) { return str.Substring(needle, StringComparison.CurrentCulture); } /// <summary> /// Returns a substring, starting from specified text (included in resulting string); /// </summary> /// <param name="str"></param> /// <param name="needle">Text to be used as starting point.</param> public static string Substring(this string str, string needle, StringComparison comparisonType) { var needlePosition = str.IndexOf(needle, comparisonType); if (needlePosition < 0) throw new ArgumentException(string.Format("Needle ({0}) not found in the source string ({1}).", needle, str)); return str.Substring(needlePosition); } public static Stream ToStream(this string str) { var stream = new MemoryStream(); var writer = new StreamWriter(stream); writer.Write(str); writer.Flush(); stream.Position = 0; return stream; } public static string ToUpperFirstLetter(this string source) { return source.ChangeFirstLetter(SizeChangeEnum.Upper); } public static string ToLowerFirstLetter(this string source) { return source.ChangeFirstLetter(SizeChangeEnum.Lower); } private static string ChangeFirstLetter(this string source, SizeChangeEnum sizeChangeEnum) { if (string.IsNullOrEmpty(source)) return string.Empty; // convert to char array of the string var letters = source.ToCharArray(); // upper case the first char switch (sizeChangeEnum) { case SizeChangeEnum.Upper: letters[0] = char.ToUpper(letters[0]); break; case SizeChangeEnum.Lower: letters[0] = char.ToLower(letters[0]); break; default: throw new ArgumentOutOfRangeException("sizeChangeEnum"); } // return the array made of the new char array return new string(letters); } public static string GetStringBetween(this string str, string start, string end) { var dataSourceTokenIndex = str.IndexOf(start, StringComparison.Ordinal) + start.Length + 1; var dataSourcePartLength = str.IndexOf(end, dataSourceTokenIndex, StringComparison.Ordinal) - dataSourceTokenIndex; return str.Substring(dataSourceTokenIndex, dataSourcePartLength); } public static string Random(int size) { var builder = new StringBuilder(); var random = new Random(); for (var i = 0; i < size; i++) { var ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))); builder.Append(ch); } return builder.ToString(); } public static string[] SplitCamelCase(this string source) { return Regex.Split(source, @"(?<!^)(?=[A-Z])"); } public static string ToReadableTypeName<T>() { return string.Join(" ", typeof(T).Name.SplitCamelCase()); } private enum SizeChangeEnum { Upper, Lower } }
oskardudycz/GoldenEye
src/Core/Core/Extensions/Basic/StringExtensions.cs
C#
mit
5,294
from __future__ import unicode_literals import unittest from six import text_type from fs.mode import check_readable, check_writable, Mode class TestMode(unittest.TestCase): def test_checks(self): self.assertTrue(check_readable("r")) self.assertTrue(check_readable("r+")) self.assertTrue(check_readable("rt")) self.assertTrue(check_readable("rb")) self.assertFalse(check_readable("w")) self.assertTrue(check_readable("w+")) self.assertFalse(check_readable("wt")) self.assertFalse(check_readable("wb")) self.assertFalse(check_readable("a")) self.assertTrue(check_writable("w")) self.assertTrue(check_writable("w+")) self.assertTrue(check_writable("r+")) self.assertFalse(check_writable("r")) self.assertTrue(check_writable("a")) def test_mode_object(self): with self.assertRaises(ValueError): Mode("") with self.assertRaises(ValueError): Mode("J") with self.assertRaises(ValueError): Mode("b") with self.assertRaises(ValueError): Mode("rtb") mode = Mode("w") repr(mode) self.assertEqual(text_type(mode), "w") self.assertTrue(mode.create) self.assertFalse(mode.reading) self.assertTrue(mode.writing) self.assertFalse(mode.appending) self.assertFalse(mode.updating) self.assertTrue(mode.truncate) self.assertFalse(mode.exclusive) self.assertFalse(mode.binary) self.assertTrue(mode.text)
PyFilesystem/pyfilesystem2
tests/test_mode.py
Python
mit
1,589
--- layout: post title: "Protection from Energy" date: 2015-01-02 sources: [PHB.270, SRD.173] tags: [artificer, cleric, druid, ranger, sorcerer, wizard, level3, action, concentration, abjuration] subtags: [paladin: ancients, paladin: vengeance] --- **3rd-level abjuration** **Casting Time**: 1 action **Range**: Touch **Components**: V, S **Duration**: Concentration, up to 1 minute For the duration, the willing creature you touch has resistance to one damage type of your choice: acid, cold, fire, lightning, or thunder.
thebombzen/grimoire
_posts/2015-01-02-protection-from-energy.markdown
Markdown
mit
532
'use strict'; module.exports = function() { const that = { extract: function(text) { if (!text) return null; const keywords = [ 'close', 'closes', 'closed', 'fix', 'fixes', 'fixed', 'resolve', 'resolves', 'resolved' ]; for (const keyword of keywords) { const regexTemplate = `${keyword} \#([0-9]+)`; const regex = new RegExp(regexTemplate, 'i'); const match = text.match(regex); if (match) { return match[1]; } } return null; } }; return that; };
AudienseCo/monorail
core/services/boundIssueExtractor.js
JavaScript
mit
625
ChainChat ========= Android app to send chained videos to friends, made at Hack the North in September at the University of Waterloo.
MarcusPSjolin/ChainChat
README.md
Markdown
mit
135
<mat-nav-list [disableRipple]="${13:false|true}"> <h3 mat-subheader>${1:Section 1}</h3> <mat-list-item *ngFor="let ${3:item} of ${2:items}"> <a mat-line href="${3:item}$5">${3:item}$4</a> $6 </mat-list-item> <mat-divider></mat-divider> <h3 mat-subheader>${7:Section 2}</h3> <mat-list-item *ngFor="let ${9:item} of ${8:items}"> <a mat-line href="${9:item}$11">${9:item}$10</a> $12 </mat-list-item>$END$ </mat-nav-list>
1tontech/material2-snippets
snippets/material/list/nav:**.html
HTML
mit
478
<?php namespace Mayoz\Tests\Categorizable; use Orchestra\Testbench\TestCase as BaseTestCase; use Mayoz\Categorizable\CategorizableServiceProvider; abstract class TestCase extends BaseTestCase { /** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->setUpDatabase($this->app); $this->setupConfig($this->app); } /** * {@inheritdoc} */ protected function getPackageProviders($app) { return [ CategorizableServiceProvider::class, TestServiceProvider::class, ]; } /** * {@inheritdoc} */ protected function getEnvironmentSetUp($app) { $app['config']->set('database.default', 'test'); $app['config']->set('database.connections.test', [ 'driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '', ]); } /** * Setup the application database. * * @param \Illuminate\Foundation\Application $app * @return void */ protected function setUpDatabase($app) { $this->artisan('migrate', ['--database' => 'test']); $this->withFactories(__DIR__.'/factories'); $this->beforeApplicationDestroyed(function () { $this->artisan('migrate:rollback'); }); } /** * Setup the application config. * * @param \Illuminate\Foundation\Application $app * @return void */ protected function setupConfig($app) { $app['config']->set('categorizable.category', Category::class); } }
mayoz/laravel-categorizable
tests/TestCase.php
PHP
mit
1,617
#!/usr/bin/python3 import numpy as np import cv2 from collections import deque import obstacle_detector.tm as tm from obstacle_detector.frame_queue import Frame_queue from obstacle_detector.slam import * from obstacle_detector.distance_calculator import spline_dist from obstacle_detector.perspective import find_center_point from obstacle_detector.perspective import inv_persp_new from obstacle_detector.perspective import regress_perspecive from obstacle_detector.utils.gabor_filter import gabor_filter transformed_img_width = 200 def video_test(input_video_path=None, output_video_path=None): cx = 595 cy = 303 roi_width = 25 roi_length = 90 cap = cv2.VideoCapture( input_video_path \ if input_video_path is not None \ else input('enter video path: ')) transformed_frames = Frame_queue() original_frames = deque() ret, frame = cap.read() for i in range(15): original_frames.append(frame) img, pts1 = inv_persp_new( frame, (cx, cy), (roi_width, roi_length), spline_dist, transformed_img_width) transformed_frames.append(img) ret, frame = cap.read() cy, cy = find_center_point(original_frames, (400, 100, 800, 719)) past_img = transformed_frames[-5].frame[300:,20:-20] coord_y = 1 while(ret): ret, frame = cap.read() img, pts1 = inv_persp_new( frame, (cx, cy), (roi_width, roi_length), spline_dist, transformed_img_width) #img_gray, old_img_gray, match, absdiff = tm.find_obstacles(transformed_frames, (0, 50, 200, 400), method='sparse') transformed_frames.popleft() transformed_frames.append(img) # transformed_frames.append(gabor_filter(img)) slam_height, slam_width = past_img.shape[:2] y_to = slam_height - coord_y -200 y_from = slam_height - coord_y - 300 print('position', y_from, y_to) # cv2.imshow('current', transformed_frames[-1].frame) cv2.imshow( 'frame position', transformed_frames[-1].frame[-300 : -200,:]) cv2.imshow( 'slam position', past_img[y_from : y_to,:]) cv2.imshow( 'diff', cv2.absdiff( transformed_frames[-1].frame[-300:-200, 20:-20], past_img[y_from : y_to,:])) past_img, shift_x, shift_y = stich_two_images( past_img, transformed_frames[-9].frame[300:,:], transformed_frames[-1].frame[300:,:]) coord_y -= shift_y print('y is', coord_y) cv2.imshow('slam', past_img) k = cv2.waitKey(1) & 0xff if k == 27: break cv2.imwrite('slam.jpg', past_img) cap.release() cv2.destroyAllWindows() video_test('../../video/1.mp4', '../results/back_sub_out.avi')
Sid1057/obstacle_detector
slam_test.py
Python
mit
2,885
'use strict'; /** * Construct a new Cleave instance by passing the configuration object * * @param {String / HTMLElement} element * @param {Object} opts */ var Cleave = function (element, opts) { var owner = this; if (typeof element === 'string') { owner.element = document.querySelector(element); } else { owner.element = ((typeof element.length !== 'undefined') && element.length > 0) ? element[0] : element; } if (!owner.element) { throw new Error('[cleave.js] Please check the element'); } opts.initValue = owner.element.value; owner.properties = Cleave.DefaultProperties.assign({}, opts); owner.init(); }; Cleave.prototype = { init: function () { var owner = this, pps = owner.properties; // no need to use this lib if (!pps.numeral && !pps.phone && !pps.creditCard && !pps.date && (pps.blocksLength === 0 && !pps.prefix)) { return; } pps.maxLength = Cleave.Util.getMaxLength(pps.blocks); owner.isAndroid = Cleave.Util.isAndroid(); owner.onChangeListener = owner.onChange.bind(owner); owner.onKeyDownListener = owner.onKeyDown.bind(owner); owner.onCutListener = owner.onCut.bind(owner); owner.onCopyListener = owner.onCopy.bind(owner); owner.element.addEventListener('input', owner.onChangeListener); owner.element.addEventListener('keydown', owner.onKeyDownListener); owner.element.addEventListener('cut', owner.onCutListener); owner.element.addEventListener('copy', owner.onCopyListener); owner.initPhoneFormatter(); owner.initDateFormatter(); owner.initNumeralFormatter(); owner.onInput(pps.initValue); }, initNumeralFormatter: function () { var owner = this, pps = owner.properties; if (!pps.numeral) { return; } pps.numeralFormatter = new Cleave.NumeralFormatter( pps.numeralDecimalMark, pps.numeralDecimalScale, pps.numeralThousandsGroupStyle, pps.numeralPositiveOnly, pps.delimiter ); }, initDateFormatter: function () { var owner = this, pps = owner.properties; if (!pps.date) { return; } pps.dateFormatter = new Cleave.DateFormatter(pps.datePattern); pps.blocks = pps.dateFormatter.getBlocks(); pps.blocksLength = pps.blocks.length; pps.maxLength = Cleave.Util.getMaxLength(pps.blocks); }, initPhoneFormatter: function () { var owner = this, pps = owner.properties; if (!pps.phone) { return; } // Cleave.AsYouTypeFormatter should be provided by // external google closure lib try { pps.phoneFormatter = new Cleave.PhoneFormatter( new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode), pps.delimiter ); } catch (ex) { throw new Error('[cleave.js] Please include phone-type-formatter.{country}.js lib'); } }, onKeyDown: function (event) { var owner = this, pps = owner.properties, charCode = event.which || event.keyCode; // hit backspace when last character is delimiter if (charCode === 8 && Cleave.Util.isDelimiter(owner.element.value.slice(-1), pps.delimiter, pps.delimiters)) { pps.backspace = true; return; } pps.backspace = false; }, onChange: function () { this.onInput(this.element.value); }, onCut: function (e) { this.copyClipboardData(e); this.onInput(''); }, onCopy: function (e) { this.copyClipboardData(e); }, copyClipboardData: function (e) { var owner = this, pps = owner.properties, Util = Cleave.Util, inputValue = owner.element.value, textToCopy = ''; if (!pps.copyDelimiter) { textToCopy = Util.stripDelimiters(inputValue, pps.delimiter, pps.delimiters); } else { textToCopy = inputValue; } try { if (e.clipboardData) { e.clipboardData.setData('Text', textToCopy); } else { window.clipboardData.setData('Text', textToCopy); } e.preventDefault(); } catch (ex) { // empty } }, onInput: function (value) { var owner = this, pps = owner.properties, prev = value, Util = Cleave.Util; // case 1: delete one more character "4" // 1234*| -> hit backspace -> 123| // case 2: last character is not delimiter which is: // 12|34* -> hit backspace -> 1|34* // note: no need to apply this for numeral mode if (!pps.numeral && pps.backspace && !Util.isDelimiter(value.slice(-1), pps.delimiter, pps.delimiters)) { value = Util.headStr(value, value.length - 1); } // phone formatter if (pps.phone) { pps.result = pps.phoneFormatter.format(value); owner.updateValueState(); return; } // numeral formatter if (pps.numeral) { pps.result = pps.prefix + pps.numeralFormatter.format(value); owner.updateValueState(); return; } // date if (pps.date) { value = pps.dateFormatter.getValidatedDate(value); } // strip delimiters value = Util.stripDelimiters(value, pps.delimiter, pps.delimiters); // strip prefix value = Util.getPrefixStrippedValue(value, pps.prefix, pps.prefixLength); // strip non-numeric characters value = pps.numericOnly ? Util.strip(value, /[^\d]/g) : value; // convert case value = pps.uppercase ? value.toUpperCase() : value; value = pps.lowercase ? value.toLowerCase() : value; // prefix if (pps.prefix) { value = pps.prefix + value; // no blocks specified, no need to do formatting if (pps.blocksLength === 0) { pps.result = value; owner.updateValueState(); return; } } // update credit card props if (pps.creditCard) { owner.updateCreditCardPropsByValue(value); } // strip over length characters value = Util.headStr(value, pps.maxLength); // apply blocks pps.result = Util.getFormattedValue(value, pps.blocks, pps.blocksLength, pps.delimiter, pps.delimiters); // nothing changed // prevent update value to avoid caret position change if (prev === pps.result && prev !== pps.prefix) { return; } owner.updateValueState(); }, updateCreditCardPropsByValue: function (value) { var owner = this, pps = owner.properties, Util = Cleave.Util, creditCardInfo; // At least one of the first 4 characters has changed if (Util.headStr(pps.result, 4) === Util.headStr(value, 4)) { return; } creditCardInfo = Cleave.CreditCardDetector.getInfo(value, pps.creditCardStrictMode); pps.blocks = creditCardInfo.blocks; pps.blocksLength = pps.blocks.length; pps.maxLength = Util.getMaxLength(pps.blocks); // credit card type changed if (pps.creditCardType !== creditCardInfo.type) { pps.creditCardType = creditCardInfo.type; pps.onCreditCardTypeChanged.call(owner, pps.creditCardType); } }, updateValueState: function () { var owner = this; // fix Android browser type="text" input field // cursor not jumping issue if (owner.isAndroid) { window.setTimeout(function () { owner.element.value = owner.properties.result; }, 1); return; } owner.element.value = owner.properties.result; }, setPhoneRegionCode: function (phoneRegionCode) { var owner = this, pps = owner.properties; pps.phoneRegionCode = phoneRegionCode; owner.initPhoneFormatter(); owner.onChange(); }, setRawValue: function (value) { var owner = this, pps = owner.properties; value = value !== undefined ? value.toString() : ''; if (pps.numeral) { value = value.replace('.', pps.numeralDecimalMark); } owner.element.value = value; owner.onInput(value); }, getRawValue: function () { var owner = this, pps = owner.properties, Util = Cleave.Util, rawValue = owner.element.value; if (pps.rawValueTrimPrefix) { rawValue = Util.getPrefixStrippedValue(rawValue, pps.prefix, pps.prefixLength); } if (pps.numeral) { rawValue = pps.numeralFormatter.getRawValue(rawValue); } else { rawValue = Util.stripDelimiters(rawValue, pps.delimiter, pps.delimiters); } return rawValue; }, getFormattedValue: function () { return this.element.value; }, destroy: function () { var owner = this; owner.element.removeEventListener('input', owner.onChangeListener); owner.element.removeEventListener('keydown', owner.onKeyDownListener); owner.element.removeEventListener('cut', owner.onCutListener); owner.element.removeEventListener('copy', owner.onCopyListener); }, toString: function () { return '[Cleave Object]'; } }; Cleave.NumeralFormatter = require('./shortcuts/NumeralFormatter'); Cleave.DateFormatter = require('./shortcuts/DateFormatter'); Cleave.PhoneFormatter = require('./shortcuts/PhoneFormatter'); Cleave.CreditCardDetector = require('./shortcuts/CreditCardDetector'); Cleave.Util = require('./utils/Util'); Cleave.DefaultProperties = require('./common/DefaultProperties'); // for angular directive ((typeof global === 'object' && global) ? global : window)['Cleave'] = Cleave; // CommonJS module.exports = Cleave;
glg-enterprises/Cms
template/admin/node_modules/cleave.js/src/Cleave.js
JavaScript
mit
10,275
@import url("https://fonts.googleapis.com/css?family=Amatic+SC|PT+Sans|Vollkorn"); /* line 4, ../scss/typography.scss */ h1, h2, h3, h4, h5, h6, html, footer { font-family: "Vollkorn", serif; color: #403d34; } /* line 8, ../scss/typography.scss */ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, html a, footer a { color: #403d34; } /* line 13, ../scss/typography.scss */ p { font-size: 1.2em; } /* line 18, ../scss/typography.scss */ h1#site-title { font-family: "Amatic SC", cursive; text-align: center; color: #211931; font-size: 6em; } /* line 25, ../scss/typography.scss */ a { color: #ccb285; } /* line 29, ../scss/typography.scss */ .blog-post { font-family: "Vollkorn", serif; color: #403d34; } /* line 31, ../scss/typography.scss */ .blog-post h2 { color: #211931; } /* line 38, ../scss/typography.scss */ .blog-post .post-date { font-family: "PT Sans", sans-serif; } /* line 42, ../scss/typography.scss */ .blog-post .post-content { font-family: "Vollkorn", serif; } /* line 47, ../scss/typography.scss */ span.serif-italic { font-family: "Vollkorn", serif; font-style: italic; font-size: 1em; } /* line 53, ../scss/typography.scss */ footer { font-family: "PT Sans", sans-serif; } /* line 55, ../scss/typography.scss */ footer h3 { color: #FFF; }
darkbreed/peak
static/css/typography.css
CSS
mit
1,290
module.exports = function (grunt) { require('load-grunt-tasks')(grunt); var config = { mkdir: { tmp: { options: { create: ['tmp'] } } }, gitclone: { hterm: { options: { cwd: './tmp', repository: 'https://chromium.googlesource.com/apps/libapps' } } }, shell: { build_hterm: { command: 'LIBDOT_SEARCH_PATH=$(pwd) ./libdot/bin/concat.sh -i ./hterm/concat/hterm_all.concat -o ../../public/webshell/hterm_all.js', options: { execOptions: { cwd: './tmp/libapps' } } } }, clean: ['./tmp'] }; grunt.initConfig(config); grunt.registerTask('update-hterm', ['mkdir:tmp', 'gitclone:hterm', 'shell:build_hterm', 'clean']); };
maestrano/webshell
Gruntfile.js
JavaScript
mit
1,001
// Objective-C API for talking to socketcluster-client/native Go package. // gobind -lang=objc -prefix=Go socketcluster-client/native // // File is generated by gobind. Do not edit. #ifndef __GoSocketClusterClient_H__ #define __GoSocketClusterClient_H__ #include <Foundation/Foundation.h> FOUNDATION_EXPORT void GoSocketClusterClientDisconnect(); FOUNDATION_EXPORT BOOL GoSocketClusterClientGetData(NSData** ret0_, NSError** error); FOUNDATION_EXPORT BOOL GoSocketClusterClientNewSocketClusterClient(NSString* host, NSString* profileName, NSString* authToken, NSString* userAgent, BOOL secure, NSString* dbPath, NSError** error); FOUNDATION_EXPORT BOOL GoSocketClusterClientSubscribe(NSData* data, NSString** ret0_, NSError** error); FOUNDATION_EXPORT BOOL GoSocketClusterClientUnsubscribe(NSString* id, NSError** error); #endif
hemantasapkota/socketcluster-client
example/ios/ios-sc-demo/SocketClusterClient.framework/Versions/A/Headers/SocketClusterClient.h
C
mit
839
import sys sys.path.insert(0, '../') import unittest import pygfa gfa_file = str.join("", [\ "S\ts1\t25\t*\n", \ "S\ts2\t21\t*\n", \ "S\ts3\t10\t*\n", \ "S\ts4\t12\t*\n", \ "S\ts5\t21\t*\n", \ "E\tl12\ts1+\ts2+\t20\t24$\t0\t4\t*\n", \ "E\tl23\ts2+\ts3+\t18\t20$\t0\t2\t*\n", \ "E\tlgeneric34\ts3+\ts4+\t5\t8\t0\t3\t*\n", \ "E\tl45\ts4+\ts5+\t9\t11$\t0\t2\t*\n", \ "F\tfragment5\ts5+\t10\t14\t100\t104\t*\n", \ "S\ts6\t12\t*\n", \ "S\ts7\t24\t*\n", \ "S\ts8\t9\t*\n", \ "E\tl67\ts6+\ts7+\t9\t11$\t0\t2\t*\n"]) # # --- = dovetail overlap # ~~~ = other overlap # # # [s1_s1] --- [s2_s2] --- [s3_s3] ~~ # ~~~ [s4_s4] --- [s5_s5] # # # [s6_s6] --- [s7_s7] [s8_s8_s8] # class TestLine (unittest.TestCase): graph = pygfa.gfa.GFA() graph.from_string(gfa_file) def test_nodes_connected_components(self): nodes = set(self.graph.nodes()) self.assertTrue({"s1", "fragment5", "s2", "s3", "s4", "s5"} in \ pygfa.nodes_connected_components(self.graph)) nodes.remove("s1") nodes.remove("s2") nodes.remove("s3") nodes.remove("s4") nodes.remove("s5") nodes.remove("fragment5") self.assertTrue({"s6", "s7"} in \ pygfa.nodes_connected_components(self.graph)) nodes.remove("s6") nodes.remove("s7") self.assertTrue({"s8"} in \ pygfa.nodes_connected_components(self.graph)) nodes.remove("s8") self.assertTrue(nodes == set()) def test_nodes_connected_component(self): self.assertTrue({"s1", "s2", "s3", "s4", "s5", "fragment5"} == pygfa.nodes_connected_component(self.graph, "s4")) with self.assertRaises(pygfa.gfa.GFAError): pygfa.nodes_connected_component(self.graph, "42") if __name__ == '__main__': unittest.main()
AlgoLab/pygfa
test/test_gfa_operations.py
Python
mit
2,206
class Util { static isEven(x) { return (x % 2) == 0; } static generateSequence(min, max, count) { var range = [], number = 0, matches = [], i = 0; while (i < count) { number = Math.floor(Math.random() * (max - min + 1)) + min; matches = range.filter(function (elem) { return elem == number; }); if (matches.length == 0) { range.push(number); i++; } } return range; } static generateGameSequence(min, max, count) { var sequence = Util.generateSequence(min, max, count); while (!Util.isValid(sequence)) { sequence = Util.generateSequence(min, max, count); } return sequence; } static isValid(sequence) { var inversionCounts = [], inversionSum = 0; sequence.map(function (a, x, arr) { var inversions = arr.filter(function (b, y) { return y > x && b < a; }); if (inversions.length) { inversionCounts.push(inversions.length); } else { inversionCounts.push(0); } }); inversionCounts.map(function (cnt) { inversionSum += cnt; }); return Util.isEven(inversionSum); } static mapLevelDimensions(level) { switch(level) { case 8: return { cols: 10, rows: 10 } case 7: return { cols: 9, rows: 9 } case 6: return { cols: 8, rows: 8 } case 5: return { cols: 7, rows: 7 } case 4: return { cols: 6, rows: 6 } case 3: return { cols: 5, rows: 5 } case 2: return { cols: 4, rows: 4 } default: return { cols: 3, rows: 3 } } } static overlay(updates, obj) { for(var prop in updates){ if (obj.hasOwnProperty(prop)) { obj[prop]=updates[prop]; } } return obj; } }
bradyhouse/house
fiddles/jquery/fiddle-0033-15Puzzle/src/Util.js
JavaScript
mit
2,664
package com.firefly.utils; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.UUID; public class GuidUtil { /** * The flag. */ private static final int PAD_BELOW = 0x10; /** * The flag. */ private static final int TWO_BYTES = 0xFF; public static String getGuid(String ip) throws NoSuchAlgorithmException { MessageDigest md5 = MessageDigest.getInstance("MD5"); SecureRandom rand = new SecureRandom(); long time = System.currentTimeMillis(); StringBuffer sbValueBeforeMD5 = new StringBuffer(128); sbValueBeforeMD5.append(ip); sbValueBeforeMD5.append(":"); sbValueBeforeMD5.append(Long.toString(time)); sbValueBeforeMD5.append(":"); sbValueBeforeMD5.append(Long.toString(rand.nextLong())); md5.update(sbValueBeforeMD5.toString().getBytes()); byte[] array = md5.digest(); StringBuffer sb = new StringBuffer(32); for (int j = 0; j < array.length; ++j) { int b = array[j] & TWO_BYTES; if (b < PAD_BELOW) { sb.append('0'); } sb.append(Integer.toHexString(b)); } String valueAfterMD5 = sb.toString() + UUID.randomUUID().toString(); return valueAfterMD5.toUpperCase(); } }
talentstrong/fireflyEnglish
common/src/main/java/com/firefly/utils/GuidUtil.java
Java
mit
1,442
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Mithril developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_BIGNUM_H #define BITCOIN_BIGNUM_H #include <stdexcept> #include <vector> #include <openssl/bn.h> #include "util.h" // for uint64 /** Errors thrown by the bignum class */ class bignum_error : public std::runtime_error { public: explicit bignum_error(const std::string& str) : std::runtime_error(str) {} }; /** RAII encapsulated BN_CTX (OpenSSL bignum context) */ class CAutoBN_CTX { protected: BN_CTX* pctx; BN_CTX* operator=(BN_CTX* pnew) { return pctx = pnew; } public: CAutoBN_CTX() { pctx = BN_CTX_new(); if (pctx == NULL) throw bignum_error("CAutoBN_CTX : BN_CTX_new() returned NULL"); } ~CAutoBN_CTX() { if (pctx != NULL) BN_CTX_free(pctx); } operator BN_CTX*() { return pctx; } BN_CTX& operator*() { return *pctx; } BN_CTX** operator&() { return &pctx; } bool operator!() { return (pctx == NULL); } }; /** C++ wrapper for BIGNUM (OpenSSL bignum) */ class CBigNum : public BIGNUM { public: CBigNum() { BN_init(this); } CBigNum(const CBigNum& b) { BN_init(this); if (!BN_copy(this, &b)) { BN_clear_free(this); throw bignum_error("CBigNum::CBigNum(const CBigNum&) : BN_copy failed"); } } CBigNum& operator=(const CBigNum& b) { if (!BN_copy(this, &b)) throw bignum_error("CBigNum::operator= : BN_copy failed"); return (*this); } ~CBigNum() { BN_clear_free(this); } //CBigNum(char n) is not portable. Use 'signed char' or 'unsigned char'. CBigNum(signed char n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); } CBigNum(int64 n) { BN_init(this); setint64(n); } CBigNum(unsigned char n) { BN_init(this); setulong(n); } CBigNum(unsigned short n) { BN_init(this); setulong(n); } CBigNum(unsigned int n) { BN_init(this); setulong(n); } CBigNum(unsigned long n) { BN_init(this); setulong(n); } CBigNum(uint64 n) { BN_init(this); setuint64(n); } explicit CBigNum(uint256 n) { BN_init(this); setuint256(n); } explicit CBigNum(const std::vector<unsigned char>& vch) { BN_init(this); setvch(vch); } void setulong(unsigned long n) { if (!BN_set_word(this, n)) throw bignum_error("CBigNum conversion from unsigned long : BN_set_word failed"); } unsigned long getulong() const { return BN_get_word(this); } unsigned int getuint() const { return BN_get_word(this); } int getint() const { unsigned long n = BN_get_word(this); if (!BN_is_negative(this)) return (n > (unsigned long)std::numeric_limits<int>::max() ? std::numeric_limits<int>::max() : n); else return (n > (unsigned long)std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n); } void setint64(int64 sn) { unsigned char pch[sizeof(sn) + 6]; unsigned char* p = pch + 4; bool fNegative; uint64 n; if (sn < (int64)0) { // Since the minimum signed integer cannot be represented as positive so long as its type is signed, // and it's not well-defined what happens if you make it unsigned before negating it, // we instead increment the negative integer by 1, convert it, then increment the (now positive) unsigned integer by 1 to compensate n = -(sn + 1); ++n; fNegative = true; } else { n = sn; fNegative = false; } bool fLeadingZeroes = true; for (int i = 0; i < 8; i++) { unsigned char c = (n >> 56) & 0xff; n <<= 8; if (fLeadingZeroes) { if (c == 0) continue; if (c & 0x80) *p++ = (fNegative ? 0x80 : 0); else if (fNegative) c |= 0x80; fLeadingZeroes = false; } *p++ = c; } unsigned int nSize = p - (pch + 4); pch[0] = (nSize >> 24) & 0xff; pch[1] = (nSize >> 16) & 0xff; pch[2] = (nSize >> 8) & 0xff; pch[3] = (nSize) & 0xff; BN_mpi2bn(pch, p - pch, this); } void setuint64(uint64 n) { unsigned char pch[sizeof(n) + 6]; unsigned char* p = pch + 4; bool fLeadingZeroes = true; for (int i = 0; i < 8; i++) { unsigned char c = (n >> 56) & 0xff; n <<= 8; if (fLeadingZeroes) { if (c == 0) continue; if (c & 0x80) *p++ = 0; fLeadingZeroes = false; } *p++ = c; } unsigned int nSize = p - (pch + 4); pch[0] = (nSize >> 24) & 0xff; pch[1] = (nSize >> 16) & 0xff; pch[2] = (nSize >> 8) & 0xff; pch[3] = (nSize) & 0xff; BN_mpi2bn(pch, p - pch, this); } void setuint256(uint256 n) { unsigned char pch[sizeof(n) + 6]; unsigned char* p = pch + 4; bool fLeadingZeroes = true; unsigned char* pbegin = (unsigned char*)&n; unsigned char* psrc = pbegin + sizeof(n); while (psrc != pbegin) { unsigned char c = *(--psrc); if (fLeadingZeroes) { if (c == 0) continue; if (c & 0x80) *p++ = 0; fLeadingZeroes = false; } *p++ = c; } unsigned int nSize = p - (pch + 4); pch[0] = (nSize >> 24) & 0xff; pch[1] = (nSize >> 16) & 0xff; pch[2] = (nSize >> 8) & 0xff; pch[3] = (nSize >> 0) & 0xff; BN_mpi2bn(pch, p - pch, this); } uint256 getuint256() const { unsigned int nSize = BN_bn2mpi(this, NULL); if (nSize < 4) return 0; std::vector<unsigned char> vch(nSize); BN_bn2mpi(this, &vch[0]); if (vch.size() > 4) vch[4] &= 0x7f; uint256 n = 0; for (unsigned int i = 0, j = vch.size()-1; i < sizeof(n) && j >= 4; i++, j--) ((unsigned char*)&n)[i] = vch[j]; return n; } void setvch(const std::vector<unsigned char>& vch) { std::vector<unsigned char> vch2(vch.size() + 4); unsigned int nSize = vch.size(); // BIGNUM's byte stream format expects 4 bytes of // big endian size data info at the front vch2[0] = (nSize >> 24) & 0xff; vch2[1] = (nSize >> 16) & 0xff; vch2[2] = (nSize >> 8) & 0xff; vch2[3] = (nSize >> 0) & 0xff; // swap data to big endian reverse_copy(vch.begin(), vch.end(), vch2.begin() + 4); BN_mpi2bn(&vch2[0], vch2.size(), this); } std::vector<unsigned char> getvch() const { unsigned int nSize = BN_bn2mpi(this, NULL); if (nSize <= 4) return std::vector<unsigned char>(); std::vector<unsigned char> vch(nSize); BN_bn2mpi(this, &vch[0]); vch.erase(vch.begin(), vch.begin() + 4); reverse(vch.begin(), vch.end()); return vch; } // The "compact" format is a representation of a whole // number N using an unsigned 32bit number similar to a // floating point format. // The most significant 8 bits are the unsigned exponent of base 256. // This exponent can be thought of as "number of bytes of N". // The lower 23 bits are the mantissa. // Bit number 24 (0x800000) represents the sign of N. // N = (-1^sign) * mantissa * 256^(exponent-3) // // Satoshi's original implementation used BN_bn2mpi() and BN_mpi2bn(). // MPI uses the most significant bit of the first byte as sign. // Thus 0x1234560000 is compact (0x05123456) // and 0xc0de000000 is compact (0x0600c0de) // (0x05c0de00) would be -0x40de000000 // // Mithril only uses this "compact" format for encoding difficulty // targets, which are unsigned 256bit quantities. Thus, all the // complexities of the sign bit and using base 256 are probably an // implementation accident. // // This implementation directly uses shifts instead of going // through an intermediate MPI representation. CBigNum& SetCompact(unsigned int nCompact) { unsigned int nSize = nCompact >> 24; bool fNegative =(nCompact & 0x00800000) != 0; unsigned int nWord = nCompact & 0x007fffff; if (nSize <= 3) { nWord >>= 8*(3-nSize); BN_set_word(this, nWord); } else { BN_set_word(this, nWord); BN_lshift(this, this, 8*(nSize-3)); } BN_set_negative(this, fNegative); return *this; } unsigned int GetCompact() const { unsigned int nSize = BN_num_bytes(this); unsigned int nCompact = 0; if (nSize <= 3) nCompact = BN_get_word(this) << 8*(3-nSize); else { CBigNum bn; BN_rshift(&bn, this, 8*(nSize-3)); nCompact = BN_get_word(&bn); } // The 0x00800000 bit denotes the sign. // Thus, if it is already set, divide the mantissa by 256 and increase the exponent. if (nCompact & 0x00800000) { nCompact >>= 8; nSize++; } nCompact |= nSize << 24; nCompact |= (BN_is_negative(this) ? 0x00800000 : 0); return nCompact; } void SetHex(const std::string& str) { // skip 0x const char* psz = str.c_str(); while (isspace(*psz)) psz++; bool fNegative = false; if (*psz == '-') { fNegative = true; psz++; } if (psz[0] == '0' && tolower(psz[1]) == 'x') psz += 2; while (isspace(*psz)) psz++; // hex string to bignum static const signed char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 }; *this = 0; while (isxdigit(*psz)) { *this <<= 4; int n = phexdigit[(unsigned char)*psz++]; *this += n; } if (fNegative) *this = 0 - *this; } std::string ToString(int nBase=10) const { CAutoBN_CTX pctx; CBigNum bnBase = nBase; CBigNum bn0 = 0; std::string str; CBigNum bn = *this; BN_set_negative(&bn, false); CBigNum dv; CBigNum rem; if (BN_cmp(&bn, &bn0) == 0) return "0"; while (BN_cmp(&bn, &bn0) > 0) { if (!BN_div(&dv, &rem, &bn, &bnBase, pctx)) throw bignum_error("CBigNum::ToString() : BN_div failed"); bn = dv; unsigned int c = rem.getulong(); str += "0123456789abcdef"[c]; } if (BN_is_negative(this)) str += "-"; reverse(str.begin(), str.end()); return str; } std::string GetHex() const { return ToString(16); } unsigned int GetSerializeSize(int nType=0, int nVersion=PROTOCOL_VERSION) const { return ::GetSerializeSize(getvch(), nType, nVersion); } template<typename Stream> void Serialize(Stream& s, int nType=0, int nVersion=PROTOCOL_VERSION) const { ::Serialize(s, getvch(), nType, nVersion); } template<typename Stream> void Unserialize(Stream& s, int nType=0, int nVersion=PROTOCOL_VERSION) { std::vector<unsigned char> vch; ::Unserialize(s, vch, nType, nVersion); setvch(vch); } bool operator!() const { return BN_is_zero(this); } CBigNum& operator+=(const CBigNum& b) { if (!BN_add(this, this, &b)) throw bignum_error("CBigNum::operator+= : BN_add failed"); return *this; } CBigNum& operator-=(const CBigNum& b) { *this = *this - b; return *this; } CBigNum& operator*=(const CBigNum& b) { CAutoBN_CTX pctx; if (!BN_mul(this, this, &b, pctx)) throw bignum_error("CBigNum::operator*= : BN_mul failed"); return *this; } CBigNum& operator/=(const CBigNum& b) { *this = *this / b; return *this; } CBigNum& operator%=(const CBigNum& b) { *this = *this % b; return *this; } CBigNum& operator<<=(unsigned int shift) { if (!BN_lshift(this, this, shift)) throw bignum_error("CBigNum:operator<<= : BN_lshift failed"); return *this; } CBigNum& operator>>=(unsigned int shift) { // Note: BN_rshift segfaults on 64-bit if 2^shift is greater than the number // if built on ubuntu 9.04 or 9.10, probably depends on version of OpenSSL CBigNum a = 1; a <<= shift; if (BN_cmp(&a, this) > 0) { *this = 0; return *this; } if (!BN_rshift(this, this, shift)) throw bignum_error("CBigNum:operator>>= : BN_rshift failed"); return *this; } CBigNum& operator++() { // prefix operator if (!BN_add(this, this, BN_value_one())) throw bignum_error("CBigNum::operator++ : BN_add failed"); return *this; } const CBigNum operator++(int) { // postfix operator const CBigNum ret = *this; ++(*this); return ret; } CBigNum& operator--() { // prefix operator CBigNum r; if (!BN_sub(&r, this, BN_value_one())) throw bignum_error("CBigNum::operator-- : BN_sub failed"); *this = r; return *this; } const CBigNum operator--(int) { // postfix operator const CBigNum ret = *this; --(*this); return ret; } friend inline const CBigNum operator-(const CBigNum& a, const CBigNum& b); friend inline const CBigNum operator/(const CBigNum& a, const CBigNum& b); friend inline const CBigNum operator%(const CBigNum& a, const CBigNum& b); }; inline const CBigNum operator+(const CBigNum& a, const CBigNum& b) { CBigNum r; if (!BN_add(&r, &a, &b)) throw bignum_error("CBigNum::operator+ : BN_add failed"); return r; } inline const CBigNum operator-(const CBigNum& a, const CBigNum& b) { CBigNum r; if (!BN_sub(&r, &a, &b)) throw bignum_error("CBigNum::operator- : BN_sub failed"); return r; } inline const CBigNum operator-(const CBigNum& a) { CBigNum r(a); BN_set_negative(&r, !BN_is_negative(&r)); return r; } inline const CBigNum operator*(const CBigNum& a, const CBigNum& b) { CAutoBN_CTX pctx; CBigNum r; if (!BN_mul(&r, &a, &b, pctx)) throw bignum_error("CBigNum::operator* : BN_mul failed"); return r; } inline const CBigNum operator/(const CBigNum& a, const CBigNum& b) { CAutoBN_CTX pctx; CBigNum r; if (!BN_div(&r, NULL, &a, &b, pctx)) throw bignum_error("CBigNum::operator/ : BN_div failed"); return r; } inline const CBigNum operator%(const CBigNum& a, const CBigNum& b) { CAutoBN_CTX pctx; CBigNum r; if (!BN_mod(&r, &a, &b, pctx)) throw bignum_error("CBigNum::operator% : BN_div failed"); return r; } inline const CBigNum operator<<(const CBigNum& a, unsigned int shift) { CBigNum r; if (!BN_lshift(&r, &a, shift)) throw bignum_error("CBigNum:operator<< : BN_lshift failed"); return r; } inline const CBigNum operator>>(const CBigNum& a, unsigned int shift) { CBigNum r = a; r >>= shift; return r; } inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); } inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); } inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); } inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); } inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) < 0); } inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) > 0); } #endif
mithrilda/mithril
src/bignum.h
C
mit
17,217
// see http://vuejs-templates.github.io/webpack for documentation. var path = require('path') module.exports = { build: { env: require('./prod.env'), index: path.resolve(__dirname, '../www/index.html'), // build script will delete all assets root files, be careful to set the folder path assetsRoot: path.resolve(__dirname, '../www'), assetsSubDirectory: 'static', assetsPublicPath: '', productionSourceMap: false, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. // Before setting to `true`, make sure to: // npm install --save-dev compression-webpack-plugin productionGzip: false, productionGzipExtensions: ['js', 'css'], // Run the build command with an extra argument to // View the bundle analyzer report after build finishes: // `npm run build --report` // Set to `true` or `false` to always turn it on or off bundleAnalyzerReport: process.env.npm_config_report }, dev: { env: require('./dev.env'), port: 3000, autoOpenBrowser: true, assetsSubDirectory: 'static', assetsPublicPath: '', proxyTable: {}, // CSS Sourcemaps off by default because relative paths are "buggy" // with this option, according to the CSS-Loader README // (https://github.com/webpack/css-loader#sourcemaps) // In our experience, they generally work as expected, // just be aware of this issue when enabling this option. cssSourceMap: false } }
BeedleCars/Mobile
config/index.js
JavaScript
mit
1,523
package imagicthecat.fundamentalchemistry.shared.tileentity; import java.util.Map; import imagicthecat.fundamentalchemistry.FundamentalChemistry; import imagicthecat.fundamentalchemistry.shared.ChemicalFilter; import imagicthecat.fundamentalchemistry.shared.ChemicalStorage; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; public class TilePeriodicStorage extends TileSimpleMachine { public TilePeriodicStorage() { this.storage.max_atoms = 1000; } @Override public void tick() { //powered mode (eject overflow in atmosphere, 10% margin) if(this.worldObj.isBlockIndirectlyGettingPowered(this.pos) != 0){ this.storage.max_atoms = 1100; //build overflow ChemicalStorage overflow = new ChemicalStorage(); for(Map.Entry<Integer, Integer> entry : this.storage.atoms.entrySet()){ int aoverflow = entry.getValue()-1000; if(aoverflow > 0) overflow.addAtom(entry.getKey(), aoverflow); } //remove overflow this.storage.take(overflow); } else //normal mode this.storage.max_atoms = 1000; TileLaserRelay relay = this.getAttachedRelay(); if(relay != null){ relay.fetch(this.storage, LaserRelayFetch.ATOMS, buildFilter()); this.markDirty(); } } //build storage filter (return null if not filtered) public ChemicalFilter buildFilter() { //get book content ItemStack stack = this.getStackInSlot(0); if(stack != null && stack.stackSize >= 0){ NBTTagCompound tag = stack.getTagCompound(); if(tag != null && tag.hasKey("pages")){ NBTTagList pages = tag.getTagList("pages", 8); ChemicalFilter filter = new ChemicalFilter(); // one atom per line for(int i = 0; i < pages.tagCount(); i++){ String content = pages.getStringTagAt(i); if(content != null){ for(String line : content.split("\n")){ if(line.length() > 0 && line.charAt(0) == '-'){ //check if blacklist policy filter.policy = false; line = line.substring(1); } Integer an = FundamentalChemistry.elements.get(line.replaceAll("[^a-zA-Z]", "")); if(an != null) filter.atoms.add(an); } } } return filter; } } return null; } @Override public String getName() { return "container.periodic_storage"; } }
ImagicTheCat/FundamentalChemistry
src/main/java/imagicthecat/fundamentalchemistry/shared/tileentity/TilePeriodicStorage.java
Java
mit
2,423
package gavilan.irc; public interface QuoteManager { void add(String quote); String get(int id); int size(); void remove(int id); }
gavilancomun/irc-explorer
src/main/java/gavilan/irc/QuoteManager.java
Java
mit
151
FactoryBot.define do factory :interaction do sequence(:lgil_code) { |n| n } sequence(:label) { |n| "Interaction Label #{n}" } slug { label.parameterize } end end
alphagov/local-links-manager
spec/factories/interactions.rb
Ruby
mit
178
using Content.Server.UserInterface; using Content.Shared.DragDrop; using Content.Shared.MedicalScanner; using Robust.Server.GameObjects; using Robust.Shared.Containers; namespace Content.Server.Medical.Components { [RegisterComponent] [ComponentReference(typeof(SharedMedicalScannerComponent))] public sealed class MedicalScannerComponent : SharedMedicalScannerComponent { public ContainerSlot BodyContainer = default!; public BoundUserInterface? UserInterface => Owner.GetUIOrNull(MedicalScannerUiKey.Key); // ECS this out!, when DragDropSystem and InteractionSystem refactored public override bool DragDropOn(DragDropEvent eventArgs) { return true; } } }
space-wizards/space-station-14
Content.Server/Medical/Components/MedicalScannerComponent.cs
C#
mit
739
var _ = require('underscore'); var path = require('path'); var fs = require('fs'); var parseLines = require('./lib/parselines') module.exports.getObject = getObject; module.exports.getTitles = getTitles; module.exports.getBook = getBook; module.exports.getText = getText; function getObject(fileNameArray, cb) { getFileContents(fileNameArray, function (content) { cb(parseContent(content)); }); } function getFileContents(fileNameArray, cb) { var counter = 0; var text = ''; fileNameArray.forEach(function (file) { fs.readFile(path.join(process.cwd(), file), 'utf8', function (err, data) { if (err) throw err; text = text + '\n' + data; counter++; if (counter === fileNameArray.length) { cb(text); } }); }); } function parseContent(data) { var records = splitIntoRecords(data); return makeArray(records); } function splitIntoRecords(data) { return data.split('\r\n=========='); } function makeArray(arr) { var col = []; for (var i = 0; i < arr.length; i++) { var record = arr[i]; // split record into lines (section of a record - title / time / text) var lines = splitRecord(record); // initialize empty record object var singleRecord = {}; // first line - title and author var first = parseLines.firstLine(lines); if (first) { singleRecord.title = first.title; singleRecord.author = first.author; } //second line - type, location, time var second = parseLines.secondLine(lines); if (second) { singleRecord.time = second.time; singleRecord.type = second.type; singleRecord.location = second.location; singleRecord.page = second.page; } // third line - content var third = parseLines.thirdLine(lines); if (third) { singleRecord.text = third; } // push record to collection col.push(singleRecord); } // end of record iteration return col; } function splitRecord(record) { var line = record.split('\r\n'); var lines = []; for (var j = 0; j < line.length; j++) { var l = line[j]; if (l !== '') { lines.push(l.trim()); } } return lines; } function getTitles(fileNameArray, cb) { var titles = []; getObject(fileNameArray, function (collection) { collection.forEach(function (el) { if (el.title) titles.push(el.title); }); var unique = titles.filter(function (itm, i, titles) { return i == titles.indexOf(itm); }); cb(unique, collection); }); } function getBook(collection, title, startFrom) { var lock = !!startFrom; var book = collection.filter(function (obj) { if (lock && (startFrom === obj.location)) lock = false; return !lock && (obj.title === title); }); return book; } function getText(book, showLocation) { var text = ''; var locationArray = []; const getSingleLocation = x => { if (!x.location) return x const index = x.location.indexOf('-') if (index > -1) { return Object.assign({}, x, { location: Number(x.location.substr(0, index)), }) } return Object.assign({}, x, { location: Number(x.location), }) } book = _.map(book, getSingleLocation) book = _.sortBy(book, 'location') for (let i = 0; i < book.length; i++) { var b = book[i]; if (b.location) { // Prevent from displaying doubled entries if (locationArray.indexOf(b.location) === -1) { var location = showLocation ? b.location : ''; text += '\n----------\t' + location + '\n\n' + b.text + '\n'; } locationArray.push(b.location); } // No location property - probably pdf with `page` property else { text += '\n----------\t' + b.page + '\n\n' + b.text + '\n'; } } return text; }
baniol/kindle-my-clippings
clippings.js
JavaScript
mit
3,782
<?php namespace SimpleBus\RabbitMQBundleBridge\EventListener; use Psr\Log\LoggerInterface; use SimpleBus\RabbitMQBundleBridge\Event\Events; use SimpleBus\RabbitMQBundleBridge\Event\MessageConsumptionFailed; use Symfony\Component\EventDispatcher\EventSubscriberInterface; class LogErrorWhenMessageConsumptionFailed implements EventSubscriberInterface { private LoggerInterface $logger; private string $logLevel; private string $logMessage; public function __construct(LoggerInterface $logger, string $logLevel, string $logMessage) { $this->logger = $logger; $this->logLevel = $logLevel; $this->logMessage = $logMessage; } /** * @return array<string, string> */ public static function getSubscribedEvents(): array { return [ Events::MESSAGE_CONSUMPTION_FAILED => 'messageConsumptionFailed', ]; } /** * Log the failed message and the related exception. */ public function messageConsumptionFailed(MessageConsumptionFailed $event): void { $this->logger->log( $this->logLevel, $this->logMessage, [ 'exception' => $event->exception(), 'message' => $event->message(), ] ); } }
SimpleBus/RabbitMQBundleBridge
src/EventListener/LogErrorWhenMessageConsumptionFailed.php
PHP
mit
1,302
import React from 'react'; /* eslint-disable import/no-extraneous-dependencies */ import { storiesOf } from '@storybook/react'; import { withKnobs, text, select } from '@storybook/addon-knobs'; import { withInfo } from '@storybook/addon-info'; /* eslint-enable import/no-extraneous-dependencies */ import { renderMJML } from '../utility'; import Footer from './footer'; const contactTypes = [ 'phone', 'email', 'website', 'fax' ]; storiesOf('Footer/No Children', module) .addDecorator(withKnobs) .add('with no nested components', withInfo({ text: ` # Footer #### No nested components A simple footer for usage on the bottom of the email, includes a company title and a copyright date set for the current date of the email generation. #### Usage ~~~js import React from 'react'; import { Footer, renderMJML } from 'hapi-maily-widgets'; ~~~ const component = <Footer title="Widget Factory" /> ~~~js renderMJML(component); //static HTML ~~~ `, propTables: [Footer] })(() => { const component = ( <Footer title={text('Company Name', 'Widget Factory')} /> ); return renderMJML(component); })) .add('with custom theme', withInfo({ text: ` # Footer #### With a custom theme A simple footer with a custom primary color that was defined in the theme. #### Usage ~~~js import React from 'react'; import { Footer, renderMJML } from 'hapi-maily-widgets'; ~~~ const component = <Footer title="Widget Factory" /> ~~~js const theme = { colors: { primary: '#2196F3' } }; renderMJML(component, theme); // static HTML ~~~ `, propTables: [Footer] })(() => { const theme = { colors: { primary: '#2196F3' } }; const component = ( <Footer title={text('Company Name', 'Widget Factory')} /> ); return renderMJML(component, theme); })) .add('with address information', withInfo({ text: ` # Footer #### With address information Footer that includes address information that has been defined in the theme. #### Usage ~~~js import React from 'react'; import { Footer, renderMJML } from 'hapi-maily-widgets'; ~~~ const component = <Footer title="Widget Factory" /> ~~~js const theme = { address: { name: 'Widget Factory', addressLine1: '1234 Example Drive', city: 'Greatest City', state: 'CA', zip: '12345', country: 'USA' } }; renderMJML(component, theme); // static HTML ~~~ `, propTables: [Footer] })(() => { const theme = { address: { name: 'Widget Factory', addressLine1: '1234 Example Drive', city: 'Greatest City', state: 'CA', zip: '12345', country: 'USA' } }; const component = ( <Footer title={text('Company Name', 'Widget Factory')} /> ); return renderMJML(component, theme); })) .add('with contact information', withInfo({ text: ` # Footer #### With contact information Includes a listing of contact information in the footer including an icon when the type is used. Available types include the following: * phone * fax * email * website Multiple contact listings can be used in the array. #### Usage ~~~js import React from 'react'; import { Footer, renderMJML } from 'hapi-maily-widgets'; ~~~ const component = <Footer title="Widget Factory" />; ~~~js const theme = { contact: [ { name: text('Contact Name', 'Phone'), href: text('Url Link', 'tel:123-555-1234'), value: text('Url Value', '123-555-1234'), type: select('Contact Types', contactTypes, 'phone') } ] }; renderMJML(component, theme); //static HTML ~~~ `, propTables: [Footer] })(() => { const theme = { contact: [ { name: text('Contact Name', 'Phone'), href: text('Url Link', 'tel:123-555-1234'), value: text('Url Value', '123-555-1234'), type: select('Contact Types', contactTypes, 'phone') } ] }; const component = ( <Footer title={text('Company Name', 'Widget Factory')} /> ); return renderMJML(component, theme); })) .add('with contact and address information', () => { const theme = { address: { name: text('Address Name', 'Widget Factory'), addressLine1: text('Address Line 1', '1234 Example Drive'), addressLine2: text('Address Line 2', ''), city: text('City', 'Greatest City'), state: text('State', 'CA'), zip: text('Zip', '12345'), country: text('Country', 'USA') }, contact: [ { name: text('Contact Name', 'Phone'), href: text('Url Link', 'tel:123-555-1234'), value: text('Url Value', '123-555-1234'), type: select('Contact Types', contactTypes, 'phone') } ] }; const component = ( <Footer title={text('Company Name', 'Widget Factory')} /> ); return renderMJML(component, theme); });
joshferrell/hapi-maily
widgets/src/footer/footer.stories.js
JavaScript
mit
6,432
<?php class News_model extends CI_Model { function get_all_news() { $query = $this->db->get('news'); $data = $query->result(); return $data; } public function getTotalNews($keyword = null) { if(!empty($keyword)) { return $this->db->select() ->like('title', $keyword) ->get('news')->num_rows(); } else { return $this->db->select()->get('news')->num_rows(); } } function getNews( $perpage, $offset, $keyword = null ){ // var_dump($keyword);die; $news = $this->db->select() ->like('title', $keyword) ->limit($perpage, $offset) ->order_by('title', 'ASC') ->get('news') ->result(); return $news; } function getPopularPost(){ $news = $this->db->select() ->order_by('hits', 'DESC') ->limit('4') ->get('news') ->result(); return $news; } function get_news_by_category($id) { $this->db->where('category_id',$id); $query = $this->db->get('news'); $data = $query->result(); return $data; } function insert_data($data){ $this->db->insert('news', $data); } public function update($id=0, $data) { $this->db->where('id',$id); return $this->db->update('news',$data); } public function increase_hit($id=0) { //lay thong tin của news $this->db->where('id', $id); $query = $this->db->get('news'); $data_news = $query->row(); $data = array( 'hits' => $data_news->hits + 1 ); $this->db->where('id',$id); return $this->db->update('news',$data); } function getNewsById($id) { $this->db->where('id', $id); $query = $this->db->get('news'); $data = $query->row(); return $data; } public function truncate($string,$length=100,$append="&hellip;") { $string = trim($string); if(strlen($string) > $length) { $string = wordwrap($string, $length); $string = explode("\n", $string, 2); $string = $string[0] . $append; } return $string; } } ?>
sonha/ci
application/models/News_model.php
PHP
mit
2,411
 using System; using System.Security.Cryptography; using System.Text; namespace Person_Project.Authorize_Service.Helper { internal class CryptoService { public static byte[] Crypto(string password) { try { if (!string.IsNullOrEmpty(password)) { using (SHA256 sha256 = new SHA256CryptoServiceProvider()) { return sha256.ComputeHash(Encoding.ASCII.GetBytes(password)); } } throw new ArgumentException(); } catch (EncoderFallbackException encoderException) { throw encoderException; } } } }
LiftenShy/PersonalProject
Person_Project.Authorize_Service/Person_Project.Authorize_Service/Helper/CryptoService.cs
C#
mit
765