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; } } }

Dataset Card for "github"

More Information needed

Downloads last month
0
Edit dataset card