text
stringlengths
3
1.05M
namespace Microsoft.Azure.Management.Network.Models { using System; using System.Linq; using System.Collections.Generic; using Newtonsoft.Json; using Microsoft.Rest; using Microsoft.Rest.Serialization; using Microsoft.Rest.Azure; /// <summary> /// Response for ListRoutesTable associated with the Express Route /// Circuits Api /// </summary> public partial class ExpressRouteCircuitsRoutesTableListResult { /// <summary> /// Initializes a new instance of the /// ExpressRouteCircuitsRoutesTableListResult class. /// </summary> public ExpressRouteCircuitsRoutesTableListResult() { } /// <summary> /// Initializes a new instance of the /// ExpressRouteCircuitsRoutesTableListResult class. /// </summary> public ExpressRouteCircuitsRoutesTableListResult(IList<ExpressRouteCircuitRoutesTable> value = default(IList<ExpressRouteCircuitRoutesTable>), string nextLink = default(string)) { Value = value; NextLink = nextLink; } /// <summary> /// Gets List of RoutesTable /// </summary> [JsonProperty(PropertyName = "value")] public IList<ExpressRouteCircuitRoutesTable> Value { get; set; } /// <summary> /// Gets the URL to get the next set of results. /// </summary> [JsonProperty(PropertyName = "nextLink")] public string NextLink { get; set; } } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="Xenon Boostrap Admin Panel" /> <meta name="author" content="" /> <title>Xenon - Range Selector</title> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Arimo:400,700,400italic"> <link rel="stylesheet" href="assets/css/fonts/linecons/css/linecons.css"> <link rel="stylesheet" href="assets/css/fonts/fontawesome/css/font-awesome.min.css"> <link rel="stylesheet" href="assets/css/bootstrap.css"> <link rel="stylesheet" href="assets/css/xenon-core.css"> <link rel="stylesheet" href="assets/css/xenon-forms.css"> <link rel="stylesheet" href="assets/css/xenon-components.css"> <link rel="stylesheet" href="assets/css/xenon-skins.css"> <link rel="stylesheet" href="assets/css/custom.css"> <script src="assets/js/jquery-1.11.1.min.js"></script> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body class="page-body"> <div class="settings-pane"> <a href="#" data-toggle="settings-pane" data-animate="true"> &times; </a> <div class="settings-pane-inner"> <div class="row"> <div class="col-md-4"> <div class="user-info"> <div class="user-image"> <a href="extra-profile.html"> <img src="assets/images/user-2.png" class="img-responsive img-circle" /> </a> </div> <div class="user-details"> <h3> <a href="extra-profile.html">John Smith</a> <!-- Available statuses: is-online, is-idle, is-busy and is-offline --> <span class="user-status is-online"></span> </h3> <p class="user-title">Web Developer</p> <div class="user-links"> <a href="extra-profile.html" class="btn btn-primary">Edit Profile</a> <a href="extra-profile.html" class="btn btn-success">Upgrade</a> </div> </div> </div> </div> <div class="col-md-8 link-blocks-env"> <div class="links-block left-sep"> <h4> <span>Notifications</span> </h4> <ul class="list-unstyled"> <li> <input type="checkbox" class="cbr cbr-primary" checked="checked" id="sp-chk1" /> <label for="sp-chk1">Messages</label> </li> <li> <input type="checkbox" class="cbr cbr-primary" checked="checked" id="sp-chk2" /> <label for="sp-chk2">Events</label> </li> <li> <input type="checkbox" class="cbr cbr-primary" checked="checked" id="sp-chk3" /> <label for="sp-chk3">Updates</label> </li> <li> <input type="checkbox" class="cbr cbr-primary" checked="checked" id="sp-chk4" /> <label for="sp-chk4">Server Uptime</label> </li> </ul> </div> <div class="links-block left-sep"> <h4> <a href="#"> <span>Help Desk</span> </a> </h4> <ul class="list-unstyled"> <li> <a href="#"> <i class="fa-angle-right"></i> Support Center </a> </li> <li> <a href="#"> <i class="fa-angle-right"></i> Submit a Ticket </a> </li> <li> <a href="#"> <i class="fa-angle-right"></i> Domains Protocol </a> </li> <li> <a href="#"> <i class="fa-angle-right"></i> Terms of Service </a> </li> </ul> </div> </div> </div> </div> </div> <div class="page-container"><!-- add class "sidebar-collapsed" to close sidebar by default, "chat-visible" to make chat appear always --> <!-- Add "fixed" class to make the sidebar fixed always to the browser viewport. --> <!-- Adding class "toggle-others" will keep only one menu item open at a time. --> <!-- Adding class "collapsed" collapse sidebar root elements and show only icons. --> <div class="sidebar-menu toggle-others fixed"> <div class="sidebar-menu-inner"> <header class="logo-env"> <!-- logo --> <div class="logo"> <a href="dashboard-1.html" class="logo-expanded"> <img src="assets/images/logo@2x.png" width="80" alt="" /> </a> <a href="dashboard-1.html" class="logo-collapsed"> <img src="assets/images/logo-collapsed@2x.png" width="40" alt="" /> </a> </div> <!-- This will toggle the mobile menu and will be visible only on mobile devices --> <div class="mobile-menu-toggle visible-xs"> <a href="#" data-toggle="user-info-menu"> <i class="fa-bell-o"></i> <span class="badge badge-success">7</span> </a> <a href="#" data-toggle="mobile-menu"> <i class="fa-bars"></i> </a> </div> <!-- This will open the popup with user profile settings, you can use for any purpose, just be creative --> <div class="settings-icon"> <a href="#" data-toggle="settings-pane" data-animate="true"> <i class="linecons-cog"></i> </a> </div> </header> <ul id="main-menu" class="main-menu"> <!-- add class "multiple-expanded" to allow multiple submenus to open --> <!-- class "auto-inherit-active-class" will automatically add "active" class for parent elements who are marked already with class "active" --> <li> <a href="dashboard-1.html"> <i class="linecons-cog"></i> <span class="title">Dashboard</span> </a> <ul> <li> <a href="dashboard-1.html"> <span class="title">Dashboard 1</span> </a> </li> <li> <a href="dashboard-2.html"> <span class="title">Dashboard 2</span> </a> </li> <li> <a href="dashboard-3.html"> <span class="title">Dashboard 3</span> </a> </li> <li> <a href="dashboard-4.html"> <span class="title">Dashboard 4</span> </a> </li> <li> <a href="skin-generator.html"> <span class="title">Skin Generator</span> </a> </li> <li> <a href="update-highlights.html"> <span class="title">Update Highlights</span> <span class="label label-pink pull-right hidden-collapsed">v1.3</span> </a> </li> </ul> </li> <li> <a href="layout-variants.html"> <i class="linecons-desktop"></i> <span class="title">Layouts</span> </a> <ul> <li> <a href="layout-variants.html"> <span class="title">Layout Variants &amp; API</span> </a> </li> <li> <a href="layout-collapsed-sidebar.html"> <span class="title">Collapsed Sidebar</span> </a> </li> <li> <a href="layout-static-sidebar.html"> <span class="title">Static Sidebar</span> </a> </li> <li> <a href="layout-horizontal-menu.html"> <span class="title">Horizontal Menu</span> </a> </li> <li> <a href="layout-horizontal-plus-sidebar.html"> <span class="title">Horizontal &amp; Sidebar Menu</span> </a> </li> <li> <a href="layout-horizontal-menu-click-to-open-subs.html"> <span class="title">Horizontal Open On Click</span> </a> </li> <li> <a href="layout-horizontal-menu-min.html"> <span class="title">Horizontal Menu Minimal</span> </a> </li> <li> <a href="layout-right-sidebar.html"> <span class="title">Right Sidebar</span> </a> </li> <li> <a href="layout-chat-open.html"> <span class="title">Chat Open</span> </a> </li> <li> <a href="layout-horizontal-sidebar-menu-collapsed-right.html"> <span class="title">Both Menus &amp; Collapsed</span> </a> </li> <li> <a href="layout-boxed.html"> <span class="title">Boxed Layout</span> </a> </li> <li> <a href="layout-boxed-horizontal-menu.html"> <span class="title">Boxed &amp; Horizontal Menu</span> </a> </li> </ul> </li> <li> <a href="ui-panels.html"> <i class="linecons-note"></i> <span class="title">UI Elements</span> </a> <ul> <li> <a href="ui-panels.html"> <span class="title">Panels</span> </a> </li> <li> <a href="ui-buttons.html"> <span class="title">Buttons</span> </a> </li> <li> <a href="ui-tabs-accordions.html"> <span class="title">Tabs &amp; Accordions</span> </a> </li> <li> <a href="ui-modals.html"> <span class="title">Modals</span> </a> </li> <li> <a href="ui-breadcrumbs.html"> <span class="title">Breadcrumbs</span> </a> </li> <li> <a href="ui-blockquotes.html"> <span class="title">Blockquotes</span> </a> </li> <li> <a href="ui-progressbars.html"> <span class="title">Progress Bars</span> </a> </li> <li> <a href="ui-navbars.html"> <span class="title">Navbars</span> </a> </li> <li> <a href="ui-alerts.html"> <span class="title">Alerts</span> </a> </li> <li> <a href="ui-pagination.html"> <span class="title">Pagination</span> </a> </li> <li> <a href="ui-typography.html"> <span class="title">Typography</span> </a> </li> <li> <a href="ui-other-elements.html"> <span class="title">Other Elements</span> </a> </li> </ul> </li> <li> <a href="ui-widgets.html"> <i class="linecons-star"></i> <span class="title">Widgets</span> </a> </li> <li> <a href="mailbox-main.html"> <i class="linecons-mail"></i> <span class="title">Mailbox</span> <span class="label label-success pull-right">5</span> </a> <ul> <li> <a href="mailbox-main.html"> <span class="title">Inbox</span> </a> </li> <li> <a href="mailbox-compose.html"> <span class="title">Compose Message</span> </a> </li> <li> <a href="mailbox-message.html"> <span class="title">View Message</span> </a> </li> </ul> </li> <li> <a href="tables-basic.html"> <i class="linecons-database"></i> <span class="title">Tables</span> </a> <ul> <li> <a href="tables-basic.html"> <span class="title">Basic Tables</span> </a> </li> <li> <a href="tables-responsive.html"> <span class="title">Responsive Table</span> </a> </li> <li> <a href="tables-datatables.html"> <span class="title">Data Tables</span> </a> </li> </ul> </li> <li> <a href="forms-native.html"> <i class="linecons-params"></i> <span class="title">Forms</span> </a> <ul> <li> <a href="forms-native.html"> <span class="title">Native Elements</span> </a> </li> <li> <a href="forms-advanced.html"> <span class="title">Advanced Plugins</span> </a> </li> <li> <a href="forms-wizard.html"> <span class="title">Form Wizard</span> </a> </li> <li> <a href="forms-validation.html"> <span class="title">Form Validation</span> </a> </li> <li> <a href="forms-input-masks.html"> <span class="title">Input Masks</span> </a> </li> <li> <a href="forms-file-upload.html"> <span class="title">File Upload</span> </a> </li> <li> <a href="forms-editors.html"> <span class="title">Editors</span> </a> </li> <li> <a href="forms-sliders.html"> <span class="title">Sliders</span> </a> </li> </ul> </li> <li> <a href="extra-gallery.html"> <i class="linecons-beaker"></i> <span class="title">Extra</span> <span class="label label-purple pull-right hidden-collapsed">New Items</span> </a> <ul> <li> <a href="extra-icons-fontawesome.html"> <span class="title">Icons</span> </a> <ul> <li> <a href="extra-icons-fontawesome.html"> <span class="title">Font Awesome</span> </a> </li> <li> <a href="extra-icons-linecons.html"> <span class="title">Linecons</span> </a> </li> <li> <a href="extra-icons-elusive.html"> <span class="title">Elusive</span> </a> </li> <li> <a href="extra-icons-meteocons.html"> <span class="title">Meteocons</span> </a> </li> </ul> </li> <li> <a href="extra-maps-google.html"> <span class="title">Maps</span> </a> <ul> <li> <a href="extra-maps-google.html"> <span class="title">Google Maps</span> </a> </li> <li> <a href="extra-maps-advanced.html"> <span class="title">Advanced Map</span> </a> </li> <li> <a href="extra-maps-vector.html"> <span class="title">Vector Map</span> </a> </li> </ul> </li> <li> <a href="extra-members-list.html"> <span class="title">Members</span> <span class="label label-warning pull-right">New</span> </a> <ul> <li> <a href="extra-members-list.html"> <span class="title">Members List</span> </a> </li> <li> <a href="extra-members-add.html"> <span class="title">Add Member</span> </a> </li> </ul> </li> <li> <a href="extra-gallery.html"> <span class="title">Gallery</span> </a> </li> <li> <a href="extra-calendar.html"> <span class="title">Calendar</span> </a> </li> <li> <a href="extra-profile.html"> <span class="title">Profile</span> </a> </li> <li> <a href="extra-login.html"> <span class="title">Login</span> </a> </li> <li> <a href="extra-lockscreen.html"> <span class="title">Lockscreen</span> </a> </li> <li> <a href="extra-login-light.html"> <span class="title">Login Light</span> </a> </li> <li> <a href="extra-timeline.html"> <span class="title">Timeline</span> </a> </li> <li> <a href="extra-timeline-center.html"> <span class="title">Timeline Centerd</span> </a> </li> <li> <a href="extra-notes.html"> <span class="title">Notes</span> </a> </li> <li> <a href="extra-image-crop.html"> <span class="title">Image Crop</span> </a> </li> <li> <a href="extra-portlets.html"> <span class="title">Portlets</span> </a> </li> <li> <a href="blank-sidebar.html"> <span class="title">Blank Page</span> </a> </li> <li> <a href="extra-search.html"> <span class="title">Search</span> </a> </li> <li> <a href="extra-invoice.html"> <span class="title">Invoice</span> </a> </li> <li> <a href="extra-not-found.html"> <span class="title">404 Page</span> </a> </li> <li> <a href="extra-tocify.html"> <span class="title">Tocify</span> </a> </li> <li> <a href="extra-loader.html"> <span class="title">Loading Progress</span> </a> </li> <li> <a href="extra-page-loading-ol.html"> <span class="title">Page Loading Overlay</span> </a> </li> <li> <a href="extra-notifications.html"> <span class="title">Notifications</span> </a> </li> <li> <a href="extra-nestable-lists.html"> <span class="title">Nestable Lists</span> </a> </li> <li> <a href="extra-scrollable.html"> <span class="title">Scrollable</span> </a> </li> </ul> </li> <li class="opened active"> <a href="charts-main.html"> <i class="linecons-globe"></i> <span class="title">Charts</span> </a> <ul> <li> <a href="charts-main.html"> <span class="title">Chart Variants</span> </a> </li> <li class="active"> <a href="charts-range.html"> <span class="title">Range Selector</span> </a> </li> <li> <a href="charts-sparklines.html"> <span class="title">Sparklines</span> </a> </li> <li> <a href="charts-map.html"> <span class="title">Map Charts</span> </a> </li> <li> <a href="charts-gauges.html"> <span class="title">Circular Gauges</span> </a> </li> <li> <a href="charts-bar-gauges.html"> <span class="title">Bar Gauges</span> </a> </li> </ul> </li> <li> <a href="#"> <i class="linecons-cloud"></i> <span class="title">Menu Levels</span> </a> <ul> <li> <a href="#"> <i class="entypo-flow-line"></i> <span class="title">Menu Level 1.1</span> </a> <ul> <li> <a href="#"> <i class="entypo-flow-parallel"></i> <span class="title">Menu Level 2.1</span> </a> </li> <li> <a href="#"> <i class="entypo-flow-parallel"></i> <span class="title">Menu Level 2.2</span> </a> <ul> <li> <a href="#"> <i class="entypo-flow-cascade"></i> <span class="title">Menu Level 3.1</span> </a> </li> <li> <a href="#"> <i class="entypo-flow-cascade"></i> <span class="title">Menu Level 3.2</span> </a> <ul> <li> <a href="#"> <i class="entypo-flow-branch"></i> <span class="title">Menu Level 4.1</span> </a> </li> </ul> </li> </ul> </li> <li> <a href="#"> <i class="entypo-flow-parallel"></i> <span class="title">Menu Level 2.3</span> </a> </li> </ul> </li> <li> <a href="#"> <i class="entypo-flow-line"></i> <span class="title">Menu Level 1.2</span> </a> </li> <li> <a href="#"> <i class="entypo-flow-line"></i> <span class="title">Menu Level 1.3</span> </a> </li> </ul> </li> </ul> </div> </div> <div class="main-content"> <nav class="navbar user-info-navbar" role="navigation"><!-- User Info, Notifications and Menu Bar --> <!-- Left links for user info navbar --> <ul class="user-info-menu left-links list-inline list-unstyled"> <li class="hidden-sm hidden-xs"> <a href="#" data-toggle="sidebar"> <i class="fa-bars"></i> </a> </li> <li class="dropdown hover-line"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa-envelope-o"></i> <span class="badge badge-green">15</span> </a> <ul class="dropdown-menu messages"> <li> <ul class="dropdown-menu-list list-unstyled ps-scrollbar"> <li class="active"><!-- "active" class means message is unread --> <a href="#"> <span class="line"> <strong>Luc Chartier</strong> <span class="light small">- yesterday</span> </span> <span class="line desc small"> This ain’t our first item, it is the best of the rest. </span> </a> </li> <li class="active"> <a href="#"> <span class="line"> <strong>Salma Nyberg</strong> <span class="light small">- 2 days ago</span> </span> <span class="line desc small"> Oh he decisively impression attachment friendship so if everything. </span> </a> </li> <li> <a href="#"> <span class="line"> Hayden Cartwright <span class="light small">- a week ago</span> </span> <span class="line desc small"> Whose her enjoy chief new young. Felicity if ye required likewise so doubtful. </span> </a> </li> <li> <a href="#"> <span class="line"> Sandra Eberhardt <span class="light small">- 16 days ago</span> </span> <span class="line desc small"> On so attention necessary at by provision otherwise existence direction. </span> </a> </li> <!-- Repeated --> <li class="active"><!-- "active" class means message is unread --> <a href="#"> <span class="line"> <strong>Luc Chartier</strong> <span class="light small">- yesterday</span> </span> <span class="line desc small"> This ain’t our first item, it is the best of the rest. </span> </a> </li> <li class="active"> <a href="#"> <span class="line"> <strong>Salma Nyberg</strong> <span class="light small">- 2 days ago</span> </span> <span class="line desc small"> Oh he decisively impression attachment friendship so if everything. </span> </a> </li> <li> <a href="#"> <span class="line"> Hayden Cartwright <span class="light small">- a week ago</span> </span> <span class="line desc small"> Whose her enjoy chief new young. Felicity if ye required likewise so doubtful. </span> </a> </li> <li> <a href="#"> <span class="line"> Sandra Eberhardt <span class="light small">- 16 days ago</span> </span> <span class="line desc small"> On so attention necessary at by provision otherwise existence direction. </span> </a> </li> </ul> </li> <li class="external"> <a href="mailbox-main.html"> <span>All Messages</span> <i class="fa-link-ext"></i> </a> </li> </ul> </li> <li class="dropdown hover-line"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa-bell-o"></i> <span class="badge badge-purple">7</span> </a> <ul class="dropdown-menu notifications"> <li class="top"> <p class="small"> <a href="#" class="pull-right">Mark all Read</a> You have <strong>3</strong> new notifications. </p> </li> <li> <ul class="dropdown-menu-list list-unstyled ps-scrollbar"> <li class="active notification-success"> <a href="#"> <i class="fa-user"></i> <span class="line"> <strong>New user registered</strong> </span> <span class="line small time"> 30 seconds ago </span> </a> </li> <li class="active notification-secondary"> <a href="#"> <i class="fa-lock"></i> <span class="line"> <strong>Privacy settings have been changed</strong> </span> <span class="line small time"> 3 hours ago </span> </a> </li> <li class="notification-primary"> <a href="#"> <i class="fa-thumbs-up"></i> <span class="line"> <strong>Someone special liked this</strong> </span> <span class="line small time"> 2 minutes ago </span> </a> </li> <li class="notification-danger"> <a href="#"> <i class="fa-calendar"></i> <span class="line"> John cancelled the event </span> <span class="line small time"> 9 hours ago </span> </a> </li> <li class="notification-info"> <a href="#"> <i class="fa-database"></i> <span class="line"> The server is status is stable </span> <span class="line small time"> yesterday at 10:30am </span> </a> </li> <li class="notification-warning"> <a href="#"> <i class="fa-envelope-o"></i> <span class="line"> New comments waiting approval </span> <span class="line small time"> last week </span> </a> </li> </ul> </li> <li class="external"> <a href="#"> <span>View all notifications</span> <i class="fa-link-ext"></i> </a> </li> </ul> </li> <!-- Added in v1.2 --> <li class="dropdown hover-line language-switcher"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <img src="assets/images/flags/flag-uk.png" alt="flag-uk" /> English </a> <ul class="dropdown-menu languages"> <li> <a href="#"> <img src="assets/images/flags/flag-al.png" alt="flag-al" /> Shqip </a> </li> <li class="active"> <a href="#"> <img src="assets/images/flags/flag-uk.png" alt="flag-uk" /> English </a> </li> <li> <a href="#"> <img src="assets/images/flags/flag-de.png" alt="flag-de" /> Deutsch </a> </li> <li> <a href="#"> <img src="assets/images/flags/flag-fr.png" alt="flag-fr" /> Fran&ccedil;ais </a> </li> <li> <a href="#"> <img src="assets/images/flags/flag-br.png" alt="flag-br" /> Portugu&ecirc;s </a> </li> <li> <a href="#"> <img src="assets/images/flags/flag-es.png" alt="flag-es" /> Espa&ntilde;ol </a> </li> </ul> </li> </ul> <!-- Right links for user info navbar --> <ul class="user-info-menu right-links list-inline list-unstyled"> <li class="search-form"><!-- You can add "always-visible" to show make the search input visible --> <form name="userinfo_search_form" method="get" action="extra-search.html"> <input type="text" name="s" class="form-control search-field" placeholder="Type to search..." /> <button type="submit" class="btn btn-link"> <i class="linecons-search"></i> </button> </form> </li> <li class="dropdown user-profile"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <img src="assets/images/user-4.png" alt="user-image" class="img-circle img-inline userpic-32" width="28" /> <span> John Smith <i class="fa-angle-down"></i> </span> </a> <ul class="dropdown-menu user-profile-menu list-unstyled"> <li> <a href="#edit-profile"> <i class="fa-edit"></i> New Post </a> </li> <li> <a href="#settings"> <i class="fa-wrench"></i> Settings </a> </li> <li> <a href="#profile"> <i class="fa-user"></i> Profile </a> </li> <li> <a href="#help"> <i class="fa-info"></i> Help </a> </li> <li class="last"> <a href="extra-lockscreen.html"> <i class="fa-lock"></i> Logout </a> </li> </ul> </li> <li> <a href="#" data-toggle="chat"> <i class="fa-comments-o"></i> </a> </li> </ul> </nav> <div class="page-title"> <div class="title-env"> <h1 class="title">Range Selector</h1> <p class="description">Data visualization widgets for your stats</p> </div> <div class="breadcrumb-env"> <ol class="breadcrumb bc-1" > <li> <a href="dashboard-1.html"><i class="fa-home"></i>Home</a> </li> <li> <a href="charts-main.html">Charts</a> </li> <li class="active"> <strong>Chart Variants</strong> </li> </ol> </div> </div> <div class="dx-warning hidden"> <div> <h2>How to Include Charts Library in Xenon Theme</h2> <p>The reason why you don't see charts like in the Xenon demo website is because of license restrictions from DevExpress company. <a href="http://js.devexpress.com/DevExtremeWeb/?folder=EULAs" target="_blank">Click here</a> to read license agreement.</p> <p>Even that we have purchased the developer license we are not permitted to include the DevExtreme Web Charts JavaScript library in the default download file of Xenon theme, however you can include DevExpress Charts library manually and takes just few minutes:</p> <ol> <li>Download <strong>DevExtreme Web</strong> JavaScript library by clicking <a href="https://go.devexpress.com/DevExpressDownload_DevExtremeWebTrial.aspx" class="text-bold">here</a>. If the link doesn't work, then <a href="http://js.devexpress.com/Buy/" target="_parent"><strong>click this one</strong></a> and choose DevExtreme Web package to download.</li> <li>Extract the downloaded archive. There you will find <strong>Lib/</strong> folder. <strong>Copy</strong> the folders inside.</li> <li><strong>Paste</strong> copied files to <strong>assets/js/devexpress-web-14.1/</strong></li> <li>You are all set! Charts will look the same just like in the demo website.</li> </ol> </div> </div> <script type="text/javascript"> jQuery(document).ready(function($) { if( ! $.isFunction($.fn.dxChart)) $(".dx-warning").removeClass('hidden'); }); </script> <div class="row"> <div class="col-sm-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Range Selector</h3> <div class="panel-options"> <a href="#" data-toggle="panel"> <span class="collapse-icon">&ndash;</span> <span class="expand-icon">+</span> </a> <a href="#" data-toggle="remove"> &times; </a> </div> </div> <div class="panel-body"> <script type="text/javascript"> jQuery(document).ready(function($) { if( ! $.isFunction($.fn.dxChart)) return; $("#range-1").dxRangeSelector({ margin: { top: 50 }, scale: { minorTickInterval: "day", majorTickInterval: { days: 7 } }, size: { height: 310 }, dataSource: [ { t: new Date(2011, 11, 22), costs: 19, income: 18 }, { t: new Date(2011, 11, 29), costs: 27, income: 12 }, { t: new Date(2012, 0, 5), costs: 30, income: 5 }, { t: new Date(2012, 0, 12), costs: 26, income: 6 }, { t: new Date(2012, 0, 19), costs: 18, income: 10 }, { t: new Date(2012, 0, 26), costs: 15, income: 15 }, { t: new Date(2012, 1, 2), costs: 14, income: 21 }, { t: new Date(2012, 1, 9), costs: 14, income: 25 } ], chart: { series: [ { argumentField: "t", valueField: "costs", color: "#7c38bc" }, { argumentField: "t", valueField: "income", color: "#4fcdfc" } ], valueAxis: { min: 0 } }, selectedRange: { startValue: new Date(2011, 11, 25), endValue: new Date(2012, 0, 1) }, selectedRangeChanged: function(e) { $("#range-1-selected strong").html(e.startValue.toDateString() + ' - ' + e.endValue.toDateString()); } }); }); </script> <div id="range-1" style="height: 310px; width: 100%;"></div> <div id="range-1-selected"> Selected range: <strong class="text-primary">/</strong> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Range Selector Example 2</h3> <div class="panel-options"> <a href="#" data-toggle="panel"> <span class="collapse-icon">&ndash;</span> <span class="expand-icon">+</span> </a> <a href="#" data-toggle="remove"> &times; </a> </div> </div> <div class="panel-body"> <script type="text/javascript"> jQuery(document).ready(function($) { if( ! $.isFunction($.fn.dxChart)) return; var employees = [ { BirthYear: 1948 }, { BirthYear: 1952 }, { BirthYear: 1963 }, { BirthYear: 1937 }, { BirthYear: 1955 }, { BirthYear: 1963 }, { BirthYear: 1960 }, { BirthYear: 1958 }, { BirthYear: 1966 } ]; $("#range-2").dxRangeSelector({ margin: { top: 20 }, size: { height: 140 }, dataSource: employees, dataSourceField: "BirthYear", behavior: { callSelectedRangeChanged: "onMoving" }, selectedRangeChanged: function (e) { $("#range-2-selected").html('<br />Start: ' + e.startValue + ' End: ' + e.endValue); } }); }); </script> <div id="range-2" style="height: 140px; width: 100%;"></div> <strong id="range-2-selected" class="text-success"></strong> </div> </div> </div> </div> <!-- Main Footer --> <!-- Choose between footer styles: "footer-type-1" or "footer-type-2" --> <!-- Add class "sticky" to always stick the footer to the end of page (if page contents is small) --> <!-- Or class "fixed" to always fix the footer to the end of page --> <footer class="main-footer sticky footer-type-1"> <div class="footer-inner"> <!-- Add your copyright text here --> <div class="footer-text"> &copy; 2014 <strong>Xenon</strong> theme by <a href="http://laborator.co" target="_blank">Laborator</a> - <a href="http://themeforest.net/item/xenon-bootstrap-admin-theme/9059661?ref=Laborator" target="_blank">Purchase for only <strong>23$</strong></a> </div> <!-- Go to Top Link, just add rel="go-top" to any link to add this functionality --> <div class="go-up"> <a href="#" rel="go-top"> <i class="fa-angle-up"></i> </a> </div> </div> </footer> </div> <div id="chat" class="fixed"><!-- start: Chat Section --> <div class="chat-inner"> <h2 class="chat-header"> <a href="#" class="chat-close" data-toggle="chat"> <i class="fa-plus-circle rotate-45deg"></i> </a> Chat <span class="badge badge-success is-hidden">0</span> </h2> <script type="text/javascript"> // Here is just a sample how to open chat conversation box jQuery(document).ready(function($) { var $chat_conversation = $(".chat-conversation"); $(".chat-group a").on('click', function(ev) { ev.preventDefault(); $chat_conversation.toggleClass('is-open'); $(".chat-conversation textarea").trigger('autosize.resize').focus(); }); $(".conversation-close").on('click', function(ev) { ev.preventDefault(); $chat_conversation.removeClass('is-open'); }); }); </script> <div class="chat-group"> <strong>Favorites</strong> <a href="#"><span class="user-status is-online"></span> <em>Catherine J. Watkins</em></a> <a href="#"><span class="user-status is-online"></span> <em>Nicholas R. Walker</em></a> <a href="#"><span class="user-status is-busy"></span> <em>Susan J. Best</em></a> <a href="#"><span class="user-status is-idle"></span> <em>Fernando G. Olson</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Brandon S. Young</em></a> </div> <div class="chat-group"> <strong>Work</strong> <a href="#"><span class="user-status is-busy"></span> <em>Rodrigo E. Lozano</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Robert J. Garcia</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Daniel A. Pena</em></a> </div> <div class="chat-group"> <strong>Other</strong> <a href="#"><span class="user-status is-online"></span> <em>Dennis E. Johnson</em></a> <a href="#"><span class="user-status is-online"></span> <em>Stuart A. Shire</em></a> <a href="#"><span class="user-status is-online"></span> <em>Janet I. Matas</em></a> <a href="#"><span class="user-status is-online"></span> <em>Mindy A. Smith</em></a> <a href="#"><span class="user-status is-busy"></span> <em>Herman S. Foltz</em></a> <a href="#"><span class="user-status is-busy"></span> <em>Gregory E. Robie</em></a> <a href="#"><span class="user-status is-busy"></span> <em>Nellie T. Foreman</em></a> <a href="#"><span class="user-status is-busy"></span> <em>William R. Miller</em></a> <a href="#"><span class="user-status is-idle"></span> <em>Vivian J. Hall</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Melinda A. Anderson</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Gary M. Mooneyham</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Robert C. Medina</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Dylan C. Bernal</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Marc P. Sanborn</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Kenneth M. Rochester</em></a> <a href="#"><span class="user-status is-offline"></span> <em>Rachael D. Carpenter</em></a> </div> </div> <!-- conversation template --> <div class="chat-conversation"> <div class="conversation-header"> <a href="#" class="conversation-close"> &times; </a> <span class="user-status is-online"></span> <span class="display-name">Arlind Nushi</span> <small>Online</small> </div> <ul class="conversation-body"> <li> <span class="user">Arlind Nushi</span> <span class="time">09:00</span> <p>Are you here?</p> </li> <li class="odd"> <span class="user">Brandon S. Young</span> <span class="time">09:25</span> <p>This message is pre-queued.</p> </li> <li> <span class="user">Brandon S. Young</span> <span class="time">09:26</span> <p>Whohoo!</p> </li> <li class="odd"> <span class="user">Arlind Nushi</span> <span class="time">09:27</span> <p>Do you like it?</p> </li> </ul> <div class="chat-textarea"> <textarea class="form-control autogrow" placeholder="Type your message"></textarea> </div> </div> <!-- end: Chat Section --> </div> </div> <div class="footer-sticked-chat"><!-- Start: Footer Sticked Chat --> <script type="text/javascript"> function toggleSampleChatWindow() { var $chat_win = jQuery("#sample-chat-window"); $chat_win.toggleClass('open'); if($chat_win.hasClass('open')) { var $messages = $chat_win.find('.ps-scrollbar'); if($.isFunction($.fn.perfectScrollbar)) { $messages.perfectScrollbar('destroy'); setTimeout(function(){ $messages.perfectScrollbar(); $chat_win.find('.form-control').focus(); }, 300); } } jQuery("#sample-chat-window form").on('submit', function(ev) { ev.preventDefault(); }); } jQuery(document).ready(function($) { $(".footer-sticked-chat .chat-user, .other-conversations-list a").on('click', function(ev) { ev.preventDefault(); toggleSampleChatWindow(); }); $(".mobile-chat-toggle").on('click', function(ev) { ev.preventDefault(); $(".footer-sticked-chat").toggleClass('mobile-is-visible'); }); }); </script> <ul class="chat-conversations list-unstyled"> <!-- Extra Chat Conversations collected not to exceed window width --> <li class="browse-more"> <a href="#" class="chat-user"> <i class="linecons-comment"></i> <span>3</span> </a> <!-- These conversations are hidden in screen --> <ul class="other-conversations-list"> <li> <!-- Minimal User Info Link --> <a href="#" > Catherine J. Watkins <span>&times;</span> </a> </li> <li> <!-- Minimal User Info Link --> <a href="#" > Nicholas R. Walker <span>&times;</span> </a> </li> <li> <!-- Minimal User Info Link --> <a href="#" > Susan J. Best <span>&times;</span> </a> </li> </ul> </li> <li id="sample-chat-window"> <!-- User Info Link --> <a href="#" class="chat-user"> <span class="user-status is-online"></span> Art Ramadani </a> <span class="badge badge-purple">4</span> <!-- Conversation Window --> <div class="conversation-window"> <!-- User Info Link in header (used to close the chat bar) --> <a href="#" class="chat-user"> <span class="close">&times;</span> <span class="user-status is-online"></span> Art Ramadani </a> <ul class="conversation-messages ps-scrollbar ps-scroll-down"> <!-- Will indicate time --> <li class="time">Thursday 04, December '14</li> <li> <div class="user-info"> <a href="#"> <img src="assets/images/user-1.png" width="30" height="30" alt="user-image" /> </a> </div> <div class="message-entry"> <p>Hello John, how are you?</p> </div> </li> <li class="me"><!-- adding class="me" will indicate that "you" are sending a message --> <div class="message-entry"> <p>Hi Art, I am fine :) How about you?</p> </div> <div class="user-info"> <a href="#"> <img src="assets/images/user-4.png" width="30" height="30" alt="user-image" /> </a> </div> </li> <li> <div class="user-info"> <a href="#"> <img src="assets/images/user-1.png" width="30" height="30" alt="user-image" /> </a> </div> <div class="message-entry"> <p>Warmth his law design say are person. Pronounce suspected in belonging conveying ye repulsive.</p> </div> </li> <li class="me"><!-- adding class="me" will indicate that "you" are sending a message --> <div class="message-entry"> <p>Comfort reached gay perhaps chamber his six detract besides add. Moonlight newspaper.</p> <p>Timed voice share led his widen noisy young.</p> <p>His six detract besides add moonlight newspaper.</p> </div> <div class="user-info"> <a href="#"> <img src="assets/images/user-4.png" width="30" height="30" alt="user-image" /> </a> </div> </li> <li> <div class="user-info"> <a href="#"> <img src="assets/images/user-1.png" width="30" height="30" alt="user-image" /> </a> </div> <div class="message-entry"> <p>Hello John, how are you?</p> </div> </li> <li class="me"><!-- adding class="me" will indicate that "you" are sending a message --> <div class="message-entry"> <p>Hi Art, I am fine :) How about you?</p> </div> <div class="user-info"> <a href="#"> <img src="assets/images/user-4.png" width="30" height="30" alt="user-image" /> </a> </div> </li> <li> <div class="user-info"> <a href="#"> <img src="assets/images/user-1.png" width="30" height="30" alt="user-image" /> </a> </div> <div class="message-entry"> <p>Hello John, how are you?</p> </div> </li> <!-- Will indicate time --> <li class="time">Today 17:12</li> <li class="me"><!-- adding class="me" will indicate that "you" are sending a message --> <div class="message-entry"> <p>Hi Art, I am fine :) How about you?</p> </div> <div class="user-info"> <a href="#"> <img src="assets/images/user-4.png" width="30" height="30" alt="user-image" /> </a> </div> </li> </ul> <form method="post" class="chat-form"> <input type="text" class="form-control" placeholder="Enter your message..." /> </form> </div> </li> <li> <!-- User Info Link --> <a href="#" class="chat-user"> <span class="user-status is-idle"></span> Ylli Pylla </a> </li> <li> <!-- User Info Link --> <a href="#" class="chat-user"> <span class="user-status is-busy"></span> Arlind Nushi </a> </li> </ul> <a href="#" class="mobile-chat-toggle"> <i class="linecons-comment"></i> <span class="num">6</span> <span class="badge badge-purple">4</span> </a> <!-- End: Footer Sticked Chat --> </div> <!-- Bottom Scripts --> <script src="assets/js/bootstrap.min.js"></script> <script src="assets/js/TweenMax.min.js"></script> <script src="assets/js/resizeable.js"></script> <script src="assets/js/joinable.js"></script> <script src="assets/js/xenon-api.js"></script> <script src="assets/js/xenon-toggles.js"></script> <!-- Imported scripts on this page --> <script src="assets/js/devexpress-web-14.1/js/globalize.min.js"></script> <script src="assets/js/devexpress-web-14.1/js/dx.chartjs.js"></script> <!-- JavaScripts initializations and stuff --> <script src="assets/js/xenon-custom.js"></script> </body> </html>
package client const ( EXTERNAL_HOST_EVENT_TYPE = "externalHostEvent" ) type ExternalHostEvent struct { Resource AccountId string `json:"accountId,omitempty" yaml:"account_id,omitempty"` Created string `json:"created,omitempty" yaml:"created,omitempty"` Data map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"` DeleteHost bool `json:"deleteHost,omitempty" yaml:"delete_host,omitempty"` EventType string `json:"eventType,omitempty" yaml:"event_type,omitempty"` ExternalId string `json:"externalId,omitempty" yaml:"external_id,omitempty"` HostId string `json:"hostId,omitempty" yaml:"host_id,omitempty"` HostLabel string `json:"hostLabel,omitempty" yaml:"host_label,omitempty"` Kind string `json:"kind,omitempty" yaml:"kind,omitempty"` ReportedAccountId string `json:"reportedAccountId,omitempty" yaml:"reported_account_id,omitempty"` State string `json:"state,omitempty" yaml:"state,omitempty"` Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioning_message,omitempty"` TransitioningProgress int64 `json:"transitioningProgress,omitempty" yaml:"transitioning_progress,omitempty"` Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` } type ExternalHostEventCollection struct { Collection Data []ExternalHostEvent `json:"data,omitempty"` } type ExternalHostEventClient struct { rancherClient *RancherClient } type ExternalHostEventOperations interface { List(opts *ListOpts) (*ExternalHostEventCollection, error) Create(opts *ExternalHostEvent) (*ExternalHostEvent, error) Update(existing *ExternalHostEvent, updates interface{}) (*ExternalHostEvent, error) ById(id string) (*ExternalHostEvent, error) Delete(container *ExternalHostEvent) error ActionCreate(*ExternalHostEvent) (*ExternalEvent, error) ActionRemove(*ExternalHostEvent) (*ExternalEvent, error) } func newExternalHostEventClient(rancherClient *RancherClient) *ExternalHostEventClient { return &ExternalHostEventClient{ rancherClient: rancherClient, } } func (c *ExternalHostEventClient) Create(container *ExternalHostEvent) (*ExternalHostEvent, error) { resp := &ExternalHostEvent{} err := c.rancherClient.doCreate(EXTERNAL_HOST_EVENT_TYPE, container, resp) return resp, err } func (c *ExternalHostEventClient) Update(existing *ExternalHostEvent, updates interface{}) (*ExternalHostEvent, error) { resp := &ExternalHostEvent{} err := c.rancherClient.doUpdate(EXTERNAL_HOST_EVENT_TYPE, &existing.Resource, updates, resp) return resp, err } func (c *ExternalHostEventClient) List(opts *ListOpts) (*ExternalHostEventCollection, error) { resp := &ExternalHostEventCollection{} err := c.rancherClient.doList(EXTERNAL_HOST_EVENT_TYPE, opts, resp) return resp, err } func (c *ExternalHostEventClient) ById(id string) (*ExternalHostEvent, error) { resp := &ExternalHostEvent{} err := c.rancherClient.doById(EXTERNAL_HOST_EVENT_TYPE, id, resp) if apiError, ok := err.(*ApiError); ok { if apiError.StatusCode == 404 { return nil, nil } } return resp, err } func (c *ExternalHostEventClient) Delete(container *ExternalHostEvent) error { return c.rancherClient.doResourceDelete(EXTERNAL_HOST_EVENT_TYPE, &container.Resource) } func (c *ExternalHostEventClient) ActionCreate(resource *ExternalHostEvent) (*ExternalEvent, error) { resp := &ExternalEvent{} err := c.rancherClient.doAction(EXTERNAL_HOST_EVENT_TYPE, "create", &resource.Resource, nil, resp) return resp, err } func (c *ExternalHostEventClient) ActionRemove(resource *ExternalHostEvent) (*ExternalEvent, error) { resp := &ExternalEvent{} err := c.rancherClient.doAction(EXTERNAL_HOST_EVENT_TYPE, "remove", &resource.Resource, nil, resp) return resp, err }
using System.Collections.Concurrent; using System.Diagnostics.Contracts; using System.Globalization; using System.Reflection; using System.Runtime; using System.Runtime.CompilerServices; using System.ServiceModel.Description; using System.ServiceModel.Diagnostics; using System.ServiceModel.Dispatcher; using System.Threading.Tasks; namespace System.ServiceModel.Channels { public class ServiceChannelProxy : DispatchProxy, ICommunicationObject, IChannel, IClientChannel, IOutputChannel, IRequestChannel, IServiceChannel { private const String activityIdSlotName = "E2ETrace.ActivityID"; private Type _proxiedType; private ServiceChannel _serviceChannel; private ImmutableClientRuntime _proxyRuntime; private MethodDataCache _methodDataCache; // ServiceChannelProxy serves 2 roles. It is the TChannel proxy called by the client, // and it is also the handler of those calls that dispatches them to the appropriate service channel. // In .Net Remoting terms, it is conceptually the same as a RealProxy and a TransparentProxy combined. internal static TChannel CreateProxy<TChannel>(MessageDirection direction, ServiceChannel serviceChannel) { TChannel proxy = DispatchProxy.Create<TChannel, ServiceChannelProxy>(); if (proxy == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.FailedToCreateTypedProxy, typeof(TChannel)))); } ServiceChannelProxy channelProxy = (ServiceChannelProxy)(object)proxy; channelProxy._proxiedType = typeof(TChannel); channelProxy._serviceChannel = serviceChannel; channelProxy._proxyRuntime = serviceChannel.ClientRuntime.GetRuntime(); channelProxy._methodDataCache = new MethodDataCache(); return proxy; } //Workaround is to set the activityid in remoting call's LogicalCallContext // Override ToString() to reveal only the expected proxy type, not the generated one public override string ToString() { return _proxiedType.ToString(); } private MethodData GetMethodData(MethodCall methodCall) { MethodData methodData; MethodBase method = methodCall.MethodBase; if (_methodDataCache.TryGetMethodData(method, out methodData)) { return methodData; } bool canCacheMessageData; Type declaringType = method.DeclaringType; if (declaringType == typeof(object) && method == typeof(object).GetMethod("GetType")) { canCacheMessageData = true; methodData = new MethodData(method, MethodType.GetType); } else if (declaringType.IsAssignableFrom(_serviceChannel.GetType())) { canCacheMessageData = true; methodData = new MethodData(method, MethodType.Channel); } else { ProxyOperationRuntime operation = _proxyRuntime.GetOperation(method, methodCall.Args, out canCacheMessageData); if (operation == null) { if (_serviceChannel.Factory != null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.Format(SR.SFxMethodNotSupported1, method.Name))); else throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.Format(SR.SFxMethodNotSupportedOnCallback1, method.Name))); } MethodType methodType; if (operation.IsTaskCall(methodCall)) { methodType = MethodType.TaskService; } else if (operation.IsSyncCall(methodCall)) { methodType = MethodType.Service; } else if (operation.IsBeginCall(methodCall)) { methodType = MethodType.BeginService; } else { methodType = MethodType.EndService; } methodData = new MethodData(method, methodType, operation); } if (canCacheMessageData) { _methodDataCache.SetMethodData(methodData); } return methodData; } internal ServiceChannel GetServiceChannel() { return _serviceChannel; } protected override object Invoke(MethodInfo targetMethod, object[] args) { if (args == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("args"); } if (targetMethod == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.InvalidTypedProxyMethodHandle, _proxiedType.Name))); } MethodCall methodCall = new MethodCall(targetMethod, args); MethodData methodData = GetMethodData(methodCall); switch (methodData.MethodType) { case MethodType.Service: return InvokeService(methodCall, methodData.Operation); case MethodType.BeginService: return InvokeBeginService(methodCall, methodData.Operation); case MethodType.EndService: return InvokeEndService(methodCall, methodData.Operation); case MethodType.TaskService: return InvokeTaskService(methodCall, methodData.Operation); case MethodType.Channel: return InvokeChannel(methodCall); case MethodType.GetType: return InvokeGetType(methodCall); default: Fx.Assert("Invalid proxy method type"); throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Invalid proxy method type"))); } } internal static class TaskCreator { public static Task CreateTask(ServiceChannel channel, MethodCall methodCall, ProxyOperationRuntime operation) { if (operation.TaskTResult == ServiceReflector.VoidType) { return TaskCreator.CreateTask(channel, operation, methodCall.Args); } return TaskCreator.CreateGenericTask(channel, operation, methodCall.Args); } private static Task CreateGenericTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inputParameters) { TaskCompletionSourceProxy tcsp = new TaskCompletionSourceProxy(operation.TaskTResult); bool completedCallback = false; Action<IAsyncResult> endCallDelegate = (asyncResult) => { Contract.Assert(asyncResult != null, "'asyncResult' MUST NOT be NULL."); completedCallback = true; OperationContext originalOperationContext = OperationContext.Current; OperationContext.Current = asyncResult.AsyncState as OperationContext; try { object result = channel.EndCall(operation.Action, Array.Empty<object>(), asyncResult); tcsp.TrySetResult(result); } catch (Exception e) { tcsp.TrySetException(e); } finally { OperationContext.Current = originalOperationContext; } }; try { IAsyncResult ar = ServiceChannel.BeginCall(channel, operation, inputParameters, new AsyncCallback(endCallDelegate), OperationContext.Current); if (ar.CompletedSynchronously && !completedCallback) { endCallDelegate(ar); } } catch (Exception e) { tcsp.TrySetException(e); } return tcsp.Task; } private static Task CreateTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inputParameters) { TaskCompletionSource<object> tcs = new TaskCompletionSource<object>(); bool completedCallback = false; Action<IAsyncResult> endCallDelegate = (asyncResult) => { Contract.Assert(asyncResult != null, "'asyncResult' MUST NOT be NULL."); completedCallback = true; OperationContext originalOperationContext = OperationContext.Current; OperationContext.Current = asyncResult.AsyncState as OperationContext; try { channel.EndCall(operation.Action, Array.Empty<object>(), asyncResult); tcs.TrySetResult(null); } catch (Exception e) { tcs.TrySetException(e); } finally { OperationContext.Current = originalOperationContext; } }; try { IAsyncResult ar = ServiceChannel.BeginCall(channel, operation, inputParameters, new AsyncCallback(endCallDelegate), OperationContext.Current); if (ar.CompletedSynchronously && !completedCallback) { endCallDelegate(ar); } } catch (Exception e) { tcs.TrySetException(e); } return tcs.Task; } } private class TaskCompletionSourceProxy { private TaskCompletionSourceInfo _tcsInfo; private object _tcsInstance; public TaskCompletionSourceProxy(Type resultType) { _tcsInfo = TaskCompletionSourceInfo.GetTaskCompletionSourceInfo(resultType); _tcsInstance = Activator.CreateInstance(_tcsInfo.GenericType); } public Task Task { get { return (Task)_tcsInfo.TaskProperty.GetValue(_tcsInstance); } } public bool TrySetResult(object result) { return (bool)_tcsInfo.TrySetResultMethod.Invoke(_tcsInstance, new object[] { result }); } public bool TrySetException(Exception exception) { return (bool)_tcsInfo.TrySetExceptionMethod.Invoke(_tcsInstance, new object[] { exception }); } public bool TrySetCanceled() { return (bool)_tcsInfo.TrySetCanceledMethod.Invoke(_tcsInstance, Array.Empty<object>()); } } private class TaskCompletionSourceInfo { private static ConcurrentDictionary<Type, TaskCompletionSourceInfo> s_cache = new ConcurrentDictionary<Type, TaskCompletionSourceInfo>(); public TaskCompletionSourceInfo(Type resultType) { ResultType = resultType; Type tcsType = typeof(TaskCompletionSource<>); GenericType = tcsType.MakeGenericType(new Type[] { resultType }); TaskProperty = GenericType.GetTypeInfo().GetDeclaredProperty("Task"); TrySetResultMethod = GenericType.GetTypeInfo().GetDeclaredMethod("TrySetResult"); TrySetExceptionMethod = GenericType.GetRuntimeMethod("TrySetException", new Type[] { typeof(Exception) }); TrySetCanceledMethod = GenericType.GetRuntimeMethod("TrySetCanceled", Array.Empty<Type>()); } public Type ResultType { get; private set; } public Type GenericType { get; private set; } public PropertyInfo TaskProperty { get; private set; } public MethodInfo TrySetResultMethod { get; private set; } public MethodInfo TrySetExceptionMethod { get; set; } public MethodInfo TrySetCanceledMethod { get; set; } public static TaskCompletionSourceInfo GetTaskCompletionSourceInfo(Type resultType) { return s_cache.GetOrAdd(resultType, t => new TaskCompletionSourceInfo(t)); } } private object InvokeTaskService(MethodCall methodCall, ProxyOperationRuntime operation) { Task task = TaskCreator.CreateTask(_serviceChannel, methodCall, operation); return task; } private object InvokeChannel(MethodCall methodCall) { string activityName = null; ActivityType activityType = ActivityType.Unknown; if (DiagnosticUtility.ShouldUseActivity) { if (ServiceModelActivity.Current == null || ServiceModelActivity.Current.ActivityType != ActivityType.Close) { MethodData methodData = this.GetMethodData(methodCall); if (methodData.MethodBase.DeclaringType == typeof(System.ServiceModel.ICommunicationObject) && methodData.MethodBase.Name.Equals("Close", StringComparison.Ordinal)) { activityName = SR.Format(SR.ActivityClose, _serviceChannel.GetType().FullName); activityType = ActivityType.Close; } } } using (ServiceModelActivity activity = string.IsNullOrEmpty(activityName) ? null : ServiceModelActivity.CreateBoundedActivity()) { if (DiagnosticUtility.ShouldUseActivity) { ServiceModelActivity.Start(activity, activityName, activityType); } return ExecuteMessage(_serviceChannel, methodCall); } } private object InvokeGetType(MethodCall methodCall) { return _proxiedType; } private object InvokeBeginService(MethodCall methodCall, ProxyOperationRuntime operation) { AsyncCallback callback; object asyncState; object[] ins = operation.MapAsyncBeginInputs(methodCall, out callback, out asyncState); object ret = _serviceChannel.BeginCall(operation.Action, operation.IsOneWay, operation, ins, callback, asyncState); return ret; } private object InvokeEndService(MethodCall methodCall, ProxyOperationRuntime operation) { IAsyncResult result; object[] outs; operation.MapAsyncEndInputs(methodCall, out result, out outs); object ret = _serviceChannel.EndCall(operation.Action, outs, result); operation.MapAsyncOutputs(methodCall, outs, ref ret); return ret; } private object InvokeService(MethodCall methodCall, ProxyOperationRuntime operation) { object[] outs; object[] ins = operation.MapSyncInputs(methodCall, out outs); object ret = _serviceChannel.Call(operation.Action, operation.IsOneWay, operation, ins, outs); operation.MapSyncOutputs(methodCall, outs, ref ret); return ret; } private object ExecuteMessage(object target, MethodCall methodCall) { MethodBase targetMethod = methodCall.MethodBase; object[] args = methodCall.Args; object returnValue = null; try { returnValue = targetMethod.Invoke(target, args); } catch (TargetInvocationException e) { throw e.InnerException; } return returnValue; } internal class MethodDataCache { private MethodData[] _methodDatas; public MethodDataCache() { _methodDatas = new MethodData[4]; } private object ThisLock { get { return this; } } public bool TryGetMethodData(MethodBase method, out MethodData methodData) { lock (ThisLock) { MethodData[] methodDatas = _methodDatas; int index = FindMethod(methodDatas, method); if (index >= 0) { methodData = methodDatas[index]; return true; } else { methodData = new MethodData(); return false; } } } private static int FindMethod(MethodData[] methodDatas, MethodBase methodToFind) { for (int i = 0; i < methodDatas.Length; i++) { MethodBase method = methodDatas[i].MethodBase; if (method == null) { break; } if (method == methodToFind) { return i; } } return -1; } public void SetMethodData(MethodData methodData) { lock (ThisLock) { int index = FindMethod(_methodDatas, methodData.MethodBase); if (index < 0) { for (int i = 0; i < _methodDatas.Length; i++) { if (_methodDatas[i].MethodBase == null) { _methodDatas[i] = methodData; return; } } MethodData[] newMethodDatas = new MethodData[_methodDatas.Length * 2]; Array.Copy(_methodDatas, newMethodDatas, _methodDatas.Length); newMethodDatas[_methodDatas.Length] = methodData; _methodDatas = newMethodDatas; } } } } internal enum MethodType { Service, BeginService, EndService, Channel, Object, GetType, TaskService } internal struct MethodData { private MethodBase _methodBase; private MethodType _methodType; private ProxyOperationRuntime _operation; public MethodData(MethodBase methodBase, MethodType methodType) : this(methodBase, methodType, null) { } public MethodData(MethodBase methodBase, MethodType methodType, ProxyOperationRuntime operation) { _methodBase = methodBase; _methodType = methodType; _operation = operation; } public MethodBase MethodBase { get { return _methodBase; } } public MethodType MethodType { get { return _methodType; } } public ProxyOperationRuntime Operation { get { return _operation; } } } #region Channel interfaces // These channel methods exist only to implement additional channel interfaces for ServiceChannelProxy. // This is required because clients can down-cast typed proxies to the these channel interfaces. // On the desktop, the .Net Remoting layer allowed that type cast, and subsequent calls against the // interface went back through the RealProxy and invoked the underlying ServiceChannel. // Net Native and CoreClr do not have .Net Remoting and therefore cannot use that mechanism. // But because typed proxies derive from ServiceChannelProxy, implementing these interfaces // on ServiceChannelProxy permits casting the typed proxy to these interfaces. // All interface implentations delegate directly to the underlying ServiceChannel. T IChannel.GetProperty<T>() { return _serviceChannel.GetProperty<T>(); } CommunicationState ICommunicationObject.State { get { return _serviceChannel.State; } } event EventHandler ICommunicationObject.Closed { add { _serviceChannel.Closed += value; } remove { _serviceChannel.Closed -= value; } } event EventHandler ICommunicationObject.Closing { add { _serviceChannel.Closing += value; } remove { _serviceChannel.Closing -= value; } } event EventHandler ICommunicationObject.Faulted { add { _serviceChannel.Faulted += value; } remove { _serviceChannel.Faulted -= value; } } event EventHandler ICommunicationObject.Opened { add { _serviceChannel.Opened += value; } remove { _serviceChannel.Opened -= value; } } event EventHandler ICommunicationObject.Opening { add { _serviceChannel.Opening += value; } remove { _serviceChannel.Opening -= value; } } void ICommunicationObject.Abort() { _serviceChannel.Abort(); } void ICommunicationObject.Close() { _serviceChannel.Close(); } void ICommunicationObject.Close(TimeSpan timeout) { _serviceChannel.Close(timeout); } IAsyncResult ICommunicationObject.BeginClose(AsyncCallback callback, object state) { return _serviceChannel.BeginClose(callback, state); } IAsyncResult ICommunicationObject.BeginClose(TimeSpan timeout, AsyncCallback callback, object state) { return _serviceChannel.BeginClose(timeout, callback, state); } void ICommunicationObject.EndClose(IAsyncResult result) { _serviceChannel.EndClose(result); } void ICommunicationObject.Open() { _serviceChannel.Open(); } void ICommunicationObject.Open(TimeSpan timeout) { _serviceChannel.Open(timeout); } IAsyncResult ICommunicationObject.BeginOpen(AsyncCallback callback, object state) { return _serviceChannel.BeginOpen(callback, state); } IAsyncResult ICommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, object state) { return _serviceChannel.BeginOpen(timeout, callback, state); } void ICommunicationObject.EndOpen(IAsyncResult result) { _serviceChannel.EndOpen(result); } bool IClientChannel.AllowInitializationUI { get { return ((IClientChannel)_serviceChannel).AllowInitializationUI; } set { ((IClientChannel)_serviceChannel).AllowInitializationUI = value; } } bool IClientChannel.DidInteractiveInitialization { get { return ((IClientChannel)_serviceChannel).DidInteractiveInitialization; } } Uri IClientChannel.Via { get { return _serviceChannel.Via; } } event EventHandler<UnknownMessageReceivedEventArgs> IClientChannel.UnknownMessageReceived { add { ((IClientChannel)_serviceChannel).UnknownMessageReceived += value; } remove { ((IClientChannel)_serviceChannel).UnknownMessageReceived -= value; } } IAsyncResult IClientChannel.BeginDisplayInitializationUI(AsyncCallback callback, object state) { return _serviceChannel.BeginDisplayInitializationUI(callback, state); } void IClientChannel.DisplayInitializationUI() { _serviceChannel.DisplayInitializationUI(); } void IClientChannel.EndDisplayInitializationUI(IAsyncResult result) { _serviceChannel.EndDisplayInitializationUI(result); } void IDisposable.Dispose() { ((IClientChannel)_serviceChannel).Dispose(); } bool IContextChannel.AllowOutputBatching { get { return ((IContextChannel)_serviceChannel).AllowOutputBatching; } set { ((IContextChannel)_serviceChannel).AllowOutputBatching = value; } } IInputSession IContextChannel.InputSession { get { return ((IContextChannel)_serviceChannel).InputSession; } } EndpointAddress IContextChannel.LocalAddress { get { return ((IContextChannel)_serviceChannel).LocalAddress; } } TimeSpan IContextChannel.OperationTimeout { get { return ((IContextChannel)_serviceChannel).OperationTimeout; } set { ((IContextChannel)_serviceChannel).OperationTimeout = value; } } IOutputSession IContextChannel.OutputSession { get { return ((IContextChannel)_serviceChannel).OutputSession; } } EndpointAddress IOutputChannel.RemoteAddress { get { return ((IContextChannel)_serviceChannel).RemoteAddress; } } Uri IOutputChannel.Via { get { return _serviceChannel.Via; } } EndpointAddress IContextChannel.RemoteAddress { get { return ((IContextChannel)_serviceChannel).RemoteAddress; } } string IContextChannel.SessionId { get { return ((IContextChannel)_serviceChannel).SessionId; } } IExtensionCollection<IContextChannel> IExtensibleObject<IContextChannel>.Extensions { get { return ((IContextChannel)_serviceChannel).Extensions; } } IAsyncResult IOutputChannel.BeginSend(Message message, AsyncCallback callback, object state) { return _serviceChannel.BeginSend(message, callback, state); } IAsyncResult IOutputChannel.BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) { return _serviceChannel.BeginSend(message, timeout, callback, state); } void IOutputChannel.EndSend(IAsyncResult result) { _serviceChannel.EndSend(result); } void IOutputChannel.Send(Message message) { _serviceChannel.Send(message); } void IOutputChannel.Send(Message message, TimeSpan timeout) { _serviceChannel.Send(message, timeout); } Message IRequestChannel.Request(Message message) { return _serviceChannel.Request(message); } Message IRequestChannel.Request(Message message, TimeSpan timeout) { return _serviceChannel.Request(message, timeout); } IAsyncResult IRequestChannel.BeginRequest(Message message, AsyncCallback callback, object state) { return _serviceChannel.BeginRequest(message, callback, state); } IAsyncResult IRequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state) { return _serviceChannel.BeginRequest(message, timeout, callback, state); } Message IRequestChannel.EndRequest(IAsyncResult result) { return _serviceChannel.EndRequest(result); } EndpointAddress IRequestChannel.RemoteAddress { get { return ((IContextChannel)_serviceChannel).RemoteAddress; } } Uri IRequestChannel.Via { get { return _serviceChannel.Via; } } Uri IServiceChannel.ListenUri { get { return _serviceChannel.ListenUri; } } #endregion // Channel interfaces } }
package org.openqa.selenium.grid.router; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openqa.selenium.Capabilities; import org.openqa.selenium.ImmutableCapabilities; import org.openqa.selenium.SessionNotCreatedException; import org.openqa.selenium.events.EventBus; import org.openqa.selenium.events.local.GuavaEventBus; import org.openqa.selenium.grid.data.Availability; import org.openqa.selenium.grid.data.CreateSessionResponse; import org.openqa.selenium.grid.data.DefaultSlotMatcher; import org.openqa.selenium.grid.data.RequestId; import org.openqa.selenium.grid.data.Session; import org.openqa.selenium.grid.data.SessionRequest; import org.openqa.selenium.grid.distributor.Distributor; import org.openqa.selenium.grid.distributor.local.LocalDistributor; import org.openqa.selenium.grid.distributor.selector.DefaultSlotSelector; import org.openqa.selenium.grid.node.HealthCheck; import org.openqa.selenium.grid.node.Node; import org.openqa.selenium.grid.node.local.LocalNode; import org.openqa.selenium.grid.security.Secret; import org.openqa.selenium.grid.sessionmap.SessionMap; import org.openqa.selenium.grid.sessionmap.local.LocalSessionMap; import org.openqa.selenium.grid.sessionqueue.NewSessionQueue; import org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue; import org.openqa.selenium.grid.testing.PassthroughHttpClient; import org.openqa.selenium.grid.testing.TestSessionFactory; import org.openqa.selenium.grid.web.CombinedHandler; import org.openqa.selenium.grid.web.Values; import org.openqa.selenium.internal.Either; import org.openqa.selenium.remote.http.HttpClient; import org.openqa.selenium.remote.http.HttpRequest; import org.openqa.selenium.remote.http.HttpResponse; import org.openqa.selenium.remote.tracing.DefaultTestTracer; import org.openqa.selenium.remote.tracing.Tracer; import org.openqa.selenium.support.ui.FluentWait; import java.net.URI; import java.net.URISyntaxException; import java.time.Duration; import java.time.Instant; import java.util.List; import java.util.Map; import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.openqa.selenium.grid.data.Availability.DOWN; import static org.openqa.selenium.grid.data.Availability.UP; import static org.openqa.selenium.json.Json.MAP_TYPE; import static org.openqa.selenium.remote.Dialect.OSS; import static org.openqa.selenium.remote.Dialect.W3C; import static org.openqa.selenium.remote.http.HttpMethod.GET; class RouterTest { private Tracer tracer; private EventBus bus; private Distributor distributor; private Router router; private Secret registrationSecret; private static Map<String, Object> getStatus(Router router) { HttpResponse response = router.execute(new HttpRequest(GET, "/status")); Map<String, Object> status = Values.get(response, MAP_TYPE); assertNotNull(status); return status; } private static void waitUntilReady(Router router, Duration duration) { waitUntilStatus(router, duration, Boolean.TRUE); } private static void waitUntilNotReady(Router router, Duration duration) { waitUntilStatus(router, duration, Boolean.FALSE); } private static void waitUntilStatus(Router router, Duration duration, Boolean ready) { new FluentWait<>(router) .withTimeout(duration) .pollingEvery(Duration.ofMillis(100)) .until(r -> { Map<String, Object> status = getStatus(router); return ready.equals(status.get("ready")); }); } @BeforeEach public void setUp() { tracer = DefaultTestTracer.createTracer(); bus = new GuavaEventBus(); CombinedHandler handler = new CombinedHandler(); HttpClient.Factory clientFactory = new PassthroughHttpClient.Factory(handler); SessionMap sessions = new LocalSessionMap(tracer, bus); handler.addHandler(sessions); registrationSecret = new Secret("stinking bishop"); NewSessionQueue queue = new LocalNewSessionQueue( tracer, new DefaultSlotMatcher(), Duration.ofSeconds(2), Duration.ofSeconds(2), registrationSecret, 5); handler.addHandler(queue); distributor = new LocalDistributor( tracer, bus, clientFactory, sessions, queue, new DefaultSlotSelector(), registrationSecret, Duration.ofSeconds(1), false, Duration.ofSeconds(5), Runtime.getRuntime().availableProcessors()); handler.addHandler(distributor); router = new Router(tracer, clientFactory, sessions, queue, distributor); } @Test void shouldListAnEmptyDistributorAsMeaningTheGridIsNotReady() { Map<String, Object> status = getStatus(router); assertFalse((Boolean) status.get("ready")); } @Test void addingANodeThatIsDownMeansTheGridIsNotReady() throws URISyntaxException { Capabilities capabilities = new ImmutableCapabilities("cheese", "amsterdam"); URI uri = new URI("https://example.com"); AtomicReference<Availability> isUp = new AtomicReference<>(UP); Node node = getNode(capabilities, uri, isUp); distributor.add(node); waitUntilReady(router, Duration.ofSeconds(5)); isUp.set(DOWN); waitUntilNotReady(router, Duration.ofSeconds(5)); Map<String, Object> status = getStatus(router); assertFalse((Boolean) status.get("ready"), status.toString()); } @Test void aNodeThatIsUpAndHasSpareSessionsMeansTheGridIsReady() throws URISyntaxException { Capabilities capabilities = new ImmutableCapabilities("cheese", "peas"); URI uri = new URI("https://example.com"); Node node = getNode(capabilities, uri, new AtomicReference<>(UP)); distributor.add(node); waitUntilReady(router, Duration.ofSeconds(5)); } @Test void shouldListAllNodesTheDistributorIsAwareOf() throws URISyntaxException { Capabilities chromeCapabilities = new ImmutableCapabilities("browser", "chrome"); Capabilities firefoxCapabilities = new ImmutableCapabilities("browser", "firefox"); URI firstNodeUri = new URI("https://example1.com"); URI secondNodeUri = new URI("https://example2.com"); AtomicReference<Availability> isUp = new AtomicReference<>(UP); Node firstNode = LocalNode.builder(tracer, bus, firstNodeUri, firstNodeUri, registrationSecret) .add(chromeCapabilities, new TestSessionFactory( (id, caps) -> new Session(id, firstNodeUri, new ImmutableCapabilities(), caps, Instant.now()))) .advanced() .healthCheck(() -> new HealthCheck.Result(isUp.get(), "TL;DR")) .build(); Node secondNode = LocalNode.builder(tracer, bus, secondNodeUri, secondNodeUri, registrationSecret) .add(firefoxCapabilities, new TestSessionFactory( (id, caps) -> new Session(id, secondNodeUri, new ImmutableCapabilities(), caps, Instant.now()))) .advanced() .healthCheck(() -> new HealthCheck.Result(isUp.get(), "TL;DR")) .build(); distributor.add(firstNode); distributor.add(secondNode); waitUntilReady(router, Duration.ofSeconds(5)); Map<String, Object> status = getStatus(router); @SuppressWarnings("unchecked") List<Map<String, Object>> nodes = (List<Map<String, Object>>) status.get("nodes"); assertEquals(2, nodes.size()); String firstNodeId = (String) nodes.get(0).get("id"); String secondNodeId = (String) nodes.get(1).get("id"); assertNotEquals(firstNodeId, secondNodeId); } @Test void ifNodesHaveSpareSlotsButAlreadyHaveMaxSessionsGridIsNotReady() throws URISyntaxException { Capabilities chromeCapabilities = new ImmutableCapabilities("browser", "chrome"); Capabilities firefoxCapabilities = new ImmutableCapabilities("browser", "firefox"); URI uri = new URI("https://example.com"); AtomicReference<Availability> isUp = new AtomicReference<>(UP); Node node = LocalNode.builder(tracer, bus, uri, uri, registrationSecret) .add(chromeCapabilities, new TestSessionFactory( (id, caps) -> new Session(id, uri, new ImmutableCapabilities(), caps, Instant.now()))) .add(firefoxCapabilities, new TestSessionFactory( (id, caps) -> new Session(id, uri, new ImmutableCapabilities(), caps, Instant.now()))) .maximumConcurrentSessions(1) .advanced() .healthCheck(() -> new HealthCheck.Result(isUp.get(), "TL;DR")) .build(); distributor.add(node); waitUntilReady(router, Duration.ofSeconds(5)); Map<String, Object> status = getStatus(router); assertTrue((Boolean) status.get("ready"), status.toString()); SessionRequest sessionRequest = new SessionRequest( new RequestId(UUID.randomUUID()), Instant.now(), ImmutableSet.of(OSS, W3C), ImmutableSet.of(chromeCapabilities), ImmutableMap.of(), ImmutableMap.of()); Either<SessionNotCreatedException, CreateSessionResponse> response = distributor.newSession(sessionRequest); assertTrue(response.isRight()); Session session = response.right().getSession(); assertThat(session).isNotNull(); waitUntilNotReady(router, Duration.ofSeconds(5)); } private Node getNode(Capabilities capabilities, URI uri, AtomicReference<Availability> availability) { return LocalNode.builder(tracer, bus, uri, uri, registrationSecret) .add(capabilities, new TestSessionFactory( (id, caps) -> new Session(id, uri, new ImmutableCapabilities(), caps, Instant.now()))) .advanced() .healthCheck(() -> new HealthCheck.Result(availability.get(), "TL;DR")) .build(); } }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
import * as gulpLoadPlugins from 'gulp-load-plugins'; import { join } from 'path'; import ts = require('gulp-typescript/release/main'); import Config from '../../config'; const plugins = <any>gulpLoadPlugins(); let tsProjects: any = {}; /** * Creates a TypeScript project with the given options using the gulp typescript plugin. * @param {Object} options - The additional options for the project configuration. */ export function makeTsProject(options: ts.Settings = {}, pathToTsConfig: string = Config.APP_SRC, projectName = Config.APP_PROJECTNAME) { let optionsHash = JSON.stringify(options); if (!tsProjects[optionsHash]) { let config = Object.assign({ typescript: require('typescript') }, options); tsProjects[optionsHash] = plugins.typescript.createProject(join(pathToTsConfig, projectName), config); } return tsProjects[optionsHash]; }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Roslyn.Diagnostics.Analyzers { internal static class RoslynDiagnosticIds { public const string UseEmptyEnumerableRuleId = "RS0001"; public const string UseSingletonEnumerableRuleId = "RS0002"; public const string DirectlyAwaitingTaskAnalyzerRuleId = "RS0003"; public const string UseSiteDiagnosticsCheckerRuleId = "RS0004"; public const string DontUseCodeActionCreateRuleId = "RS0005"; public const string MixedVersionsOfMefAttributesRuleId = "RS0006"; public const string UseArrayEmptyRuleId = "RS0007"; public const string ImplementIEquatableRuleId = "RS0008"; public const string OverrideObjectEqualsRuleId = "RS0009"; public const string MissingSharedAttributeRuleId = "RS0010"; public const string DoNotUseVerbatimCrefsRuleId = "RS0010"; public const string CancellationTokenMustBeLastRuleId = "RS0011"; public const string DoNotCallToImmutableArrayRuleId = "RS0012"; public const string DoNotAccessDiagnosticDescriptorRuleId = "RS0013"; public const string DoNotCallLinqOnIndexable = "RS0014"; public const string ConsumePreserveSigRuleId = "RS0015"; public const string DeclarePublicApiRuleId = "RS0016"; public const string RemoveDeletedApiRuleId = "RS0017"; public const string DoNotCreateTasksWithoutTaskSchedulerRuleId = "RS0018"; public const string SymbolDeclaredEventRuleId = "RS0019"; public const string DeadCodeRuleId = "RS0020"; public const string DeadCodeTriggerRuleId = "RS0021"; public const string ExposedNoninstantiableTypeRuleId = "RS0022"; } }
#ifndef _TASK_H_ #define _TASK_H_ 1 #ifdef __cplusplus extern "C" { #endif #include <stdarg.h> #include <unistd.h> #include <inttypes.h> #include "zmq_compat.h" struct tns_value_t; /* * basic procs and threads */ typedef struct Task Task; typedef struct Tasklist Tasklist; #define MAX_STATE_LENGTH 30 int anyready(void); int taskcreate(void (*f)(void *arg), void *arg, unsigned int stacksize); void taskexit(int); void taskexitall(int); void taskmain(int argc, char *argv[]); int taskyield(void); void** taskdata(void); void needstack(int); void taskname(char*); void taskstate(char*); char* taskgetname(void); char* taskgetstate(void); struct tns_value_t *taskgetinfo(void); void tasksystem(void); unsigned int taskdelay(unsigned int); unsigned int taskid(void); unsigned int taskgetid(Task *task); int taskwaiting(); int tasksrunning(); void taskready(Task *t); Task *taskself(); void taskswitch(); struct Tasklist /* used internally */ { Task *head; Task *tail; }; /** Signal management. **/ int tasksignal(Task *task, int signal); int task_was_signaled(); void task_clear_signal(); int taskallsignal(int signal); /* * queuing locks */ typedef struct QLock QLock; struct QLock { Task *owner; Tasklist waiting; }; void qlock(QLock*); int canqlock(QLock*); void qunlock(QLock*); /* * reader-writer locks */ typedef struct RWLock RWLock; struct RWLock { int readers; Task *writer; Tasklist rwaiting; Tasklist wwaiting; }; void rlock(RWLock*); int canrlock(RWLock*); void runlock(RWLock*); void wlock(RWLock*); int canwlock(RWLock*); void wunlock(RWLock*); /* * sleep and wakeup (condition variables) */ typedef struct Rendez Rendez; struct Rendez { QLock *l; Tasklist waiting; }; void tasksleep(Rendez*); int taskwakeup(Rendez*); int taskwakeupall(Rendez*); int taskbarrier(Rendez *r); /* * Threaded I/O. */ int fdread(int, void*, int); int fdread1(int, void*, int); /* always uses fdwait */ int fdrecv1(int, void*, int); /* always uses fdwait */ int fdwrite(int, void*, int); int fdsend(int, void*, int); int fdrecv(int, void*, int); int fdwait(int, int); int fdnoblock(int); void fdshutdown(); extern Task *FDTASK; #define fdclose(fd) if(fd >= 0) close(fd) void fdtask(void*); /* * 0mq Integration. */ void mqinit(int threads); void *mqsocket(int type); int mqwait(void *socket, int rw); int mqrecv(void *socket, zmq_msg_t *msg, int flags); int mqsend(void *socket, zmq_msg_t *msg, int flags); extern void *ZMQ_CTX; /* * Network dialing - sets non-blocking automatically */ enum { UDP = 0, TCP = 1, }; int netannounce(int, char*, int); int netaccept(int, char*, int*); int netdial(int, char*, int); int netlookup(char*, uint32_t*); /* blocks entire program! */ #ifdef __cplusplus } #endif #endif
(function() { 'use strict'; var hello = function () { return "hello"; } module.exports = hello; }()); // benalman.com/news/2010/11/immediately-invoked-function-expression
<?php namespace ZendTest\Db\Adapter\Driver\IbmDb2; use Zend\Db\Adapter\Driver\IbmDb2\IbmDb2; use Zend\Db\Adapter\Driver\IbmDb2\Connection; class ConnectionTest extends \PHPUnit_Framework_TestCase { /** * @var Connection */ protected $connection; /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this->connection = new Connection(array()); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown() { } /** * @covers Zend\Db\Adapter\Driver\IbmDb2\Connection::setDriver */ public function testSetDriver() { $this->assertEquals($this->connection, $this->connection->setDriver(new IbmDb2(array()))); } /** * @covers Zend\Db\Adapter\Driver\IbmDb2\Connection::setConnectionParameters */ public function testSetConnectionParameters() { $this->assertEquals($this->connection, $this->connection->setConnectionParameters(array())); } /** * @covers Zend\Db\Adapter\Driver\IbmDb2\Connection::getConnectionParameters */ public function testGetConnectionParameters() { $this->connection->setConnectionParameters(array('foo' => 'bar')); $this->assertEquals(array('foo' => 'bar'), $this->connection->getConnectionParameters()); } }
it("should run a multi compiler", function() { });
<?php namespace Mockery; class MethodCall { private $method; private $args; public function __construct($method, $args) { $this->method = $method; $this->args = $args; } public function getMethod() { return $this->method; } public function getArgs() { return $this->args; } }
<!-- This is a static template file, so it doesn't have an associated app. It is rendered by the server via a staticPages renderer. Since static pages don't include the Derby client library, they can't have bound variables that automatically update. However, they do support initial template tag rendering from a context object and/or model. --> <Title:> Not found <Body:> <h1>404</h1> <p>Sorry, we can't find anything at <b>{{url}}</b>. <p>Try heading back to the <a href="/">home page</a>.
<!DOCTYPE html> <html> <link href="resources/grid.css" rel="stylesheet"> <style> .grid { grid-template-columns: 100px 300px; grid-template-rows: 50px 150px; height: 200px; width: 400px; } .percentWidth { width: 100%; height: 15px; } .percentHeight { width: 15px; height: 100%; } .percentHeightAndWidth { width: 100%; height: 100%; } </style> <script src="../../resources/check-layout.js"></script> <body onload="checkLayout('.grid')"> <p>Test that resolving percent lengths on grid items works properly on a fixed grid with different writing modes.</p> <div class="grid"> <div class="firstRowFirstColumn percentWidth" data-expected-width="100" data-expected-height="15"></div> <div class="firstRowSecondColumn percentHeight" data-expected-width="15" data-expected-height="50"></div> <div class="secondRowFirstColumn percentHeightAndWidth" data-expected-width="100" data-expected-height="150"></div> <div class="secondRowSecondColumn percentHeightAndWidth" data-expected-width="300" data-expected-height="150"></div> </div> <div class="grid verticalRL"> <div class="firstRowFirstColumn percentWidth" data-expected-width="50" data-expected-height="15"></div> <div class="firstRowSecondColumn percentHeight" data-expected-width="15" data-expected-height="300"></div> <div class="secondRowFirstColumn percentHeightAndWidth" data-expected-width="150" data-expected-height="100"></div> <div class="secondRowSecondColumn percentHeightAndWidth" data-expected-width="150" data-expected-height="300"></div> </div> <div class="grid"> <div class="firstRowFirstColumn percentWidth verticalRL" data-expected-width="100" data-expected-height="15"></div> <div class="firstRowSecondColumn percentHeight verticalRL" data-expected-width="15" data-expected-height="50"></div> <div class="secondRowFirstColumn percentHeightAndWidth verticalRL" data-expected-width="100" data-expected-height="150"></div> <div class="secondRowSecondColumn percentHeightAndWidth verticalRL" data-expected-width="300" data-expected-height="150"></div> </div> <div class="grid"> <div class="firstRowFirstColumn percentWidth verticalRL" data-expected-width="100" data-expected-height="15"></div> <div class="firstRowSecondColumn percentHeight" data-expected-width="15" data-expected-height="50"></div> <div class="secondRowFirstColumn percentHeightAndWidth verticalRL" data-expected-width="100" data-expected-height="150"></div> <div class="secondRowSecondColumn percentHeightAndWidth" data-expected-width="300" data-expected-height="150"></div> </div> </body> </html>
#include "../../SDL_internal.h" #ifdef SDL_FILESYSTEM_COCOA /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ #include <Foundation/Foundation.h> #include <sys/stat.h> #include <sys/types.h> #include "SDL_error.h" #include "SDL_stdinc.h" #include "SDL_filesystem.h" char * SDL_GetBasePath(void) { @autoreleasepool { NSBundle *bundle = [NSBundle mainBundle]; const char* baseType = [[[bundle infoDictionary] objectForKey:@"SDL_FILESYSTEM_BASE_DIR_TYPE"] UTF8String]; const char *base = NULL; char *retval = NULL; if (baseType == NULL) { baseType = "resource"; } if (SDL_strcasecmp(baseType, "bundle")==0) { base = [[bundle bundlePath] fileSystemRepresentation]; } else if (SDL_strcasecmp(baseType, "parent")==0) { base = [[[bundle bundlePath] stringByDeletingLastPathComponent] fileSystemRepresentation]; } else { /* this returns the exedir for non-bundled and the resourceDir for bundled apps */ base = [[bundle resourcePath] fileSystemRepresentation]; } if (base) { const size_t len = SDL_strlen(base) + 2; retval = (char *) SDL_malloc(len); if (retval == NULL) { SDL_OutOfMemory(); } else { SDL_snprintf(retval, len, "%s/", base); } } return retval; }} char * SDL_GetPrefPath(const char *org, const char *app) { @autoreleasepool { char *retval = NULL; NSArray *array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); if ([array count] > 0) { /* we only want the first item in the list. */ NSString *str = [array objectAtIndex:0]; const char *base = [str fileSystemRepresentation]; if (base) { const size_t len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4; retval = (char *) SDL_malloc(len); if (retval == NULL) { SDL_OutOfMemory(); } else { char *ptr; SDL_snprintf(retval, len, "%s/%s/%s/", base, org, app); for (ptr = retval+1; *ptr; ptr++) { if (*ptr == '/') { *ptr = '\0'; mkdir(retval, 0700); *ptr = '/'; } } mkdir(retval, 0700); } } } return retval; }} #endif /* SDL_FILESYSTEM_COCOA */ /* vi: set ts=4 sw=4 expandtab: */
package org.apache.hadoop.util; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.jar.Manifest; import java.util.regex.Pattern; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.io.IOUtils; /** Run a Hadoop job jar. */ @InterfaceAudience.Private @InterfaceStability.Unstable public class RunJar { /** Pattern that matches any string */ public static final Pattern MATCH_ANY = Pattern.compile(".*"); /** * Priority of the RunJar shutdown hook. */ public static final int SHUTDOWN_HOOK_PRIORITY = 10; /** * Environment key for using the client classloader. */ public static final String HADOOP_USE_CLIENT_CLASSLOADER = "HADOOP_USE_CLIENT_CLASSLOADER"; /** * Environment key for the (user-provided) hadoop classpath. */ public static final String HADOOP_CLASSPATH = "HADOOP_CLASSPATH"; /** * Environment key for the system classes. */ public static final String HADOOP_CLIENT_CLASSLOADER_SYSTEM_CLASSES = "HADOOP_CLIENT_CLASSLOADER_SYSTEM_CLASSES"; /** * Unpack a jar file into a directory. * * This version unpacks all files inside the jar regardless of filename. */ public static void unJar(File jarFile, File toDir) throws IOException { unJar(jarFile, toDir, MATCH_ANY); } /** * Unpack matching files from a jar. Entries inside the jar that do * not match the given pattern will be skipped. * * @param jarFile the .jar file to unpack * @param toDir the destination directory into which to unpack the jar * @param unpackRegex the pattern to match jar entries against */ public static void unJar(File jarFile, File toDir, Pattern unpackRegex) throws IOException { JarFile jar = new JarFile(jarFile); try { Enumeration<JarEntry> entries = jar.entries(); while (entries.hasMoreElements()) { final JarEntry entry = entries.nextElement(); if (!entry.isDirectory() && unpackRegex.matcher(entry.getName()).matches()) { InputStream in = jar.getInputStream(entry); try { File file = new File(toDir, entry.getName()); ensureDirectory(file.getParentFile()); OutputStream out = new FileOutputStream(file); try { IOUtils.copyBytes(in, out, 8192); } finally { out.close(); } } finally { in.close(); } } } } finally { jar.close(); } } /** * Ensure the existence of a given directory. * * @throws IOException if it cannot be created and does not already exist */ private static void ensureDirectory(File dir) throws IOException { if (!dir.mkdirs() && !dir.isDirectory()) { throw new IOException("Mkdirs failed to create " + dir.toString()); } } /** Run a Hadoop job jar. If the main class is not in the jar's manifest, * then it must be provided on the command line. */ public static void main(String[] args) throws Throwable { new RunJar().run(args); } public void run(String[] args) throws Throwable { String usage = "RunJar jarFile [mainClass] args..."; if (args.length < 1) { System.err.println(usage); System.exit(-1); } int firstArg = 0; String fileName = args[firstArg++]; File file = new File(fileName); if (!file.exists() || !file.isFile()) { System.err.println("JAR does not exist or is not a normal file: " + file.getCanonicalPath()); System.exit(-1); } String mainClassName = null; JarFile jarFile; try { jarFile = new JarFile(fileName); } catch(IOException io) { throw new IOException("Error opening job jar: " + fileName) .initCause(io); } Manifest manifest = jarFile.getManifest(); if (manifest != null) { mainClassName = manifest.getMainAttributes().getValue("Main-Class"); } jarFile.close(); if (mainClassName == null) { if (args.length < 2) { System.err.println(usage); System.exit(-1); } mainClassName = args[firstArg++]; } mainClassName = mainClassName.replaceAll("/", "."); File tmpDir = new File(System.getProperty("java.io.tmpdir")); ensureDirectory(tmpDir); final File workDir; try { workDir = File.createTempFile("hadoop-unjar", "", tmpDir); } catch (IOException ioe) { // If user has insufficient perms to write to tmpDir, default // "Permission denied" message doesn't specify a filename. System.err.println("Error creating temp dir in java.io.tmpdir " + tmpDir + " due to " + ioe.getMessage()); System.exit(-1); return; } if (!workDir.delete()) { System.err.println("Delete failed for " + workDir); System.exit(-1); } ensureDirectory(workDir); ShutdownHookManager.get().addShutdownHook( new Runnable() { @Override public void run() { FileUtil.fullyDelete(workDir); } }, SHUTDOWN_HOOK_PRIORITY); unJar(file, workDir); ClassLoader loader = createClassLoader(file, workDir); Thread.currentThread().setContextClassLoader(loader); Class<?> mainClass = Class.forName(mainClassName, true, loader); Method main = mainClass.getMethod("main", new Class[] { Array.newInstance(String.class, 0).getClass() }); String[] newArgs = Arrays.asList(args) .subList(firstArg, args.length).toArray(new String[0]); try { main.invoke(null, new Object[] { newArgs }); } catch (InvocationTargetException e) { throw e.getTargetException(); } } /** * Creates a classloader based on the environment that was specified by the * user. If HADOOP_USE_CLIENT_CLASSLOADER is specified, it creates an * application classloader that provides the isolation of the user class space * from the hadoop classes and their dependencies. It forms a class space for * the user jar as well as the HADOOP_CLASSPATH. Otherwise, it creates a * classloader that simply adds the user jar to the classpath. */ private ClassLoader createClassLoader(File file, final File workDir) throws MalformedURLException { ClassLoader loader; // see if the client classloader is enabled if (useClientClassLoader()) { StringBuilder sb = new StringBuilder(); sb.append(workDir+"/"). append(File.pathSeparator).append(file). append(File.pathSeparator).append(workDir+"/classes/"). append(File.pathSeparator).append(workDir+"/lib/*"); // HADOOP_CLASSPATH is added to the client classpath String hadoopClasspath = getHadoopClasspath(); if (hadoopClasspath != null && !hadoopClasspath.isEmpty()) { sb.append(File.pathSeparator).append(hadoopClasspath); } String clientClasspath = sb.toString(); // get the system classes String systemClasses = getSystemClasses(); List<String> systemClassesList = systemClasses == null ? null : Arrays.asList(StringUtils.getTrimmedStrings(systemClasses)); // create an application classloader that isolates the user classes loader = new ApplicationClassLoader(clientClasspath, getClass().getClassLoader(), systemClassesList); } else { List<URL> classPath = new ArrayList<URL>(); classPath.add(new File(workDir+"/").toURI().toURL()); classPath.add(file.toURI().toURL()); classPath.add(new File(workDir, "classes/").toURI().toURL()); File[] libs = new File(workDir, "lib").listFiles(); if (libs != null) { for (int i = 0; i < libs.length; i++) { classPath.add(libs[i].toURI().toURL()); } } // create a normal parent-delegating classloader loader = new URLClassLoader(classPath.toArray(new URL[0])); } return loader; } boolean useClientClassLoader() { return Boolean.parseBoolean(System.getenv(HADOOP_USE_CLIENT_CLASSLOADER)); } String getHadoopClasspath() { return System.getenv(HADOOP_CLASSPATH); } String getSystemClasses() { return System.getenv(HADOOP_CLIENT_CLASSLOADER_SYSTEM_CLASSES); } }
package org.vertexium.cypher.tck; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; import org.junit.runner.RunWith; @RunWith(Cucumber.class) @CucumberOptions( format = "pretty", features = "classpath:org/vertexium/cypher/tck/features/TriadicSelection.feature", glue = "org.vertexium.cypher.glue" ) public class TriadicSelectionTest { }
package org.elasticsearch.transport; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.elasticsearch.action.Action; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionModule; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.indexedscripts.put.PutIndexedScriptRequest; import org.elasticsearch.action.indexedscripts.put.PutIndexedScriptResponse; import org.elasticsearch.action.percolate.PercolateResponse; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.ActionFilter; import org.elasticsearch.action.termvectors.MultiTermVectorsRequest; import org.elasticsearch.client.Client; import org.elasticsearch.client.FilterClient; import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.GeoShapeQueryBuilder; import org.elasticsearch.index.query.MoreLikeThisQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.TermsLookupQueryBuilder; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestController; import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.groovy.GroovyScriptEngineService; import org.elasticsearch.script.mustache.MustacheScriptEngineService; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.elasticsearch.test.rest.client.http.HttpResponse; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS; import static org.elasticsearch.common.settings.Settings.settingsBuilder; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.node.Node.HTTP_ENABLED; import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.hasStatus; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; @ClusterScope(scope = SUITE) public class ContextAndHeaderTransportIT extends ESIntegTestCase { private static final List<ActionRequest> requests = new CopyOnWriteArrayList<>(); private String randomHeaderKey = randomAsciiOfLength(10); private String randomHeaderValue = randomAsciiOfLength(20); private String queryIndex = "query-" + randomAsciiOfLength(10).toLowerCase(Locale.ROOT); private String lookupIndex = "lookup-" + randomAsciiOfLength(10).toLowerCase(Locale.ROOT); @Override protected Settings nodeSettings(int nodeOrdinal) { return settingsBuilder() .put(super.nodeSettings(nodeOrdinal)) .put("plugin.types", ActionLoggingPlugin.class.getName()) .put("script.indexed", "on") .put(HTTP_ENABLED, true) .build(); } @Before public void createIndices() throws Exception { String mapping = jsonBuilder().startObject().startObject("type") .startObject("properties") .startObject("location").field("type", "geo_shape").endObject() .startObject("name").field("type", "string").endObject() .endObject() .endObject().endObject().string(); Settings settings = settingsBuilder() .put(indexSettings()) .put(SETTING_NUMBER_OF_SHARDS, 1) // A single shard will help to keep the tests repeatable. .build(); assertAcked(transportClient().admin().indices().prepareCreate(lookupIndex) .setSettings(settings).addMapping("type", mapping)); assertAcked(transportClient().admin().indices().prepareCreate(queryIndex) .setSettings(settings).addMapping("type", mapping)); ensureGreen(queryIndex, lookupIndex); requests.clear(); } @After public void checkAllRequestsContainHeaders() { assertRequestsContainHeader(IndexRequest.class); assertRequestsContainHeader(RefreshRequest.class); } @Test public void testThatTermsLookupGetRequestContainsContextAndHeaders() throws Exception { transportClient().prepareIndex(lookupIndex, "type", "1") .setSource(jsonBuilder().startObject().array("followers", "foo", "bar", "baz").endObject()).get(); transportClient().prepareIndex(queryIndex, "type", "1") .setSource(jsonBuilder().startObject().field("username", "foo").endObject()).get(); transportClient().admin().indices().prepareRefresh(queryIndex, lookupIndex).get(); TermsLookupQueryBuilder termsLookupFilterBuilder = QueryBuilders.termsLookupQuery("username").lookupIndex(lookupIndex).lookupType("type").lookupId("1").lookupPath("followers"); BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery().must(QueryBuilders.matchAllQuery()).must(termsLookupFilterBuilder); SearchResponse searchResponse = transportClient() .prepareSearch(queryIndex) .setQuery(queryBuilder) .get(); assertNoFailures(searchResponse); assertHitCount(searchResponse, 1); assertGetRequestsContainHeaders(); } @Test public void testThatGeoShapeQueryGetRequestContainsContextAndHeaders() throws Exception { transportClient().prepareIndex(lookupIndex, "type", "1").setSource(jsonBuilder().startObject() .field("name", "Munich Suburban Area") .startObject("location") .field("type", "polygon") .startArray("coordinates").startArray() .startArray().value(11.34).value(48.25).endArray() .startArray().value(11.68).value(48.25).endArray() .startArray().value(11.65).value(48.06).endArray() .startArray().value(11.37).value(48.13).endArray() .startArray().value(11.34).value(48.25).endArray() // close the polygon .endArray().endArray() .endObject() .endObject()) .get(); // second document transportClient().prepareIndex(queryIndex, "type", "1").setSource(jsonBuilder().startObject() .field("name", "Munich Center") .startObject("location") .field("type", "point") .startArray("coordinates").value(11.57).value(48.13).endArray() .endObject() .endObject()) .get(); transportClient().admin().indices().prepareRefresh(lookupIndex, queryIndex).get(); GeoShapeQueryBuilder queryBuilder = QueryBuilders.geoShapeQuery("location", "1", "type") .indexedShapeIndex(lookupIndex) .indexedShapePath("location"); SearchResponse searchResponse = transportClient() .prepareSearch(queryIndex) .setQuery(queryBuilder) .get(); assertNoFailures(searchResponse); assertHitCount(searchResponse, 1); assertThat(requests, hasSize(greaterThan(0))); assertGetRequestsContainHeaders(); } @Test public void testThatMoreLikeThisQueryMultiTermVectorRequestContainsContextAndHeaders() throws Exception { transportClient().prepareIndex(lookupIndex, "type", "1") .setSource(jsonBuilder().startObject().field("name", "Star Wars - The new republic").endObject()) .get(); transportClient().prepareIndex(queryIndex, "type", "1") .setSource(jsonBuilder().startObject().field("name", "Jar Jar Binks - A horrible mistake").endObject()) .get(); transportClient().prepareIndex(queryIndex, "type", "2") .setSource(jsonBuilder().startObject().field("name", "Star Wars - Return of the jedi").endObject()) .get(); transportClient().admin().indices().prepareRefresh(lookupIndex, queryIndex).get(); MoreLikeThisQueryBuilder moreLikeThisQueryBuilder = QueryBuilders.moreLikeThisQuery("name") .addItem(new MoreLikeThisQueryBuilder.Item(lookupIndex, "type", "1")) .minTermFreq(1) .minDocFreq(1); SearchResponse searchResponse = transportClient() .prepareSearch(queryIndex) .setQuery(moreLikeThisQueryBuilder) .get(); assertNoFailures(searchResponse); assertHitCount(searchResponse, 1); assertRequestsContainHeader(MultiTermVectorsRequest.class); } @Test public void testThatPercolatingExistingDocumentGetRequestContainsContextAndHeaders() throws Exception { transportClient().prepareIndex(lookupIndex, ".percolator", "1") .setSource(jsonBuilder().startObject().startObject("query").startObject("match").field("name", "star wars").endObject().endObject().endObject()) .get(); transportClient().prepareIndex(lookupIndex, "type", "1") .setSource(jsonBuilder().startObject().field("name", "Star Wars - The new republic").endObject()) .get(); transportClient().admin().indices().prepareRefresh(lookupIndex).get(); GetRequest getRequest = transportClient().prepareGet(lookupIndex, "type", "1").request(); PercolateResponse response = transportClient().preparePercolate().setDocumentType("type").setGetRequest(getRequest).get(); assertThat(response.getCount(), is(1l)); assertGetRequestsContainHeaders(); } @Test public void testThatIndexedScriptGetRequestContainsContextAndHeaders() throws Exception { PutIndexedScriptResponse scriptResponse = transportClient().preparePutIndexedScript(GroovyScriptEngineService.NAME, "my_script", jsonBuilder().startObject().field("script", "_score * 10").endObject().string() ).get(); assertThat(scriptResponse.isCreated(), is(true)); transportClient().prepareIndex(queryIndex, "type", "1") .setSource(jsonBuilder().startObject().field("name", "Star Wars - The new republic").endObject()) .get(); transportClient().admin().indices().prepareRefresh(queryIndex).get(); // custom content, not sure how to specify "script_id" otherwise in the API XContentBuilder builder = jsonBuilder().startObject().startObject("function_score").field("boost_mode", "replace").startArray("functions") .startObject().startObject("script_score").field("script_id", "my_script").field("lang", "groovy").endObject().endObject().endArray().endObject().endObject(); SearchResponse searchResponse = transportClient() .prepareSearch(queryIndex) .setQuery(builder) .get(); assertNoFailures(searchResponse); assertHitCount(searchResponse, 1); assertThat(searchResponse.getHits().getMaxScore(), is(10.0f)); assertGetRequestsContainHeaders(".scripts"); assertRequestsContainHeader(PutIndexedScriptRequest.class); } @Test public void testThatSearchTemplatesWithIndexedTemplatesGetRequestContainsContextAndHeaders() throws Exception { PutIndexedScriptResponse scriptResponse = transportClient().preparePutIndexedScript(MustacheScriptEngineService.NAME, "the_template", jsonBuilder().startObject().startObject("template").startObject("query").startObject("match") .field("name", "{{query_string}}").endObject().endObject().endObject().endObject().string() ).get(); assertThat(scriptResponse.isCreated(), is(true)); transportClient().prepareIndex(queryIndex, "type", "1") .setSource(jsonBuilder().startObject().field("name", "Star Wars - The new republic").endObject()) .get(); transportClient().admin().indices().prepareRefresh(queryIndex).get(); Map<String, Object> params = new HashMap<>(); params.put("query_string", "star wars"); SearchResponse searchResponse = transportClient().prepareSearch(queryIndex) .setTemplateName("the_template") .setTemplateParams(params) .setTemplateType(ScriptService.ScriptType.INDEXED) .get(); assertNoFailures(searchResponse); assertHitCount(searchResponse, 1); assertGetRequestsContainHeaders(".scripts"); assertRequestsContainHeader(PutIndexedScriptRequest.class); } @Test public void testThatRelevantHttpHeadersBecomeRequestHeaders() throws Exception { String releventHeaderName = "relevant_" + randomHeaderKey; for (RestController restController : internalCluster().getDataNodeInstances(RestController.class)) { restController.registerRelevantHeaders(releventHeaderName); } CloseableHttpClient httpClient = HttpClients.createDefault(); HttpResponse response = new HttpRequestBuilder(httpClient) .httpTransport(internalCluster().getDataNodeInstance(HttpServerTransport.class)) .addHeader(randomHeaderKey, randomHeaderValue) .addHeader(releventHeaderName, randomHeaderValue) .path("/" + queryIndex + "/_search") .execute(); assertThat(response, hasStatus(OK)); List<SearchRequest> searchRequests = getRequests(SearchRequest.class); assertThat(searchRequests, hasSize(greaterThan(0))); for (SearchRequest searchRequest : searchRequests) { assertThat(searchRequest.hasHeader(releventHeaderName), is(true)); // was not specified, thus is not included assertThat(searchRequest.hasHeader(randomHeaderKey), is(false)); } } private <T> List<T> getRequests(Class<T> clazz) { List<T> results = new ArrayList<>(); for (ActionRequest request : requests) { if (request.getClass().equals(clazz)) { results.add((T) request); } } return results; } private void assertRequestsContainHeader(Class<? extends ActionRequest> clazz) { List<? extends ActionRequest> classRequests = getRequests(clazz); for (ActionRequest request : classRequests) { assertRequestContainsHeader(request); } } private void assertGetRequestsContainHeaders() { assertGetRequestsContainHeaders(this.lookupIndex); } private void assertGetRequestsContainHeaders(String index) { List<GetRequest> getRequests = getRequests(GetRequest.class); assertThat(getRequests, hasSize(greaterThan(0))); for (GetRequest request : getRequests) { if (!request.index().equals(index)) { continue; } assertRequestContainsHeader(request); } } private void assertRequestContainsHeader(ActionRequest request) { String msg = String.format(Locale.ROOT, "Expected header %s to be in request %s", randomHeaderKey, request.getClass().getName()); if (request instanceof IndexRequest) { IndexRequest indexRequest = (IndexRequest) request; msg = String.format(Locale.ROOT, "Expected header %s to be in index request %s/%s/%s", randomHeaderKey, indexRequest.index(), indexRequest.type(), indexRequest.id()); } assertThat(msg, request.hasHeader(randomHeaderKey), is(true)); assertThat(request.getHeader(randomHeaderKey).toString(), is(randomHeaderValue)); } /** * a transport client that adds our random header */ private Client transportClient() { Client transportClient = internalCluster().transportClient(); FilterClient filterClient = new FilterClient(transportClient) { @Override protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) { request.putHeader(randomHeaderKey, randomHeaderValue); super.doExecute(action, request, listener); } }; return filterClient; } public static class ActionLoggingPlugin extends Plugin { @Override public String name() { return "test-action-logging"; } @Override public String description() { return "Test action logging"; } @Override public Collection<Module> nodeModules() { return Collections.<Module>singletonList(new ActionLoggingModule()); } public void onModule(ActionModule module) { module.registerFilter(LoggingFilter.class); } } public static class ActionLoggingModule extends AbstractModule { @Override protected void configure() { bind(LoggingFilter.class).asEagerSingleton(); } } public static class LoggingFilter extends ActionFilter.Simple { @Inject public LoggingFilter(Settings settings) { super(settings); } @Override public int order() { return 999; } @Override protected boolean apply(String action, ActionRequest request, ActionListener listener) { requests.add(request); return true; } @Override protected boolean apply(String action, ActionResponse response, ActionListener listener) { return true; } } }
Wrapper that adds `fetcher` function to react component as static property ```js type FetcherFn = (locals: Object) => Array<Action> | Action | void; type PrefetchFn = (fetcher: FetcherFn) => (component: ReactComponent) => ReactComponent; ``` ### `dispatchFetchers` Collects results (redux actions) of `fetcher` functions from wrapped route handlers. Then dispatches this actions. ```js type DispatchFetchersFn = ( // redux `store.dispatch` dispatch: (action: Action) => any, // react-router route handler components from `routerProps.components` components: Array<ReactComponent | { [key: string]: ReactComponent }>, // locals can be used to give some data to `fetcher` functions locals: Object | (component: ReactComponent) => Object ) => void; ``` ### `useSagaFetcher` middleware for react-router 2.x/3.x React router v2.x/3.x middleware. Used for client side rendering. Initiates fetches when location has changed. ```js type Params = { dispatch: (action: Action) => any, getLocals: (routerProps: Object) => Object } type UseSagaFetcherFn = (params: Params) => ReactRouterMiddleware; ```
/* * FileSystem * * Translate temporary / persistent / root file paths */ var info = require("cordova-plugin-file.bb10FileSystemInfo"); module.exports = { __format__: function(fullPath) { var path; switch (this.name) { case 'temporary': path = info.temporaryPath + FileSystem.encodeURIPath(fullPath); break; case 'persistent': path = info.persistentPath + FileSystem.encodeURIPath(fullPath); break; case 'root': path = 'file://' + FileSystem.encodeURIPath(fullPath); break; } return path; } };
<div id="__html_block_list_id__" class="adm-bp-blocks"> <bx_include_auto:bp_blocks.html /> <script type="text/javascript"> $(document).ready(function () { $('.adm-bp-block .adm-bpb-icon, .adm-bp-block .adm-bpb-info').bind('click', function() { var oCheckbox = $(this).parents('.adm-bp-block').find("input[type = 'checkbox']"); oCheckbox.attr('checked', !oCheckbox.attr('checked')).trigger('change'); }); }); </script> </div>
package org.springframework.boot.context.web; import javax.servlet.Filter; import javax.servlet.Servlet; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.builder.ParentContextApplicationContextInitializer; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext; import org.springframework.boot.context.embedded.ServletContextInitializer; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.util.Assert; import org.springframework.web.WebApplicationInitializer; import org.springframework.web.context.ContextLoaderListener; import org.springframework.web.context.WebApplicationContext; /** * An opinionated {@link WebApplicationInitializer} to run a {@link SpringApplication} * from a traditional WAR deployment. Binds {@link Servlet}, {@link Filter} and * {@link ServletContextInitializer} beans from the application context to the servlet * container. * <p> * To configure the application either override the * {@link #configure(SpringApplicationBuilder)} method (calling * {@link SpringApplicationBuilder#sources(Object...)}) or make the initializer itself a * {@code @Configuration}. If you are using {@link SpringBootServletInitializer} in * combination with other {@link WebApplicationInitializer WebApplicationInitializers} you * might also want to add an {@code @Ordered} annotation to configure a specific startup * order. * <p> * Note that a WebApplicationInitializer is only needed if you are building a war file and * deploying it. If you prefer to run an embedded container then you won't need this at * all. * * @author Dave Syer * @author Phillip Webb * @see #configure(SpringApplicationBuilder) */ public abstract class SpringBootServletInitializer implements WebApplicationInitializer { protected final Log logger = LogFactory.getLog(getClass()); @Override public void onStartup(ServletContext servletContext) throws ServletException { WebApplicationContext rootAppContext = createRootApplicationContext(servletContext); if (rootAppContext != null) { servletContext.addListener(new ContextLoaderListener(rootAppContext) { @Override public void contextInitialized(ServletContextEvent event) { // no-op because the application context is already initialized } }); } else { this.logger.debug("No ContextLoaderListener registered, as " + "createRootApplicationContext() did not " + "return an application context"); } } protected WebApplicationContext createRootApplicationContext( ServletContext servletContext) { SpringApplicationBuilder builder = new SpringApplicationBuilder(); ApplicationContext parent = getExistingRootWebApplicationContext(servletContext); if (parent != null) { this.logger.info("Root context already created (using as parent)."); servletContext.setAttribute( WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, null); builder.initializers(new ParentContextApplicationContextInitializer(parent)); } builder.initializers(new ServletContextApplicationContextInitializer( servletContext)); builder.contextClass(AnnotationConfigEmbeddedWebApplicationContext.class); builder = configure(builder); SpringApplication application = builder.build(); if (application.getSources().isEmpty() && AnnotationUtils.findAnnotation(getClass(), Configuration.class) != null) { application.getSources().add(getClass()); } Assert.state(application.getSources().size() > 0, "No SpringApplication sources have been defined. Either override the " + "configure method or add an @Configuration annotation"); // Ensure error pages are registered application.getSources().add(ErrorPageFilter.class); return run(application); } /** * Called to run a fully configured {@link SpringApplication}. * @param application the application to run * @return the {@link WebApplicationContext} */ protected WebApplicationContext run(SpringApplication application) { return (WebApplicationContext) application.run(); } private ApplicationContext getExistingRootWebApplicationContext( ServletContext servletContext) { Object context = servletContext .getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); if (context instanceof ApplicationContext) { return (ApplicationContext) context; } return null; } /** * Configure the application. Normally all you would need to do it add sources (e.g. * config classes) because other settings have sensible defaults. You might choose * (for instance) to add default command line arguments, or set an active Spring * profile. * @param builder a builder for the application context * @return the application builder * @see SpringApplicationBuilder */ protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder; } }
[npm-img]: https://img.shields.io/npm/v/mkv-subtitle-extractor.svg [npm-url]: https://www.npmjs.com/package/mkv-subtitle-extractor [dep-img]: https://david-dm.org/mathiasvr/mkv-subtitle-extractor.svg [dep-url]: https://david-dm.org/mathiasvr/mkv-subtitle-extractor [lic-img]: http://img.shields.io/:license-MIT-blue.svg [lic-url]: http://mvr.mit-license.org Extract subtitles from .mkv files. > Currently only supports the .srt format. ## install ``` npm install -g mkv-subtitle-extractor ``` ## usage ``` mkv-subtitle-extractor file.mkv ... ``` All supported subtitle tracks are written to the same destination with non-overwriting (incremental) names. > file.srt, file.2.srt, file.eng.srt, file.ger.srt, file.ita.srt, ... ## license MIT
/*! SWFMini - a SWFObject 2.2 cut down version for webshims * * based on SWFObject v2.2 <http://code.google.com/p/swfobject/> is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> */ var swfmini = function() { var wasRemoved = function(){webshims.error('This method was removed from swfmini');}; var UNDEF = "undefined", OBJECT = "object", webshims = window.webshims, SHOCKWAVE_FLASH = "Shockwave Flash", SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", FLASH_MIME_TYPE = "application/x-shockwave-flash", win = window, doc = document, nav = navigator, plugin = false, domLoadFnArr = [main], isDomLoaded = false, autoHideShow = true, /* Centralized function for browser feature detection - User agent string detection is only used when no good alternative is possible - Is executed directly for optimal performance */ ua = function() { var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, u = nav.userAgent.toLowerCase(), p = nav.platform.toLowerCase(), windows = p ? /win/.test(p) : /win/.test(u), mac = p ? /mac/.test(p) : /mac/.test(u), webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html playerVersion = [0,0,0], d = null; if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { d = nav.plugins[SHOCKWAVE_FLASH].description; if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ plugin = true; ie = false; // cascaded feature detection for Internet Explorer d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; } } else if (typeof win.ActiveXObject != UNDEF) { try { var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); if (a) { // a will return null when ActiveX is disabled d = a.GetVariable("$version"); if (d) { ie = true; // cascaded feature detection for Internet Explorer d = d.split(" ")[1].split(","); playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } } } catch(e) {} } return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; }(); function callDomLoadFunctions() { if (isDomLoaded) { return; } isDomLoaded = true; var dl = domLoadFnArr.length; for (var i = 0; i < dl; i++) { domLoadFnArr[i](); } } function addDomLoadEvent(fn) { if (isDomLoaded) { fn(); } else { domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ } } /* Main function - Will preferably execute onDomLoad, otherwise onload (as a fallback) */ function main() { if (plugin) { testPlayerVersion(); } } /* Detect the Flash Player version for non-Internet Explorer browsers - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: a. Both release and build numbers can be detected b. Avoid wrong descriptions by corrupt installers provided by Adobe c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available */ function testPlayerVersion() { var b = doc.getElementsByTagName("body")[0]; var o = createElement(OBJECT); o.setAttribute("type", FLASH_MIME_TYPE); var t = b.appendChild(o); if (t) { var counter = 0; (function(){ if (typeof t.GetVariable != UNDEF) { var d = t.GetVariable("$version"); if (d) { d = d.split(" ")[1].split(","); ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } } else if (counter < 10) { counter++; setTimeout(arguments.callee, 10); return; } b.removeChild(o); t = null; })(); } } function createElement(el) { return doc.createElement(el); } /* Flash Player and SWF content version matching */ function hasPlayerVersion(rv) { var pv = ua.pv, v = rv.split("."); v[0] = parseInt(v[0], 10); v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" v[2] = parseInt(v[2], 10) || 0; return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; } webshims.ready('DOM', callDomLoadFunctions); webshims.loader.addModule('swfmini-embed', {d: ['swfmini']}); var loadEmbed = hasPlayerVersion('9.0.0') ? function(){ webshims.loader.loadList(['swfmini-embed']); return true; } : webshims.$.noop ; if(!Modernizr.video){ loadEmbed(); } else { webshims.ready('WINDOWLOAD', loadEmbed); } return { /* Public API - Reference: http://code.google.com/p/swfobject/wiki/documentation */ registerObject: wasRemoved, getObjectById: wasRemoved, embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { var args = arguments; if(loadEmbed()){ webshims.ready('swfmini-embed', function(){ swfmini.embedSWF.apply(swfmini, args); }); } else if(callbackFn) { callbackFn({success:false, id:replaceElemIdStr}); } }, switchOffAutoHideShow: function() { autoHideShow = false; }, ua: ua, getFlashPlayerVersion: function() { return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; }, hasFlashPlayerVersion: hasPlayerVersion, createSWF: function(attObj, parObj, replaceElemIdStr) { if (ua.w3) { return createSWF(attObj, parObj, replaceElemIdStr); } else { return undefined; } }, showExpressInstall: wasRemoved, removeSWF: wasRemoved, createCSS: wasRemoved, addDomLoadEvent: addDomLoadEvent, addLoadEvent: wasRemoved, // For internal usage only expressInstallCallback: wasRemoved }; }(); webshims.isReady('swfmini', true);
@interface OCThumborTests : XCTestCase @property (nonatomic, strong) OCThumbor *thumbor; @end NSString * const KEY = @"my-security-key"; NSString * const IMG = @"my.server.com/some/path/to/image.jpg"; @implementation OCThumborTests - (void)testCannotAddInvalidKey { @try { [OCThumbor createWithHost:@"http://example.com" key:nil]; XCTFail(@"Bad key string allowed."); } @catch (NSException *expected) { } @try { [OCThumbor createWithHost:@"http://example.com" key:@""]; XCTFail(@"Bad key string allowed."); } @catch (NSException *expected) { } } - (void)testCannotAddInvalidHost { @try { [OCThumbor createWithHost:nil]; XCTFail(@"Bad host string allowed."); } @catch (NSException *expected) { } @try { [OCThumbor createWithHost:@""]; XCTFail(@"Bad host string allowed."); } @catch (NSException *expected) { } } - (void)testCannotBuildWithInvalidTarget { OCThumbor *thumbor = [OCThumbor createWithHost:@"http://example.com"]; @try { [thumbor buildImage:nil]; XCTFail(@"Bad target image URL allowed."); } @catch (NSException *expected) { } @try { [thumbor buildImage:@""]; XCTFail(@"Bad target image URL allowed."); } @catch (NSException *expected) { } } - (void)testHostAlwaysEndsWithSlash { OCThumbor *t1 = [OCThumbor createWithHost:@"http://me.com/"]; XCTAssertTrue([t1.host isEqualToString:@"http://me.com/"]); OCThumbor *t2 = [OCThumbor createWithHost:@"http://me.com"]; XCTAssertTrue([t2.host isEqualToString:@"http://me.com/"]); } @end
{% extends "layout.html" %} {% block pageTitle %} GOV.UK prototyping kit {% endblock %} {% block content %} {% import "pip23/macros/elements.html" as elements %} {% for page in data %} {% for question in page.treatments %} <main id="content" role="main" class="pip23"> <div class="grid-row"> <div class="column-two-thirds"> <form action="/pip23/treatments{% if edit %}?edit=true{% endif %}" method="post" class="form"> {{ elements.header(page,question) }} {{ elements.answerLater() }} {% set seq = [ {"id":"treatments","value":"Yes","showPanel":"medications"}, {"id":"treatments", "value":"No"} ] %} {{ elements.radioSelect('treatments',question.question,"",answers.treatments,seq,"inline") }} <div class="panel-indent {% if answers.treatments != 'Yes' %}js-hidden{% endif %}" id="medications"> <ul class="list-user-input"> {% for i in range(1, 11) -%} <li id="condition-row-{{i}}" class="condition-row {% if not loop.first and not answers['treatment' + i] %} js-hidden {% endif %}"> <h2 class="heading-small">{{ question.rowHd }} {{i}}</h2> {% if not loop.first %}<a href="#" class="remove">{{ question.removeLink }}</a>{% endif %} {{ elements.genericInputList("treatment" + i,question.treatmentHd, answers["treatment" + i] ,"treatment-1") }} {{ elements.genericInputList("often" + i,question.oftenHd, answers["often" + i] ,"often-1") }} </li> {% endfor %} <li><a href="add-another" class="add-another secondary-button" data-target="condition-row">Add another</a></li> </ul> {% set seq2 = [ {"id":"atHome","value":"Yes"}, {"id":"atHome", "value":"No"} ] %} {{ elements.radioSelect('atHome',question.question2,"",answers.atHome,seq2,"inline") }} </div> {% if answers.skipQuestion.length or edit %} {{ elements.returnToMenu(page,question) }} {% else %} {{ elements.submit(page,question,true,true) }} {% endif%} </form> </div> {{ elements.helpline(page) }} </div> </main> {% endfor %} {% endfor %} {% endblock %}
require 'spec_helper' describe Spree::Order, :type => :model do let(:order) { stub_model("Spree::Order") } context "#finalize!" do let(:order) { Spree::Order.create(email: 'test@example.com') } before do order.update_column :state, 'complete' end it "should set completed_at" do expect(order).to receive(:touch).with(:completed_at) order.finalize! end it "should sell inventory units" do order.shipments.each do |shipment| expect(shipment).to receive(:update!) expect(shipment).to receive(:finalize!) end order.finalize! end it "should decrease the stock for each variant in the shipment" do order.shipments.each do |shipment| expect(shipment.stock_location).to receive(:decrease_stock_for_variant) end order.finalize! end it "should change the shipment state to ready if order is paid" do Spree::Shipment.create(order: order, stock_location: create(:stock_location)) order.shipments.reload allow(order).to receive_messages(paid?: true, complete?: true) order.finalize! order.reload # reload so we're sure the changes are persisted expect(order.shipment_state).to eq('ready') end after { Spree::Config.set track_inventory_levels: true } it "should not sell inventory units if track_inventory_levels is false" do Spree::Config.set track_inventory_levels: false expect(Spree::InventoryUnit).not_to receive(:sell_units) order.finalize! end it "should send an order confirmation email" do mail_message = double "Mail::Message" expect(Spree::OrderMailer).to receive(:confirm_email).with(order.id).and_return mail_message expect(mail_message).to receive :deliver_later order.finalize! end it "sets confirmation delivered when finalizing" do expect(order.confirmation_delivered?).to be false order.finalize! expect(order.confirmation_delivered?).to be true end it "should not send duplicate confirmation emails" do allow(order).to receive_messages(:confirmation_delivered? => true) expect(Spree::OrderMailer).not_to receive(:confirm_email) order.finalize! end it "should freeze all adjustments" do # Stub this method as it's called due to a callback # and it's irrelevant to this test allow(order).to receive :has_available_shipment allow(Spree::OrderMailer).to receive_message_chain :confirm_email, :deliver_later adjustments = [double] expect(order).to receive(:all_adjustments).and_return(adjustments) adjustments.each do |adj| expect(adj).to receive(:close) end order.finalize! end context "order is considered risky" do before do allow(order).to receive_messages :is_risky? => true end it "should change state to risky" do expect(order).to receive(:considered_risky!) order.finalize! end context "and order is approved" do before do allow(order).to receive_messages :approved? => true end it "should leave order in complete state" do order.finalize! expect(order.state).to eq 'complete' end end end context "order is not considered risky" do before do allow(order).to receive_messages :is_risky? => false end it "should set completed_at" do order.finalize! expect(order.completed_at).to be_present end end end end
namespace GraphQL.Language { public class Directive { public string Name { get; set; } public Arguments Arguments { get; set; } } }
@import url(//fonts.googleapis.com/css?family=Crete+Round); .clearfix { *zoom: 1; } .clearfix:before, .clearfix:after { display: table; content: ""; line-height: 0; } .clearfix:after { clear: both; } .hide-text { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .input-block-level { display: block; width: 100%; min-height: 31px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } audio:not([controls]) { display: none; } html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } a:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } a:hover, a:active { outline: 0; } sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { /* Responsive images (ensure images don't scale beyond their parents) */ max-width: 100%; /* Part 1: Set a maxium relative to the parent */ width: auto\9; /* IE7-8 need help adjusting responsive images */ height: auto; /* Part 2: Scale the height according to the width, otherwise you get stretching */ vertical-align: middle; border: 0; -ms-interpolation-mode: bicubic; } #map_canvas img, .google-maps img { max-width: none; } button, input, select, textarea { margin: 0; font-size: 100%; vertical-align: middle; } button, input { *overflow: visible; line-height: normal; } button::-moz-focus-inner, input::-moz-focus-inner { padding: 0; border: 0; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } label, select, button, input[type="button"], input[type="reset"], input[type="submit"], input[type="radio"], input[type="checkbox"] { cursor: pointer; } input[type="search"] { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-appearance: textfield; } input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; } textarea { overflow: auto; vertical-align: top; } @media print { * { text-shadow: none !important; color: #000 !important; background: transparent !important; box-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } @page { margin: 0.5cm; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } } body { margin: 0; font-family: Georgia, "Times New Roman", Times, serif; font-size: 11px; line-height: normal; color: #555555; background-color: #ffffff; } a { color: #CC3333; text-decoration: none; } a:hover, a:focus { color: #CC3333; text-decoration: underline; } .img-rounded { -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .img-polaroid { padding: 4px; background-color: #fff; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } .img-circle { -webkit-border-radius: 500px; -moz-border-radius: 500px; border-radius: 500px; } .row { margin-left: -20px; *zoom: 1; } .row:before, .row:after { display: table; content: ""; line-height: 0; } .row:after { clear: both; } [class*="span"] { float: left; min-height: 1px; margin-left: 20px; } .container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 940px; } .span12 { width: 940px; } .span11 { width: 860px; } .span10 { width: 780px; } .span9 { width: 700px; } .span8 { width: 620px; } .span7 { width: 540px; } .span6 { width: 460px; } .span5 { width: 380px; } .span4 { width: 300px; } .span3 { width: 220px; } .span2 { width: 140px; } .span1 { width: 60px; } .offset12 { margin-left: 980px; } .offset11 { margin-left: 900px; } .offset10 { margin-left: 820px; } .offset9 { margin-left: 740px; } .offset8 { margin-left: 660px; } .offset7 { margin-left: 580px; } .offset6 { margin-left: 500px; } .offset5 { margin-left: 420px; } .offset4 { margin-left: 340px; } .offset3 { margin-left: 260px; } .offset2 { margin-left: 180px; } .offset1 { margin-left: 100px; } .row-fluid { width: 100%; *zoom: 1; } .row-fluid:before, .row-fluid:after { display: table; content: ""; line-height: 0; } .row-fluid:after { clear: both; } .row-fluid [class*="span"] { display: block; width: 100%; min-height: 31px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.127659574468085%; *margin-left: 2.074468085106383%; } .row-fluid [class*="span"]:first-child { margin-left: 0; } .row-fluid .controls-row [class*="span"] + [class*="span"] { margin-left: 2.127659574468085%; } .row-fluid .span12 { width: 100%; *width: 99.94680851063829%; } .row-fluid .span11 { width: 91.48936170212765%; *width: 91.43617021276594%; } .row-fluid .span10 { width: 82.97872340425532%; *width: 82.92553191489361%; } .row-fluid .span9 { width: 74.46808510638297%; *width: 74.41489361702126%; } .row-fluid .span8 { } .row-fluid .span7 { width: 57.44680851063829%; *width: 57.39361702127659%; } .row-fluid .span6 { width: 48.93617021276595%; *width: 48.88297872340425%; } .row-fluid .span5 { width: 40.42553191489362%; *width: 40.37234042553192%; } .row-fluid .span4 { width: 31.914893617021278%; *width: 31.861702127659576%; } .row-fluid .span3 { width: 23.404255319148934%; *width: 23.351063829787233%; } .row-fluid .span2 { width: 14.893617021276595%; *width: 14.840425531914894%; } .row-fluid .span1 { width: 6.382978723404255%; *width: 6.329787234042553%; } .row-fluid .offset12 { margin-left: 104.25531914893617%; *margin-left: 104.14893617021275%; } .row-fluid .offset12:first-child { margin-left: 102.12765957446808%; *margin-left: 102.02127659574467%; } .row-fluid .offset11 { margin-left: 95.74468085106382%; *margin-left: 95.6382978723404%; } .row-fluid .offset11:first-child { margin-left: 93.61702127659574%; *margin-left: 93.51063829787232%; } .row-fluid .offset10 { margin-left: 87.23404255319149%; *margin-left: 87.12765957446807%; } .row-fluid .offset10:first-child { margin-left: 85.1063829787234%; *margin-left: 84.99999999999999%; } .row-fluid .offset9 { margin-left: 78.72340425531914%; *margin-left: 78.61702127659572%; } .row-fluid .offset9:first-child { margin-left: 76.59574468085106%; *margin-left: 76.48936170212764%; } .row-fluid .offset8 { margin-left: 70.2127659574468%; *margin-left: 70.10638297872339%; } .row-fluid .offset8:first-child { margin-left: 68.08510638297872%; *margin-left: 67.9787234042553%; } .row-fluid .offset7 { margin-left: 61.70212765957446%; *margin-left: 61.59574468085106%; } .row-fluid .offset7:first-child { margin-left: 59.574468085106375%; *margin-left: 59.46808510638297%; } .row-fluid .offset6 { margin-left: 53.191489361702125%; *margin-left: 53.085106382978715%; } .row-fluid .offset6:first-child { margin-left: 51.063829787234035%; *margin-left: 50.95744680851063%; } .row-fluid .offset5 { margin-left: 44.68085106382979%; *margin-left: 44.57446808510638%; } .row-fluid .offset5:first-child { margin-left: 42.5531914893617%; *margin-left: 42.4468085106383%; } .row-fluid .offset4 { margin-left: 36.170212765957444%; *margin-left: 36.06382978723405%; } .row-fluid .offset4:first-child { margin-left: 34.04255319148936%; *margin-left: 33.93617021276596%; } .row-fluid .offset3 { margin-left: 27.659574468085104%; *margin-left: 27.5531914893617%; } .row-fluid .offset3:first-child { margin-left: 25.53191489361702%; *margin-left: 25.425531914893618%; } .row-fluid .offset2 { margin-left: 19.148936170212764%; *margin-left: 19.04255319148936%; } .row-fluid .offset2:first-child { margin-left: 17.02127659574468%; *margin-left: 16.914893617021278%; } .row-fluid .offset1 { margin-left: 10.638297872340425%; *margin-left: 10.53191489361702%; } .row-fluid .offset1:first-child { margin-left: 8.51063829787234%; *margin-left: 8.404255319148938%; } [class*="span"].hide, .row-fluid [class*="span"].hide { display: none; } [class*="span"].pull-right, .row-fluid [class*="span"].pull-right { float: right; } .container { margin-right: auto; margin-left: auto; *zoom: 1; } .container:before, .container:after { display: table; content: ""; line-height: 0; } .container:after { clear: both; } .container-fluid { padding-right: 20px; padding-left: 20px; *zoom: 1; } .container-fluid:before, .container-fluid:after { display: table; content: ""; line-height: 0; } .container-fluid:after { clear: both; } p { margin: 0 0 10.5px; } .lead { margin-bottom: 21px; font-size: 22.5px; font-weight: 200; line-height: 31.5px; } small { font-size: 85%; } strong { font-weight: bold; } em { font-style: italic; } cite { font-style: normal; } .muted { color: #999999; } a.muted:hover, a.muted:focus { color: #808080; } .text-warning { color: #ffffff; } a.text-warning:hover, a.text-warning:focus { color: #e6e6e6; } .text-error { color: #ffffff; } a.text-error:hover, a.text-error:focus { color: #e6e6e6; } .text-info { color: #ffffff; } a.text-info:hover, a.text-info:focus { color: #e6e6e6; } .text-success { color: #ffffff; } a.text-success:hover, a.text-success:focus { color: #e6e6e6; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } h1, h2, h3, h4, h5, h6 { margin: 0px; font-family: 'Crete Round', serif; font-weight: normal; line-height: 21px; color: #333333; text-rendering: optimizelegibility; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-weight: normal; line-height: 1; color: #999999; } h1, h2, h3 { line-height: 42px; } h1 { font-size: 41.25px; } h2 { font-size: 33.75px; } h3 { font-size: 26.25px; } h4 { font-size: 18.75px; } h5 { font-size: 15px; } h6 { font-size: 12.75px; } h1 small { font-size: 26.25px; } h2 small { font-size: 18.75px; } h3 small { font-size: 15px; } h4 small { font-size: 15px; } .page-header { padding-bottom: 9.5px; margin: 21px 0 31.5px; border-bottom: 1px solid #eeeeee; } ul, ol { padding: 0; margin: 0 0 10.5px 25px; } ul ul, ul ol, ol ol, ol ul { margin-bottom: 0; } li { line-height: 21px; } ul.unstyled, ol.unstyled { margin-left: 0; list-style: none; } ul.inline, ol.inline { margin-left: 0; list-style: none; } ul.inline > li, ol.inline > li { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; padding-left: 5px; padding-right: 5px; } dl { margin-bottom: 21px; } dt, dd { line-height: 21px; } dt { font-weight: bold; } dd { margin-left: 10.5px; } .dl-horizontal { *zoom: 1; } .dl-horizontal:before, .dl-horizontal:after { display: table; content: ""; line-height: 0; } .dl-horizontal:after { clear: both; } .dl-horizontal dt { float: left; width: 160px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } hr { margin: 21px 0; border: 0; border-top: 1px solid #999999; border-bottom: 1px solid #ffffff; } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #999999; } abbr.initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 0 0 0 15px; margin: 0 0 21px; border-left: 5px solid #eeeeee; } blockquote p { margin-bottom: 0; font-size: 18.75px; font-weight: 300; line-height: 1.25; } blockquote small { display: block; line-height: 21px; color: #999999; } blockquote small:before { content: '\2014 \00A0'; } blockquote.pull-right { float: right; padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0; } blockquote.pull-right p, blockquote.pull-right small { text-align: right; } blockquote.pull-right small:before { content: ''; } blockquote.pull-right small:after { content: '\00A0 \2014'; } q:before, q:after, blockquote:before, blockquote:after { content: ""; } address { display: block; margin-bottom: 21px; font-style: normal; line-height: 21px; } code, pre { padding: 0 3px 2px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 13px; color: #333333; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } code { padding: 0px; color: #d14; background-color: #f7f7f9; border: 1px solid #e1e1e8; white-space: nowrap; } pre { display: block; padding: 10px; margin: 0 0 10.5px; font-size: 14px; line-height: 21px; word-break: break-all; word-wrap: break-word; white-space: pre; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } pre.prettyprint { margin-bottom: 21px; } pre code { padding: 0; color: inherit; white-space: pre; white-space: pre-wrap; background-color: transparent; border: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } form { margin: 0 0 21px; } fieldset { padding: 0; margin: 0; border: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 21px; font-size: 22.5px; line-height: 42px; color: #333333; border: 0; border-bottom: 1px solid #e5e5e5; } legend small { font-size: 15.75px; color: #999999; } label, input, button, select, textarea { font-size: 15px; font-weight: normal; line-height: 21px; } input, button, select, textarea { font-family: Georgia, "Times New Roman", Times, serif; } label { display: block; margin-bottom: 5px; } select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { display: inline-block; height: 21px; padding: 4px 6px; margin-bottom: 10.5px; font-size: 15px; line-height: 21px; color: #555555; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; vertical-align: middle; } input, textarea, .uneditable-input { width: 206px; } textarea { height: auto; } textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input { background-color: #ffffff; border: 1px solid #cccccc; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border linear .2s, box-shadow linear .2s; -moz-transition: border linear .2s, box-shadow linear .2s; -o-transition: border linear .2s, box-shadow linear .2s; transition: border linear .2s, box-shadow linear .2s; } textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="color"]:focus, .uneditable-input:focus { border-color: rgba(82, 168, 236, 0.8); outline: 0; outline: thin dotted \9; /* IE6-9 */ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; *margin-top: 0; /* IE7 */ margin-top: 1px \9; /* IE8-9 */ line-height: normal; } input[type="file"], input[type="image"], input[type="submit"], input[type="reset"], input[type="button"], input[type="radio"], input[type="checkbox"] { width: auto; } select, input[type="file"] { height: 31px; /* In IE7, the height of the select element cannot be changed by height, only font-size */ *margin-top: 4px; /* For IE7, add top margin to align select with labels */ line-height: 31px; } select { width: 220px; border: 1px solid #cccccc; background-color: #ffffff; } select[multiple], select[size] { height: auto; } select:focus, input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .uneditable-input, .uneditable-textarea { color: #999999; background-color: #fcfcfc; border-color: #cccccc; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); cursor: not-allowed; } .uneditable-input { overflow: hidden; white-space: nowrap; } .uneditable-textarea { width: auto; height: auto; } input:-moz-placeholder, textarea:-moz-placeholder { color: #cccccc; } input:-ms-input-placeholder, textarea:-ms-input-placeholder { color: #cccccc; } input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #cccccc; } .radio, .checkbox { min-height: 21px; padding-left: 20px; } .radio input[type="radio"], .checkbox input[type="checkbox"] { float: left; margin-left: -20px; } .controls > .radio:first-child, .controls > .checkbox:first-child { padding-top: 5px; } .radio.inline, .checkbox.inline { display: inline-block; padding-top: 5px; margin-bottom: 0; vertical-align: middle; } .radio.inline + .radio.inline, .checkbox.inline + .checkbox.inline { margin-left: 10px; } .input-mini { width: 60px; } .input-small { width: 90px; } .input-medium { width: 150px; } .input-large { width: 210px; } .input-xlarge { width: 270px; } .input-xxlarge { width: 530px; } input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"] { float: none; margin-left: 0; } .input-append input[class*="span"], .input-append .uneditable-input[class*="span"], .input-prepend input[class*="span"], .input-prepend .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"], .row-fluid .input-prepend [class*="span"], .row-fluid .input-append [class*="span"] { display: inline-block; } input, textarea, .uneditable-input { margin-left: 0; } .controls-row [class*="span"] + [class*="span"] { margin-left: 20px; } input.span12, textarea.span12, .uneditable-input.span12 { width: 926px; } input.span11, textarea.span11, .uneditable-input.span11 { width: 846px; } input.span10, textarea.span10, .uneditable-input.span10 { width: 766px; } input.span9, textarea.span9, .uneditable-input.span9 { width: 686px; } input.span8, textarea.span8, .uneditable-input.span8 { width: 606px; } input.span7, textarea.span7, .uneditable-input.span7 { width: 526px; } input.span6, textarea.span6, .uneditable-input.span6 { width: 446px; } input.span5, textarea.span5, .uneditable-input.span5 { width: 366px; } input.span4, textarea.span4, .uneditable-input.span4 { width: 286px; } input.span3, textarea.span3, .uneditable-input.span3 { width: 206px; } input.span2, textarea.span2, .uneditable-input.span2 { width: 126px; } input.span1, textarea.span1, .uneditable-input.span1 { width: 46px; } .controls-row { *zoom: 1; } .controls-row:before, .controls-row:after { display: table; content: ""; line-height: 0; } .controls-row:after { clear: both; } .controls-row [class*="span"], .row-fluid .controls-row [class*="span"] { float: left; } .controls-row .checkbox[class*="span"], .controls-row .radio[class*="span"] { padding-top: 5px; } input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] { cursor: not-allowed; background-color: #eeeeee; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"][readonly], input[type="checkbox"][readonly] { background-color: transparent; } .control-group.warning .control-label, .control-group.warning .help-block, .control-group.warning .help-inline { color: #ffffff; } .control-group.warning .checkbox, .control-group.warning .radio, .control-group.warning input, .control-group.warning select, .control-group.warning textarea { color: #ffffff; } .control-group.warning input, .control-group.warning select, .control-group.warning textarea { border-color: #ffffff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.warning input:focus, .control-group.warning select:focus, .control-group.warning textarea:focus { border-color: #e6e6e6; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; } .control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on { color: #ffffff; background-color: #f26522; border-color: #ffffff; } .control-group.error .control-label, .control-group.error .help-block, .control-group.error .help-inline { color: #ffffff; } .control-group.error .checkbox, .control-group.error .radio, .control-group.error input, .control-group.error select, .control-group.error textarea { color: #ffffff; } .control-group.error input, .control-group.error select, .control-group.error textarea { border-color: #ffffff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.error input:focus, .control-group.error select:focus, .control-group.error textarea:focus { border-color: #e6e6e6; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; } .control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on { color: #ffffff; background-color: #d14432; border-color: #ffffff; } .control-group.success .control-label, .control-group.success .help-block, .control-group.success .help-inline { color: #ffffff; } .control-group.success .checkbox, .control-group.success .radio, .control-group.success input, .control-group.success select, .control-group.success textarea { color: #ffffff; } .control-group.success input, .control-group.success select, .control-group.success textarea { border-color: #ffffff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.success input:focus, .control-group.success select:focus, .control-group.success textarea:focus { border-color: #e6e6e6; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; } .control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on { color: #ffffff; background-color: #24c00b; border-color: #ffffff; } .control-group.info .control-label, .control-group.info .help-block, .control-group.info .help-inline { color: #ffffff; } .control-group.info .checkbox, .control-group.info .radio, .control-group.info input, .control-group.info select, .control-group.info textarea { color: #ffffff; } .control-group.info input, .control-group.info select, .control-group.info textarea { border-color: #ffffff; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .control-group.info input:focus, .control-group.info select:focus, .control-group.info textarea:focus { border-color: #e6e6e6; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffffff; } .control-group.info .input-prepend .add-on, .control-group.info .input-append .add-on { color: #ffffff; background-color: #185af9; border-color: #ffffff; } input:focus:invalid, textarea:focus:invalid, select:focus:invalid { color: #b94a48; border-color: #ee5f5b; } input:focus:invalid:focus, textarea:focus:invalid:focus, select:focus:invalid:focus { border-color: #e9322d; -webkit-box-shadow: 0 0 6px #f8b9b7; -moz-box-shadow: 0 0 6px #f8b9b7; box-shadow: 0 0 6px #f8b9b7; } .form-actions { padding: 20px 20px 21px; margin-top: 21px; margin-bottom: 21px; background-color: transparent; border-top: 1px solid #e5e5e5; *zoom: 1; } .form-actions:before, .form-actions:after { display: table; content: ""; line-height: 0; } .form-actions:after { clear: both; } .help-block, .help-inline { color: #7b7b7b; } .help-block { display: block; margin-bottom: 10.5px; } .help-inline { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; vertical-align: middle; padding-left: 5px; } .input-append, .input-prepend { display: inline-block; margin-bottom: 10.5px; vertical-align: middle; font-size: 0; white-space: nowrap; } .input-append input, .input-prepend input, .input-append select, .input-prepend select, .input-append .uneditable-input, .input-prepend .uneditable-input, .input-append .dropdown-menu, .input-prepend .dropdown-menu, .input-append .popover, .input-prepend .popover { font-size: 15px; } .input-append input, .input-prepend input, .input-append select, .input-prepend select, .input-append .uneditable-input, .input-prepend .uneditable-input { position: relative; margin-bottom: 0; *margin-left: 0; vertical-align: top; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .input-append input:focus, .input-prepend input:focus, .input-append select:focus, .input-prepend select:focus, .input-append .uneditable-input:focus, .input-prepend .uneditable-input:focus { z-index: 2; } .input-append .add-on, .input-prepend .add-on { display: inline-block; width: auto; height: 21px; min-width: 16px; padding: 4px 5px; font-size: 15px; font-weight: normal; line-height: 21px; text-align: center; text-shadow: 0 1px 0 #ffffff; background-color: #eeeeee; border: 1px solid #ccc; } .input-append .add-on, .input-prepend .add-on, .input-append .btn, .input-prepend .btn, .input-append .btn-group > .dropdown-toggle, .input-prepend .btn-group > .dropdown-toggle { vertical-align: top; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .input-append .active, .input-prepend .active { background-color: #03f2d0; border-color: #CC3333; } .input-prepend .add-on, .input-prepend .btn { margin-right: -1px; } .input-prepend .add-on:first-child, .input-prepend .btn:first-child { -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; } .input-append input, .input-append select, .input-append .uneditable-input { -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; } .input-append input + .btn-group .btn:last-child, .input-append select + .btn-group .btn:last-child, .input-append .uneditable-input + .btn-group .btn:last-child { -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .input-append .add-on, .input-append .btn, .input-append .btn-group { margin-left: -1px; } .input-append .add-on:last-child, .input-append .btn:last-child, .input-append .btn-group:last-child > .dropdown-toggle { -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .input-prepend.input-append input, .input-prepend.input-append select, .input-prepend.input-append .uneditable-input { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .input-prepend.input-append input + .btn-group .btn, .input-prepend.input-append select + .btn-group .btn, .input-prepend.input-append .uneditable-input + .btn-group .btn { -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .input-prepend.input-append .add-on:first-child, .input-prepend.input-append .btn:first-child { margin-right: -1px; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; } .input-prepend.input-append .add-on:last-child, .input-prepend.input-append .btn:last-child { margin-left: -1px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .input-prepend.input-append .btn-group:first-child { margin-left: 0; } input.search-query { padding-right: 14px; padding-right: 4px \9; padding-left: 14px; padding-left: 4px \9; /* IE7-8 doesn't have border-radius, so don't indent the padding */ margin-bottom: 0; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; } /* Allow for input prepend/append in search forms */ .form-search .input-append .search-query, .form-search .input-prepend .search-query { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .form-search .input-append .search-query { -webkit-border-radius: 14px 0 0 14px; -moz-border-radius: 14px 0 0 14px; border-radius: 14px 0 0 14px; } .form-search .input-append .btn { -webkit-border-radius: 0 14px 14px 0; -moz-border-radius: 0 14px 14px 0; border-radius: 0 14px 14px 0; } .form-search .input-prepend .search-query { -webkit-border-radius: 0 14px 14px 0; -moz-border-radius: 0 14px 14px 0; border-radius: 0 14px 14px 0; } .form-search .input-prepend .btn { -webkit-border-radius: 14px 0 0 14px; -moz-border-radius: 14px 0 0 14px; border-radius: 14px 0 0 14px; } .form-search input, .form-inline input, .form-horizontal input, .form-search textarea, .form-inline textarea, .form-horizontal textarea, .form-search select, .form-inline select, .form-horizontal select, .form-search .help-inline, .form-inline .help-inline, .form-horizontal .help-inline, .form-search .uneditable-input, .form-inline .uneditable-input, .form-horizontal .uneditable-input, .form-search .input-prepend, .form-inline .input-prepend, .form-horizontal .input-prepend, .form-search .input-append, .form-inline .input-append, .form-horizontal .input-append { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; margin-bottom: 0; vertical-align: middle; } .form-search .hide, .form-inline .hide, .form-horizontal .hide { display: none; } .form-search label, .form-inline label, .form-search .btn-group, .form-inline .btn-group { display: inline-block; } .form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend { margin-bottom: 0; } .form-search .radio, .form-search .checkbox, .form-inline .radio, .form-inline .checkbox { padding-left: 0; margin-bottom: 0; vertical-align: middle; } .form-search .radio input[type="radio"], .form-search .checkbox input[type="checkbox"], .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { float: left; margin-right: 3px; margin-left: 0; } .control-group { margin-bottom: 10.5px; } legend + .control-group { margin-top: 21px; -webkit-margin-top-collapse: separate; } .form-horizontal .control-group { margin-bottom: 21px; *zoom: 1; } .form-horizontal .control-group:before, .form-horizontal .control-group:after { display: table; content: ""; line-height: 0; } .form-horizontal .control-group:after { clear: both; } .form-horizontal .control-label { float: left; width: 160px; padding-top: 5px; text-align: right; } .form-horizontal .controls { *display: inline-block; *padding-left: 20px; margin-left: 180px; *margin-left: 0; } .form-horizontal .controls:first-child { *padding-left: 180px; } .form-horizontal .help-block { margin-bottom: 0; } .form-horizontal input + .help-block, .form-horizontal select + .help-block, .form-horizontal textarea + .help-block, .form-horizontal .uneditable-input + .help-block, .form-horizontal .input-prepend + .help-block, .form-horizontal .input-append + .help-block { margin-top: 10.5px; } .form-horizontal .form-actions { padding-left: 180px; } table { max-width: 100%; background-color: #f7f7f7; border-collapse: collapse; border-spacing: 0; } .table { width: 100%; margin-bottom: 21px; } .table th, .table td { padding: 1px; line-height: normal; text-align: left; vertical-align: top; border-top: 1px solid #999999; } .table th { font-weight: bold; } .table thead th { vertical-align: bottom; } .table caption + thead tr:first-child th, .table caption + thead tr:first-child td, .table colgroup + thead tr:first-child th, .table colgroup + thead tr:first-child td, .table thead:first-child tr:first-child th, .table thead:first-child tr:first-child td { border-top: 0; } .table tbody + tbody { border-top: 2px solid #999999; } .table .table { background-color: #ffffff; } .table-condensed th, .table-condensed td { padding: 4px 5px; } .table-bordered { border: 1px solid #999999; border-collapse: separate; *border-collapse: collapse; border-left: 0; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .table-bordered th, .table-bordered td { border-left: 1px solid #999999; } .table-bordered caption + thead tr:first-child th, .table-bordered caption + tbody tr:first-child th, .table-bordered caption + tbody tr:first-child td, .table-bordered colgroup + thead tr:first-child th, .table-bordered colgroup + tbody tr:first-child th, .table-bordered colgroup + tbody tr:first-child td, .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td { border-top: 0; } .table-bordered thead:first-child tr:first-child > th:first-child, .table-bordered tbody:first-child tr:first-child > td:first-child, .table-bordered tbody:first-child tr:first-child > th:first-child { -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; } .table-bordered thead:first-child tr:first-child > th:last-child, .table-bordered tbody:first-child tr:first-child > td:last-child, .table-bordered tbody:first-child tr:first-child > th:last-child { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; } .table-bordered thead:last-child tr:last-child > th:first-child, .table-bordered tbody:last-child tr:last-child > td:first-child, .table-bordered tbody:last-child tr:last-child > th:first-child, .table-bordered tfoot:last-child tr:last-child > td:first-child, .table-bordered tfoot:last-child tr:last-child > th:first-child { -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .table-bordered thead:last-child tr:last-child > th:last-child, .table-bordered tbody:last-child tr:last-child > td:last-child, .table-bordered tbody:last-child tr:last-child > th:last-child, .table-bordered tfoot:last-child tr:last-child > td:last-child, .table-bordered tfoot:last-child tr:last-child > th:last-child { -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } .table-bordered tfoot + tbody:last-child tr:last-child td:first-child { -webkit-border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; border-bottom-left-radius: 0; } .table-bordered tfoot + tbody:last-child tr:last-child td:last-child { -webkit-border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; border-bottom-right-radius: 0; } .table-bordered caption + thead tr:first-child th:first-child, .table-bordered caption + tbody tr:first-child td:first-child, .table-bordered colgroup + thead tr:first-child th:first-child, .table-bordered colgroup + tbody tr:first-child td:first-child { -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; } .table-bordered caption + thead tr:first-child th:last-child, .table-bordered caption + tbody tr:first-child td:last-child, .table-bordered colgroup + thead tr:first-child th:last-child, .table-bordered colgroup + tbody tr:first-child td:last-child { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; } .table-striped tbody > tr:nth-child(odd) > td, .table-striped tbody > tr:nth-child(odd) > th { background-color: #eaeaea; } .table-hover tbody tr:hover > td, .table-hover tbody tr:hover > th { background-color: #dddddd; } table td[class*="span"], table th[class*="span"], .row-fluid table td[class*="span"], .row-fluid table th[class*="span"] { display: table-cell; float: none; margin-left: 0; } .table td.span1, .table th.span1 { float: none; width: 44px; margin-left: 0; } .table td.span2, .table th.span2 { float: none; width: 124px; margin-left: 0; } .table td.span3, .table th.span3 { float: none; width: 204px; margin-left: 0; } .table td.span4, .table th.span4 { float: none; width: 284px; margin-left: 0; } .table td.span5, .table th.span5 { float: none; width: 364px; margin-left: 0; } .table td.span6, .table th.span6 { float: none; width: 444px; margin-left: 0; } .table td.span7, .table th.span7 { float: none; width: 524px; margin-left: 0; } .table td.span8, .table th.span8 { float: none; width: 604px; margin-left: 0; } .table td.span9, .table th.span9 { float: none; width: 684px; margin-left: 0; } .table td.span10, .table th.span10 { float: none; width: 764px; margin-left: 0; } .table td.span11, .table th.span11 { float: none; width: 844px; margin-left: 0; } .table td.span12, .table th.span12 { float: none; width: 924px; margin-left: 0; } .table tbody tr.success > td { background-color: #24c00b; } .table tbody tr.error > td { background-color: #d14432; } .table tbody tr.warning > td { background-color: #f26522; } .table tbody tr.info > td { background-color: #185af9; } .table-hover tbody tr.success:hover > td { background-color: #1fa80a; } .table-hover tbody tr.error:hover > td { background-color: #bf3c2b; } .table-hover tbody tr.warning:hover > td { background-color: #ed560e; } .table-hover tbody tr.info:hover > td { background-color: #064bf1; } [class^="icon-"], [class*=" icon-"] { display: inline-block; width: 14px; height: 14px; *margin-right: .3em; line-height: 14px; vertical-align: text-top; background-image: url("../img/glyphicons-halflings.png"); background-position: 14px 14px; background-repeat: no-repeat; margin-top: 1px; } /* White icons with optional class, or on hover/focus/active states of certain elements */ .icon-white, .nav-pills > .active > a > [class^="icon-"], .nav-pills > .active > a > [class*=" icon-"], .nav-list > .active > a > [class^="icon-"], .nav-list > .active > a > [class*=" icon-"], .navbar-inverse .nav > .active > a > [class^="icon-"], .navbar-inverse .nav > .active > a > [class*=" icon-"], .dropdown-menu > li > a:hover > [class^="icon-"], .dropdown-menu > li > a:focus > [class^="icon-"], .dropdown-menu > li > a:hover > [class*=" icon-"], .dropdown-menu > li > a:focus > [class*=" icon-"], .dropdown-menu > .active > a > [class^="icon-"], .dropdown-menu > .active > a > [class*=" icon-"], .dropdown-submenu:hover > a > [class^="icon-"], .dropdown-submenu:focus > a > [class^="icon-"], .dropdown-submenu:hover > a > [class*=" icon-"], .dropdown-submenu:focus > a > [class*=" icon-"] { background-image: url("../img/glyphicons-halflings-white.png"); } .icon-glass { background-position: 0 0; } .icon-music { background-position: -24px 0; } .icon-search { background-position: -48px 0; } .icon-envelope { background-position: -72px 0; } .icon-heart { background-position: -96px 0; } .icon-star { background-position: -120px 0; } .icon-star-empty { background-position: -144px 0; } .icon-user { background-position: -168px 0; } .icon-film { background-position: -192px 0; } .icon-th-large { background-position: -216px 0; } .icon-th { background-position: -240px 0; } .icon-th-list { background-position: -264px 0; } .icon-ok { background-position: -288px 0; } .icon-remove { background-position: -312px 0; } .icon-zoom-in { background-position: -336px 0; } .icon-zoom-out { background-position: -360px 0; } .icon-off { background-position: -384px 0; } .icon-signal { background-position: -408px 0; } .icon-cog { background-position: -432px 0; } .icon-trash { background-position: -456px 0; } .icon-home { background-position: 0 -24px; } .icon-file { background-position: -24px -24px; } .icon-time { background-position: -48px -24px; } .icon-road { background-position: -72px -24px; } .icon-download-alt { background-position: -96px -24px; } .icon-download { background-position: -120px -24px; } .icon-upload { background-position: -144px -24px; } .icon-inbox { background-position: -168px -24px; } .icon-play-circle { background-position: -192px -24px; } .icon-repeat { background-position: -216px -24px; } .icon-refresh { background-position: -240px -24px; } .icon-list-alt { background-position: -264px -24px; } .icon-lock { background-position: -287px -24px; } .icon-flag { background-position: -312px -24px; } .icon-headphones { background-position: -336px -24px; } .icon-volume-off { background-position: -360px -24px; } .icon-volume-down { background-position: -384px -24px; } .icon-volume-up { background-position: -408px -24px; } .icon-qrcode { background-position: -432px -24px; } .icon-barcode { background-position: -456px -24px; } .icon-tag { background-position: 0 -48px; } .icon-tags { background-position: -25px -48px; } .icon-book { background-position: -48px -48px; } .icon-bookmark { background-position: -72px -48px; } .icon-print { background-position: -96px -48px; } .icon-camera { background-position: -120px -48px; } .icon-font { background-position: -144px -48px; } .icon-bold { background-position: -167px -48px; } .icon-italic { background-position: -192px -48px; } .icon-text-height { background-position: -216px -48px; } .icon-text-width { background-position: -240px -48px; } .icon-align-left { background-position: -264px -48px; } .icon-align-center { background-position: -288px -48px; } .icon-align-right { background-position: -312px -48px; } .icon-align-justify { background-position: -336px -48px; } .icon-list { background-position: -360px -48px; } .icon-indent-left { background-position: -384px -48px; } .icon-indent-right { background-position: -408px -48px; } .icon-facetime-video { background-position: -432px -48px; } .icon-picture { background-position: -456px -48px; } .icon-pencil { background-position: 0 -72px; } .icon-map-marker { background-position: -24px -72px; } .icon-adjust { background-position: -48px -72px; } .icon-tint { background-position: -72px -72px; } .icon-edit { background-position: -96px -72px; } .icon-share { background-position: -120px -72px; } .icon-check { background-position: -144px -72px; } .icon-move { background-position: -168px -72px; } .icon-step-backward { background-position: -192px -72px; } .icon-fast-backward { background-position: -216px -72px; } .icon-backward { background-position: -240px -72px; } .icon-play { background-position: -264px -72px; } .icon-pause { background-position: -288px -72px; } .icon-stop { background-position: -312px -72px; } .icon-forward { background-position: -336px -72px; } .icon-fast-forward { background-position: -360px -72px; } .icon-step-forward { background-position: -384px -72px; } .icon-eject { background-position: -408px -72px; } .icon-chevron-left { background-position: -432px -72px; } .icon-chevron-right { background-position: -456px -72px; } .icon-plus-sign { background-position: 0 -96px; } .icon-minus-sign { background-position: -24px -96px; } .icon-remove-sign { background-position: -48px -96px; } .icon-ok-sign { background-position: -72px -96px; } .icon-question-sign { background-position: -96px -96px; } .icon-info-sign { background-position: -120px -96px; } .icon-screenshot { background-position: -144px -96px; } .icon-remove-circle { background-position: -168px -96px; } .icon-ok-circle { background-position: -192px -96px; } .icon-ban-circle { background-position: -216px -96px; } .icon-arrow-left { background-position: -240px -96px; } .icon-arrow-right { background-position: -264px -96px; } .icon-arrow-up { background-position: -289px -96px; } .icon-arrow-down { background-position: -312px -96px; } .icon-share-alt { background-position: -336px -96px; } .icon-resize-full { background-position: -360px -96px; } .icon-resize-small { background-position: -384px -96px; } .icon-plus { background-position: -408px -96px; } .icon-minus { background-position: -433px -96px; } .icon-asterisk { background-position: -456px -96px; } .icon-exclamation-sign { background-position: 0 -120px; } .icon-gift { background-position: -24px -120px; } .icon-leaf { background-position: -48px -120px; } .icon-fire { background-position: -72px -120px; } .icon-eye-open { background-position: -96px -120px; } .icon-eye-close { background-position: -120px -120px; } .icon-warning-sign { background-position: -144px -120px; } .icon-plane { background-position: -168px -120px; } .icon-calendar { background-position: -192px -120px; } .icon-random { background-position: -216px -120px; width: 16px; } .icon-comment { background-position: -240px -120px; } .icon-magnet { background-position: -264px -120px; } .icon-chevron-up { background-position: -288px -120px; } .icon-chevron-down { background-position: -313px -119px; } .icon-retweet { background-position: -336px -120px; } .icon-shopping-cart { background-position: -360px -120px; } .icon-folder-close { background-position: -384px -120px; width: 16px; } .icon-folder-open { background-position: -408px -120px; width: 16px; } .icon-resize-vertical { background-position: -432px -119px; } .icon-resize-horizontal { background-position: -456px -118px; } .icon-hdd { background-position: 0 -144px; } .icon-bullhorn { background-position: -24px -144px; } .icon-bell { background-position: -48px -144px; } .icon-certificate { background-position: -72px -144px; } .icon-thumbs-up { background-position: -96px -144px; } .icon-thumbs-down { background-position: -120px -144px; } .icon-hand-right { background-position: -144px -144px; } .icon-hand-left { background-position: -168px -144px; } .icon-hand-up { background-position: -192px -144px; } .icon-hand-down { background-position: -216px -144px; } .icon-circle-arrow-right { background-position: -240px -144px; } .icon-circle-arrow-left { background-position: -264px -144px; } .icon-circle-arrow-up { background-position: -288px -144px; } .icon-circle-arrow-down { background-position: -312px -144px; } .icon-globe { background-position: -336px -144px; } .icon-wrench { background-position: -360px -144px; } .icon-tasks { background-position: -384px -144px; } .icon-filter { background-position: -408px -144px; } .icon-briefcase { background-position: -432px -144px; } .icon-fullscreen { background-position: -456px -144px; } .dropup, .dropdown { position: relative; } .dropdown-toggle { *margin-bottom: -3px; } .dropdown-toggle:active, .open .dropdown-toggle { outline: 0; } .caret { display: inline-block; width: 0; height: 0; vertical-align: top; border-top: 4px solid #000000; border-right: 4px solid transparent; border-left: 4px solid transparent; content: ""; } .dropdown .caret { margin-top: 8px; margin-left: 2px; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; background-color: #002425; border: 1px solid #ccc; border: 1px solid transparent; *border-right-width: 2px; *border-bottom-width: 2px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { *width: 100%; height: 1px; margin: 9.5px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: transparent; border-bottom: 1px solid #999999; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 21px; color: #ffffff; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus, .dropdown-submenu:hover > a, .dropdown-submenu:focus > a { text-decoration: none; color: #ffffff; background-color: #015145; background-image: -moz-linear-gradient(top, #CC3333, #014238); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#CC3333), to(#014238)); background-image: -webkit-linear-gradient(top, #CC3333, #014238); background-image: -o-linear-gradient(top, #CC3333, #014238); background-image: linear-gradient(to bottom, #CC3333, #014238); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff015b4e', endColorstr='#ff014238', GradientType=0); } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #ffffff; text-decoration: none; outline: 0; background-color: #015145; background-image: -moz-linear-gradient(top, #CC3333, #014238); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#CC3333), to(#014238)); background-image: -webkit-linear-gradient(top, #CC3333, #014238); background-image: -o-linear-gradient(top, #CC3333, #014238); background-image: linear-gradient(to bottom, #CC3333, #014238); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff015b4e', endColorstr='#ff014238', GradientType=0); } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #999999; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); cursor: default; } .open { *z-index: 1000; } .open > .dropdown-menu { display: block; } .dropdown-backdrop { position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px solid #000000; content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 1px; } .dropdown-submenu { position: relative; } .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-top: -6px; margin-left: -1px; -webkit-border-radius: 0 6px 6px 6px; -moz-border-radius: 0 6px 6px 6px; border-radius: 0 6px 6px 6px; } .dropdown-submenu:hover > .dropdown-menu { display: block; } .dropup .dropdown-submenu > .dropdown-menu { top: auto; bottom: 0; margin-top: 0; margin-bottom: -2px; -webkit-border-radius: 5px 5px 5px 0; -moz-border-radius: 5px 5px 5px 0; border-radius: 5px 5px 5px 0; } .dropdown-submenu > a:after { display: block; content: " "; float: right; width: 0; height: 0; border-color: transparent; border-style: solid; border-width: 5px 0 5px 5px; border-left-color: #000000; margin-top: 5px; margin-right: -10px; } .dropdown-submenu:hover > a:after { border-left-color: #ffffff; } .dropdown-submenu.pull-left { float: none; } .dropdown-submenu.pull-left > .dropdown-menu { left: -100%; margin-left: 10px; -webkit-border-radius: 6px 0 6px 6px; -moz-border-radius: 6px 0 6px 6px; border-radius: 6px 0 6px 6px; } .dropdown .dropdown-menu .nav-header { padding-left: 20px; padding-right: 20px; } .typeahead { z-index: 1051; margin-top: 2px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #dddddd; border: 1px solid #cbcbcb; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); } .well-large { padding: 24px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .well-small { padding: 9px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .fade { opacity: 0; -webkit-transition: opacity 0.15s linear; -moz-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; } .fade.in { opacity: 1; } .collapse { position: relative; height: 0; overflow: hidden; -webkit-transition: height 0.35s ease; -moz-transition: height 0.35s ease; -o-transition: height 0.35s ease; transition: height 0.35s ease; } .collapse.in { height: auto; } .close { float: right; font-size: 20px; font-weight: bold; line-height: 21px; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20); } .close:hover, .close:focus { color: #000000; text-decoration: none; cursor: pointer; opacity: 0.4; filter: alpha(opacity=40); } button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; } .btn { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; padding: 4px 12px; margin-bottom: 0; font-size: 15px; line-height: 21px; text-align: center; vertical-align: middle; cursor: pointer; color: #333333; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); background-color: #f5f5f5; background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); border-color: #e6e6e6 #e6e6e6 #bfbfbf; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #e6e6e6; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); border: 1px solid #d9d9d9; *border: 0; border-bottom-color: #bfbfbf; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; *margin-left: .3em; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); } .btn:hover, .btn:focus, .btn:active, .btn.active, .btn.disabled, .btn[disabled] { color: #333333; background-color: #e6e6e6; *background-color: #d9d9d9; } .btn:active, .btn.active { background-color: #cccccc \9; } .btn:first-child { *margin-left: 0; } .btn:hover, .btn:focus { color: #333333; text-decoration: none; background-position: 0 -15px; -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s linear; -o-transition: background-position 0.1s linear; transition: background-position 0.1s linear; } .btn:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn.active, .btn:active { background-image: none; outline: 0; -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); } .btn.disabled, .btn[disabled] { cursor: default; background-image: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn-large { padding: 11px 19px; font-size: 18.75px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .btn-large [class^="icon-"], .btn-large [class*=" icon-"] { margin-top: 4px; } .btn-small { padding: 2px 10px; font-size: 12.75px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .btn-small [class^="icon-"], .btn-small [class*=" icon-"] { margin-top: 0; } .btn-mini [class^="icon-"], .btn-mini [class*=" icon-"] { margin-top: -1px; } .btn-mini { padding: 0px 6px; font-size: 11.25px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .btn-block { display: block; width: 100%; padding-left: 0; padding-right: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .btn-block + .btn-block { margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { width: 100%; } .btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-inverse.active { color: rgba(255, 255, 255, 0.75); } .btn-primary { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #016a5b; background-image: -moz-linear-gradient(top, #017464, #CC3333); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#017464), to(#CC3333)); background-image: -webkit-linear-gradient(top, #017464, #CC3333); background-image: -o-linear-gradient(top, #017464, #CC3333); background-image: linear-gradient(to bottom, #017464, #CC3333); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff017464', endColorstr='#ff015b4e', GradientType=0); border-color: #CC3333 #CC3333 #000f0d; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #CC3333; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { color: #ffffff; background-color: #CC3333; *background-color: #014238; } .btn-primary:active, .btn-primary.active { background-color: #002923 \9; } .btn-warning { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #f36f30; background-image: -moz-linear-gradient(top, #f3763a, #f26522); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3763a), to(#f26522)); background-image: -webkit-linear-gradient(top, #f3763a, #f26522); background-image: -o-linear-gradient(top, #f3763a, #f26522); background-image: linear-gradient(to bottom, #f3763a, #f26522); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff3763a', endColorstr='#fff26522', GradientType=0); border-color: #f26522 #f26522 #bc440b; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #f26522; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] { color: #ffffff; background-color: #f26522; *background-color: #ed560e; } .btn-warning:active, .btn-warning.active { background-color: #d44d0d \9; } .btn-danger { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #d44f3e; background-image: -moz-linear-gradient(top, #d65747, #d14432); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#d65747), to(#d14432)); background-image: -webkit-linear-gradient(top, #d65747, #d14432); background-image: -o-linear-gradient(top, #d65747, #d14432); background-image: linear-gradient(to bottom, #d65747, #d14432); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd65747', endColorstr='#ffd14432', GradientType=0); border-color: #d14432 #d14432 #952f21; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #d14432; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] { color: #ffffff; background-color: #d14432; *background-color: #bf3c2b; } .btn-danger:active, .btn-danger.active { background-color: #aa3526 \9; } .btn-success { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #0065b4; background-image: -moz-linear-gradient(top, #006bbe, #005ca4); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#006bbe), to(#005ca4)); background-image: -webkit-linear-gradient(top, #006bbe, #005ca4); background-image: -o-linear-gradient(top, #006bbe, #005ca4); background-image: linear-gradient(to bottom, #006bbe, #005ca4); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff006bbe', endColorstr='#ff005ca4', GradientType=0); border-color: #005ca4 #005ca4 #003158; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #005ca4; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] { color: #ffffff; background-color: #005ca4; *background-color: #004e8b; } .btn-success:active, .btn-success.active { background-color: #004071 \9; } .btn-info { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #32a0c0; background-image: -moz-linear-gradient(top, #34a7c8, #2f96b4); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#34a7c8), to(#2f96b4)); background-image: -webkit-linear-gradient(top, #34a7c8, #2f96b4); background-image: -o-linear-gradient(top, #34a7c8, #2f96b4); background-image: linear-gradient(to bottom, #34a7c8, #2f96b4); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff34a7c8', endColorstr='#ff2f96b4', GradientType=0); border-color: #2f96b4 #2f96b4 #1f6377; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #2f96b4; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] { color: #ffffff; background-color: #2f96b4; *background-color: #2a85a0; } .btn-info:active, .btn-info.active { background-color: #24748c \9; } .btn-inverse { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #505050; background-image: -moz-linear-gradient(top, #555555, #484848); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#484848)); background-image: -webkit-linear-gradient(top, #555555, #484848); background-image: -o-linear-gradient(top, #555555, #484848); background-image: linear-gradient(to bottom, #555555, #484848); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff555555', endColorstr='#ff484848', GradientType=0); border-color: #484848 #484848 #222222; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #484848; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-inverse:hover, .btn-inverse:focus, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] { color: #ffffff; background-color: #484848; *background-color: #3c3c3c; } .btn-inverse:active, .btn-inverse.active { background-color: #2f2f2f \9; } button.btn, input[type="submit"].btn { *padding-top: 3px; *padding-bottom: 3px; } button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner { padding: 0; border: 0; } button.btn.btn-large, input[type="submit"].btn.btn-large { *padding-top: 7px; *padding-bottom: 7px; } button.btn.btn-small, input[type="submit"].btn.btn-small { *padding-top: 3px; *padding-bottom: 3px; } button.btn.btn-mini, input[type="submit"].btn.btn-mini { *padding-top: 1px; *padding-bottom: 1px; } .btn-link, .btn-link:active, .btn-link[disabled] { background-color: transparent; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn-link { border-color: transparent; cursor: pointer; color: #CC3333; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-link:hover, .btn-link:focus { color: #CC3333; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, .btn-link[disabled]:focus { color: #333333; text-decoration: none; } .btn-group { position: relative; display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; font-size: 0; vertical-align: middle; white-space: nowrap; *margin-left: .3em; } .btn-group:first-child { *margin-left: 0; } .btn-group + .btn-group { margin-left: 5px; } .btn-toolbar { font-size: 0; margin-top: 10.5px; margin-bottom: 10.5px; } .btn-toolbar > .btn + .btn, .btn-toolbar > .btn-group + .btn, .btn-toolbar > .btn + .btn-group { margin-left: 5px; } .btn-group > .btn { position: relative; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-group > .btn + .btn { margin-left: -1px; } .btn-group > .btn, .btn-group > .dropdown-menu, .btn-group > .popover { font-size: 15px; } .btn-group > .btn-mini { font-size: 11.25px; } .btn-group > .btn-small { font-size: 12.75px; } .btn-group > .btn-large { font-size: 18.75px; } .btn-group > .btn:first-child { margin-left: 0; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .btn-group > .btn:last-child, .btn-group > .dropdown-toggle { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } .btn-group > .btn.large:first-child { margin-left: 0; -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; } .btn-group > .btn.large:last-child, .btn-group > .large.dropdown-toggle { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; } .btn-group > .btn:hover, .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active { z-index: 2; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; -webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); *padding-top: 5px; *padding-bottom: 5px; } .btn-group > .btn-mini + .dropdown-toggle { padding-left: 5px; padding-right: 5px; *padding-top: 2px; *padding-bottom: 2px; } .btn-group > .btn-small + .dropdown-toggle { *padding-top: 5px; *padding-bottom: 4px; } .btn-group > .btn-large + .dropdown-toggle { padding-left: 12px; padding-right: 12px; *padding-top: 7px; *padding-bottom: 7px; } .btn-group.open .dropdown-toggle { background-image: none; -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); } .btn-group.open .btn.dropdown-toggle { background-color: #e6e6e6; } .btn-group.open .btn-primary.dropdown-toggle { background-color: #CC3333; } .btn-group.open .btn-warning.dropdown-toggle { background-color: #f26522; } .btn-group.open .btn-danger.dropdown-toggle { background-color: #d14432; } .btn-group.open .btn-success.dropdown-toggle { background-color: #005ca4; } .btn-group.open .btn-info.dropdown-toggle { background-color: #2f96b4; } .btn-group.open .btn-inverse.dropdown-toggle { background-color: #484848; } .btn .caret { margin-top: 8px; margin-left: 0; } .btn-large .caret { margin-top: 6px; } .btn-large .caret { border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; } .btn-mini .caret, .btn-small .caret { margin-top: 8px; } .dropup .btn-large .caret { border-bottom-width: 5px; } .btn-primary .caret, .btn-warning .caret, .btn-danger .caret, .btn-info .caret, .btn-success .caret, .btn-inverse .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; } .btn-group-vertical { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; } .btn-group-vertical > .btn { display: block; float: none; max-width: 100%; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-group-vertical > .btn + .btn { margin-left: 0; margin-top: -1px; } .btn-group-vertical > .btn:first-child { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .btn-group-vertical > .btn:last-child { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .btn-group-vertical > .btn-large:first-child { -webkit-border-radius: 6px 6px 0 0; -moz-border-radius: 6px 6px 0 0; border-radius: 6px 6px 0 0; } .btn-group-vertical > .btn-large:last-child { -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; } .alert { padding: 8px 35px 8px 14px; margin-bottom: 21px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); background-color: #f26522; border: 1px solid #f13614; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .alert, .alert h4 { color: #ffffff; } .alert h4 { margin: 0; } .alert .close { position: relative; top: -2px; right: -21px; line-height: 21px; } .alert-success { background-color: #24c00b; border-color: #3aa80a; color: #ffffff; } .alert-success h4 { color: #ffffff; } .alert-danger, .alert-error { background-color: #d14432; border-color: #c72d35; color: #ffffff; } .alert-danger h4, .alert-error h4 { color: #ffffff; } .alert-info { background-color: #185af9; border-color: #066ee7; color: #ffffff; } .alert-info h4 { color: #ffffff; } .alert-block { padding-top: 14px; padding-bottom: 14px; } .alert-block > p, .alert-block > ul { margin-bottom: 0; } .alert-block p + p { margin-top: 5px; } .nav { margin-left: 0; margin-bottom: 21px; list-style: none; } .nav > li > a { display: block; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eeeeee; } .nav > li > a > img { max-width: none; } .nav > .pull-right { float: right; } .nav-header { display: block; padding: 3px 15px; font-size: 11px; font-weight: bold; line-height: 21px; color: #999999; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); text-transform: uppercase; } .nav li + .nav-header { margin-top: 9px; } .nav-list { padding-left: 15px; padding-right: 15px; margin-bottom: 0; } .nav-list > li > a, .nav-list .nav-header { margin-left: -15px; margin-right: -15px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } .nav-list > li > a { padding: 3px 15px; } .nav-list > .active > a, .nav-list > .active > a:hover, .nav-list > .active > a:focus { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); background-color: #CC3333; } .nav-list [class^="icon-"], .nav-list [class*=" icon-"] { margin-right: 2px; } .nav-list .divider { *width: 100%; height: 1px; margin: 9.5px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #ffffff; } .nav-tabs, .nav-pills { *zoom: 1; } .nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after { display: table; content: ""; line-height: 0; } .nav-tabs:after, .nav-pills:after { clear: both; } .nav-tabs > li, .nav-pills > li { float: left; } .nav-tabs > li > a, .nav-pills > li > a { padding-right: 12px; padding-left: 12px; margin-right: 2px; line-height: normal; } .nav-tabs { border-bottom: 1px solid #ddd; } .nav-tabs > li { margin-bottom: -1px; } .nav-tabs > li > a { padding-top: 8px; padding-bottom: 8px; line-height: 21px; border: 1px solid transparent; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover, .nav-tabs > li > a:focus { border-color: #eeeeee #eeeeee #dddddd; } .nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus { color: #555555; background-color: #ffffff; border: 1px solid #ddd; border-bottom-color: transparent; cursor: default; } .nav-pills > li > a { padding: 2px; margin-top: 0px; margin-bottom: 0px; -webkit-border-radius: 0px; -moz-border-radius: 0px; border-radius: 0px; } .nav-pills > .active > a, .nav-pills > .active > a:hover, .nav-pills > .active > a:focus { color: #ffffff; background-color: #CC3333; } .nav-stacked > li { float: none; } .nav-stacked > li > a { margin-right: 0; } .nav-tabs.nav-stacked { border-bottom: 0; } .nav-tabs.nav-stacked > li > a { border: 1px solid #ddd; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .nav-tabs.nav-stacked > li:first-child > a { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; } .nav-tabs.nav-stacked > li:last-child > a { -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .nav-tabs.nav-stacked > li > a:hover, .nav-tabs.nav-stacked > li > a:focus { border-color: #ddd; z-index: 2; } .nav-pills.nav-stacked > li > a { margin-bottom: 0px; } .nav-pills.nav-stacked > li:last-child > a { margin-bottom: 1px; } .nav-tabs .dropdown-menu { -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; } .nav-pills .dropdown-menu { -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .nav .dropdown-toggle .caret { border-top-color: #CC3333; border-bottom-color: #CC3333; margin-top: 6px; } .nav .dropdown-toggle:hover .caret, .nav .dropdown-toggle:focus .caret { border-top-color: #CC3333; border-bottom-color: #CC3333; } /* move down carets for tabs */ .nav-tabs .dropdown-toggle .caret { margin-top: 8px; } .nav .active .dropdown-toggle .caret { border-top-color: #fff; border-bottom-color: #fff; } .nav-tabs .active .dropdown-toggle .caret { border-top-color: #555555; border-bottom-color: #555555; } .nav > .dropdown.active > a:hover, .nav > .dropdown.active > a:focus { cursor: pointer; } .nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > li.dropdown.open.active > a:hover, .nav > li.dropdown.open.active > a:focus { color: #ffffff; background-color: #999999; border-color: #999999; } .nav li.dropdown.open .caret, .nav li.dropdown.open.active .caret, .nav li.dropdown.open a:hover .caret, .nav li.dropdown.open a:focus .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; opacity: 1; filter: alpha(opacity=100); } .tabs-stacked .open > a:hover, .tabs-stacked .open > a:focus { border-color: #999999; } .tabbable { *zoom: 1; } .tabbable:before, .tabbable:after { display: table; content: ""; line-height: 0; } .tabbable:after { clear: both; } .tab-content { overflow: auto; } .tabs-below > .nav-tabs, .tabs-right > .nav-tabs, .tabs-left > .nav-tabs { border-bottom: 0; } .tab-content > .tab-pane, .pill-content > .pill-pane { display: none; } .tab-content > .active, .pill-content > .active { display: block; } .tabs-below > .nav-tabs { border-top: 1px solid #ddd; } .tabs-below > .nav-tabs > li { margin-top: -1px; margin-bottom: 0; } .tabs-below > .nav-tabs > li > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .tabs-below > .nav-tabs > li > a:hover, .tabs-below > .nav-tabs > li > a:focus { border-bottom-color: transparent; border-top-color: #ddd; } .tabs-below > .nav-tabs > .active > a, .tabs-below > .nav-tabs > .active > a:hover, .tabs-below > .nav-tabs > .active > a:focus { border-color: transparent #ddd #ddd #ddd; } .tabs-left > .nav-tabs > li, .tabs-right > .nav-tabs > li { float: none; } .tabs-left > .nav-tabs > li > a, .tabs-right > .nav-tabs > li > a { min-width: 74px; margin-right: 0; margin-bottom: 3px; } .tabs-left > .nav-tabs { float: left; margin-right: 19px; border-right: 1px solid #ddd; } .tabs-left > .nav-tabs > li > a { margin-right: -1px; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; } .tabs-left > .nav-tabs > li > a:hover, .tabs-left > .nav-tabs > li > a:focus { border-color: #eeeeee #dddddd #eeeeee #eeeeee; } .tabs-left > .nav-tabs .active > a, .tabs-left > .nav-tabs .active > a:hover, .tabs-left > .nav-tabs .active > a:focus { border-color: #ddd transparent #ddd #ddd; *border-right-color: #ffffff; } .tabs-right > .nav-tabs { float: right; margin-left: 19px; border-left: 1px solid #ddd; } .tabs-right > .nav-tabs > li > a { margin-left: -1px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .tabs-right > .nav-tabs > li > a:hover, .tabs-right > .nav-tabs > li > a:focus { border-color: #eeeeee #eeeeee #eeeeee #dddddd; } .tabs-right > .nav-tabs .active > a, .tabs-right > .nav-tabs .active > a:hover, .tabs-right > .nav-tabs .active > a:focus { border-color: #ddd #ddd #ddd transparent; *border-left-color: #ffffff; } .nav > .disabled > a { color: #999999; } .nav > .disabled > a:hover, .nav > .disabled > a:focus { text-decoration: none; background-color: transparent; cursor: default; } .navbar { overflow: visible; margin-bottom: 21px; *position: relative; *z-index: 2; } .navbar-inner { min-height: 55px; padding-left: 20px; padding-right: 20px; background-color: #CC3333; background-image: -moz-linear-gradient(top, #CC3333, #CC3333); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#CC3333), to(#CC3333)); background-image: -webkit-linear-gradient(top, #CC3333, #CC3333); background-image: -o-linear-gradient(top, #CC3333, #CC3333); background-image: linear-gradient(to bottom, #CC3333, #CC3333); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff013435', endColorstr='#ff013435', GradientType=0); border: 1px solid #011b1c; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); *zoom: 1; } .navbar-inner:before, .navbar-inner:after { display: table; content: ""; line-height: 0; } .navbar-inner:after { clear: both; } .navbar .container { width: auto; } .nav-collapse.collapse { height: auto; overflow: visible; } .navbar .brand { float: left; display: block; padding: 17px 20px 17px; margin-left: -20px; font-size: 20px; font-weight: 200; color: #ffffff; text-shadow: 0 1px 0 #CC3333; } .navbar .brand:hover, .navbar .brand:focus { text-decoration: none; } .navbar-text { margin-bottom: 0; line-height: 55px; color: #999999; } .navbar-link { color: #ffffff; } .navbar-link:hover, .navbar-link:focus { color: #ffffff; } .navbar .divider-vertical { height: 55px; margin: 0 9px; border-left: 1px solid #CC3333; border-right: 1px solid #CC3333; } .navbar .btn, .navbar .btn-group { margin-top: 12.5px; } .navbar .btn-group .btn, .navbar .input-prepend .btn, .navbar .input-append .btn, .navbar .input-prepend .btn-group, .navbar .input-append .btn-group { margin-top: 0; } .navbar-form { margin-bottom: 0; *zoom: 1; } .navbar-form:before, .navbar-form:after { display: table; content: ""; line-height: 0; } .navbar-form:after { clear: both; } .navbar-form input, .navbar-form select, .navbar-form .radio, .navbar-form .checkbox { margin-top: 12.5px; } .navbar-form input, .navbar-form select, .navbar-form .btn { display: inline-block; margin-bottom: 0; } .navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] { margin-top: 3px; } .navbar-form .input-append, .navbar-form .input-prepend { margin-top: 5px; white-space: nowrap; } .navbar-form .input-append input, .navbar-form .input-prepend input { margin-top: 0; } .navbar-search { position: relative; float: left; margin-top: 12.5px; margin-bottom: 0; } .navbar-search .search-query { margin-bottom: 0; padding: 4px 14px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; font-weight: normal; line-height: 1; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; } .navbar-static-top { position: static; margin-bottom: 0; } .navbar-static-top .navbar-inner { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; margin-bottom: 0; } .navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner { border-width: 0 0 1px; } .navbar-fixed-bottom .navbar-inner { border-width: 1px 0 0; } .navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner { padding-left: 0; padding-right: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 940px; } .navbar-fixed-top { top: 0; } .navbar-fixed-top .navbar-inner, .navbar-static-top .navbar-inner { -webkit-box-shadow: 0 1px 10px rgba(0,0,0,.1); -moz-box-shadow: 0 1px 10px rgba(0,0,0,.1); box-shadow: 0 1px 10px rgba(0,0,0,.1); } .navbar-fixed-bottom { bottom: 0; } .navbar-fixed-bottom .navbar-inner { -webkit-box-shadow: 0 -1px 10px rgba(0,0,0,.1); -moz-box-shadow: 0 -1px 10px rgba(0,0,0,.1); box-shadow: 0 -1px 10px rgba(0,0,0,.1); } .navbar .nav { position: relative; left: 0; display: block; float: left; margin: 0 10px 0 0; } .navbar .nav.pull-right { float: right; margin-right: 0; } .navbar .nav > li { float: left; } .navbar .nav > li > a { float: none; padding: 17px 15px 17px; color: #ffffff; text-decoration: none; text-shadow: 0 1px 0 #CC3333; } .navbar .nav .dropdown-toggle .caret { margin-top: 8px; } .navbar .nav > li > a:focus, .navbar .nav > li > a:hover { background-color: #002425; color: #ffffff; text-decoration: none; } .navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus { color: #ffffff; text-decoration: none; background-color: #002425; -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); } .navbar .btn-navbar { display: none; float: right; padding: 7px 10px; margin-left: 5px; margin-right: 5px; color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #011b1c; background-image: -moz-linear-gradient(top, #011b1c, #011b1c); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#011b1c), to(#011b1c)); background-image: -webkit-linear-gradient(top, #011b1c, #011b1c); background-image: -o-linear-gradient(top, #011b1c, #011b1c); background-image: linear-gradient(to bottom, #011b1c, #011b1c); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff011b1c', endColorstr='#ff011b1c', GradientType=0); border-color: #011b1c #011b1c #000000; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #011b1c; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); } .navbar .btn-navbar:hover, .navbar .btn-navbar:focus, .navbar .btn-navbar:active, .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled] { color: #ffffff; background-color: #011b1c; *background-color: #000303; } .navbar .btn-navbar:active, .navbar .btn-navbar.active { background-color: #000000 \9; } .navbar .btn-navbar .icon-bar { display: block; width: 18px; height: 2px; background-color: #f5f5f5; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); } .btn-navbar .icon-bar + .icon-bar { margin-top: 3px; } .navbar .nav > li > .dropdown-menu:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: transparent; position: absolute; top: -7px; left: 9px; } .navbar .nav > li > .dropdown-menu:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #002425; position: absolute; top: -6px; left: 10px; } .navbar-fixed-bottom .nav > li > .dropdown-menu:before { border-top: 7px solid #ccc; border-top-color: transparent; border-bottom: 0; bottom: -7px; top: auto; } .navbar-fixed-bottom .nav > li > .dropdown-menu:after { border-top: 6px solid #002425; border-bottom: 0; bottom: -6px; top: auto; } .navbar .nav li.dropdown > a:hover .caret, .navbar .nav li.dropdown > a:focus .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; } .navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.active > .dropdown-toggle, .navbar .nav li.dropdown.open.active > .dropdown-toggle { background-color: #002425; color: #ffffff; } .navbar .nav li.dropdown > .dropdown-toggle .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; } .navbar .nav li.dropdown.open > .dropdown-toggle .caret, .navbar .nav li.dropdown.active > .dropdown-toggle .caret, .navbar .nav li.dropdown.open.active > .dropdown-toggle .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; } .navbar .pull-right > li > .dropdown-menu, .navbar .nav > li > .dropdown-menu.pull-right { left: auto; right: 0; } .navbar .pull-right > li > .dropdown-menu:before, .navbar .nav > li > .dropdown-menu.pull-right:before { left: auto; right: 12px; } .navbar .pull-right > li > .dropdown-menu:after, .navbar .nav > li > .dropdown-menu.pull-right:after { left: auto; right: 13px; } .navbar .pull-right > li > .dropdown-menu .dropdown-menu, .navbar .nav > li > .dropdown-menu.pull-right .dropdown-menu { left: auto; right: 100%; margin-left: 0; margin-right: -1px; -webkit-border-radius: 6px 0 6px 6px; -moz-border-radius: 6px 0 6px 6px; border-radius: 6px 0 6px 6px; } .navbar-inverse .navbar-inner { background-color: #e5e5e5; background-image: -moz-linear-gradient(top, #eaeaea, #dddddd); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eaeaea), to(#dddddd)); background-image: -webkit-linear-gradient(top, #eaeaea, #dddddd); background-image: -o-linear-gradient(top, #eaeaea, #dddddd); background-image: linear-gradient(to bottom, #eaeaea, #dddddd); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffeaeaea', endColorstr='#ffdddddd', GradientType=0); border-color: #d0d0d0; } .navbar-inverse .brand, .navbar-inverse .nav > li > a { color: #333333; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .navbar-inverse .brand:hover, .navbar-inverse .nav > li > a:hover, .navbar-inverse .brand:focus, .navbar-inverse .nav > li > a:focus { color: #333333; } .navbar-inverse .brand { color: #333333; } .navbar-inverse .navbar-text { color: #555555; } .navbar-inverse .nav > li > a:focus, .navbar-inverse .nav > li > a:hover { background-color: #cbcbcb; color: #333333; } .navbar-inverse .nav .active > a, .navbar-inverse .nav .active > a:hover, .navbar-inverse .nav .active > a:focus { color: #333333; background-color: #cbcbcb; } .navbar-inverse .navbar-link { color: #333333; } .navbar-inverse .navbar-link:hover, .navbar-inverse .navbar-link:focus { color: #333333; } .navbar-inverse .divider-vertical { border-left-color: #dddddd; border-right-color: #eaeaea; } .navbar-inverse .nav li.dropdown.open > .dropdown-toggle, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { background-color: #cbcbcb; color: #333333; } .navbar-inverse .nav li.dropdown > a:hover .caret, .navbar-inverse .nav li.dropdown > a:focus .caret { border-top-color: #333333; border-bottom-color: #333333; } .navbar-inverse .nav li.dropdown > .dropdown-toggle .caret { border-top-color: #333333; border-bottom-color: #333333; } .navbar-inverse .nav li.dropdown.open > .dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.active > .dropdown-toggle .caret, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle .caret { border-top-color: #333333; border-bottom-color: #333333; } .navbar-inverse .navbar-search .search-query { color: #ffffff; background-color: #ffffff; border-color: #dddddd; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15); box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15); -webkit-transition: none; -moz-transition: none; -o-transition: none; transition: none; } .navbar-inverse .navbar-search .search-query:-moz-placeholder { color: #555555; } .navbar-inverse .navbar-search .search-query:-ms-input-placeholder { color: #555555; } .navbar-inverse .navbar-search .search-query::-webkit-input-placeholder { color: #555555; } .navbar-inverse .navbar-search .search-query:focus, .navbar-inverse .navbar-search .search-query.focused { padding: 5px 15px; color: #333333; text-shadow: 0 1px 0 #ffffff; background-color: #ffffff; border: 0; -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); outline: 0; } .navbar-inverse .btn-navbar { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #d8d8d8; background-image: -moz-linear-gradient(top, #dddddd, #d0d0d0); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#dddddd), to(#d0d0d0)); background-image: -webkit-linear-gradient(top, #dddddd, #d0d0d0); background-image: -o-linear-gradient(top, #dddddd, #d0d0d0); background-image: linear-gradient(to bottom, #dddddd, #d0d0d0); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdddddd', endColorstr='#ffd0d0d0', GradientType=0); border-color: #d0d0d0 #d0d0d0 #aaaaaa; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #d0d0d0; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .navbar-inverse .btn-navbar:hover, .navbar-inverse .btn-navbar:focus, .navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active, .navbar-inverse .btn-navbar.disabled, .navbar-inverse .btn-navbar[disabled] { color: #ffffff; background-color: #d0d0d0; *background-color: #c3c3c3; } .navbar-inverse .btn-navbar:active, .navbar-inverse .btn-navbar.active { background-color: #b7b7b7 \9; } .breadcrumb { padding: 8px 15px; margin: 0 0 21px; list-style: none; background-color: #f5f5f5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .breadcrumb > li { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; text-shadow: 0 1px 0 #ffffff; } .breadcrumb > li > .divider { padding: 0 5px; color: #ccc; } .breadcrumb > .active { color: #999999; } .pagination { margin: 21px 0; } .pagination ul { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; margin-left: 0; margin-bottom: 0; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } .pagination ul > li { display: inline; } .pagination ul > li > a, .pagination ul > li > span { float: left; padding: 4px 12px; line-height: 21px; text-decoration: none; background-color: #e6e6e6; border: 1px solid transparent; border-left-width: 0; } .pagination ul > li > a:hover, .pagination ul > li > a:focus, .pagination ul > .active > a, .pagination ul > .active > span { background-color: #a2cdb5; } .pagination ul > .active > a, .pagination ul > .active > span { color: #999999; cursor: default; } .pagination ul > .disabled > span, .pagination ul > .disabled > a, .pagination ul > .disabled > a:hover, .pagination ul > .disabled > a:focus { color: #999999; background-color: transparent; cursor: default; } .pagination ul > li:first-child > a, .pagination ul > li:first-child > span { border-left-width: 1px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .pagination ul > li:last-child > a, .pagination ul > li:last-child > span { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } .pagination-centered { text-align: center; } .pagination-right { text-align: right; } .pagination-large ul > li > a, .pagination-large ul > li > span { padding: 11px 19px; font-size: 18.75px; } .pagination-large ul > li:first-child > a, .pagination-large ul > li:first-child > span { -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; } .pagination-large ul > li:last-child > a, .pagination-large ul > li:last-child > span { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; } .pagination-mini ul > li:first-child > a, .pagination-small ul > li:first-child > a, .pagination-mini ul > li:first-child > span, .pagination-small ul > li:first-child > span { -webkit-border-top-left-radius: 3px; -moz-border-radius-topleft: 3px; border-top-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; -moz-border-radius-bottomleft: 3px; border-bottom-left-radius: 3px; } .pagination-mini ul > li:last-child > a, .pagination-small ul > li:last-child > a, .pagination-mini ul > li:last-child > span, .pagination-small ul > li:last-child > span { -webkit-border-top-right-radius: 3px; -moz-border-radius-topright: 3px; border-top-right-radius: 3px; -webkit-border-bottom-right-radius: 3px; -moz-border-radius-bottomright: 3px; border-bottom-right-radius: 3px; } .pagination-small ul > li > a, .pagination-small ul > li > span { padding: 2px 10px; font-size: 12.75px; } .pagination-mini ul > li > a, .pagination-mini ul > li > span { padding: 0px 6px; font-size: 11.25px; } .pager { margin: 21px 0; list-style: none; text-align: center; *zoom: 1; } .pager:before, .pager:after { display: table; content: ""; line-height: 0; } .pager:after { clear: both; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #ddd; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #f5f5f5; } .pager .next > a, .pager .next > span { float: right; } .pager .previous > a, .pager .previous > span { float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #999999; background-color: #fff; cursor: default; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000000; } .modal-backdrop.fade { opacity: 0; } .modal-backdrop, .modal-backdrop.fade.in { opacity: 0.8; filter: alpha(opacity=80); } .modal { position: fixed; top: 10%; left: 50%; z-index: 1050; width: 560px; margin-left: -280px; background-color: #ffffff; border: 1px solid #999; border: 1px solid rgba(0, 0, 0, 0.3); *border: 1px solid #999; /* IE6-7 */ -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; outline: none; } .modal.fade { -webkit-transition: opacity .3s linear, top .3s ease-out; -moz-transition: opacity .3s linear, top .3s ease-out; -o-transition: opacity .3s linear, top .3s ease-out; transition: opacity .3s linear, top .3s ease-out; top: -25%; } .modal.fade.in { top: 10%; } .modal-header { padding: 9px 15px; border-bottom: 1px solid #eee; } .modal-header .close { margin-top: 2px; } .modal-header h3 { margin: 0; line-height: 30px; } .modal-body { position: relative; overflow-y: auto; max-height: 400px; padding: 15px; } .modal-form { margin-bottom: 0; } .modal-footer { padding: 14px 15px 15px; margin-bottom: 0; text-align: right; background-color: #f5f5f5; border-top: 1px solid #ddd; -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; -webkit-box-shadow: inset 0 1px 0 #ffffff; -moz-box-shadow: inset 0 1px 0 #ffffff; box-shadow: inset 0 1px 0 #ffffff; *zoom: 1; } .modal-footer:before, .modal-footer:after { display: table; content: ""; line-height: 0; } .modal-footer:after { clear: both; } .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .modal-footer .btn-block + .btn-block { margin-left: 0; } .tooltip { position: absolute; z-index: 1030; display: block; visibility: visible; font-size: 11px; line-height: 1.4; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.8; filter: alpha(opacity=80); } .tooltip.top { margin-top: -3px; padding: 5px 0; } .tooltip.right { margin-left: 3px; padding: 0 5px; } .tooltip.bottom { margin-top: 3px; padding: 5px 0; } .tooltip.left { margin-left: -3px; padding: 0 5px; } .tooltip-inner { max-width: 200px; padding: 8px; color: #ffffff; text-align: center; text-decoration: none; background-color: #000000; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .popover { position: absolute; top: 0; left: 0; z-index: 1010; display: none; max-width: 276px; padding: 1px; text-align: left; background-color: #ffffff; -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.2); -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); white-space: normal; } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { margin: 0; padding: 8px 14px; font-size: 14px; font-weight: normal; line-height: 18px; background-color: #CC3333; border-bottom: 1px solid #014238; -webkit-border-radius: 5px 5px 0 0; -moz-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; } .popover-title:empty { display: none; } .popover-content { padding: 9px 14px; } .popover .arrow, .popover .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover .arrow { border-width: 11px; } .popover .arrow:after { border-width: 10px; content: ""; } .popover.top .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: #999; border-top-color: rgba(0, 0, 0, 0.25); bottom: -11px; } .popover.top .arrow:after { bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #ffffff; } .popover.right .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: #999; border-right-color: rgba(0, 0, 0, 0.25); } .popover.right .arrow:after { left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #ffffff; } .popover.bottom .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999; border-bottom-color: rgba(0, 0, 0, 0.25); top: -11px; } .popover.bottom .arrow:after { top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #ffffff; } .popover.left .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999; border-left-color: rgba(0, 0, 0, 0.25); } .popover.left .arrow:after { right: 1px; border-right-width: 0; border-left-color: #ffffff; bottom: -10px; } .thumbnails { margin-left: -20px; list-style: none; *zoom: 1; } .thumbnails:before, .thumbnails:after { display: table; content: ""; line-height: 0; } .thumbnails:after { clear: both; } .row-fluid .thumbnails { margin-left: 0; } .thumbnails > li { float: left; margin-bottom: 21px; margin-left: 20px; } .thumbnail { display: block; padding: 4px; line-height: 21px; border: 1px solid #ddd; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } a.thumbnail:hover, a.thumbnail:focus { border-color: #CC3333; -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); } .thumbnail > img { display: block; max-width: 100%; margin-left: auto; margin-right: auto; } .thumbnail .caption { padding: 9px; color: #555555; } .media, .media-body { overflow: hidden; *overflow: visible; zoom: 1; } .media, .media .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media-object { display: block; } .media-heading { margin: 0 0 5px; } .media > .pull-left { margin-right: 10px; } .media > .pull-right { margin-left: 10px; } .media-list { margin-left: 0; list-style: none; } .label, .badge { display: inline-block; padding: 2px 4px; font-size: 12.69px; font-weight: bold; line-height: 14px; color: #ffffff; vertical-align: baseline; white-space: nowrap; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #999999; } .label { -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .badge { padding-left: 9px; padding-right: 9px; -webkit-border-radius: 9px; -moz-border-radius: 9px; border-radius: 9px; } .label:empty, .badge:empty { display: none; } a.label:hover, a.label:focus, a.badge:hover, a.badge:focus { color: #ffffff; text-decoration: none; cursor: pointer; } .label-important, .badge-important { background-color: #ffffff; } .label-important[href], .badge-important[href] { background-color: #e6e6e6; } .label-warning, .badge-warning { background-color: #f26522; } .label-warning[href], .badge-warning[href] { background-color: #d44d0d; } .label-success, .badge-success { background-color: #ffffff; } .label-success[href], .badge-success[href] { background-color: #e6e6e6; } .label-info, .badge-info { background-color: #ffffff; } .label-info[href], .badge-info[href] { background-color: #e6e6e6; } .label-inverse, .badge-inverse { background-color: #333333; } .label-inverse[href], .badge-inverse[href] { background-color: #1a1a1a; } .btn .label, .btn .badge { position: relative; top: -1px; } .btn-mini .label, .btn-mini .badge { top: 0; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-moz-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-ms-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-o-keyframes progress-bar-stripes { from { background-position: 0 0; } to { background-position: 40px 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { overflow: hidden; height: 21px; margin-bottom: 21px; background-color: #f7f7f7; background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: linear-gradient(to bottom, #f5f5f5, #f9f9f9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0); -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .progress .bar { width: 0%; height: 100%; color: #ffffff; float: left; font-size: 12px; text-align: center; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #0e90d2; background-image: -moz-linear-gradient(top, #149bdf, #0480be); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); background-image: -webkit-linear-gradient(top, #149bdf, #0480be); background-image: -o-linear-gradient(top, #149bdf, #0480be); background-image: linear-gradient(to bottom, #149bdf, #0480be); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0); -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: width 0.6s ease; -moz-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; } .progress .bar + .bar { -webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15); -moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15); box-shadow: inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15); } .progress-striped .bar { background-color: #149bdf; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); -webkit-background-size: 40px 40px; -moz-background-size: 40px 40px; -o-background-size: 40px 40px; background-size: 40px 40px; } .progress.active .bar { -webkit-animation: progress-bar-stripes 2s linear infinite; -moz-animation: progress-bar-stripes 2s linear infinite; -ms-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-danger .bar, .progress .bar-danger { background-color: #dd514c; background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); background-image: linear-gradient(to bottom, #ee5f5b, #c43c35); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0); } .progress-danger.progress-striped .bar, .progress-striped .bar-danger { background-color: #ee5f5b; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-success .bar, .progress .bar-success { background-color: #5eb95e; background-image: -moz-linear-gradient(top, #62c462, #57a957); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); background-image: -webkit-linear-gradient(top, #62c462, #57a957); background-image: -o-linear-gradient(top, #62c462, #57a957); background-image: linear-gradient(to bottom, #62c462, #57a957); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0); } .progress-success.progress-striped .bar, .progress-striped .bar-success { background-color: #62c462; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-info .bar, .progress .bar-info { background-color: #4bb1cf; background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); background-image: -o-linear-gradient(top, #5bc0de, #339bb9); background-image: linear-gradient(to bottom, #5bc0de, #339bb9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0); } .progress-info.progress-striped .bar, .progress-striped .bar-info { background-color: #5bc0de; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-warning .bar, .progress .bar-warning { background-color: #f5834d; background-image: -moz-linear-gradient(top, #f6976a, #f26522); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f6976a), to(#f26522)); background-image: -webkit-linear-gradient(top, #f6976a, #f26522); background-image: -o-linear-gradient(top, #f6976a, #f26522); background-image: linear-gradient(to bottom, #f6976a, #f26522); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff6976a', endColorstr='#fff26522', GradientType=0); } .progress-warning.progress-striped .bar, .progress-striped .bar-warning { background-color: #f6976a; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .accordion { margin-bottom: 21px; } .accordion-group { margin-bottom: 2px; border: 1px solid #e5e5e5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .accordion-heading { border-bottom: 0; } .accordion-heading .accordion-toggle { display: block; padding: 8px 15px; } .accordion-toggle { cursor: pointer; } .accordion-inner { padding: 9px 15px; border-top: 1px solid #e5e5e5; } .carousel { position: relative; margin-bottom: 21px; line-height: 1; } .carousel-inner { overflow: hidden; width: 100%; position: relative; } .carousel-inner > .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -moz-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; line-height: 1; } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { display: block; } .carousel-inner > .active { left: 0; } .carousel-inner > .next, .carousel-inner > .prev { position: absolute; top: 0; width: 100%; } .carousel-inner > .next { left: 100%; } .carousel-inner > .prev { left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { left: 0; } .carousel-inner > .active.left { left: -100%; } .carousel-inner > .active.right { left: 100%; } .carousel-control { position: absolute; top: 40%; left: 15px; width: 40px; height: 40px; margin-top: -20px; font-size: 60px; font-weight: 100; line-height: 30px; color: #ffffff; text-align: center; background: #222222; border: 3px solid #ffffff; -webkit-border-radius: 23px; -moz-border-radius: 23px; border-radius: 23px; opacity: 0.5; filter: alpha(opacity=50); } .carousel-control.right { left: auto; right: 15px; } .carousel-control:hover, .carousel-control:focus { color: #ffffff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-indicators { position: absolute; top: 15px; right: 15px; z-index: 5; margin: 0; list-style: none; } .carousel-indicators li { display: block; float: left; width: 10px; height: 10px; margin-left: 5px; text-indent: -999px; background-color: #ccc; background-color: rgba(255, 255, 255, 0.25); border-radius: 5px; } .carousel-indicators .active { background-color: #fff; } .carousel-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 15px; background: #333333; background: rgba(0, 0, 0, 0.75); } .carousel-caption h4, .carousel-caption p { color: #ffffff; line-height: 21px; } .carousel-caption h4 { margin: 0 0 5px; } .carousel-caption p { margin-bottom: 0; } .hero-unit { padding: 60px; margin-bottom: 30px; font-size: 18px; font-weight: 200; line-height: 31.5px; color: inherit; background-color: #dddddd; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .hero-unit h1 { margin-bottom: 0; font-size: 60px; line-height: 1; color: #333333; letter-spacing: -1px; } .hero-unit li { line-height: 31.5px; } .pull-right { float: right; } .pull-left { float: left; } .hide { display: none; } .show { display: block; } .invisible { visibility: hidden; } .affix { position: fixed; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-family: Georgia, "Times New Roman", Times, serif; color: #333333; } .muted { color: #999999; } .jumbotron h1 { font-weight: normal !important; } .text-warning { color: #f26522; } .text-error { color: #d14432; } .text-success { color: #CC3333; } .text-info { color: #004e8b; } .page-header { border-bottom: none; padding-bottom: 5px; } .page-header h1 { margin-bottom: 0; } hr { border-bottom: none; } blockquote { border-left: 2px solid #333333; } blockquote.pull-right { border-right: 2px solid #333333; } blockquote small { color: #CC3333; } .navbar .navbar-inner { background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .navbar .brand { padding: 18px 20px 16px; font-size: 26px; font-family: 'Crete Round', serif; font-weight: normal; } .navbar .brand:hover { background-color: #002425; } .navbar .nav > li > a { padding: 20px 20px 14px; font-size: 20px; font-family: 'Crete Round', serif; font-weight: normal; text-shadow: none; } .navbar .nav > .active > a, .navbar .nav > .active > a:hover, .navbar .nav > .active > a:focus { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .navbar .navbar-text { margin: 19px 20px 0; font-size: 20px; font-family: 'Crete Round', serif; font-weight: normal; line-height: inherit; } .navbar .divider-vertical { border-color: rgba(0, 0, 0, 0.2); } .navbar .btn-navbar { margin-top: 14px; } .navbar .navbar-form, .navbar .navbar-search { border-color: transparent; margin-top: 12px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; line-height: normal; } .navbar .navbar-search .search-query { border-color: transparent; background-color: rgba(255, 255, 255, 0.4); line-height: normal; color: #ffffff; } .navbar .dropdown-menu li > a { font-family: 'Crete Round', serif; font-weight: normal; } .navbar .nav > li > .dropdown-menu::before, .navbar .nav > li > .dropdown-menu::after { border-bottom: none; } .navbar-inverse .navbar-search .search-query { color: #555555; } .navbar-inverse .dropdown-menu { background-color: #cbcbcb; } .navbar-inverse .dropdown-menu li > a { color: #333333; } .navbar-inverse .dropdown-menu li > a:hover { background-color: #dddddd; } .navbar-inverse .dropdown-menu .divider { border-bottom: 1px solid rgba(0, 0, 0, 0.2); } .navbar-inverse .dropdown-menu .nav-header { color: #555555; } @media (max-width: 979px) { .navbar .nav-collapse .nav li > a { color: #ffffff; } .navbar .nav-collapse .nav li > a:hover { background-color: #002425; } .navbar-inverse .nav-collapse .nav li > a:hover { background-color: rgba(0, 0, 0, 0.06) !important; } .nav-collapse .navbar-form, .nav-collapse .navbar-search { border: none !important; -webkit-box-shadow: none !important; -moz-box-shadow: none !important; box-shadow: none !important; } } div.subnav { background: #CC3333 none; border-color: transparent; } div.subnav .nav > li > a { padding: 12px 12px 10px; border-color: transparent; background-color: transparent; font-family: 'Crete Round', serif; font-weight: normal; color: #ffffff; } div.subnav .nav > li > a:hover, div.subnav .nav > .active > a, div.subnav .nav > .active > a:hover, div.subnav .dropdown.open .dropdown-toggle, div.subnav .dropdown.open.active .dropdown-toggle:hover { background-color: #002425; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; border-color: transparent; color: #ffffff; } div.subnav.subnav-fixed { top: 55px; } .nav .nav-header { color: #333333; } .nav .disabled > a, .nav .disabled > a:hover { background-color: #CC3333; color: #ffffff; } .nav-tabs { border-color: transparent; } .nav-tabs > li > a { background-color: #CC3333; color: #ffffff; } .nav-tabs > li > a:hover { background-color: #CC3333; border-color: transparent; } .nav-tabs .active > a, .nav-tabs .active > a:hover { background-color: #CC3333; border-color: transparent; color: #ffffff; } .nav-tabs.nav-stacked > li > a { border-color: transparent; } .nav-tabs.nav-stacked > li > a:hover { border-color: transparent; } .nav-tabs .open .dropdown-toggle, .nav-tabs .active.open .dropdown-toggle { background-color: #CC3333; } .nav-pills > li > a { background-color: #CC3333; color: #ffffff; } .nav-pills > li > a:hover { background-color: #CC3333; border-color: transparent; } .nav-pills .active > a, .nav-pills .active > a:hover { background-color: #CC3333; border-color: transparent; color: #ffffff; } .nav-pills .open .dropdown-toggle, .nav-pills .active.open .dropdown-toggle { background-color: #CC3333; } .tabbable .nav-tabs, .tabbable .nav-tabs > li > a, .tabbable .nav-tabs > li > a:hover, .tabbable .nav-tabs > li.active > a, .tabbable .nav-tabs > li.active > a:hover { border-color: transparent; } .nav-list .nav-header, .nav-list li > a { text-shadow: none; } .nav-list li > a:hover { background-color: #CC3333; color: #ffffff; } .nav-list li.active > a, .nav-list li.active > a:hover { background-color: #CC3333; text-shadow: none; } .nav-list .divider { background-color: transparent; border-bottom: 1px solid #999999; } .breadcrumb { background-color: #CC3333; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; border-color: transparent; } .breadcrumb li { color: #ffffff; text-shadow: none; } .breadcrumb li a { color: #ffffff; text-decoration: underline; } .breadcrumb li a:hover { color: #ffffff; } .breadcrumb li .divider { color: #ffffff; } .breadcrumb .active { color: #ffffff; } .pagination ul { background-color: #CC3333; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; border-color: transparent; } .pagination ul > li > a, .pagination ul > li > span { background-color: #CC3333; border-color: transparent; color: #ffffff; } .pagination ul > li > a:hover, .pagination ul > li > span:hover { background-color: #CC3333; color: #ffffff; } .pagination ul > .active > a, .pagination ul > .active > span { background-color: #CC3333; color: #ffffff; } .pagination ul > .disabled > a, .pagination ul > .disabled > a:hover, .pagination ul > .disabled > span, .pagination ul > .disabled > span:hover { background-color: #CC3333; color: #ffffff; } .pager li > a, .pager li > span { border: none; background-color: #CC3333; color: #ffffff; } .pager li > a:hover, .pager li > span:hover { background-color: #CC3333; } .pager .disabled a, .pager .disabled a:hover { background-color: #CC3333; color: #ffffff; } .btn { font-family: 'Crete Round', serif; font-weight: normal; text-shadow: none; } .btn-large { font-size: 18px; } .btn-group .dropdown-toggle { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .table th, .table-striped tbody tr:nth-child(odd) th { background-color: #CC3333; color: #ffffff; } .table tbody tr.success td { background-color: #B5EEAA; } .table tbody tr.error td { background-color: #EEB8B8; } .table tbody tr.info td { background-color: #AEE2EE; } legend { border-bottom: none; font-family: 'Crete Round', serif; font-weight: normal; color: #333333; } label, .help-block, input[type="file"] { color: #333333; } input, textarea, select { color: #555555; } .uneditable-input { color: #555555; } .form-actions { border-top: none; } .control-group.warning .control-label, .control-group.error .control-label, .control-group.success .control-label, .control-group.info .control-label { color: #555555; } .control-group.error .help-block, .control-group.error .help-inline { color: #d14432; } .control-group.error input, .control-group.error select, .control-group.error textarea { border: 1px solid #d14432; color: #555555; } .control-group.success .help-block, .control-group.success .help-inline { color: #CC3333; } .control-group.success input, .control-group.success select, .control-group.success textarea { border: 1px solid #CC3333; color: #555555; } .control-group.warning .help-block, .control-group.warning .help-inline { color: #f26522; } .control-group.warning input, .control-group.warning select, .control-group.warning textarea { border: 1px solid #f26522; color: #555555; } .control-group.info .help-block, .control-group.info .help-inline { color: #2f96b4; } .control-group.info input, .control-group.info select, .control-group.info textarea { border: 1px solid #2f96b4; color: #555555; } .alert { text-shadow: none; border: none; } .alert h1, .alert h2, .alert h3, .alert h4, .alert h5, .alert h6 { font-weight: bold; color: #ffffff; } .alert-heading { font-family: Georgia, "Times New Roman", Times, serif; color: inherit; } .badge, .label { background-color: #CC3333; text-shadow: none; } .badge-success, .label-success { background-color: #006bbe; } .badge-warning, .label-warning { background-color: #f3763a; } .badge-important, .label-important { background-color: #d65747; } .badge-info, .label-info { background-color: #34a7c8; } .badge-inverse, .label-inverse { background-color: #555555; } .well { border: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .hero-unit { border: none; } .thumbnail { border: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .dropdown-menu .nav-header { color: #ffffff; text-shadow: none; } .dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a { background-image: none; } .progress { background-color: #d5d5d5; background-image: none; } [class^="icon-"], [class*=" icon-"] { vertical-align: baseline; } .modal-header { padding: 12px 15px 6px; background-color: #CC3333; color: #ffffff; } .modal-header h1, .modal-header h2, .modal-header h3, .modal-header h4, .modal-header h5, .modal-header h6 { color: #ffffff; } .modal-body, .modal-footer { border: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .modal-body label, .modal-footer label { color: #555555; } .modal-footer { background-color: #dddddd; } .popover-title { color: #ffffff; } #main { margin-top: 56px; } .navbar-fixed-top .navbar-inner { padding-left: 20px; padding-right: 20px; } .navbar .dropdown-menu { padding: 20px; max-height: 300px; overflow: auto; width: 300px; background-color: #dddddd; } .navbar .dropdown-menu a, .navbar .dropdown-menu a:visited { color: #333333; } .navbar .dropdown-menu a:hover { color: #333333; background-color: #cbcbcb; } .navbar .dropdown-menu a:active { color: #333333; background-color: #cbcbcb; } .navbar .dropdown-menu a { padding-left: 0; padding-right: 5px; font-weight: 500; font-size: 115%; } #toc { position: fixed; top: 56px; width: 29%; max-height: 90%; overflow: auto; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; border: 1px #CC3333 solid; padding: 5px; display:none; } #toc .toc-active { background-color: #002425; color: #ffffff; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } #toc .toc-active a, #toc .toc-active a:hover, #toc .toc-active a:active, #toc .toc-active a:visited { background-color: #002425; color: #ffffff; } .toc-shim { padding-top: 56px; margin-top: -56px; display: block; } .toc-h1 { margin-left: 2px; margin-right: 2px; } .toc-h2 { margin-left: 7px; margin-right: 7px; } .toc-h3 { margin-left: 14px; margin-right: 7px; } .toc-h4 { margin-left: 21px; margin-right: 7px; } .copyright { font-size: 90%; text-align: center; color: #dddddd; width: 100%; display: block; } .jsdoc-message { font-size: 90%; text-align: center; color: #dddddd; width: 100%; display: block; } .page-title { font-size: 220%; color: #dddddd; font-weight: 700; padding-top: 10px; display: block; } footer { border-top: 1px solid #eaeaea; padding-top: 15px; } code { background-color: none; border: none; color: #CC3333; font-weight:bold; } .buffered-name { padding-top: 56px; margin-top: -56px; } .member-collapsed { background-color: #dddddd; color: #555555; } .member-open { background-color: inherit; color: inherit; } .member { -webkit-transition: background-color 0.5s linear; -moz-transition: background-color 0.5s linear; -o-transition: background-color 0.5s linear; transition: background-color 0.5s linear; -webkit-transition: color 0.5s linear; -moz-transition: color 0.5s linear; -o-transition: color 0.5s linear; transition: color 0.5s linear; -webkit-border-radius: 0px; -moz-border-radius: 0px; border-radius: 0px; padding: 3px; } .sunlight-highlighted { margin: 0; line-height: auto; word-break: normal; word-wrap: normal; white-space: pre; background-color: transparent; border: none; } .sunlight-line-number-margin { border-radius: 0; border-width: 0 1px 0 0; font-size: 12px; line-height: 15px; padding: 12px 4px !important; }
import { Provider } from '../../di'; import { ChangeDetectorRef } from '../change_detector_ref'; /** * A type describing supported iterable types. * * @stable */ export declare type NgIterable<T> = Array<T> | Iterable<T>; /** * A strategy for tracking changes over time to an iterable. Used by {@link NgFor} to * respond to changes in an iterable by effecting equivalent changes in the DOM. * * @stable */ export interface IterableDiffer<V> { /** * Compute a difference between the previous state and the new `object` state. * * @param object containing the new value. * @returns an object describing the difference. The return value is only valid until the next * `diff()` invocation. */ diff(object: NgIterable<V>): IterableChanges<V> | null; } /** * An object describing the changes in the `Iterable` collection since last time * `IterableDiffer#diff()` was invoked. * * @stable */ export interface IterableChanges<V> { /** * Iterate over all changes. `IterableChangeRecord` will contain information about changes * to each item. */ forEachItem(fn: (record: IterableChangeRecord<V>) => void): void; /** * Iterate over a set of operations which when applied to the original `Iterable` will produce the * new `Iterable`. * * NOTE: These are not necessarily the actual operations which were applied to the original * `Iterable`, rather these are a set of computed operations which may not be the same as the * ones applied. * * @param record A change which needs to be applied * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the * original `Iterable` location, where as `previousIndex` refers to the transient location * of the item, after applying the operations up to this point. * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the * original `Iterable` location, where as `currentIndex` refers to the transient location * of the item, after applying the operations up to this point. */ forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number, currentIndex: number) => void): void; /** * Iterate over changes in the order of original `Iterable` showing where the original items * have moved. */ forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void; /** Iterate over all added items. */ forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void; /** Iterate over all moved items. */ forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void; /** Iterate over all removed items. */ forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void; /** Iterate over all items which had their identity (as computed by the `trackByFn`) changed. */ forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void; } /** * Record representing the item change information. * * @stable */ export interface IterableChangeRecord<V> { /** Current index of the item in `Iterable` or null if removed. */ readonly currentIndex: number | null; /** Previous index of the item in `Iterable` or null if added. */ readonly previousIndex: number | null; /** The item. */ readonly item: V; /** Track by identity as computed by the `trackByFn`. */ readonly trackById: any; } /** * @deprecated v4.0.0 - Use IterableChangeRecord instead. */ export interface CollectionChangeRecord<V> extends IterableChangeRecord<V> { } /** * Nolonger used. * * @deprecated v4.0.0 - Use TrackByFunction instead */ export interface TrackByFn { (index: number, item: any): any; } /** * An optional function passed into {@link NgForOf} that defines how to track * items in an iterable (e.g. fby index or id) * * @stable */ export interface TrackByFunction<T> { (index: number, item: T): any; } /** * Provides a factory for {@link IterableDiffer}. * * @stable */ export interface IterableDifferFactory { supports(objects: any): boolean; create<V>(trackByFn?: TrackByFunction<V>): IterableDiffer<V>; /** * @deprecated v4.0.0 - ChangeDetectorRef is not used and is no longer a parameter */ create<V>(_cdr?: ChangeDetectorRef | TrackByFunction<V>, trackByFn?: TrackByFunction<V>): IterableDiffer<V>; } /** * A repository of different iterable diffing strategies used by NgFor, NgClass, and others. * @stable */ export declare class IterableDiffers { /** * @deprecated v4.0.0 - Should be private */ factories: IterableDifferFactory[]; constructor(factories: IterableDifferFactory[]); static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers; /** * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the * inherited {@link IterableDiffers} instance with the provided factories and return a new * {@link IterableDiffers} instance. * * The following example shows how to extend an existing list of factories, * which will only be applied to the injector for this component and its children. * This step is all that's required to make a new {@link IterableDiffer} available. * * ### Example * * ``` * @Component({ * viewProviders: [ * IterableDiffers.extend([new ImmutableListDiffer()]) * ] * }) * ``` */ static extend(factories: IterableDifferFactory[]): Provider; find(iterable: any): IterableDifferFactory; } export declare function getTypeNameForDebugging(type: any): string;
require File.expand_path('../../../../spec_helper', __FILE__) require 'net/ftp' describe "Net::FTP#passive" do it "returns true when self is in passive mode" do ftp = Net::FTP.new ftp.passive.should be_false ftp.passive = true ftp.passive.should be_true end end describe "Net::FTP#passive=" do it "sets self to passive mode when passed true" do ftp = Net::FTP.new ftp.passive = true ftp.passive.should be_true ftp.passive = false ftp.passive.should be_false end end
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.IO Imports Microsoft.CodeAnalysis Imports Microsoft.CodeAnalysis.SpecialType Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text Imports Microsoft.CodeAnalysis.VisualBasic Imports Microsoft.CodeAnalysis.VisualBasic.OverloadResolution Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Roslyn.Test.Utilities Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Semantics Public Class BinaryOperators Inherits BasicTestBase <Fact> Public Sub Test1() Dim compilationDef = <compilation name="VBBinaryOperators1"> <file name="lib.vb"> <%= My.Resources.Resource.PrintResultTestSource %> </file> <file name="a.vb"> <%= My.Resources.Resource.BinaryOperatorsTestSource1 %> </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe) Assert.True(compilation.Options.CheckOverflow) CompileAndVerify(compilation, expectedOutput:=My.Resources.Resource.BinaryOperatorsTestBaseline1) compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe.WithOverflowChecks(False)) Assert.False(compilation.Options.CheckOverflow) CompileAndVerify(compilation, expectedOutput:=My.Resources.Resource.BinaryOperatorsTestBaseline1) End Sub <Fact> Public Sub Test1_Date() ' test binary operator between Date value and another type data ' call ToString() on it defeat the purpose of these scenarios Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US", useUserOverride:=False) Try Dim compilationDef = <compilation name="VBBinaryOperators11"> <file name="lib.vb"> <%= My.Resources.Resource.PrintResultTestSource %> </file> <file name="a.vb"> <![CDATA[ Option Strict Off Imports System Module Module1 Sub Main() Dim BoFalse As Boolean Dim BoTrue As Boolean Dim SB As SByte Dim By As Byte Dim Sh As Short Dim US As UShort Dim [In] As Integer Dim UI As UInteger Dim Lo As Long Dim UL As ULong Dim De As Decimal Dim Si As Single Dim [Do] As Double Dim St As String Dim Ob As Object Dim Tc As System.TypeCode Dim Da As Date Dim Ch As Char Dim ChArray() As Char BoFalse = False BoTrue = True SB = -1 Sh = -3 [In] = -5 Lo = -7 De = -9D Si = 10 [Do] = -11 St = "12" Ob = "-13" Da = #8:30:00 AM# Ch = "c"c Tc = TypeCode.Double ChArray = "14" By = 22 US = 24 UI = 26 UL = 28 PrintResult("Da + St", Da + St) PrintResult("Da + Ob", Da + Ob) PrintResult("Da + Da", Da + Da) PrintResult("Da + ChArray", Da + ChArray) PrintResult("ChArray + Da", ChArray + Da) PrintResult("St + Da", St + Da) PrintResult("Ob + Da", Ob + Da) PrintResult("Da & BoFalse", Da & BoFalse) PrintResult("Da & BoTrue", Da & BoTrue) PrintResult("Da & SB", Da & SB) PrintResult("Da & By", Da & By) PrintResult("Da & Sh", Da & Sh) PrintResult("Da & US", Da & US) PrintResult("Da & [In]", Da & [In]) PrintResult("Da & UI", Da & UI) PrintResult("Da & Lo", Da & Lo) PrintResult("Da & UL", Da & UL) PrintResult("Da & De", Da & De) PrintResult("Da & Si", Da & Si) PrintResult("Da & [Do]", Da & [Do]) PrintResult("Da & St", Da & St) PrintResult("Da & Ob", Da & Ob) PrintResult("Da & Tc", Da & Tc) PrintResult("Da & Da", Da & Da) PrintResult("Da & Ch", Da & Ch) PrintResult("Da & ChArray", Da & ChArray) PrintResult("Ch & Da", Ch & Da) PrintResult("ChArray & Da", ChArray & Da) PrintResult("BoFalse & Da", BoFalse & Da) PrintResult("BoTrue & Da", BoTrue & Da) PrintResult("SB & Da", SB & Da) PrintResult("By & Da", By & Da) PrintResult("Sh & Da", Sh & Da) PrintResult("US & Da", US & Da) PrintResult("[In] & Da", [In] & Da) PrintResult("UI & Da", UI & Da) PrintResult("Lo & Da", Lo & Da) PrintResult("UL & Da", UL & Da) PrintResult("De & Da", De & Da) PrintResult("Si & Da", Si & Da) PrintResult("[Do] & Da", [Do] & Da) PrintResult("St & Da", St & Da) PrintResult("Ob & Da", Ob & Da) PrintResult("Tc & Da", Tc & Da) End Sub End Module ]]> </file> </compilation> Dim expected = <![CDATA[[Da + St] String: [8:30:00 AM12] [Da + Ob] Object: 8:30:00 AM-13 [Da + Da] String: [8:30:00 AM8:30:00 AM] [Da + ChArray] String: [8:30:00 AM14] [ChArray + Da] String: [148:30:00 AM] [St + Da] String: [128:30:00 AM] [Ob + Da] Object: -138:30:00 AM [Da & BoFalse] String: [8:30:00 AMFalse] [Da & BoTrue] String: [8:30:00 AMTrue] [Da & SB] String: [8:30:00 AM-1] [Da & By] String: [8:30:00 AM22] [Da & Sh] String: [8:30:00 AM-3] [Da & US] String: [8:30:00 AM24] [Da & [In]] String: [8:30:00 AM-5] [Da & UI] String: [8:30:00 AM26] [Da & Lo] String: [8:30:00 AM-7] [Da & UL] String: [8:30:00 AM28] [Da & De] String: [8:30:00 AM-9] [Da & Si] String: [8:30:00 AM10] [Da & [Do]] String: [8:30:00 AM-11] [Da & St] String: [8:30:00 AM12] [Da & Ob] Object: 8:30:00 AM-13 [Da & Tc] String: [8:30:00 AM14] [Da & Da] String: [8:30:00 AM8:30:00 AM] [Da & Ch] String: [8:30:00 AMc] [Da & ChArray] String: [8:30:00 AM14] [Ch & Da] String: [c8:30:00 AM] [ChArray & Da] String: [148:30:00 AM] [BoFalse & Da] String: [False8:30:00 AM] [BoTrue & Da] String: [True8:30:00 AM] [SB & Da] String: [-18:30:00 AM] [By & Da] String: [228:30:00 AM] [Sh & Da] String: [-38:30:00 AM] [US & Da] String: [248:30:00 AM] [[In] & Da] String: [-58:30:00 AM] [UI & Da] String: [268:30:00 AM] [Lo & Da] String: [-78:30:00 AM] [UL & Da] String: [288:30:00 AM] [De & Da] String: [-98:30:00 AM] [Si & Da] String: [108:30:00 AM] [[Do] & Da] String: [-118:30:00 AM] [St & Da] String: [128:30:00 AM] [Ob & Da] Object: -138:30:00 AM [Tc & Da] String: [148:30:00 AM]]]> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe) Assert.True(compilation.Options.CheckOverflow) CompileAndVerify(compilation, expectedOutput:=expected) compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe.WithOverflowChecks(False)) Assert.False(compilation.Options.CheckOverflow) CompileAndVerify(compilation, expectedOutput:=expected) Catch ex As Exception Assert.Null(ex) Finally System.Threading.Thread.CurrentThread.CurrentCulture = currCulture End Try End Sub <Fact> Public Sub Test2() Dim compilationDef = <compilation name="VBBinaryOperators2"> <file name="a.vb"> <%= My.Resources.Resource.BinaryOperatorsTestSource2 %> </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) CompilationUtils.AssertTheseDiagnostics(compilation, My.Resources.Resource.BinaryOperatorsTestBaseline2) End Sub <Fact> Public Sub Test30() Dim compilationDef = <compilation name="VBBinaryOperators30"> <file name="a.vb"> Option Strict Off Imports System Module Module1 Sub Main() Dim St1 As String Dim St2 As String Dim Ob1 As Object Dim Ob2 As Object St1 = "a" St2 = "a" Ob1 = "a" Ob2 = "a" Console.WriteLine(St1 = St2) Console.WriteLine(Ob1 = Ob2) St1 = "a" St2 = "A" Ob1 = "a" Ob2 = "A" Console.WriteLine(St1 = St2) Console.WriteLine(Ob1 = Ob2) St1 = "a" St2 = "b" Ob1 = "a" Ob2 = "b" Console.WriteLine(St1 = St2) Console.WriteLine(Ob1 = Ob2) End Sub End Module </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe) Assert.False(compilation.Options.OptionCompareText) CompileAndVerify(compilation, <![CDATA[ True True False False False False ]]>) compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe.WithOptionCompareText(True)) Assert.True(compilation.Options.OptionCompareText) CompileAndVerify(compilation, <![CDATA[ True True True True False False ]]>) End Sub <Fact> Public Sub Test3() Dim compilationDef = <compilation name="VBBinaryOperators3"> <file name="a.vb"> <%= My.Resources.Resource.BinaryOperatorsTestSource3 %> </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) CompilationUtils.AssertTheseDiagnostics(compilation, My.Resources.Resource.BinaryOperatorsTestBaseline3) End Sub <Fact> Public Sub Test4() Dim compilationDef = <compilation name="VBBinaryOperators4"> <file name="a.vb"> <%= My.Resources.Resource.BinaryOperatorsTestSource4 %> </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe) CompileAndVerify(compilation, expectedOutput:=My.Resources.Resource.BinaryOperatorsTestBaseline4) End Sub <Fact> Public Sub Test5() Dim compilationDef = <compilation name="VBBinaryOperators52"> <file name="lib.vb"> <%= My.Resources.Resource.PrintResultTestSource %> </file> <file name="a.vb"> <%= My.Resources.Resource.BinaryOperatorsTestSource5 %> </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe) Assert.True(compilation.Options.CheckOverflow) CompileAndVerify(compilation, expectedOutput:=My.Resources.Resource.BinaryOperatorsTestBaseline5) compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe.WithOverflowChecks(False)) Assert.False(compilation.Options.CheckOverflow) CompileAndVerify(compilation, expectedOutput:=My.Resources.Resource.BinaryOperatorsTestBaseline5) End Sub <Fact> Public Sub Test5_DateConst() ' test binary operator between Date const and another type data ' call ToString() on it defeat the purpose of these scenarios Dim currCulture = System.Threading.Thread.CurrentThread.CurrentCulture System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US", useUserOverride:=False) Try Dim compilationDef = <compilation name="VBBinaryOperators52"> <file name="lib.vb"> <%= My.Resources.Resource.PrintResultTestSource %> </file> <file name="a.vb"> <![CDATA[ Option Strict Off Imports System Module Module1 Sub Main() PrintResult("#8:30:00 AM# + ""12""", #8:30:00 AM# + "12") PrintResult("#8:30:00 AM# + #8:30:00 AM#", #8:30:00 AM# + #8:30:00 AM#) PrintResult("""12"" + #8:30:00 AM#", "12" + #8:30:00 AM#) PrintResult("#8:30:00 AM# & False", #8:30:00 AM# & False) PrintResult("#8:30:00 AM# & True", #8:30:00 AM# & True) PrintResult("#8:30:00 AM# & System.SByte.MinValue", #8:30:00 AM# & System.SByte.MinValue) PrintResult("#8:30:00 AM# & System.Byte.MaxValue", #8:30:00 AM# & System.Byte.MaxValue) PrintResult("#8:30:00 AM# & -3S", #8:30:00 AM# & -3S) PrintResult("#8:30:00 AM# & 24US", #8:30:00 AM# & 24US) PrintResult("#8:30:00 AM# & -5I", #8:30:00 AM# & -5I) PrintResult("#8:30:00 AM# & 26UI", #8:30:00 AM# & 26UI) PrintResult("#8:30:00 AM# & -7L", #8:30:00 AM# & -7L) PrintResult("#8:30:00 AM# & 28UL", #8:30:00 AM# & 28UL) PrintResult("#8:30:00 AM# & -9D", #8:30:00 AM# & -9D) PrintResult("#8:30:00 AM# & 10.0F", #8:30:00 AM# & 10.0F) PrintResult("#8:30:00 AM# & -11.0R", #8:30:00 AM# & -11.0R) PrintResult("#8:30:00 AM# & ""12""", #8:30:00 AM# & "12") PrintResult("#8:30:00 AM# & TypeCode.Double", #8:30:00 AM# & TypeCode.Double) PrintResult("#8:30:00 AM# & #8:30:00 AM#", #8:30:00 AM# & #8:30:00 AM#) PrintResult("#8:30:00 AM# & ""c""c", #8:30:00 AM# & "c"c) PrintResult("""c""c & #8:30:00 AM#", "c"c & #8:30:00 AM#) PrintResult("False & #8:30:00 AM#", False & #8:30:00 AM#) PrintResult("True & #8:30:00 AM#", True & #8:30:00 AM#) PrintResult("System.SByte.MinValue & #8:30:00 AM#", System.SByte.MinValue & #8:30:00 AM#) PrintResult("System.Byte.MaxValue & #8:30:00 AM#", System.Byte.MaxValue & #8:30:00 AM#) PrintResult("-3S & #8:30:00 AM#", -3S & #8:30:00 AM#) PrintResult("24US & #8:30:00 AM#", 24US & #8:30:00 AM#) PrintResult("-5I & #8:30:00 AM#", -5I & #8:30:00 AM#) PrintResult("26UI & #8:30:00 AM#", 26UI & #8:30:00 AM#) PrintResult("-7L & #8:30:00 AM#", -7L & #8:30:00 AM#) PrintResult("28UL & #8:30:00 AM#", 28UL & #8:30:00 AM#) PrintResult("-9D & #8:30:00 AM#", -9D & #8:30:00 AM#) PrintResult("10.0F & #8:30:00 AM#", 10.0F & #8:30:00 AM#) PrintResult("-11.0R & #8:30:00 AM#", -11.0R & #8:30:00 AM#) PrintResult("""12"" & #8:30:00 AM#", "12" & #8:30:00 AM#) PrintResult("TypeCode.Double & #8:30:00 AM#", TypeCode.Double & #8:30:00 AM#) End Sub End Module ]]> </file> </compilation> Dim expected = <![CDATA[[#8:30:00 AM# + "12"] String: [8:30:00 AM12] [#8:30:00 AM# + #8:30:00 AM#] String: [8:30:00 AM8:30:00 AM] ["12" + #8:30:00 AM#] String: [128:30:00 AM] [#8:30:00 AM# & False] String: [8:30:00 AMFalse] [#8:30:00 AM# & True] String: [8:30:00 AMTrue] [#8:30:00 AM# & System.SByte.MinValue] String: [8:30:00 AM-128] [#8:30:00 AM# & System.Byte.MaxValue] String: [8:30:00 AM255] [#8:30:00 AM# & -3S] String: [8:30:00 AM-3] [#8:30:00 AM# & 24US] String: [8:30:00 AM24] [#8:30:00 AM# & -5I] String: [8:30:00 AM-5] [#8:30:00 AM# & 26UI] String: [8:30:00 AM26] [#8:30:00 AM# & -7L] String: [8:30:00 AM-7] [#8:30:00 AM# & 28UL] String: [8:30:00 AM28] [#8:30:00 AM# & -9D] String: [8:30:00 AM-9] [#8:30:00 AM# & 10.0F] String: [8:30:00 AM10] [#8:30:00 AM# & -11.0R] String: [8:30:00 AM-11] [#8:30:00 AM# & "12"] String: [8:30:00 AM12] [#8:30:00 AM# & TypeCode.Double] String: [8:30:00 AM14] [#8:30:00 AM# & #8:30:00 AM#] String: [8:30:00 AM8:30:00 AM] [#8:30:00 AM# & "c"c] String: [8:30:00 AMc] ["c"c & #8:30:00 AM#] String: [c8:30:00 AM] [False & #8:30:00 AM#] String: [False8:30:00 AM] [True & #8:30:00 AM#] String: [True8:30:00 AM] [System.SByte.MinValue & #8:30:00 AM#] String: [-1288:30:00 AM] [System.Byte.MaxValue & #8:30:00 AM#] String: [2558:30:00 AM] [-3S & #8:30:00 AM#] String: [-38:30:00 AM] [24US & #8:30:00 AM#] String: [248:30:00 AM] [-5I & #8:30:00 AM#] String: [-58:30:00 AM] [26UI & #8:30:00 AM#] String: [268:30:00 AM] [-7L & #8:30:00 AM#] String: [-78:30:00 AM] [28UL & #8:30:00 AM#] String: [288:30:00 AM] [-9D & #8:30:00 AM#] String: [-98:30:00 AM] [10.0F & #8:30:00 AM#] String: [108:30:00 AM] [-11.0R & #8:30:00 AM#] String: [-118:30:00 AM] ["12" & #8:30:00 AM#] String: [128:30:00 AM] [TypeCode.Double & #8:30:00 AM#] String: [148:30:00 AM] ]]> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe) Assert.True(compilation.Options.CheckOverflow) CompileAndVerify(compilation, expectedOutput:=expected) compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.ReleaseExe.WithOverflowChecks(False)) Assert.False(compilation.Options.CheckOverflow) CompileAndVerify(compilation, expectedOutput:=expected) Catch ex As Exception Assert.Null(ex) Finally System.Threading.Thread.CurrentThread.CurrentCulture = currCulture End Try End Sub <Fact> Public Sub Test7() Dim compilationDef = <compilation name="VBBinaryOperators7"> <file name="a.vb"> Option Strict Off Imports System Module Module1 Sub Main() Dim ob As Object ob = System.SByte.MinValue + (System.SByte.MaxValue + System.SByte.MinValue) ob = System.Byte.MinValue - (System.Byte.MaxValue \ System.Byte.MaxValue) ob = System.Int16.MinValue - 1S ob = System.UInt16.MinValue - 1US ob = System.Int32.MinValue - 1I ob = System.UInt32.MinValue - 1UI ob = System.Int64.MinValue - 1L ob = System.UInt64.MinValue - 1UL ob = -79228162514264337593543950335D - 1D ob = System.SByte.MaxValue - (System.SByte.MaxValue + System.SByte.MinValue) ob = System.Byte.MaxValue + (System.Byte.MaxValue \ System.Byte.MaxValue) ob = System.Int16.MaxValue + 1S ob = System.UInt16.MaxValue + 1US ob = System.Int32.MaxValue + 1I ob = System.UInt32.MaxValue + 1UI ob = System.Int64.MaxValue + 1L ob = System.UInt64.MaxValue + 1UL ob = 79228162514264337593543950335D + 1D ob = (2I \ 0) ob = (1.5F \ 0) ob = (2.5R \ 0) ob = (3.5D \ 0) ob = (2I Mod 0) ob = (3.5D Mod 0) ob = (3.5D / Nothing) ob = (2I \ Nothing) ob = (1.5F \ Nothing) ob = (2.5R \ Nothing) ob = (3.5D \ Nothing) ob = (2I Mod Nothing) ob = (3.5D Mod Nothing) ob = (3.5D / 0) ob = System.UInt64.MaxValue * 2UL ob = System.Int64.MaxValue * 2L ob = System.Int64.MinValue * (-2L) ob = 3L * (System.Int64.MinValue \ 2L) ob = (System.Int64.MinValue \ 2L) * 3L ob = System.Int64.MinValue \ (-1L) End Sub End Module </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) CompilationUtils.AssertTheseDiagnostics(compilation, <expected> BC30439: Constant expression not representable in type 'SByte'. ob = System.SByte.MinValue + (System.SByte.MaxValue + System.SByte.MinValue) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Byte'. ob = System.Byte.MinValue - (System.Byte.MaxValue \ System.Byte.MaxValue) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Short'. ob = System.Int16.MinValue - 1S ~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'UShort'. ob = System.UInt16.MinValue - 1US ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Integer'. ob = System.Int32.MinValue - 1I ~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'UInteger'. ob = System.UInt32.MinValue - 1UI ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Long'. ob = System.Int64.MinValue - 1L ~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'ULong'. ob = System.UInt64.MinValue - 1UL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Decimal'. ob = -79228162514264337593543950335D - 1D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'SByte'. ob = System.SByte.MaxValue - (System.SByte.MaxValue + System.SByte.MinValue) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Byte'. ob = System.Byte.MaxValue + (System.Byte.MaxValue \ System.Byte.MaxValue) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Short'. ob = System.Int16.MaxValue + 1S ~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'UShort'. ob = System.UInt16.MaxValue + 1US ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Integer'. ob = System.Int32.MaxValue + 1I ~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'UInteger'. ob = System.UInt32.MaxValue + 1UI ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Long'. ob = System.Int64.MaxValue + 1L ~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'ULong'. ob = System.UInt64.MaxValue + 1UL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Decimal'. ob = 79228162514264337593543950335D + 1D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (2I \ 0) ~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (1.5F \ 0) ~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (2.5R \ 0) ~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (3.5D \ 0) ~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (2I Mod 0) ~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (3.5D Mod 0) ~~~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (3.5D / Nothing) ~~~~~~~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (2I \ Nothing) ~~~~~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (1.5F \ Nothing) ~~~~~~~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (2.5R \ Nothing) ~~~~~~~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (3.5D \ Nothing) ~~~~~~~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (2I Mod Nothing) ~~~~~~~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (3.5D Mod Nothing) ~~~~~~~~~~~~~~~~ BC30542: Division by zero occurred while evaluating this expression. ob = (3.5D / 0) ~~~~~~~~ BC30439: Constant expression not representable in type 'ULong'. ob = System.UInt64.MaxValue * 2UL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Long'. ob = System.Int64.MaxValue * 2L ~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Long'. ob = System.Int64.MinValue * (-2L) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Long'. ob = 3L * (System.Int64.MinValue \ 2L) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Long'. ob = (System.Int64.MinValue \ 2L) * 3L ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BC30439: Constant expression not representable in type 'Long'. ob = System.Int64.MinValue \ (-1L) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ </expected>) End Sub <Fact> Public Sub Test8() Dim compilationDef = <compilation name="VBBinaryOperators8"> <file name="a.vb"> Imports System Module Module1 Sub Main() Dim Ob As Object = Nothing Ob = Ob-Ob Ob = Ob = Ob Ob = Ob &lt;&gt; Ob Ob = Ob &gt; Ob End Sub End Module </file> </compilation> Dim expected = <expected> BC42019: Operands of type Object used for operator '-'; runtime errors could occur. Ob = Ob-Ob ~~ BC42019: Operands of type Object used for operator '-'; runtime errors could occur. Ob = Ob-Ob ~~ BC42018: Operands of type Object used for operator '='; use the 'Is' operator to test object identity. Ob = Ob = Ob ~~ BC42018: Operands of type Object used for operator '='; use the 'Is' operator to test object identity. Ob = Ob = Ob ~~ BC42032: Operands of type Object used for operator '&lt;&gt;'; use the 'IsNot' operator to test object identity. Ob = Ob &lt;&gt; Ob ~~ BC42032: Operands of type Object used for operator '&lt;&gt;'; use the 'IsNot' operator to test object identity. Ob = Ob &lt;&gt; Ob ~~ BC42019: Operands of type Object used for operator '&gt;'; runtime errors could occur. Ob = Ob &gt; Ob ~~ BC42019: Operands of type Object used for operator '&gt;'; runtime errors could occur. Ob = Ob &gt; Ob ~~ </expected> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef, New VisualBasicCompilationOptions(OutputKind.ConsoleApplication).WithOptionStrict(OptionStrict.Custom)) Assert.Equal(OptionStrict.Custom, compilation.Options.OptionStrict) CompilationUtils.AssertTheseDiagnostics(compilation, expected) End Sub <WorkItem(543387, "DevDiv")> <Fact()> Public Sub Test9() Dim compilation = CreateCompilationWithMscorlibAndVBRuntime( <compilation> <file name="a.vb"><![CDATA[ Module Program Sub Main() If Nothing = Function() 5 Then 'BIND1:"Nothing = Function() 5" System.Console.WriteLine("Failed") Else System.Console.WriteLine("Succeeded") End If End Sub End Module ]]></file> </compilation>, options:=TestOptions.ReleaseExe.WithOptionStrict(OptionStrict.Custom)) CompileAndVerify(compilation, expectedOutput:= <![CDATA[ Succeeded ]]>) AssertTheseDiagnostics(compilation, <expected> </expected>) Dim model = GetSemanticModel(compilation, "a.vb") Dim node As ExpressionSyntax = CompilationUtils.FindBindingText(Of ExpressionSyntax)(compilation, "a.vb", 1) Dim symbolInfo = model.GetSymbolInfo(node) Assert.Equal("Public Shared Overloads Operator =(d1 As System.MulticastDelegate, d2 As System.MulticastDelegate) As Boolean", symbolInfo.Symbol.ToDisplayString()) End Sub <WorkItem(544620, "DevDiv")> <Fact()> Public Sub Bug13088() Dim compilation = CreateCompilationWithMscorlibAndVBRuntime( <compilation> <file name="a.vb"><![CDATA[ Module Program Public Const Z As Integer = Integer.MaxValue + 1 'BIND:"Public Const Z As Integer = Integer.MaxValue + 1" Sub Main() End Sub End Module ]]></file> </compilation>) VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_ExpressionOverflow1, "Integer.MaxValue + 1").WithArguments("Integer")) Dim symbol = compilation.GlobalNamespace.GetTypeMembers("Program").Single.GetMembers("Z").Single Assert.False(DirectCast(symbol, FieldSymbol).HasConstantValue) End Sub <Fact(), WorkItem(531531, "DevDiv")> Public Sub Bug18257() Dim source = <compilation name="ErrorHandling"> <file name="a.vb"> <![CDATA[ Option Strict On Public Class TestState Shared Function IsImmediateWindow1(line As Integer?) As String Dim s = "Expected: " & line & "." Return s End Function Shared Function IsImmediateWindow2(line As Integer) As String Dim s = "Expected: " & line & "." Return s End Function End Class Module Module1 Sub Main() System.Console.WriteLine(TestState.IsImmediateWindow1(Nothing)) System.Console.WriteLine(TestState.IsImmediateWindow2(Nothing)) End Sub End Module ]]> </file> </compilation> Dim compilation = CreateCompilationWithMscorlibAndVBRuntime(source, TestOptions.ReleaseExe) Dim compilationVerifier = CompileAndVerify(compilation, expectedOutput:= <![CDATA[ Expected: . Expected: 0. ]]>) End Sub <Fact()> Public Sub IntrinsicSymbols() Dim operators() As BinaryOperatorKind = { BinaryOperatorKind.Add, BinaryOperatorKind.Concatenate, BinaryOperatorKind.Like, BinaryOperatorKind.Equals, BinaryOperatorKind.NotEquals, BinaryOperatorKind.LessThanOrEqual, BinaryOperatorKind.GreaterThanOrEqual, BinaryOperatorKind.LessThan, BinaryOperatorKind.GreaterThan, BinaryOperatorKind.Subtract, BinaryOperatorKind.Multiply, BinaryOperatorKind.Power, BinaryOperatorKind.Divide, BinaryOperatorKind.Modulo, BinaryOperatorKind.IntegerDivide, BinaryOperatorKind.LeftShift, BinaryOperatorKind.RightShift, BinaryOperatorKind.Xor, BinaryOperatorKind.Or, BinaryOperatorKind.And, BinaryOperatorKind.OrElse, BinaryOperatorKind.AndAlso, BinaryOperatorKind.Is, BinaryOperatorKind.IsNot } Dim opTokens = (From op In operators Select SyntaxFacts.GetText(OverloadResolution.GetOperatorTokenKind(op))).ToArray() Dim typeNames() As String = { "System.Object", "System.String", "System.Double", "System.SByte", "System.Int16", "System.Int32", "System.Int64", "System.Decimal", "System.Single", "System.Byte", "System.UInt16", "System.UInt32", "System.UInt64", "System.Boolean", "System.Char", "System.DateTime", "System.TypeCode", "System.StringComparison", "System.Guid", "System.Char()" } Dim builder As New System.Text.StringBuilder Dim n As Integer = 0 For Each arg1 In typeNames For Each arg2 In typeNames n += 1 builder.AppendFormat( "Sub Test{2}(x1 as {0}, y1 As {1}, x2 as System.Nullable(Of {0}), y2 As System.Nullable(Of {1}))" & vbCrLf, arg1, arg2, n) Dim k As Integer = 0 For Each opToken In opTokens builder.AppendFormat( " Dim z{0}_1 = x1 {1} y1" & vbCrLf & " Dim z{0}_2 = x2 {1} y2" & vbCrLf & " Dim z{0}_3 = x2 {1} y1" & vbCrLf & " Dim z{0}_4 = x1 {1} y2" & vbCrLf & " If x1 {1} y1" & vbCrLf & " End If" & vbCrLf & " If x2 {1} y2" & vbCrLf & " End If" & vbCrLf & " If x2 {1} y1" & vbCrLf & " End If" & vbCrLf & " If x1 {1} y2" & vbCrLf & " End If" & vbCrLf, k, opToken) k += 1 Next builder.Append( "End Sub" & vbCrLf) Next Next Dim source = <compilation> <file name="a.vb"> Class Module1 <%= New System.Xml.Linq.XCData(builder.ToString()) %> End Class </file> </compilation> Dim compilation = CreateCompilationWithMscorlib(source, TestOptions.ReleaseDll.WithOverflowChecks(True)) Dim types(typeNames.Length - 1) As NamedTypeSymbol For i As Integer = 0 To typeNames.Length - 2 types(i) = compilation.GetTypeByMetadataName(typeNames(i)) Next Assert.Null(types(types.Length - 1)) types(types.Length - 1) = compilation.GetSpecialType(SpecialType.System_String) Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() Dim semanticModel = compilation.GetSemanticModel(tree) Dim nodes = (From node In tree.GetRoot().DescendantNodes() Select node = TryCast(node, BinaryExpressionSyntax) Where node IsNot Nothing).ToArray() n = 0 For Each leftType In types For Each rightType In types For Each op In operators TestIntrinsicSymbol( op, leftType, rightType, compilation, semanticModel, nodes(n), nodes(n + 1), nodes(n + 2), nodes(n + 3), nodes(n + 4), nodes(n + 5), nodes(n + 6), nodes(n + 7)) n += 8 Next Next Next Assert.Equal(n, nodes.Length) End Sub Private Sub TestIntrinsicSymbol( op As BinaryOperatorKind, leftType As TypeSymbol, rightType As TypeSymbol, compilation As VisualBasicCompilation, semanticModel As SemanticModel, node1 As BinaryExpressionSyntax, node2 As BinaryExpressionSyntax, node3 As BinaryExpressionSyntax, node4 As BinaryExpressionSyntax, node5 As BinaryExpressionSyntax, node6 As BinaryExpressionSyntax, node7 As BinaryExpressionSyntax, node8 As BinaryExpressionSyntax ) Dim info1 As SymbolInfo = semanticModel.GetSymbolInfo(node1) If (leftType.SpecialType <> SpecialType.System_Object AndAlso Not leftType.IsIntrinsicType()) OrElse (rightType.SpecialType <> SpecialType.System_Object AndAlso Not rightType.IsIntrinsicType()) OrElse (leftType.IsDateTimeType() AndAlso rightType.IsDateTimeType() AndAlso op = BinaryOperatorKind.Subtract) Then ' Let (Date - Date) use operator overloading. If info1.Symbol IsNot Nothing OrElse info1.CandidateSymbols.Length = 0 Then Assert.Equal(CandidateReason.None, info1.CandidateReason) Else Assert.Equal(CandidateReason.OverloadResolutionFailure, info1.CandidateReason) End If Else Assert.Equal(CandidateReason.None, info1.CandidateReason) Assert.Equal(0, info1.CandidateSymbols.Length) End If Dim symbol1 = DirectCast(info1.Symbol, MethodSymbol) Dim symbol2 = semanticModel.GetSymbolInfo(node2).Symbol Dim symbol3 = semanticModel.GetSymbolInfo(node3).Symbol Dim symbol4 = semanticModel.GetSymbolInfo(node4).Symbol Dim symbol5 = DirectCast(semanticModel.GetSymbolInfo(node5).Symbol, MethodSymbol) Dim symbol6 = semanticModel.GetSymbolInfo(node6).Symbol Dim symbol7 = semanticModel.GetSymbolInfo(node7).Symbol Dim symbol8 = semanticModel.GetSymbolInfo(node8).Symbol Assert.Equal(symbol1, symbol5) Assert.Equal(symbol2, symbol6) Assert.Equal(symbol3, symbol7) Assert.Equal(symbol4, symbol8) If symbol1 IsNot Nothing AndAlso symbol1.IsImplicitlyDeclared Then Assert.NotSame(symbol1, symbol5) Assert.Equal(symbol1.GetHashCode(), symbol5.GetHashCode()) For i As Integer = 0 To 1 Assert.Equal(symbol1.Parameters(i), symbol5.Parameters(i)) Assert.Equal(symbol1.Parameters(i).GetHashCode(), symbol5.Parameters(i).GetHashCode()) Next Assert.NotEqual(symbol1.Parameters(0), symbol5.Parameters(1)) End If Select Case op Case BinaryOperatorKind.AndAlso, BinaryOperatorKind.OrElse, BinaryOperatorKind.Is, BinaryOperatorKind.IsNot Assert.Null(symbol1) Assert.Null(symbol2) Assert.Null(symbol3) Assert.Null(symbol4) Return End Select Dim leftSpecial As SpecialType = leftType.GetEnumUnderlyingTypeOrSelf().SpecialType Dim rightSpecial As SpecialType = rightType.GetEnumUnderlyingTypeOrSelf().SpecialType Dim resultType As SpecialType = OverloadResolution.ResolveNotLiftedIntrinsicBinaryOperator(op, leftSpecial, rightSpecial) Dim userDefined As MethodSymbol = Nothing If resultType = SpecialType.None AndAlso (leftSpecial = SpecialType.None OrElse rightSpecial = SpecialType.None OrElse (op = BinaryOperatorKind.Subtract AndAlso leftSpecial = SpecialType.System_DateTime AndAlso rightSpecial = SpecialType.System_DateTime)) Then If leftSpecial = SpecialType.System_Object OrElse rightSpecial = SpecialType.System_Object OrElse leftType = rightType Then If leftSpecial = SpecialType.System_Object OrElse rightSpecial = SpecialType.System_Object Then resultType = SpecialType.System_Object End If Dim nonSpecialType = If(leftSpecial = SpecialType.System_Object, rightType, leftType) For Each m In nonSpecialType.GetMembers(OverloadResolution.TryGetOperatorName(op)) If m.Kind = SymbolKind.Method Then Dim method = DirectCast(m, MethodSymbol) If method.MethodKind = MethodKind.UserDefinedOperator AndAlso method.ParameterCount = 2 AndAlso method.Parameters(0).Type = nonSpecialType AndAlso method.Parameters(1).Type = nonSpecialType Then userDefined = method resultType = SpecialType.None End If End If Next Else Assert.Null(symbol1) Assert.Null(symbol2) Assert.Null(symbol3) Assert.Null(symbol4) Return End If End If If resultType = SpecialType.None Then If userDefined IsNot Nothing Then Assert.False(userDefined.IsImplicitlyDeclared) Assert.Same(userDefined, symbol1) If leftType.IsValueType Then If rightType.IsValueType Then Assert.Same(userDefined, symbol2) Assert.Same(userDefined, symbol3) Assert.Same(userDefined, symbol4) Return Else Assert.Null(symbol2) Assert.Same(userDefined, symbol3) Assert.Null(symbol4) Return End If ElseIf rightType.IsValueType Then Assert.Null(symbol2) Assert.Null(symbol3) Assert.Same(userDefined, symbol4) Return Else Assert.Null(symbol2) Assert.Null(symbol3) Assert.Null(symbol4) Return End If End If Assert.Null(symbol1) Assert.Null(symbol2) Assert.Null(symbol3) Assert.Null(symbol4) Return End If Assert.NotNull(symbol1) Dim containerName As String = compilation.GetSpecialType(resultType).ToTestDisplayString() Dim rightName As String = containerName Dim returnName As String = containerName Select Case op Case BinaryOperatorKind.Equals, BinaryOperatorKind.NotEquals, BinaryOperatorKind.LessThanOrEqual, BinaryOperatorKind.GreaterThanOrEqual, BinaryOperatorKind.LessThan, BinaryOperatorKind.GreaterThan, BinaryOperatorKind.Like If resultType <> SpecialType.System_Object Then returnName = compilation.GetSpecialType(SpecialType.System_Boolean).ToTestDisplayString() End If Case BinaryOperatorKind.LeftShift, BinaryOperatorKind.RightShift If resultType <> SpecialType.System_Object Then rightName = compilation.GetSpecialType(SpecialType.System_Int32).ToTestDisplayString() End If Case BinaryOperatorKind.Xor, BinaryOperatorKind.And, BinaryOperatorKind.Or If leftType.IsEnumType() AndAlso leftType = rightType Then containerName = leftType.ToTestDisplayString() rightName = containerName returnName = containerName End If End Select Assert.Equal(String.Format("Function {0}.{1}(left As {0}, right As {2}) As {3}", containerName, OverloadResolution.TryGetOperatorName( If(op = BinaryOperatorKind.Add AndAlso resultType = SpecialType.System_String, BinaryOperatorKind.Concatenate, op)), rightName, returnName), symbol1.ToTestDisplayString()) Assert.Equal(MethodKind.BuiltinOperator, symbol1.MethodKind) Assert.True(symbol1.IsImplicitlyDeclared) Assert.Equal((op = BinaryOperatorKind.Multiply OrElse op = BinaryOperatorKind.Add OrElse op = BinaryOperatorKind.Subtract OrElse op = BinaryOperatorKind.IntegerDivide) AndAlso symbol1.ContainingType.IsIntegralType(), symbol1.IsCheckedBuiltin) Assert.False(symbol1.IsGenericMethod) Assert.False(symbol1.IsExtensionMethod) Assert.False(symbol1.IsExternalMethod) Assert.False(symbol1.CanBeReferencedByName) Assert.Null(symbol1.DeclaringCompilation) Assert.Equal(symbol1.Name, symbol1.MetadataName) Assert.Same(symbol1.ContainingSymbol, symbol1.Parameters(0).Type) Dim match As Integer = 0 If symbol1.ContainingSymbol = symbol1.ReturnType Then match += 1 End If If symbol1.ContainingSymbol = symbol1.Parameters(0).Type Then match += 1 End If If symbol1.ContainingSymbol = symbol1.Parameters(1).Type Then match += 1 End If Assert.True(match >= 2) Assert.Equal(0, symbol1.Locations.Length) Assert.Null(symbol1.GetDocumentationCommentId) Assert.Equal("", symbol1.GetDocumentationCommentXml) Assert.True(symbol1.HasSpecialName) Assert.True(symbol1.IsShared) Assert.Equal(Accessibility.Public, symbol1.DeclaredAccessibility) Assert.False(symbol1.IsOverloads) Assert.False(symbol1.IsOverrides) Assert.False(symbol1.IsOverridable) Assert.False(symbol1.IsMustOverride) Assert.False(symbol1.IsNotOverridable) Assert.Equal(2, symbol1.ParameterCount) Assert.Equal(0, symbol1.Parameters(0).Ordinal) Assert.Equal(1, symbol1.Parameters(1).Ordinal) Dim otherSymbol = DirectCast(semanticModel.GetSymbolInfo(node1).Symbol, MethodSymbol) Assert.Equal(symbol1, otherSymbol) If leftType.IsValueType Then If rightType.IsValueType Then Assert.Equal(symbol1, symbol2) Assert.Equal(symbol1, symbol3) Assert.Equal(symbol1, symbol4) Return Else Assert.Null(symbol2) Assert.Equal(symbol1, symbol3) Assert.Null(symbol4) Return End If ElseIf rightType.IsValueType Then Assert.Null(symbol2) Assert.Null(symbol3) Assert.Equal(symbol1, symbol4) Return End If Assert.Null(symbol2) Assert.Null(symbol3) Assert.Null(symbol4) End Sub <Fact()> Public Sub CheckedIntrinsicSymbols() Dim source = <compilation> <file name="a.vb"> Class Module1 Sub Test(x as Integer, y as Integer) Dim z1 = x + y Dim z2 = x - y Dim z3 = x * y Dim z4 = x \ y End Sub End Class </file> </compilation> Dim compilation = CreateCompilationWithMscorlib(source, TestOptions.ReleaseDll.WithOverflowChecks(False)) Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() Dim semanticModel = compilation.GetSemanticModel(tree) Dim nodes = (From node In tree.GetRoot().DescendantNodes() Select node = TryCast(node, BinaryExpressionSyntax) Where node IsNot Nothing).ToArray() Dim builder1 = ArrayBuilder(Of MethodSymbol).GetInstance() For Each node In nodes Dim symbol = DirectCast(semanticModel.GetSymbolInfo(node).Symbol, MethodSymbol) Assert.False(symbol.IsCheckedBuiltin) builder1.Add(symbol) Next compilation = compilation.WithOptions(TestOptions.ReleaseDll.WithOverflowChecks(True)) semanticModel = compilation.GetSemanticModel(tree) Dim builder2 = ArrayBuilder(Of MethodSymbol).GetInstance() For Each node In nodes Dim symbol = DirectCast(semanticModel.GetSymbolInfo(node).Symbol, MethodSymbol) Assert.True(symbol.IsCheckedBuiltin) builder2.Add(symbol) Next For i As Integer = 0 To builder1.Count - 1 Assert.NotEqual(builder1(i), builder2(i)) Next builder1.Free() builder2.Free() End Sub <Fact(), WorkItem(721565, "DevDiv")> Public Sub Bug721565() Dim source = <compilation> <file name="a.vb"><![CDATA[ Class Module1 Sub Test(x as TestStr?, y as Integer?) Dim z1 = (x Is Nothing) Dim z2 = (Nothing Is x) Dim z3 = (x IsNot Nothing) Dim z4 = (Nothing IsNot x) Dim z5 = (x = Nothing) Dim z6 = (Nothing = x) Dim z7 = (x <> Nothing) Dim z8 = (Nothing <> x) Dim z11 = (y Is Nothing) Dim z12 = (Nothing Is y) Dim z13 = (y IsNot Nothing) Dim z14 = (Nothing IsNot y) Dim z15 = (y = Nothing) Dim z16 = (Nothing = y) Dim z17 = (y <> Nothing) Dim z18 = (Nothing <> y) End Sub End Class Structure TestStr End Structure ]]></file> </compilation> Dim compilation = CreateCompilationWithMscorlib(source, TestOptions.ReleaseDll) AssertTheseDiagnostics(compilation, <expected><![CDATA[ BC30452: Operator '=' is not defined for types 'TestStr?' and 'TestStr?'. Dim z5 = (x = Nothing) ~~~~~~~~~~~ BC30452: Operator '=' is not defined for types 'TestStr?' and 'TestStr?'. Dim z6 = (Nothing = x) ~~~~~~~~~~~ BC30452: Operator '<>' is not defined for types 'TestStr?' and 'TestStr?'. Dim z7 = (x <> Nothing) ~~~~~~~~~~~~ BC30452: Operator '<>' is not defined for types 'TestStr?' and 'TestStr?'. Dim z8 = (Nothing <> x) ~~~~~~~~~~~~ BC42037: This expression will always evaluate to Nothing (due to null propagation from the equals operator). To check if the value is null consider using 'Is Nothing'. Dim z15 = (y = Nothing) ~~~~~~~~~~~ BC42037: This expression will always evaluate to Nothing (due to null propagation from the equals operator). To check if the value is null consider using 'Is Nothing'. Dim z16 = (Nothing = y) ~~~~~~~~~~~ BC42038: This expression will always evaluate to Nothing (due to null propagation from the equals operator). To check if the value is not null consider using 'IsNot Nothing'. Dim z17 = (y <> Nothing) ~~~~~~~~~~~~ BC42038: This expression will always evaluate to Nothing (due to null propagation from the equals operator). To check if the value is not null consider using 'IsNot Nothing'. Dim z18 = (Nothing <> y) ~~~~~~~~~~~~ ]]></expected>) Dim tree As SyntaxTree = (From t In compilation.SyntaxTrees Where t.FilePath = "a.vb").Single() Dim semanticModel = compilation.GetSemanticModel(tree) Dim nodes = (From node In tree.GetRoot().DescendantNodes() Select node = TryCast(node, BinaryExpressionSyntax) Where node IsNot Nothing).ToArray() Assert.Equal(16, nodes.Length) For i As Integer = 0 To nodes.Length - 1 Dim symbol = semanticModel.GetSymbolInfo(nodes(i)).Symbol Select Case i Case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 Assert.Null(symbol) Case 12, 13 Assert.Equal("Function System.Int32.op_Equality(left As System.Int32, right As System.Int32) As System.Boolean", symbol.ToTestDisplayString()) Case 14, 15 Assert.Equal("Function System.Int32.op_Inequality(left As System.Int32, right As System.Int32) As System.Boolean", symbol.ToTestDisplayString()) Case Else Throw ExceptionUtilities.UnexpectedValue(i) End Select Next End Sub <Fact(Skip:="This test can cause other tests running in parallel to fail because they might not have enough memory to succeed."), WorkItem(529600, "DevDiv")> Public Sub Bug529600() Dim compilationDef = <compilation> <file name="a.vb"> Module M Sub Main() End Sub Const c0 = "<%= New String("0"c, 65000) %>" Const C1=C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 + C0 Const C2=C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 + C1 End Module </file> </compilation> Dim compilation = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(compilationDef) Dim err = compilation.GetDiagnostics().Single() Assert.Equal(ERRID.ERR_ConstantStringTooLong, err.Code) Assert.Equal("Length of String constant exceeds current memory limit. Try splitting the string into multiple constants.", err.GetMessage(EnsureEnglishUICulture.PreferredOrNull)) End Sub End Class End Namespace
define(function(require) { 'use strict'; var CollapsibleFormRowView; var $ = require('jquery'); var _ = require('underscore'); var BaseView = require('oroui/js/app/views/base/view'); require('jquery.select2'); CollapsibleFormRowView = BaseView.extend({ autoRender: true, events: { 'click [data-name=collapse]': 'onCollapseToggle', 'changed .condition.controls': 'onChanged' }, render: function() { if (this.$el.hasClass('collapsed')) { this.$('.controls').hide(); } return this; }, onCollapseToggle: function(e) { var $target = $(e.target); var toggleLabel = $target.data('toggle-label'); if (toggleLabel) { $target .data('toggle-label', $target.text()) .text(toggleLabel); } var $controls = this.$('.controls'); if (this.$el.hasClass('collapsed')) { $controls.slideDown(_.bind(function() { this.$el.trigger('content:changed'); }, this)); } else { $controls.slideUp(); } this.$el.toggleClass('collapsed'); }, onChanged: function() { this.$el.trigger('content:changed'); } }); return CollapsibleFormRowView; });
/** * @file * JavaScript to disable back button. */ (function () { 'use strict'; // From: http://stackoverflow.com/questions/17962130/restrict-user-to-refresh-and-back-forward-in-any-browser history.pushState({page: 1}, 'Title 1', '#no-back'); window.onhashchange = function (event) { window.location.hash = 'no-back'; }; })();
* dockerd ## Steps * Run postgres:11 * Run the plugin standalone * Check the exit code
namespace Kafka.Tests.Utils { using System; using System.Configuration; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; /// <summary> /// Utility class usefull to create /// </summary> public static class KafkaRunClassHelper { public const string ZookeeperMainClass = "org.apache.zookeeper.server.quorum.QuorumPeerMain"; public const string KafkaServerMainClass = "kafka.Kafka"; public static string KafkaInstallationDir { get { return ConfigurationManager.AppSettings["KafkaInstallationDir"]; } } public static string JavaExec { get { return ConfigurationManager.AppSettings["JavaExec"]; } } public static Process Run(string mainClass, string args) { var startInfo = new ProcessStartInfo(); var p = new Process(); startInfo.UseShellExecute = false; startInfo.Arguments = MakeArgs(mainClass, args); startInfo.FileName = JavaExec; p.StartInfo = startInfo; p.Start(); return p; } private static string MakeArgs(string mainClass, string args) { var sb = new StringBuilder(); sb.Append(@" -Xmx512M -Xms512M -XX:+UseParNewGC -XX:+UseConcMarkSweepGC "); sb.AppendFormat(@" -Dlog4j.configuration=file:{0}config\log4j.properties -Dkafka.logs.dir={0}logs ", KafkaInstallationDir); var libsDir = Path.Combine(KafkaInstallationDir, "libs"); if (!Directory.Exists(KafkaInstallationDir)) { throw new Exception(string.Format("Unable to find kafka installation in: {0}. Verify KafkaInstallationDir in App.config and try again.", KafkaInstallationDir)); } var jarsToInclude = Directory.EnumerateFiles(Path.Combine(KafkaInstallationDir, "libs")) .Select(x => Path.Combine(libsDir, x)) .ToList(); var classpath = " -cp " + string.Join(";", jarsToInclude); sb.Append(" " + classpath + " "); sb.Append(" "); sb.Append(mainClass); sb.Append(" "); sb.Append(args); return sb.ToString(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.SignalR; namespace TanksOnline.ProjektPZ.Server.Controllers.Hubs { public class MyHub : Hub<MyHub.ITest> { public void Hello(Test hi) { Clients.All.SomeOneSendHello(hi); } public interface ITest { void SomeOneSendHello(Test hi); } public class Test { public string Name { get; set; } public string Message { get; set; } } } }
<?php namespace Symfony\Component\HttpKernel\CacheClearer; use Psr\Cache\CacheItemPoolInterface; /** * @author Nicolas Grekas <p@tchwork.com> */ class Psr6CacheClearer implements CacheClearerInterface { private $pools = array(); public function __construct(array $pools = array()) { $this->pools = $pools; } public function addPool(CacheItemPoolInterface $pool) { @trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Pass an array of pools indexed by name to the constructor instead.', __METHOD__), E_USER_DEPRECATED); $this->pools[] = $pool; } public function hasPool($name) { return isset($this->pools[$name]); } public function clearPool($name) { if (!isset($this->pools[$name])) { throw new \InvalidArgumentException(sprintf('Cache pool not found: %s.', $name)); } return $this->pools[$name]->clear(); } /** * {@inheritdoc} */ public function clear($cacheDir) { foreach ($this->pools as $pool) { $pool->clear(); } } }
#ifndef _LAKE_BOOL_H #define _LAKE_BOOL_H #include "common.h" #include "lake.h" bool lake_bool_val(LakeBool *b); bool lake_is_true(LakeCtx *ctx, LakeVal *x); bool lake_is_false(LakeCtx *ctx, LakeVal *x); bool lake_is_truthy(LakeCtx *ctx, LakeVal *x); bool lake_is_falsy(LakeCtx *ctx, LakeVal *x); LakeBool *lake_bool_from_int(LakeCtx *ctx, int n); char *lake_bool_repr(LakeBool *b); LakeVal *lake_bool_and(LakeCtx *ctx, LakeVal *x, LakeVal *y); LakeVal *lake_bool_or(LakeCtx *ctx, LakeVal *x, LakeVal *y); #endif
void g() {} // It is important that the following string be in the error message. The gcc // testsuite looks for it to decide if a target supports aliases. void f() __attribute__((alias("g"))); //expected-error {{only weak aliases are supported}}
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Vulcanizer Test</title> <script src="bower_components/platform/platform.js"></script> <script src="bower_components/polymer/polymer.js"></script> </head> <body><div hidden="" by-vulcanize=""><dom-module id="y-import" assetpath="sub-import/"> <template> <style> :host{ background: url("foo.jpg"); } </style> </template> </dom-module><dom-module id="x-import" assetpath="/"> <template> <link rel="import" type="css" href="import-test.css"> [Imported: <content></content>] </template> </dom-module></div> <x-import>Hello Import!</x-import> <y-import></y-import> <script src="vulcanized.js"></script></body></html>
package org.onosproject.pcepio.types; import java.util.Objects; import org.jboss.netty.buffer.ChannelBuffer; import org.onosproject.pcepio.protocol.PcepVersion; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.MoreObjects; /** * Provides StatefulPceCapabilityTlv. */ public class StatefulPceCapabilityTlv implements PcepValueType { /* STATEFUL-PCE-CAPABILITY TLV format * * Reference :PCEP Extensions for Stateful PCE draft-ietf-pce-stateful-pce-10 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type=16 | Length=4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Flags |D|T|I|S|U| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ protected static final Logger log = LoggerFactory.getLogger(StatefulPceCapabilityTlv.class); public static final short TYPE = 16; public static final short LENGTH = 4; public static final byte UFLAG_SET = 0x01; public static final byte SFLAG_SET = 0x02; public static final byte IFLAG_SET = 0x04; public static final byte TFLAG_SET = 0x08; public static final byte DFLAG_SET = 0x10; public static final int SET = 1; private final int rawValue; private final boolean bDFlag; private final boolean bTFlag; private final boolean bIFlag; private final boolean bSFlag; private final boolean bUFlag; private final boolean isRawValueSet; /** * Constructor to initialize variables. * * @param rawValue Flags */ public StatefulPceCapabilityTlv(int rawValue) { this.rawValue = rawValue; isRawValueSet = true; this.bUFlag = (rawValue & UFLAG_SET) == UFLAG_SET; this.bSFlag = (rawValue & SFLAG_SET) == SFLAG_SET; this.bIFlag = (rawValue & IFLAG_SET) == IFLAG_SET; this.bTFlag = (rawValue & TFLAG_SET) == TFLAG_SET; this.bDFlag = (rawValue & DFLAG_SET) == DFLAG_SET; } /** * Constructor to initialize variables. * * @param bDFlag D-flag * @param bTFlag T-flag * @param bIFlag I-flag * @param bSFlag S-flag * @param bUFlag U-flag */ public StatefulPceCapabilityTlv(boolean bDFlag, boolean bTFlag, boolean bIFlag, boolean bSFlag, boolean bUFlag) { this.bDFlag = bDFlag; this.bTFlag = bTFlag; this.bIFlag = bIFlag; this.bSFlag = bSFlag; this.bUFlag = bUFlag; this.rawValue = 0; isRawValueSet = false; } /** * Returns object of StatefulPceCapabilityTlv. * * @param raw value Flags * @return object of StatefulPceCapabilityTlv */ public static StatefulPceCapabilityTlv of(final int raw) { return new StatefulPceCapabilityTlv(raw); } @Override public PcepVersion getVersion() { return PcepVersion.PCEP_1; } /** * Returns D-flag. * * @return bDFlag D-flag */ public boolean getDFlag() { return bDFlag; } /** * Returns T-flag. * * @return bTFlag T-flag */ public boolean getTFlag() { return bTFlag; } /** * Returns I-flag. * * @return bIFlag I-flag */ public boolean getIFlag() { return bIFlag; } /** * Returns S-flag. * * @return bSFlag S-flag */ public boolean getSFlag() { return bSFlag; } /** * Returns U-flag. * * @return bUFlag U-flag */ public boolean getUFlag() { return bUFlag; } /** * Returns raw value Flags. * * @return rawValue Flags */ public int getInt() { return rawValue; } @Override public short getType() { return TYPE; } @Override public short getLength() { return LENGTH; } @Override public int hashCode() { if (isRawValueSet) { return Objects.hash(rawValue); } else { return Objects.hash(bDFlag, bTFlag, bIFlag, bSFlag, bUFlag); } } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof StatefulPceCapabilityTlv) { StatefulPceCapabilityTlv other = (StatefulPceCapabilityTlv) obj; if (isRawValueSet) { return Objects.equals(this.rawValue, other.rawValue); } else { return Objects.equals(this.bDFlag, other.bDFlag) && Objects.equals(this.bTFlag, other.bTFlag) && Objects.equals(this.bIFlag, other.bIFlag) && Objects.equals(this.bSFlag, other.bSFlag) && Objects.equals(this.bUFlag, other.bUFlag); } } return false; } @Override public int write(ChannelBuffer c) { int iLenStartIndex = c.writerIndex(); c.writeShort(TYPE); c.writeShort(LENGTH); if (isRawValueSet) { c.writeInt(rawValue); } else { int temp = 0; if (bUFlag) { temp = temp | UFLAG_SET; } if (bSFlag) { temp = temp | SFLAG_SET; } if (bIFlag) { temp = temp | IFLAG_SET; } if (bTFlag) { temp = temp | TFLAG_SET; } if (bDFlag) { temp = temp | DFLAG_SET; } c.writeInt(temp); } return c.writerIndex() - iLenStartIndex; } /** * Reads from channel buffer and returns object of StatefulPceCapabilityTlv. * * @param c input channel buffer * @return object of StatefulPceCapabilityTlv */ public static PcepValueType read(ChannelBuffer c) { int temp = c.readInt(); boolean bDFlag; boolean bTFlag; boolean bIFlag; boolean bSFlag; boolean bUFlag; bUFlag = (temp & UFLAG_SET) == UFLAG_SET; bSFlag = (temp & SFLAG_SET) == SFLAG_SET; bIFlag = (temp & IFLAG_SET) == IFLAG_SET; bTFlag = (temp & TFLAG_SET) == TFLAG_SET; bDFlag = (temp & DFLAG_SET) == DFLAG_SET; return new StatefulPceCapabilityTlv(bDFlag, bTFlag, bIFlag, bSFlag, bUFlag); } @Override public String toString() { return MoreObjects.toStringHelper(getClass()) .add("type", TYPE) .add("Length", LENGTH) .add("DFlag", bDFlag) .add("TFlag", bTFlag) .add("IFlag", bIFlag) .add("SFlag", bSFlag) .add("UFlag", bUFlag) .toString(); } }
<?php namespace ZendTest\Authentication\Adapter; use Zend\Authentication; use Zend\Authentication\Adapter; use Zend\Db\Adapter\Adapter as DbAdapter; use Zend\Db\Sql\Select as DBSelect; /** * @category Zend * @package Zend_Auth * @subpackage UnitTests * @group Zend_Auth * @group Zend_Db_Table */ class DbTableTest extends \PHPUnit_Framework_TestCase { /** * SQLite database connection * * @var \Zend\Db\Adapter\Adapter */ protected $_db = null; /** * Database table authentication adapter * * @var \Zend\Authentication\Adapter\DbTable */ protected $_adapter = null; /** * Set up test configuration */ public function setUp() { if (!defined('TESTS_ZEND_AUTH_ADAPTER_DBTABLE_PDO_SQLITE_ENABLED') || constant('TESTS_ZEND_AUTH_ADAPTER_DBTABLE_PDO_SQLITE_ENABLED') === false ) { $this->markTestSkipped('Tests are not enabled in TestConfiguration.php'); return; } elseif (!extension_loaded('pdo')) { $this->markTestSkipped('PDO extension is not loaded'); return; } elseif (!in_array('sqlite', \PDO::getAvailableDrivers())) { $this->markTestSkipped('SQLite PDO driver is not available'); return; } $this->_setupDbAdapter(); $this->_setupAuthAdapter(); } public function tearDown() { $this->_adapter = null; if ($this->_db instanceof DbAdapter) { $this->_db->query('DROP TABLE [users]'); } $this->_db = null; } /** * Ensures expected behavior for authentication success */ public function testAuthenticateSuccess() { $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $result = $this->_adapter->authenticate(); $this->assertTrue($result->isValid()); } /** * Ensures expected behavior for authentication success */ public function testAuthenticateSuccessWithTreatment() { $this->_adapter = new Adapter\DbTable($this->_db, 'users', 'username', 'password', '?'); $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $result = $this->_adapter->authenticate(); $this->assertTrue($result->isValid()); } /** * Ensures expected behavior for for authentication failure * reason: Identity not found. */ public function testAuthenticateFailureIdentityNotFound() { $this->_adapter->setIdentity('non_existent_username'); $this->_adapter->setCredential('my_password'); $result = $this->_adapter->authenticate(); $this->assertEquals(Authentication\Result::FAILURE_IDENTITY_NOT_FOUND, $result->getCode()); } /** * Ensures expected behavior for for authentication failure * reason: Identity not found. */ public function testAuthenticateFailureIdentityAmbiguous() { $sqlInsert = 'INSERT INTO users (username, password, real_name) VALUES ("my_username", "my_password", "My Real Name")'; $this->_db->query($sqlInsert, DbAdapter::QUERY_MODE_EXECUTE); $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $result = $this->_adapter->authenticate(); $this->assertEquals(Authentication\Result::FAILURE_IDENTITY_AMBIGUOUS, $result->getCode()); } /** * Ensures expected behavior for authentication failure because of a bad password */ public function testAuthenticateFailureInvalidCredential() { $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password_bad'); $result = $this->_adapter->authenticate(); $this->assertFalse($result->isValid()); } /** * Ensures that getResultRowObject() works for successful authentication */ public function testGetResultRow() { $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $this->_adapter->authenticate(); $resultRow = $this->_adapter->getResultRowObject(); $this->assertEquals($resultRow->username, 'my_username'); } /** * Ensure that ResultRowObject returns only what told to be included */ public function testGetSpecificResultRow() { $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $this->_adapter->authenticate(); $resultRow = $this->_adapter->getResultRowObject(array('username', 'real_name')); $this->assertEquals('O:8:"stdClass":2:{s:8:"username";s:11:"my_username";s:9:"real_name";s:12:"My Real Name";}', serialize($resultRow)); } /** * Ensure that ResultRowObject returns an object has specific omissions */ public function testGetOmittedResultRow() { $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $this->_adapter->authenticate(); $resultRow = $this->_adapter->getResultRowObject(null, 'password'); $this->assertEquals('O:8:"stdClass":3:{s:2:"id";s:1:"1";s:8:"username";s:11:"my_username";s:9:"real_name";s:12:"My Real Name";}', serialize($resultRow)); } /** * @group ZF-5957 */ public function testAdapterCanReturnDbSelectObject() { $this->assertTrue($this->_adapter->getDbSelect() instanceof DBSelect); } /** * @group ZF-5957 */ public function testAdapterCanUseModifiedDbSelectObject() { $select = $this->_adapter->getDbSelect(); $select->where('1 = 0'); $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $result = $this->_adapter->authenticate(); $this->assertEquals(Authentication\Result::FAILURE_IDENTITY_NOT_FOUND, $result->getCode()); } /** * @group ZF-5957 */ public function testAdapterReturnsASelectObjectWithoutAuthTimeModificationsAfterAuth() { $select = $this->_adapter->getDbSelect(); $select->where('1 = 1'); $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $this->_adapter->authenticate(); $selectAfterAuth = $this->_adapter->getDbSelect(); $whereParts = $selectAfterAuth->where->getPredicates(); $this->assertEquals(1, count($whereParts)); $lastWherePart = array_pop($whereParts); $expressionData = $lastWherePart[1]->getExpressionData(); $this->assertEquals('1 = 1', $expressionData[0][0]); } /** * Ensure that exceptions are caught */ public function testCatchExceptionNoTable() { $this->setExpectedException('Zend\Authentication\Adapter\Exception\RuntimeException', 'A table must be supplied for'); $adapter = new Adapter\DbTable($this->_db); $adapter->authenticate(); } /** * Ensure that exceptions are caught */ public function testCatchExceptionNoIdentityColumn() { $this->setExpectedException('Zend\Authentication\Adapter\Exception\RuntimeException', 'An identity column must be supplied for the'); $adapter = new Adapter\DbTable($this->_db, 'users'); $adapter->authenticate(); } /** * Ensure that exceptions are caught */ public function testCatchExceptionNoCredentialColumn() { $this->setExpectedException('Zend\Authentication\Adapter\Exception\RuntimeException', 'A credential column must be supplied'); $adapter = new Adapter\DbTable($this->_db, 'users', 'username'); $adapter->authenticate(); } /** * Ensure that exceptions are caught */ public function testCatchExceptionNoIdentity() { $this->setExpectedException('Zend\Authentication\Adapter\Exception\RuntimeException', 'A value for the identity was not provided prior'); $this->_adapter->authenticate(); } /** * Ensure that exceptions are caught */ public function testCatchExceptionNoCredential() { $this->setExpectedException('Zend\Authentication\Adapter\Exception\RuntimeException', 'A credential value was not provided prior'); $this->_adapter->setIdentity('my_username'); $this->_adapter->authenticate(); } /** * Ensure that exceptions are caught */ public function testCatchExceptionBadSql() { $this->setExpectedException('Zend\Authentication\Adapter\Exception\RuntimeException', 'The supplied parameters to'); $this->_adapter->setTableName('bad_table_name'); $this->_adapter->setIdentity('value'); $this->_adapter->setCredential('value'); $this->_adapter->authenticate(); } /** * Test to see same usernames with different passwords can not authenticate * when flag is not set. This is the current state of * Zend_Auth_Adapter_DbTable (up to ZF 1.10.6) * * @group ZF-7289 */ public function testEqualUsernamesDifferentPasswordShouldNotAuthenticateWhenFlagIsNotSet() { $sqlInsert = 'INSERT INTO users (username, password, real_name) ' . 'VALUES ("my_username", "my_otherpass", "Test user 2")'; $this->_db->query($sqlInsert, DbAdapter::QUERY_MODE_EXECUTE); // test if user 1 can authenticate $this->_adapter->setIdentity('my_username') ->setCredential('my_password'); $result = $this->_adapter->authenticate(); $this->assertTrue(in_array('More than one record matches the supplied identity.', $result->getMessages())); $this->assertFalse($result->isValid()); } /** * Test to see same usernames with different passwords can authenticate when * a flag is set * * @group ZF-7289 */ public function testEqualUsernamesDifferentPasswordShouldAuthenticateWhenFlagIsSet() { $sqlInsert = 'INSERT INTO users (username, password, real_name) ' . 'VALUES ("my_username", "my_otherpass", "Test user 2")'; $this->_db->query($sqlInsert, DbAdapter::QUERY_MODE_EXECUTE); // test if user 1 can authenticate $this->_adapter->setIdentity('my_username') ->setCredential('my_password') ->setAmbiguityIdentity(true); $result = $this->_adapter->authenticate(); $this->assertFalse(in_array('More than one record matches the supplied identity.', $result->getMessages())); $this->assertTrue($result->isValid()); $this->assertEquals('my_username', $result->getIdentity()); $this->_adapter = null; $this->_setupAuthAdapter(); // test if user 2 can authenticate $this->_adapter->setIdentity('my_username') ->setCredential('my_otherpass') ->setAmbiguityIdentity(true); $result2 = $this->_adapter->authenticate(); $this->assertFalse(in_array('More than one record matches the supplied identity.', $result->getMessages())); $this->assertTrue($result2->isValid()); $this->assertEquals('my_username', $result2->getIdentity()); } protected function _setupDbAdapter($optionalParams = array()) { $params = array('driver' => 'pdo_sqlite', 'dbname' => TESTS_ZEND_AUTH_ADAPTER_DBTABLE_PDO_SQLITE_DATABASE); if (!empty($optionalParams)) { $params['options'] = $optionalParams; } $this->_db = new DbAdapter($params); $sqlCreate = 'CREATE TABLE IF NOT EXISTS [users] ( ' . '[id] INTEGER NOT NULL PRIMARY KEY, ' . '[username] VARCHAR(50) NOT NULL, ' . '[password] VARCHAR(32) NULL, ' . '[real_name] VARCHAR(150) NULL)'; $this->_db->query($sqlCreate, DbAdapter::QUERY_MODE_EXECUTE); $sqlDelete = 'DELETE FROM users'; $this->_db->query($sqlDelete, DbAdapter::QUERY_MODE_EXECUTE); $sqlInsert = 'INSERT INTO users (username, password, real_name) ' . 'VALUES ("my_username", "my_password", "My Real Name")'; $this->_db->query($sqlInsert, DbAdapter::QUERY_MODE_EXECUTE); } protected function _setupAuthAdapter() { $this->_adapter = new Adapter\DbTable($this->_db, 'users', 'username', 'password'); } }
// -*- C++ -*- class list_box; class box { private: static int next_uid; public: int spacing_type; const int uid; box(); virtual void debug_print() = 0; virtual ~box(); void top_level(); virtual int compute_metrics(int); virtual void compute_subscript_kern(); virtual void compute_skew(); virtual void output(); void extra_space(); virtual list_box *to_list_box(); virtual int is_simple(); virtual int is_char(); virtual int left_is_italic(); virtual int right_is_italic(); virtual void handle_char_type(int, int); enum { FOUND_NOTHING = 0, FOUND_MARK = 1, FOUND_LINEUP = 2 }; void set_spacing_type(char *type); virtual void hint(unsigned); virtual void check_tabs(int); }; class box_list { private: int maxlen; public: box **p; int len; box_list(box *); ~box_list(); void append(box *); void list_check_tabs(int); void list_debug_print(const char *sep); friend class list_box; }; // declarations to avoid friend name injection problems box *make_script_box(box *, box *, box *); box *make_mark_box(box *); box *make_lineup_box(box *); class list_box : public box { int is_script; box_list list; int sty; public: list_box(box *); void debug_print(); int compute_metrics(int); void compute_subscript_kern(); void output(); void check_tabs(int); void append(box *); list_box *to_list_box(); void handle_char_type(int, int); void compute_sublist_width(int n); friend box *make_script_box(box *, box *, box *); friend box *make_mark_box(box *); friend box *make_lineup_box(box *); }; enum alignment { LEFT_ALIGN, RIGHT_ALIGN, CENTER_ALIGN }; class column : public box_list { alignment align; int space; public: column(box *); void set_alignment(alignment); void set_space(int); void debug_print(const char *); friend class matrix_box; friend class pile_box; }; class pile_box : public box { column col; public: pile_box(box *); int compute_metrics(int); void output(); void debug_print(); void check_tabs(int); void set_alignment(alignment a) { col.set_alignment(a); } void set_space(int n) { col.set_space(n); } void append(box *p) { col.append(p); } }; class matrix_box : public box { private: int len; int maxlen; column **p; public: matrix_box(column *); ~matrix_box(); void append(column *); int compute_metrics(int); void output(); void check_tabs(int); void debug_print(); }; class pointer_box : public box { protected: box *p; public: pointer_box(box *); ~pointer_box(); int compute_metrics(int); void compute_subscript_kern(); void compute_skew(); void debug_print() = 0; void check_tabs(int); }; class vcenter_box : public pointer_box { public: vcenter_box(box *); int compute_metrics(int); void output(); void debug_print(); }; class simple_box : public box { public: int compute_metrics(int); void compute_subscript_kern(); void compute_skew(); void output() = 0; void debug_print() = 0; int is_simple(); }; class quoted_text_box : public simple_box { char *text; public: quoted_text_box(char *); ~quoted_text_box(); void debug_print(); void output(); }; class half_space_box : public simple_box { public: half_space_box(); void output(); void debug_print(); }; class space_box : public simple_box { public: space_box(); void output(); void debug_print(); }; class tab_box : public box { int disabled; public: tab_box(); void output(); void debug_print(); void check_tabs(int); }; class size_box : public pointer_box { private: char *size; public: size_box(char *, box *); ~size_box(); int compute_metrics(int); void output(); void debug_print(); }; class font_box : public pointer_box { private: char *f; public: font_box(char *, box *); ~font_box(); int compute_metrics(int); void output(); void debug_print(); }; class fat_box : public pointer_box { public: fat_box(box *); int compute_metrics(int); void output(); void debug_print(); }; class vmotion_box : public pointer_box { private: int n; // up is >= 0 public: vmotion_box(int, box *); int compute_metrics(int); void output(); void debug_print(); }; class hmotion_box : public pointer_box { int n; public: hmotion_box(int, box *); int compute_metrics(int); void output(); void debug_print(); }; box *split_text(char *); box *make_delim_box(char *, box *, char *); box *make_sqrt_box(box *); box *make_prime_box(box *); box *make_over_box(box *, box *); box *make_small_over_box(box *, box *); box *make_limit_box(box *, box *, box *); box *make_accent_box(box *, box *); box *make_uaccent_box(box *, box *); box *make_overline_box(box *); box *make_underline_box(box *); box *make_special_box(char *, box *); void set_space(int); int set_gsize(const char *); void set_gfont(const char *); void set_grfont(const char *); void set_gbfont(const char *); const char *get_gfont(); const char *get_grfont(); const char *get_gbfont(); void start_string(); void output_string(); void do_text(const char *); void restore_compatibility(); void set_script_reduction(int n); void set_minimum_size(int n); void set_param(const char *name, int value); void set_char_type(const char *type, char *ch); void init_char_table(); void init_extensible(); void define_extensible(const char *name, const char *ext, const char *top = 0, const char *mid = 0, const char *bot = 0);
<?php final class DrydockLeaseReleaseController extends DrydockLeaseController { public function handleRequest(AphrontRequest $request) { $viewer = $request->getViewer(); $id = $request->getURIData('id'); $lease = id(new DrydockLeaseQuery()) ->setViewer($viewer) ->withIDs(array($id)) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->executeOne(); if (!$lease) { return new Aphront404Response(); } $lease_uri = '/lease/'.$lease->getID().'/'; $lease_uri = $this->getApplicationURI($lease_uri); if (!$lease->canRelease()) { return $this->newDialog() ->setTitle(pht('Lease Not Releasable')) ->appendParagraph( pht( 'Leases can not be released after they are destroyed.')) ->addCancelButton($lease_uri); } if ($request->isFormPost()) { $command = DrydockCommand::initializeNewCommand($viewer) ->setTargetPHID($lease->getPHID()) ->setCommand(DrydockCommand::COMMAND_RELEASE) ->save(); $lease->scheduleUpdate(); return id(new AphrontRedirectResponse())->setURI($lease_uri); } return $this->newDialog() ->setTitle(pht('Release Lease?')) ->appendParagraph( pht( 'Forcefully releasing a lease may interfere with the operation '. 'of the lease holder and trigger destruction of the underlying '. 'resource. It can not be undone.')) ->addSubmitButton(pht('Release Lease')) ->addCancelButton($lease_uri); } }
/** * Created by tongtongbao on 5/16/15. */ function isEmpty(val){ return (val === undefined || val == null || val.length <= 0) ? true : false; } function adAlert(text) { // console.log(text); console.log($("#error_message")); var a = $("#error_message")[0]; console.log(a); $("#error_message")[0].innerText = text; $("#error_message")[0].style.visibility = "visible"; //document.getElementById("error_message").style.visibility = "visible"; setTimeout(function() {document.getElementById('error_message').style.visibility = "hidden";},2000); } function addCookie(username, password) { $.cookie("username", username, { expires: 7, path: '/pomo'}); $.cookie("password", password, { expires: 7, path: '/pomo'}); } function removeCookie() { $.removeCookie("username"); $.removeCookie("password"); } function checkCookie() { if ($.cookie('username') && $.cookie("password")) { // TODO: there is bug here. We need to check whether // password match username by querying the database return true; } else { return false; } }; function getCookie(name) { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; };
const $ = document.querySelector.bind(document); const $$ = document.querySelectorAll.bind(document); Node.prototype.on = window.on = function (name, fn) { this.addEventListener(name, fn); }; NodeList.prototype.__proto__ = Array.prototype; // eslint-disable-line NodeList.prototype.on = NodeList.prototype.addEventListener = function (name, fn) { this.forEach((elem) => { elem.on(name, fn); }); }; export { $, $$ };
body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; } #HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; } #HTMLReporter a { text-decoration: none; } #HTMLReporter a:hover { text-decoration: underline; } #HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; } #HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; } #HTMLReporter #jasmine_content { position: fixed; right: 100%; } #HTMLReporter .version { color: #aaaaaa; } #HTMLReporter .banner { margin-top: 14px; } #HTMLReporter .duration { color: #aaaaaa; float: right; } #HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; } #HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; } #HTMLReporter .symbolSummary li.passed { font-size: 14px; } #HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; } #HTMLReporter .symbolSummary li.failed { line-height: 9px; } #HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; } #HTMLReporter .symbolSummary li.skipped { font-size: 14px; } #HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; } #HTMLReporter .symbolSummary li.pending { line-height: 11px; } #HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; } #HTMLReporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; } #HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } #HTMLReporter .runningAlert { background-color: #666666; } #HTMLReporter .skippedAlert { background-color: #aaaaaa; } #HTMLReporter .skippedAlert:first-child { background-color: #333333; } #HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; } #HTMLReporter .passingAlert { background-color: #a6b779; } #HTMLReporter .passingAlert:first-child { background-color: #5e7d00; } #HTMLReporter .failingAlert { background-color: #cf867e; } #HTMLReporter .failingAlert:first-child { background-color: #b03911; } #HTMLReporter .results { margin-top: 14px; } #HTMLReporter #details { display: none; } #HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; } #HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; } #HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; } #HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; } #HTMLReporter.showDetails .summary { display: none; } #HTMLReporter.showDetails #details { display: block; } #HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; } #HTMLReporter .summary { margin-top: 14px; } #HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; } #HTMLReporter .summary .specSummary.passed a { color: #5e7d00; } #HTMLReporter .summary .specSummary.failed a { color: #b03911; } #HTMLReporter .description + .suite { margin-top: 0; } #HTMLReporter .suite { margin-top: 14px; } #HTMLReporter .suite a { color: #333333; } #HTMLReporter #details .specDetail { margin-bottom: 28px; } #HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; } #HTMLReporter .resultMessage { padding-top: 14px; color: #333333; } #HTMLReporter .resultMessage span.result { display: block; } #HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; } #TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ } #TrivialReporter a:visited, #TrivialReporter a { color: #303; } #TrivialReporter a:hover, #TrivialReporter a:active { color: blue; } #TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; } #TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; } #TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; } #TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; } #TrivialReporter .runner.running { background-color: yellow; } #TrivialReporter .options { text-align: right; font-size: .8em; } #TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; } #TrivialReporter .suite .suite { margin: 5px; } #TrivialReporter .suite.passed { background-color: #dfd; } #TrivialReporter .suite.failed { background-color: #fdd; } #TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; } #TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; } #TrivialReporter .spec.failed { background-color: #fbb; border-color: red; } #TrivialReporter .spec.passed { background-color: #bfb; border-color: green; } #TrivialReporter .spec.skipped { background-color: #bbb; } #TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; } #TrivialReporter .passed { background-color: #cfc; display: none; } #TrivialReporter .failed { background-color: #fbb; } #TrivialReporter .skipped { color: #777; background-color: #eee; display: none; } #TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; } #TrivialReporter .resultMessage .mismatch { color: black; } #TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; } #TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; } #TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; } #TrivialReporter #jasmine_content { position: fixed; right: 100%; } #TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }
#include "ANTLRErrorStrategy.h" antlr4::ANTLRErrorStrategy::~ANTLRErrorStrategy() { }
/** * @author Mat Groves http://matgroves.com/ @Doormat23 */ /** * A set of functions used by the webGL renderer to draw the primitive graphics data * * @class CanvasGraphics */ PIXI.WebGLGraphics = function() { }; /** * Renders the graphics object * * @static * @private * @method renderGraphics * @param graphics {Graphics} * @param projection {Object} */ PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projection, offset) { var gl = renderSession.gl; var projection = renderSession.projection, offset = renderSession.offset, shader = renderSession.shaderManager.primitiveShader; if(!graphics._webGL[gl.id])graphics._webGL[gl.id] = {points:[], indices:[], lastIndex:0, buffer:gl.createBuffer(), indexBuffer:gl.createBuffer()}; var webGL = graphics._webGL[gl.id]; if(graphics.dirty) { graphics.dirty = false; if(graphics.clearDirty) { graphics.clearDirty = false; webGL.lastIndex = 0; webGL.points = []; webGL.indices = []; } PIXI.WebGLGraphics.updateGraphics(graphics, gl); } renderSession.shaderManager.activatePrimitiveShader(); // This could be speeded up fo sure! var m = PIXI.mat3.clone(graphics.worldTransform); PIXI.mat3.transpose(m); // set the matrix transform for the gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); gl.uniformMatrix3fv(shader.translationMatrix, false, m); gl.uniform2f(shader.projectionVector, projection.x, -projection.y); gl.uniform2f(shader.offsetVector, -offset.x, -offset.y); gl.uniform3fv(shader.tintColor, PIXI.hex2rgb(graphics.tint)); gl.uniform1f(shader.alpha, graphics.worldAlpha); gl.bindBuffer(gl.ARRAY_BUFFER, webGL.buffer); gl.vertexAttribPointer(shader.aVertexPosition, 2, gl.FLOAT, false, 4 * 6, 0); gl.vertexAttribPointer(shader.colorAttribute, 4, gl.FLOAT, false,4 * 6, 2 * 4); // set the index buffer! gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGL.indexBuffer); gl.drawElements(gl.TRIANGLE_STRIP, webGL.indices.length, gl.UNSIGNED_SHORT, 0 ); renderSession.shaderManager.deactivatePrimitiveShader(); // return to default shader... // PIXI.activateShader(PIXI.defaultShader); }; /** * Updates the graphics object * * @static * @private * @method updateGraphics * @param graphics {Graphics} */ PIXI.WebGLGraphics.updateGraphics = function(graphics, gl) { var webGL = graphics._webGL[gl.id]; for (var i = webGL.lastIndex; i < graphics.graphicsData.length; i++) { var data = graphics.graphicsData[i]; if(data.type === PIXI.Graphics.POLY) { if(data.fill) { if(data.points.length>3) PIXI.WebGLGraphics.buildPoly(data, webGL); } if(data.lineWidth > 0) { PIXI.WebGLGraphics.buildLine(data, webGL); } } else if(data.type === PIXI.Graphics.RECT) { PIXI.WebGLGraphics.buildRectangle(data, webGL); } else if(data.type === PIXI.Graphics.CIRC || data.type === PIXI.Graphics.ELIP) { PIXI.WebGLGraphics.buildCircle(data, webGL); } } webGL.lastIndex = graphics.graphicsData.length; webGL.glPoints = new Float32Array(webGL.points); gl.bindBuffer(gl.ARRAY_BUFFER, webGL.buffer); gl.bufferData(gl.ARRAY_BUFFER, webGL.glPoints, gl.STATIC_DRAW); webGL.glIndicies = new Uint16Array(webGL.indices); gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, webGL.indexBuffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, webGL.glIndicies, gl.STATIC_DRAW); }; /** * Builds a rectangle to draw * * @static * @private * @method buildRectangle * @param graphics {Graphics} * @param webGLData {Object} */ PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData) { // --- // // need to convert points to a nice regular data // var rectData = graphicsData.points; var x = rectData[0]; var y = rectData[1]; var width = rectData[2]; var height = rectData[3]; if(graphicsData.fill) { var color = PIXI.hex2rgb(graphicsData.fillColor); var alpha = graphicsData.fillAlpha; var r = color[0] * alpha; var g = color[1] * alpha; var b = color[2] * alpha; var verts = webGLData.points; var indices = webGLData.indices; var vertPos = verts.length/6; // start verts.push(x, y); verts.push(r, g, b, alpha); verts.push(x + width, y); verts.push(r, g, b, alpha); verts.push(x , y + height); verts.push(r, g, b, alpha); verts.push(x + width, y + height); verts.push(r, g, b, alpha); // insert 2 dead triangles.. indices.push(vertPos, vertPos, vertPos+1, vertPos+2, vertPos+3, vertPos+3); } if(graphicsData.lineWidth) { var tempPoints = graphicsData.points; graphicsData.points = [x, y, x + width, y, x + width, y + height, x, y + height, x, y]; PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); graphicsData.points = tempPoints; } }; /** * Builds a circle to draw * * @static * @private * @method buildCircle * @param graphics {Graphics} * @param webGLData {Object} */ PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData) { // --- // // need to convert points to a nice regular data // var rectData = graphicsData.points; var x = rectData[0]; var y = rectData[1]; var width = rectData[2]; var height = rectData[3]; var totalSegs = 40; var seg = (Math.PI * 2) / totalSegs ; var i = 0; if(graphicsData.fill) { var color = PIXI.hex2rgb(graphicsData.fillColor); var alpha = graphicsData.fillAlpha; var r = color[0] * alpha; var g = color[1] * alpha; var b = color[2] * alpha; var verts = webGLData.points; var indices = webGLData.indices; var vecPos = verts.length/6; indices.push(vecPos); for (i = 0; i < totalSegs + 1 ; i++) { verts.push(x,y, r, g, b, alpha); verts.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height, r, g, b, alpha); indices.push(vecPos++, vecPos++); } indices.push(vecPos-1); } if(graphicsData.lineWidth) { var tempPoints = graphicsData.points; graphicsData.points = []; for (i = 0; i < totalSegs + 1; i++) { graphicsData.points.push(x + Math.sin(seg * i) * width, y + Math.cos(seg * i) * height); } PIXI.WebGLGraphics.buildLine(graphicsData, webGLData); graphicsData.points = tempPoints; } }; /** * Builds a line to draw * * @static * @private * @method buildLine * @param graphics {Graphics} * @param webGLData {Object} */ PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData) { // TODO OPTIMISE! var i = 0; var points = graphicsData.points; if(points.length === 0)return; // if the line width is an odd number add 0.5 to align to a whole pixel if(graphicsData.lineWidth%2) { for (i = 0; i < points.length; i++) { points[i] += 0.5; } } // get first and last point.. figure out the middle! var firstPoint = new PIXI.Point( points[0], points[1] ); var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); // if the first point is the last point - goona have issues :) if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y) { points.pop(); points.pop(); lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] ); var midPointX = lastPoint.x + (firstPoint.x - lastPoint.x) *0.5; var midPointY = lastPoint.y + (firstPoint.y - lastPoint.y) *0.5; points.unshift(midPointX, midPointY); points.push(midPointX, midPointY); } var verts = webGLData.points; var indices = webGLData.indices; var length = points.length / 2; var indexCount = points.length; var indexStart = verts.length/6; // DRAW the Line var width = graphicsData.lineWidth / 2; // sort color var color = PIXI.hex2rgb(graphicsData.lineColor); var alpha = graphicsData.lineAlpha; var r = color[0] * alpha; var g = color[1] * alpha; var b = color[2] * alpha; var px, py, p1x, p1y, p2x, p2y, p3x, p3y; var perpx, perpy, perp2x, perp2y, perp3x, perp3y; var a1, b1, c1, a2, b2, c2; var denom, pdist, dist; p1x = points[0]; p1y = points[1]; p2x = points[2]; p2y = points[3]; perpx = -(p1y - p2y); perpy = p1x - p2x; dist = Math.sqrt(perpx*perpx + perpy*perpy); perpx /= dist; perpy /= dist; perpx *= width; perpy *= width; // start verts.push(p1x - perpx , p1y - perpy, r, g, b, alpha); verts.push(p1x + perpx , p1y + perpy, r, g, b, alpha); for (i = 1; i < length-1; i++) { p1x = points[(i-1)*2]; p1y = points[(i-1)*2 + 1]; p2x = points[(i)*2]; p2y = points[(i)*2 + 1]; p3x = points[(i+1)*2]; p3y = points[(i+1)*2 + 1]; perpx = -(p1y - p2y); perpy = p1x - p2x; dist = Math.sqrt(perpx*perpx + perpy*perpy); perpx /= dist; perpy /= dist; perpx *= width; perpy *= width; perp2x = -(p2y - p3y); perp2y = p2x - p3x; dist = Math.sqrt(perp2x*perp2x + perp2y*perp2y); perp2x /= dist; perp2y /= dist; perp2x *= width; perp2y *= width; a1 = (-perpy + p1y) - (-perpy + p2y); b1 = (-perpx + p2x) - (-perpx + p1x); c1 = (-perpx + p1x) * (-perpy + p2y) - (-perpx + p2x) * (-perpy + p1y); a2 = (-perp2y + p3y) - (-perp2y + p2y); b2 = (-perp2x + p2x) - (-perp2x + p3x); c2 = (-perp2x + p3x) * (-perp2y + p2y) - (-perp2x + p2x) * (-perp2y + p3y); denom = a1*b2 - a2*b1; if(Math.abs(denom) < 0.1 ) { denom+=10.1; verts.push(p2x - perpx , p2y - perpy, r, g, b, alpha); verts.push(p2x + perpx , p2y + perpy, r, g, b, alpha); continue; } px = (b1*c2 - b2*c1)/denom; py = (a2*c1 - a1*c2)/denom; pdist = (px -p2x) * (px -p2x) + (py -p2y) + (py -p2y); if(pdist > 140 * 140) { perp3x = perpx - perp2x; perp3y = perpy - perp2y; dist = Math.sqrt(perp3x*perp3x + perp3y*perp3y); perp3x /= dist; perp3y /= dist; perp3x *= width; perp3y *= width; verts.push(p2x - perp3x, p2y -perp3y); verts.push(r, g, b, alpha); verts.push(p2x + perp3x, p2y +perp3y); verts.push(r, g, b, alpha); verts.push(p2x - perp3x, p2y -perp3y); verts.push(r, g, b, alpha); indexCount++; } else { verts.push(px , py); verts.push(r, g, b, alpha); verts.push(p2x - (px-p2x), p2y - (py - p2y)); verts.push(r, g, b, alpha); } } p1x = points[(length-2)*2]; p1y = points[(length-2)*2 + 1]; p2x = points[(length-1)*2]; p2y = points[(length-1)*2 + 1]; perpx = -(p1y - p2y); perpy = p1x - p2x; dist = Math.sqrt(perpx*perpx + perpy*perpy); perpx /= dist; perpy /= dist; perpx *= width; perpy *= width; verts.push(p2x - perpx , p2y - perpy); verts.push(r, g, b, alpha); verts.push(p2x + perpx , p2y + perpy); verts.push(r, g, b, alpha); indices.push(indexStart); for (i = 0; i < indexCount; i++) { indices.push(indexStart++); } indices.push(indexStart-1); }; /** * Builds a polygon to draw * * @static * @private * @method buildPoly * @param graphics {Graphics} * @param webGLData {Object} */ PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData) { var points = graphicsData.points; if(points.length < 6)return; // get first and last point.. figure out the middle! var verts = webGLData.points; var indices = webGLData.indices; var length = points.length / 2; // sort color var color = PIXI.hex2rgb(graphicsData.fillColor); var alpha = graphicsData.fillAlpha; var r = color[0] * alpha; var g = color[1] * alpha; var b = color[2] * alpha; var triangles = PIXI.PolyK.Triangulate(points); var vertPos = verts.length / 6; var i = 0; for (i = 0; i < triangles.length; i+=3) { indices.push(triangles[i] + vertPos); indices.push(triangles[i] + vertPos); indices.push(triangles[i+1] + vertPos); indices.push(triangles[i+2] +vertPos); indices.push(triangles[i+2] + vertPos); } for (i = 0; i < length; i++) { verts.push(points[i * 2], points[i * 2 + 1], r, g, b, alpha); } };
export interface GetConnectionOptions { /** * Set which replica to use. Available options are `read` and `write` */ type: 'read' | 'write'; /** * Force master or write replica to get connection from */ useMaster?: boolean; } export type Connection = object; export interface ConnectionManager { refreshTypeParser(dataTypes: object): void; /** * Drain the pool and close it permanently */ close(): Promise<void>; /** * Initialize connection pool. By default pool autostart is set to false, so no connection will be * be created unless `pool.acquire` is called. */ initPools(): void; /** * Get connection from pool. It sets database version if it's not already set. * Call pool.acquire to get a connection. */ getConnection(opts: GetConnectionOptions): Promise<Connection>; /** * Release a pooled connection so it can be utilized by other connection requests */ releaseConnection(conn: Connection): Promise<void>; }
const leveldown = require('../') , crypto = require('crypto') , fs = require('fs') , du = require('du') , uuid = require('node-uuid') , entryCount = 10000000 , concurrency = 10 , timesFile = './write_random_times.csv' , dbDir = './write_random.db' , data = crypto.randomBytes(256) // buffer var db = leveldown(dbDir) , timesStream = fs.createWriteStream(timesFile, 'utf8') function report (ms) { console.log('Wrote', entryCount, 'in', Math.floor(ms / 1000) + 's') timesStream.end() du(dbDir, function (err, size) { if (err) throw err console.log('Database size:', Math.floor(size / 1024 / 1024) + 'M') }) console.log('Wrote times to ', timesFile) } db.open(function (err) { if (err) throw err var inProgress = 0 , totalWrites = 0 , startTime = Date.now() , writeBuf = '' function write() { if (totalWrites % 100000 == 0) console.log(inProgress, totalWrites) if (totalWrites % 1000 == 0) { timesStream.write(writeBuf) writeBuf = '' } if (totalWrites++ == entryCount) return report(Date.now() - startTime) if (inProgress >= concurrency || totalWrites > entryCount) return var time = process.hrtime() inProgress++ db.put(uuid.v4(), data, function (err) { if (err) throw err writeBuf += (Date.now() - startTime) + ',' + process.hrtime(time)[1] + '\n' inProgress-- process.nextTick(write) }) process.nextTick(write) } write() })
// Package eviction is responsible for enforcing eviction thresholds to maintain // node stability. package eviction // import "k8s.io/kubernetes/pkg/kubelet/eviction"
var Spaces = require('../../options/format').Spaces; var Marker = require('../../tokenizer/marker'); var formatPosition = require('../../utils/format-position'); var CASE_ATTRIBUTE_PATTERN = /[\s"'][iI]\s*\]/; var CASE_RESTORE_PATTERN = /([\d\w])([iI])\]/g; var DOUBLE_QUOTE_CASE_PATTERN = /="([a-zA-Z][a-zA-Z\d\-_]+)"([iI])/g; var DOUBLE_QUOTE_PATTERN = /="([a-zA-Z][a-zA-Z\d\-_]+)"(\s|\])/g; var HTML_COMMENT_PATTERN = /^(?:(?:<!--|-->)\s*)+/; var SINGLE_QUOTE_CASE_PATTERN = /='([a-zA-Z][a-zA-Z\d\-_]+)'([iI])/g; var SINGLE_QUOTE_PATTERN = /='([a-zA-Z][a-zA-Z\d\-_]+)'(\s|\])/g; var RELATION_PATTERN = /[>\+~]/; var WHITESPACE_PATTERN = /\s/; var ASTERISK_PLUS_HTML_HACK = '*+html '; var ASTERISK_FIRST_CHILD_PLUS_HTML_HACK = '*:first-child+html '; var LESS_THAN = '<'; function hasInvalidCharacters(value) { var isEscaped; var isInvalid = false; var character; var isQuote = false; var i, l; for (i = 0, l = value.length; i < l; i++) { character = value[i]; if (isEscaped) { // continue as always } else if (character == Marker.SINGLE_QUOTE || character == Marker.DOUBLE_QUOTE) { isQuote = !isQuote; } else if (!isQuote && (character == Marker.CLOSE_CURLY_BRACKET || character == Marker.EXCLAMATION || character == LESS_THAN || character == Marker.SEMICOLON)) { isInvalid = true; break; } else if (!isQuote && i === 0 && RELATION_PATTERN.test(character)) { isInvalid = true; break; } isEscaped = character == Marker.BACK_SLASH; } return isInvalid; } function removeWhitespace(value, format) { var stripped = []; var character; var isNewLineNix; var isNewLineWin; var isEscaped; var wasEscaped; var isQuoted; var isSingleQuoted; var isDoubleQuoted; var isAttribute; var isRelation; var isWhitespace; var roundBracketLevel = 0; var wasRelation = false; var wasWhitespace = false; var withCaseAttribute = CASE_ATTRIBUTE_PATTERN.test(value); var spaceAroundRelation = format && format.spaces[Spaces.AroundSelectorRelation]; var i, l; for (i = 0, l = value.length; i < l; i++) { character = value[i]; isNewLineNix = character == Marker.NEW_LINE_NIX; isNewLineWin = character == Marker.NEW_LINE_NIX && value[i - 1] == Marker.NEW_LINE_WIN; isQuoted = isSingleQuoted || isDoubleQuoted; isRelation = !isEscaped && roundBracketLevel === 0 && RELATION_PATTERN.test(character); isWhitespace = WHITESPACE_PATTERN.test(character); if (wasEscaped && isQuoted && isNewLineWin) { // swallow escaped new windows lines in comments stripped.pop(); stripped.pop(); } else if (isEscaped && isQuoted && isNewLineNix) { // swallow escaped new *nix lines in comments stripped.pop(); } else if (isEscaped) { stripped.push(character); } else if (character == Marker.OPEN_SQUARE_BRACKET && !isQuoted) { stripped.push(character); isAttribute = true; } else if (character == Marker.CLOSE_SQUARE_BRACKET && !isQuoted) { stripped.push(character); isAttribute = false; } else if (character == Marker.OPEN_ROUND_BRACKET && !isQuoted) { stripped.push(character); roundBracketLevel++; } else if (character == Marker.CLOSE_ROUND_BRACKET && !isQuoted) { stripped.push(character); roundBracketLevel--; } else if (character == Marker.SINGLE_QUOTE && !isQuoted) { stripped.push(character); isSingleQuoted = true; } else if (character == Marker.DOUBLE_QUOTE && !isQuoted) { stripped.push(character); isDoubleQuoted = true; } else if (character == Marker.SINGLE_QUOTE && isQuoted) { stripped.push(character); isSingleQuoted = false; } else if (character == Marker.DOUBLE_QUOTE && isQuoted) { stripped.push(character); isDoubleQuoted = false; } else if (isWhitespace && wasRelation && !spaceAroundRelation) { continue; } else if (!isWhitespace && wasRelation && spaceAroundRelation) { stripped.push(Marker.SPACE); stripped.push(character); } else if (isWhitespace && (isAttribute || roundBracketLevel > 0) && !isQuoted) { // skip space } else if (isWhitespace && wasWhitespace && !isQuoted) { // skip extra space } else if ((isNewLineWin || isNewLineNix) && (isAttribute || roundBracketLevel > 0) && isQuoted) { // skip newline } else if (isRelation && wasWhitespace && !spaceAroundRelation) { stripped.pop(); stripped.push(character); } else if (isRelation && !wasWhitespace && spaceAroundRelation) { stripped.push(Marker.SPACE); stripped.push(character); } else if (isWhitespace) { stripped.push(Marker.SPACE); } else { stripped.push(character); } wasEscaped = isEscaped; isEscaped = character == Marker.BACK_SLASH; wasRelation = isRelation; wasWhitespace = isWhitespace; } return stripped .join('') .replace(withCaseAttribute ? CASE_RESTORE_PATTERN : null, '$1 $2]'); } function removeQuotes(value) { if (value.indexOf('\'') == -1 && value.indexOf('"') == -1) { return value; } return value .replace(SINGLE_QUOTE_CASE_PATTERN, '=$1 $2') .replace(SINGLE_QUOTE_PATTERN, '=$1$2') .replace(DOUBLE_QUOTE_CASE_PATTERN, '=$1 $2') .replace(DOUBLE_QUOTE_PATTERN, '=$1$2'); } function tidyRules(rules, removeUnsupported, adjacentSpace, format, warnings) { var list = []; var repeated = []; function removeHTMLComment(rule, match) { warnings.push('HTML comment \'' + match + '\' at ' + formatPosition(rule[2][0]) + '. Removing.'); return ''; } for (var i = 0, l = rules.length; i < l; i++) { var rule = rules[i]; var reduced = rule[1]; reduced = reduced.replace(HTML_COMMENT_PATTERN, removeHTMLComment.bind(null, rule)); if (hasInvalidCharacters(reduced)) { warnings.push('Invalid selector \'' + rule[1] + '\' at ' + formatPosition(rule[2][0]) + '. Ignoring.'); continue; } reduced = removeWhitespace(reduced, format); reduced = removeQuotes(reduced); if (adjacentSpace && reduced.indexOf('nav') > 0) { reduced = reduced.replace(/\+nav(\S|$)/, '+ nav$1'); } if (removeUnsupported && reduced.indexOf(ASTERISK_PLUS_HTML_HACK) > -1) { continue; } if (removeUnsupported && reduced.indexOf(ASTERISK_FIRST_CHILD_PLUS_HTML_HACK) > -1) { continue; } if (reduced.indexOf('*') > -1) { reduced = reduced .replace(/\*([:#\.\[])/g, '$1') .replace(/^(\:first\-child)?\+html/, '*$1+html'); } if (repeated.indexOf(reduced) > -1) { continue; } rule[1] = reduced; repeated.push(reduced); list.push(rule); } if (list.length == 1 && list[0][1].length === 0) { warnings.push('Empty selector \'' + list[0][1] + '\' at ' + formatPosition(list[0][2][0]) + '. Ignoring.'); list = []; } return list; } module.exports = tidyRules;
@class PGTSConnection; @class PGTSResultSet; @class PGTSConnector; @class PGTSQueryDescription; @class PGTSMetadataContainer; @class PGTSDatabaseDescription; @class PGTSNotification; @class PGTSQuery; @class BXSocketDescriptor; @protocol PGTSConnectionDelegate <NSObject> - (void) PGTSConnectionFailed: (PGTSConnection *) connection; - (void) PGTSConnectionEstablished: (PGTSConnection *) connection; - (void) PGTSConnectionLost: (PGTSConnection *) connection error: (NSError *) error; - (void) PGTSConnection: (PGTSConnection *) connection gotNotification: (PGTSNotification *) notification; - (void) PGTSConnection: (PGTSConnection *) connection receivedNotice: (NSError *) notice; - (FILE *) PGTSConnectionTraceFile: (PGTSConnection *) connection; - (void) PGTSConnection: (PGTSConnection *) connection networkStatusChanged: (SCNetworkConnectionFlags) newFlags; //Optional section of the protocol either as an interface or @optional. #if __MAC_OS_X_VERSION_10_5 <= __MAC_OS_X_VERSION_MAX_ALLOWED @optional #else @end @interface NSObject (PGTSConnectionDelegate) #endif - (void) PGTSConnection: (PGTSConnection *) connection sentQueryString: (const char *) queryString; - (void) PGTSConnection: (PGTSConnection *) connection sentQuery: (PGTSQuery *) query; - (void) PGTSConnection: (PGTSConnection *) connection receivedResultSet: (PGTSResultSet *) res; @end enum PGTSConnectionError { kPGTSConnectionErrorNone = 0, kPGTSConnectionErrorUnknown, kPGTSConnectionErrorSSLUnavailable, kPGTSConnectionErrorPasswordRequired, kPGTSConnectionErrorInvalidPassword, kPGTSConnectionErrorSSLError, kPGTSConnectionErrorSSLCertificateVerificationFailed }; @interface PGTSConnection : NSObject { PGconn* mConnection; NSMutableArray* mQueue; id mConnector; PGTSMetadataContainer* mMetadataContainer; NSMutableDictionary* mPGTypes; id <PGTSCertificateVerificationDelegate> mCertificateVerificationDelegate; //Weak BXSocketDescriptor *mSocketDescriptor; id <PGTSConnectionDelegate> mDelegate; //Weak BOOL mDidDisconnectOnSleep; volatile BOOL mLogsQueries; } - (id) init; - (void) dealloc; - (void) connectAsync: (NSDictionary *) connectionDictionary; - (BOOL) connectSync: (NSDictionary *) connectionDictionary; - (void) resetAsync; - (BOOL) resetSync; - (void) disconnect; - (id <PGTSConnectionDelegate>) delegate; - (void) setDelegate: (id <PGTSConnectionDelegate>) anObject; - (PGTSDatabaseDescription *) databaseDescription; - (void) reloadDatabaseDescription; - (id) deserializationDictionary; - (NSError *) connectionError; - (NSString *) errorString; - (ConnStatusType) connectionStatus; - (PGTransactionStatusType) transactionStatus; - (BOOL) usedPassword; - (PGconn *) pgConnection; - (int) backendPID; - (int) socket; - (SSL *) SSLStruct; - (BOOL) canSend; - (BXSocketDescriptor *) socketDescriptor; - (id <PGTSCertificateVerificationDelegate>) certificateVerificationDelegate; - (void) setCertificateVerificationDelegate: (id <PGTSCertificateVerificationDelegate>) anObject; - (BOOL) logsQueries; - (void) setLogsQueries: (BOOL) flag; - (void) logQueryIfNeeded: (PGTSQuery *) query; - (void) logResultIfNeeded: (PGTSResultSet *) res; @end @interface PGTSConnection (BXConnectionMonitorClient) <BXConnectionMonitorClient> @end @interface PGTSConnection (Queries) - (PGTSResultSet *) executeQuery: (NSString *) queryString; - (PGTSResultSet *) executeQuery: (NSString *) queryString parameters: (id) p1, ...; - (PGTSResultSet *) executeQuery: (NSString *) queryString parameterArray: (NSArray *) parameters; - (int) sendQuery: (NSString *) queryString delegate: (id) delegate callback: (SEL) callback; - (int) sendQuery: (NSString *) queryString delegate: (id) delegate callback: (SEL) callback parameters: (id) p1, ...; - (int) sendQuery: (NSString *) queryString delegate: (id) delegate callback: (SEL) callback parameterArray: (NSArray *) parameters; - (int) sendQuery: (NSString *) queryString delegate: (id) delegate callback: (SEL) callback parameterArray: (NSArray *) parameters userInfo: (id) userInfo; @end
<?php namespace Symfony\Bridge\Twig\Form; use Symfony\Component\Form\Exception\UnexpectedTypeException; use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderAdapter; use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface; use Symfony\Component\Form\FormRenderer; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; /** * @author Bernhard Schussek <bschussek@gmail.com> */ class TwigRenderer extends FormRenderer implements TwigRendererInterface { /** * @var TwigRendererEngineInterface */ private $engine; public function __construct(TwigRendererEngineInterface $engine, $csrfTokenManager = null) { if ($csrfTokenManager instanceof CsrfProviderInterface) { $csrfTokenManager = new CsrfProviderAdapter($csrfTokenManager); } elseif (null !== $csrfTokenManager && !$csrfTokenManager instanceof CsrfTokenManagerInterface) { throw new UnexpectedTypeException($csrfTokenManager, 'CsrfProviderInterface or CsrfTokenManagerInterface'); } parent::__construct($engine, $csrfTokenManager); $this->engine = $engine; } /** * {@inheritdoc} */ public function setEnvironment(\Twig_Environment $environment) { $this->engine->setEnvironment($environment); } }
namespace ForumSystem.Web.ViewModels.Account { using System.ComponentModel.DataAnnotations; public class LoginViewModel { [Required] [Display(Name = "Email")] [EmailAddress] public string Email { get; set; } [Required] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [Display(Name = "Remember me?")] public bool RememberMe { get; set; } } }
package org.apache.sysml.lops; import org.apache.sysml.lops.LopProperties.ExecLocation; import org.apache.sysml.lops.LopProperties.ExecType; import org.apache.sysml.lops.compile.JobType; import org.apache.sysml.parser.Expression.*; public class CumulativeSplitAggregate extends Lop { private double _initValue = 0; public CumulativeSplitAggregate(Lop input, DataType dt, ValueType vt, double init) { super(Lop.Type.CumulativeSplitAggregate, dt, vt); _initValue = init; init(input, dt, vt, ExecType.MR); } private void init(Lop input, DataType dt, ValueType vt, ExecType et) { this.addInput(input); input.addOutput(this); boolean breaksAlignment = true; boolean aligner = false; boolean definesMRJob = false; lps.addCompatibility(JobType.GMR); lps.addCompatibility(JobType.DATAGEN); lps.setProperties(inputs, et, ExecLocation.Map, breaksAlignment, aligner, definesMRJob); } @Override public String toString() { return "CumulativeSplitAggregate"; } private static String getOpcode() { return "ucumsplit"; } @Override public String getInstructions(int input_index, int output_index) { StringBuilder sb = new StringBuilder(); sb.append( getExecType() ); sb.append( OPERAND_DELIMITOR ); sb.append( getOpcode() ); sb.append( OPERAND_DELIMITOR ); sb.append( getInputs().get(0).prepInputOperand(input_index) ); sb.append( OPERAND_DELIMITOR ); sb.append( prepOutputOperand(output_index) ); sb.append( OPERAND_DELIMITOR ); sb.append( String.valueOf(_initValue) ); return sb.toString(); } }
<?php /** * Adminhtml sales transactions block * * @category Mage * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Sales_Transactions extends Mage_Adminhtml_Block_Widget_Grid_Container { public function __construct() { $this->_controller = 'sales_transactions'; $this->_headerText = Mage::helper('sales')->__('Transactions'); parent::__construct(); $this->_removeButton('add'); } }
(function() { /* ########## Begin module implementation ########## */ function initModule(forge) { // define net namespace var net = forge.net = forge.net || {}; // map of flash ID to socket pool net.socketPools = {}; /** * Creates a flash socket pool. * * @param options: * flashId: the dom ID for the flash object element. * policyPort: the default policy port for sockets, 0 to use the * flash default. * policyUrl: the default policy file URL for sockets (if provided * used instead of a policy port). * msie: true if the browser is msie, false if not. * * @return the created socket pool. */ net.createSocketPool = function(options) { // set default options.msie = options.msie || false; // initialize the flash interface var spId = options.flashId; var api = document.getElementById(spId); api.init({marshallExceptions: !options.msie}); // create socket pool entry var sp = { // ID of the socket pool id: spId, // flash interface flashApi: api, // map of socket ID to sockets sockets: {}, // default policy port policyPort: options.policyPort || 0, // default policy URL policyUrl: options.policyUrl || null }; net.socketPools[spId] = sp; // create event handler, subscribe to flash events if(options.msie === true) { sp.handler = function(e) { if(e.id in sp.sockets) { // get handler function var f; switch(e.type) { case 'connect': f = 'connected'; break; case 'close': f = 'closed'; break; case 'socketData': f = 'data'; break; default: f = 'error'; break; } /* IE calls javascript on the thread of the external object that triggered the event (in this case flash) ... which will either run concurrently with other javascript or pre-empt any running javascript in the middle of its execution (BAD!) ... calling setTimeout() will schedule the javascript to run on the javascript thread and solve this EVIL problem. */ setTimeout(function(){sp.sockets[e.id][f](e);}, 0); } }; } else { sp.handler = function(e) { if(e.id in sp.sockets) { // get handler function var f; switch(e.type) { case 'connect': f = 'connected'; break; case 'close': f = 'closed'; break; case 'socketData': f = 'data'; break; default: f = 'error'; break; } sp.sockets[e.id][f](e); } }; } var handler = 'forge.net.socketPools[\'' + spId + '\'].handler'; api.subscribe('connect', handler); api.subscribe('close', handler); api.subscribe('socketData', handler); api.subscribe('ioError', handler); api.subscribe('securityError', handler); /** * Destroys a socket pool. The socket pool still needs to be cleaned * up via net.cleanup(). */ sp.destroy = function() { delete net.socketPools[options.flashId]; for(var id in sp.sockets) { sp.sockets[id].destroy(); } sp.sockets = {}; api.cleanup(); }; /** * Creates a new socket. * * @param options: * connected: function(event) called when the socket connects. * closed: function(event) called when the socket closes. * data: function(event) called when socket data has arrived, * it can be read from the socket using receive(). * error: function(event) called when a socket error occurs. */ sp.createSocket = function(options) { // default to empty options options = options || {}; // create flash socket var id = api.create(); // create javascript socket wrapper var socket = { id: id, // set handlers connected: options.connected || function(e){}, closed: options.closed || function(e){}, data: options.data || function(e){}, error: options.error || function(e){} }; /** * Destroys this socket. */ socket.destroy = function() { api.destroy(id); delete sp.sockets[id]; }; /** * Connects this socket. * * @param options: * host: the host to connect to. * port: the port to connect to. * policyPort: the policy port to use (if non-default), 0 to * use the flash default. * policyUrl: the policy file URL to use (instead of port). */ socket.connect = function(options) { // give precedence to policy URL over policy port // if no policy URL and passed port isn't 0, use default port, // otherwise use 0 for the port var policyUrl = options.policyUrl || null; var policyPort = 0; if(policyUrl === null && options.policyPort !== 0) { policyPort = options.policyPort || sp.policyPort; } api.connect(id, options.host, options.port, policyPort, policyUrl); }; /** * Closes this socket. */ socket.close = function() { api.close(id); socket.closed({ id: socket.id, type: 'close', bytesAvailable: 0 }); }; /** * Determines if the socket is connected or not. * * @return true if connected, false if not. */ socket.isConnected = function() { return api.isConnected(id); }; /** * Writes bytes to this socket. * * @param bytes the bytes (as a string) to write. * * @return true on success, false on failure. */ socket.send = function(bytes) { return api.send(id, forge.util.encode64(bytes)); }; /** * Reads bytes from this socket (non-blocking). Fewer than the number * of bytes requested may be read if enough bytes are not available. * * This method should be called from the data handler if there are * enough bytes available. To see how many bytes are available, check * the 'bytesAvailable' property on the event in the data handler or * call the bytesAvailable() function on the socket. If the browser is * msie, then the bytesAvailable() function should be used to avoid * race conditions. Otherwise, using the property on the data handler's * event may be quicker. * * @param count the maximum number of bytes to read. * * @return the bytes read (as a string) or null on error. */ socket.receive = function(count) { var rval = api.receive(id, count).rval; return (rval === null) ? null : forge.util.decode64(rval); }; /** * Gets the number of bytes available for receiving on the socket. * * @return the number of bytes available for receiving. */ socket.bytesAvailable = function() { return api.getBytesAvailable(id); }; // store and return socket sp.sockets[id] = socket; return socket; }; return sp; }; /** * Destroys a flash socket pool. * * @param options: * flashId: the dom ID for the flash object element. */ net.destroySocketPool = function(options) { if(options.flashId in net.socketPools) { var sp = net.socketPools[options.flashId]; sp.destroy(); } }; /** * Creates a new socket. * * @param options: * flashId: the dom ID for the flash object element. * connected: function(event) called when the socket connects. * closed: function(event) called when the socket closes. * data: function(event) called when socket data has arrived, it * can be read from the socket using receive(). * error: function(event) called when a socket error occurs. * * @return the created socket. */ net.createSocket = function(options) { var socket = null; if(options.flashId in net.socketPools) { // get related socket pool var sp = net.socketPools[options.flashId]; socket = sp.createSocket(options); } return socket; }; } // end module implementation /* ########## Begin module wrapper ########## */ var name = 'net'; if(typeof define !== 'function') { // NodeJS -> AMD if(typeof module === 'object' && module.exports) { var nodeJS = true; define = function(ids, factory) { factory(require, module); }; } else { // <script> if(typeof forge === 'undefined') { forge = {}; } return initModule(forge); } } // AMD var deps; var defineFunc = function(require, module) { module.exports = function(forge) { var mods = deps.map(function(dep) { return require(dep); }).concat(initModule); // handle circular dependencies forge = forge || {}; forge.defined = forge.defined || {}; if(forge.defined[name]) { return forge[name]; } forge.defined[name] = true; for(var i = 0; i < mods.length; ++i) { mods[i](forge); } return forge[name]; }; }; var tmpDefine = define; define = function(ids, factory) { deps = (typeof ids === 'string') ? factory.slice(2) : ids.slice(2); if(nodeJS) { delete define; return tmpDefine.apply(null, Array.prototype.slice.call(arguments, 0)); } define = tmpDefine; return define.apply(null, Array.prototype.slice.call(arguments, 0)); }; define(['require', 'module'], function() { defineFunc.apply(null, Array.prototype.slice.call(arguments, 0)); }); })();
/* Cluster Styles */ #cluster { position: absolute; top: 0px; bottom: 0px; left: 20px; right: 20px; overflow: auto; } #cluster-filter-controls { z-index: 1; } #cluster-header-text { font-size: 18px; font-weight: bold; color: #728E9B; font-family: Roboto Slab; margin-bottom: 30px; } #cluster-tabs-content { top: 80px; } #cluster-refresh-container { position: absolute; bottom: 0px; left: 20px; right: 20px; } #cluster-loading-container { float: left; width: 16px; height: 16px; background-color: transparent; margin-top: 4px; margin-left: 3px; } #cluster-last-refreshed { font-weight: bold; } #cluster-header { padding-top: 10px; } /* cluster table */ .cluster-tabbed-table { position: absolute; top: 70px; left: 0px; bottom: 47px; right: 0px; min-height: 150px; } #cluster-tabs-content .slick-cell.cell-right { text-align: right; padding-right: 16px; padding-left: 2px; } #cluster-tabs-content .slick-header-column.header-right { text-align: right; } span.sorted { text-decoration: underline; } /* user details dialog */ #node-events { max-height: 200px; }
description: Scale your service, spawn new containers keywords: spawn, container, service, deploy redirect_from: - /docker-cloud/feature-reference/service-scaling/ title: Scale your service --- Docker Cloud makes it easy to spawn new containers of your service to handle additional load. Two modes are available to allow you to scale services with different configuration requirements. ## Deployment and scaling modes Any service that handles additional load by increasing the number of containers of the service is considered "horizontally scalable". There are two deployment modes when scaling a service: - **Parallel mode** (default): all containers of a service are deployed at the same time without any links between them. This is the fastest way to deploy, and is the default. - **Sequential mode**: each new container is deployed in the service one at a time. Each container is linked to all previous containers using service links. This makes complex configuration possible within the containers startup logic. This mode is explained in detail in the following sections. ## When should I use Parallel scaling? When the containers in a service work independently of each other and do not need to coordinate between themselves, they can be scaled up in parallel mode. Examples include: - Stateless web servers and proxies - “Worker” instances that process jobs from a queue - “Cron”-style instances that execute periodic tasks The default scaling mode is parallel, so no additional configuration is required to use this mode. ## When should I use Sequential scaling? Some services require coordination between different containers to ensure that the service functions correctly. Many databases, such as MySQL for example, require that the containers know about each other at startup time so that traffic can be routed to them appropriately. When this is the case, you should use [sequential scaling](service-scaling.md#sequential-deployment-and-scaling). To allow peer-aware container startup, you can enable sequential scaling mode. See [Sequential Scaling](service-scaling.md#sequential-deployment-and-scaling) for more information. ## Setting the initial number of containers When you configure a service in Docker Cloud, you can specify an initial number of containers for the service before you launch. ![](images/service-wizard-scale.png) Docker Cloud immediately launches as many containers as you specified. ### Setting the initial containers using the API You can specify the initial number of containers for a service when deploying it through the API: ``` POST /api/app/v1/service/ HTTP/1.1 { "target_num_containers": 2, [...] } ``` If you don’t specify the number of containers to deploy, this command defaults to `1`. See the [API documentation](/apidocs/docker-cloud.md) for more information. ### Setting the initial containers using the CLI You can also specify the initial number of containers for a service when deploying it using the CLI: ```bash $ docker-cloud service run -t 2 [...] ``` If you don’t specify the number of containers to deploy, the CLI uses the default value of `1`. See the [CLI documentation](/apidocs/docker-cloud.md) for more information. ## Scaling an already running service If you need to scale a service up or down while it is running, you can change the number of containers from the service detail page: ![](images/service-before-scaling.png) 1. Click the slider at the top of the service detail page. 2. Drag the slider to the number of containers you want. 3. Click **Scale**. The application starts scaling immediately, whether this means starting new containers, or gracefully shutting down existing ones. ![](images/service-during-scaling.png) ### Scaling a running service using the API You can scale an already running service through the API: ``` PATCH /api/app/v1/service/(uuid)/ HTTP/1.1 { "target_num_containers": 2 } ``` See the [scale a service API documentation](/apidocs/docker-cloud.md#scale-a-service) ### Scaling a running service using the CLI You can also scale an already running service using the CLI: ```bash $ docker-cloud service scale (uuid or name) 2 ``` See the [scale a service CLI documentation](/apidocs/docker-cloud.md#scale-a-service) ## Sequential deployment and scaling When a service with more than one container is deployed using **sequential deployment** mode, the second and subsequent containers are linked to all the previous ones using [service links](service-links.md). These links are useful if your service needs to know about other instances, for example to allow automatic configuration on startup. See the [Service links](service-links.md) topic for a list of environment variables that the links create in your containers. You can set the **Sequential deployment** setting on the **Service configuration** step of the **Launch new service** wizard: ![](images/service-wizard-sequential-deployment.png) ### Set the scaling mode using the API You can also set the `sequential_deployment` option when deploying an application through the API: ``` POST /api/app/v1/service/ HTTP/1.1 { "sequential_deployment": true, [...] } ``` See [create a new service](/apidocs/docker-cloud.md#create-a-new-service) for more information. ### Set the scaling mode using the CLI You can also set the `sequential_deployment` option when deploying an application through the CLI:  ```bash $ docker-cloud service run --sequential [...]  ```
cask 'eclipse-rcp' do version '4.6.2,neon:2' sha256 'fd850fd5a5f22723c25ce6d8855856afe48b407ddfe457e8f084a8b50d7e3b1f' url "https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/#{version.after_comma.before_colon}/#{version.after_colon}/eclipse-rcp-#{version.after_comma.before_colon}-#{version.after_colon}-macosx-cocoa-x86_64.tar.gz&r=1" name 'Eclipse for RCP and RAP Developers' homepage 'https://eclipse.org/' depends_on macos: '>= :leopard' app 'Eclipse.app' end
package org.cboard.pojo; /** * Created by yfyuan on 2016/8/18. */ public class DashboardBoard { private Long id; private int userId; private Long categoryId; private String name; private String layout; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLayout() { return layout; } public void setLayout(String layout) { this.layout = layout; } public Long getCategoryId() { return categoryId; } public void setCategoryId(Long categoryId) { this.categoryId = categoryId; } }
#ifndef UBIDIIMP_H #define UBIDIIMP_H /* set import/export definitions */ #ifdef U_COMMON_IMPLEMENTATION #include "unicode/utypes.h" #include "unicode/uchar.h" #include "ubidi_props.h" /* miscellaneous definitions ---------------------------------------------- */ typedef uint8_t DirProp; typedef uint32_t Flags; /* Comparing the description of the BiDi algorithm with this implementation is easier with the same names for the BiDi types in the code as there. See UCharDirection in uchar.h . */ enum { L= U_LEFT_TO_RIGHT, /* 0 */ R= U_RIGHT_TO_LEFT, /* 1 */ EN= U_EUROPEAN_NUMBER, /* 2 */ ES= U_EUROPEAN_NUMBER_SEPARATOR, /* 3 */ ET= U_EUROPEAN_NUMBER_TERMINATOR, /* 4 */ AN= U_ARABIC_NUMBER, /* 5 */ CS= U_COMMON_NUMBER_SEPARATOR, /* 6 */ B= U_BLOCK_SEPARATOR, /* 7 */ S= U_SEGMENT_SEPARATOR, /* 8 */ WS= U_WHITE_SPACE_NEUTRAL, /* 9 */ ON= U_OTHER_NEUTRAL, /* 10 */ LRE=U_LEFT_TO_RIGHT_EMBEDDING, /* 11 */ LRO=U_LEFT_TO_RIGHT_OVERRIDE, /* 12 */ AL= U_RIGHT_TO_LEFT_ARABIC, /* 13 */ RLE=U_RIGHT_TO_LEFT_EMBEDDING, /* 14 */ RLO=U_RIGHT_TO_LEFT_OVERRIDE, /* 15 */ PDF=U_POP_DIRECTIONAL_FORMAT, /* 16 */ NSM=U_DIR_NON_SPACING_MARK, /* 17 */ BN= U_BOUNDARY_NEUTRAL, /* 18 */ FSI=U_FIRST_STRONG_ISOLATE, /* 19 */ LRI=U_LEFT_TO_RIGHT_ISOLATE, /* 20 */ RLI=U_RIGHT_TO_LEFT_ISOLATE, /* 21 */ PDI=U_POP_DIRECTIONAL_ISOLATE, /* 22 */ ENL, /* EN after W7 */ /* 23 */ ENR, /* EN not subject to W7 */ /* 24 */ dirPropCount }; /* Sometimes, bit values are more appropriate to deal with directionality properties. Abbreviations in these macro names refer to names used in the BiDi algorithm. */ #define DIRPROP_FLAG(dir) (1UL<<(dir)) #define PURE_DIRPROP(prop) ((prop)&~0xE0) ????????????????????????? /* special flag for multiple runs from explicit embedding codes */ #define DIRPROP_FLAG_MULTI_RUNS (1UL<<31) /* are there any characters that are LTR or RTL? */ #define MASK_LTR (DIRPROP_FLAG(L)|DIRPROP_FLAG(EN)|DIRPROP_FLAG(ENL)|DIRPROP_FLAG(ENR)|DIRPROP_FLAG(AN)|DIRPROP_FLAG(LRE)|DIRPROP_FLAG(LRO)|DIRPROP_FLAG(LRI)) #define MASK_RTL (DIRPROP_FLAG(R)|DIRPROP_FLAG(AL)|DIRPROP_FLAG(RLE)|DIRPROP_FLAG(RLO)|DIRPROP_FLAG(RLI)) #define MASK_R_AL (DIRPROP_FLAG(R)|DIRPROP_FLAG(AL)) #define MASK_STRONG_EN_AN (DIRPROP_FLAG(L)|DIRPROP_FLAG(R)|DIRPROP_FLAG(AL)|DIRPROP_FLAG(EN)|DIRPROP_FLAG(AN)) /* explicit embedding codes */ #define MASK_EXPLICIT (DIRPROP_FLAG(LRE)|DIRPROP_FLAG(LRO)|DIRPROP_FLAG(RLE)|DIRPROP_FLAG(RLO)|DIRPROP_FLAG(PDF)) /* explicit isolate codes */ #define MASK_ISO (DIRPROP_FLAG(LRI)|DIRPROP_FLAG(RLI)|DIRPROP_FLAG(FSI)|DIRPROP_FLAG(PDI)) #define MASK_BN_EXPLICIT (DIRPROP_FLAG(BN)|MASK_EXPLICIT) /* paragraph and segment separators */ #define MASK_B_S (DIRPROP_FLAG(B)|DIRPROP_FLAG(S)) /* all types that are counted as White Space or Neutral in some steps */ #define MASK_WS (MASK_B_S|DIRPROP_FLAG(WS)|MASK_BN_EXPLICIT|MASK_ISO) /* types that are neutrals or could becomes neutrals in (Wn) */ #define MASK_POSSIBLE_N (DIRPROP_FLAG(ON)|DIRPROP_FLAG(CS)|DIRPROP_FLAG(ES)|DIRPROP_FLAG(ET)|MASK_WS) /* * These types may be changed to "e", * the embedding type (L or R) of the run, * in the BiDi algorithm (N2) */ #define MASK_EMBEDDING (DIRPROP_FLAG(NSM)|MASK_POSSIBLE_N) /* the dirProp's L and R are defined to 0 and 1 values in UCharDirection */ #define GET_LR_FROM_LEVEL(level) ((DirProp)((level)&1)) #define IS_DEFAULT_LEVEL(level) ((level)>=0xfe) /* * The following bit is used for the directional isolate status. * Stack entries corresponding to isolate sequences are greater than ISOLATE. */ #define ISOLATE 0x0100 U_CFUNC UBiDiLevel ubidi_getParaLevelAtIndex(const UBiDi *pBiDi, int32_t index); #define GET_PARALEVEL(ubidi, index) \ ((UBiDiLevel)(!(ubidi)->defaultParaLevel || (index)<(ubidi)->paras[0].limit ? \ (ubidi)->paraLevel : ubidi_getParaLevelAtIndex((ubidi), (index)))) /* number of paras entries allocated initially without malloc */ #define SIMPLE_PARAS_COUNT 10 /* number of isolate entries allocated initially without malloc */ #define SIMPLE_ISOLATES_COUNT 5 /* number of isolate run entries for paired brackets allocated initially without malloc */ #define SIMPLE_OPENINGS_COUNT 20 #define CR 0x000D #define LF 0x000A /* Run structure for reordering --------------------------------------------- */ enum { LRM_BEFORE=1, LRM_AFTER=2, RLM_BEFORE=4, RLM_AFTER=8 }; typedef struct Para { int32_t limit; int32_t level; } Para; enum { /* flags for Opening.flags */ FOUND_L=DIRPROP_FLAG(L), FOUND_R=DIRPROP_FLAG(R) }; typedef struct Opening { int32_t position; /* position of opening bracket */ int32_t match; /* matching char or -position of closing bracket */ int32_t contextPos; /* position of last strong char found before opening */ uint16_t flags; /* bits for L or R/AL found within the pair */ UBiDiDirection contextDir; /* L or R according to last strong char before opening */ uint8_t filler; /* to complete a nice multiple of 4 chars */ } Opening; typedef struct IsoRun { int32_t contextPos; /* position of char determining context */ uint16_t start; /* index of first opening entry for this run */ uint16_t limit; /* index after last opening entry for this run */ UBiDiLevel level; /* level of this run */ DirProp lastStrong; /* bidi class of last strong char found in this run */ DirProp lastBase; /* bidi class of last base char found in this run */ UBiDiDirection contextDir; /* L or R to use as context for following openings */ } IsoRun; typedef struct BracketData { UBiDi *pBiDi; /* array of opening entries which should be enough in most cases; no malloc() */ Opening simpleOpenings[SIMPLE_OPENINGS_COUNT]; Opening *openings; /* pointer to current array of entries */ int32_t openingsCount; /* number of allocated entries */ int32_t isoRunLast; /* index of last used entry */ /* array of nested isolated sequence entries; can never excess UBIDI_MAX_EXPLICIT_LEVEL + 1 for index 0, + 1 for before the first isolated sequence */ IsoRun isoRuns[UBIDI_MAX_EXPLICIT_LEVEL+2]; UBool isNumbersSpecial; /* reordering mode for NUMBERS_SPECIAL */ } BracketData; typedef struct Isolate { int32_t startON; int32_t start1; int32_t state; int16_t stateImp; } Isolate; typedef struct Run { int32_t logicalStart, /* first character of the run; b31 indicates even/odd level */ visualLimit, /* last visual position of the run +1 */ insertRemove; /* if >0, flags for inserting LRM/RLM before/after run, if <0, count of bidi controls within run */ } Run; /* in a Run, logicalStart will get this bit set if the run level is odd */ #define INDEX_ODD_BIT (1UL<<31) #define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31)) #define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((int32_t)(level)<<31)) #define REMOVE_ODD_BIT(x) ((x)&=~INDEX_ODD_BIT) #define GET_INDEX(x) ((x)&~INDEX_ODD_BIT) #define GET_ODD_BIT(x) ((uint32_t)(x)>>31) #define IS_ODD_RUN(x) ((UBool)(((x)&INDEX_ODD_BIT)!=0)) #define IS_EVEN_RUN(x) ((UBool)(((x)&INDEX_ODD_BIT)==0)) U_CFUNC UBool ubidi_getRuns(UBiDi *pBiDi, UErrorCode *pErrorCode); /** BiDi control code points */ enum { ZWNJ_CHAR=0x200c, ZWJ_CHAR, LRM_CHAR, RLM_CHAR, LRE_CHAR=0x202a, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR, LRI_CHAR=0x2066, RLI_CHAR, FSI_CHAR, PDI_CHAR }; #define IS_BIDI_CONTROL_CHAR(c) (((uint32_t)(c)&0xfffffffc)==ZWNJ_CHAR || (uint32_t)((c)-LRE_CHAR)<5 || (uint32_t)((c)-LRI_CHAR)<4) /* InsertPoints structure for noting where to put BiDi marks ---------------- */ typedef struct Point { int32_t pos; /* position in text */ int32_t flag; /* flag for LRM/RLM, before/after */ } Point; typedef struct InsertPoints { int32_t capacity; /* number of points allocated */ int32_t size; /* number of points used */ int32_t confirmed; /* number of points confirmed */ UErrorCode errorCode; /* for eventual memory shortage */ Point *points; /* pointer to array of points */ } InsertPoints; /* UBiDi structure ----------------------------------------------------------- */ struct UBiDi { /* pointer to parent paragraph object (pointer to self if this object is * a paragraph object); set to NULL in a newly opened object; set to a * real value after a successful execution of ubidi_setPara or ubidi_setLine */ const UBiDi * pParaBiDi; const UBiDiProps *bdp; /* alias pointer to the current text */ const UChar *text; /* length of the current text */ int32_t originalLength; /* if the UBIDI_OPTION_STREAMING option is set, this is the length * of text actually processed by ubidi_setPara, which may be shorter than * the original length. * Otherwise, it is identical to the original length. */ int32_t length; /* if the UBIDI_OPTION_REMOVE_CONTROLS option is set, and/or * marks are allowed to be inserted in one of the reordering mode, the * length of the result string may be different from the processed length. */ int32_t resultLength; /* memory sizes in bytes */ int32_t dirPropsSize, levelsSize, openingsSize, parasSize, runsSize, isolatesSize; /* allocated memory */ DirProp *dirPropsMemory; UBiDiLevel *levelsMemory; Opening *openingsMemory; Para *parasMemory; Run *runsMemory; Isolate *isolatesMemory; /* indicators for whether memory may be allocated after ubidi_open() */ UBool mayAllocateText, mayAllocateRuns; /* arrays with one value per text-character */ DirProp *dirProps; UBiDiLevel *levels; /* are we performing an approximation of the "inverse BiDi" algorithm? */ UBool isInverse; /* are we using the basic algorithm or its variation? */ UBiDiReorderingMode reorderingMode; /* UBIDI_REORDER_xxx values must be ordered so that all the regular * logical to visual modes come first, and all inverse BiDi modes * come last. */ #define UBIDI_REORDER_LAST_LOGICAL_TO_VISUAL UBIDI_REORDER_NUMBERS_SPECIAL /* bitmask for reordering options */ uint32_t reorderingOptions; /* must block separators receive level 0? */ UBool orderParagraphsLTR; /* the paragraph level */ UBiDiLevel paraLevel; /* original paraLevel when contextual */ /* must be one of UBIDI_DEFAULT_xxx or 0 if not contextual */ UBiDiLevel defaultParaLevel; /* context data */ const UChar *prologue; int32_t proLength; const UChar *epilogue; int32_t epiLength; /* the following is set in ubidi_setPara, used in processPropertySeq */ const struct ImpTabPair * pImpTabPair; /* pointer to levels state table pair */ /* the overall paragraph or line directionality - see UBiDiDirection */ UBiDiDirection direction; /* flags is a bit set for which directional properties are in the text */ Flags flags; /* lastArabicPos is index to the last AL in the text, -1 if none */ int32_t lastArabicPos; /* characters after trailingWSStart are WS and are */ /* implicitly at the paraLevel (rule (L1)) - levels may not reflect that */ int32_t trailingWSStart; /* fields for paragraph handling */ int32_t paraCount; /* set in getDirProps() */ /* filled in getDirProps() */ Para *paras; /* for relatively short text, we only need a tiny array of paras (no malloc()) */ Para simpleParas[SIMPLE_PARAS_COUNT]; /* fields for line reordering */ int32_t runCount; /* ==-1: runs not set up yet */ Run *runs; /* for non-mixed text, we only need a tiny array of runs (no malloc()) */ Run simpleRuns[1]; /* maximum or current nesting depth of isolate sequences */ /* Within resolveExplicitLevels() and checkExplicitLevels(), this is the maximal nesting encountered. Within resolveImplicitLevels(), this is the index of the current isolates stack entry. */ int32_t isolateCount; Isolate *isolates; /* for simple text, have a small stack (no malloc()) */ Isolate simpleIsolates[SIMPLE_ISOLATES_COUNT]; /* for inverse Bidi with insertion of directional marks */ InsertPoints insertPoints; /* for option UBIDI_OPTION_REMOVE_CONTROLS */ int32_t controlCount; /* for Bidi class callback */ UBiDiClassCallback *fnClassCallback; /* action pointer */ const void *coClassCallback; /* context pointer */ }; #define IS_VALID_PARA(x) ((x) && ((x)->pParaBiDi==(x))) #define IS_VALID_PARA_OR_LINE(x) ((x) && ((x)->pParaBiDi==(x) || (((x)->pParaBiDi) && (x)->pParaBiDi->pParaBiDi==(x)->pParaBiDi))) typedef union { DirProp *dirPropsMemory; UBiDiLevel *levelsMemory; Opening *openingsMemory; Para *parasMemory; Run *runsMemory; Isolate *isolatesMemory; } BidiMemoryForAllocation; /* Macros for initial checks at function entry */ #define RETURN_IF_NULL_OR_FAILING_ERRCODE(pErrcode, retvalue) \ if((pErrcode)==NULL || U_FAILURE(*pErrcode)) return retvalue #define RETURN_IF_NOT_VALID_PARA(bidi, errcode, retvalue) \ if(!IS_VALID_PARA(bidi)) { \ errcode=U_INVALID_STATE_ERROR; \ return retvalue; \ } #define RETURN_IF_NOT_VALID_PARA_OR_LINE(bidi, errcode, retvalue) \ if(!IS_VALID_PARA_OR_LINE(bidi)) { \ errcode=U_INVALID_STATE_ERROR; \ return retvalue; \ } #define RETURN_IF_BAD_RANGE(arg, start, limit, errcode, retvalue) \ if((arg)<(start) || (arg)>=(limit)) { \ (errcode)=U_ILLEGAL_ARGUMENT_ERROR; \ return retvalue; \ } #define RETURN_VOID_IF_NULL_OR_FAILING_ERRCODE(pErrcode) \ if((pErrcode)==NULL || U_FAILURE(*pErrcode)) return #define RETURN_VOID_IF_NOT_VALID_PARA(bidi, errcode) \ if(!IS_VALID_PARA(bidi)) { \ errcode=U_INVALID_STATE_ERROR; \ return; \ } #define RETURN_VOID_IF_NOT_VALID_PARA_OR_LINE(bidi, errcode) \ if(!IS_VALID_PARA_OR_LINE(bidi)) { \ errcode=U_INVALID_STATE_ERROR; \ return; \ } #define RETURN_VOID_IF_BAD_RANGE(arg, start, limit, errcode) \ if((arg)<(start) || (arg)>=(limit)) { \ (errcode)=U_ILLEGAL_ARGUMENT_ERROR; \ return; \ } /* helper function to (re)allocate memory if allowed */ U_CFUNC UBool ubidi_getMemory(BidiMemoryForAllocation *pMemory, int32_t *pSize, UBool mayAllocate, int32_t sizeNeeded); /* helper macros for each allocated array in UBiDi */ #define getDirPropsMemory(pBiDi, length) \ ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \ (pBiDi)->mayAllocateText, (length)) #define getLevelsMemory(pBiDi, length) \ ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->levelsMemory, &(pBiDi)->levelsSize, \ (pBiDi)->mayAllocateText, (length)) #define getRunsMemory(pBiDi, length) \ ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->runsMemory, &(pBiDi)->runsSize, \ (pBiDi)->mayAllocateRuns, (length)*sizeof(Run)) /* additional macros used by ubidi_open() - always allow allocation */ #define getInitialDirPropsMemory(pBiDi, length) \ ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \ TRUE, (length)) #define getInitialLevelsMemory(pBiDi, length) \ ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->levelsMemory, &(pBiDi)->levelsSize, \ TRUE, (length)) #define getInitialOpeningsMemory(pBiDi, length) \ ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->openingsMemory, &(pBiDi)->openingsSize, \ TRUE, (length)*sizeof(Opening)) #define getInitialParasMemory(pBiDi, length) \ ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->parasMemory, &(pBiDi)->parasSize, \ TRUE, (length)*sizeof(Para)) #define getInitialRunsMemory(pBiDi, length) \ ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->runsMemory, &(pBiDi)->runsSize, \ TRUE, (length)*sizeof(Run)) #define getInitialIsolatesMemory(pBiDi, length) \ ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->isolatesMemory, &(pBiDi)->isolatesSize, \ TRUE, (length)*sizeof(Isolate)) #endif #endif
import numpy as np from sklearn.metrics import confusion_matrix, accuracy_score from . import utils from .SdA import SdAClassifier N_MNIST = 70000 N_MNIST_TRAIN = 60000 N_MNIST_TEST = N_MNIST - N_MNIST_TRAIN N_TRAIN = N_MNIST_TRAIN N_TEST = N_MNIST_TEST # prepare MNIST data X, y = utils.prepare_data() # split data into train and test one perm = np.random.permutation(N_MNIST_TRAIN) X_train, y_train = X[perm[: N_TRAIN]], y[perm[: N_TRAIN]] perm = np.random.permutation(N_MNIST_TEST) X_test, y_test = X[perm[: N_TEST] + N_MNIST_TRAIN], y[perm[: N_TEST] + N_MNIST_TRAIN] # train sda = SdAClassifier(784, [500, 500], 10, [0.3, 0.3], [0.5, 0.5], do_pretrain=True, verbose=True) sda.fit(X_train, y_train) # test pred = sda.predict(X_test) cm = confusion_matrix(y_test, pred) print(cm) print('accuracy: {}'.format(accuracy_score(y_test, pred)))
void realview_clk_init(void __iomem *sysbase, bool is_pb1176);
<header>Éditer un Commande</header> Cette page vous permet d'éditer une commande qui a déjà été définie. <include cmd>
#region Apache License // // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to you under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #endregion using System; using System.Text.RegularExpressions; using log4net; using log4net.Core; using log4net.Util; namespace log4net.Filter { /// <summary> /// Simple filter to match a string in the <see cref="NDC"/> /// </summary> /// <remarks> /// <para> /// Simple filter to match a string in the <see cref="NDC"/> /// </para> /// <para> /// As the MDC has been replaced with named stacks stored in the /// properties collections the <see cref="PropertyFilter"/> should /// be used instead. /// </para> /// </remarks> /// <author>Nicko Cadell</author> /// <author>Gert Driesen</author> /*[Obsolete("NdcFilter has been replaced by PropertyFilter")]*/ public class NdcFilter : PropertyFilter { /// <summary> /// Default constructor /// </summary> /// <remarks> /// <para> /// Sets the <see cref="PropertyFilter.Key"/> to <c>"NDC"</c>. /// </para> /// </remarks> public NdcFilter() { base.Key = "NDC"; } } }
package org.gradle.jvm.toolchain.internal; import org.gradle.internal.service.scopes.Scopes; import org.gradle.internal.service.scopes.ServiceScope; import org.gradle.language.base.internal.compile.CompileSpec; import org.gradle.language.base.internal.compile.Compiler; /** * Creates Java compilers based on the provided compile options. */ @ServiceScope(Scopes.Project.class) public interface JavaCompilerFactory { <T extends CompileSpec> Compiler<T> create(Class<T> type); }
package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "storage.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} // Resource takes an unqualified resource and returns a Group qualified GroupResource func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &StorageClass{}, &StorageClassList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Blob; using Orchard.FileSystems.Media; namespace Orchard.Azure.Services.FileSystems { public class AzureFileSystem { public const string FolderEntry = "$$$ORCHARD$$$.$$$"; private readonly bool _isPrivate; private readonly IMimeTypeProvider _mimeTypeProvider; protected string _root; protected string _absoluteRoot; protected string _publicHostName; private CloudStorageAccount _storageAccount; private CloudBlobClient _blobClient; private CloudBlobContainer _container; public string StorageConnectionString { get; protected set; } public string ContainerName { get; protected set; } public CloudStorageAccount StorageAccount { get { EnsureInitialized(); return _storageAccount; } } public CloudBlobClient BlobClient { get { EnsureInitialized(); return _blobClient; } } public CloudBlobContainer Container { get { EnsureInitialized(); return _container; } } public AzureFileSystem(string storageConnectionString, string containerName, string root, bool isPrivate, IMimeTypeProvider mimeTypeProvider, string publicHostName = null) { _isPrivate = isPrivate; _mimeTypeProvider = mimeTypeProvider; StorageConnectionString = storageConnectionString; ContainerName = containerName; _root = String.IsNullOrEmpty(root) ? "" : root + "/"; _publicHostName = publicHostName; } protected void EnsureInitialized() { if (_storageAccount != null) { return; } _storageAccount = CloudStorageAccount.Parse(StorageConnectionString); _absoluteRoot = Combine(Combine(_storageAccount.BlobEndpoint.AbsoluteUri, ContainerName), _root); _blobClient = _storageAccount.CreateCloudBlobClient(); // Get and create the container if it does not exist // The container is named with DNS naming restrictions (i.e. all lower case) _container = _blobClient.GetContainerReference(ContainerName); ////Set the default service version to the current version "2015-12-11" so that newer features and optimizations are enabled on the images and videos stored in the blob storage. var properties = _blobClient.GetServiceProperties(); if (properties.DefaultServiceVersion == null) { properties.DefaultServiceVersion = "2015-12-11"; _blobClient.SetServiceProperties(properties); } _container.CreateIfNotExists(_isPrivate ? BlobContainerPublicAccessType.Off : BlobContainerPublicAccessType.Blob); } private static string ConvertToRelativeUriPath(string path) { var newPath = path.Replace(@"\", "/"); if (newPath.StartsWith("/", StringComparison.OrdinalIgnoreCase) || newPath.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || newPath.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException("Path must be relative"); } return newPath; } public string Combine(string path1, string path2) { if (path1 == null) { throw new ArgumentNullException("path1"); } if (path2 == null) { throw new ArgumentNullException("path2"); } if (String.IsNullOrEmpty(path2)) { return path1; } if (String.IsNullOrEmpty(path1)) { return path2; } if (path2.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || path2.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) { return path2; } return (path1.TrimEnd('/') + '/' + path2.TrimStart('/')); } public IStorageFile GetFile(string path) { path = ConvertToRelativeUriPath(path); Container.EnsureBlobExists(String.Concat(_root, path)); return new AzureBlobFileStorage(Container.GetBlockBlobReference(String.Concat(_root, path)), _absoluteRoot); } public bool FileExists(string path) { return Container.BlobExists(String.Concat(_root, path)); } public bool FolderExists(string path) { return Container.DirectoryExists(String.Concat(_root, path)); } public IEnumerable<IStorageFile> ListFiles(string path) { path = path ?? String.Empty; path = ConvertToRelativeUriPath(path); string prefix = Combine(Combine(Container.Name, _root), path); if (!prefix.EndsWith("/")) { prefix += "/"; } return BlobClient.ListBlobs(prefix) .OfType<CloudBlockBlob>() .Where(blobItem => !blobItem.Uri.AbsoluteUri.EndsWith(FolderEntry)) .Select(blobItem => new AzureBlobFileStorage(blobItem, _absoluteRoot)) .ToArray(); } public IEnumerable<IStorageFolder> ListFolders(string path) { path = path ?? String.Empty; path = ConvertToRelativeUriPath(path); // return root folders if (String.Concat(_root, path) == String.Empty) { return Container.ListBlobs() .OfType<CloudBlobDirectory>() .Select<CloudBlobDirectory, IStorageFolder>(d => new AzureBlobFolderStorage(d, _absoluteRoot)) .ToList(); } if (!Container.DirectoryExists(String.Concat(_root, path))) { try { CreateFolder(path); } catch (Exception ex) { throw new ArgumentException(string.Format("The folder could not be created at path: {0}. {1}", path, ex)); } } return Container.GetDirectoryReference(String.Concat(_root, path)) .ListBlobs() .OfType<CloudBlobDirectory>() .Select<CloudBlobDirectory, IStorageFolder>(d => new AzureBlobFolderStorage(d, _absoluteRoot)) .ToList(); } public bool TryCreateFolder(string path) { try { if (!Container.DirectoryExists(String.Concat(_root, path))) { CreateFolder(path); return true; } // return false to be consistent with FileSystemProvider's implementation return false; } catch { return false; } } public void CreateFolder(string path) { path = ConvertToRelativeUriPath(path); Container.EnsureDirectoryDoesNotExist(String.Concat(_root, path)); // Creating a virtually hidden file to make the directory an existing concept CreateFile(Combine(path, FolderEntry)); int lastIndex; while ((lastIndex = path.LastIndexOf('/')) > 0) { path = path.Substring(0, lastIndex); if (!Container.DirectoryExists(String.Concat(_root, path))) { CreateFile(Combine(path, FolderEntry)); } } } public void DeleteFolder(string path) { path = ConvertToRelativeUriPath(path); Container.EnsureDirectoryExists(String.Concat(_root, path)); foreach (var blob in Container.GetDirectoryReference(String.Concat(_root, path)).ListBlobs()) { if (blob is CloudBlockBlob) ((CloudBlockBlob)blob).Delete(); if (blob is CloudBlobDirectory) DeleteFolder(blob.Uri.ToString().Substring(Container.Uri.ToString().Length + 1 + _root.Length)); } } public void RenameFolder(string path, string newPath) { path = ConvertToRelativeUriPath(path); newPath = ConvertToRelativeUriPath(newPath); // Workaround for https://github.com/Azure/azure-storage-net/issues/892 // Renaming a folder by only changing the casing corrupts all the files in the folder. if (path.Equals(newPath, StringComparison.OrdinalIgnoreCase)) { var tempPath = Guid.NewGuid().ToString() + "/"; RenameFolder(path, tempPath); path = tempPath; } if (!path.EndsWith("/")) path += "/"; if (!newPath.EndsWith("/")) newPath += "/"; foreach (var blob in Container.GetDirectoryReference(_root + path).ListBlobs()) { if (blob is CloudBlockBlob) { string filename = Path.GetFileName(blob.Uri.ToString()); string source = String.Concat(path, filename); string destination = String.Concat(newPath, filename); RenameFile(source, destination); } if (blob is CloudBlobDirectory) { var blobDir = (CloudBlobDirectory)blob; string foldername = blobDir.Prefix.Substring(blobDir.Parent.Prefix.Length); string source = String.Concat(path, foldername); string destination = String.Concat(newPath, foldername); RenameFolder(source, destination); } } } public void DeleteFile(string path) { path = ConvertToRelativeUriPath(path); Container.EnsureBlobExists(Combine(_root, path)); var blob = Container.GetBlockBlobReference(Combine(_root, path)); blob.DeleteIfExists(); } public void RenameFile(string path, string newPath) { path = ConvertToRelativeUriPath(path); newPath = ConvertToRelativeUriPath(newPath); Container.EnsureBlobExists(String.Concat(_root, path)); Container.EnsureBlobDoesNotExist(String.Concat(_root, newPath)); var blob = Container.GetBlockBlobReference(String.Concat(_root, path)); var newBlob = Container.GetBlockBlobReference(String.Concat(_root, newPath)); newBlob.StartCopy(blob); blob.Delete(); } public void CopyFile(string path, string newPath) { path = ConvertToRelativeUriPath(path); newPath = ConvertToRelativeUriPath(newPath); Container.EnsureBlobExists(String.Concat(_root, path)); Container.EnsureBlobDoesNotExist(String.Concat(_root, newPath)); var blob = Container.GetBlockBlobReference(String.Concat(_root, path)); var newBlob = Container.GetBlockBlobReference(String.Concat(_root, newPath)); newBlob.StartCopy(blob); } public IStorageFile CreateFile(string path) { path = ConvertToRelativeUriPath(path); if (Container.BlobExists(String.Concat(_root, path))) { throw new ArgumentException("File " + path + " already exists"); } // create all folder entries in the hierarchy int lastIndex; var localPath = path; while ((lastIndex = localPath.LastIndexOf('/')) > 0) { localPath = localPath.Substring(0, lastIndex); var folder = Container.GetBlockBlobReference(String.Concat(_root, Combine(localPath, FolderEntry))); folder.OpenWrite().Dispose(); } var blob = Container.GetBlockBlobReference(String.Concat(_root, path)); var contentType = _mimeTypeProvider.GetMimeType(path); if (!String.IsNullOrWhiteSpace(contentType)) { blob.Properties.ContentType = contentType; } blob.UploadFromStream(new MemoryStream(new byte[0])); return new AzureBlobFileStorage(blob, _absoluteRoot); } public string GetPublicUrl(string path) { path = ConvertToRelativeUriPath(path); var uriBuilder = new UriBuilder(Container.GetBlockBlobReference(String.Concat(_root, path)).Uri); if (!string.IsNullOrEmpty(_publicHostName)) uriBuilder.Host = _publicHostName; return uriBuilder.Uri.ToString(); } private class AzureBlobFileStorage : IStorageFile { private CloudBlockBlob _blob; private readonly string _rootPath; public AzureBlobFileStorage(CloudBlockBlob blob, string rootPath) { _blob = blob; _rootPath = rootPath; } public string GetPath() { return _blob.Uri.ToString().Substring(_rootPath.Length).Trim('/'); } public string GetName() { return Path.GetFileName(GetPath()); } public long GetSize() { return _blob.Properties.Length; } public DateTime GetLastUpdated() { _blob.FetchAttributes(); return _blob.Properties.LastModified.GetValueOrDefault().DateTime; } public string GetFileType() { return Path.GetExtension(GetPath()); } public Stream OpenRead() { return _blob.OpenRead(); } public Stream OpenWrite() { return _blob.OpenWrite(); } public Stream CreateFile() { // as opposed to the File System implementation, if nothing is done on the stream // the file will be emptied, because Azure doesn't implement FileMode.Truncate _blob.DeleteIfExists(); _blob = _blob.Container.GetBlockBlobReference(_blob.Name); _blob.UploadFromStream(new MemoryStream(new byte[0])); return OpenWrite(); } } private class AzureBlobFolderStorage : IStorageFolder { private readonly CloudBlobDirectory _blob; private readonly string _rootPath; public AzureBlobFolderStorage(CloudBlobDirectory blob, string rootPath) { _blob = blob; _rootPath = rootPath; } public string GetName() { var path = GetPath(); return path.Substring(path.LastIndexOf('/') + 1); } public string GetPath() { return _blob.Uri.ToString().Substring(_rootPath.Length).Trim('/'); } public long GetSize() { return GetDirectorySize(_blob); } public DateTime GetLastUpdated() { return DateTime.MinValue; } public IStorageFolder GetParent() { if (_blob.Parent != null) { return new AzureBlobFolderStorage(_blob.Parent, _rootPath); } throw new ArgumentException("Directory " + _blob.Uri + " does not have a parent directory"); } private static long GetDirectorySize(CloudBlobDirectory directoryBlob) { long size = 0; foreach (var blobItem in directoryBlob.ListBlobs()) { if (blobItem is CloudBlockBlob) size += ((CloudBlockBlob)blobItem).Properties.Length; if (blobItem is CloudBlobDirectory) size += GetDirectorySize((CloudBlobDirectory)blobItem); } return size; } } } }
/** * Created with JetBrains PhpStorm. * User: xuheng * Date: 12-9-26 * Time: 下午12:29 * To change this template use File | Settings | File Templates. */ //清空上次查选的痕迹 editor.firstForSR = 0; editor.currentRangeForSR = null; //给tab注册切换事件 /** * tab点击处理事件 * @param tabHeads * @param tabBodys * @param obj */ function clickHandler( tabHeads,tabBodys,obj ) { //head样式更改 for ( var k = 0, len = tabHeads.length; k < len; k++ ) { tabHeads[k].className = ""; } obj.className = "focus"; //body显隐 var tabSrc = obj.getAttribute( "tabSrc" ); for ( var j = 0, length = tabBodys.length; j < length; j++ ) { var body = tabBodys[j], id = body.getAttribute( "id" ); if ( id != tabSrc ) { body.style.zIndex = 1; } else { body.style.zIndex = 200; } } } /** * TAB切换 * @param tabParentId tab的父节点ID或者对象本身 */ function switchTab( tabParentId ) { var tabElements = $G( tabParentId ).children, tabHeads = tabElements[0].children, tabBodys = tabElements[1].children; for ( var i = 0, length = tabHeads.length; i < length; i++ ) { var head = tabHeads[i]; if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); head.onclick = function () { clickHandler(tabHeads,tabBodys,this); } } } $G('searchtab').onmousedown = function(){ $G('search-msg').innerHTML = ''; $G('replace-msg').innerHTML = '' } //是否区分大小写 function getMatchCase(id) { return $G(id).checked ? true : false; } //查找 $G("nextFindBtn").onclick = function (txt, dir, mcase) { var findtxt = $G("findtxt").value, obj; if (!findtxt) { return false; } obj = { searchStr:findtxt, dir:1, casesensitive:getMatchCase("matchCase") }; if (!frCommond(obj)) { var bk = editor.selection.getRange().createBookmark(); $G('search-msg').innerHTML = lang.getEnd; editor.selection.getRange().moveToBookmark(bk).select(); } }; $G("nextReplaceBtn").onclick = function (txt, dir, mcase) { var findtxt = $G("findtxt1").value, obj; if (!findtxt) { return false; } obj = { searchStr:findtxt, dir:1, casesensitive:getMatchCase("matchCase1") }; frCommond(obj); }; $G("preFindBtn").onclick = function (txt, dir, mcase) { var findtxt = $G("findtxt").value, obj; if (!findtxt) { return false; } obj = { searchStr:findtxt, dir:-1, casesensitive:getMatchCase("matchCase") }; if (!frCommond(obj)) { $G('search-msg').innerHTML = lang.getStart; } }; $G("preReplaceBtn").onclick = function (txt, dir, mcase) { var findtxt = $G("findtxt1").value, obj; if (!findtxt) { return false; } obj = { searchStr:findtxt, dir:-1, casesensitive:getMatchCase("matchCase1") }; frCommond(obj); }; //替换 $G("repalceBtn").onclick = function () { var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); if (!findtxt) { return false; } if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { return false; } obj = { searchStr:findtxt, dir:1, casesensitive:getMatchCase("matchCase1"), replaceStr:replacetxt }; frCommond(obj); }; //全部替换 $G("repalceAllBtn").onclick = function () { var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj, replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, ""); if (!findtxt) { return false; } if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) { return false; } obj = { searchStr:findtxt, casesensitive:getMatchCase("matchCase1"), replaceStr:replacetxt, all:true }; var num = frCommond(obj); if (num) { $G('replace-msg').innerHTML = lang.countMsg.replace("{#count}", num); } }; //执行 var frCommond = function (obj) { return editor.execCommand("searchreplace", obj); }; switchTab("searchtab");
This is a changelog of changes made to the saml package for RocketChat. The package is originally based on https://github.com/steffow/meteor-accounts-saml . ## 9-Nov-2016 danb@catalyst-au.net * Only do `logoutWithSaml` if we are doing single logout (ie `idpSLORedirectURL` is set). We get an error if we do `logoutWithSaml` and `idpSLORedirectURL` is not set. This was discovered when testing with simplesamlphp. In this latter case, `logoutWithSaml` will try to use the standard saml endpoint to request the logout resulting in an error. * **TODO:** doing the standard `Meteor.logout` doesn't seem to be enough when logging out. If the user logs back into RocketChat from the same window, they will be automatically logged back in to RocketChat, no credentials required. If you enable single logout (ie set `idpSLORedirectURL`), then `logoutWithSaml` will be called and the client should be properly logged out. * Switch to using `Cookies` for the client when recording the saml provider and whether single logout is enabled. If the client has multiple rocketchat tabs or windows, this will ensure they all log out properly with the idp - but only when single logout (`idpSLORedirectURL`) is enabled. ## 31-Oct-2016 danb@catalyst-au.net * Attempt at SP-initiated logout (**requires more work**). * Added configuration setting for SLO (single logout) redirect url to the IDP. * A `Session` key is set called `saml_provider`; it is unset at logout. Is there a better way? * `Meteor.logout` on the client is overridden so that `Meteor.logoutWithSaml` is called if `saml_provider` is set. This isn't great - is there a better way? * Tested using simplesamlphp as the idp * login in using saml * then logout using the normal RocketChat logout * after some time, you should see the RocketChat login screen * if you try to login again, you will have to login to the idp again repeating the previous login flow * **TODO:** If a user has 2 independent browser login sessions using saml, both will log out, but only the one the user logged out from appears to be properly logged out of the idp. * this might be because we shouldn't be logging out the second session but RocketChat / meteor is doing this. ## 17-Oct-2016 * Fixed signing for redirect to idp. * At login time, if the idp is configured to verify the redirect to its login screen, it will expect `RelayState` as part of the signature. Tested with **simplesamlphp** with `'redirect.validate' => TRUE` in the `sp-remote` metadata file * Added `privateKey` - `SAML_Custom_Private_Key` * Added `privateCert` - `SAML_Custom_Public_Cert` * These input fields should point to locations on the the server eg `/path/to/private/certs/`. * `privateKey` is used by RocketChat to sign saml requests.
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.source.payload_fields import SourcesField from pants.source.wrapped_globs import EagerFilesetWithSpec, Globs, LazyFilesetWithSpec from pants_test.base_test import BaseTest class PayloadTest(BaseTest): def sources(self, rel_path, *args): return Globs.create_fileset_with_spec(rel_path, *args) def test_sources_field(self): self.create_file('foo/bar/a.txt', 'a_contents') self.create_file('foo/bar/b.txt', 'b_contents') self.assertNotEqual( SourcesField( sources=self.sources('foo/bar', 'a.txt'), ).fingerprint(), SourcesField( sources=self.sources('foo/bar', 'b.txt'), ).fingerprint(), ) self.assertEqual( SourcesField( sources=self.sources('foo/bar', 'a.txt'), ).fingerprint(), SourcesField( sources=self.sources('foo/bar', 'a.txt'), ).fingerprint(), ) self.assertEqual( SourcesField( sources=self.sources('foo/bar', 'a.txt', 'b.txt'), ).fingerprint(), SourcesField( sources=self.sources('foo/bar', 'a.txt', 'b.txt'), ).fingerprint(), ) fp1 = SourcesField( sources=self.sources('foo/bar', 'a.txt'), ).fingerprint() self.create_file('foo/bar/a.txt', 'a_contents_different') fp2 = SourcesField( sources=self.sources('foo/bar', 'a.txt'), ).fingerprint() self.assertNotEqual(fp1, fp2) def test_fails_on_invalid_sources_kwarg(self): with self.assertRaises(ValueError): SourcesField(sources='not-a-list') def test_passes_lazy_fileset_with_spec_through(self): self.create_file('foo/a.txt', 'a_contents') fileset = LazyFilesetWithSpec('foo', {'globs':['foo/a.txt']}, lambda: ['foo/a.txt']) sf = SourcesField(sources=fileset) self.assertIs(fileset, sf.sources) self.assertEqual(['foo/a.txt'], list(sf.source_paths)) def test_passes_eager_fileset_with_spec_through(self): self.create_file('foo/a.txt', 'a_contents') fileset = EagerFilesetWithSpec(rel_root='foo', # Glob spec is relative to build root filespec={'globs': ['foo/foo/a.txt']}, # files are relative to `rel_root` files=['foo/a.txt'], files_hash={'foo/a.txt': b'12345'}) sf = SourcesField(sources=fileset) self.assertIs(fileset, sf.sources) self.assertEqual(['foo/a.txt'], list(sf.source_paths)) self.assertEqual(['foo/foo/a.txt'], list(sf.relative_to_buildroot()))
using System; using System.ComponentModel; namespace Azure.ResourceManager.DataFactory.Models { /// <summary> The type of the parameter. </summary> public readonly partial struct ScriptActivityParameterType : IEquatable<ScriptActivityParameterType> { private readonly string _value; /// <summary> Initializes a new instance of <see cref="ScriptActivityParameterType"/>. </summary> /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> public ScriptActivityParameterType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } private const string BooleanValue = "Boolean"; private const string DateTimeValue = "DateTime"; private const string DateTimeOffsetValue = "DateTimeOffset"; private const string DecimalValue = "Decimal"; private const string DoubleValue = "Double"; private const string GuidValue = "Guid"; private const string Int16Value = "Int16"; private const string Int32Value = "Int32"; private const string Int64Value = "Int64"; private const string SingleValue = "Single"; private const string StringValue = "String"; private const string TimeSpanValue = "Timespan"; /// <summary> Boolean. </summary> public static ScriptActivityParameterType Boolean { get; } = new ScriptActivityParameterType(BooleanValue); /// <summary> DateTime. </summary> public static ScriptActivityParameterType DateTime { get; } = new ScriptActivityParameterType(DateTimeValue); /// <summary> DateTimeOffset. </summary> public static ScriptActivityParameterType DateTimeOffset { get; } = new ScriptActivityParameterType(DateTimeOffsetValue); /// <summary> Decimal. </summary> public static ScriptActivityParameterType Decimal { get; } = new ScriptActivityParameterType(DecimalValue); /// <summary> Double. </summary> public static ScriptActivityParameterType Double { get; } = new ScriptActivityParameterType(DoubleValue); /// <summary> Guid. </summary> public static ScriptActivityParameterType Guid { get; } = new ScriptActivityParameterType(GuidValue); /// <summary> Int16. </summary> public static ScriptActivityParameterType Int16 { get; } = new ScriptActivityParameterType(Int16Value); /// <summary> Int32. </summary> public static ScriptActivityParameterType Int32 { get; } = new ScriptActivityParameterType(Int32Value); /// <summary> Int64. </summary> public static ScriptActivityParameterType Int64 { get; } = new ScriptActivityParameterType(Int64Value); /// <summary> Single. </summary> public static ScriptActivityParameterType Single { get; } = new ScriptActivityParameterType(SingleValue); /// <summary> String. </summary> public static ScriptActivityParameterType String { get; } = new ScriptActivityParameterType(StringValue); /// <summary> Timespan. </summary> public static ScriptActivityParameterType TimeSpan { get; } = new ScriptActivityParameterType(TimeSpanValue); /// <summary> Determines if two <see cref="ScriptActivityParameterType"/> values are the same. </summary> public static bool operator ==(ScriptActivityParameterType left, ScriptActivityParameterType right) => left.Equals(right); /// <summary> Determines if two <see cref="ScriptActivityParameterType"/> values are not the same. </summary> public static bool operator !=(ScriptActivityParameterType left, ScriptActivityParameterType right) => !left.Equals(right); /// <summary> Converts a string to a <see cref="ScriptActivityParameterType"/>. </summary> public static implicit operator ScriptActivityParameterType(string value) => new ScriptActivityParameterType(value); /// <inheritdoc /> [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ScriptActivityParameterType other && Equals(other); /// <inheritdoc /> public bool Equals(ScriptActivityParameterType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// <inheritdoc /> [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value?.GetHashCode() ?? 0; /// <inheritdoc /> public override string ToString() => _value; } }
YUI.add('io-queue', function (Y, NAME) { /** Extends IO to implement Queue for synchronous transaction processing. @module io @submodule io-queue @for IO **/ var io = Y.io._map['io:0'] || new Y.IO(); Y.mix(Y.IO.prototype, { /** * Array of transactions queued for processing * * @property _q * @private * @static * @type {Object} */ _q: new Y.Queue(), _qActiveId: null, _qInit: false, /** * Property to determine whether the queue is set to * 1 (active) or 0 (inactive). When inactive, transactions * will be stored in the queue until the queue is set to active. * * @property _qState * @private * @static * @type {Number} */ _qState: 1, /** * Method Process the first transaction from the * queue in FIFO order. * * @method _qShift * @private * @static */ _qShift: function() { var io = this, o = io._q.next(); io._qActiveId = o.id; io._qState = 0; io.send(o.uri, o.cfg, o.id); }, /** * Method for queueing a transaction before the request is sent to the * resource, to ensure sequential processing. * * @method queue * @static * @return {Object} */ queue: function(uri, c) { var io = this, o = { uri: uri, cfg:c, id: this._id++ }; if(!io._qInit) { Y.on('io:complete', function(id, o) { io._qNext(id); }, io); io._qInit = true; } io._q.add(o); if (io._qState === 1) { io._qShift(); } return o; }, _qNext: function(id) { var io = this; io._qState = 1; if (io._qActiveId === id && io._q.size() > 0) { io._qShift(); } }, /** * Method for promoting a transaction to the top of the queue. * * @method promote * @static */ qPromote: function(o) { this._q.promote(o); }, /** * Method for removing a specific, pending transaction from * the queue. * * @method remove * @private * @static */ qRemove: function(o) { this._q.remove(o); }, /** * Method for cancel all pending transaction from * the queue. * * @method empty * @static * @since 3.7.3 */ qEmpty: function() { this._q = new Y.Queue(); }, qStart: function() { var io = this; io._qState = 1; if (io._q.size() > 0) { io._qShift(); } }, /** * Method for setting queue processing to inactive. * Transaction requests to YUI.io.queue() will be stored in the queue, but * not processed until the queue is reset to "active". * * @method _stop * @private * @static */ qStop: function() { this._qState = 0; }, /** * Method to query the current size of the queue. * * @method _size * @private * @static * @return {Number} */ qSize: function() { return this._q.size(); } }, true); function _queue(u, c) { return io.queue.apply(io, [u, c]); } _queue.start = function () { io.qStart(); }; _queue.stop = function () { io.qStop(); }; _queue.promote = function (o) { io.qPromote(o); }; _queue.remove = function (o) { io.qRemove(o); }; _queue.size = function () { io.qSize(); }; _queue.empty = function () { io.qEmpty(); }; Y.io.queue = _queue; }, '@VERSION@', {"requires": ["io-base", "queue-promote"]});
/* apps/dh.c */ /* obsoleted by dhparam.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <openssl/opensslconf.h> /* for OPENSSL_NO_DH */ #ifndef OPENSSL_NO_DH #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #include "apps.h" #include <openssl/bio.h> #include <openssl/err.h> #include <openssl/bn.h> #include <openssl/dh.h> #include <openssl/x509.h> #include <openssl/pem.h> #undef PROG #define PROG dh_main /* -inform arg - input format - default PEM (DER or PEM) * -outform arg - output format - default PEM * -in arg - input file - default stdin * -out arg - output file - default stdout * -check - check the parameters are ok * -noout * -text * -C */ int MAIN(int, char **); int MAIN(int argc, char **argv) { DH *dh=NULL; int i,badops=0,text=0; BIO *in=NULL,*out=NULL; int informat,outformat,check=0,noout=0,C=0,ret=1; char *infile,*outfile,*prog; #ifndef OPENSSL_NO_ENGINE char *engine; #endif apps_startup(); if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); if (!load_config(bio_err, NULL)) goto end; #ifndef OPENSSL_NO_ENGINE engine=NULL; #endif infile=NULL; outfile=NULL; informat=FORMAT_PEM; outformat=FORMAT_PEM; prog=argv[0]; argc--; argv++; while (argc >= 1) { if (strcmp(*argv,"-inform") == 0) { if (--argc < 1) goto bad; informat=str2fmt(*(++argv)); } else if (strcmp(*argv,"-outform") == 0) { if (--argc < 1) goto bad; outformat=str2fmt(*(++argv)); } else if (strcmp(*argv,"-in") == 0) { if (--argc < 1) goto bad; infile= *(++argv); } else if (strcmp(*argv,"-out") == 0) { if (--argc < 1) goto bad; outfile= *(++argv); } #ifndef OPENSSL_NO_ENGINE else if (strcmp(*argv,"-engine") == 0) { if (--argc < 1) goto bad; engine= *(++argv); } #endif else if (strcmp(*argv,"-check") == 0) check=1; else if (strcmp(*argv,"-text") == 0) text=1; else if (strcmp(*argv,"-C") == 0) C=1; else if (strcmp(*argv,"-noout") == 0) noout=1; else { BIO_printf(bio_err,"unknown option %s\n",*argv); badops=1; break; } argc--; argv++; } if (badops) { bad: BIO_printf(bio_err,"%s [options] <infile >outfile\n",prog); BIO_printf(bio_err,"where options are\n"); BIO_printf(bio_err," -inform arg input format - one of DER PEM\n"); BIO_printf(bio_err," -outform arg output format - one of DER PEM\n"); BIO_printf(bio_err," -in arg input file\n"); BIO_printf(bio_err," -out arg output file\n"); BIO_printf(bio_err," -check check the DH parameters\n"); BIO_printf(bio_err," -text print a text form of the DH parameters\n"); BIO_printf(bio_err," -C Output C code\n"); BIO_printf(bio_err," -noout no output\n"); #ifndef OPENSSL_NO_ENGINE BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); #endif goto end; } ERR_load_crypto_strings(); #ifndef OPENSSL_NO_ENGINE setup_engine(bio_err, engine, 0); #endif in=BIO_new(BIO_s_file()); out=BIO_new(BIO_s_file()); if ((in == NULL) || (out == NULL)) { ERR_print_errors(bio_err); goto end; } if (infile == NULL) BIO_set_fp(in,stdin,BIO_NOCLOSE); else { if (BIO_read_filename(in,infile) <= 0) { perror(infile); goto end; } } if (outfile == NULL) { BIO_set_fp(out,stdout,BIO_NOCLOSE); #ifdef OPENSSL_SYS_VMS { BIO *tmpbio = BIO_new(BIO_f_linebuffer()); out = BIO_push(tmpbio, out); } #endif } else { if (BIO_write_filename(out,outfile) <= 0) { perror(outfile); goto end; } } if (informat == FORMAT_ASN1) dh=d2i_DHparams_bio(in,NULL); else if (informat == FORMAT_PEM) dh=PEM_read_bio_DHparams(in,NULL,NULL,NULL); else { BIO_printf(bio_err,"bad input format specified\n"); goto end; } if (dh == NULL) { BIO_printf(bio_err,"unable to load DH parameters\n"); ERR_print_errors(bio_err); goto end; } if (text) { DHparams_print(out,dh); #ifdef undef printf("p="); BN_print(stdout,dh->p); printf("\ng="); BN_print(stdout,dh->g); printf("\n"); if (dh->length != 0) printf("recommended private length=%ld\n",dh->length); #endif } if (check) { if (!DH_check(dh,&i)) { ERR_print_errors(bio_err); goto end; } if (i & DH_CHECK_P_NOT_PRIME) printf("p value is not prime\n"); if (i & DH_CHECK_P_NOT_SAFE_PRIME) printf("p value is not a safe prime\n"); if (i & DH_UNABLE_TO_CHECK_GENERATOR) printf("unable to check the generator value\n"); if (i & DH_NOT_SUITABLE_GENERATOR) printf("the g value is not a generator\n"); if (i == 0) printf("DH parameters appear to be ok.\n"); } if (C) { unsigned char *data; int len,l,bits; len=BN_num_bytes(dh->p); bits=BN_num_bits(dh->p); data=(unsigned char *)OPENSSL_malloc(len); if (data == NULL) { perror("OPENSSL_malloc"); goto end; } l=BN_bn2bin(dh->p,data); printf("static unsigned char dh%d_p[]={",bits); for (i=0; i<l; i++) { if ((i%12) == 0) printf("\n\t"); printf("0x%02X,",data[i]); } printf("\n\t};\n"); l=BN_bn2bin(dh->g,data); printf("static unsigned char dh%d_g[]={",bits); for (i=0; i<l; i++) { if ((i%12) == 0) printf("\n\t"); printf("0x%02X,",data[i]); } printf("\n\t};\n\n"); printf("DH *get_dh%d()\n\t{\n",bits); printf("\tDH *dh;\n\n"); printf("\tif ((dh=DH_new()) == NULL) return(NULL);\n"); printf("\tdh->p=BN_bin2bn(dh%d_p,sizeof(dh%d_p),NULL);\n", bits,bits); printf("\tdh->g=BN_bin2bn(dh%d_g,sizeof(dh%d_g),NULL);\n", bits,bits); printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n"); printf("\t\treturn(NULL);\n"); printf("\treturn(dh);\n\t}\n"); OPENSSL_free(data); } if (!noout) { if (outformat == FORMAT_ASN1) i=i2d_DHparams_bio(out,dh); else if (outformat == FORMAT_PEM) i=PEM_write_bio_DHparams(out,dh); else { BIO_printf(bio_err,"bad output format specified for outfile\n"); goto end; } if (!i) { BIO_printf(bio_err,"unable to write DH parameters\n"); ERR_print_errors(bio_err); goto end; } } ret=0; end: if (in != NULL) BIO_free(in); if (out != NULL) BIO_free_all(out); if (dh != NULL) DH_free(dh); apps_shutdown(); OPENSSL_EXIT(ret); } #else /* !OPENSSL_NO_DH */ # if PEDANTIC static void *dummy=&dummy; # endif #endif
#ifndef INCLUDE_git_git_h__ #define INCLUDE_git_git_h__ #include BLIK_LIBGIT2_U_git2__annotated_commit_h //original-code:"git2/annotated_commit.h" #include BLIK_LIBGIT2_U_git2__attr_h //original-code:"git2/attr.h" #include BLIK_LIBGIT2_U_git2__blob_h //original-code:"git2/blob.h" #include BLIK_LIBGIT2_U_git2__blame_h //original-code:"git2/blame.h" #include BLIK_LIBGIT2_U_git2__branch_h //original-code:"git2/branch.h" #include BLIK_LIBGIT2_U_git2__buffer_h //original-code:"git2/buffer.h" #include BLIK_LIBGIT2_U_git2__checkout_h //original-code:"git2/checkout.h" #include BLIK_LIBGIT2_U_git2__cherrypick_h //original-code:"git2/cherrypick.h" #include BLIK_LIBGIT2_U_git2__clone_h //original-code:"git2/clone.h" #include BLIK_LIBGIT2_U_git2__commit_h //original-code:"git2/commit.h" #include BLIK_LIBGIT2_U_git2__common_h //original-code:"git2/common.h" #include BLIK_LIBGIT2_U_git2__config_h //original-code:"git2/config.h" #include BLIK_LIBGIT2_U_git2__describe_h //original-code:"git2/describe.h" #include BLIK_LIBGIT2_U_git2__diff_h //original-code:"git2/diff.h" #include BLIK_LIBGIT2_U_git2__errors_h //original-code:"git2/errors.h" #include BLIK_LIBGIT2_U_git2__filter_h //original-code:"git2/filter.h" #include BLIK_LIBGIT2_U_git2__global_h //original-code:"git2/global.h" #include BLIK_LIBGIT2_U_git2__graph_h //original-code:"git2/graph.h" #include BLIK_LIBGIT2_U_git2__ignore_h //original-code:"git2/ignore.h" #include BLIK_LIBGIT2_U_git2__index_h //original-code:"git2/index.h" #include BLIK_LIBGIT2_U_git2__indexer_h //original-code:"git2/indexer.h" #include BLIK_LIBGIT2_U_git2__merge_h //original-code:"git2/merge.h" #include BLIK_LIBGIT2_U_git2__message_h //original-code:"git2/message.h" #include BLIK_LIBGIT2_U_git2__net_h //original-code:"git2/net.h" #include "git2/notes.h" #include BLIK_LIBGIT2_U_git2__object_h //original-code:"git2/object.h" #include BLIK_LIBGIT2_U_git2__odb_h //original-code:"git2/odb.h" #include BLIK_LIBGIT2_U_git2__odb_backend_h //original-code:"git2/odb_backend.h" #include BLIK_LIBGIT2_U_git2__oid_h //original-code:"git2/oid.h" #include BLIK_LIBGIT2_U_git2__pack_h //original-code:"git2/pack.h" #include BLIK_LIBGIT2_U_git2__patch_h //original-code:"git2/patch.h" #include BLIK_LIBGIT2_U_git2__pathspec_h //original-code:"git2/pathspec.h" #include BLIK_LIBGIT2_U_git2__push_h //original-code:"git2/push.h" #include "git2/rebase.h" #include BLIK_LIBGIT2_U_git2__refdb_h //original-code:"git2/refdb.h" #include BLIK_LIBGIT2_U_git2__reflog_h //original-code:"git2/reflog.h" #include BLIK_LIBGIT2_U_git2__refs_h //original-code:"git2/refs.h" #include BLIK_LIBGIT2_U_git2__refspec_h //original-code:"git2/refspec.h" #include BLIK_LIBGIT2_U_git2__remote_h //original-code:"git2/remote.h" #include BLIK_LIBGIT2_U_git2__repository_h //original-code:"git2/repository.h" #include BLIK_LIBGIT2_U_git2__reset_h //original-code:"git2/reset.h" #include BLIK_LIBGIT2_U_git2__revert_h //original-code:"git2/revert.h" #include BLIK_LIBGIT2_U_git2__revparse_h //original-code:"git2/revparse.h" #include BLIK_LIBGIT2_U_git2__revwalk_h //original-code:"git2/revwalk.h" #include BLIK_LIBGIT2_U_git2__signature_h //original-code:"git2/signature.h" #include BLIK_LIBGIT2_U_git2__stash_h //original-code:"git2/stash.h" #include BLIK_LIBGIT2_U_git2__status_h //original-code:"git2/status.h" #include BLIK_LIBGIT2_U_git2__submodule_h //original-code:"git2/submodule.h" #include BLIK_LIBGIT2_U_git2__tag_h //original-code:"git2/tag.h" #include BLIK_LIBGIT2_U_git2__transport_h //original-code:"git2/transport.h" #include BLIK_LIBGIT2_U_git2__tree_h //original-code:"git2/tree.h" #include BLIK_LIBGIT2_U_git2__types_h //original-code:"git2/types.h" #include "git2/version.h" #endif
<settings> <localRepository>../../../../build/local-m2-repository</localRepository> <profiles> <profile> <id>cli-test-repo</id> <activation> <activeByDefault>true</activeByDefault> </activation> <repositories> <repository> <id>local.central</id> <url>file:../../../../build/test-repository</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>thymeleaf-snapshot</id> <url>https://oss.sonatype.org/content/repositories/snapshots</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </profile> </profiles> </settings>
.. Copyright David Abrahams 2006. Distributed under the Boost .. Software License, Version 1.0. (See accompanying .. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) :: template < class Incrementable , class CategoryOrTraversal = use_default , class Difference = use_default > class counting_iterator { public: typedef Incrementable value_type; typedef const Incrementable& reference; typedef const Incrementable* pointer; typedef /* see below */ difference_type; typedef /* see below */ iterator_category; counting_iterator(); counting_iterator(counting_iterator const& rhs); explicit counting_iterator(Incrementable x); Incrementable const& base() const; reference operator*() const; counting_iterator& operator++(); counting_iterator& operator--(); private: Incrementable m_inc; // exposition }; If the ``Difference`` argument is ``use_default`` then ``difference_type`` is an unspecified signed integral type. Otherwise ``difference_type`` is ``Difference``. ``iterator_category`` is determined according to the following algorithm: .. parsed-literal:: if (CategoryOrTraversal is not use_default) return CategoryOrTraversal else if (numeric_limits<Incrementable>::is_specialized) return |iterator-category|_\ ( random_access_traversal_tag, Incrementable, const Incrementable&) else return |iterator-category|_\ ( iterator_traversal<Incrementable>::type, Incrementable, const Incrementable&) [*Note:* implementers are encouraged to provide an implementation of ``operator-`` and a ``difference_type`` that avoids overflows in the cases where ``std::numeric_limits<Incrementable>::is_specialized`` is true.] ``counting_iterator`` requirements .................................. The ``Incrementable`` argument shall be Copy Constructible and Assignable. If ``iterator_category`` is convertible to ``forward_iterator_tag`` or ``forward_traversal_tag``, the following must be well-formed:: Incrementable i, j; ++i; // pre-increment i == j; // operator equal If ``iterator_category`` is convertible to ``bidirectional_iterator_tag`` or ``bidirectional_traversal_tag``, the following expression must also be well-formed:: --i If ``iterator_category`` is convertible to ``random_access_iterator_tag`` or ``random_access_traversal_tag``, the following must must also be valid:: counting_iterator::difference_type n; i += n; n = i - j; i < j; ``counting_iterator`` models ............................ Specializations of ``counting_iterator`` model Readable Lvalue Iterator. In addition, they model the concepts corresponding to the iterator tags to which their ``iterator_category`` is convertible. Also, if ``CategoryOrTraversal`` is not ``use_default`` then ``counting_iterator`` models the concept corresponding to the iterator tag ``CategoryOrTraversal``. Otherwise, if ``numeric_limits<Incrementable>::is_specialized``, then ``counting_iterator`` models Random Access Traversal Iterator. Otherwise, ``counting_iterator`` models the same iterator traversal concepts modeled by ``Incrementable``. ``counting_iterator<X,C1,D1>`` is interoperable with ``counting_iterator<Y,C2,D2>`` if and only if ``X`` is interoperable with ``Y``. ``counting_iterator`` operations ................................ In addition to the operations required by the concepts modeled by ``counting_iterator``, ``counting_iterator`` provides the following operations. ``counting_iterator();`` :Requires: ``Incrementable`` is Default Constructible. :Effects: Default construct the member ``m_inc``. ``counting_iterator(counting_iterator const& rhs);`` :Effects: Construct member ``m_inc`` from ``rhs.m_inc``. ``explicit counting_iterator(Incrementable x);`` :Effects: Construct member ``m_inc`` from ``x``. ``reference operator*() const;`` :Returns: ``m_inc`` ``counting_iterator& operator++();`` :Effects: ``++m_inc`` :Returns: ``*this`` ``counting_iterator& operator--();`` :Effects: ``--m_inc`` :Returns: ``*this`` ``Incrementable const& base() const;`` :Returns: ``m_inc``
layout: post title: "Sensei Anywhere" category: development image: /images/blog/sensei-anywhere-screenshot.png --- Developer productivity is very important for us at [Datazenit](http://datazenit.com). Database administration tools usually do not excel with great efficiency, but we are here to change that. I really enjoy quick navigation features in IDEs and code editors. For example, Sublime Text, IntelliJ IDEA and vim with [ctrlp](https://github.com/kien/ctrlp.vim) or [command-t](https://github.com/wincent/Command-T) plugins provide an exceptionally quick way to navigate between files, classes and methods. <!-- more --> ![Sublime Text Navigation](/images/blog/sublime-text-navigation.png) <p class="caption">Sublime Text Goto Anything</p> I want to introduce similar functionality to Datazenit. We have started development on [Sensei Anywhere](https://github.com/datazenit/sensei-anywhere), a navigation tool powered by fuzzy search. The best part of this is that Sensei Anywhere is fully open source. It is essentially a JS library that depends on jQuery and lodash/underscore.js. The library itself is very simple and uncomplicated, it just triggers callbacks that you can listen to and do anything from there. It also means that the library is very flexible and brings no overhead. Sensei Anywhere will be used in Datazenit to quickly navigate between connections, databases, tables and filters. The project is currently under heavy development, but you can check out [Sensei Anywhere demo](http://datazenit.com/static/sensei-anywhere/example/). Source code is available at [GitHub](https://github.com/datazenit/sensei-anywhere). <a href="http://datazenit.com/static/sensei-anywhere/example/" target="_blank"><img style="margin:auto;" src="/images/blog/sensei-anywhere-screenshot.png" alt="Sensei Anywhere Screenshot"></a> P.S. We recently announced another open source project – [Sensei Grid](https://github.com/datazenit/sensei-grid), simple and lightweight data grid in JS/HTML, that is also a part of Datazenit.
const defaultTheme = require('./default-theme.js'); const darkThemeSingle = { "theme": "dark", "blue-1": "mix(color(~`colorPalette('@{blue-base}', 8) `), @component-background, 15%)", "blue-2": "mix(color(~`colorPalette('@{blue-base}', 7) `), @component-background, 25%)", "blue-3": "mix(@blue-base, @component-background, 30%)", "blue-4": "mix(@blue-base, @component-background, 45%)", "blue-5": "mix(@blue-base, @component-background, 65%)", "blue-6": "mix(@blue-base, @component-background, 85%)", "blue-7": "mix(color(~`colorPalette('@{blue-base}', 5) `), @component-background, 90%)", "blue-8": "mix(color(~`colorPalette('@{blue-base}', 4) `), @component-background, 95%)", "blue-9": "mix(color(~`colorPalette('@{blue-base}', 3) `), @component-background, 97%)", "blue-10": "mix(color(~`colorPalette('@{blue-base}', 2) `), @component-background, 98%)", "purple-1": "mix(color(~`colorPalette('@{purple-base}', 8) `), @component-background, 15%)", "purple-2": "mix(color(~`colorPalette('@{purple-base}', 7) `), @component-background, 25%)", "purple-3": "mix(@purple-base, @component-background, 30%)", "purple-4": "mix(@purple-base, @component-background, 45%)", "purple-5": "mix(@purple-base, @component-background, 65%)", "purple-6": "mix(@purple-base, @component-background, 85%)", "purple-7": "mix(color(~`colorPalette('@{purple-base}', 5) `), @component-background, 90%)", "purple-8": "mix(color(~`colorPalette('@{purple-base}', 4) `), @component-background, 95%)", "purple-9": "mix(color(~`colorPalette('@{purple-base}', 3) `), @component-background, 97%)", "purple-10": "mix(color(~`colorPalette('@{purple-base}', 2) `), @component-background, 98%)", "cyan-1": "mix(color(~`colorPalette('@{cyan-base}', 8) `), @component-background, 15%)", "cyan-2": "mix(color(~`colorPalette('@{cyan-base}', 7) `), @component-background, 25%)", "cyan-3": "mix(@cyan-base, @component-background, 30%)", "cyan-4": "mix(@cyan-base, @component-background, 45%)", "cyan-5": "mix(@cyan-base, @component-background, 65%)", "cyan-6": "mix(@cyan-base, @component-background, 85%)", "cyan-7": "mix(color(~`colorPalette('@{cyan-base}', 5) `), @component-background, 90%)", "cyan-8": "mix(color(~`colorPalette('@{cyan-base}', 4) `), @component-background, 95%)", "cyan-9": "mix(color(~`colorPalette('@{cyan-base}', 3) `), @component-background, 97%)", "cyan-10": "mix(color(~`colorPalette('@{cyan-base}', 2) `), @component-background, 98%)", "green-1": "mix(color(~`colorPalette('@{green-base}', 8) `), @component-background, 15%)", "green-2": "mix(color(~`colorPalette('@{green-base}', 7) `), @component-background, 25%)", "green-3": "mix(@green-base, @component-background, 30%)", "green-4": "mix(@green-base, @component-background, 45%)", "green-5": "mix(@green-base, @component-background, 65%)", "green-6": "mix(@green-base, @component-background, 85%)", "green-7": "mix(color(~`colorPalette('@{green-base}', 5) `), @component-background, 90%)", "green-8": "mix(color(~`colorPalette('@{green-base}', 4) `), @component-background, 95%)", "green-9": "mix(color(~`colorPalette('@{green-base}', 3) `), @component-background, 97%)", "green-10": "mix(color(~`colorPalette('@{green-base}', 2) `), @component-background, 98%)", "magenta-1": "mix(color(~`colorPalette('@{magenta-base}', 8) `), @component-background, 15%)", "magenta-2": "mix(color(~`colorPalette('@{magenta-base}', 7) `), @component-background, 25%)", "magenta-3": "mix(@magenta-base, @component-background, 30%)", "magenta-4": "mix(@magenta-base, @component-background, 45%)", "magenta-5": "mix(@magenta-base, @component-background, 65%)", "magenta-6": "mix(@magenta-base, @component-background, 85%)", "magenta-7": "mix(color(~`colorPalette('@{magenta-base}', 5) `), @component-background, 90%)", "magenta-8": "mix(color(~`colorPalette('@{magenta-base}', 4) `), @component-background, 95%)", "magenta-9": "mix(color(~`colorPalette('@{magenta-base}', 3) `), @component-background, 97%)", "magenta-10": "mix(color(~`colorPalette('@{magenta-base}', 2) `), @component-background, 98%)", "pink-1": "mix(color(~`colorPalette('@{pink-base}', 8) `), @component-background, 15%)", "pink-2": "mix(color(~`colorPalette('@{pink-base}', 7) `), @component-background, 25%)", "pink-3": "mix(@pink-base, @component-background, 30%)", "pink-4": "mix(@pink-base, @component-background, 45%)", "pink-5": "mix(@pink-base, @component-background, 65%)", "pink-6": "mix(@pink-base, @component-background, 85%)", "pink-7": "mix(color(~`colorPalette('@{pink-base}', 5) `), @component-background, 90%)", "pink-8": "mix(color(~`colorPalette('@{pink-base}', 4) `), @component-background, 95%)", "pink-9": "mix(color(~`colorPalette('@{pink-base}', 3) `), @component-background, 97%)", "pink-10": "mix(color(~`colorPalette('@{pink-base}', 2) `), @component-background, 98%)", "red-1": "mix(color(~`colorPalette('@{red-base}', 8) `), @component-background, 15%)", "red-2": "mix(color(~`colorPalette('@{red-base}', 7) `), @component-background, 25%)", "red-3": "mix(@red-base, @component-background, 30%)", "red-4": "mix(@red-base, @component-background, 45%)", "red-5": "mix(@red-base, @component-background, 65%)", "red-6": "mix(@red-base, @component-background, 85%)", "red-7": "mix(color(~`colorPalette('@{red-base}', 5) `), @component-background, 90%)", "red-8": "mix(color(~`colorPalette('@{red-base}', 4) `), @component-background, 95%)", "red-9": "mix(color(~`colorPalette('@{red-base}', 3) `), @component-background, 97%)", "red-10": "mix(color(~`colorPalette('@{red-base}', 2) `), @component-background, 98%)", "orange-1": "mix(color(~`colorPalette('@{orange-base}', 8) `), @component-background, 15%)", "orange-2": "mix(color(~`colorPalette('@{orange-base}', 7) `), @component-background, 25%)", "orange-3": "mix(@orange-base, @component-background, 30%)", "orange-4": "mix(@orange-base, @component-background, 45%)", "orange-5": "mix(@orange-base, @component-background, 65%)", "orange-6": "mix(@orange-base, @component-background, 85%)", "orange-7": "mix(color(~`colorPalette('@{orange-base}', 5) `), @component-background, 90%)", "orange-8": "mix(color(~`colorPalette('@{orange-base}', 4) `), @component-background, 95%)", "orange-9": "mix(color(~`colorPalette('@{orange-base}', 3) `), @component-background, 97%)", "orange-10": "mix(color(~`colorPalette('@{orange-base}', 2) `), @component-background, 98%)", "yellow-1": "mix(color(~`colorPalette('@{yellow-base}', 8) `), @component-background, 15%)", "yellow-2": "mix(color(~`colorPalette('@{yellow-base}', 7) `), @component-background, 25%)", "yellow-3": "mix(@yellow-base, @component-background, 30%)", "yellow-4": "mix(@yellow-base, @component-background, 45%)", "yellow-5": "mix(@yellow-base, @component-background, 65%)", "yellow-6": "mix(@yellow-base, @component-background, 85%)", "yellow-7": "mix(color(~`colorPalette('@{yellow-base}', 5) `), @component-background, 90%)", "yellow-8": "mix(color(~`colorPalette('@{yellow-base}', 4) `), @component-background, 95%)", "yellow-9": "mix(color(~`colorPalette('@{yellow-base}', 3) `), @component-background, 97%)", "yellow-10": "mix(color(~`colorPalette('@{yellow-base}', 2) `), @component-background, 98%)", "volcano-1": "mix(color(~`colorPalette('@{volcano-base}', 8) `), @component-background, 15%)", "volcano-2": "mix(color(~`colorPalette('@{volcano-base}', 7) `), @component-background, 25%)", "volcano-3": "mix(@volcano-base, @component-background, 30%)", "volcano-4": "mix(@volcano-base, @component-background, 45%)", "volcano-5": "mix(@volcano-base, @component-background, 65%)", "volcano-6": "mix(@volcano-base, @component-background, 85%)", "volcano-7": "mix(color(~`colorPalette('@{volcano-base}', 5) `), @component-background, 90%)", "volcano-8": "mix(color(~`colorPalette('@{volcano-base}', 4) `), @component-background, 95%)", "volcano-9": "mix(color(~`colorPalette('@{volcano-base}', 3) `), @component-background, 97%)", "volcano-10": "mix(color(~`colorPalette('@{volcano-base}', 2) `), @component-background, 98%)", "geekblue-1": "mix(color(~`colorPalette('@{geekblue-base}', 8) `), @component-background, 15%)", "geekblue-2": "mix(color(~`colorPalette('@{geekblue-base}', 7) `), @component-background, 25%)", "geekblue-3": "mix(@geekblue-base, @component-background, 30%)", "geekblue-4": "mix(@geekblue-base, @component-background, 45%)", "geekblue-5": "mix(@geekblue-base, @component-background, 65%)", "geekblue-6": "mix(@geekblue-base, @component-background, 85%)", "geekblue-7": "mix(color(~`colorPalette('@{geekblue-base}', 5) `), @component-background, 90%)", "geekblue-8": "mix(color(~`colorPalette('@{geekblue-base}', 4) `), @component-background, 95%)", "geekblue-9": "mix(color(~`colorPalette('@{geekblue-base}', 3) `), @component-background, 97%)", "geekblue-10": "mix(color(~`colorPalette('@{geekblue-base}', 2) `), @component-background, 98%)", "lime-1": "mix(color(~`colorPalette('@{lime-base}', 8) `), @component-background, 15%)", "lime-2": "mix(color(~`colorPalette('@{lime-base}', 7) `), @component-background, 25%)", "lime-3": "mix(@lime-base, @component-background, 30%)", "lime-4": "mix(@lime-base, @component-background, 45%)", "lime-5": "mix(@lime-base, @component-background, 65%)", "lime-6": "mix(@lime-base, @component-background, 85%)", "lime-7": "mix(color(~`colorPalette('@{lime-base}', 5) `), @component-background, 90%)", "lime-8": "mix(color(~`colorPalette('@{lime-base}', 4) `), @component-background, 95%)", "lime-9": "mix(color(~`colorPalette('@{lime-base}', 3) `), @component-background, 97%)", "lime-10": "mix(color(~`colorPalette('@{lime-base}', 2) `), @component-background, 98%)", "gold-1": "mix(color(~`colorPalette('@{gold-base}', 8) `), @component-background, 15%)", "gold-2": "mix(color(~`colorPalette('@{gold-base}', 7) `), @component-background, 25%)", "gold-3": "mix(@gold-base, @component-background, 30%)", "gold-4": "mix(@gold-base, @component-background, 45%)", "gold-5": "mix(@gold-base, @component-background, 65%)", "gold-6": "mix(@gold-base, @component-background, 85%)", "gold-7": "mix(color(~`colorPalette('@{gold-base}', 5) `), @component-background, 90%)", "gold-8": "mix(color(~`colorPalette('@{gold-base}', 4) `), @component-background, 95%)", "gold-9": "mix(color(~`colorPalette('@{gold-base}', 3) `), @component-background, 97%)", "gold-10": "mix(color(~`colorPalette('@{gold-base}', 2) `), @component-background, 98%)", "primary-1": "mix(color(~`colorPalette('@{primary-color}', 8) `), @component-background, 15%)", "primary-2": "mix(color(~`colorPalette('@{primary-color}', 7) `), @component-background, 25%)", "primary-3": "mix(@primary-color, @component-background, 30%)", "primary-4": "mix(@primary-color, @component-background, 45%)", "primary-5": "mix(@primary-color, @component-background, 65%)", "primary-6": "@primary-color", "primary-7": "mix(color(~`colorPalette('@{primary-color}', 5) `), @component-background, 90%)", "primary-8": "mix(color(~`colorPalette('@{primary-color}', 4) `), @component-background, 95%)", "primary-9": "mix(color(~`colorPalette('@{primary-color}', 3) `), @component-background, 97%)", "primary-10": "mix(color(~`colorPalette('@{primary-color}', 2) `), @component-background, 98%)", "popover-background": "#1f1f1f", "popover-customize-border-color": "#3a3a3a", "body-background": "@black", "component-background": "#141414", "text-color": "fade(@white, 85%)", "text-color-secondary": "fade(@white, 45%)", "text-color-inverse": "@white", "icon-color-hover": "fade(@white, 75%)", "heading-color": "fade(@white, 85%)", "item-active-bg": "@primary-1", "item-hover-bg": "fade(@white, 8%)", "border-color-base": "#434343", "border-color-split": "#303030", "background-color-light": "fade(@white, 4%)", "background-color-base": "fade(@white, 8%)", "disabled-color": "fade(@white, 30%)", "disabled-bg": "@background-color-base", "disabled-color-dark": "fade(@white, 30%)", "tree-bg": "transparent", "list-customize-card-bg": "transparent", "shadow-color": "rgba(0, 0, 0, 0.45)", "shadow-color-inverse": "@component-background", "box-shadow-base": "@shadow-2", "shadow-1-up": "0 -6px 16px -8px rgba(0, 0, 0, 0.32), 0 -9px 28px 0 rgba(0, 0, 0, 0.2),\n 0 -12px 48px 16px rgba(0, 0, 0, 0.12)", "shadow-1-down": "0 6px 16px -8px rgba(0, 0, 0, 0.32), 0 9px 28px 0 rgba(0, 0, 0, 0.2),\n 0 12px 48px 16px rgba(0, 0, 0, 0.12)", "shadow-1-right": "6px 0 16px -8px rgba(0, 0, 0, 0.32), 9px 0 28px 0 rgba(0, 0, 0, 0.2),\n 12px 0 48px 16px rgba(0, 0, 0, 0.12)", "shadow-2": "0 3px 6px -4px rgba(0, 0, 0, 0.48), 0 6px 16px 0 rgba(0, 0, 0, 0.32),\n 0 9px 28px 8px rgba(0, 0, 0, 0.2)", "btn-shadow": "0 2px 0 rgba(0, 0, 0, 0.015)", "btn-primary-shadow": "0 2px 0 rgba(0, 0, 0, 0.045)", "btn-text-shadow": "0 -1px 0 rgba(0, 0, 0, 0.12)", "btn-default-bg": "transparent", "btn-default-ghost-color": "@text-color", "btn-default-ghost-border": "fade(@white, 25%)", "btn-text-hover-bg": "rgba(255, 255, 255, 0.03)", "checkbox-check-bg": "transparent", "descriptions-bg": "@background-color-light", "divider-color": "rgba(255, 255, 255, 12%)", "modal-header-bg": "@popover-background", "modal-header-border-color-split": "@border-color-split", "modal-content-bg": "@popover-background", "modal-footer-border-color-split": "@border-color-split", "radio-solid-checked-color": "@white", "radio-dot-disabled-color": "fade(@white, 20%)", "radio-disabled-button-checked-bg": "fade(@white, 20%)", "radio-disabled-button-checked-color": "@disabled-color", "layout-body-background": "@body-background", "layout-header-background": "@popover-background", "layout-trigger-background": "#262626", "input-bg": "transparent", "input-placeholder-color": "fade(@white, 30%)", "input-icon-color": "fade(@white, 30%)", "input-number-handler-active-bg": "@item-hover-bg", "input-icon-hover-color": "fade(@white, 85%)", "select-background": "transparent", "select-dropdown-bg": "@popover-background", "select-clear-background": "@component-background", "select-selection-item-bg": "fade(@white, 8)", "select-selection-item-border-color": "@border-color-split", "select-multiple-disabled-background": "@component-background", "select-multiple-item-disabled-color": "#595959", "select-multiple-item-disabled-border-color": "@popover-background", "cascader-bg": "transparent", "cascader-menu-bg": "@popover-background", "cascader-menu-border-color-split": "@border-color-split", "tooltip-bg": "#434343", "menu-dark-submenu-bg": "@component-background", "menu-dark-bg": "@popover-background", "menu-popup-bg": "@popover-background", "message-notice-content-bg": "@popover-background", "notification-bg": "@popover-background", "link-hover-color": "@primary-5", "link-active-color": "@primary-7", "table-header-bg": "#1d1d1d", "table-body-sort-bg": "fade(@white, 1%)", "table-row-hover-bg": "#262626", "table-header-sort-bg": "#262626", "table-header-filter-active-bg": "#434343", "table-header-sort-active-bg": "#303030", "table-filter-btns-bg": "@popover-background", "table-expanded-row-bg": "@table-header-bg", "table-filter-dropdown-bg": "@popover-background", "table-expand-icon-bg": "transparent", "picker-basic-cell-hover-with-range-color": "darken(@primary-color, 35%)", "picker-basic-cell-disabled-bg": "#303030", "picker-border-color": "@border-color-split", "picker-bg": "transparent", "picker-date-hover-range-border-color": "darken(@primary-color, 20%)", "dropdown-menu-bg": "@popover-background", "dropdown-menu-submenu-disabled-bg": "transparent", "steps-nav-arrow-color": "fade(@white, 20%)", "steps-background": "transparent", "avatar-bg": "fade(@white, 30%)", "progress-steps-item-bg": "fade(@white, 8%)", "calendar-bg": "@popover-background", "calendar-input-bg": "@calendar-bg", "calendar-border-color": "transparent", "calendar-full-bg": "@component-background", "badge-text-color": "@white", "popover-bg": "@popover-background", "drawer-bg": "@popover-background", "card-actions-background": "@component-background", "card-skeleton-bg": "#303030", "card-shadow": "0 1px 2px -2px rgba(0, 0, 0, 0.64), 0 3px 6px 0 rgba(0, 0, 0, 0.48),\n 0 5px 12px 4px rgba(0, 0, 0, 0.36)", "transfer-item-hover-bg": "#262626", "comment-bg": "transparent", "comment-author-time-color": "fade(@white, 30%)", "comment-action-hover-color": "fade(@white, 65%)", "rate-star-bg": "fade(@white, 12%)", "switch-bg": "@white", "pagination-item-bg": "transparent", "pagination-item-bg-active": "transparent", "pagination-item-link-bg": "transparent", "pagination-item-disabled-bg-active": "fade(@white, 25%)", "pagination-item-disabled-color-active": "@black", "pagination-item-input-bg": "@pagination-item-bg", "page-header-back-color": "@icon-color", "page-header-ghost-bg": "transparent", "slider-rail-background-color": "#262626", "slider-rail-background-color-hover": "@border-color-base", "slider-dot-border-color": "@border-color-split", "slider-dot-border-color-active": "@primary-4", "skeleton-to-color": "fade(@white, 16%)", "alert-success-border-color": "@green-3", "alert-success-bg-color": "@green-1", "alert-success-icon-color": "@success-color", "alert-info-border-color": "@primary-3", "alert-info-bg-color": "@primary-1", "alert-info-icon-color": "@info-color", "alert-warning-border-color": "@gold-3", "alert-warning-bg-color": "@gold-1", "alert-warning-icon-color": "@warning-color", "alert-error-border-color": "@red-3", "alert-error-bg-color": "@red-1", "alert-error-icon-color": "@error-color", "timeline-color": "@border-color-split", "timeline-dot-color": "@primary-color", "mentions-dropdown-bg": "@popover-background" }; function getThemeVariables(options = {}) { let themeVar = { 'hack': `true;@import "${require.resolve('ant-design-vue/lib/style/color/colorPalette.less')}";`, ...defaultTheme }; if(options.dark) { themeVar = { ...themeVar, ...darkThemeSingle } } if(options.compact){ themeVar = { ...themeVar } } return themeVar; } module.exports = { darkThemeSingle, getThemeVariables }
"""Run the tests with python misc_test.py or python3 misc_test.py """ from __future__ import division import random import unittest import misc class TestMisc(unittest.TestCase): def testUnwrapMod3(self): data = [0, 1, 2, 0, -1, -2, -3, -4] unwrapped_3 = misc.Unwrap(data, 3) self.assertEqual([0, 1, 2, 3, 2, 1, 0, -1], unwrapped_3) def testUnwrapMod4(self): data = [0, 1, 2, 0, -1, -2, -3, -4] unwrapped_4 = misc.Unwrap(data, 4) self.assertEqual([0, 1, 2, 0, -1, -2, -3, -4], unwrapped_4) def testDataShouldNotChangeAfterUnwrap(self): data = [0, 1, 2, 0, -1, -2, -3, -4] _ = misc.Unwrap(data, 4) self.assertEqual([0, 1, 2, 0, -1, -2, -3, -4], data) def testRandomlyMultiplesOfModAdded(self): # `unwrap` definition says only multiples of mod are added. random_data = [random.randint(0, 9) for _ in range(100)] for mod in range(1, 100): random_data_unwrapped_mod = misc.Unwrap(random_data, mod) for (old_a, a) in zip(random_data, random_data_unwrapped_mod): self.assertEqual((old_a - a) % mod, 0) def testRandomlyAgainstInequalityDefinition(self): # Data has to satisfy -mod/2 <= difference < mod/2 for every # difference between consecutive values after unwrap. random_data = [random.randint(0, 9) for _ in range(100)] for mod in range(1, 100): random_data_unwrapped_mod = misc.Unwrap(random_data, mod) for (a, b) in zip(random_data_unwrapped_mod, random_data_unwrapped_mod[1:]): self.assertTrue(-mod / 2 <= b - a < mod / 2) def testRandomlyDataShouldNotChangeAfterUnwrap(self): random_data = [random.randint(0, 9) for _ in range(100)] random_data_copy = random_data[:] for mod in range(1, 100): _ = misc.Unwrap(random_data, mod) self.assertEqual(random_data, random_data_copy) if __name__ == "__main__": unittest.main()
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild, } from '@angular/core'; import { LngLatLike, PointLike, Popup, PopupOptions } from 'mapbox-gl'; import { MapService } from '../map/map.service'; import { MarkerComponent } from '../marker/marker.component'; import { deprecationWarning } from '../utils'; @Component({ selector: 'mgl-popup', template: '<div #content><ng-content></ng-content></div>', changeDetection: ChangeDetectionStrategy.OnPush, }) export class PopupComponent implements OnChanges, OnDestroy, AfterViewInit, OnInit { /* Init input */ @Input() closeButton?: PopupOptions['closeButton']; @Input() closeOnClick?: PopupOptions['closeOnClick']; @Input() closeOnMove?: PopupOptions['closeOnMove']; @Input() focusAfterOpen?: PopupOptions['focusAfterOpen']; @Input() anchor?: PopupOptions['anchor']; @Input() className?: PopupOptions['className']; @Input() maxWidth?: PopupOptions['maxWidth']; /* Dynamic input */ @Input() feature?: GeoJSON.Feature<GeoJSON.Point>; @Input() lngLat?: LngLatLike; @Input() marker?: MarkerComponent; @Input() offset?: number | PointLike | { [anchor: string]: [number, number] }; @Output() popupClose = new EventEmitter<void>(); @Output() popupOpen = new EventEmitter<void>(); /** * @deprecated Use popupClose instead */ // eslint-disable-next-line @angular-eslint/no-output-native @Output() close = new EventEmitter<void>(); /** * @deprecated Use popupOpen instead */ // eslint-disable-next-line @angular-eslint/no-output-native @Output() open = new EventEmitter<void>(); @ViewChild('content', { static: true }) content: ElementRef; popupInstance?: Popup; constructor(private mapService: MapService) {} ngOnInit() { this.warnDeprecatedOutputs(); if ( (this.lngLat && this.marker) || (this.feature && this.lngLat) || (this.feature && this.marker) ) { throw new Error('marker, lngLat, feature input are mutually exclusive'); } } ngOnChanges(changes: SimpleChanges) { if ( (changes['lngLat'] && !changes['lngLat'].isFirstChange()) || (changes['feature'] && !changes['feature'].isFirstChange()) ) { const newlngLat = changes['lngLat'] ? this.lngLat! : (this.feature!.geometry!.coordinates! as [number, number]); this.mapService.removePopupFromMap(this.popupInstance!, true); const popupInstanceTmp = this.createPopup(); this.mapService.addPopupToMap( popupInstanceTmp, newlngLat, this.popupInstance!.isOpen() ); this.popupInstance = popupInstanceTmp; } if (changes['marker'] && !changes['marker'].isFirstChange()) { const previousMarker: MarkerComponent = changes['marker'].previousValue; if (previousMarker.markerInstance) { this.mapService.removePopupFromMarker(previousMarker.markerInstance); } if (this.marker && this.marker.markerInstance && this.popupInstance) { this.mapService.addPopupToMarker( this.marker.markerInstance, this.popupInstance ); } } if ( changes['offset'] && !changes['offset'].isFirstChange() && this.popupInstance ) { this.popupInstance.setOffset(this.offset); } } ngAfterViewInit() { this.popupInstance = this.createPopup(); this.addPopup(this.popupInstance); } ngOnDestroy() { if (this.popupInstance) { if (this.lngLat || this.feature) { this.mapService.removePopupFromMap(this.popupInstance); } else if (this.marker && this.marker.markerInstance) { this.mapService.removePopupFromMarker(this.marker.markerInstance); } } this.popupInstance = undefined; } private createPopup() { return this.mapService.createPopup( { popupOptions: { closeButton: this.closeButton, closeOnClick: this.closeOnClick, closeOnMove: this.closeOnMove, focusAfterOpen: this.focusAfterOpen, anchor: this.anchor, offset: this.offset, className: this.className, maxWidth: this.maxWidth, }, popupEvents: { open: this.open, close: this.close, popupOpen: this.popupOpen, popupClose: this.popupClose, }, }, this.content.nativeElement ); } private addPopup(popup: Popup) { this.mapService.mapCreated$.subscribe(() => { if (this.lngLat || this.feature) { this.mapService.addPopupToMap( popup, this.lngLat ? this.lngLat : (this.feature!.geometry!.coordinates! as [number, number]) ); } else if (this.marker && this.marker.markerInstance) { this.mapService.addPopupToMarker(this.marker.markerInstance, popup); } else { throw new Error( 'mgl-popup need either lngLat/marker/feature to be set' ); } }); } private warnDeprecatedOutputs() { const dw = deprecationWarning.bind(undefined, PopupComponent.name); if (this.close.observed) { dw('close', 'popupClose'); } if (this.open.observed) { dw('open', 'popupOpen'); } } }
<?php App::uses('ClassRegistry', 'Utility'); App::uses('Validation', 'Utility'); App::uses('String', 'Utility'); App::uses('Hash', 'Utility'); App::uses('BehaviorCollection', 'Model'); App::uses('ModelBehavior', 'Model'); App::uses('ModelValidator', 'Model'); App::uses('ConnectionManager', 'Model'); App::uses('Xml', 'Utility'); App::uses('CakeEvent', 'Event'); App::uses('CakeEventListener', 'Event'); App::uses('CakeEventManager', 'Event'); /** * Object-relational mapper. * * DBO-backed object data model. * Automatically selects a database table name based on a pluralized lowercase object class name * (i.e. class 'User' => table 'users'; class 'Man' => table 'men') * The table is required to have at least 'id auto_increment' primary key. * * @package Cake.Model * @link http://book.cakephp.org/2.0/en/models.html */ class Model extends Object implements CakeEventListener { /** * The name of the DataSource connection that this Model uses * * The value must be an attribute name that you defined in `app/Config/database.php` * or created using `ConnectionManager::create()`. * * @var string * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#usedbconfig */ public $useDbConfig = 'default'; /** * Custom database table name, or null/false if no table association is desired. * * @var string * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#usetable */ public $useTable = null; /** * Custom display field name. Display fields are used by Scaffold, in SELECT boxes' OPTION elements. * * This field is also used in `find('list')` when called with no extra parameters in the fields list * * @var string * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#displayfield */ public $displayField = null; /** * Value of the primary key ID of the record that this model is currently pointing to. * Automatically set after database insertions. * * @var mixed */ public $id = false; /** * Container for the data that this model gets from persistent storage (usually, a database). * * @var array * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#data */ public $data = array(); /** * Holds physical schema/database name for this model. Automatically set during Model creation. * * @var string */ public $schemaName = null; /** * Table name for this Model. * * @var string */ public $table = false; /** * The name of the primary key field for this model. * * @var string * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#primaryKey */ public $primaryKey = null; /** * Field-by-field table metadata. * * @var array */ protected $_schema = null; /** * List of validation rules. It must be an array with the field name as key and using * as value one of the following possibilities * * ### Validating using regular expressions * * {{{ * public $validate = array( * 'name' => '/^[a-z].+$/i' * ); * }}} * * ### Validating using methods (no parameters) * * {{{ * public $validate = array( * 'name' => 'notEmpty' * ); * }}} * * ### Validating using methods (with parameters) * * {{{ * public $validate = array( * 'age' => array( * 'rule' => array('between', 5, 25) * ) * ); * }}} * * ### Validating using custom method * * {{{ * public $validate = array( * 'password' => array( * 'rule' => array('customValidation') * ) * ); * public function customValidation($data) { * // $data will contain array('password' => 'value') * if (isset($this->data[$this->alias]['password2'])) { * return $this->data[$this->alias]['password2'] === current($data); * } * return true; * } * }}} * * ### Validations with messages * * The messages will be used in Model::$validationErrors and can be used in the FormHelper * * {{{ * public $validate = array( * 'age' => array( * 'rule' => array('between', 5, 25), * 'message' => array('The age must be between %d and %d.') * ) * ); * }}} * * ### Multiple validations to the same field * * {{{ * public $validate = array( * 'login' => array( * array( * 'rule' => 'alphaNumeric', * 'message' => 'Only alphabets and numbers allowed', * 'last' => true * ), * array( * 'rule' => array('minLength', 8), * 'message' => array('Minimum length of %d characters') * ) * ) * ); * }}} * * ### Valid keys in validations * * - `rule`: String with method name, regular expression (started by slash) or array with method and parameters * - `message`: String with the message or array if have multiple parameters. See http://php.net/sprintf * - `last`: Boolean value to indicate if continue validating the others rules if the current fail [Default: true] * - `required`: Boolean value to indicate if the field must be present on save * - `allowEmpty`: Boolean value to indicate if the field can be empty * - `on`: Possible values: `update`, `create`. Indicate to apply this rule only on update or create * * @var array * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#validate * @link http://book.cakephp.org/2.0/en/models/data-validation.html */ public $validate = array(); /** * List of validation errors. * * @var array */ public $validationErrors = array(); /** * Name of the validation string domain to use when translating validation errors. * * @var string */ public $validationDomain = null; /** * Database table prefix for tables in model. * * @var string * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#tableprefix */ public $tablePrefix = null; /** * Plugin model belongs to. * * @var string */ public $plugin = null; /** * Name of the model. * * @var string * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#name */ public $name = null; /** * Alias name for model. * * @var string */ public $alias = null; /** * List of table names included in the model description. Used for associations. * * @var array */ public $tableToModel = array(); /** * Whether or not to cache queries for this model. This enables in-memory * caching only, the results are not stored beyond the current request. * * @var boolean * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#cachequeries */ public $cacheQueries = false; /** * Detailed list of belongsTo associations. * * ### Basic usage * * `public $belongsTo = array('Group', 'Department');` * * ### Detailed configuration * * {{{ * public $belongsTo = array( * 'Group', * 'Department' => array( * 'className' => 'Department', * 'foreignKey' => 'department_id' * ) * ); * }}} * * ### Possible keys in association * * - `className`: the class name of the model being associated to the current model. * If you're defining a 'Profile belongsTo User' relationship, the className key should equal 'User.' * - `foreignKey`: the name of the foreign key found in the current model. This is * especially handy if you need to define multiple belongsTo relationships. The default * value for this key is the underscored, singular name of the other model, suffixed with '_id'. * - `conditions`: An SQL fragment used to filter related model records. It's good * practice to use model names in SQL fragments: 'User.active = 1' is always * better than just 'active = 1.' * - `type`: the type of the join to use in the SQL query, default is LEFT which * may not fit your needs in all situations, INNER may be helpful when you want * everything from your main and associated models or nothing at all!(effective * when used with some conditions of course). (NB: type value is in lower case - i.e. left, inner) * - `fields`: A list of fields to be retrieved when the associated model data is * fetched. Returns all fields by default. * - `order`: An SQL fragment that defines the sorting order for the returned associated rows. * - `counterCache`: If set to true the associated Model will automatically increase or * decrease the "[singular_model_name]_count" field in the foreign table whenever you do * a save() or delete(). If its a string then its the field name to use. The value in the * counter field represents the number of related rows. * - `counterScope`: Optional conditions array to use for updating counter cache field. * * @var array * @link http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#belongsto */ public $belongsTo = array(); /** * Detailed list of hasOne associations. * * ### Basic usage * * `public $hasOne = array('Profile', 'Address');` * * ### Detailed configuration * * {{{ * public $hasOne = array( * 'Profile', * 'Address' => array( * 'className' => 'Address', * 'foreignKey' => 'user_id' * ) * ); * }}} * * ### Possible keys in association * * - `className`: the class name of the model being associated to the current model. * If you're defining a 'User hasOne Profile' relationship, the className key should equal 'Profile.' * - `foreignKey`: the name of the foreign key found in the other model. This is * especially handy if you need to define multiple hasOne relationships. * The default value for this key is the underscored, singular name of the * current model, suffixed with '_id'. In the example above it would default to 'user_id'. * - `conditions`: An SQL fragment used to filter related model records. It's good * practice to use model names in SQL fragments: "Profile.approved = 1" is * always better than just "approved = 1." * - `fields`: A list of fields to be retrieved when the associated model data is * fetched. Returns all fields by default. * - `order`: An SQL fragment that defines the sorting order for the returned associated rows. * - `dependent`: When the dependent key is set to true, and the model's delete() * method is called with the cascade parameter set to true, associated model * records are also deleted. In this case we set it true so that deleting a * User will also delete her associated Profile. * * @var array * @link http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasone */ public $hasOne = array(); /** * Detailed list of hasMany associations. * * ### Basic usage * * `public $hasMany = array('Comment', 'Task');` * * ### Detailed configuration * * {{{ * public $hasMany = array( * 'Comment', * 'Task' => array( * 'className' => 'Task', * 'foreignKey' => 'user_id' * ) * ); * }}} * * ### Possible keys in association * * - `className`: the class name of the model being associated to the current model. * If you're defining a 'User hasMany Comment' relationship, the className key should equal 'Comment.' * - `foreignKey`: the name of the foreign key found in the other model. This is * especially handy if you need to define multiple hasMany relationships. The default * value for this key is the underscored, singular name of the actual model, suffixed with '_id'. * - `conditions`: An SQL fragment used to filter related model records. It's good * practice to use model names in SQL fragments: "Comment.status = 1" is always * better than just "status = 1." * - `fields`: A list of fields to be retrieved when the associated model data is * fetched. Returns all fields by default. * - `order`: An SQL fragment that defines the sorting order for the returned associated rows. * - `limit`: The maximum number of associated rows you want returned. * - `offset`: The number of associated rows to skip over (given the current * conditions and order) before fetching and associating. * - `dependent`: When dependent is set to true, recursive model deletion is * possible. In this example, Comment records will be deleted when their * associated User record has been deleted. * - `exclusive`: When exclusive is set to true, recursive model deletion does * the delete with a deleteAll() call, instead of deleting each entity separately. * This greatly improves performance, but may not be ideal for all circumstances. * - `finderQuery`: A complete SQL query CakePHP can use to fetch associated model * records. This should be used in situations that require very custom results. * * @var array * @link http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasmany */ public $hasMany = array(); /** * Detailed list of hasAndBelongsToMany associations. * * ### Basic usage * * `public $hasAndBelongsToMany = array('Role', 'Address');` * * ### Detailed configuration * * {{{ * public $hasAndBelongsToMany = array( * 'Role', * 'Address' => array( * 'className' => 'Address', * 'foreignKey' => 'user_id', * 'associationForeignKey' => 'address_id', * 'joinTable' => 'addresses_users' * ) * ); * }}} * * ### Possible keys in association * * - `className`: the class name of the model being associated to the current model. * If you're defining a 'Recipe HABTM Tag' relationship, the className key should equal 'Tag.' * - `joinTable`: The name of the join table used in this association (if the * current table doesn't adhere to the naming convention for HABTM join tables). * - `with`: Defines the name of the model for the join table. By default CakePHP * will auto-create a model for you. Using the example above it would be called * RecipesTag. By using this key you can override this default name. The join * table model can be used just like any "regular" model to access the join table directly. * - `foreignKey`: the name of the foreign key found in the current model. * This is especially handy if you need to define multiple HABTM relationships. * The default value for this key is the underscored, singular name of the * current model, suffixed with '_id'. * - `associationForeignKey`: the name of the foreign key found in the other model. * This is especially handy if you need to define multiple HABTM relationships. * The default value for this key is the underscored, singular name of the other * model, suffixed with '_id'. * - `unique`: If true (default value) cake will first delete existing relationship * records in the foreign keys table before inserting new ones, when updating a * record. So existing associations need to be passed again when updating. * To prevent deletion of existing relationship records, set this key to a string 'keepExisting'. * - `conditions`: An SQL fragment used to filter related model records. It's good * practice to use model names in SQL fragments: "Comment.status = 1" is always * better than just "status = 1." * - `fields`: A list of fields to be retrieved when the associated model data is * fetched. Returns all fields by default. * - `order`: An SQL fragment that defines the sorting order for the returned associated rows. * - `limit`: The maximum number of associated rows you want returned. * - `offset`: The number of associated rows to skip over (given the current * conditions and order) before fetching and associating. * - `finderQuery`, A complete SQL query CakePHP * can use to fetch associated model records. This should * be used in situations that require very custom results. * * @var array * @link http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasandbelongstomany-habtm */ public $hasAndBelongsToMany = array(); /** * List of behaviors to load when the model object is initialized. Settings can be * passed to behaviors by using the behavior name as index. Eg: * * public $actsAs = array('Translate', 'MyBehavior' => array('setting1' => 'value1')) * * @var array * @link http://book.cakephp.org/2.0/en/models/behaviors.html#using-behaviors */ public $actsAs = null; /** * Holds the Behavior objects currently bound to this model. * * @var BehaviorCollection */ public $Behaviors = null; /** * Whitelist of fields allowed to be saved. * * @var array */ public $whitelist = array(); /** * Whether or not to cache sources for this model. * * @var boolean */ public $cacheSources = true; /** * Type of find query currently executing. * * @var string */ public $findQueryType = null; /** * Number of associations to recurse through during find calls. Fetches only * the first level by default. * * @var integer * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#recursive */ public $recursive = 1; /** * The column name(s) and direction(s) to order find results by default. * * public $order = "Post.created DESC"; * public $order = array("Post.view_count DESC", "Post.rating DESC"); * * @var string * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#order */ public $order = null; /** * Array of virtual fields this model has. Virtual fields are aliased * SQL expressions. Fields added to this property will be read as other fields in a model * but will not be saveable. * * `public $virtualFields = array('two' => '1 + 1');` * * Is a simplistic example of how to set virtualFields * * @var array * @link http://book.cakephp.org/2.0/en/models/model-attributes.html#virtualfields */ public $virtualFields = array(); /** * Default list of association keys. * * @var array */ protected $_associationKeys = array( 'belongsTo' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'counterCache'), 'hasOne' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'dependent'), 'hasMany' => array('className', 'foreignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'dependent', 'exclusive', 'finderQuery', 'counterQuery'), 'hasAndBelongsToMany' => array('className', 'joinTable', 'with', 'foreignKey', 'associationForeignKey', 'conditions', 'fields', 'order', 'limit', 'offset', 'unique', 'finderQuery') ); /** * Holds provided/generated association key names and other data for all associations. * * @var array */ protected $_associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); // @codingStandardsIgnoreStart /** * Holds model associations temporarily to allow for dynamic (un)binding. * * @var array */ public $__backAssociation = array(); /** * Back inner association * * @var array */ public $__backInnerAssociation = array(); /** * Back original association * * @var array */ public $__backOriginalAssociation = array(); /** * Back containable association * * @var array */ public $__backContainableAssociation = array(); // @codingStandardsIgnoreEnd /** * The ID of the model record that was last inserted. * * @var integer */ protected $_insertID = null; /** * Has the datasource been configured. * * @var boolean * @see Model::getDataSource */ protected $_sourceConfigured = false; /** * List of valid finder method options, supplied as the first parameter to find(). * * @var array */ public $findMethods = array( 'all' => true, 'first' => true, 'count' => true, 'neighbors' => true, 'list' => true, 'threaded' => true ); /** * Instance of the CakeEventManager this model is using * to dispatch inner events. * * @var CakeEventManager */ protected $_eventManager = null; /** * Instance of the ModelValidator * * @var ModelValidator */ protected $_validator = null; /** * Constructor. Binds the model's database table to the object. * * If `$id` is an array it can be used to pass several options into the model. * * - `id`: The id to start the model on. * - `table`: The table to use for this model. * - `ds`: The connection name this model is connected to. * - `name`: The name of the model eg. Post. * - `alias`: The alias of the model, this is used for registering the instance in the `ClassRegistry`. * eg. `ParentThread` * * ### Overriding Model's __construct method. * * When overriding Model::__construct() be careful to include and pass in all 3 of the * arguments to `parent::__construct($id, $table, $ds);` * * ### Dynamically creating models * * You can dynamically create model instances using the $id array syntax. * * {{{ * $Post = new Model(array('table' => 'posts', 'name' => 'Post', 'ds' => 'connection2')); * }}} * * Would create a model attached to the posts table on connection2. Dynamic model creation is useful * when you want a model object that contains no associations or attached behaviors. * * @param boolean|integer|string|array $id Set this ID for this model on startup, * can also be an array of options, see above. * @param string $table Name of database table to use. * @param string $ds DataSource connection name. */ public function __construct($id = false, $table = null, $ds = null) { parent::__construct(); if (is_array($id)) { extract(array_merge( array( 'id' => $this->id, 'table' => $this->useTable, 'ds' => $this->useDbConfig, 'name' => $this->name, 'alias' => $this->alias, 'plugin' => $this->plugin ), $id )); } if ($this->plugin === null) { $this->plugin = (isset($plugin) ? $plugin : $this->plugin); } if ($this->name === null) { $this->name = (isset($name) ? $name : get_class($this)); } if ($this->alias === null) { $this->alias = (isset($alias) ? $alias : $this->name); } if ($this->primaryKey === null) { $this->primaryKey = 'id'; } ClassRegistry::addObject($this->alias, $this); $this->id = $id; unset($id); if ($table === false) { $this->useTable = false; } elseif ($table) { $this->useTable = $table; } if ($ds !== null) { $this->useDbConfig = $ds; } if (is_subclass_of($this, 'AppModel')) { $merge = array('actsAs', 'findMethods'); $parentClass = get_parent_class($this); if ($parentClass !== 'AppModel') { $this->_mergeVars($merge, $parentClass); } $this->_mergeVars($merge, 'AppModel'); } $this->_mergeVars(array('findMethods'), 'Model'); $this->Behaviors = new BehaviorCollection(); if ($this->useTable !== false) { if ($this->useTable === null) { $this->useTable = Inflector::tableize($this->name); } if (!$this->displayField) { unset($this->displayField); } $this->table = $this->useTable; $this->tableToModel[$this->table] = $this->alias; } elseif ($this->table === false) { $this->table = Inflector::tableize($this->name); } if ($this->tablePrefix === null) { unset($this->tablePrefix); } $this->_createLinks(); $this->Behaviors->init($this->alias, $this->actsAs); } /** * Returns a list of all events that will fire in the model during it's lifecycle. * You can override this function to add you own listener callbacks * * @return array */ public function implementedEvents() { return array( 'Model.beforeFind' => array('callable' => 'beforeFind', 'passParams' => true), 'Model.afterFind' => array('callable' => 'afterFind', 'passParams' => true), 'Model.beforeValidate' => array('callable' => 'beforeValidate', 'passParams' => true), 'Model.afterValidate' => array('callable' => 'afterValidate'), 'Model.beforeSave' => array('callable' => 'beforeSave', 'passParams' => true), 'Model.afterSave' => array('callable' => 'afterSave', 'passParams' => true), 'Model.beforeDelete' => array('callable' => 'beforeDelete', 'passParams' => true), 'Model.afterDelete' => array('callable' => 'afterDelete'), ); } /** * Returns the CakeEventManager manager instance that is handling any callbacks. * You can use this instance to register any new listeners or callbacks to the * model events, or create your own events and trigger them at will. * * @return CakeEventManager */ public function getEventManager() { if (empty($this->_eventManager)) { $this->_eventManager = new CakeEventManager(); $this->_eventManager->attach($this->Behaviors); $this->_eventManager->attach($this); } return $this->_eventManager; } /** * Handles custom method calls, like findBy<field> for DB models, * and custom RPC calls for remote data sources. * * @param string $method Name of method to call. * @param array $params Parameters for the method. * @return mixed Whatever is returned by called method */ public function __call($method, $params) { $result = $this->Behaviors->dispatchMethod($this, $method, $params); if ($result !== array('unhandled')) { return $result; } return $this->getDataSource()->query($method, $params, $this); } /** * Handles the lazy loading of model associations by looking in the association arrays for the requested variable * * @param string $name variable tested for existence in class * @return boolean true if the variable exists (if is a not loaded model association it will be created), false otherwise */ public function __isset($name) { $className = false; foreach ($this->_associations as $type) { if (isset($name, $this->{$type}[$name])) { $className = empty($this->{$type}[$name]['className']) ? $name : $this->{$type}[$name]['className']; break; } elseif (isset($name, $this->__backAssociation[$type][$name])) { $className = empty($this->__backAssociation[$type][$name]['className']) ? $name : $this->__backAssociation[$type][$name]['className']; break; } elseif ($type === 'hasAndBelongsToMany') { foreach ($this->{$type} as $k => $relation) { if (empty($relation['with'])) { continue; } if (is_array($relation['with'])) { if (key($relation['with']) === $name) { $className = $name; } } else { list($plugin, $class) = pluginSplit($relation['with']); if ($class === $name) { $className = $relation['with']; } } if ($className) { $assocKey = $k; $dynamic = !empty($relation['dynamicWith']); break(2); } } } } if (!$className) { return false; } list($plugin, $className) = pluginSplit($className); if (!ClassRegistry::isKeySet($className) && !empty($dynamic)) { $this->{$className} = new AppModel(array( 'name' => $className, 'table' => $this->hasAndBelongsToMany[$assocKey]['joinTable'], 'ds' => $this->useDbConfig )); } else { $this->_constructLinkedModel($name, $className, $plugin); } if (!empty($assocKey)) { $this->hasAndBelongsToMany[$assocKey]['joinTable'] = $this->{$name}->table; if (count($this->{$name}->schema()) <= 2 && $this->{$name}->primaryKey !== false) { $this->{$name}->primaryKey = $this->hasAndBelongsToMany[$assocKey]['foreignKey']; } } return true; } /** * Returns the value of the requested variable if it can be set by __isset() * * @param string $name variable requested for it's value or reference * @return mixed value of requested variable if it is set */ public function __get($name) { if ($name === 'displayField') { return $this->displayField = $this->hasField(array('title', 'name', $this->primaryKey)); } if ($name === 'tablePrefix') { $this->setDataSource(); if (property_exists($this, 'tablePrefix') && !empty($this->tablePrefix)) { return $this->tablePrefix; } return $this->tablePrefix = null; } if (isset($this->{$name})) { return $this->{$name}; } } /** * Bind model associations on the fly. * * If `$reset` is false, association will not be reset * to the originals defined in the model * * Example: Add a new hasOne binding to the Profile model not * defined in the model source code: * * `$this->User->bindModel(array('hasOne' => array('Profile')));` * * Bindings that are not made permanent will be reset by the next Model::find() call on this * model. * * @param array $params Set of bindings (indexed by binding type) * @param boolean $reset Set to false to make the binding permanent * @return boolean Success * @link http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#creating-and-destroying-associations-on-the-fly */ public function bindModel($params, $reset = true) { foreach ($params as $assoc => $model) { if ($reset === true && !isset($this->__backAssociation[$assoc])) { $this->__backAssociation[$assoc] = $this->{$assoc}; } foreach ($model as $key => $value) { $assocName = $key; if (is_numeric($key)) { $assocName = $value; $value = array(); } $this->{$assoc}[$assocName] = $value; if (property_exists($this, $assocName)) { unset($this->{$assocName}); } if ($reset === false && isset($this->__backAssociation[$assoc])) { $this->__backAssociation[$assoc][$assocName] = $value; } } } $this->_createLinks(); return true; } /** * Turn off associations on the fly. * * If $reset is false, association will not be reset * to the originals defined in the model * * Example: Turn off the associated Model Support request, * to temporarily lighten the User model: * * `$this->User->unbindModel(array('hasMany' => array('SupportRequest')));` * Or alternatively: * `$this->User->unbindModel(array('hasMany' => 'SupportRequest'));` * * Unbound models that are not made permanent will reset with the next call to Model::find() * * @param array $params Set of bindings to unbind (indexed by binding type) * @param boolean $reset Set to false to make the unbinding permanent * @return boolean Success * @link http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#creating-and-destroying-associations-on-the-fly */ public function unbindModel($params, $reset = true) { foreach ($params as $assoc => $models) { if ($reset === true && !isset($this->__backAssociation[$assoc])) { $this->__backAssociation[$assoc] = $this->{$assoc}; } $models = Hash::normalize((array)$models, false); foreach ($models as $model) { if ($reset === false && isset($this->__backAssociation[$assoc][$model])) { unset($this->__backAssociation[$assoc][$model]); } unset($this->{$assoc}[$model]); } } return true; } /** * Create a set of associations. * * @return void */ protected function _createLinks() { foreach ($this->_associations as $type) { $association =& $this->{$type}; if (!is_array($association)) { $association = explode(',', $association); foreach ($association as $i => $className) { $className = trim($className); unset ($association[$i]); $association[$className] = array(); } } if (!empty($association)) { foreach ($association as $assoc => $value) { $plugin = null; if (is_numeric($assoc)) { unset($association[$assoc]); $assoc = $value; $value = array(); if (strpos($assoc, '.') !== false) { list($plugin, $assoc) = pluginSplit($assoc, true); $association[$assoc] = array('className' => $plugin . $assoc); } else { $association[$assoc] = $value; } } $this->_generateAssociation($type, $assoc); } } } } /** * Protected helper method to create associated models of a given class. * * @param string $assoc Association name * @param string $className Class name * @param string $plugin name of the plugin where $className is located * examples: public $hasMany = array('Assoc' => array('className' => 'ModelName')); * usage: $this->Assoc->modelMethods(); * * public $hasMany = array('ModelName'); * usage: $this->ModelName->modelMethods(); * @return void */ protected function _constructLinkedModel($assoc, $className = null, $plugin = null) { if (empty($className)) { $className = $assoc; } if (!isset($this->{$assoc}) || $this->{$assoc}->name !== $className) { if ($plugin) { $plugin .= '.'; } $model = array('class' => $plugin . $className, 'alias' => $assoc); $this->{$assoc} = ClassRegistry::init($model); if ($plugin) { ClassRegistry::addObject($plugin . $className, $this->{$assoc}); } if ($assoc) { $this->tableToModel[$this->{$assoc}->table] = $assoc; } } } /** * Build an array-based association from string. * * @param string $type 'belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany' * @param string $assocKey * @return void */ protected function _generateAssociation($type, $assocKey) { $class = $assocKey; $dynamicWith = false; $assoc =& $this->{$type}[$assocKey]; foreach ($this->_associationKeys[$type] as $key) { if (!isset($assoc[$key]) || $assoc[$key] === null) { $data = ''; switch ($key) { case 'fields': $data = ''; break; case 'foreignKey': $data = (($type === 'belongsTo') ? Inflector::underscore($assocKey) : Inflector::singularize($this->table)) . '_id'; break; case 'associationForeignKey': $data = Inflector::singularize($this->{$class}->table) . '_id'; break; case 'with': $data = Inflector::camelize(Inflector::singularize($assoc['joinTable'])); $dynamicWith = true; break; case 'joinTable': $tables = array($this->table, $this->{$class}->table); sort($tables); $data = $tables[0] . '_' . $tables[1]; break; case 'className': $data = $class; break; case 'unique': $data = true; break; } $assoc[$key] = $data; } if ($dynamicWith) { $assoc['dynamicWith'] = true; } } } /** * Sets a custom table for your model class. Used by your controller to select a database table. * * @param string $tableName Name of the custom table * @throws MissingTableException when database table $tableName is not found on data source * @return void */ public function setSource($tableName) { $this->setDataSource($this->useDbConfig); $db = ConnectionManager::getDataSource($this->useDbConfig); if (method_exists($db, 'listSources')) { $restore = $db->cacheSources; $db->cacheSources = ($restore && $this->cacheSources); $sources = $db->listSources(); $db->cacheSources = $restore; if (is_array($sources) && !in_array(strtolower($this->tablePrefix . $tableName), array_map('strtolower', $sources))) { throw new MissingTableException(array( 'table' => $this->tablePrefix . $tableName, 'class' => $this->alias, 'ds' => $this->useDbConfig, )); } if ($sources) { $this->_schema = null; } } $this->table = $this->useTable = $tableName; $this->tableToModel[$this->table] = $this->alias; } /** * This function does two things: * * 1. it scans the array $one for the primary key, * and if that's found, it sets the current id to the value of $one[id]. * For all other keys than 'id' the keys and values of $one are copied to the 'data' property of this object. * 2. Returns an array with all of $one's keys and values. * (Alternative indata: two strings, which are mangled to * a one-item, two-dimensional array using $one for a key and $two as its value.) * * @param string|array|SimpleXmlElement|DomNode $one Array or string of data * @param string $two Value string for the alternative indata method * @return array Data with all of $one's keys and values * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html */ public function set($one, $two = null) { if (!$one) { return; } if (is_object($one)) { if ($one instanceof SimpleXMLElement || $one instanceof DOMNode) { $one = $this->_normalizeXmlData(Xml::toArray($one)); } else { $one = Set::reverse($one); } } if (is_array($one)) { $data = $one; if (empty($one[$this->alias])) { $data = $this->_setAliasData($one); } } else { $data = array($this->alias => array($one => $two)); } foreach ($data as $modelName => $fieldSet) { if (!is_array($fieldSet)) { continue; } foreach ($fieldSet as $fieldName => $fieldValue) { unset($this->validationErrors[$fieldName]); if ($modelName === $this->alias && $fieldName === $this->primaryKey) { $this->id = $fieldValue; } if (is_array($fieldValue) || is_object($fieldValue)) { $fieldValue = $this->deconstruct($fieldName, $fieldValue); } $this->data[$modelName][$fieldName] = $fieldValue; } } return $data; } /** * Move values to alias * * @param array $data * @return array */ protected function _setAliasData($data) { $models = array_keys($this->getAssociated()); $schema = array_keys((array)$this->schema()); foreach ($data as $field => $value) { if (in_array($field, $schema) || !in_array($field, $models)) { $data[$this->alias][$field] = $value; unset($data[$field]); } } return $data; } /** * Normalize `Xml::toArray()` to use in `Model::save()` * * @param array $xml XML as array * @return array */ protected function _normalizeXmlData(array $xml) { $return = array(); foreach ($xml as $key => $value) { if (is_array($value)) { $return[Inflector::camelize($key)] = $this->_normalizeXmlData($value); } elseif ($key[0] === '@') { $return[substr($key, 1)] = $value; } else { $return[$key] = $value; } } return $return; } /** * Deconstructs a complex data type (array or object) into a single field value. * * @param string $field The name of the field to be deconstructed * @param array|object $data An array or object to be deconstructed into a field * @return mixed The resulting data that should be assigned to a field */ public function deconstruct($field, $data) { if (!is_array($data)) { return $data; } $type = $this->getColumnType($field); if (!in_array($type, array('datetime', 'timestamp', 'date', 'time'))) { return $data; } $useNewDate = (isset($data['year']) || isset($data['month']) || isset($data['day']) || isset($data['hour']) || isset($data['minute'])); $dateFields = array('Y' => 'year', 'm' => 'month', 'd' => 'day', 'H' => 'hour', 'i' => 'min', 's' => 'sec'); $timeFields = array('H' => 'hour', 'i' => 'min', 's' => 'sec'); $date = array(); if (isset($data['meridian']) && empty($data['meridian'])) { return null; } if ( isset($data['hour']) && isset($data['meridian']) && !empty($data['hour']) && $data['hour'] != 12 && $data['meridian'] === 'pm' ) { $data['hour'] = $data['hour'] + 12; } if (isset($data['hour']) && isset($data['meridian']) && $data['hour'] == 12 && $data['meridian'] === 'am') { $data['hour'] = '00'; } if ($type === 'time') { foreach ($timeFields as $key => $val) { if (!isset($data[$val]) || $data[$val] === '0' || $data[$val] === '00') { $data[$val] = '00'; } elseif ($data[$val] !== '') { $data[$val] = sprintf('%02d', $data[$val]); } if (!empty($data[$val])) { $date[$key] = $data[$val]; } else { return null; } } } if ($type === 'datetime' || $type === 'timestamp' || $type === 'date') { foreach ($dateFields as $key => $val) { if ($val === 'hour' || $val === 'min' || $val === 'sec') { if (!isset($data[$val]) || $data[$val] === '0' || $data[$val] === '00') { $data[$val] = '00'; } else { $data[$val] = sprintf('%02d', $data[$val]); } } if (!isset($data[$val]) || isset($data[$val]) && (empty($data[$val]) || $data[$val][0] === '-')) { return null; } if (isset($data[$val]) && !empty($data[$val])) { $date[$key] = $data[$val]; } } } if ($useNewDate && !empty($date)) { $format = $this->getDataSource()->columns[$type]['format']; foreach (array('m', 'd', 'H', 'i', 's') as $index) { if (isset($date[$index])) { $date[$index] = sprintf('%02d', $date[$index]); } } return str_replace(array_keys($date), array_values($date), $format); } return $data; } /** * Returns an array of table metadata (column names and types) from the database. * $field => keys(type, null, default, key, length, extra) * * @param boolean|string $field Set to true to reload schema, or a string to return a specific field * @return array Array of table metadata */ public function schema($field = false) { if ($this->useTable !== false && (!is_array($this->_schema) || $field === true)) { $db = $this->getDataSource(); $db->cacheSources = ($this->cacheSources && $db->cacheSources); if (method_exists($db, 'describe')) { $this->_schema = $db->describe($this); } } if (!is_string($field)) { return $this->_schema; } if (isset($this->_schema[$field])) { return $this->_schema[$field]; } return null; } /** * Returns an associative array of field names and column types. * * @return array Field types indexed by field name */ public function getColumnTypes() { $columns = $this->schema(); if (empty($columns)) { trigger_error(__d('cake_dev', '(Model::getColumnTypes) Unable to build model field data. If you are using a model without a database table, try implementing schema()'), E_USER_WARNING); } $cols = array(); foreach ($columns as $field => $values) { $cols[$field] = $values['type']; } return $cols; } /** * Returns the column type of a column in the model. * * @param string $column The name of the model column * @return string Column type */ public function getColumnType($column) { $db = $this->getDataSource(); $cols = $this->schema(); $model = null; $startQuote = isset($db->startQuote) ? $db->startQuote : null; $endQuote = isset($db->endQuote) ? $db->endQuote : null; $column = str_replace(array($startQuote, $endQuote), '', $column); if (strpos($column, '.')) { list($model, $column) = explode('.', $column); } if (isset($model) && $model != $this->alias && isset($this->{$model})) { return $this->{$model}->getColumnType($column); } if (isset($cols[$column]) && isset($cols[$column]['type'])) { return $cols[$column]['type']; } return null; } /** * Returns true if the supplied field exists in the model's database table. * * @param string|array $name Name of field to look for, or an array of names * @param boolean $checkVirtual checks if the field is declared as virtual * @return mixed If $name is a string, returns a boolean indicating whether the field exists. * If $name is an array of field names, returns the first field that exists, * or false if none exist. */ public function hasField($name, $checkVirtual = false) { if (is_array($name)) { foreach ($name as $n) { if ($this->hasField($n, $checkVirtual)) { return $n; } } return false; } if ($checkVirtual && !empty($this->virtualFields) && $this->isVirtualField($name)) { return true; } if (empty($this->_schema)) { $this->schema(); } if ($this->_schema) { return isset($this->_schema[$name]); } return false; } /** * Check that a method is callable on a model. This will check both the model's own methods, its * inherited methods and methods that could be callable through behaviors. * * @param string $method The method to be called. * @return boolean True on method being callable. */ public function hasMethod($method) { if (method_exists($this, $method)) { return true; } return $this->Behaviors->hasMethod($method); } /** * Returns true if the supplied field is a model Virtual Field * * @param string $field Name of field to look for * @return boolean indicating whether the field exists as a model virtual field. */ public function isVirtualField($field) { if (empty($this->virtualFields) || !is_string($field)) { return false; } if (isset($this->virtualFields[$field])) { return true; } if (strpos($field, '.') !== false) { list($model, $field) = explode('.', $field); if ($model === $this->alias && isset($this->virtualFields[$field])) { return true; } } return false; } /** * Returns the expression for a model virtual field * * @param string $field Name of field to look for * @return mixed If $field is string expression bound to virtual field $field * If $field is null, returns an array of all model virtual fields * or false if none $field exist. */ public function getVirtualField($field = null) { if (!$field) { return empty($this->virtualFields) ? false : $this->virtualFields; } if ($this->isVirtualField($field)) { if (strpos($field, '.') !== false) { list(, $field) = pluginSplit($field); } return $this->virtualFields[$field]; } return false; } /** * Initializes the model for writing a new record, loading the default values * for those fields that are not defined in $data, and clearing previous validation errors. * Especially helpful for saving data in loops. * * @param boolean|array $data Optional data array to assign to the model after it is created. If null or false, * schema data defaults are not merged. * @param boolean $filterKey If true, overwrites any primary key input with an empty value * @return array The current Model::data; after merging $data and/or defaults from database * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-create-array-data-array */ public function create($data = array(), $filterKey = false) { $defaults = array(); $this->id = false; $this->data = array(); $this->validationErrors = array(); if ($data !== null && $data !== false) { $schema = (array)$this->schema(); foreach ($schema as $field => $properties) { if ($this->primaryKey !== $field && isset($properties['default']) && $properties['default'] !== '') { $defaults[$field] = $properties['default']; } } $this->set($defaults); $this->set($data); } if ($filterKey) { $this->set($this->primaryKey, false); } return $this->data; } /** * This function is a convenient wrapper class to create(false) and, as the name suggests, clears the id, data, and validation errors. * * @return boolean Always true upon success * @see Model::create() */ public function clear() { $this->create(false); return true; } /** * Returns a list of fields from the database, and sets the current model * data (Model::$data) with the record found. * * @param string|array $fields String of single field name, or an array of field names. * @param integer|string $id The ID of the record to read * @return array Array of database fields, or false if not found * @link http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#model-read */ public function read($fields = null, $id = null) { $this->validationErrors = array(); if ($id) { $this->id = $id; } $id = $this->id; if (is_array($this->id)) { $id = $this->id[0]; } if ($id !== null && $id !== false) { $this->data = $this->find('first', array( 'conditions' => array($this->alias . '.' . $this->primaryKey => $id), 'fields' => $fields )); return $this->data; } return false; } /** * Returns the contents of a single field given the supplied conditions, in the * supplied order. * * @param string $name Name of field to get * @param array $conditions SQL conditions (defaults to NULL) * @param string $order SQL ORDER BY fragment * @return string field contents, or false if not found * @link http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#model-field */ public function field($name, $conditions = null, $order = null) { if ($conditions === null && $this->id !== false) { $conditions = array($this->alias . '.' . $this->primaryKey => $this->id); } $recursive = $this->recursive; if ($this->recursive >= 1) { $recursive = -1; } $fields = $name; $data = $this->find('first', compact('conditions', 'fields', 'order', 'recursive')); if (!$data) { return false; } if (strpos($name, '.') === false) { if (isset($data[$this->alias][$name])) { return $data[$this->alias][$name]; } } else { $name = explode('.', $name); if (isset($data[$name[0]][$name[1]])) { return $data[$name[0]][$name[1]]; } } if (isset($data[0]) && count($data[0]) > 0) { return array_shift($data[0]); } } /** * Saves the value of a single field to the database, based on the current * model ID. * * @param string $name Name of the table field * @param mixed $value Value of the field * @param boolean|array $validate Either a boolean, or an array. * If a boolean, indicates whether or not to validate before saving. * If an array, allows control of 'validate', 'callbacks' and 'counterCache' options. * See Model::save() for details of each options. * @return boolean See Model::save() * @see Model::save() * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-savefield-string-fieldname-string-fieldvalue-validate-false */ public function saveField($name, $value, $validate = false) { $id = $this->id; $this->create(false); $options = array('validate' => $validate, 'fieldList' => array($name)); if (is_array($validate)) { $options = $validate + array('validate' => false, 'fieldList' => array($name)); } return $this->save(array($this->alias => array($this->primaryKey => $id, $name => $value)), $options); } /** * Saves model data (based on white-list, if supplied) to the database. By * default, validation occurs before save. * * @param array $data Data to save. * @param boolean|array $validate Either a boolean, or an array. * If a boolean, indicates whether or not to validate before saving. * If an array, can have following keys: * * - validate: Set to true/false to enable or disable validation. * - fieldList: An array of fields you want to allow for saving. * - callbacks: Set to false to disable callbacks. Using 'before' or 'after' * will enable only those callbacks. * - `counterCache`: Boolean to control updating of counter caches (if any) * * @param array $fieldList List of fields to allow to be saved * @return mixed On success Model::$data if its not empty or true, false on failure * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html */ public function save($data = null, $validate = true, $fieldList = array()) { $defaults = array( 'validate' => true, 'fieldList' => array(), 'callbacks' => true, 'counterCache' => true ); $_whitelist = $this->whitelist; $fields = array(); if (!is_array($validate)) { $options = compact('validate', 'fieldList') + $defaults; } else { $options = $validate + $defaults; } if (!empty($options['fieldList'])) { if (!empty($options['fieldList'][$this->alias]) && is_array($options['fieldList'][$this->alias])) { $this->whitelist = $options['fieldList'][$this->alias]; } elseif (Hash::dimensions($options['fieldList']) < 2) { $this->whitelist = $options['fieldList']; } } elseif ($options['fieldList'] === null) { $this->whitelist = array(); } $this->set($data); if (empty($this->data) && !$this->hasField(array('created', 'updated', 'modified'))) { $this->whitelist = $_whitelist; return false; } foreach (array('created', 'updated', 'modified') as $field) { $keyPresentAndEmpty = ( isset($this->data[$this->alias]) && array_key_exists($field, $this->data[$this->alias]) && $this->data[$this->alias][$field] === null ); if ($keyPresentAndEmpty) { unset($this->data[$this->alias][$field]); } } $exists = $this->exists(); $dateFields = array('modified', 'updated'); if (!$exists) { $dateFields[] = 'created'; } if (isset($this->data[$this->alias])) { $fields = array_keys($this->data[$this->alias]); } if ($options['validate'] && !$this->validates($options)) { $this->whitelist = $_whitelist; return false; } $db = $this->getDataSource(); $now = time(); foreach ($dateFields as $updateCol) { if (in_array($updateCol, $fields) || !$this->hasField($updateCol)) { continue; } $default = array('formatter' => 'date'); $colType = array_merge($default, $db->columns[$this->getColumnType($updateCol)]); $time = $now; if (array_key_exists('format', $colType)) { $time = call_user_func($colType['formatter'], $colType['format']); } if (!empty($this->whitelist)) { $this->whitelist[] = $updateCol; } $this->set($updateCol, $time); } if ($options['callbacks'] === true || $options['callbacks'] === 'before') { $event = new CakeEvent('Model.beforeSave', $this, array($options)); list($event->break, $event->breakOn) = array(true, array(false, null)); $this->getEventManager()->dispatch($event); if (!$event->result) { $this->whitelist = $_whitelist; return false; } } $db = $this->getDataSource(); if (empty($this->data[$this->alias][$this->primaryKey])) { unset($this->data[$this->alias][$this->primaryKey]); } $fields = $values = array(); foreach ($this->data as $n => $v) { if (isset($this->hasAndBelongsToMany[$n])) { if (isset($v[$n])) { $v = $v[$n]; } $joined[$n] = $v; } elseif ($n === $this->alias) { foreach (array('created', 'updated', 'modified') as $field) { if (array_key_exists($field, $v) && empty($v[$field])) { unset($v[$field]); } } foreach ($v as $x => $y) { if ($this->hasField($x) && (empty($this->whitelist) || in_array($x, $this->whitelist))) { list($fields[], $values[]) = array($x, $y); } } } } $count = count($fields); if (!$exists && $count > 0) { $this->id = false; } $success = true; $created = false; if ($count > 0) { $cache = $this->_prepareUpdateFields(array_combine($fields, $values)); if (!empty($this->id)) { $success = (bool)$db->update($this, $fields, $values); } else { if (empty($this->data[$this->alias][$this->primaryKey]) && $this->_isUUIDField($this->primaryKey)) { if (array_key_exists($this->primaryKey, $this->data[$this->alias])) { $j = array_search($this->primaryKey, $fields); $values[$j] = String::uuid(); } else { list($fields[], $values[]) = array($this->primaryKey, String::uuid()); } } if (!$db->create($this, $fields, $values)) { $success = false; } else { $created = true; } } if ($success && $options['counterCache'] && !empty($this->belongsTo)) { $this->updateCounterCache($cache, $created); } } if (!empty($joined) && $success === true) { $this->_saveMulti($joined, $this->id, $db); } if ($success && $count === 0) { $success = false; } if ($success && $count > 0) { if (!empty($this->data)) { if ($created) { $this->data[$this->alias][$this->primaryKey] = $this->id; } } if ($options['callbacks'] === true || $options['callbacks'] === 'after') { $event = new CakeEvent('Model.afterSave', $this, array($created, $options)); $this->getEventManager()->dispatch($event); } if (!empty($this->data)) { $success = $this->data; } $this->_clearCache(); $this->validationErrors = array(); $this->data = false; } $this->whitelist = $_whitelist; return $success; } /** * Check if the passed in field is a UUID field * * @param string $field the field to check * @return boolean */ protected function _isUUIDField($field) { $field = $this->schema($field); return $field['length'] == 36 && in_array($field['type'], array('string', 'binary')); } /** * Saves model hasAndBelongsToMany data to the database. * * @param array $joined Data to save * @param integer|string $id ID of record in this model * @param DataSource $db * @return void */ protected function _saveMulti($joined, $id, $db) { foreach ($joined as $assoc => $data) { if (!isset($this->hasAndBelongsToMany[$assoc])) { continue; } $habtm = $this->hasAndBelongsToMany[$assoc]; list($join) = $this->joinModel($habtm['with']); $Model = $this->{$join}; if (!empty($habtm['with'])) { $withModel = is_array($habtm['with']) ? key($habtm['with']) : $habtm['with']; list(, $withModel) = pluginSplit($withModel); $dbMulti = $this->{$withModel}->getDataSource(); } else { $dbMulti = $db; } $isUUID = !empty($Model->primaryKey) && $Model->_isUUIDField($Model->primaryKey); $newData = $newValues = $newJoins = array(); $primaryAdded = false; $fields = array( $dbMulti->name($habtm['foreignKey']), $dbMulti->name($habtm['associationForeignKey']) ); $idField = $db->name($Model->primaryKey); if ($isUUID && !in_array($idField, $fields)) { $fields[] = $idField; $primaryAdded = true; } foreach ((array)$data as $row) { if ((is_string($row) && (strlen($row) === 36 || strlen($row) === 16)) || is_numeric($row)) { $newJoins[] = $row; $values = array($id, $row); if ($isUUID && $primaryAdded) { $values[] = String::uuid(); } $newValues[$row] = $values; unset($values); } elseif (isset($row[$habtm['associationForeignKey']])) { if (!empty($row[$Model->primaryKey])) { $newJoins[] = $row[$habtm['associationForeignKey']]; } $newData[] = $row; } elseif (isset($row[$join]) && isset($row[$join][$habtm['associationForeignKey']])) { if (!empty($row[$join][$Model->primaryKey])) { $newJoins[] = $row[$join][$habtm['associationForeignKey']]; } $newData[] = $row[$join]; } } $keepExisting = $habtm['unique'] === 'keepExisting'; if ($habtm['unique']) { $conditions = array( $join . '.' . $habtm['foreignKey'] => $id ); if (!empty($habtm['conditions'])) { $conditions = array_merge($conditions, (array)$habtm['conditions']); } $associationForeignKey = $Model->alias . '.' . $habtm['associationForeignKey']; $links = $Model->find('all', array( 'conditions' => $conditions, 'recursive' => empty($habtm['conditions']) ? -1 : 0, 'fields' => $associationForeignKey, )); $oldLinks = Hash::extract($links, "{n}.{$associationForeignKey}"); if (!empty($oldLinks)) { if ($keepExisting && !empty($newJoins)) { $conditions[$associationForeignKey] = array_diff($oldLinks, $newJoins); } else { $conditions[$associationForeignKey] = $oldLinks; } $dbMulti->delete($Model, $conditions); } } if (!empty($newData)) { foreach ($newData as $data) { $data[$habtm['foreignKey']] = $id; if (empty($data[$Model->primaryKey])) { $Model->create(); } $Model->save($data); } } if (!empty($newValues)) { if ($keepExisting && !empty($links)) { foreach ($links as $link) { $oldJoin = $link[$join][$habtm['associationForeignKey']]; if (!in_array($oldJoin, $newJoins)) { $conditions[$associationForeignKey] = $oldJoin; $db->delete($Model, $conditions); } else { unset($newValues[$oldJoin]); } } $newValues = array_values($newValues); } if (!empty($newValues)) { $dbMulti->insertMulti($Model, $fields, $newValues); } } } } /** * Updates the counter cache of belongsTo associations after a save or delete operation * * @param array $keys Optional foreign key data, defaults to the information $this->data * @param boolean $created True if a new record was created, otherwise only associations with * 'counterScope' defined get updated * @return void */ public function updateCounterCache($keys = array(), $created = false) { if (empty($keys) && isset($this->data[$this->alias])) { $keys = $this->data[$this->alias]; } $keys['old'] = isset($keys['old']) ? $keys['old'] : array(); foreach ($this->belongsTo as $parent => $assoc) { if (empty($assoc['counterCache'])) { continue; } $Model = $this->{$parent}; if (!is_array($assoc['counterCache'])) { if (isset($assoc['counterScope'])) { $assoc['counterCache'] = array($assoc['counterCache'] => $assoc['counterScope']); } else { $assoc['counterCache'] = array($assoc['counterCache'] => array()); } } $foreignKey = $assoc['foreignKey']; $fkQuoted = $this->escapeField($assoc['foreignKey']); foreach ($assoc['counterCache'] as $field => $conditions) { if (!is_string($field)) { $field = Inflector::underscore($this->alias) . '_count'; } if (!$Model->hasField($field)) { continue; } if ($conditions === true) { $conditions = array(); } else { $conditions = (array)$conditions; } if (!array_key_exists($foreignKey, $keys)) { $keys[$foreignKey] = $this->field($foreignKey); } $recursive = (empty($conditions) ? -1 : 0); if (isset($keys['old'][$foreignKey]) && $keys['old'][$foreignKey] != $keys[$foreignKey]) { $conditions[$fkQuoted] = $keys['old'][$foreignKey]; $count = intval($this->find('count', compact('conditions', 'recursive'))); $Model->updateAll( array($field => $count), array($Model->escapeField() => $keys['old'][$foreignKey]) ); } $conditions[$fkQuoted] = $keys[$foreignKey]; if ($recursive === 0) { $conditions = array_merge($conditions, (array)$conditions); } $count = intval($this->find('count', compact('conditions', 'recursive'))); $Model->updateAll( array($field => $count), array($Model->escapeField() => $keys[$foreignKey]) ); } } } /** * Helper method for `Model::updateCounterCache()`. Checks the fields to be updated for * * @param array $data The fields of the record that will be updated * @return array Returns updated foreign key values, along with an 'old' key containing the old * values, or empty if no foreign keys are updated. */ protected function _prepareUpdateFields($data) { $foreignKeys = array(); foreach ($this->belongsTo as $assoc => $info) { if (isset($info['counterCache']) && $info['counterCache']) { $foreignKeys[$assoc] = $info['foreignKey']; } } $included = array_intersect($foreignKeys, array_keys($data)); if (empty($included) || empty($this->id)) { return array(); } $old = $this->find('first', array( 'conditions' => array($this->alias . '.' . $this->primaryKey => $this->id), 'fields' => array_values($included), 'recursive' => -1 )); return array_merge($data, array('old' => $old[$this->alias])); } /** * Backwards compatible passthrough method for: * saveMany(), validateMany(), saveAssociated() and validateAssociated() * * Saves multiple individual records for a single model; Also works with a single record, as well as * all its associated records. * * #### Options * * - `validate`: Set to false to disable validation, true to validate each record before saving, * 'first' to validate *all* records before any are saved (default), * or 'only' to only validate the records, but not save them. * - `atomic`: If true (default), will attempt to save all records in a single transaction. * Should be set to false if database/table does not support transactions. * - `fieldList`: Equivalent to the $fieldList parameter in Model::save(). * It should be an associate array with model name as key and array of fields as value. Eg. * {{{ * array( * 'SomeModel' => array('field'), * 'AssociatedModel' => array('field', 'otherfield') * ) * }}} * - `deep`: See saveMany/saveAssociated * - `callbacks`: See Model::save() * - `counterCache`: See Model::save() * * @param array $data Record data to save. This can be either a numerically-indexed array (for saving multiple * records of the same type), or an array indexed by association name. * @param array $options Options to use when saving record data, See $options above. * @return mixed If atomic: True on success, or false on failure. * Otherwise: array similar to the $data array passed, but values are set to true/false * depending on whether each record saved successfully. * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-saveassociated-array-data-null-array-options-array * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-saveall-array-data-null-array-options-array */ public function saveAll($data = array(), $options = array()) { $options += array('validate' => 'first'); if (Hash::numeric(array_keys($data))) { if ($options['validate'] === 'only') { return $this->validateMany($data, $options); } return $this->saveMany($data, $options); } if ($options['validate'] === 'only') { return $this->validateAssociated($data, $options); } return $this->saveAssociated($data, $options); } /** * Saves multiple individual records for a single model * * #### Options * * - `validate`: Set to false to disable validation, true to validate each record before saving, * 'first' to validate *all* records before any are saved (default), * - `atomic`: If true (default), will attempt to save all records in a single transaction. * Should be set to false if database/table does not support transactions. * - `fieldList`: Equivalent to the $fieldList parameter in Model::save() * - `deep`: If set to true, all associated data will be saved as well. * - `callbacks`: See Model::save() * - `counterCache`: See Model::save() * * @param array $data Record data to save. This should be a numerically-indexed array * @param array $options Options to use when saving record data, See $options above. * @return mixed If atomic: True on success, or false on failure. * Otherwise: array similar to the $data array passed, but values are set to true/false * depending on whether each record saved successfully. * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-savemany-array-data-null-array-options-array */ public function saveMany($data = null, $options = array()) { if (empty($data)) { $data = $this->data; } $options += array('validate' => 'first', 'atomic' => true, 'deep' => false); $this->validationErrors = $validationErrors = array(); if (empty($data) && $options['validate'] !== false) { $result = $this->save($data, $options); if (!$options['atomic']) { return array(!empty($result)); } return !empty($result); } if ($options['validate'] === 'first') { $validates = $this->validateMany($data, $options); if ((!$validates && $options['atomic']) || (!$options['atomic'] && in_array(false, $validates, true))) { return $validates; } $options['validate'] = false; } if ($options['atomic']) { $db = $this->getDataSource(); $transactionBegun = $db->begin(); } $return = array(); foreach ($data as $key => $record) { $validates = $this->create(null) !== null; $saved = false; if ($validates) { if ($options['deep']) { $saved = $this->saveAssociated($record, array_merge($options, array('atomic' => false))); } else { $saved = $this->save($record, $options); } } $validates = ($validates && ($saved === true || (is_array($saved) && !in_array(false, $saved, true)))); if (!$validates) { $validationErrors[$key] = $this->validationErrors; } if (!$options['atomic']) { $return[$key] = $validates; } elseif (!$validates) { break; } } $this->validationErrors = $validationErrors; if (!$options['atomic']) { return $return; } if ($validates) { if ($transactionBegun) { return $db->commit() !== false; } return true; } $db->rollback(); return false; } /** * Validates multiple individual records for a single model * * #### Options * * - `atomic`: If true (default), returns boolean. If false returns array. * - `fieldList`: Equivalent to the $fieldList parameter in Model::save() * - `deep`: If set to true, all associated data will be validated as well. * * Warning: This method could potentially change the passed argument `$data`, * If you do not want this to happen, make a copy of `$data` before passing it * to this method * * @param array $data Record data to validate. This should be a numerically-indexed array * @param array $options Options to use when validating record data (see above), See also $options of validates(). * @return boolean|array If atomic: True on success, or false on failure. * Otherwise: array similar to the $data array passed, but values are set to true/false * depending on whether each record validated successfully. */ public function validateMany(&$data, $options = array()) { return $this->validator()->validateMany($data, $options); } /** * Saves a single record, as well as all its directly associated records. * * #### Options * * - `validate`: Set to `false` to disable validation, `true` to validate each record before saving, * 'first' to validate *all* records before any are saved(default), * - `atomic`: If true (default), will attempt to save all records in a single transaction. * Should be set to false if database/table does not support transactions. * - `fieldList`: Equivalent to the $fieldList parameter in Model::save(). * It should be an associate array with model name as key and array of fields as value. Eg. * {{{ * array( * 'SomeModel' => array('field'), * 'AssociatedModel' => array('field', 'otherfield') * ) * }}} * - `deep`: If set to true, not only directly associated data is saved, but deeper nested associated data as well. * - `callbacks`: See Model::save() * - `counterCache`: See Model::save() * * @param array $data Record data to save. This should be an array indexed by association name. * @param array $options Options to use when saving record data, See $options above. * @return mixed If atomic: True on success, or false on failure. * Otherwise: array similar to the $data array passed, but values are set to true/false * depending on whether each record saved successfully. * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-saveassociated-array-data-null-array-options-array */ public function saveAssociated($data = null, $options = array()) { if (empty($data)) { $data = $this->data; } $options += array('validate' => 'first', 'atomic' => true, 'deep' => false); $this->validationErrors = $validationErrors = array(); if (empty($data) && $options['validate'] !== false) { $result = $this->save($data, $options); if (!$options['atomic']) { return array(!empty($result)); } return !empty($result); } if ($options['validate'] === 'first') { $validates = $this->validateAssociated($data, $options); if ((!$validates && $options['atomic']) || (!$options['atomic'] && in_array(false, Hash::flatten($validates), true))) { return $validates; } $options['validate'] = false; } if ($options['atomic']) { $db = $this->getDataSource(); $transactionBegun = $db->begin(); } $associations = $this->getAssociated(); $return = array(); $validates = true; foreach ($data as $association => $values) { $isEmpty = empty($values) || (isset($values[$association]) && empty($values[$association])); if ($isEmpty || !isset($associations[$association]) || $associations[$association] !== 'belongsTo') { continue; } $Model = $this->{$association}; $validates = $Model->create(null) !== null; $saved = false; if ($validates) { if ($options['deep']) { $saved = $Model->saveAssociated($values, array('atomic' => false) + $options); } else { $saved = $Model->save($values, array('atomic' => false) + $options); } $validates = ($saved === true || (is_array($saved) && !in_array(false, $saved, true))); } if ($validates) { $key = $this->belongsTo[$association]['foreignKey']; if (isset($data[$this->alias])) { $data[$this->alias][$key] = $Model->id; } else { $data = array_merge(array($key => $Model->id), $data, array($key => $Model->id)); } $options = $this->_addToWhiteList($key, $options); } else { $validationErrors[$association] = $Model->validationErrors; } $return[$association] = $validates; } if ($validates && !($this->create(null) !== null && $this->save($data, $options))) { $validationErrors[$this->alias] = $this->validationErrors; $validates = false; } $return[$this->alias] = $validates; foreach ($data as $association => $values) { if (!$validates) { break; } $isEmpty = empty($values) || (isset($values[$association]) && empty($values[$association])); if ($isEmpty || !isset($associations[$association])) { continue; } $Model = $this->{$association}; $type = $associations[$association]; $key = $this->{$type}[$association]['foreignKey']; switch ($type) { case 'hasOne': if (isset($values[$association])) { $values[$association][$key] = $this->id; } else { $values = array_merge(array($key => $this->id), $values, array($key => $this->id)); } $validates = $Model->create(null) !== null; $saved = false; if ($validates) { $options = $Model->_addToWhiteList($key, $options); if ($options['deep']) { $saved = $Model->saveAssociated($values, array('atomic' => false) + $options); } else { $saved = $Model->save($values, $options); } } $validates = ($validates && ($saved === true || (is_array($saved) && !in_array(false, $saved, true)))); if (!$validates) { $validationErrors[$association] = $Model->validationErrors; } $return[$association] = $validates; break; case 'hasMany': foreach ($values as $i => $value) { if (isset($values[$i][$association])) { $values[$i][$association][$key] = $this->id; } else { $values[$i] = array_merge(array($key => $this->id), $value, array($key => $this->id)); } } $options = $Model->_addToWhiteList($key, $options); $_return = $Model->saveMany($values, array('atomic' => false) + $options); if (in_array(false, $_return, true)) { $validationErrors[$association] = $Model->validationErrors; $validates = false; } $return[$association] = $_return; break; } } $this->validationErrors = $validationErrors; if (isset($validationErrors[$this->alias])) { $this->validationErrors = $validationErrors[$this->alias]; unset($validationErrors[$this->alias]); $this->validationErrors = array_merge($this->validationErrors, $validationErrors); } if (!$options['atomic']) { return $return; } if ($validates) { if ($transactionBegun) { return $db->commit() !== false; } return true; } $db->rollback(); return false; } /** * Helper method for saveAll() and friends, to add foreign key to fieldlist * * @param string $key fieldname to be added to list * @param array $options * @return array $options */ protected function _addToWhiteList($key, $options) { if (empty($options['fieldList']) && $this->whitelist && !in_array($key, $this->whitelist)) { $options['fieldList'][$this->alias] = $this->whitelist; $options['fieldList'][$this->alias][] = $key; return $options; } if (!empty($options['fieldList'][$this->alias]) && is_array($options['fieldList'][$this->alias])) { $options['fieldList'][$this->alias][] = $key; return $options; } if (!empty($options['fieldList']) && is_array($options['fieldList']) && Hash::dimensions($options['fieldList']) < 2) { $options['fieldList'][] = $key; } return $options; } /** * Validates a single record, as well as all its directly associated records. * * #### Options * * - `atomic`: If true (default), returns boolean. If false returns array. * - `fieldList`: Equivalent to the $fieldList parameter in Model::save() * - `deep`: If set to true, not only directly associated data , but deeper nested associated data is validated as well. * * Warning: This method could potentially change the passed argument `$data`, * If you do not want this to happen, make a copy of `$data` before passing it * to this method * * @param array $data Record data to validate. This should be an array indexed by association name. * @param array $options Options to use when validating record data (see above), See also $options of validates(). * @return array|boolean If atomic: True on success, or false on failure. * Otherwise: array similar to the $data array passed, but values are set to true/false * depending on whether each record validated successfully. */ public function validateAssociated(&$data, $options = array()) { return $this->validator()->validateAssociated($data, $options); } /** * Updates multiple model records based on a set of conditions. * * @param array $fields Set of fields and values, indexed by fields. * Fields are treated as SQL snippets, to insert literal values manually escape your data. * @param mixed $conditions Conditions to match, true for all records * @return boolean True on success, false on failure * @link http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-updateall-array-fields-array-conditions */ public function updateAll($fields, $conditions = true) { return $this->getDataSource()->update($this, $fields, null, $conditions); } /** * Removes record for given ID. If no ID is given, the current ID is used. Returns true on success. * * @param integer|string $id ID of record to delete * @param boolean $cascade Set to true to delete records that depend on this record * @return boolean True on success * @link http://book.cakephp.org/2.0/en/models/deleting-data.html */ public function delete($id = null, $cascade = true) { if (!empty($id)) { $this->id = $id; } $id = $this->id; $event = new CakeEvent('Model.beforeDelete', $this, array($cascade)); list($event->break, $event->breakOn) = array(true, array(false, null)); $this->getEventManager()->dispatch($event); if ($event->isStopped()) { return false; } if (!$this->exists()) { return false; } $this->_deleteDependent($id, $cascade); $this->_deleteLinks($id); $this->id = $id; if (!empty($this->belongsTo)) { foreach ($this->belongsTo as $assoc) { if (empty($assoc['counterCache'])) { continue; } $keys = $this->find('first', array( 'fields' => $this->_collectForeignKeys(), 'conditions' => array($this->alias . '.' . $this->primaryKey => $id), 'recursive' => -1, 'callbacks' => false )); break; } } if (!$this->getDataSource()->delete($this, array($this->alias . '.' . $this->primaryKey => $id))) { return false; } if (!empty($keys[$this->alias])) { $this->updateCounterCache($keys[$this->alias]); } $this->getEventManager()->dispatch(new CakeEvent('Model.afterDelete', $this)); $this->_clearCache(); $this->id = false; return true; } /** * Cascades model deletes through associated hasMany and hasOne child records. * * @param string $id ID of record that was deleted * @param boolean $cascade Set to true to delete records that depend on this record * @return void */ protected function _deleteDependent($id, $cascade) { if ($cascade !== true) { return; } if (!empty($this->__backAssociation)) { $savedAssociations = $this->__backAssociation; $this->__backAssociation = array(); } foreach (array_merge($this->hasMany, $this->hasOne) as $assoc => $data) { if ($data['dependent'] !== true) { continue; } $Model = $this->{$assoc}; if ($data['foreignKey'] === false && $data['conditions'] && in_array($this->name, $Model->getAssociated('belongsTo'))) { $Model->recursive = 0; $conditions = array($this->escapeField(null, $this->name) => $id); } else { $Model->recursive = -1; $conditions = array($Model->escapeField($data['foreignKey']) => $id); if ($data['conditions']) { $conditions = array_merge((array)$data['conditions'], $conditions); } } if (isset($data['exclusive']) && $data['exclusive']) { $Model->deleteAll($conditions); } else { $records = $Model->find('all', array( 'conditions' => $conditions, 'fields' => $Model->primaryKey )); if (!empty($records)) { foreach ($records as $record) { $Model->delete($record[$Model->alias][$Model->primaryKey]); } } } } if (isset($savedAssociations)) { $this->__backAssociation = $savedAssociations; } } /** * Cascades model deletes through HABTM join keys. * * @param string $id ID of record that was deleted * @return void */ protected function _deleteLinks($id) { foreach ($this->hasAndBelongsToMany as $data) { list(, $joinModel) = pluginSplit($data['with']); $Model = $this->{$joinModel}; $records = $Model->find('all', array( 'conditions' => array($Model->escapeField($data['foreignKey']) => $id), 'fields' => $Model->primaryKey, 'recursive' => -1, 'callbacks' => false )); if (!empty($records)) { foreach ($records as $record) { $Model->delete($record[$Model->alias][$Model->primaryKey]); } } } } /** * Deletes multiple model records based on a set of conditions. * * @param mixed $conditions Conditions to match * @param boolean $cascade Set to true to delete records that depend on this record * @param boolean $callbacks Run callbacks * @return boolean True on success, false on failure * @link http://book.cakephp.org/2.0/en/models/deleting-data.html#deleteall */ public function deleteAll($conditions, $cascade = true, $callbacks = false) { if (empty($conditions)) { return false; } $db = $this->getDataSource(); if (!$cascade && !$callbacks) { return $db->delete($this, $conditions); } $ids = $this->find('all', array_merge(array( 'fields' => "{$this->alias}.{$this->primaryKey}", 'order' => false, 'group' => "{$this->alias}.{$this->primaryKey}", 'recursive' => 0), compact('conditions')) ); if ($ids === false || $ids === null) { return false; } $ids = Hash::extract($ids, "{n}.{$this->alias}.{$this->primaryKey}"); if (empty($ids)) { return true; } if ($callbacks) { $_id = $this->id; $result = true; foreach ($ids as $id) { $result = $result && $this->delete($id, $cascade); } $this->id = $_id; return $result; } foreach ($ids as $id) { $this->_deleteLinks($id); if ($cascade) { $this->_deleteDependent($id, $cascade); } } return $db->delete($this, array($this->alias . '.' . $this->primaryKey => $ids)); } /** * Collects foreign keys from associations. * * @param string $type * @return array */ protected function _collectForeignKeys($type = 'belongsTo') { $result = array(); foreach ($this->{$type} as $assoc => $data) { if (isset($data['foreignKey']) && is_string($data['foreignKey'])) { $result[$assoc] = $data['foreignKey']; } } return $result; } /** * Returns true if a record with particular ID exists. * * If $id is not passed it calls `Model::getID()` to obtain the current record ID, * and then performs a `Model::find('count')` on the currently configured datasource * to ascertain the existence of the record in persistent storage. * * @param integer|string $id ID of record to check for existence * @return boolean True if such a record exists */ public function exists($id = null) { if ($id === null) { $id = $this->getID(); } if ($id === false) { return false; } return (bool)$this->find('count', array( 'conditions' => array( $this->alias . '.' . $this->primaryKey => $id ), 'recursive' => -1, 'callbacks' => false )); } /** * Returns true if a record that meets given conditions exists. * * @param array $conditions SQL conditions array * @return boolean True if such a record exists */ public function hasAny($conditions = null) { return (bool)$this->find('count', array('conditions' => $conditions, 'recursive' => -1)); } /** * Queries the datasource and returns a result set array. * * Used to perform find operations, where the first argument is type of find operation to perform * (all / first / count / neighbors / list / threaded), * second parameter options for finding (indexed array, including: 'conditions', 'limit', * 'recursive', 'page', 'fields', 'offset', 'order', 'callbacks') * * Eg: * {{{ * $model->find('all', array( * 'conditions' => array('name' => 'Thomas Anderson'), * 'fields' => array('name', 'email'), * 'order' => 'field3 DESC', * 'recursive' => 2, * 'group' => 'type', * 'callbacks' => false, * )); * }}} * * In addition to the standard query keys above, you can provide Datasource, and behavior specific * keys. For example, when using a SQL based datasource you can use the joins key to specify additional * joins that should be part of the query. * * {{{ * $model->find('all', array( * 'conditions' => array('name' => 'Thomas Anderson'), * 'joins' => array( * array( * 'alias' => 'Thought', * 'table' => 'thoughts', * 'type' => 'LEFT', * 'conditions' => '`Thought`.`person_id` = `Person`.`id`' * ) * ) * )); * }}} * * ### Disabling callbacks * * The `callbacks` key allows you to disable or specify the callbacks that should be run. To * disable beforeFind & afterFind callbacks set `'callbacks' => false` in your options. You can * also set the callbacks option to 'before' or 'after' to enable only the specified callback. * * ### Adding new find types * * Behaviors and find types can also define custom finder keys which are passed into find(). * See the documentation for custom find types * (http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#creating-custom-find-types) * for how to implement custom find types. * * Specifying 'fields' for notation 'list': * * - If no fields are specified, then 'id' is used for key and 'model->displayField' is used for value. * - If a single field is specified, 'id' is used for key and specified field is used for value. * - If three fields are specified, they are used (in order) for key, value and group. * - Otherwise, first and second fields are used for key and value. * * Note: find(list) + database views have issues with MySQL 5.0. Try upgrading to MySQL 5.1 if you * have issues with database views. * * Note: find(count) has its own return values. * * @param string $type Type of find operation (all / first / count / neighbors / list / threaded) * @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks) * @return array Array of records, or Null on failure. * @link http://book.cakephp.org/2.0/en/models/retrieving-your-data.html */ public function find($type = 'first', $query = array()) { $this->findQueryType = $type; $this->id = $this->getID(); $query = $this->buildQuery($type, $query); if ($query === null) { return null; } return $this->_readDataSource($type, $query); } /** * Read from the datasource * * Model::_readDataSource() is used by all find() calls to read from the data source and can be overloaded to allow * caching of datasource calls. * * {{{ * protected function _readDataSource($type, $query) { * $cacheName = md5(json_encode($query)); * $cache = Cache::read($cacheName, 'cache-config-name'); * if ($cache !== false) { * return $cache; * } * * $results = parent::_readDataSource($type, $query); * Cache::write($cacheName, $results, 'cache-config-name'); * return $results; * } * }}} * * @param string $type Type of find operation (all / first / count / neighbors / list / threaded) * @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks) * @return array */ protected function _readDataSource($type, $query) { $results = $this->getDataSource()->read($this, $query); $this->resetAssociations(); if ($query['callbacks'] === true || $query['callbacks'] === 'after') { $results = $this->_filterResults($results); } $this->findQueryType = null; if ($this->findMethods[$type] === true) { return $this->{'_find' . ucfirst($type)}('after', $query, $results); } } /** * Builds the query array that is used by the data source to generate the query to fetch the data. * * @param string $type Type of find operation (all / first / count / neighbors / list / threaded) * @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks) * @return array Query array or null if it could not be build for some reasons * @see Model::find() */ public function buildQuery($type = 'first', $query = array()) { $query = array_merge( array( 'conditions' => null, 'fields' => null, 'joins' => array(), 'limit' => null, 'offset' => null, 'order' => null, 'page' => 1, 'group' => null, 'callbacks' => true, ), (array)$query ); if ($this->findMethods[$type] === true) { $query = $this->{'_find' . ucfirst($type)}('before', $query); } if (!is_numeric($query['page']) || intval($query['page']) < 1) { $query['page'] = 1; } if ($query['page'] > 1 && !empty($query['limit'])) { $query['offset'] = ($query['page'] - 1) * $query['limit']; } if ($query['order'] === null && $this->order !== null) { $query['order'] = $this->order; } $query['order'] = array($query['order']); if ($query['callbacks'] === true || $query['callbacks'] === 'before') { $event = new CakeEvent('Model.beforeFind', $this, array($query)); list($event->break, $event->breakOn, $event->modParams) = array(true, array(false, null), 0); $this->getEventManager()->dispatch($event); if ($event->isStopped()) { return null; } $query = $event->result === true ? $event->data[0] : $event->result; } return $query; } /** * Handles the before/after filter logic for find('all') operations. Only called by Model::find(). * * @param string $state Either "before" or "after" * @param array $query * @param array $results * @return array * @see Model::find() */ protected function _findAll($state, $query, $results = array()) { if ($state === 'before') { return $query; } return $results; } /** * Handles the before/after filter logic for find('first') operations. Only called by Model::find(). * * @param string $state Either "before" or "after" * @param array $query * @param array $results * @return array * @see Model::find() */ protected function _findFirst($state, $query, $results = array()) { if ($state === 'before') { $query['limit'] = 1; return $query; } if (empty($results[0])) { return array(); } return $results[0]; } /** * Handles the before/after filter logic for find('count') operations. Only called by Model::find(). * * @param string $state Either "before" or "after" * @param array $query * @param array $results * @return integer The number of records found, or false * @see Model::find() */ protected function _findCount($state, $query, $results = array()) { if ($state === 'before') { if (!empty($query['type']) && isset($this->findMethods[$query['type']]) && $query['type'] !== 'count') { $query['operation'] = 'count'; $query = $this->{'_find' . ucfirst($query['type'])}('before', $query); } $db = $this->getDataSource(); $query['order'] = false; if (!method_exists($db, 'calculate')) { return $query; } if (!empty($query['fields']) && is_array($query['fields'])) { if (!preg_match('/^count/i', current($query['fields']))) { unset($query['fields']); } } if (empty($query['fields'])) { $query['fields'] = $db->calculate($this, 'count'); } elseif (method_exists($db, 'expression') && is_string($query['fields']) && !preg_match('/count/i', $query['fields'])) { $query['fields'] = $db->calculate($this, 'count', array( $db->expression($query['fields']), 'count' )); } return $query; } foreach (array(0, $this->alias) as $key) { if (isset($results[0][$key]['count'])) { if ($query['group']) { return count($results); } return intval($results[0][$key]['count']); } } return false; } /** * Handles the before/after filter logic for find('list') operations. Only called by Model::find(). * * @param string $state Either "before" or "after" * @param array $query * @param array $results * @return array Key/value pairs of primary keys/display field values of all records found * @see Model::find() */ protected function _findList($state, $query, $results = array()) { if ($state === 'before') { if (empty($query['fields'])) { $query['fields'] = array("{$this->alias}.{$this->primaryKey}", "{$this->alias}.{$this->displayField}"); $list = array("{n}.{$this->alias}.{$this->primaryKey}", "{n}.{$this->alias}.{$this->displayField}", null); } else { if (!is_array($query['fields'])) { $query['fields'] = String::tokenize($query['fields']); } if (count($query['fields']) === 1) { if (strpos($query['fields'][0], '.') === false) { $query['fields'][0] = $this->alias . '.' . $query['fields'][0]; } $list = array("{n}.{$this->alias}.{$this->primaryKey}", '{n}.' . $query['fields'][0], null); $query['fields'] = array("{$this->alias}.{$this->primaryKey}", $query['fields'][0]); } elseif (count($query['fields']) === 3) { for ($i = 0; $i < 3; $i++) { if (strpos($query['fields'][$i], '.') === false) { $query['fields'][$i] = $this->alias . '.' . $query['fields'][$i]; } } $list = array('{n}.' . $query['fields'][0], '{n}.' . $query['fields'][1], '{n}.' . $query['fields'][2]); } else { for ($i = 0; $i < 2; $i++) { if (strpos($query['fields'][$i], '.') === false) { $query['fields'][$i] = $this->alias . '.' . $query['fields'][$i]; } } $list = array('{n}.' . $query['fields'][0], '{n}.' . $query['fields'][1], null); } } if (!isset($query['recursive']) || $query['recursive'] === null) { $query['recursive'] = -1; } list($query['list']['keyPath'], $query['list']['valuePath'], $query['list']['groupPath']) = $list; return $query; } if (empty($results)) { return array(); } return Hash::combine($results, $query['list']['keyPath'], $query['list']['valuePath'], $query['list']['groupPath']); } /** * Detects the previous field's value, then uses logic to find the 'wrapping' * rows and return them. * * @param string $state Either "before" or "after" * @param array $query * @param array $results * @return array */ protected function _findNeighbors($state, $query, $results = array()) { extract($query); if ($state === 'before') { $conditions = (array)$conditions; if (isset($field) && isset($value)) { if (strpos($field, '.') === false) { $field = $this->alias . '.' . $field; } } else { $field = $this->alias . '.' . $this->primaryKey; $value = $this->id; } $query['conditions'] = array_merge($conditions, array($field . ' <' => $value)); $query['order'] = $field . ' DESC'; $query['limit'] = 1; $query['field'] = $field; $query['value'] = $value; return $query; } unset($query['conditions'][$field . ' <']); $return = array(); if (isset($results[0])) { $prevVal = Hash::get($results[0], $field); $query['conditions'][$field . ' >='] = $prevVal; $query['conditions'][$field . ' !='] = $value; $query['limit'] = 2; } else { $return['prev'] = null; $query['conditions'][$field . ' >'] = $value; $query['limit'] = 1; } $query['order'] = $field . ' ASC'; $neighbors = $this->find('all', $query); if (!array_key_exists('prev', $return)) { $return['prev'] = isset($neighbors[0]) ? $neighbors[0] : null; } if (count($neighbors) === 2) { $return['next'] = $neighbors[1]; } elseif (count($neighbors) === 1 && !$return['prev']) { $return['next'] = $neighbors[0]; } else { $return['next'] = null; } return $return; } /** * In the event of ambiguous results returned (multiple top level results, with different parent_ids) * top level results with different parent_ids to the first result will be dropped * * @param string $state * @param mixed $query * @param array $results * @return array Threaded results */ protected function _findThreaded($state, $query, $results = array()) { if ($state === 'before') { return $query; } $parent = 'parent_id'; if (isset($query['parent'])) { $parent = $query['parent']; } return Hash::nest($results, array( 'idPath' => '{n}.' . $this->alias . '.' . $this->primaryKey, 'parentPath' => '{n}.' . $this->alias . '.' . $parent )); } /** * Passes query results through model and behavior afterFind() methods. * * @param array $results Results to filter * @param boolean $primary If this is the primary model results (results from model where the find operation was performed) * @return array Set of filtered results */ protected function _filterResults($results, $primary = true) { $event = new CakeEvent('Model.afterFind', $this, array($results, $primary)); $event->modParams = 0; $this->getEventManager()->dispatch($event); return $event->result; } /** * This resets the association arrays for the model back * to those originally defined in the model. Normally called at the end * of each call to Model::find() * * @return boolean Success */ public function resetAssociations() { if (!empty($this->__backAssociation)) { foreach ($this->_associations as $type) { if (isset($this->__backAssociation[$type])) { $this->{$type} = $this->__backAssociation[$type]; } } $this->__backAssociation = array(); } foreach ($this->_associations as $type) { foreach ($this->{$type} as $key => $name) { if (property_exists($this, $key) && !empty($this->{$key}->__backAssociation)) { $this->{$key}->resetAssociations(); } } } $this->__backAssociation = array(); return true; } /** * Returns false if any fields passed match any (by default, all if $or = false) of their matching values. * * @param array $fields Field/value pairs to search (if no values specified, they are pulled from $this->data) * @param boolean $or If false, all fields specified must match in order for a false return value * @return boolean False if any records matching any fields are found */ public function isUnique($fields, $or = true) { if (!is_array($fields)) { $fields = func_get_args(); if (is_bool($fields[count($fields) - 1])) { $or = $fields[count($fields) - 1]; unset($fields[count($fields) - 1]); } } foreach ($fields as $field => $value) { if (is_numeric($field)) { unset($fields[$field]); $field = $value; $value = null; if (isset($this->data[$this->alias][$field])) { $value = $this->data[$this->alias][$field]; } } if (strpos($field, '.') === false) { unset($fields[$field]); $fields[$this->alias . '.' . $field] = $value; } } if ($or) { $fields = array('or' => $fields); } if (!empty($this->id)) { $fields[$this->alias . '.' . $this->primaryKey . ' !='] = $this->id; } return !$this->find('count', array('conditions' => $fields, 'recursive' => -1)); } /** * Returns a resultset for a given SQL statement. Custom SQL queries should be performed with this method. * * @param string $sql SQL statement * @param boolean|array $params Either a boolean to control query caching or an array of parameters * for use with prepared statement placeholders. * @param boolean $cache If $params is provided, a boolean flag for enabling/disabled * query caching. * @return mixed Resultset array or boolean indicating success / failure depending on the query executed * @link http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#model-query */ public function query($sql) { $params = func_get_args(); $db = $this->getDataSource(); return call_user_func_array(array(&$db, 'query'), $params); } /** * Returns true if all fields pass validation. Will validate hasAndBelongsToMany associations * that use the 'with' key as well. Since _saveMulti is incapable of exiting a save operation. * * Will validate the currently set data. Use Model::set() or Model::create() to set the active data. * * @param array $options An optional array of custom options to be made available in the beforeValidate callback * @return boolean True if there are no errors */ public function validates($options = array()) { return $this->validator()->validates($options); } /** * Returns an array of fields that have failed the validation of the current model. * * Additionally it populates the validationErrors property of the model with the same array. * * @param array|string $options An optional array of custom options to be made available in the beforeValidate callback * @return array Array of invalid fields and their error messages * @see Model::validates() */ public function invalidFields($options = array()) { return $this->validator()->errors($options); } /** * Marks a field as invalid, optionally setting the name of validation * rule (in case of multiple validation for field) that was broken. * * @param string $field The name of the field to invalidate * @param mixed $value Name of validation rule that was not failed, or validation message to * be returned. If no validation key is provided, defaults to true. * @return void */ public function invalidate($field, $value = true) { $this->validator()->invalidate($field, $value); } /** * Returns true if given field name is a foreign key in this model. * * @param string $field Returns true if the input string ends in "_id" * @return boolean True if the field is a foreign key listed in the belongsTo array. */ public function isForeignKey($field) { $foreignKeys = array(); if (!empty($this->belongsTo)) { foreach ($this->belongsTo as $data) { $foreignKeys[] = $data['foreignKey']; } } return in_array($field, $foreignKeys); } /** * Escapes the field name and prepends the model name. Escaping is done according to the * current database driver's rules. * * @param string $field Field to escape (e.g: id) * @param string $alias Alias for the model (e.g: Post) * @return string The name of the escaped field for this Model (i.e. id becomes `Post`.`id`). */ public function escapeField($field = null, $alias = null) { if (empty($alias)) { $alias = $this->alias; } if (empty($field)) { $field = $this->primaryKey; } $db = $this->getDataSource(); if (strpos($field, $db->name($alias) . '.') === 0) { return $field; } return $db->name($alias . '.' . $field); } /** * Returns the current record's ID * * @param integer $list Index on which the composed ID is located * @return mixed The ID of the current record, false if no ID */ public function getID($list = 0) { if (empty($this->id) || (is_array($this->id) && isset($this->id[0]) && empty($this->id[0]))) { return false; } if (!is_array($this->id)) { return $this->id; } if (isset($this->id[$list]) && !empty($this->id[$list])) { return $this->id[$list]; } if (isset($this->id[$list])) { return false; } return current($this->id); } /** * Returns the ID of the last record this model inserted. * * @return mixed Last inserted ID */ public function getLastInsertID() { return $this->getInsertID(); } /** * Returns the ID of the last record this model inserted. * * @return mixed Last inserted ID */ public function getInsertID() { return $this->_insertID; } /** * Sets the ID of the last record this model inserted * * @param integer|string $id Last inserted ID * @return void */ public function setInsertID($id) { $this->_insertID = $id; } /** * Returns the number of rows returned from the last query. * * @return integer Number of rows */ public function getNumRows() { return $this->getDataSource()->lastNumRows(); } /** * Returns the number of rows affected by the last query. * * @return integer Number of rows */ public function getAffectedRows() { return $this->getDataSource()->lastAffected(); } /** * Sets the DataSource to which this model is bound. * * @param string $dataSource The name of the DataSource, as defined in app/Config/database.php * @return void * @throws MissingConnectionException */ public function setDataSource($dataSource = null) { $oldConfig = $this->useDbConfig; if ($dataSource) { $this->useDbConfig = $dataSource; } $db = ConnectionManager::getDataSource($this->useDbConfig); if (!empty($oldConfig) && isset($db->config['prefix'])) { $oldDb = ConnectionManager::getDataSource($oldConfig); if (!isset($this->tablePrefix) || (!isset($oldDb->config['prefix']) || $this->tablePrefix === $oldDb->config['prefix'])) { $this->tablePrefix = $db->config['prefix']; } } elseif (isset($db->config['prefix'])) { $this->tablePrefix = $db->config['prefix']; } $this->schemaName = (empty($this->schemaName) ? $db->getSchemaName() : $this->schemaName); } /** * Gets the DataSource to which this model is bound. * * @return DataSource A DataSource object */ public function getDataSource() { if (!$this->_sourceConfigured && $this->useTable !== false) { $this->_sourceConfigured = true; $this->setSource($this->useTable); } return ConnectionManager::getDataSource($this->useDbConfig); } /** * Get associations * * @return array */ public function associations() { return $this->_associations; } /** * Gets all the models with which this model is associated. * * @param string $type Only result associations of this type * @return array Associations */ public function getAssociated($type = null) { if (!$type) { $associated = array(); foreach ($this->_associations as $assoc) { if (!empty($this->{$assoc})) { $models = array_keys($this->{$assoc}); foreach ($models as $m) { $associated[$m] = $assoc; } } } return $associated; } if (in_array($type, $this->_associations)) { if (empty($this->{$type})) { return array(); } return array_keys($this->{$type}); } $assoc = array_merge( $this->hasOne, $this->hasMany, $this->belongsTo, $this->hasAndBelongsToMany ); if (array_key_exists($type, $assoc)) { foreach ($this->_associations as $a) { if (isset($this->{$a}[$type])) { $assoc[$type]['association'] = $a; break; } } return $assoc[$type]; } return null; } /** * Gets the name and fields to be used by a join model. This allows specifying join fields * in the association definition. * * @param string|array $assoc The model to be joined * @param array $keys Any join keys which must be merged with the keys queried * @return array */ public function joinModel($assoc, $keys = array()) { if (is_string($assoc)) { list(, $assoc) = pluginSplit($assoc); return array($assoc, array_keys($this->{$assoc}->schema())); } if (is_array($assoc)) { $with = key($assoc); return array($with, array_unique(array_merge($assoc[$with], $keys))); } trigger_error( __d('cake_dev', 'Invalid join model settings in %s. The association parameter has the wrong type, expecting a string or array, but was passed type: %s', $this->alias, gettype($assoc)), E_USER_WARNING ); } /** * Called before each find operation. Return false if you want to halt the find * call, otherwise return the (modified) query data. * * @param array $query Data used to execute this query, i.e. conditions, order, etc. * @return mixed true if the operation should continue, false if it should abort; or, modified * $query to continue with new $query * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforefind */ public function beforeFind($query) { return true; } /** * Called after each find operation. Can be used to modify any results returned by find(). * Return value should be the (modified) results. * * @param mixed $results The results of the find operation * @param boolean $primary Whether this model is being queried directly (vs. being queried as an association) * @return mixed Result of the find operation * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#afterfind */ public function afterFind($results, $primary = false) { return $results; } /** * Called before each save operation, after validation. Return a non-true result * to halt the save. * * @param array $options Options passed from Model::save(). * @return boolean True if the operation should continue, false if it should abort * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforesave * @see Model::save() */ public function beforeSave($options = array()) { return true; } /** * Called after each successful save operation. * * @param boolean $created True if this save created a new record * @param array $options Options passed from Model::save(). * @return void * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#aftersave * @see Model::save() */ public function afterSave($created, $options = array()) { } /** * Called before every deletion operation. * * @param boolean $cascade If true records that depend on this record will also be deleted * @return boolean True if the operation should continue, false if it should abort * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforedelete */ public function beforeDelete($cascade = true) { return true; } /** * Called after every deletion operation. * * @return void * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#afterdelete */ public function afterDelete() { } /** * Called during validation operations, before validation. Please note that custom * validation rules can be defined in $validate. * * @param array $options Options passed from Model::save(). * @return boolean True if validate operation should continue, false to abort * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate * @see Model::save() */ public function beforeValidate($options = array()) { return true; } /** * Called after data has been checked for errors * * @return void */ public function afterValidate() { } /** * Called when a DataSource-level error occurs. * * @return void * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#onerror */ public function onError() { } /** * Clears cache for this model. * * @param string $type If null this deletes cached views if Cache.check is true * Will be used to allow deleting query cache also * @return mixed True on delete, null otherwise */ protected function _clearCache($type = null) { if ($type !== null || Configure::read('Cache.check') !== true) { return; } $pluralized = Inflector::pluralize($this->alias); $assoc = array( strtolower($pluralized), Inflector::underscore($pluralized) ); foreach ($this->_associations as $association) { foreach ($this->{$association} as $className) { $pluralizedAssociation = Inflector::pluralize($className['className']); if (!in_array(strtolower($pluralizedAssociation), $assoc)) { $assoc = array_merge($assoc, array( strtolower($pluralizedAssociation), Inflector::underscore($pluralizedAssociation) )); } } } clearCache(array_unique($assoc)); return true; } /** * Returns an instance of a model validator for this class * * @param ModelValidator Model validator instance. * If null a new ModelValidator instance will be made using current model object * @return ModelValidator */ public function validator(ModelValidator $instance = null) { if ($instance) { $this->_validator = $instance; } elseif (!$this->_validator) { $this->_validator = new ModelValidator($this); } return $this->_validator; } }
var path = require('path'), vows = require('vows'), assert = require('assert'), winston = require('../../lib/winston'), helpers = require('../helpers'); var npmTransport = new (winston.transports.Memory)(), syslogTransport = new (winston.transports.Memory)({ levels: winston.config.syslog.levels }); vows.describe('winston/transports/memory').addBatch({ "An instance of the Memory Transport": { "with npm levels": { "should have the proper methods defined": function () { helpers.assertMemory(npmTransport); }, "the log() method": helpers.testNpmLevels(npmTransport, "should respond with true", function (ign, err, logged) { assert.isNull(err); assert.isTrue(logged); }) }, "with syslog levels": { "should have the proper methods defined": function () { helpers.assertMemory(syslogTransport); }, "the log() method": helpers.testSyslogLevels(syslogTransport, "should respond with true", function (ign, err, logged) { assert.isNull(err); assert.isTrue(logged); }) } } }).export(module);
/* * imgAreaSelect default style */ .imgareaselect-border1 { background: url(border-v.gif) repeat-y left top; } .imgareaselect-border2 { background: url(border-h.gif) repeat-x left top; } .imgareaselect-border3 { background: url(border-v.gif) repeat-y right top; } .imgareaselect-border4 { background: url(border-h.gif) repeat-x left bottom; } .imgareaselect-border1, .imgareaselect-border2, .imgareaselect-border3, .imgareaselect-border4 { filter: alpha(opacity=50); opacity: 0.5; } .imgareaselect-handle { background-color: #fff; border: solid 1px #000; filter: alpha(opacity=50); opacity: 0.5; } .imgareaselect-outer { background-color: #000; filter: alpha(opacity=50); opacity: 0.5; } .imgareaselect-selection { }
var browserify = require('../..'), path = require('path'), fs = require('fs'), bundlePath = path.join(__dirname, 'js', 'build', 'bundle.js'); browserify() .require(require.resolve('./js/main.js'), { entry: true }) .bundle({ debug: true }) .on('error', function (err) { console.error(err); }) .pipe(fs.createWriteStream(bundlePath));
import SagaTestError from '../shared/SagaTestError'; import validateEffects from './validateEffects'; export default function assertSameEffect( eventChannel: Function, effectName: string, effectKey: ?string, isHelperEffect: boolean, actual: Object, expected: Object, stepNumber: number, ) { const errorMessage = validateEffects( eventChannel, effectName, effectKey, isHelperEffect, actual, expected, stepNumber, ); if (errorMessage) { throw new SagaTestError(errorMessage); } }
DELETE FROM person;
import * as React from 'react'; import './style.css'; import { RouteComponentProps } from 'react-router-dom'; import Dashboard from 'Components/DashboardLayout'; import SearchForm from './Components/SearchForm'; class SearchPage extends React.Component<RouteComponentProps<{}>, {}> { render() { return ( <div className="searchPage"> <Dashboard> <div className="dashboardTitle"> <h3>Filter your result</h3> </div> <div className="searchFormWrapper"> <SearchForm /> </div> </Dashboard> </div> ); } } export default SearchPage;
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Phaser Source: src/core/Plugin.js</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/default.css"> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div style="position: absolute; width: 143px; height: 31px; right: 10px; top: 10px; z-index: 1050"><a href="http://phaser.io"><img src="img/phaser.png" border="0" /></a></div> <div class="navbar-inner"> <a class="brand" href="index.html">Phaser API</a> <ul class="nav"> <li class="dropdown"> <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="Phaser.html">Phaser</a> </li> <li class="class-depth-0"> <a href="PIXI.html">PIXI</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="Matrix.html">Matrix</a> </li> <li class="class-depth-1"> <a href="Phaser.Animation.html">Animation</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationManager.html">AnimationManager</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationParser.html">AnimationParser</a> </li> <li class="class-depth-1"> <a href="Phaser.ArrayList.html">ArrayList</a> </li> <li class="class-depth-1"> <a href="Phaser.ArraySet.html">ArraySet</a> </li> <li class="class-depth-1"> <a href="Phaser.ArrayUtils.html">ArrayUtils</a> </li> <li class="class-depth-1"> <a href="Phaser.AudioSprite.html">AudioSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapData.html">BitmapData</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapText.html">BitmapText</a> </li> <li class="class-depth-1"> <a href="Phaser.Button.html">Button</a> </li> <li class="class-depth-1"> <a href="Phaser.Cache.html">Cache</a> </li> <li class="class-depth-1"> <a href="Phaser.Camera.html">Camera</a> </li> <li class="class-depth-1"> <a href="Phaser.Canvas.html">Canvas</a> </li> <li class="class-depth-1"> <a href="Phaser.Circle.html">Circle</a> </li> <li class="class-depth-1"> <a href="Phaser.Color.html">Color</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Angle.html">Angle</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Animation.html">Animation</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.AutoCull.html">AutoCull</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Bounds.html">Bounds</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.BringToTop.html">BringToTop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Core.html">Core</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Crop.html">Crop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Delta.html">Delta</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Destroy.html">Destroy</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.FixedToCamera.html">FixedToCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Health.html">Health</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InCamera.html">InCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InputEnabled.html">InputEnabled</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InWorld.html">InWorld</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LifeSpan.html">LifeSpan</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LoadTexture.html">LoadTexture</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Overlap.html">Overlap</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.PhysicsBody.html">PhysicsBody</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Reset.html">Reset</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.ScaleMinMax.html">ScaleMinMax</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Smoothed.html">Smoothed</a> </li> <li class="class-depth-1"> <a href="Phaser.Device.html">Device</a> </li> <li class="class-depth-1"> <a href="Phaser.DOM.html">DOM</a> </li> <li class="class-depth-1"> <a href="Phaser.Easing.html">Easing</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Back.html">Back</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Bounce.html">Bounce</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Circular.html">Circular</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Cubic.html">Cubic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Elastic.html">Elastic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Exponential.html">Exponential</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Linear.html">Linear</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quadratic.html">Quadratic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quartic.html">Quartic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quintic.html">Quintic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> </li> <li class="class-depth-1"> <a href="Phaser.Ellipse.html">Ellipse</a> </li> <li class="class-depth-1"> <a href="Phaser.Events.html">Events</a> </li> <li class="class-depth-1"> <a href="Phaser.Filter.html">Filter</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexGrid.html">FlexGrid</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexLayer.html">FlexLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.Frame.html">Frame</a> </li> <li class="class-depth-1"> <a href="Phaser.FrameData.html">FrameData</a> </li> <li class="class-depth-1"> <a href="Phaser.Game.html">Game</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectCreator.html">GameObjectCreator</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> </li> <li class="class-depth-1"> <a href="Phaser.Gamepad.html">Gamepad</a> </li> <li class="class-depth-1"> <a href="Phaser.GamepadButton.html">GamepadButton</a> </li> <li class="class-depth-1"> <a href="Phaser.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="Phaser.Group.html">Group</a> </li> <li class="class-depth-1"> <a href="Phaser.Image.html">Image</a> </li> <li class="class-depth-1"> <a href="Phaser.Input.html">Input</a> </li> <li class="class-depth-1"> <a href="Phaser.InputHandler.html">InputHandler</a> </li> <li class="class-depth-1"> <a href="Phaser.Key.html">Key</a> </li> <li class="class-depth-1"> <a href="Phaser.Keyboard.html">Keyboard</a> </li> <li class="class-depth-1"> <a href="Phaser.Line.html">Line</a> </li> <li class="class-depth-1"> <a href="Phaser.LinkedList.html">LinkedList</a> </li> <li class="class-depth-1"> <a href="Phaser.Loader.html">Loader</a> </li> <li class="class-depth-1"> <a href="Phaser.LoaderParser.html">LoaderParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Math.html">Math</a> </li> <li class="class-depth-1"> <a href="Phaser.Mouse.html">Mouse</a> </li> <li class="class-depth-1"> <a href="Phaser.MSPointer.html">MSPointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Net.html">Net</a> </li> <li class="class-depth-1"> <a href="Phaser.Particle.html">Particle</a> </li> <li class="class-depth-1"> <a href="Phaser.Particles.html">Particles</a> </li> <li class="class-depth-2"> <a href="Phaser.Particles.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a> </li> <li class="class-depth-1"> <a href="Phaser.Physics.html">Physics</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.html#TilemapCollision">TilemapCollision</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Ninja.html">Ninja</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.AABB.html">AABB</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Circle.html">Circle</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Tile.html">Tile</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.P2.html">P2</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.FixtureList.html">FixtureList</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Material.html">Material</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Spring.html">Spring</a> </li> <li class="class-depth-1"> <a href="Phaser.Plugin.html">Plugin</a> </li> <li class="class-depth-1"> <a href="Phaser.PluginManager.html">PluginManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Point.html">Point</a> </li> <li class="class-depth-1"> <a href="Phaser.Pointer.html">Pointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Polygon.html">Polygon</a> </li> <li class="class-depth-1"> <a href="Phaser.QuadTree.html">QuadTree</a> </li> <li class="class-depth-1"> <a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a> </li> <li class="class-depth-1"> <a href="Phaser.Rectangle.html">Rectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> </li> <li class="class-depth-1"> <a href="Phaser.RetroFont.html">RetroFont</a> </li> <li class="class-depth-1"> <a href="Phaser.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="Phaser.ScaleManager.html">ScaleManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Signal.html">Signal</a> </li> <li class="class-depth-1"> <a href="Phaser.SignalBinding.html">SignalBinding</a> </li> <li class="class-depth-1"> <a href="Phaser.SinglePad.html">SinglePad</a> </li> <li class="class-depth-1"> <a href="Phaser.Sound.html">Sound</a> </li> <li class="class-depth-1"> <a href="Phaser.SoundManager.html">SoundManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="Phaser.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="Phaser.Stage.html">Stage</a> </li> <li class="class-depth-1"> <a href="Phaser.State.html">State</a> </li> <li class="class-depth-1"> <a href="Phaser.StateManager.html">StateManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Text.html">Text</a> </li> <li class="class-depth-1"> <a href="Phaser.Tile.html">Tile</a> </li> <li class="class-depth-1"> <a href="Phaser.Tilemap.html">Tilemap</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapLayer.html">TilemapLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapParser.html">TilemapParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Tileset.html">Tileset</a> </li> <li class="class-depth-1"> <a href="Phaser.TileSprite.html">TileSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.Time.html">Time</a> </li> <li class="class-depth-1"> <a href="Phaser.Timer.html">Timer</a> </li> <li class="class-depth-1"> <a href="Phaser.TimerEvent.html">TimerEvent</a> </li> <li class="class-depth-1"> <a href="Phaser.Touch.html">Touch</a> </li> <li class="class-depth-1"> <a href="Phaser.Tween.html">Tween</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenData.html">TweenData</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenManager.html">TweenManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Utils.html">Utils</a> </li> <li class="class-depth-2"> <a href="Phaser.Utils.Debug.html">Debug</a> </li> <li class="class-depth-1"> <a href="Phaser.World.html">World</a> </li> <li class="class-depth-1"> <a href="PIXI.AbstractFilter.html">AbstractFilter</a> </li> <li class="class-depth-1"> <a href="PIXI.BaseTexture.html">BaseTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.BitmapText.html">BitmapText</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasBuffer.html">CanvasBuffer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasGraphics.html">CanvasGraphics</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasMaskManager.html">CanvasMaskManager</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasRenderer.html">CanvasRenderer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasTinter.html">CanvasTinter</a> </li> <li class="class-depth-1"> <a href="PIXI.ComplexPrimitiveShader.html">ComplexPrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.DisplayObject.html">DisplayObject</a> </li> <li class="class-depth-1"> <a href="PIXI.DisplayObjectContainer.html">DisplayObjectContainer</a> </li> <li class="class-depth-1"> <a href="PIXI.Event.html">Event</a> </li> <li class="class-depth-1"> <a href="PIXI.EventTarget.html">EventTarget</a> </li> <li class="class-depth-1"> <a href="PIXI.FilterTexture.html">FilterTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="PIXI.GraphicsData.html">GraphicsData</a> </li> <li class="class-depth-1"> <a href="PIXI.PIXI.html">PIXI</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiFastShader.html">PixiFastShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiShader.html">PixiShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PolyK.html">PolyK</a> </li> <li class="class-depth-1"> <a href="PIXI.PrimitiveShader.html">PrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="PIXI.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="PIXI.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="PIXI.Stage.html">Stage</a> </li> <li class="class-depth-1"> <a href="PIXI.Strip.html">Strip</a> </li> <li class="class-depth-1"> <a href="PIXI.StripShader.html">StripShader</a> </li> <li class="class-depth-1"> <a href="PIXI.Text.html">Text</a> </li> <li class="class-depth-1"> <a href="PIXI.Texture.html">Texture</a> </li> <li class="class-depth-1"> <a href="PIXI.TilingSprite.html">TilingSprite</a> </li> <li class="class-depth-1"> <a href="PIXI.VideoTexture.html">VideoTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLBlendModeManager.html">WebGLBlendModeManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFastSpriteBatch.html">WebGLFastSpriteBatch</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFilterManager.html">WebGLFilterManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLRenderer.html">WebGLRenderer</a> </li> <li class="class-depth-0"> <a href="RoundedRectangle.html">RoundedRectangle</a> </li> </ul> </li> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="global.html#append">append</a> </li> <li class="class-depth-0"> <a href="global.html#apply">apply</a> </li> <li class="class-depth-0"> <a href="global.html#applyInverse">applyInverse</a> </li> <li class="class-depth-0"> <a href="global.html#blendModes">blendModes</a> </li> <li class="class-depth-0"> <a href="global.html#clone">clone</a> </li> <li class="class-depth-0"> <a href="global.html#contains">contains</a> </li> <li class="class-depth-0"> <a href="global.html#fromArray">fromArray</a> </li> <li class="class-depth-0"> <a href="global.html#identity">identity</a> </li> <li class="class-depth-0"> <a href="global.html#rotate">rotate</a> </li> <li class="class-depth-0"> <a href="global.html#scale">scale</a> </li> <li class="class-depth-0"> <a href="global.html#scaleModes">scaleModes</a> </li> <li class="class-depth-0"> <a href="global.html#sort">sort</a> </li> <li class="class-depth-0"> <a href="global.html#toArray">toArray</a> </li> <li class="class-depth-0"> <a href="global.html#translate">translate</a> </li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Core<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Game.html">Game</a></li> <li class="class-depth-1"><a href="Phaser.Group.html">Group</a></li> <li class="class-depth-1"><a href="Phaser.World.html">World</a></li> <li class="class-depth-1"><a href="Phaser.Loader.html">Loader</a></li> <li class="class-depth-1"><a href="Phaser.Time.html">Time</a></li> <li class="class-depth-1"><a href="Phaser.Camera.html">Camera</a></li> <li class="class-depth-1"><a href="Phaser.StateManager.html">State Manager</a></li> <li class="class-depth-1"><a href="Phaser.TweenManager.html">Tween Manager</a></li> <li class="class-depth-1"><a href="Phaser.SoundManager.html">Sound Manager</a></li> <li class="class-depth-1"><a href="Phaser.Input.html">Input Manager</a></li> <li class="class-depth-1"><a href="Phaser.ScaleManager.html">Scale Manager</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Game Objects<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.GameObjectFactory.html">Factory (game.add)</a></li> <li class="class-depth-1"><a href="Phaser.GameObjectCreator.html">Creator (game.make)</a></li> <li class="class-depth-1"><a href="Phaser.Sprite.html">Sprite</a></li> <li class="class-depth-1"><a href="Phaser.Image.html">Image</a></li> <li class="class-depth-1"><a href="Phaser.Sound.html">Sound</a></li> <li class="class-depth-1"><a href="Phaser.Particles.Arcade.Emitter.html">Particle Emitter</a></li> <li class="class-depth-1"><a href="Phaser.Particle.html">Particle</a></li> <li class="class-depth-1"><a href="Phaser.Text.html">Text</a></li> <li class="class-depth-1"><a href="Phaser.Tween.html">Tween</a></li> <li class="class-depth-1"><a href="Phaser.BitmapText.html">BitmapText</a></li> <li class="class-depth-1"><a href="Phaser.Tilemap.html">Tilemap</a></li> <li class="class-depth-1"><a href="Phaser.BitmapData.html">BitmapData</a></li> <li class="class-depth-1"><a href="Phaser.RetroFont.html">RetroFont</a></li> <li class="class-depth-1"><a href="Phaser.Button.html">Button</a></li> <li class="class-depth-1"><a href="Phaser.Animation.html">Animation</a></li> <li class="class-depth-1"><a href="Phaser.Graphics.html">Graphics</a></li> <li class="class-depth-1"><a href="Phaser.RenderTexture.html">RenderTexture</a></li> <li class="class-depth-1"><a href="Phaser.TileSprite.html">TileSprite</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Geometry<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Circle.html">Circle</a></li> <li class="class-depth-1"><a href="Phaser.Rectangle.html">Rectangle</a></li> <li class="class-depth-1"><a href="Phaser.Point.html">Point</a></li> <li class="class-depth-1"><a href="Phaser.Line.html">Line</a></li> <li class="class-depth-1"><a href="Phaser.Ellipse.html">Ellipse</a></li> <li class="class-depth-1"><a href="Phaser.Polygon.html">Polygon</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Physics<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Physics.Arcade.html">Arcade Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Arcade.Body.html">Body</a></li> <li class="class-depth-1"><a href="Phaser.Physics.P2.html">P2 Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Body.html">Body</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Spring.html">Spring</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a></li> <li class="class-depth-1"><a href="Phaser.Physics.Ninja.html">Ninja Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Body.html">Body</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Input<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.InputHandler.html">Input Handler</a></li> <li class="class-depth-1"><a href="Phaser.Pointer.html">Pointer</a></li> <li class="class-depth-1"><a href="Phaser.Mouse.html">Mouse</a></li> <li class="class-depth-1"><a href="Phaser.Keyboard.html">Keyboard</a></li> <li class="class-depth-1"><a href="Phaser.Key.html">Key</a></li> <li class="class-depth-1"><a href="Phaser.Gamepad.html">Gamepad</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="http://phaser.io">Phaser Web Site</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser">Phaser Github</a></li> <li class="class-depth-1"><a href="http://phaser.io/examples">Phaser Examples</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser-plugins">Phaser Plugins</a></li> <li class="class-depth-1"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Forum</a></li> <li class="class-depth-1"><a href="http://stackoverflow.com/questions/tagged/phaser-framework">Stack Overflow</a></li> <li class="class-depth-1"><a href="http://phaser.io/learn">Weekly Coding Tips</a></li> <li class="class-depth-1"><a href="https://confirmsubscription.com/h/r/369DE48E3E86AF1E">Newsletter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/twitter">Twitter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/irc">IRC</a></li> <li class="class-depth-1"><a href="https://www.gittip.com/photonstorm/">Donate to the project</a></li> <li class="class-depth-1"><a href="https://www.codeandweb.com/texturepacker/phaser">Texture Packer</a></li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span12"> <div id="main"> <h1 class="page-title">Source: src/core/Plugin.js</h1> <section> <article> <pre class="sunlight-highlight-javascript linenums"> /** * This is a base Plugin template to use for any Phaser plugin development. * * @class Phaser.Plugin * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {any} parent - The object that owns this plugin, usually Phaser.PluginManager. */ Phaser.Plugin = function (game, parent) { if (typeof parent === 'undefined') { parent = null; } /** * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; /** * @property {any} parent - The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null. */ this.parent = parent; /** * @property {boolean} active - A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped. * @default */ this.active = false; /** * @property {boolean} visible - A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped. * @default */ this.visible = false; /** * @property {boolean} hasPreUpdate - A flag to indicate if this plugin has a preUpdate method. * @default */ this.hasPreUpdate = false; /** * @property {boolean} hasUpdate - A flag to indicate if this plugin has an update method. * @default */ this.hasUpdate = false; /** * @property {boolean} hasPostUpdate - A flag to indicate if this plugin has a postUpdate method. * @default */ this.hasPostUpdate = false; /** * @property {boolean} hasRender - A flag to indicate if this plugin has a render method. * @default */ this.hasRender = false; /** * @property {boolean} hasPostRender - A flag to indicate if this plugin has a postRender method. * @default */ this.hasPostRender = false; }; Phaser.Plugin.prototype = { /** * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics). * It is only called if active is set to true. * @method Phaser.Plugin#preUpdate */ preUpdate: function () { }, /** * Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render. * It is only called if active is set to true. * @method Phaser.Plugin#update */ update: function () { }, /** * Render is called right after the Game Renderer completes, but before the State.render. * It is only called if visible is set to true. * @method Phaser.Plugin#render */ render: function () { }, /** * Post-render is called after the Game Renderer and State.render have run. * It is only called if visible is set to true. * @method Phaser.Plugin#postRender */ postRender: function () { }, /** * Clear down this Plugin and null out references * @method Phaser.Plugin#destroy */ destroy: function () { this.game = null; this.parent = null; this.active = false; this.visible = false; } }; Phaser.Plugin.prototype.constructor = Phaser.Plugin; </pre> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="copyright"> Phaser Copyright © 2012-2015 Photon Storm Ltd. </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha10</a> on Thu Mar 26 2015 02:53:48 GMT+0000 (GMT Standard Time) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> </div> <br clear="both"> </div> </div> <script src="scripts/sunlight.js"></script> <script src="scripts/sunlight.javascript.js"></script> <script src="scripts/sunlight-plugin.doclinks.js"></script> <script src="scripts/sunlight-plugin.linenumbers.js"></script> <script src="scripts/sunlight-plugin.menu.js"></script> <script src="scripts/jquery.min.js"></script> <script src="scripts/jquery.scrollTo.js"></script> <script src="scripts/jquery.localScroll.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script> <script> $( function () { $( "#toc" ).toc( { anchorName : function(i, heading, prefix) { return $(heading).attr("id") || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : 60 } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); } ); </script> </body> </html>
PKG_NAME = node PKG_VERS = 0.12.2 PKG_EXT = tar.gz PKG_DIST_NAME = $(PKG_NAME)-v$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = http://nodejs.org/dist/v$(PKG_VERS)/ PKG_DIR = $(PKG_NAME)-v$(PKG_VERS) REQUIRED_DSM = 5.0 UNSUPPORTED_ARCHS = $(ARMv5_ARCHES) $(PPC_ARCHES) HOMEPAGE = http://nodejs.org/ COMMENT = Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. LICENSE = MIT CONFIGURE_ARGS = --without-snapshot --dest-os=linux --prefix=$(STAGING_INSTALL_PREFIX) ENV += LINK.target=$(TC_PATH)$(TC_PREFIX)g++ POST_INSTALL_TARGET = myPostInstall include ../../mk/spksrc.cross-cc.mk .PHONY: myPostInstall myPostInstall: sed -i -e 's|^#\!$(STAGING_INSTALL_PREFIX)|#\!$(INSTALL_PREFIX)|' $(STAGING_INSTALL_PREFIX)/lib/node_modules/npm/bin/npm-cli.js
/* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2012 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ if (typeof define !== 'function') { var define = require('amdefine')(module, require); } define(function (require, exports, module) { var sourceMap; try { sourceMap = require('../../lib/source-map'); } catch (e) { sourceMap = {}; Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap); } exports['test that the api is properly exposed in the top level'] = function (assert, util) { assert.equal(typeof sourceMap.SourceMapGenerator, "function"); assert.equal(typeof sourceMap.SourceMapConsumer, "function"); assert.equal(typeof sourceMap.SourceNode, "function"); }; });
#if !__has_feature(objc_arc) #error GCDWebServer requires ARC #endif #import "GCDWebServerPrivate.h" #define kMultiPartBufferSize (256 * 1024) typedef enum { kParserState_Undefined = 0, kParserState_Start, kParserState_Headers, kParserState_Content, kParserState_End } ParserState; @interface GCDWebServerMIMEStreamParser : NSObject - (id)initWithBoundary:(NSString*)boundary defaultControlName:(NSString*)name arguments:(NSMutableArray*)arguments files:(NSMutableArray*)files; - (BOOL)appendBytes:(const void*)bytes length:(NSUInteger)length; - (BOOL)isAtEnd; @end static NSData* _newlineData = nil; static NSData* _newlinesData = nil; static NSData* _dashNewlineData = nil; @interface GCDWebServerMultiPart () { @private NSString* _controlName; NSString* _contentType; NSString* _mimeType; } @end @implementation GCDWebServerMultiPart @synthesize controlName=_controlName, contentType=_contentType, mimeType=_mimeType; - (id)initWithControlName:(NSString*)name contentType:(NSString*)type { if ((self = [super init])) { _controlName = [name copy]; _contentType = [type copy]; _mimeType = GCDWebServerTruncateHeaderValue(_contentType); } return self; } @end @interface GCDWebServerMultiPartArgument () { @private NSData* _data; NSString* _string; } @end @implementation GCDWebServerMultiPartArgument @synthesize data=_data, string=_string; - (id)initWithControlName:(NSString*)name contentType:(NSString*)type data:(NSData*)data { if ((self = [super initWithControlName:name contentType:type])) { _data = data; if ([self.contentType hasPrefix:@"text/"]) { NSString* charset = GCDWebServerExtractHeaderValueParameter(self.contentType, @"charset"); _string = [[NSString alloc] initWithData:_data encoding:GCDWebServerStringEncodingFromCharset(charset)]; } } return self; } - (NSString*)description { return [NSString stringWithFormat:@"<%@ | '%@' | %lu bytes>", [self class], self.mimeType, (unsigned long)_data.length]; } @end @interface GCDWebServerMultiPartFile () { @private NSString* _fileName; NSString* _temporaryPath; } @end @implementation GCDWebServerMultiPartFile @synthesize fileName=_fileName, temporaryPath=_temporaryPath; - (id)initWithControlName:(NSString*)name contentType:(NSString*)type fileName:(NSString*)fileName temporaryPath:(NSString*)temporaryPath { if ((self = [super initWithControlName:name contentType:type])) { _fileName = [fileName copy]; _temporaryPath = [temporaryPath copy]; } return self; } - (void)dealloc { unlink([_temporaryPath fileSystemRepresentation]); } - (NSString*)description { return [NSString stringWithFormat:@"<%@ | '%@' | '%@>'", [self class], self.mimeType, _fileName]; } @end @interface GCDWebServerMIMEStreamParser () { @private NSData* _boundary; NSString* _defaultcontrolName; ParserState _state; NSMutableData* _data; NSMutableArray* _arguments; NSMutableArray* _files; NSString* _controlName; NSString* _fileName; NSString* _contentType; NSString* _tmpPath; int _tmpFile; GCDWebServerMIMEStreamParser* _subParser; } @end @implementation GCDWebServerMIMEStreamParser + (void)initialize { if (_newlineData == nil) { _newlineData = [[NSData alloc] initWithBytes:"\r\n" length:2]; GWS_DCHECK(_newlineData); } if (_newlinesData == nil) { _newlinesData = [[NSData alloc] initWithBytes:"\r\n\r\n" length:4]; GWS_DCHECK(_newlinesData); } if (_dashNewlineData == nil) { _dashNewlineData = [[NSData alloc] initWithBytes:"--\r\n" length:4]; GWS_DCHECK(_dashNewlineData); } } - (id)initWithBoundary:(NSString*)boundary defaultControlName:(NSString*)name arguments:(NSMutableArray*)arguments files:(NSMutableArray*)files { NSData* data = boundary.length ? [[NSString stringWithFormat:@"--%@", boundary] dataUsingEncoding:NSASCIIStringEncoding] : nil; if (data == nil) { GWS_DNOT_REACHED(); return nil; } if ((self = [super init])) { _boundary = data; _defaultcontrolName = name; _arguments = arguments; _files = files; _data = [[NSMutableData alloc] initWithCapacity:kMultiPartBufferSize]; _state = kParserState_Start; } return self; } - (void)dealloc { if (_tmpFile > 0) { close(_tmpFile); unlink([_tmpPath fileSystemRepresentation]); } } // http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2 - (BOOL)_parseData { BOOL success = YES; if (_state == kParserState_Headers) { NSRange range = [_data rangeOfData:_newlinesData options:0 range:NSMakeRange(0, _data.length)]; if (range.location != NSNotFound) { _controlName = nil; _fileName = nil; _contentType = nil; _tmpPath = nil; _subParser = nil; NSString* headers = [[NSString alloc] initWithData:[_data subdataWithRange:NSMakeRange(0, range.location)] encoding:NSUTF8StringEncoding]; if (headers) { for (NSString* header in [headers componentsSeparatedByString:@"\r\n"]) { NSRange subRange = [header rangeOfString:@":"]; if (subRange.location != NSNotFound) { NSString* name = [header substringToIndex:subRange.location]; NSString* value = [[header substringFromIndex:(subRange.location + subRange.length)] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; if ([name caseInsensitiveCompare:@"Content-Type"] == NSOrderedSame) { _contentType = GCDWebServerNormalizeHeaderValue(value); } else if ([name caseInsensitiveCompare:@"Content-Disposition"] == NSOrderedSame) { NSString* contentDisposition = GCDWebServerNormalizeHeaderValue(value); if ([GCDWebServerTruncateHeaderValue(contentDisposition) isEqualToString:@"form-data"]) { _controlName = GCDWebServerExtractHeaderValueParameter(contentDisposition, @"name"); _fileName = GCDWebServerExtractHeaderValueParameter(contentDisposition, @"filename"); } else if ([GCDWebServerTruncateHeaderValue(contentDisposition) isEqualToString:@"file"]) { _controlName = _defaultcontrolName; _fileName = GCDWebServerExtractHeaderValueParameter(contentDisposition, @"filename"); } } } else { GWS_DNOT_REACHED(); } } if (_contentType == nil) { _contentType = @"text/plain"; } } else { GWS_LOG_ERROR(@"Failed decoding headers in part of 'multipart/form-data'"); GWS_DNOT_REACHED(); } if (_controlName) { if ([GCDWebServerTruncateHeaderValue(_contentType) isEqualToString:@"multipart/mixed"]) { NSString* boundary = GCDWebServerExtractHeaderValueParameter(_contentType, @"boundary"); _subParser = [[GCDWebServerMIMEStreamParser alloc] initWithBoundary:boundary defaultControlName:_controlName arguments:_arguments files:_files]; if (_subParser == nil) { GWS_DNOT_REACHED(); success = NO; } } else if (_fileName) { NSString* path = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]; _tmpFile = open([path fileSystemRepresentation], O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (_tmpFile > 0) { _tmpPath = [path copy]; } else { GWS_DNOT_REACHED(); success = NO; } } } else { GWS_DNOT_REACHED(); success = NO; } [_data replaceBytesInRange:NSMakeRange(0, range.location + range.length) withBytes:NULL length:0]; _state = kParserState_Content; } } if ((_state == kParserState_Start) || (_state == kParserState_Content)) { NSRange range = [_data rangeOfData:_boundary options:0 range:NSMakeRange(0, _data.length)]; if (range.location != NSNotFound) { NSRange subRange = NSMakeRange(range.location + range.length, _data.length - range.location - range.length); NSRange subRange1 = [_data rangeOfData:_newlineData options:NSDataSearchAnchored range:subRange]; NSRange subRange2 = [_data rangeOfData:_dashNewlineData options:NSDataSearchAnchored range:subRange]; if ((subRange1.location != NSNotFound) || (subRange2.location != NSNotFound)) { if (_state == kParserState_Content) { const void* dataBytes = _data.bytes; NSUInteger dataLength = range.location - 2; if (_subParser) { if (![_subParser appendBytes:dataBytes length:(dataLength + 2)] || ![_subParser isAtEnd]) { GWS_DNOT_REACHED(); success = NO; } _subParser = nil; } else if (_tmpPath) { ssize_t result = write(_tmpFile, dataBytes, dataLength); if (result == (ssize_t)dataLength) { if (close(_tmpFile) == 0) { _tmpFile = 0; GCDWebServerMultiPartFile* file = [[GCDWebServerMultiPartFile alloc] initWithControlName:_controlName contentType:_contentType fileName:_fileName temporaryPath:_tmpPath]; [_files addObject:file]; } else { GWS_DNOT_REACHED(); success = NO; } } else { GWS_DNOT_REACHED(); success = NO; } _tmpPath = nil; } else { NSData* data = [[NSData alloc] initWithBytes:(void*)dataBytes length:dataLength]; GCDWebServerMultiPartArgument* argument = [[GCDWebServerMultiPartArgument alloc] initWithControlName:_controlName contentType:_contentType data:data]; [_arguments addObject:argument]; } } if (subRange1.location != NSNotFound) { [_data replaceBytesInRange:NSMakeRange(0, subRange1.location + subRange1.length) withBytes:NULL length:0]; _state = kParserState_Headers; success = [self _parseData]; } else { _state = kParserState_End; } } } else { NSUInteger margin = 2 * _boundary.length; if (_data.length > margin) { NSUInteger length = _data.length - margin; if (_subParser) { if ([_subParser appendBytes:_data.bytes length:length]) { [_data replaceBytesInRange:NSMakeRange(0, length) withBytes:NULL length:0]; } else { GWS_DNOT_REACHED(); success = NO; } } else if (_tmpPath) { ssize_t result = write(_tmpFile, _data.bytes, length); if (result == (ssize_t)length) { [_data replaceBytesInRange:NSMakeRange(0, length) withBytes:NULL length:0]; } else { GWS_DNOT_REACHED(); success = NO; } } } } } return success; } - (BOOL)appendBytes:(const void*)bytes length:(NSUInteger)length { [_data appendBytes:bytes length:length]; return [self _parseData]; } - (BOOL)isAtEnd { return (_state == kParserState_End); } @end @interface GCDWebServerMultiPartFormRequest () { @private GCDWebServerMIMEStreamParser* _parser; NSMutableArray* _arguments; NSMutableArray* _files; } @end @implementation GCDWebServerMultiPartFormRequest @synthesize arguments=_arguments, files=_files; + (NSString*)mimeType { return @"multipart/form-data"; } - (instancetype)initWithMethod:(NSString*)method url:(NSURL*)url headers:(NSDictionary*)headers path:(NSString*)path query:(NSDictionary*)query { if ((self = [super initWithMethod:method url:url headers:headers path:path query:query])) { _arguments = [[NSMutableArray alloc] init]; _files = [[NSMutableArray alloc] init]; } return self; } - (BOOL)open:(NSError**)error { NSString* boundary = GCDWebServerExtractHeaderValueParameter(self.contentType, @"boundary"); _parser = [[GCDWebServerMIMEStreamParser alloc] initWithBoundary:boundary defaultControlName:nil arguments:_arguments files:_files]; if (_parser == nil) { if (error) { *error = [NSError errorWithDomain:kGCDWebServerErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey: @"Failed starting to parse multipart form data"}]; } return NO; } return YES; } - (BOOL)writeData:(NSData*)data error:(NSError**)error { if (![_parser appendBytes:data.bytes length:data.length]) { if (error) { *error = [NSError errorWithDomain:kGCDWebServerErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey: @"Failed continuing to parse multipart form data"}]; } return NO; } return YES; } - (BOOL)close:(NSError**)error { BOOL atEnd = [_parser isAtEnd]; _parser = nil; if (!atEnd) { if (error) { *error = [NSError errorWithDomain:kGCDWebServerErrorDomain code:-1 userInfo:@{NSLocalizedDescriptionKey: @"Failed finishing to parse multipart form data"}]; } return NO; } return YES; } - (GCDWebServerMultiPartArgument*)firstArgumentForControlName:(NSString*)name { for (GCDWebServerMultiPartArgument* argument in _arguments) { if ([argument.controlName isEqualToString:name]) { return argument; } } return nil; } - (GCDWebServerMultiPartFile*)firstFileForControlName:(NSString*)name { for (GCDWebServerMultiPartFile* file in _files) { if ([file.controlName isEqualToString:name]) { return file; } } return nil; } - (NSString*)description { NSMutableString* description = [NSMutableString stringWithString:[super description]]; if (_arguments.count) { [description appendString:@"\n"]; for (GCDWebServerMultiPartArgument* argument in _arguments) { [description appendFormat:@"\n%@ (%@)\n", argument.controlName, argument.contentType]; [description appendString:GCDWebServerDescribeData(argument.data, argument.contentType)]; } } if (_files.count) { [description appendString:@"\n"]; for (GCDWebServerMultiPartFile* file in _files) { [description appendFormat:@"\n%@ (%@): %@\n{%@}", file.controlName, file.contentType, file.fileName, file.temporaryPath]; } } return description; } @end
 CKEDITOR.plugins.setLang( 'table', 'pt-br', { border: 'Borda', caption: 'Legenda', cell: { menu: 'Célula', insertBefore: 'Inserir célula a esquerda', insertAfter: 'Inserir célula a direita', deleteCell: 'Remover Células', merge: 'Mesclar Células', mergeRight: 'Mesclar com célula a direita', mergeDown: 'Mesclar com célula abaixo', splitHorizontal: 'Dividir célula horizontalmente', splitVertical: 'Dividir célula verticalmente', title: 'Propriedades da célula', cellType: 'Tipo de célula', rowSpan: 'Linhas cobertas', colSpan: 'Colunas cobertas', wordWrap: 'Quebra de palavra', hAlign: 'Alinhamento horizontal', vAlign: 'Alinhamento vertical', alignBaseline: 'Patamar de alinhamento', bgColor: 'Cor de fundo', borderColor: 'Cor das bordas', data: 'Dados', header: 'Cabeçalho', yes: 'Sim', no: 'Não', invalidWidth: 'A largura da célula tem que ser um número.', invalidHeight: 'A altura da célula tem que ser um número.', invalidRowSpan: 'Linhas cobertas tem que ser um número inteiro.', invalidColSpan: 'Colunas cobertas tem que ser um número inteiro.', chooseColor: 'Escolher' }, cellPad: 'Margem interna', cellSpace: 'Espaçamento', column: { menu: 'Coluna', insertBefore: 'Inserir coluna a esquerda', insertAfter: 'Inserir coluna a direita', deleteColumn: 'Remover Colunas' }, columns: 'Colunas', deleteTable: 'Apagar Tabela', headers: 'Cabeçalho', headersBoth: 'Ambos', headersColumn: 'Primeira coluna', headersNone: 'Nenhum', headersRow: 'Primeira linha', invalidBorder: 'O tamanho da borda tem que ser um número.', invalidCellPadding: 'A margem interna das células tem que ser um número.', invalidCellSpacing: 'O espaçamento das células tem que ser um número.', invalidCols: 'O número de colunas tem que ser um número maior que 0.', invalidHeight: 'A altura da tabela tem que ser um número.', invalidRows: 'O número de linhas tem que ser um número maior que 0.', invalidWidth: 'A largura da tabela tem que ser um número.', menu: 'Formatar Tabela', row: { menu: 'Linha', insertBefore: 'Inserir linha acima', insertAfter: 'Inserir linha abaixo', deleteRow: 'Remover Linhas' }, rows: 'Linhas', summary: 'Resumo', title: 'Formatar Tabela', toolbar: 'Tabela', widthPc: '%', widthPx: 'pixels', widthUnit: 'unidade largura' } );
package org.apache.flink.test.checkpointing.utils; import org.junit.Ignore; import org.junit.Test; /** * This verifies that we can restore a complete job from a Flink 1.3 savepoint. * * <p>The test pipeline contains both "Checkpointed" state and keyed user state. */ public class StatefulJobSavepointFrom13MigrationITCase extends StatefulJobSavepointFrom12MigrationITCase { /** * This has to be manually executed to create the savepoint on Flink 1.3. */ @Test @Ignore public void testCreateSavepointOnFlink13() throws Exception { testCreateSavepointOnFlink12(); } /** * This has to be manually executed to create the savepoint on Flink 1.3. */ @Test @Ignore public void testCreateSavepointOnFlink13WithRocksDB() throws Exception { testCreateSavepointOnFlink12WithRocksDB(); } @Override protected String getSavepointPath() { return "stateful-udf-migration-itcase-flink1.3-savepoint"; } @Override protected String getRocksDBSavepointPath() { return "stateful-udf-migration-itcase-flink1.3-rocksdb-savepoint"; } }
<!DOCTYPE html> <html> <head> <script src="/js-test-resources/js-test.js"></script> <script> window.jsTestIsAsync = true; testRunner.waitUntilDone(); var givenLoadEventTargets = []; function handleError(event) { givenLoadEventTargets.push(event.target.id); if (givenLoadEventTargets.length == 3) { shouldBe("['invalid', 'notFound', 'notFoundShared']", "givenLoadEventTargets.sort()"); finishJSTest(); } } </script> <link id="notFound" rel="import" href="notfound.html" onerror="handleError(event)"> <link id="notFoundShared" rel="import" href="notfound.html" onerror="handleError(event)"> <link id="invalid" rel="import" href="" onerror="handleError(event)"> </head> <body></body> </html>