answer
stringlengths
15
1.25M
CKEDITOR.plugins.setLang("uicolor","lv",{title:"UI krāsas izvēle",options:"Color Options",highlight:"Highlight",selected:"Selected Color",predefined:"Predefinēti krāsu komplekti",config:"Ielīmējiet šo rindu jūsu config.js failā"});
namespace SqlStreamStore.HAL.StreamMetadata { using System.IO; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Newtonsoft.Json; using Newtonsoft.Json.Linq; internal class <API key> : <API key><Unit> { public static async Task<<API key>> Create(HttpContext context) { using(var reader = new JsonTextReader(new StreamReader(context.Request.Body)) { CloseInput = false }) { var body = await JObject.LoadAsync(reader, context.RequestAborted); return new <API key>(context, body); } } private <API key>(HttpContext context, JObject body) { var request = context.Request; Path = request.Path; StreamId = context.GetRouteData().GetStreamId(); ExpectedVersion = request.GetExpectedVersion(); MaxAge = body.Value<int?>("maxAge"); MaxCount = body.Value<int?>("maxCount"); MetadataJson = body.Value<JObject>("metadataJson"); } public PathString Path { get; } public string StreamId { get; } public int ExpectedVersion { get; } public JObject MetadataJson { get; } public int? MaxCount { get; } public int? MaxAge { get; } public async Task<Unit> Invoke(IStreamStore streamStore, CancellationToken ct) { await streamStore.SetStreamMetadata( StreamId, ExpectedVersion, MaxAge, MaxCount, MetadataJson?.ToString(Formatting.Indented), ct); return Unit.Instance; } } }
<?php /** * @namespace */ namespace Zend\GData\EXIF\Extension; class FStop extends \Zend\GData\Extension { protected $_rootNamespace = 'exif'; protected $_rootElement = 'fstop'; /** * Constructs a new <API key> object. * * @param string $text (optional) The value to use for this element. */ public function __construct($text = null) { $this-><API key>(\Zend\GData\EXIF::$namespaces); parent::__construct(); $this->setText($text); } }
use std::rc::Rc; use std::cell::RefCell; const SEGMENT_SIZE: usize = 16; type SegmentLink = Rc<RefCell<Segment>>; #[derive(PartialEq)] struct Segment { head: usize, tail: usize, items: [i32; SEGMENT_SIZE], next: Option<SegmentLink> } impl Segment { fn new() -> SegmentLink { Rc::new(RefCell::new(Segment { head: 0, tail: 0, items: [0; 16], next: None })) } fn with(item: i32) -> SegmentLink { let segment = Segment::new(); segment.borrow_mut().tail += 1; segment.borrow_mut().items[0] = item; segment } fn add(&mut self, item: i32) -> Result<(), SegmentLink> { if self.tail == SEGMENT_SIZE { let segment = Segment::with(item); self.next = Some(segment.clone()); Err(segment) } else { let tail = self.tail; self.tail += 1; self.items[tail] = item; Ok(()) } } fn remove(&mut self) -> Result<i32, Option<SegmentLink>> { if self.tail == self.head { Err(self.next.take()) } else { let head = self.head; self.head += 1; Ok(self.items[head]) } } } pub struct ArrayLinkedQueue { first: Option<SegmentLink>, last: Option<SegmentLink> } impl ArrayLinkedQueue { pub fn dequeue(&mut self) -> Option<i32> { self.first.take().and_then(|first| { match first.borrow_mut().remove() { Ok(item) => { self.first = Some(first.clone()); Some(item) } Err(Some(next)) => { self.first = Some(next.clone()); next.borrow_mut().remove().ok() } Err(_) => None } }) } pub fn enqueue(&mut self, item: i32) { match self.insert(item) { Ok(()) => (), Err(last) => self.last = Some(last.clone()) } } fn insert(&mut self, item: i32) -> Result<(), SegmentLink> { let segment = self.last.get_or_insert(Segment::new()); if self.first.as_ref().map_or(true, |first| first == segment) { self.first = Some(segment.clone()); } segment.borrow_mut().add(item) } } impl Default for ArrayLinkedQueue { fn default() -> Self { ArrayLinkedQueue { first: None, last: None } } } #[cfg(test)] mod tests { use super::*; #[test] fn <API key>() { let mut queue = ArrayLinkedQueue::default(); queue.enqueue(1); queue.enqueue(2); queue.enqueue(3); assert_eq!(queue.dequeue(), Some(1)); assert_eq!(queue.dequeue(), Some(2)); assert_eq!(queue.dequeue(), Some(3)); assert_eq!(queue.dequeue(), None); } #[test] fn <API key>() { let mut queue = ArrayLinkedQueue::default(); for i in 0..(2 * SEGMENT_SIZE + 1) { queue.enqueue(i as i32); } for i in 0..(2 * SEGMENT_SIZE + 1) { assert_eq!(queue.dequeue(), Some(i as i32)); } assert_eq!(queue.dequeue(), None); } #[test] fn <API key>() { let mut queue = ArrayLinkedQueue::default(); for i in 0..(2 * SEGMENT_SIZE + 1) { queue.enqueue(i as i32); assert_eq!(queue.dequeue(), Some(i as i32)); assert_eq!(queue.dequeue(), None); } } }
// import { // select, // } from "@kadira/<API key>"; import Forms from "./"; import TagSelect from "../TagSelect"; Forms .add("TagSelect", () => { // set channel name options const GIVING_SCHEDULES = [ { label: "One time", value: "One-Time" }, { label: "Every Month", value: "Monthly" }, { label: "Every Week", value: "Weekly" }, { label: "Every 2 Weeks", value: "Bi-Weekly" }, ]; return ( <div className={"floating"}> <div className={"grid__item text-left"} style={{ maxWidth: "480px" }}> <TagSelect items={GIVING_SCHEDULES} /> </div> </div>); });
/** * * * @param {Object|Array} object * @param {Function} callback * @param {Object} [thisObj=undefined] this * @access public * @return {Object|Array} * * @example * * var arr = [1, 2, 3, 4]; * each(arr, function(item, index, arr){ * console.log(index + ":" + item); * }); * // 0:1 * // 1:2 * // 2:3 * // 3:4 * * @example * * var arr = [1, 2, 3, 4]; * each(arr, function(item, index, arr){ * console.log(index + ":" + item); * if(item > 2){ * return false; * } * }); * // 0:1 * // 1:2 */ function each(object, callback, thisObj) { var name, i = 0, length = object.length, isObj = length === undefined || isFunction(object); if (isObj) { for (name in object) { if (callback.call(thisObj, object[name], name, object) === false) { break; } } } else { for (i = 0; i < length; i++) { if (callback.call(thisObj, object[i], i, object) === false) { break; } } } return object; }
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; import { Constants, } from '@ag-grid-community/core'; import { mock } from '../test-utils/mock'; import { SetFilter } from './setFilter'; var rowModel; var eventService; var <API key>; var gridOptionsWrapper; var context; var eMiniFilter; var eGui; var eSelectAll; var virtualList; var setValueModel; beforeEach(function () { rowModel = mock('getType', 'forEachLeafNode'); rowModel.getType.mockReturnValue(Constants.<API key>); eventService = mock('addEventListener'); <API key> = mock('formatValue'); <API key>.formatValue.mockImplementation(function (_1, _2, _3, value) { return value; }); gridOptionsWrapper = mock('getLocaleTextFunc', '<API key>'); gridOptionsWrapper.getLocaleTextFunc.mockImplementation(function () { return (function (_, defaultValue) { return defaultValue; }); }); context = mock('createBean'); context.createBean.mockImplementation(function (bean) { return bean; }); eMiniFilter = mock('getGui', 'getValue', 'setValue', 'onValueChange', 'getInputElement', 'setInputAriaLabel'); eMiniFilter.getGui.mockImplementation(function () { return mock(); }); eMiniFilter.getInputElement.mockImplementation(function () { return mock('addEventListener'); }); eGui = mock('querySelector', 'appendChild'); eGui.querySelector.mockImplementation(function () { return mock('appendChild', 'addEventListener'); }); eSelectAll = mock('setValue', 'getInputElement', 'onValueChange', 'setLabel'); eSelectAll.getInputElement.mockImplementation(function () { return mock('addEventListener'); }); virtualList = mock('refresh'); setValueModel = mock('getModel', '<API key>'); }); function createSetFilter(filterParams) { var colDef = {}; var params = __assign({ api: null, colDef: colDef, rowModel: rowModel, column: null, context: null, <API key>: function () { return true; }, <API key>: function () { }, <API key>: function () { }, valueGetter: function (node) { return node.data.value; } }, filterParams); colDef.filterParams = params; var setFilter = new SetFilter(); setFilter.eventService = eventService; setFilter.gridOptionsWrapper = gridOptionsWrapper; setFilter.<API key> = <API key>; setFilter.rowModel = rowModel; setFilter.context = context; setFilter.eGui = eGui; setFilter.eMiniFilter = eMiniFilter; setFilter.eSelectAll = eSelectAll; setFilter.setParams(params); setFilter.virtualList = virtualList; setFilter.valueModel = setValueModel; return setFilter; } describe('applyModel', function () { it('returns false if nothing has changed', function () { var setFilter = createSetFilter(); expect(setFilter.applyModel()).toBe(false); }); it('returns true if something has changed', function () { var setFilter = createSetFilter(); setValueModel.getModel.mockReturnValue(['A']); expect(setFilter.applyModel()).toBe(true); }); it('can apply empty model', function () { var setFilter = createSetFilter(); setValueModel.getModel.mockReturnValue([]); setFilter.applyModel(); expect(setFilter.getModel().values).toStrictEqual([]); }); it.each(['windows', 'mac'])('will not apply model with zero values in %s Excel Mode', function (excelMode) { var setFilter = createSetFilter({ excelMode: excelMode }); setValueModel.getModel.mockReturnValue([]); setFilter.applyModel(); expect(setFilter.getModel()).toBeNull(); }); it.each(['windows', 'mac'])('preserves existing model if new model with zero values applied in %s Excel Mode', function (excelMode) { var setFilter = createSetFilter({ excelMode: excelMode }); var model = ['A', 'B']; setValueModel.getModel.mockReturnValue(model); setFilter.applyModel(); expect(setFilter.getModel().values).toStrictEqual(model); setValueModel.getModel.mockReturnValue(model); setFilter.applyModel(); expect(setFilter.getModel().values).toStrictEqual(model); }); it.each(['windows', 'mac'])('can reset model in %s Excel Mode', function (excelMode) { var setFilter = createSetFilter({ excelMode: excelMode }); var model = ['A', 'B']; setValueModel.getModel.mockReturnValue(model); setFilter.applyModel(); expect(setFilter.getModel().values).toStrictEqual(model); setValueModel.getModel.mockReturnValue(null); setFilter.applyModel(); expect(setFilter.getModel()).toBeNull(); }); it.each(['windows', 'mac'])('ensures any active filter is removed by selecting all values if all visible values are selected', function (excelMode) { setValueModel = mock('getModel', '<API key>', '<API key>'); var setFilter = createSetFilter({ excelMode: excelMode }); setValueModel.<API key>.mockReturnValue(true); setValueModel.getModel.mockReturnValue(null); setFilter.applyModel(); expect(setValueModel.<API key>).toBeCalledTimes(1); }); });
// Generated by CoffeeScript 1.12.3 var layerA; layerA = new Layer({ x: Align.center, y: Align.center, width: 200, height: 200, backgroundColor: "#FAFB40" }); layerA.onClick(function() { return layerA.animate({ properties: { scale: 3, backgroundColor: "#C2FF01", borderRadius: 100 } }); });
<!DOCTYPE html> <html lang="en"> <head> <title>Card Class Reference</title> <link rel="stylesheet" type="text/css" href="../css/jazzy.css" /> <link rel="stylesheet" type="text/css" href="../css/highlight.css" /> <meta charset='utf-8'> <script src="../js/jquery.min.js" defer></script> <script src="../js/jazzy.js" defer></script> <script src="../js/lunr.min.js" defer></script> <script src="../js/typeahead.jquery.js" defer></script> <script src="../js/jazzy.search.js" defer></script> </head> <body> <a name="//apple_ref/swift/Class/Card" class="dashAnchor"></a> <a title="Card Class Reference"></a> <header> <div class="content-wrapper"> <p><a href="../index.html">PAYJP 1.6.1 Docs</a></p> <p class="header-right"><a href="https://github.com/payjp/payjp-ios"><img src="../img/gh.png"/>View on GitHub</a></p> <p class="header-right"> <form role="search" action="../search.json"> <input type="text" placeholder="Search documentation" data-typeahead> </form> </p> </div> </header> <div class="content-wrapper"> <p id="breadcrumbs"> <a href="../index.html">PAYJP Reference</a> <img id="carat" src="../img/carat.png" /> Card Class Reference </p> </div> <div class="content-wrapper"> <nav class="sidebar"> <ul class="nav-groups"> <li class="nav-group-name"> <a href="../Classes.html">Classes</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Classes/APIClient.html">APIClient</a> </li> <li class="nav-group-task"> <a href="../Classes/Card.html">Card</a> </li> <li class="nav-group-task"> <a href="../Classes/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Classes/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Classes/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Classes/CardFormView.html">CardFormView</a> </li> <li class="nav-group-task"> <a href="../Classes/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Classes/ClientInfo.html">ClientInfo</a> </li> <li class="nav-group-task"> <a href="../Classes/FormStyle.html">FormStyle</a> </li> <li class="nav-group-task"> <a href="../Classes/PAYErrorResponse.html">PAYErrorResponse</a> </li> <li class="nav-group-task"> <a href="../Classes/PAYJPSDK.html">PAYJPSDK</a> </li> <li class="nav-group-task"> <a href="../Classes/PAYNotificationKey.html">PAYNotificationKey</a> </li> <li class="nav-group-task"> <a href="../Classes/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Classes/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Classes/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Classes/Token.html">Token</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../Enums.html">Enumerations</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Enums/APIError.html">APIError</a> </li> <li class="nav-group-task"> <a href="../Enums/CardBrand.html">CardBrand</a> </li> <li class="nav-group-task"> <a href="../Enums/CardFormResult.html">CardFormResult</a> </li> <li class="nav-group-task"> <a href="../Enums/CardFormViewType.html">CardFormViewType</a> </li> <li class="nav-group-task"> <a href="../Enums/LocalError.html">LocalError</a> </li> <li class="nav-group-task"> <a href="../Enums/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Enums/<API key>.html"><API key></a> </li> </ul> </li> <li class="nav-group-name"> <a href="../Extensions.html">Extensions</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Extensions/NSNotification.html">NSNotification</a> </li> <li class="nav-group-task"> <a href="../Extensions/Notification.html">Notification</a> </li> <li class="nav-group-task"> <a href="../Extensions/Notification/Name.html">– Name</a> </li> </ul> </li> <li class="nav-group-name"> <a href="../Protocols.html">Protocols</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Protocols/CardFormAction.html">CardFormAction</a> </li> <li class="nav-group-task"> <a href="../Protocols/CardFormStylable.html">CardFormStylable</a> </li> <li class="nav-group-task"> <a href="../Protocols/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Protocols/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Protocols/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Protocols/PAYJPSDKType.html">PAYJPSDKType</a> </li> <li class="nav-group-task"> <a href="../Protocols/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Protocols/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Protocols/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Protocols/<API key>.html"><API key></a> </li> <li class="nav-group-task"> <a href="../Protocols/<API key>.html"><API key></a> </li> </ul> </li> <li class="nav-group-name"> <a href="../Typealiases.html">Type Aliases</a> <ul class="nav-group-tasks"> <li class="nav-group-task"> <a href="../Typealiases.html#/s:<API key>">CardBrandsResult</a> </li> </ul> </li> </ul> </nav> <article class="main-content"> <section> <section class="section"> <h1>Card</h1> <div class="declaration"> <div class="language"> <pre class="highlight swift"><code><span class="kd">@objcMembers</span> <span class="kd">@objc(PAYCard)</span> <span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">Card</span> <span class="p">:</span> <span class="kt">NSObject</span><span class="p">,</span> <span class="kt">Decodable</span></code></pre> </div> </div> <p>PAY.JP card object. For security reasons, the card number is masked and you can get only last4 character. The full documentations are following. cf. <a href="https://pay.jp/docs/api/ </section> <section class="section task-group-section"> <div class="task-group"> <ul> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)identifer"></a> <a name="//apple_ref/swift/Property/identifer" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)identifer">identifer</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">identifer</span><span class="p">:</span> <span class="kt">String</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)name"></a> <a name="//apple_ref/swift/Property/name" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)name">name</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)last4Number"></a> <a name="//apple_ref/swift/Property/last4Number" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)last4Number">last4Number</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">last4Number</span><span class="p">:</span> <span class="kt">String</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)brand"></a> <a name="//apple_ref/swift/Property/brand" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)brand">brand</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">brand</span><span class="p">:</span> <span class="kt">String</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)expirationMonth"></a> <a name="//apple_ref/swift/Property/expirationMonth" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)expirationMonth">expirationMonth</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">expirationMonth</span><span class="p">:</span> <span class="kt">UInt8</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)expirationYear"></a> <a name="//apple_ref/swift/Property/expirationYear" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)expirationYear">expirationYear</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">expirationYear</span><span class="p">:</span> <span class="kt">UInt16</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)fingerprint"></a> <a name="//apple_ref/swift/Property/fingerprint" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)fingerprint">fingerprint</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">fingerprint</span><span class="p">:</span> <span class="kt">String</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)liveMode"></a> <a name="//apple_ref/swift/Property/liveMode" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)liveMode">liveMode</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">liveMode</span><span class="p">:</span> <span class="kt">Bool</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)createdAt"></a> <a name="//apple_ref/swift/Property/createdAt" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)createdAt">createdAt</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">createdAt</span><span class="p">:</span> <span class="kt">Date</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)threeDSecureStatus"></a> <a name="//apple_ref/swift/Property/threeDSecureStatus" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)threeDSecureStatus">threeDSecureStatus</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">threeDSecureStatus</span><span class="p">:</span> <span class="kt"><API key></span><span class="p">?</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(py)rawValue"></a> <a name="//apple_ref/swift/Property/rawValue" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(py)rawValue">rawValue</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">rawValue</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">Any</span><span class="p">]?</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> <div class="task-group"> <div class="task-name-container"> <a name="/Decodable"></a> <a name="//apple_ref/swift/Section/Decodable" class="dashAnchor"></a> <div class="<API key>"> <a class="section-name-link" href="#/Decodable"></a> <h3 class="section-name"><p>Decodable</p> </h3> </div> </div> <ul> <li class="item"> <div> <code> <a name="/s:<API key>"></a> <a name="//apple_ref/swift/Method/init(from:)" class="dashAnchor"></a> <a class="token" href="#/s:<API key>">init(from:<wbr>)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">from</span> <span class="nv">decoder</span><span class="p">:</span> <span class="kt">Decoder</span><span class="p">)</span> <span class="k">throws</span></code></pre> </div> </div> </section> </div> </li> <li class="item"> <div> <code> <a name="/c:@M@PAYJP@objc(cs)PAYCard(im)initWithIdentifier:name:last4Number:brand:expirationMonth:expirationYear:fingerprint:liveMode:createAt:threeDSecureStatus:rawValue:"></a> <a name="//apple_ref/swift/Method/init(identifier:name:last4Number:brand:expirationMonth:expirationYear:fingerprint:liveMode:createAt:threeDSecureStatus:rawValue:)" class="dashAnchor"></a> <a class="token" href="#/c:@M@PAYJP@objc(cs)PAYCard(im)initWithIdentifier:name:last4Number:brand:expirationMonth:expirationYear:fingerprint:liveMode:createAt:threeDSecureStatus:rawValue:">init(identifier:<wbr>name:<wbr>last4Number:<wbr>brand:<wbr>expirationMonth:<wbr>expirationYear:<wbr>fingerprint:<wbr>liveMode:<wbr>createAt:<wbr>threeDSecureStatus:<wbr>rawValue:<wbr>)</a> </code> </div> <div class="height-container"> <div class="pointer-container"></div> <section class="section"> <div class="pointer"></div> <div class="abstract"> <p>Undocumented</p> </div> <div class="declaration"> <h4>Declaration</h4> <div class="language"> <p class="aside-title">Swift</p> <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">identifier</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span><span class="p">?,</span> <span class="nv">last4Number</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">brand</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">expirationMonth</span><span class="p">:</span> <span class="kt">UInt8</span><span class="p">,</span> <span class="nv">expirationYear</span><span class="p">:</span> <span class="kt">UInt16</span><span class="p">,</span> <span class="nv">fingerprint</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">liveMode</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">,</span> <span class="nv">createAt</span><span class="p">:</span> <span class="kt">Date</span><span class="p">,</span> <span class="nv">threeDSecureStatus</span><span class="p">:</span> <span class="kt"><API key></span><span class="p">?,</span> <span class="nv">rawValue</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">Any</span><span class="p">]?</span> <span class="o">=</span> <span class="kc">nil</span> <span class="p">)</span></code></pre> </div> </div> </section> </div> </li> </ul> </div> </section> </section> <section id="footer"> <p>&copy; 2020 <a class="link" href="https: <p>Generated by <a class="link" href="https: </section> </article> </div> </body> </div> </html>
it("should hoist exports in a concatenated module", () => { return import("./root-ref").then(m => { m.test(); }); }); if (Math.random() < 0) import("./external-ref");
using System; using System.Collections.Generic; using System.Text; using SharpLua.LuaTypes; namespace SharpLua.AST { <summary> A for/in loop </summary> [Serializable()] public partial class ForInStmt : Statement { <summary> Executes the chunk </summary> <param name="enviroment">Runs in the given environment</param> <param name="isBreak">whether to break execution</param> <returns></returns> public override LuaValue Execute(LuaTable enviroment, out bool isBreak) { LuaValue[] values = this.ExprList.ConvertAll(expr => expr.Evaluate(enviroment)).ToArray(); LuaValue[] neatValues = LuaMultiValue.UnWrapLuaValues(values); if (neatValues.Length < 3) //probably LuaUserdata. Literal will also fail... { return ExecuteAlternative(enviroment, out isBreak); } LuaFunction func = neatValues[0] as LuaFunction; LuaValue state = neatValues[1]; LuaValue loopVar = neatValues[2]; var table = new LuaTable(enviroment); this.Body.Enviroment = table; while (true) { LuaValue result = func.Invoke(new LuaValue[] { state, loopVar }); LuaMultiValue multiValue = result as LuaMultiValue; if (multiValue != null) { neatValues = LuaMultiValue.UnWrapLuaValues(multiValue.Values); loopVar = neatValues[0]; for (int i = 0; i < Math.Min(this.NameList.Count, neatValues.Length); i++) { table.SetNameValue(this.NameList[i], neatValues[i]); } } else { loopVar = result; table.SetNameValue(this.NameList[0], result); } if (loopVar == LuaNil.Nil) { break; } var returnValue = this.Body.Execute(out isBreak); if (returnValue != null || isBreak == true) { isBreak = false; return returnValue; } } isBreak = false; return null; } private LuaValue ExecuteAlternative(LuaTable enviroment, out bool isBreak) { LuaValue returnValue; LuaValue[] values = this.ExprList.ConvertAll(expr => expr.Evaluate(enviroment)).ToArray(); LuaValue[] neatValues = LuaMultiValue.UnWrapLuaValues(values); LuaValue state = neatValues[0]; LuaTable table = new LuaTable(enviroment); this.Body.Enviroment = table; System.Collections.IDictionary dict = state.Value as System.Collections.IDictionary; System.Collections.IEnumerable ie = state.Value as System.Collections.IEnumerable; if (dict != null) { foreach (object key in dict.Keys) { //for (int i = 0; i < this.NameList.Count; i++) //table.SetNameValue(this.NameList[i], ObjectToLua.ToLuaValue(key)); table.SetNameValue(this.NameList[0], ObjectToLua.ToLuaValue(key)); table.SetNameValue(this.NameList[1], ObjectToLua.ToLuaValue(dict[key])); returnValue = this.Body.Execute(out isBreak); if (returnValue != null || isBreak == true) { isBreak = false; return returnValue; } } } else if (ie != null) { foreach (object obj in ie) { for (int i = 0; i < this.NameList.Count; i++) { table.SetNameValue(this.NameList[i], ObjectToLua.ToLuaValue(obj)); } returnValue = this.Body.Execute(out isBreak); if (returnValue != null || isBreak == true) { isBreak = false; return returnValue; } } } else { // its some other value... for (int i = 0; i < this.NameList.Count; i++) { table.SetNameValue(this.NameList[i], ObjectToLua.ToLuaValue(state.Value)); } returnValue = this.Body.Execute(out isBreak); if (returnValue != null || isBreak == true) { isBreak = false; return returnValue; } isBreak = false; return null; } isBreak = false; return null; } } }
<!doctype html> <head> <meta charset="utf-8" /> <title></title> <style> #cajaimagen{ float:left; width: 350px; margin: 30px; border:1px solid #F00; } #cajaimagen img{width: 200px;} #zonaDestino{ border:1px solid #F20; background-color: #F80; float:left; margin:30px; width: 550px; height: 400px; } </style> <script> var elem_origin, elem_destino; var imagenes; function comenzar(){ imagenes = document.querySelectorAll("#cajaimagen img"); for(var i=0;i<imagenes.length;i++){ imagenes[i].addEventListener("dragstart",comenzamosArrastrar,false); imagenes[i].addEventListener("dragend",terminado,false); } elem_destino = document.getElementById("zonaDestino"); elem_destino.addEventListener("dragenter",function(e){e.preventDefault();},false); elem_destino.addEventListener("dragover",function(e){e.preventDefault();},false); elem_destino.addEventListener("drop",soltado,false); elem_destino.addEventListener("dragenter",entrando,false); elem_destino.addEventListener("dragleave",saliendo,false); } function comenzamosArrastrar(e){ var elementos = e.target; e.dataTransfer.setData("Text", elementos.getAttribute("id")); var img = document.createElement("img"); img.src = "jesuscuesta.jpg"; e.dataTransfer.setDragImage(img, 0, 0); } function soltado(e){ e.preventDefault(); var id = e.dataTransfer.getData("Text"); elem_destino.innerHTML = "<img src='" + document.getElementById(id).src + "' />"; } function terminado(e){ var elemento = e.target; elemento.style.visibility="hidden"; } function entrando(e){ e.preventDefault(); elem_destino.style.background = "rgba(8,252,25,.8)"; } function saliendo(e){ e.preventDefault(); elem_destino.style.background = "#F80"; } window.addEventListener("load",comenzar,false); </script> </head> <body> <section id="cajaimagen"> <img id="imagen1" src="homer.png" /> <img id="imagen2" src="navegadores.png" /> <img id="imagen3" src="fiat.jpg" /> <img id="imagen4" src="presentacion.png" /> </section> <section id="zonaDestino"> Arrastre el elemento hasta aquí </section> </body> </html>
// Publish the current user Meteor.publish('currentUser', function() { var user = Meteor.users.find({_id: this.userId}, {fields: ownUserOptions}); return user; }); // publish all users for admins to make autocomplete work // TODO: find a better way Meteor.publish('allUsersAdmin', function() { var selector = Settings.get('requirePostInvite') ? {isInvited: true} : {}; // only users that can post if (isAdminById(this.userId)) { return Meteor.users.find(selector, {fields: { _id: true, profile: true, slug: true }}); } return []; }); //Publish count of all users // Meteor.publish('getUserCount', function() { // return Meteor.users.find().count(); // Meteor.methods({ // getUserCount: function() { // return Meteor.users.find().count();
#if !defined(CRYPTO_SQUARE_H) #define CRYPTO_SQUARE_H namespace crypto_square { } // namespace crypto_square #endif // CRYPTO_SQUARE_H
var EventEmitter = require('events').EventEmitter var Backbone = require('backbone') var BrowserRunner = require('./browser_runner') var child_process = require('child_process') var exec = child_process.exec var log = require('winston') var template = require('./strutils').template var async = require('async') var process = require('did_it_work') function BaseApp(config){ var self = this this.config = config this.runners = new Backbone.Collection this .on('all-test-results', function () { var allRunnersComplete = self.runners.all(function (runner) { var results = runner.get('results') return results && !!results.get('all') }) if (allRunnersComplete) { self.emit('<API key>') } }) } BaseApp.prototype = { __proto__: EventEmitter.prototype , runPreprocessors: function(callback){ this.runHook('before_tests', callback) } , runPostprocessors: function(callback){ this.runHook('after_tests', callback) } , startOnStartHook: function(callback){ var on_start = this.config.get('on_start') if (!on_start) return callback() var proc = this.onStartProcess = this.<API key>() var waitForText = on_start.wait_for_text if (waitForText){ proc.goodIfMatches(waitForText, on_start.<API key> || 4000) } proc.good(function(){ callback(proc) }) } , <API key>: function(){ var on_start = this.config.get('on_start') if (on_start.exe){ // use spawn var args = on_start.args || [] proc = process(this.template(on_start.exe), this.template(args)) log.info('Starting on_start hook: ' + on_start.exe + ' ' + args.join(' ')) }else{ // use exec var cmd = on_start.command ? on_start.command : on_start cmd = this.template(cmd) proc = process(cmd) log.info('Starting on_start hook: ' + cmd) } return proc } , template: function(str){ var params = { url: this.config.get('url'), port: this.config.get('port') } return template(str, params) } , runExitHook: function (callback) { if(this.onStartProcess) { this.onStartProcess.kill('SIGTERM'); } this.runHook('on_exit', callback) } , runHook: function(hook, callback){ var self = this var hookCommand = this.config.get(hook) if (hookCommand){ hookCommand = this.template(hookCommand) log.info('Running ' + hook + ' command ' + hookCommand) this.disableFileWatch = true exec(hookCommand, function(err, stdout, stderr){ self.disableFileWatch = false if (callback) callback(err, stdout, stderr, hookCommand) }) }else{ if (callback) callback() } } , removeBrowser: function(browser){ this.runners.remove(browser) } , connectBrowser: function(browserName, id, client){ var existing = this.runners.find(function(runner){ return runner.pending && runner.get('name') === browserName }) if (existing){ clearTimeout(existing.pending) existing.set('socket', client) return existing }else{ var browser = new BrowserRunner({ name: browserName , socket: client , app: this }) var self = this browser.on('disconnect', function(){ browser.pending = setTimeout(function(){ self.removeBrowser(browser) }, 1000) }) browser.on('all-test-results', function(results, browser){ self.emit('all-test-results', results, browser) }) browser.on('top-level-error', function(msg, url, line){ self.emit('top-level-error', msg, url, line) }) this.runners.push(browser) return browser } } , cleanUpLaunchers: function(callback){ if (!this.launchers){ if (callback) callback() return } async.forEach(this.launchers, function(launcher, done){ if (launcher && launcher.process){ launcher.kill('SIGTERM', done) }else{ done() } }, callback) } } module.exports = BaseApp
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_23) on Sun Feb 26 06:28:57 CET 2012 --> <TITLE> Reference (Apache Ant API) </TITLE> <META NAME="date" CONTENT="2012-02-26"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Reference (Apache Ant API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/apache/tools/ant/types/RedirectorElement.html" title="class in org.apache.tools.ant.types"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/tools/ant/types/Reference.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Reference.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <H2> <FONT SIZE="-1"> org.apache.tools.ant.types</FONT> <BR> Class Reference</H2> <PRE> java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.tools.ant.types.Reference</B> </PRE> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/tools/ant/taskdefs/Ant.Reference.html" title="class in org.apache.tools.ant.taskdefs">Ant.Reference</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>Reference</B><DT>extends java.lang.Object</DL> </PRE> <P> Class to hold a reference to another object in the project. <P> <P> <HR> <P> <A NAME="constructor_summary"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/types/Reference.html#Reference()">Reference</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>since 1.7. Please use <A HREF="../../../../../org/apache/tools/ant/types/Reference.html#Reference(org.apache.tools.ant.Project, java.lang.String)"><CODE>Reference(Project,String)</CODE></A> instead.</I></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/types/Reference.html#Reference(org.apache.tools.ant.Project, java.lang.String)">Reference</A></B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A>&nbsp;p, java.lang.String&nbsp;id)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a reference to a named ID in a particular project.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/types/Reference.html#Reference(java.lang.String)">Reference</A></B>(java.lang.String&nbsp;id)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>since 1.7. Please use <A HREF="../../../../../org/apache/tools/ant/types/Reference.html#Reference(org.apache.tools.ant.Project, java.lang.String)"><CODE>Reference(Project,String)</CODE></A> instead.</I></TD> </TR> </TABLE> &nbsp; <A NAME="method_summary"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/types/Reference.html#getProject()">getProject</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the associated project, if any; may be null.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/types/Reference.html#getReferencedObject()">getReferencedObject</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resolve the reference, looking in the associated project.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/types/Reference.html#getReferencedObject(org.apache.tools.ant.Project)">getReferencedObject</A></B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A>&nbsp;fallback)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resolve the reference, using the associated project if it set, otherwise use the passed in project.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/types/Reference.html#getRefId()">getRefId</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the reference id of this reference.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/types/Reference.html#setProject(org.apache.tools.ant.Project)">setProject</A></B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A>&nbsp;p)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the associated project.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/types/Reference.html#setRefId(java.lang.String)">setRefId</A></B>(java.lang.String&nbsp;id)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the reference id.</TD> </TR> </TABLE> &nbsp;<A NAME="<API key>.lang.Object"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="<API key>"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <A NAME="constructor_detail"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="Reference()"></A><H3> Reference</H3> <PRE> public <B>Reference</B>()</PRE> <DL> <DD><B>Deprecated.</B>&nbsp;<I>since 1.7. Please use <A HREF="../../../../../org/apache/tools/ant/types/Reference.html#Reference(org.apache.tools.ant.Project, java.lang.String)"><CODE>Reference(Project,String)</CODE></A> instead.</I> <P> <DD>Create a reference. <P> </DL> <HR> <A NAME="Reference(java.lang.String)"></A><H3> Reference</H3> <PRE> public <B>Reference</B>(java.lang.String&nbsp;id)</PRE> <DL> <DD><B>Deprecated.</B>&nbsp;<I>since 1.7. Please use <A HREF="../../../../../org/apache/tools/ant/types/Reference.html#Reference(org.apache.tools.ant.Project, java.lang.String)"><CODE>Reference(Project,String)</CODE></A> instead.</I> <P> <DD>Create a reference to a named ID. <P> <DL> <DT><B>Parameters:</B><DD><CODE>id</CODE> - the name of this reference</DL> </DL> <HR> <A NAME="Reference(org.apache.tools.ant.Project, java.lang.String)"></A><H3> Reference</H3> <PRE> public <B>Reference</B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A>&nbsp;p, java.lang.String&nbsp;id)</PRE> <DL> <DD>Create a reference to a named ID in a particular project. <P> <DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - the project this reference is associated with<DD><CODE>id</CODE> - the name of this reference<DT><B>Since:</B></DT> <DD>Ant 1.6.3</DD> </DL> </DL> <A NAME="method_detail"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="setRefId(java.lang.String)"></A><H3> setRefId</H3> <PRE> public void <B>setRefId</B>(java.lang.String&nbsp;id)</PRE> <DL> <DD>Set the reference id. Should not normally be necessary; use <A HREF="../../../../../org/apache/tools/ant/types/Reference.html#Reference(org.apache.tools.ant.Project, java.lang.String)"><CODE>Reference(Project, String)</CODE></A>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>id</CODE> - the reference id to use</DL> </DD> </DL> <HR> <A NAME="getRefId()"></A><H3> getRefId</H3> <PRE> public java.lang.String <B>getRefId</B>()</PRE> <DL> <DD>Get the reference id of this reference. <P> <DD><DL> <DT><B>Returns:</B><DD>the reference id</DL> </DD> </DL> <HR> <A NAME="setProject(org.apache.tools.ant.Project)"></A><H3> setProject</H3> <PRE> public void <B>setProject</B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A>&nbsp;p)</PRE> <DL> <DD>Set the associated project. Should not normally be necessary; use <A HREF="../../../../../org/apache/tools/ant/types/Reference.html#Reference(org.apache.tools.ant.Project, java.lang.String)"><CODE>Reference(Project,String)</CODE></A>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>p</CODE> - the project to use<DT><B>Since:</B></DT> <DD>Ant 1.6.3</DD> </DL> </DD> </DL> <HR> <A NAME="getProject()"></A><H3> getProject</H3> <PRE> public <A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A> <B>getProject</B>()</PRE> <DL> <DD>Get the associated project, if any; may be null. <P> <DD><DL> <DT><B>Returns:</B><DD>the associated project<DT><B>Since:</B></DT> <DD>Ant 1.6.3</DD> </DL> </DD> </DL> <HR> <A NAME="getReferencedObject(org.apache.tools.ant.Project)"></A><H3> getReferencedObject</H3> <PRE> public java.lang.Object <B>getReferencedObject</B>(<A HREF="../../../../../org/apache/tools/ant/Project.html" title="class in org.apache.tools.ant">Project</A>&nbsp;fallback) throws <A HREF="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</A></PRE> <DL> <DD>Resolve the reference, using the associated project if it set, otherwise use the passed in project. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>fallback</CODE> - the fallback project to use if the project attribute of reference is not set. <DT><B>Returns:</B><DD>the dereferenced object. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</A></CODE> - if the reference cannot be dereferenced.</DL> </DD> </DL> <HR> <A NAME="getReferencedObject()"></A><H3> getReferencedObject</H3> <PRE> public java.lang.Object <B>getReferencedObject</B>() throws <A HREF="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</A></PRE> <DL> <DD>Resolve the reference, looking in the associated project. <P> <DD><DL> <DT><B>Returns:</B><DD>the dereferenced object. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../../org/apache/tools/ant/BuildException.html" title="class in org.apache.tools.ant">BuildException</A></CODE> - if the project is null or the reference cannot be dereferenced<DT><B>Since:</B></DT> <DD>Ant 1.6.3</DD> <DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/tools/ant/Project.html#getReference(java.lang.String)"><CODE>Project.getReference(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/apache/tools/ant/types/RedirectorElement.html" title="class in org.apache.tools.ant.types"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/apache/tools/ant/types/RegularExpression.html" title="class in org.apache.tools.ant.types"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/tools/ant/types/Reference.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Reference.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> </BODY> </HTML>
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>InfoBox v1.1.4 [February 18, 2011] Reference</title> <link rel="stylesheet" type="text/css" href="http://code.google.com/css/codesite.css"></link> <link rel="stylesheet" type="text/css" href="../../util/docs/template/local_extensions.css"></link> </head> <body> <h1>InfoBox</h1> <p> InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class. <p> An InfoBox behaves like a <tt>google.maps.InfoWindow</tt>, but it supports several additional properties for advanced styling. An InfoBox can also be used as a map label. <p> An InfoBox also fires the same events as a <tt>google.maps.InfoWindow</tt>. <p> Browsers tested: <p> Mac -- Safari (4.0.4), Firefox (3.6), Opera (10.10), Chrome (4.0.249.43), OmniWeb (5.10.1) <br> Win -- Safari, Firefox, Opera, Chrome (3.0.195.38), Internet Explorer (8.0.6001.18702) <br> iPod Touch/iPhone -- Safari (3.1.2)</p> <p>For a description and examples of how to use this library, check out the <a href="examples.html">how-to</a>.</p> <h2><a name="InfoBox"></a>class InfoBox</h2> <p></p> <h3>Constructor</h3> <table summary="class InfoBox - Constructor" width="90%"> <tbody> <tr> <th>Constructor</th> <th>Description</th> </tr> <tr class="odd"> <td><code>InfoBox(<span class="type">opt_opts?:InfoBoxOptions</span>)</code></td> <td>Creates an InfoBox with the options specified in <code><a href="reference.html#InfoBoxOptions">InfoBoxOptions</a></code>. Call <tt>InfoBox.open</tt> to add the box to the map.</td> </tr> </tbody> </table> <h3>Methods</h3> <table summary="class InfoBox - Methods" width="90%"> <tbody> <tr> <th>Methods</th> <th>Return&nbsp;Value</th> <th>Description</th> </tr> <tr class="odd"> <td><code>close()</code></td> <td><code>None</code></td> <td>Removes the InfoBox from the map.</td> </tr> <tr class="even"> <td><code>draw()</code></td> <td><code>None</code></td> <td>Draws the InfoBox based on the current map projection and zoom level.</td> </tr> <tr class="odd"> <td><code>getContent()</code></td> <td><code>string</code></td> <td>Returns the content of the InfoBox.</td> </tr> <tr class="even"> <td><code>getPosition()</code></td> <td><code>LatLng</code></td> <td>Returns the geographic location of the InfoBox.</td> </tr> <tr class="odd"> <td><code>getZIndex()</code></td> <td><code>number</code></td> <td>Returns the zIndex for the InfoBox.</td> </tr> <tr class="even"> <td><code>hide()</code></td> <td><code>None</code></td> <td>Hides the InfoBox.</td> </tr> <tr class="odd"> <td><code>onRemove()</code></td> <td><code>None</code></td> <td>Invoked when <tt>close</tt> is called. Do not call it directly.</td> </tr> <tr class="even"> <td><code>open(<span class="type">map:Map|StreetViewPanorama</span>, <span class="type">anchor?:MVCObject</span>)</code></td> <td><code>None</code></td> <td>Adds the InfoBox to the specified map or Street View panorama. If <tt>anchor</tt> (usually a <tt>google.maps.Marker</tt>) is specified, the position of the InfoBox is set to the position of the <tt>anchor</tt>. If the anchor is dragged to a new location, the InfoBox moves as well.</td> </tr> <tr class="odd"> <td><code>setContent(<span class="type">content:string|Node</span>)</code></td> <td><code>None</code></td> <td>Sets the content of the InfoBox. The content can be plain text or an HTML DOM node.</td> </tr> <tr class="even"> <td><code>setOptions(<span class="type">opt_opts:InfoBoxOptions</span>)</code></td> <td><code>None</code></td> <td>Sets the options for the InfoBox. Note that changes to the <tt>maxWidth</tt>, <tt>closeBoxMargin</tt>, <tt>closeBoxURL</tt>, and <tt><API key></tt> properties have no affect until the current InfoBox is <tt>close</tt>d and a new one is <tt>open</tt>ed.</td> </tr> <tr class="odd"> <td><code>setPosition(<span class="type">latlng:LatLng</span>)</code></td> <td><code>None</code></td> <td>Sets the geographic location of the InfoBox.</td> </tr> <tr class="even"> <td><code>setZIndex(<span class="type">index:number</span>)</code></td> <td><code>None</code></td> <td>Sets the zIndex style for the InfoBox.</td> </tr> <tr class="odd"> <td><code>show()</code></td> <td><code>None</code></td> <td>Shows the InfoBox.</td> </tr> </tbody> </table> <h3>Events</h3> <table summary="class InfoBox - Events" width="90%"> <tbody> <tr> <th>Events</th> <th>Arguments</th> <th>Description</th> </tr> <tr class="odd"> <td><code>closeclick</code></td> <td><code>None</code></td> <td>This event is fired when the InfoBox's close box is clicked.</td> </tr> <tr class="even"> <td><code>content_changed</code></td> <td><code>None</code></td> <td>This event is fired when the content of the InfoBox changes.</td> </tr> <tr class="odd"> <td><code>domready</code></td> <td><code>None</code></td> <td>This event is fired when the DIV containing the InfoBox's content is attached to the DOM.</td> </tr> <tr class="even"> <td><code>position_changed</code></td> <td><code>None</code></td> <td>This event is fired when the position of the InfoBox changes.</td> </tr> <tr class="odd"> <td><code>zindex_changed</code></td> <td><code>None</code></td> <td>This event is fired when the zIndex of the InfoBox changes.</td> </tr> </tbody> </table> <h2><a name="InfoBoxOptions"></a>class InfoBoxOptions</h2> <p>This class represents the optional parameter passed to the <code><a href="reference.html#InfoBox">InfoBox</a></code> constructor. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.</p> <h3>Properties</h3> <table summary="class InfoBoxOptions - Properties" width="90%"> <tbody> <tr> <th>Properties</th> <th>Type</th> <th>Description</th> </tr> <tr class="odd"> <td><code>alignBottom</code></td> <td><code>boolean</code></td> <td>Align the bottom left corner of the InfoBox to the <code>position</code> location (default is <tt>false</tt> which means that the top left corner of the InfoBox is aligned).</td> </tr> <tr class="even"> <td><code>boxClass</code></td> <td><code>string</code></td> <td>The name of the CSS class defining the styles for the InfoBox container. The default name is <code>infoBox</code>.</td> </tr> <tr class="odd"> <td><code>boxStyle</code></td> <td><code>Object</code></td> <td>An object literal whose properties define specific CSS style values to be applied to the InfoBox. Style values defined here override those that may be defined in the <code>boxClass</code> style sheet. If this property is changed after the InfoBox has been created, all previously set styles (except those defined in the style sheet) are removed from the InfoBox before the new style values are applied.</td> </tr> <tr class="even"> <td><code>closeBoxMargin</code></td> <td><code>string</code></td> <td>The CSS margin style value for the close box. The default is "2px" (a 2-pixel margin on all sides).</td> </tr> <tr class="odd"> <td><code>closeBoxURL</code></td> <td><code>string</code></td> <td>The URL of the image representing the close box. Note: The default is the URL for Google's standard close box. Set this property to "" if no close box is required.</td> </tr> <tr class="even"> <td><code>content</code></td> <td><code>string|Node</code></td> <td>The content of the InfoBox (plain text or an HTML DOM node).</td> </tr> <tr class="odd"> <td><code>disableAutoPan</code></td> <td><code>boolean</code></td> <td>Disable auto-pan on <tt>open</tt> (default is <tt>false</tt>).</td> </tr> <tr class="even"> <td><code><API key></code></td> <td><code>boolean</code></td> <td>Propagate mousedown, click, dblclick, and contextmenu events in the InfoBox (default is <tt>false</tt> to mimic the behavior of a <tt>google.maps.InfoWindow</tt>). Set this property to <tt>true</tt> if the InfoBox is being used as a map label. iPhone note: This property setting has no effect. Events are always propagated for an InfoBox in the "mapPane" pane and they are <i>not</i> propagated for an InfoBox in the "floatPane" pane.</td> </tr> <tr class="odd"> <td><code>infoBoxClearance</code></td> <td><code>Size</code></td> <td>Minimum offset (in pixels) from the InfoBox to the map edge after an auto-pan.</td> </tr> <tr class="even"> <td><code>isHidden</code></td> <td><code>boolean</code></td> <td>Hide the InfoBox on <tt>open</tt> (default is <tt>false</tt>).</td> </tr> <tr class="odd"> <td><code>maxWidth</code></td> <td><code>number</code></td> <td>The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum.</td> </tr> <tr class="even"> <td><code>pane</code></td> <td><code>string</code></td> <td>The pane where the InfoBox is to appear (default is "floatPane"). Set the pane to "mapPane" if the InfoBox is being used as a map label. Valid pane names are the property names for the <tt>google.maps.MapPanes</tt> object.</td> </tr> <tr class="odd"> <td><code>pixelOffset</code></td> <td><code>Size</code></td> <td>The offset (in pixels) from the top left corner of the InfoBox (or the bottom left corner if the <code>alignBottom</code> property is <code>true</code>) to the map pixel corresponding to <tt>position</tt>.</td> </tr> <tr class="even"> <td><code>position</code></td> <td><code>LatLng</code></td> <td>The geographic location at which to display the InfoBox.</td> </tr> <tr class="odd"> <td><code>zIndex</code></td> <td><code>number</code></td> <td>The CSS z-index style value for the InfoBox. Note: This value overrides a zIndex setting specified in the <tt>boxStyle</tt> property.</td> </tr> </tbody> </table> <script src="http: <script type="text/javascript"> _uacct = "UA-964209-4"; urchinTracker(); </script> </body> </html>
.success-text{color:green} /*# sourceMappingURL=maps/main.<API key>.css.map */
module SimpleNavigation module Renderer # Renders an ItemContainer as a <ul> element and its containing items as # <li> elements. # It adds the 'selected' class to li element AND the link inside the li # element that is currently active. # If the sub navigation should be included (based on the level and # expand_all options), it renders another <ul> containing the sub navigation # inside the active <li> element. # By default, the renderer sets the item's key as dom_id for the rendered # <li> element unless the config option <tt><API key></tt> is # set to false. # The id can also be explicitely specified by setting the id in the # html-options of the 'item' method in the config/navigation.rb file. class List < SimpleNavigation::Renderer::Base def render(item_container) if skip_if_empty? && item_container.empty? '' else tag = options[:ordered] ? :ol : :ul content = list_content(item_container) content_tag(tag, content, item_container.dom_attributes) end end private def list_content(item_container) item_container.items.map { |item| li_options = item.html_options.except(:link) li_content = tag_for(item) if <API key>?(item) li_content << <API key>(item) end content_tag(:li, li_content, li_options) }.join end end end end
<?php if(filemtime(__FILE__) + 1800 < time())return false; return array ( 'id' => 652, 'goods' => array ( 'goods_id' => '652', 'store_id' => '42', 'type' => 'material', 'goods_name' => '40g', 'description' => '<p style="text-align: center;"><img src="http: 'cate_id' => '696', 'cate_name' => ' ', 'brand' => '', 'spec_qty' => '0', 'spec_name_1' => '', 'spec_name_2' => '', 'if_show' => '1', 'if_seckill' => '0', 'closed' => '0', 'close_reason' => NULL, 'add_time' => '1418840903', 'last_update' => '1418840903', 'default_spec' => '655', 'default_image' => 'data/files/store_42/goods_80/<API key>.jpg', 'recommended' => '0', 'cate_id_1' => '691', 'cate_id_2' => '696', 'cate_id_3' => '0', 'cate_id_4' => '0', 'price' => '4.20', 'tags' => array ( 0 => '', 1 => '', 2 => '', ), 'cuxiao_ids' => NULL, 'from_goods_id' => NULL, 'quanzhong' => NULL, 'state' => '1', '_specs' => array ( 0 => array ( 'spec_id' => '655', 'goods_id' => '652', 'spec_1' => '', 'spec_2' => '', 'color_rgb' => '', 'price' => '4.20', 'stock' => '1000', 'sku' => '6925009902862', ), ), '_images' => array ( 0 => array ( 'image_id' => '837', 'goods_id' => '652', 'image_url' => 'data/files/store_42/goods_80/201412181028007839.jpg', 'thumbnail' => 'data/files/store_42/goods_80/<API key>.jpg', 'sort_order' => '1', 'file_id' => '3217', ), ), '_scates' => array ( ), 'views' => '2', 'collects' => '0', 'carts' => '1', 'orders' => '0', 'sales' => '0', 'comments' => '0', 'related_info' => array ( ), ), 'store_data' => array ( 'store_id' => '42', 'store_name' => '', 'owner_name' => '', 'owner_card' => '370832200104057894', 'region_id' => '3398', 'region_name' => ' ', 'address' => '', 'zipcode' => '', 'tel' => '053188089011', 'sgrade' => '', 'apply_remark' => '', 'credit_value' => '0', 'praise_rate' => '0.00', 'domain' => '', 'state' => '1', 'close_reason' => '', 'add_time' => '1418929047', 'end_time' => '0', 'certification' => 'autonym,material', 'sort_order' => '65535', 'recommended' => '0', 'theme' => '', 'store_banner' => NULL, 'store_logo' => 'data/files/store_42/other/store_logo.jpg', 'description' => '', 'image_1' => '', 'image_2' => '', 'image_3' => '', 'im_qq' => '', 'im_ww' => '', 'im_msn' => '', 'hot_search' => '', 'business_scope' => '', 'online_service' => array ( ), 'hotline' => '', 'pic_slides' => '', 'pic_slides_wap' => '{"1":{"url":"data/files/store_42/pic_slides_wap/pic_slides_wap_1.jpg","link":"http: 'enable_groupbuy' => '0', 'enable_radar' => '1', 'waptheme' => '', 'is_open_pay' => '0', 'area_peisong' => NULL, 'power_coupon' => '1', 's_long' => '117.129732 ', 's_lat' => '36.697199', 'user_name' => 'beiquan', 'email' => '111111111@qq.com', 'certifications' => array ( 0 => 'autonym', 1 => 'material', ), 'credit_image' => 'http://wap.bqmart.cn/themes/images/heart_1.gif', 'store_owner' => array ( 'user_id' => '42', 'user_name' => 'beiquan', 'email' => '111111111@qq.com', 'password' => '<API key>', 'real_name' => '', 'gender' => '0', 'birthday' => '', 'phone_tel' => NULL, 'phone_mob' => NULL, 'im_qq' => '', 'im_msn' => '', 'im_skype' => NULL, 'im_yahoo' => NULL, 'im_aliww' => NULL, 'reg_time' => '1418928900', 'last_login' => '1421803680', 'last_ip' => '27.211.233.48', 'logins' => '208', 'ugrade' => '0', 'portrait' => NULL, 'outer_id' => '0', 'activation' => NULL, 'feed_config' => NULL, 'uin' => '0', 'parentid' => '0', 'user_level' => '0', 'from_weixin' => '0', 'wx_openid' => NULL, 'wx_nickname' => NULL, 'wx_city' => NULL, 'wx_country' => NULL, 'wx_province' => NULL, 'wx_language' => NULL, 'wx_headimgurl' => NULL, 'wx_subscribe_time' => '0', 'wx_id' => '0', 'from_public' => '0', 'm_storeid' => NULL, ), 'store_navs' => array ( ), 'kmenus' => array ( 'kmenus_id' => '42', 'stypeinfo' => '1', 'status' => '0', 'stype' => '1', ), 'kmenusinfo' => array ( ), 'radio_new' => 1, 'radio_recommend' => 1, 'radio_hot' => 1, 'goods_count' => '1107', 'store_gcates' => array ( ), 'functions' => array ( 'editor_multimedia' => 'editor_multimedia', 'coupon' => 'coupon', 'groupbuy' => 'groupbuy', 'enable_radar' => 'enable_radar', 'seckill' => 'seckill', ), 'hot_saleslist' => array ( 104 => array ( 'goods_id' => '104', 'goods_name' => '480g', 'default_image' => 'data/files/store_42/goods_19/<API key>.gif', 'price' => '15.80', 'sales' => '7', ), 526 => array ( 'goods_id' => '526', 'goods_name' => '10', 'default_image' => 'data/files/store_42/goods_110/<API key>.jpg', 'price' => '9.60', 'sales' => '7', ), 843 => array ( 'goods_id' => '843', 'goods_name' => '400g', 'default_image' => 'data/files/store_42/goods_194/<API key>.jpg', 'price' => '1.60', 'sales' => '7', ), 524 => array ( 'goods_id' => '524', 'goods_name' => '120g', 'default_image' => 'data/files/store_42/goods_71/<API key>.jpg', 'price' => '2.50', 'sales' => '5', ), 717 => array ( 'goods_id' => '717', 'goods_name' => '450ml', 'default_image' => 'data/files/store_42/goods_5/<API key>.jpg', 'price' => '3.00', 'sales' => '5', ), 732 => array ( 'goods_id' => '732', 'goods_name' => '600ml', 'default_image' => 'data/files/store_42/goods_101/<API key>.jpg', 'price' => '4.00', 'sales' => '3', ), 999 => array ( 'goods_id' => '999', 'goods_name' => '100g*10', 'default_image' => 'data/files/store_42/goods_199/<API key>.jpg', 'price' => '16.50', 'sales' => '2', ), 1082 => array ( 'goods_id' => '1082', 'goods_name' => '39 ', 'default_image' => 'data/files/store_42/goods_186/<API key>.jpg', 'price' => '39.00', 'sales' => '1', ), 5072 => array ( 'goods_id' => '5072', 'goods_name' => '200ml*16', 'default_image' => 'data/files/store_42/goods_80/<API key>.jpg', 'price' => '28.00', 'sales' => '1', ), 1018 => array ( 'goods_id' => '1018', 'goods_name' => '300g', 'default_image' => 'data/files/store_42/goods_25/<API key>.jpg', 'price' => '4.00', 'sales' => '1', ), ), 'collect_goodslist' => array ( 998 => array ( 'goods_id' => '998', 'goods_name' => '150g', 'default_image' => 'data/files/store_42/goods_29/<API key>.jpg', 'price' => '2.30', 'collects' => '1', ), 961 => array ( 'goods_id' => '961', 'goods_name' => '500ml', 'default_image' => 'data/files/store_42/goods_0/<API key>.jpg', 'price' => '9.80', 'collects' => '1', ), 524 => array ( 'goods_id' => '524', 'goods_name' => '120g', 'default_image' => 'data/files/store_42/goods_71/<API key>.jpg', 'price' => '2.50', 'collects' => '1', ), 868 => array ( 'goods_id' => '868', 'goods_name' => '450g', 'default_image' => 'data/files/store_42/goods_12/<API key>.jpg', 'price' => '13.50', 'collects' => '1', ), 104 => array ( 'goods_id' => '104', 'goods_name' => '480g', 'default_image' => 'data/files/store_42/goods_19/<API key>.gif', 'price' => '15.80', 'collects' => '1', ), 939 => array ( 'goods_id' => '939', 'goods_name' => '400g', 'default_image' => 'data/files/store_42/goods_103/<API key>.jpg', 'price' => '11.80', 'collects' => '1', ), 526 => array ( 'goods_id' => '526', 'goods_name' => '10', 'default_image' => 'data/files/store_42/goods_110/<API key>.jpg', 'price' => '9.60', 'collects' => '1', ), 648 => array ( 'goods_id' => '648', 'goods_name' => '42500ml', 'default_image' => 'data/files/store_42/goods_168/<API key>.jpg', 'price' => '138.00', 'collects' => '1', ), 624 => array ( 'goods_id' => '624', 'goods_name' => '33g', 'default_image' => 'data/files/store_42/goods_107/<API key>.jpg', 'price' => '2.00', 'collects' => '1', ), 638 => array ( 'goods_id' => '638', 'goods_name' => '490ml', 'default_image' => 'data/files/store_42/goods_10/<API key>.jpg', 'price' => '3.00', 'collects' => '1', ), ), 'left_rec_goods' => array ( 104 => array ( 'goods_name' => '480g', 'default_image' => 'data/files/store_42/goods_19/<API key>.gif', 'price' => '15.80', 'sales' => '7', 'goods_id' => '104', ), 5283 => array ( 'goods_name' => '336g ', 'default_image' => 'data/files/store_42/goods_79/<API key>.jpg', 'price' => '59.80', 'sales' => '0', 'goods_id' => '5283', ), 524 => array ( 'goods_name' => '120g', 'default_image' => 'data/files/store_42/goods_71/<API key>.jpg', 'price' => '2.50', 'sales' => '5', 'goods_id' => '524', ), 638 => array ( 'goods_name' => '490ml', 'default_image' => 'data/files/store_42/goods_10/<API key>.jpg', 'price' => '3.00', 'sales' => '0', 'goods_id' => '638', ), 998 => array ( 'goods_name' => '150g', 'default_image' => 'data/files/store_42/goods_29/<API key>.jpg', 'price' => '2.30', 'sales' => '0', 'goods_id' => '998', ), ), ), 'cur_local' => array ( 0 => array ( 'text' => '', 'url' => 'index.php?app=category', ), 1 => array ( 'text' => '', 'url' => 'index.php?app=search&amp;cate_id=691', ), 2 => array ( 'text' => '', 'url' => 'index.php?app=search&amp;cate_id=696', ), 3 => array ( 'text' => '', ), ), 'share' => array ( 4 => array ( 'title' => '', 'link' => 'http: 'type' => 'share', 'sort_order' => 255, 'logo' => 'data/system/kaixin001.gif', ), 3 => array ( 'title' => 'QQ', 'link' => 'http://shuqian.qq.com/post?from=3&title=%E5%A4%A9%E5%96%94%E7%9B%90%E6%B4%A5%E8%91%A1%E8%90%8440g-%E5%BE%AE%E4%BF%A1%E5%95%86%E5%9F%8E++++++&uri=http%3A%2F%2Fwap.bqmart.cn%2Findex.php%3Fapp%3Dgoods%26id%3D652&jumpback=2&noui=1', 'type' => 'collect', 'sort_order' => 255, 'logo' => 'data/system/qqshuqian.gif', ), 2 => array ( 'title' => '', 'link' => 'http://share.renren.com/share/buttonshare.do?link=http%3A%2F%2Fwap.bqmart.cn%2Findex.php%3Fapp%3Dgoods%26id%3D652&title=%E5%A4%A9%E5%96%94%E7%9B%90%E6%B4%A5%E8%91%A1%E8%90%8440g-%E5%BE%AE%E4%BF%A1%E5%95%86%E5%9F%8E', 'type' => 'share', 'sort_order' => 255, 'logo' => 'data/system/renren.gif', ), 1 => array ( 'title' => '', 'link' => 'http://cang.baidu.com/do/add?it=%E5%A4%A9%E5%96%94%E7%9B%90%E6%B4%A5%E8%91%A1%E8%90%8440g-%E5%BE%AE%E4%BF%A1%E5%95%86%E5%9F%8E++++++&iu=http%3A%2F%2Fwap.bqmart.cn%2Findex.php%3Fapp%3Dgoods%26id%3D652&fr=ien#nw=1', 'type' => 'collect', 'sort_order' => 255, 'logo' => 'data/system/baidushoucang.gif', ), ), ); ?>
<!DOCTYPE html> <html class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Benchit — reach your online potential</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="/vendor/bootstrap/dist/css/bootstrap.min.css"> <style> body { padding-top: 50px; padding-bottom: 20px; } </style> <link rel="stylesheet" href="/css/main.css"> <script src="/vendor/modernizr/modernizr.js"></script> <script src="/vendor/jquery/dist/jquery.min.js"></script> </head> <body ng-app="benchit.com"> <div class="navbar navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="/"> <img src="/img/logo-small.png" alt="Benchit"> </a> </div> <p class="navbar-text navbar-right"> <a href="//app.benchit.com/">Sign in</a> </p> </div> </div> <main ui-view></main> <hr> <footer> <p>&copy; Benchit 2014</p> </footer> </div> <script src="/vendor/angular/angular.js"></script> <script src="/vendor/angular-ui-router/release/angular-ui-router.js"></script> <script src="/js/main.js"></script> <script> var _nos = _nos || []; _nos.push(['setAID','BA-0001'],['trackView']); (function(w,d,t,u){ var n=d.createElement(t);n.async=true;n.src=u; var s = d.<API key>(t)[0]; s.parentNode.insertBefore(n, s); }(window,document,'script','//tr.benchit.com/nostradamus.js')); </script> </body> </html>
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownitFootnote = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ // Process footnotes 'use strict'; // Renderer partials function <API key>(tokens, idx, options, env/*, slf*/) { var n = Number(tokens[idx].meta.id + 1).toString(); var prefix = ''; if (typeof env.docId === 'string') { prefix = '-' + env.docId + '-'; } return prefix + n; } function <API key>(tokens, idx/*, options, env, slf*/) { var n = Number(tokens[idx].meta.id + 1).toString(); if (tokens[idx].meta.subId > 0) { n += ':' + tokens[idx].meta.subId; } return '[' + n + ']'; } function render_footnote_ref(tokens, idx, options, env, slf) { var id = slf.rules.<API key>(tokens, idx, options, env, slf); var caption = slf.rules.footnote_caption(tokens, idx, options, env, slf); var refid = id; if (tokens[idx].meta.subId > 0) { refid += ':' + tokens[idx].meta.subId; } return '<sup class="footnote-ref"><a href="#fn' + id + '" id="fnref' + refid + '">' + caption + '</a></sup>'; } function <API key>(tokens, idx, options) { return (options.xhtmlOut ? '<hr class="footnotes-sep" />\n' : '<hr class="footnotes-sep">\n') + '<section class="footnotes">\n' + '<ol class="footnotes-list">\n'; } function <API key>() { return '</ol>\n</section>\n'; } function <API key>(tokens, idx, options, env, slf) { var id = slf.rules.<API key>(tokens, idx, options, env, slf); if (tokens[idx].meta.subId > 0) { id += ':' + tokens[idx].meta.subId; } return '<li id="fn' + id + '" class="footnote-item">'; } function <API key>() { return '</li>\n'; } function <API key>(tokens, idx, options, env, slf) { var id = slf.rules.<API key>(tokens, idx, options, env, slf); if (tokens[idx].meta.subId > 0) { id += ':' + tokens[idx].meta.subId; } return ' <a href="#fnref' + id + '" class="footnote-backref">\u21a9\uFE0E</a>'; } module.exports = function footnote_plugin(md) { var parseLinkLabel = md.helpers.parseLinkLabel, isSpace = md.utils.isSpace; md.renderer.rules.footnote_ref = render_footnote_ref; md.renderer.rules.footnote_block_open = <API key>; md.renderer.rules.<API key> = <API key>; md.renderer.rules.footnote_open = <API key>; md.renderer.rules.footnote_close = <API key>; md.renderer.rules.footnote_anchor = <API key>; // helpers (only used in other rules, no tokens are attached to those) md.renderer.rules.footnote_caption = <API key>; md.renderer.rules.<API key> = <API key>; // Process footnote block definition function footnote_def(state, startLine, endLine, silent) { var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token, initial, offset, ch, posAfterColon, start = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine]; // line should be at least 5 chars - "[^x]:" if (start + 4 > max) { return false; } if (state.src.charCodeAt(start) !== 0x5B) { return false; } if (state.src.charCodeAt(start + 1) !== 0x5E) { return false; } for (pos = start + 2; pos < max; pos++) { if (state.src.charCodeAt(pos) === 0x20) { return false; } if (state.src.charCodeAt(pos) === 0x5D ) { break; } } if (pos === start + 2) { return false; } // no empty footnote labels if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A ) { return false; } if (silent) { return true; } pos++; if (!state.env.footnotes) { state.env.footnotes = {}; } if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; } label = state.src.slice(start + 2, pos - 2); state.env.footnotes.refs[':' + label] = -1; token = new state.Token('<API key>', '', 1); token.meta = { label: label }; token.level = state.level++; state.tokens.push(token); oldBMark = state.bMarks[startLine]; oldTShift = state.tShift[startLine]; oldSCount = state.sCount[startLine]; oldParentType = state.parentType; posAfterColon = pos; initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]); while (pos < max) { ch = state.src.charCodeAt(pos); if (isSpace(ch)) { if (ch === 0x09) { offset += 4 - offset % 4; } else { offset++; } } else { break; } pos++; } state.tShift[startLine] = pos - posAfterColon; state.sCount[startLine] = offset - initial; state.bMarks[startLine] = posAfterColon; state.blkIndent += 4; state.parentType = 'footnote'; if (state.sCount[startLine] < state.blkIndent) { state.sCount[startLine] += state.blkIndent; } state.md.block.tokenize(state, startLine, endLine, true); state.parentType = oldParentType; state.blkIndent -= 4; state.tShift[startLine] = oldTShift; state.sCount[startLine] = oldSCount; state.bMarks[startLine] = oldBMark; token = new state.Token('<API key>', '', -1); token.level = --state.level; state.tokens.push(token); return true; } // Process inline footnotes (^[...]) function footnote_inline(state, silent) { var labelStart, labelEnd, footnoteId, token, tokens, max = state.posMax, start = state.pos; if (start + 2 >= max) { return false; } if (state.src.charCodeAt(start) !== 0x5E) { return false; } if (state.src.charCodeAt(start + 1) !== 0x5B) { return false; } labelStart = start + 2; labelEnd = parseLinkLabel(state, start + 1); // parser failed to find ']', so it's not a valid note if (labelEnd < 0) { return false; } // We found the end of the link, and know for a fact it's a valid link; // so all that's left to do is to call tokenizer. if (!silent) { if (!state.env.footnotes) { state.env.footnotes = {}; } if (!state.env.footnotes.list) { state.env.footnotes.list = []; } footnoteId = state.env.footnotes.list.length; state.md.inline.parse( state.src.slice(labelStart, labelEnd), state.md, state.env, tokens = [] ); token = state.push('footnote_ref', '', 0); token.meta = { id: footnoteId }; state.env.footnotes.list[footnoteId] = { content: state.src.slice(labelStart, labelEnd), tokens: tokens }; } state.pos = labelEnd + 1; state.posMax = max; return true; } // Process footnote references ([^...]) function footnote_ref(state, silent) { var label, pos, footnoteId, footnoteSubId, token, max = state.posMax, start = state.pos; // should be at least 4 chars - "[^x]" if (start + 3 > max) { return false; } if (!state.env.footnotes || !state.env.footnotes.refs) { return false; } if (state.src.charCodeAt(start) !== 0x5B) { return false; } if (state.src.charCodeAt(start + 1) !== 0x5E) { return false; } for (pos = start + 2; pos < max; pos++) { if (state.src.charCodeAt(pos) === 0x20) { return false; } if (state.src.charCodeAt(pos) === 0x0A) { return false; } if (state.src.charCodeAt(pos) === 0x5D ) { break; } } if (pos === start + 2) { return false; } // no empty footnote labels if (pos >= max) { return false; } pos++; label = state.src.slice(start + 2, pos - 1); if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; } if (!silent) { if (!state.env.footnotes.list) { state.env.footnotes.list = []; } if (state.env.footnotes.refs[':' + label] < 0) { footnoteId = state.env.footnotes.list.length; state.env.footnotes.list[footnoteId] = { label: label, count: 0 }; state.env.footnotes.refs[':' + label] = footnoteId; } else { footnoteId = state.env.footnotes.refs[':' + label]; } footnoteSubId = state.env.footnotes.list[footnoteId].count; state.env.footnotes.list[footnoteId].count++; token = state.push('footnote_ref', '', 0); token.meta = { id: footnoteId, subId: footnoteSubId, label: label }; } state.pos = pos; state.posMax = max; return true; } // Glue footnote tokens to end of token stream function footnote_tail(state) { var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel, insideRef = false, refTokens = {}; if (!state.env.footnotes) { return; } state.tokens = state.tokens.filter(function (tok) { if (tok.type === '<API key>') { insideRef = true; current = []; currentLabel = tok.meta.label; return false; } if (tok.type === '<API key>') { insideRef = false; // prepend ':' to avoid conflict with Object.prototype members refTokens[':' + currentLabel] = current; return false; } if (insideRef) { current.push(tok); } return !insideRef; }); if (!state.env.footnotes.list) { return; } list = state.env.footnotes.list; token = new state.Token('footnote_block_open', '', 1); state.tokens.push(token); for (i = 0, l = list.length; i < l; i++) { token = new state.Token('footnote_open', '', 1); token.meta = { id: i, label: list[i].label }; state.tokens.push(token); if (list[i].tokens) { tokens = []; token = new state.Token('paragraph_open', 'p', 1); token.block = true; tokens.push(token); token = new state.Token('inline', '', 0); token.children = list[i].tokens; token.content = list[i].content; tokens.push(token); token = new state.Token('paragraph_close', 'p', -1); token.block = true; tokens.push(token); } else if (list[i].label) { tokens = refTokens[':' + list[i].label]; } if (tokens) state.tokens = state.tokens.concat(tokens); if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') { lastParagraph = state.tokens.pop(); } else { lastParagraph = null; } t = list[i].count > 0 ? list[i].count : 1; for (j = 0; j < t; j++) { token = new state.Token('footnote_anchor', '', 0); token.meta = { id: i, subId: j, label: list[i].label }; state.tokens.push(token); } if (lastParagraph) { state.tokens.push(lastParagraph); } token = new state.Token('footnote_close', '', -1); state.tokens.push(token); } token = new state.Token('<API key>', '', -1); state.tokens.push(token); } md.block.ruler.before('reference', 'footnote_def', footnote_def, { alt: [ 'paragraph', 'reference' ] }); md.inline.ruler.after('image', 'footnote_inline', footnote_inline); md.inline.ruler.after('footnote_inline', 'footnote_ref', footnote_ref); md.core.ruler.after('inline', 'footnote_tail', footnote_tail); }; },{}]},{},[1])(1) });
# == Schema Information # Table name: levels # id :integer not null, primary key # text :text # heading :string # subheading :string # chapeau :text # continuation :text # type :string # created_at :datetime not null # updated_at :datetime not null # bill_id :integer # level_id :integer require 'test_helper' class ParagraphTest < ActiveSupport::TestCase should belong_to(:sub_section).class_name('SubSection').with_foreign_key('level_id') should have_many(:sub_paragraphs).with_foreign_key('level_id').dependent(:destroy) should <API key>(:sub_paragraphs).allow_destroy(true) end
<!DOCTYPE HTML PUBLIC "- <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <title></title> <link rel="stylesheet" href="../fpdoc.css" type="text/css"> </head> <body> <table cellpadding="0" cellspacing="0"> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.addedon.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.addedon.html'; return false;">AddedOn</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.category.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.category.html'; return false;">Category</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.completionon.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.completionon.html'; return false;">CompletionOn</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.dlspeed.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.dlspeed.html'; return false;">DlSpeed</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.eta.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.eta.html'; return false;">Eta</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p>ro&nbsp;</p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.files.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.files.html'; return false;">Files</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.<API key>.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.<API key>.html'; return false;"><API key></a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.forcestart.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.forcestart.html'; return false;">ForceStart</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.hash.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.hash.html'; return false;">Hash</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.name.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.name.html'; return false;">Name</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.numcomplete.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.numcomplete.html'; return false;">NumComplete</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.numincomplete.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.numincomplete.html'; return false;">NumIncomplete</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.numleechs.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.numleechs.html'; return false;">NumLeechs</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.numseeds.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.numseeds.html'; return false;">NumSeeds</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.priority.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.priority.html'; return false;">Priority</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.progress.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.progress.html'; return false;">Progress</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p>ro&nbsp;</p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.properties.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.properties.html'; return false;">Properties</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.ratio.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.ratio.html'; return false;">Ratio</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.savepath.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.savepath.html'; return false;">SavePath</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.seqdl.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.seqdl.html'; return false;">SeqDl</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.size.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.size.html'; return false;">Size</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.state.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.state.html'; return false;">State</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.superseeding.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.superseeding.html'; return false;">SuperSeeding</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p>ro&nbsp;</p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.trackers.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.trackers.html'; return false;">Trackers</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p></p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.upspeed.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.upspeed.html'; return false;">UpSpeed</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> <tr> <td><p>&nbsp;</p></td> <td><p>ro&nbsp;</p></td> <td nowrap="nowrap"><p><a href="../qbtorrents/tqbtorrent.webseeds.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.webseeds.html'; return false;">WebSeeds</a> (<a href="../qbtorrents/tqbtorrent.html" onClick="opener.location.href = '../qbtorrents/tqbtorrent.html'; return false;">TqBTorrent</a>)</p></td> </tr> </table> </body> </html>
author: alex categories: - how to - linux mainclass: linux date: '2016-01-01' lastmod: 2017-09-26T12:46:45+01:00 description: "El otro día me hacía falta convertir cada una de las páginas de un documento pdf a imágenes individuales, con un poco de búsqueda en google lo solucioné y hoy lo comparto con vosotros." url: /<API key>/ tags: - imagemagick - script title: "Cómo convertir un archivo pdf a imágenes" <figure> <img sizes="(min-width: 128px) 128px, 100vw" on="tap:lightbox1" role="button" tabindex="0" layout="responsive" title="sh" src="/img/2012/07/sh1.png" alt="" width="128px" height="128px" /> </figure> El otro día me hacía falta convertir cada una de las páginas de un documento pdf a imágenes individuales, con un poco de búsqueda en google lo solucioné y hoy lo comparto con vosotros. Es necesario tener instalado el paquete imagemagick, si no lo tenemos instalado ejecutamos: bash sudo aptitude install imagemagick Tras instalarlo basta con ejecutar el comando siguiente: bash convert foo.pdf foo.png La extensión de la imagen podemos cambiarla a jpg por ejemplo. Si las imágenes resultan con poca calidad, podemos ejecutar el siguiente comando: bash convert -density 400 foo.pdf -resize 25% foo.png Espero que os sea útil si alguna vez lo necesitáis. Vía | <a href="http:
#!/usr/bin/env ruby require "sinatra" require "open3" if ARGV[0] == "onboot" File.open("/etc/init/dokku-installer.conf", "w") do |f| f.puts "start on runlevel [2345]" f.puts "exec #{File.absolute_path(__FILE__)} selfdestruct" end File.open("/etc/nginx/conf.d/dokku-installer.conf", "w") do |f| f.puts "upstream dokku-installer { server 127.0.0.1:2000; }" f.puts "server {" f.puts " listen 80;" f.puts " location / {" f.puts " proxy_pass http://dokku-installer;" f.puts " }" f.puts "}" end
'use strict'; const request = require('./utils/request'); const R = require('ramda'); function suggest (opts) { return new Promise(function (resolve, reject) { if (!opts && !opts.term) { throw Error('term missing'); } const lang = opts.lang || 'en'; const country = opts.country || 'us'; const term = encodeURIComponent(opts.term); const options = Object.assign({ url: `https://market.android.com/suggest/SuggRequest?json=1&c=3&query=${term}&hl=${lang}&gl=${country}`, json: true, followAllRedirects: true }, opts.requestOptions); request(options, opts.throttle) .then(function (res) { const suggestions = R.pluck('s', res); resolve(suggestions); }) .catch(reject); }); } module.exports = suggest;
const DrawCard = require('../../drawcard.js'); const { Players, CardTypes } = require('../../Constants'); class ShinjoAltansarnai extends DrawCard { setupCardAbilities(ability) { this.reaction({ title: 'Discard a character', when: { onBreakProvince: (event, context) => event.conflict.conflictType === 'military' && context.source.isAttacking() }, target: { activePromptTitle: 'Choose a character to discard', cardType: CardTypes.Character, player: Players.Opponent, controller: Players.Opponent, gameAction: ability.actions.discardFromPlay() } }); } } ShinjoAltansarnai.id = 'shinjo-altansarnai'; module.exports = ShinjoAltansarnai;
#include "maths.h" namespace squish { Sym3x3 <API key>( int n, Vec3 const* points, float const* weights ) { // compute the centroid float total = 0.0f; Vec3 centroid( 0.0f ); for( int i = 0; i < n; ++i ) { total += weights[i]; centroid += weights[i]*points[i]; } centroid /= total; // accumulate the covariance matrix Sym3x3 covariance( 0.0f ); for( int i = 0; i < n; ++i ) { Vec3 a = points[i] - centroid; Vec3 b = weights[i]*a; covariance[0] += a.X()*b.X(); covariance[1] += a.X()*b.Y(); covariance[2] += a.X()*b.Z(); covariance[3] += a.Y()*b.Y(); covariance[4] += a.Y()*b.Z(); covariance[5] += a.Z()*b.Z(); } // return it return covariance; } static Vec3 <API key>( Sym3x3 const& matrix, float evalue ) { // compute M Sym3x3 m; m[0] = matrix[0] - evalue; m[1] = matrix[1]; m[2] = matrix[2]; m[3] = matrix[3] - evalue; m[4] = matrix[4]; m[5] = matrix[5] - evalue; // compute U Sym3x3 u; u[0] = m[3]*m[5] - m[4]*m[4]; u[1] = m[2]*m[4] - m[1]*m[5]; u[2] = m[1]*m[4] - m[2]*m[3]; u[3] = m[0]*m[5] - m[2]*m[2]; u[4] = m[1]*m[2] - m[4]*m[0]; u[5] = m[0]*m[3] - m[1]*m[1]; // find the largest component float mc = SquishMath::fabs( u[0] ); int mi = 0; for( int i = 1; i < 6; ++i ) { float c = SquishMath::fabs( u[i] ); if( c > mc ) { mc = c; mi = i; } } // pick the column with this component switch( mi ) { case 0: return Vec3( u[0], u[1], u[2] ); case 1: case 3: return Vec3( u[1], u[3], u[4] ); default: return Vec3( u[2], u[4], u[5] ); } } static Vec3 <API key>( Sym3x3 const& matrix, float evalue ) { // compute M Sym3x3 m; m[0] = matrix[0] - evalue; m[1] = matrix[1]; m[2] = matrix[2]; m[3] = matrix[3] - evalue; m[4] = matrix[4]; m[5] = matrix[5] - evalue; // find the largest component float mc = SquishMath::fabs( m[0] ); int mi = 0; for( int i = 1; i < 6; ++i ) { float c = SquishMath::fabs( m[i] ); if( c > mc ) { mc = c; mi = i; } } // pick the first eigenvector based on this index switch( mi ) { case 0: case 1: return Vec3( -m[1], m[0], 0.0f ); case 2: return Vec3( m[2], 0.0f, -m[0] ); case 3: case 4: return Vec3( 0.0f, -m[4], m[3] ); default: return Vec3( 0.0f, -m[5], m[4] ); } } Vec3 <API key>( Sym3x3 const& matrix ) { // compute the cubic coefficients float c0 = matrix[0]*matrix[3]*matrix[5] + 2.0f*matrix[1]*matrix[2]*matrix[4] - matrix[0]*matrix[4]*matrix[4] - matrix[3]*matrix[2]*matrix[2] - matrix[5]*matrix[1]*matrix[1]; float c1 = matrix[0]*matrix[3] + matrix[0]*matrix[5] + matrix[3]*matrix[5] - matrix[1]*matrix[1] - matrix[2]*matrix[2] - matrix[4]*matrix[4]; float c2 = matrix[0] + matrix[3] + matrix[5]; // compute the quadratic coefficients float a = c1 - ( 1.0f/3.0f )*c2*c2; float b = ( -2.0f/27.0f )*c2*c2*c2 + ( 1.0f/3.0f )*c1*c2 - c0; // compute the root count check float Q = 0.25f*b*b + ( 1.0f/27.0f )*a*a*a; // test the multiplicity if( FLT_EPSILON < Q ) { // only one root, which implies we have a multiple of the identity return Vec3( 1.0f ); } else if( Q < -FLT_EPSILON ) { // three distinct roots float theta = SquishMath::atan2( SquishMath::sqrt( -Q ), -0.5f*b ); float rho = SquishMath::sqrt( 0.25f*b*b - Q ); float rt = SquishMath::pow( rho, 1.0f/3.0f ); float ct = SquishMath::cos( theta/3.0f ); float st = SquishMath::sin( theta/3.0f ); float l1 = ( 1.0f/3.0f )*c2 + 2.0f*rt*ct; float l2 = ( 1.0f/3.0f )*c2 - rt*( ct + ( float )SquishMath::sqrt( 3.0f )*st ); float l3 = ( 1.0f/3.0f )*c2 - rt*( ct - ( float )SquishMath::sqrt( 3.0f )*st ); // pick the larger if( SquishMath::fabs( l2 ) > SquishMath::fabs( l1 ) ) l1 = l2; if( SquishMath::fabs( l3 ) > SquishMath::fabs( l1 ) ) l1 = l3; // get the eigenvector return <API key>( matrix, l1 ); } else // if( -FLT_EPSILON <= Q && Q <= FLT_EPSILON ) { // two roots float rt; if( b < 0.0f ) rt = -SquishMath::pow( -0.5f*b, 1.0f/3.0f ); else rt = SquishMath::pow( 0.5f*b, 1.0f/3.0f ); float l1 = ( 1.0f/3.0f )*c2 + rt; // repeated float l2 = ( 1.0f/3.0f )*c2 - 2.0f*rt; // get the eigenvector if( SquishMath::fabs( l1 ) > SquishMath::fabs( l2 ) ) return <API key>( matrix, l1 ); else return <API key>( matrix, l2 ); } } } // namespace squish
"use strict"; function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports.ScrollTop = void 0; var _react = <API key>(require("react")); var _propTypes = <API key>(require("prop-types")); var _ClassNames = require("../utils/ClassNames"); var <API key> = require("<API key>"); var _DomHandler = <API key>(require("../utils/DomHandler")); var _Ripple = require("../ripple/Ripple"); function <API key>(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function <API key>() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); <API key> = function <API key>() { return cache; }; return cache; } function <API key>(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = <API key>(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var <API key> = Object.defineProperty && Object.<API key>; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = <API key> ? Object.<API key>(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var <API key> = <API key>(); return function <API key>() { var Super = _getPrototypeOf(Derived), result; if (<API key>) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return <API key>(this, result); }; } function <API key>(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return <API key>(self); } function <API key>(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function <API key>() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var ScrollTop = /*#__PURE__*/function (_Component) { _inherits(ScrollTop, _Component); var _super = _createSuper(ScrollTop); function ScrollTop(props) { var _this; _classCallCheck(this, ScrollTop); _this = _super.call(this, props); _this.state = { visible: false }; _this.onClick = _this.onClick.bind(<API key>(_this)); return _this; } _createClass(ScrollTop, [{ key: "onClick", value: function onClick() { var scrollElement = this.props.target === 'window' ? window : this.helper.parentElement; scrollElement.scroll({ top: 0, behavior: this.props.behavior }); } }, { key: "checkVisibility", value: function checkVisibility(scrollY) { this.setState({ visible: scrollY > this.props.threshold }); } }, { key: "<API key>", value: function <API key>() { var _this2 = this; this.scrollListener = function () { _this2.checkVisibility(_this2.helper.parentElement.scrollTop); }; this.helper.parentElement.addEventListener('scroll', this.scrollListener); } }, { key: "<API key>", value: function <API key>() { var _this3 = this; this.scrollListener = function () { _this3.checkVisibility(_DomHandler.default.getWindowScrollTop()); }; window.addEventListener('scroll', this.scrollListener); } }, { key: "<API key>", value: function <API key>() { if (this.scrollListener) { this.helper.parentElement.removeEventListener('scroll', this.scrollListener); this.scrollListener = null; } } }, { key: "<API key>", value: function <API key>() { if (this.scrollListener) { window.removeEventListener('scroll', this.scrollListener); this.scrollListener = null; } } }, { key: "onEnter", value: function onEnter(el) { el.style.zIndex = String(_DomHandler.default.generateZIndex()); } }, { key: "componentDidMount", value: function componentDidMount() { if (this.props.target === 'window') this.<API key>();else if (this.props.target === 'parent') this.<API key>(); } }, { key: "<API key>", value: function <API key>() { if (this.props.target === 'window') this.<API key>();else if (this.props.target === 'parent') this.<API key>(); } }, { key: "render", value: function render() { var _this4 = this; var className = (0, _ClassNames.classNames)('p-scrolltop p-link p-component', { 'p-scrolltop-sticky': this.props.target !== 'window' }, this.props.className); var iconClassName = (0, _ClassNames.classNames)('p-scrolltop-icon', this.props.icon); var isTargetParent = this.props.target === 'parent'; return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(<API key>.CSSTransition, { classNames: "p-scrolltop", in: this.state.visible, timeout: { enter: 150, exit: 150 }, unmountOnExit: true, onEnter: this.onEnter }, /*#__PURE__*/_react.default.createElement("button", { type: "button", className: className, style: this.props.style, onClick: this.onClick }, /*#__PURE__*/_react.default.createElement("span", { className: iconClassName }), /*#__PURE__*/_react.default.createElement(_Ripple.Ripple, null))), isTargetParent && /*#__PURE__*/_react.default.createElement("span", { ref: function ref(el) { return _this4.helper = el; }, className: "p-scrolltop-helper" })); } }]); return ScrollTop; }(_react.Component); exports.ScrollTop = ScrollTop; _defineProperty(ScrollTop, "defaultProps", { target: 'window', threshold: 400, icon: 'pi pi-chevron-up', behavior: 'smooth', className: null, style: null }); _defineProperty(ScrollTop, "propTypes", { target: _propTypes.default.string, threshold: _propTypes.default.number, icon: _propTypes.default.string, behavior: _propTypes.default.string, className: _propTypes.default.string, style: _propTypes.default.object });
/* global suite, beforeEach, afterEach, test, assert */ var fs = require('fs'); var path = require('path'); var temp = require('temp'); var rimraf = require('rimraf'); var walkSync = require('walk-sync'); var playground = require('..'); // Set CWD to the test output directory process.chdir('./test/'); // Automatically track and cleanup files at exit temp.track(); var FIXTURES_DIR = path.join(__dirname, 'fixtures'); var EXPECTED_DIR = path.join(__dirname, 'expected'); var OUTPUT_DIR = temp.mkdirSync('playground'); function <API key>(actual, expected) { expected = path.join(EXPECTED_DIR, expected); assert.isDirectory(actual, 'playground exists'); var actualFiles = walkSync(actual); var expectedFiles = walkSync(expected).filter(function(file) { return file.indexOf('.DS_Store') === -1; // ignore pesky .DS_Store }); assert.deepEqual(actualFiles, expectedFiles, 'file structure'); actualFiles.forEach(function(filePath) { if (filePath.charAt(filePath.length - 1) !== '/') { var expectedContents = fs.readFileSync(path.join(expected, filePath)).toString(); assert.fileContent(path.join(actual, filePath), expectedContents, 'content of ' + filePath); } }); } suite('Node.js module'); afterEach(function() { // clean up rimraf.sync(path.join(process.cwd(), 'MyPlayground.playground')); rimraf.sync(path.join(process.cwd(), 'Test.playground')); rimraf.sync(path.join(process.cwd(), 'Test2.playground')); }); test('public methods exist', function() { assert.isFunction(playground.createFromFile, 'createFromFile'); assert.isFunction(playground.createFromFiles, 'createFromFiles'); assert.isFunction(playground.createFromString, 'createFromString'); }); test('createFromString, default options', function(done) { var markdown = fs.readFileSync(path.join(FIXTURES_DIR, 'Test.md')).toString(); playground.createFromString(markdown, function(err) { if (err) { return done(err); } <API key>(path.join(process.cwd(), 'MyPlayground.playground'), 'Test.playground'); done(); }); }); test('createFromString, "name" and "outputDirectory" options', function(done) { var markdown = fs.readFileSync(path.join(FIXTURES_DIR, 'Test.md')).toString(); playground.createFromString(markdown, { name: 'CustomName', outputDirectory: OUTPUT_DIR }, function(err) { if (err) { return done(err); } <API key>(path.join(OUTPUT_DIR, 'CustomName.playground'), 'Test.playground'); done(); }); }); test('createFromFile, given a file', function(done) { playground.createFromFile(path.join(FIXTURES_DIR, 'Test.md'), { outputDirectory: OUTPUT_DIR }, function(err) { if (err) { return done(err); } <API key>(path.join(OUTPUT_DIR, 'Test.playground'), 'Test.playground'); done(); }); }); test('createFromFiles, given a array of files', function(done) { playground.createFromFiles([ path.join(FIXTURES_DIR, 'Test.md'), path.join(FIXTURES_DIR, 'Test2.md') ], { outputDirectory: OUTPUT_DIR }, function(err) { if (err) { return done(err); } <API key>(path.join(OUTPUT_DIR, 'Test.playground'), 'Test.playground'); <API key>(path.join(OUTPUT_DIR, 'Test2.playground'), 'Test2.playground'); done(); }); }); test('createFromFiles, given a directory', function(done) { playground.createFromFiles(FIXTURES_DIR, { outputDirectory: OUTPUT_DIR }, function(err) { if (err) { return done(err); } <API key>(path.join(OUTPUT_DIR, 'Test.playground'), 'Test.playground'); <API key>(path.join(OUTPUT_DIR, 'Test2.playground'), 'Test2.playground'); done(); }); }); test('"platform" and "allowsReset" options', function(done) { playground.createFromFile(path.join(FIXTURES_DIR, 'iOS.md'), { outputDirectory: OUTPUT_DIR, platform: 'ios', allowsReset: false }, function(err) { if (err) { return done(err); } <API key>(path.join(OUTPUT_DIR, 'iOS.playground'), 'iOS.playground'); done(); }); }); test('"stylesheet" option', function(done) { playground.createFromFile(path.join(FIXTURES_DIR, 'Stylesheet.md'), { outputDirectory: OUTPUT_DIR, stylesheet: path.join(FIXTURES_DIR, 'custom.css') }, function(err) { if (err) { return done(err); } <API key>(path.join(OUTPUT_DIR, 'Stylesheet.playground'), 'Stylesheet.playground'); done(); }); }); test('Kramdown-style code blocks', function(done) { playground.createFromFile(path.join(FIXTURES_DIR, 'Kramdown.md'), { outputDirectory: OUTPUT_DIR }, function(err) { if (err) { return done(err); } <API key>(path.join(OUTPUT_DIR, 'Kramdown.playground'), 'Kramdown.playground'); done(); }); }); test('reference-style links and images', function(done) { playground.createFromFile(path.join(FIXTURES_DIR, 'References.md'), { outputDirectory: OUTPUT_DIR }, function(err) { if (err) { return done(err); } <API key>(path.join(OUTPUT_DIR, 'References.playground'), 'References.playground'); done(); }); });
ALTER TABLE testtable DROP CONSTRAINT field4check; ALTER TABLE testtable ADD CONSTRAINT field4check CHECK ((field4 > (0.0)::double precision));
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // TWTToast/UIKit/<API key> #define <API key> #define <API key> 0 #define <API key> 15 #define <API key> 0
<! Created by wangWei on 2016/5/15. <section class="item"> <section class="item_main"> <div class="item_head"> <p class="time" ng-bind="item.currentTime|timeFormate"></p> <span class="from" ng-if="topicStatus.showTopic"> <a ui-sref="topic({'topicId':itemTopic._id})" ng-repeat="itemTopic in item.topics"> {{itemTopic.name}} </a> </span> </div> <div class="item_content"> <p class="content_title"> <a ui-sref="detail({id:item._id})" ng-bind="item.title"></a> </p> <div class="content_with_img" ng-if="item.img"> <div class="col-xs-10"> <p class="content" ng-bind-html="item.summaryContent|trustHtml"> </p> </div> <div class="col-xs-2"> <img class="img-responsive" ng-src="{{item.img}}"> </div> </div> <div class="content_no_img" ng-if="!item.img"> <p class="content" ng-bind-html="item.summaryContent|trustHtml"> </p> </div> </div> <p class="readMore"> <a ui-sref="detail({id:item._id})">[]</a> </p> </section> </section>
describe Spotify do describe "VERSION" do it "is defined" do expect(defined?(Spotify::VERSION)).to eq "constant" end it "is the same version as in api.h" do spotify_version = API_H_SRC.match(/#define\s+SPOTIFY_API_VERSION\s+(\d+)/)[1] expect(Spotify::API_VERSION.to_i).to eq spotify_version.to_i end end describe "proxying" do it "responds to the spotify methods" do expect(Spotify).to respond_to :error_message end it "allows creating proxy methods" do expect(api).to receive(:error_message).and_return("Some error") expect(Spotify.method(:error_message).call).to eq "Some error" end end describe ".log" do it "print nothing if not debugging" do out, err = spy_output do old_debug, $DEBUG = $DEBUG, false Spotify.log "They see me loggin'" $DEBUG = old_debug end expect(out).to be_empty expect(err).to be_empty end it "prints output and path if debugging" do suppress = true out, err = spy_output(suppress) do old_debug, $DEBUG = $DEBUG, true Spotify.log "Testin' Spotify log" $DEBUG = old_debug end expect(out).to match "Testin' Spotify log" expect(out).to match "spec/spotify_spec.rb" expect(err).to be_empty end end describe ".try" do it "raises an error when the result is not OK" do expect(api).to receive(:error_example).and_return(Spotify::APIError.from_native(5, nil)) expect { Spotify.try(:error_example) }.to raise_error(Spotify::<API key>, /Invalid application key/) end it "does not raise an error when the result is OK" do expect(api).to receive(:error_example).and_return(nil) expect(Spotify.try(:error_example)).to eq nil end it "does not raise an error when the result is not an error-type" do result = Object.new expect(api).to receive(:error_example).and_return(result) expect(Spotify.try(:error_example)).to eq result end it "does not raise an error when the resource is loading" do expect(api).to receive(:error_example).and_return(Spotify::APIError.from_native(17, nil)) error = Spotify.try(:error_example) expect(error).to be_a(Spotify::IsLoadingError) expect(error.message).to match /Resource not loaded yet/ end end end
//! A numerical value which represents the unique identifier of a registered type. // https://developer.gnome.org/gobject/unstable/<API key>.html#GType pub mod g_type { use ffi; use std::ffi::CString; use std::slice; use glib::translate::{FromGlibPtr, ToGlibPtr}; use glib_ffi::{self}; pub fn name(_type: glib_ffi::GType) -> Option<String> { unsafe { from_glib_none(ffi::g_type_name(_type)) } } pub fn from_name(name: &str) -> glib_ffi::GType { unsafe { ffi::g_type_from_name(name.to_glib_none().0) } } pub fn parent(_type: glib_ffi::GType) -> glib_ffi::GType { unsafe { ffi::g_type_parent(_type) } } pub fn depth(_type: glib_ffi::GType) -> u32 { unsafe { ffi::g_type_depth(_type) } } pub fn next_base(leaf_type: glib_ffi::GType, root_type: glib_ffi::GType) -> glib_ffi::GType { unsafe { ffi::g_type_next_base(leaf_type, root_type) } } pub fn is_a(_type: glib_ffi::GType, is_a_type: glib_ffi::GType) -> bool { unsafe { to_bool(ffi::g_type_is_a(_type, is_a_type)) } } pub fn children(_type: glib_ffi::GType) -> Vec<glib_ffi::GType> { let mut n_children = 0u32; let tmp_vec = unsafe { ffi::g_type_children(_type, &mut n_children) }; if n_children == 0u32 || tmp_vec.is_null() { Vec::new() } else { unsafe { Vec::from( slice::from_raw_parts( tmp_vec as *const glib_ffi::GType, n_children as usize)) } } } pub fn interfaces(_type: glib_ffi::GType) -> Vec<glib_ffi::GType> { let mut n_interfaces = 0u32; let tmp_vec = unsafe { ffi::g_type_interfaces(_type, &mut n_interfaces) }; if n_interfaces == 0u32 || tmp_vec.is_null() { Vec::new() } else { unsafe { Vec::from( slice::from_raw_parts( tmp_vec as *const glib_ffi::GType, n_interfaces as usize)) } } } pub fn <API key>(interface_type: glib_ffi::GType) -> Vec<glib_ffi::GType> { let mut n_prerequisites = 0u32; let tmp_vec = unsafe { ffi::<API key>(interface_type, &mut n_prerequisites) }; if n_prerequisites == 0u32 || tmp_vec.is_null() { Vec::new() } else { unsafe { Vec::from( slice::from_raw_parts( tmp_vec as *const glib_ffi::GType, n_prerequisites as usize)) } } } pub fn <API key>(interface_type: glib_ffi::GType, prerequisite_type: glib_ffi::GType) { unsafe { ffi::<API key>(interface_type, prerequisite_type) } } pub fn fundamental_next() -> glib_ffi::GType { unsafe { ffi::<API key>() } } pub fn fundamental(type_id: glib_ffi::GType) -> glib_ffi::GType { unsafe { ffi::g_type_fundamental(type_id) } } pub fn ensure(_type: glib_ffi::GType) { unsafe { ffi::g_type_ensure(_type) } } pub fn <API key>() -> u32 { unsafe { ffi::<API key>() } } }
import { expect } from 'chai'; import <API key> from './<API key>'; import actionTypes from './baseActionTypes'; describe('<API key>', () => { it('should be a function', () => { expect(<API key>).to.be.a('function'); }); it('should return a reducer', () => { expect(<API key>(actionTypes)) .to.be.a('function'); }); describe('defaultDataReducer', () => { const reducer = <API key>(actionTypes); it('should have initial state', () => { expect(reducer(undefined, {})).to.deep.equal({}); }); it('should return original state on unhandled actions', () => { const originalState = {}; expect(reducer(originalState, { type: 'foo', })).to.equal(originalState); }); it('should reset to empty object on resetSuccess', () => { expect(reducer( { foo: 'bar', }, { type: actionTypes.resetSuccess, } )).to.deep.equal({}); }); it('should return new state with new data on matchSuccess', () => { const data = { foo: ['bar'], }; const name = 'rogue'; const now = Date.now(); expect(reducer({}, { type: actionTypes.matchSuccess, data, name, queries: ['foo'], timestamp: now, })).to.deep.equal({ foo: { [name]: { data: data.foo, _t: now, }, }, }); }); it('should mark an entry with timestamp if match is not found', () => { const data = { foo: [], }; const name = 'rogue'; const now = Date.now(); expect(reducer({}, { type: actionTypes.matchSuccess, data, name, queries: ['foo'], timestamp: now, })).to.deep.equal({ foo: { [name]: { _t: now, data: [], }, }, }); }); it('should mark entry with timestamp if it is no longer in queries', () => { const state = { foo: { bar: {}, }, }; const ttl = 30; const now = Date.now(); expect(reducer(state, { type: actionTypes.cleanUp, ttl, timestamp: now, queries: [], })).to.deep.equal({ foo: { _t: now, bar: {}, }, }); }); it('should remove entry from state if it is marked for longer than ttl', () => { const now = Date.now(); const state = { foo: { _t: now - 50, bar: {}, }, }; const ttl = 30; expect(reducer(state, { type: actionTypes.cleanUp, ttl, queries: [], timestamp: now, })).to.deep.equal({}); }); it('should return original state if nothing has changed', () => { const state = { foo: { bar: {}, }, }; const ttl = 30; const now = Date.now(); expect(reducer(state, { type: actionTypes.cleanUp, ttl, timestamp: now, queries: ['foo'], })).to.equal(state); }); it('should not remove entry if the marked time is less than ttl', () => { const now = Date.now(); const state = { foo: { _t: now - 20, bar: {}, }, }; const ttl = 30; expect(reducer(state, { type: actionTypes.cleanUp, ttl, queries: [], timestamp: now, })).to.equal(state); }); it('should remove timestamp on entries if it is found in queries again', () => { const now = Date.now(); const state = { foo: { _t: now - 50, bar: {}, }, }; const ttl = 30; expect(reducer(state, { type: actionTypes.cleanUp, ttl, queries: ['foo'], timestamp: now, })).to.deep.equal({ foo: { bar: {}, }, }); }); }); });
<?php namespace Anomaly\Streams\Platform\Addon\Module\Console; use Anomaly\Streams\Platform\Addon\Module\Module; use Anomaly\Streams\Platform\Addon\Module\ModuleCollection; use Anomaly\Streams\Platform\Addon\Module\ModuleManager; use Illuminate\Console\Command; use Symfony\Component\Console\Input\InputArgument; use Exception; class Uninstall extends Command { /** * The console command name. * * @var string */ protected $name = 'module:uninstall'; /** * The console command description. * * @var string */ protected $description = 'Uninstall a module.'; /** * Execute the console command. * * @param ModuleManager $manager * @param ModuleCollection $modules */ public function fire(ModuleManager $manager, ModuleCollection $modules) { /* @var Module $module */ $module = $modules->get($this->argument('module')); if (!$module) { throw new Exception('Module ' . $this->argument('module') . ' does not exist or is not installed.'); } $manager->uninstall($module); $this->info(trans($module->getName()) . ' uninstalled successfully!'); } /** * Get the console command arguments. * * @return array */ protected function getArguments() { return [ ['module', InputArgument::REQUIRED, 'The module\'s dot namespace.'], ]; } }
// See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Beatmaps; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.Leaderboards; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Scoring; namespace osu.Game.Screens.Select.Leaderboards { public class BeatmapLeaderboard : Leaderboard<<API key>, ScoreInfo> { public Action<ScoreInfo> ScoreSelected; [Resolved] private RulesetStore rulesets { get; set; } private BeatmapInfo beatmap; public BeatmapInfo Beatmap { get => beatmap; set { if (beatmap == value) return; beatmap = value; Scores = null; UpdateScores(); } } private bool filterMods; private IBindable<WeakReference<ScoreInfo>> itemRemoved; private IBindable<WeakReference<ScoreInfo>> itemAdded; <summary> Whether to apply the game's currently selected mods as a filter when retrieving scores. </summary> public bool FilterMods { get => filterMods; set { if (value == filterMods) return; filterMods = value; UpdateScores(); } } [Resolved] private ScoreManager scoreManager { get; set; } [Resolved] private IBindable<RulesetInfo> ruleset { get; set; } [Resolved] private IBindable<IReadOnlyList<Mod>> mods { get; set; } [Resolved] private IAPIProvider api { get; set; } [<API key>] private void load() { ruleset.ValueChanged += _ => UpdateScores(); mods.ValueChanged += _ => { if (filterMods) UpdateScores(); }; itemRemoved = scoreManager.ItemRemoved.GetBoundCopy(); itemRemoved.BindValueChanged(onScoreRemoved); itemAdded = scoreManager.ItemUpdated.GetBoundCopy(); itemAdded.BindValueChanged(onScoreAdded); } protected override void Reset() { base.Reset(); TopScore = null; } private void onScoreRemoved(ValueChangedEvent<WeakReference<ScoreInfo>> score) => scoreStoreChanged(score); private void onScoreAdded(ValueChangedEvent<WeakReference<ScoreInfo>> score) => scoreStoreChanged(score); private void scoreStoreChanged(ValueChangedEvent<WeakReference<ScoreInfo>> score) { if (Scope != <API key>.Local) return; if (score.NewValue.TryGetTarget(out var scoreInfo)) { if (Beatmap?.ID != scoreInfo.BeatmapInfoID) return; } RefreshScores(); } protected override bool IsOnlineScope => Scope != <API key>.Local; protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback) { if (Beatmap == null) { PlaceholderState = PlaceholderState.NoneSelected; return null; } if (Scope == <API key>.Local) { var scores = scoreManager .QueryScores(s => !s.DeletePending && s.Beatmap.ID == Beatmap.ID && s.Ruleset.ID == ruleset.Value.ID); if (filterMods && !mods.Value.Any()) { // we need to filter out all scores that have any mods to get all local nomod scores scores = scores.Where(s => !s.Mods.Any()); } else if (filterMods) { // otherwise find all the scores that have *any* of the currently selected mods (similar to how web applies mod filters) // we're creating and using a string list representation of selected mods so that it can be translated into the DB query itself var selectedMods = mods.Value.Select(m => m.Acronym); scores = scores.Where(s => s.Mods.Any(m => selectedMods.Contains(m.Acronym))); } Scores = scores.OrderByDescending(s => s.TotalScore).ToArray(); PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores; return null; } if (api?.IsLoggedIn != true) { PlaceholderState = PlaceholderState.NotLoggedIn; return null; } if (Beatmap.OnlineBeatmapID == null || Beatmap?.Status <= <API key>.Pending) { PlaceholderState = PlaceholderState.Unavailable; return null; } if (!api.LocalUser.Value.IsSupporter && (Scope != <API key>.Global || filterMods)) { PlaceholderState = PlaceholderState.NotSupporter; return null; } IReadOnlyList<Mod> requestMods = null; if (filterMods && !mods.Value.Any()) // add nomod for the request requestMods = new Mod[] { new ModNoMod() }; else if (filterMods) requestMods = mods.Value; var req = new GetScoresRequest(Beatmap, ruleset.Value ?? Beatmap.Ruleset, Scope, requestMods); req.Success += r => { scoresCallback?.Invoke(r.Scores.Select(s => s.CreateScoreInfo(rulesets))); TopScore = r.UserScore?.CreateScoreInfo(rulesets); }; return req; } protected override LeaderboardScore CreateDrawableScore(ScoreInfo model, int index) => new LeaderboardScore(model, index, IsOnlineScope) { Action = () => ScoreSelected?.Invoke(model) }; protected override LeaderboardScore <API key>(ScoreInfo model) => new LeaderboardScore(model, model.Position, false) { Action = () => ScoreSelected?.Invoke(model) }; } }
Imports System.Collections.ObjectModel ''' <summary> ''' Interaction logic for MainWindow.xaml
<html lang="en"> <head> <title>clock - Untitled</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Untitled"> <meta name="generator" content="makeinfo 4.11"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Timefns.html#Timefns" title="Timefns"> <link rel="prev" href="asctime.html#asctime" title="asctime"> <link rel="next" href="ctime.html#ctime" title="ctime"> <link href="http: <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><! pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <p> <a name="clock"></a> Next:&nbsp;<a rel="next" accesskey="n" href="ctime.html#ctime">ctime</a>, Previous:&nbsp;<a rel="previous" accesskey="p" href="asctime.html#asctime">asctime</a>, Up:&nbsp;<a rel="up" accesskey="u" href="Timefns.html#Timefns">Timefns</a> <hr> </div> <h3 class="section">8.2 <code>clock</code>&mdash;cumulative processor time</h3> <p><a name="index-clock-430"></a><strong>Synopsis</strong> <pre class="example"> #include &lt;time.h&gt; clock_t clock(void); </pre> <p><strong>Description</strong><br> Calculates the best available approximation of the cumulative amount of time used by your program since it started. To convert the result into seconds, divide by the macro <code>CLOCKS_PER_SEC</code>. <p><br> <strong>Returns</strong><br> The amount of processor time used so far by your program, in units defined by the machine-dependent macro <code>CLOCKS_PER_SEC</code>. If no measurement is available, the result is (clock_t)<code>-1</code>. <p><br> <strong>Portability</strong><br> ANSI C requires <code>clock</code> and <code>CLOCKS_PER_SEC</code>. <p>Supporting OS subroutine required: <code>times</code>. <p><br> </body></html>
function isBackboneBase(node, settings) { "use strict"; var prefixes = settings.Collection.concat(settings.Model, settings.View).map(function(item) { return item.prefix; }); return node.type === "CallExpression" && node.callee.type === "MemberExpression" && ( (node.callee.object.type === "MemberExpression" && prefixes.indexOf(node.callee.object.object.name) > -1) || (node.callee.object.type === "Identifier" && prefixes.indexOf(node.callee.object.name) > -1) ) && node.callee.property.name === "extend"; } function parseSettings(settings) { "use strict"; return settings.map(function(setting) { var splitValue = setting.split("."); return splitValue.length > 1 ? { prefix: splitValue[0], postfix: splitValue[1] } : { prefix: splitValue[0] }; }); } function normalizeSettings(originalSettings) { "use strict"; originalSettings = originalSettings || {}; var settings = {}; settings.Collection = originalSettings.Collection ? originalSettings.Collection.concat("Backbone.Collection") : ["Backbone.Collection"]; settings.Collection = parseSettings(settings.Collection); settings.Model = originalSettings.Model ? originalSettings.Model.concat("Backbone.Model") : ["Backbone.Model"]; settings.Model = parseSettings(settings.Model); settings.View = originalSettings.View ? originalSettings.View.concat("Backbone.View") : ["Backbone.View"]; settings.View = parseSettings(settings.View); return settings; } function <API key>(settings, object) { "use strict"; return settings.some(function(item) { return item.postfix && object.property ? item.postfix === object.property.name : item.prefix === object.name; }); } function isBackboneModel(node, settings) { "use strict"; settings = normalizeSettings(settings); return isBackboneBase(node, settings) && <API key>(settings.Model, node.callee.object); } function isBackboneView(node, settings) { "use strict"; settings = normalizeSettings(settings); return isBackboneBase(node, settings) && <API key>(settings.View, node.callee.object); } function <API key>(node, settings) { "use strict"; settings = normalizeSettings(settings); return isBackboneBase(node, settings) && <API key>(settings.Collection, node.callee.object); } function isBackboneAny(node, settings) { "use strict"; settings = normalizeSettings(settings); return isBackboneBase(node, settings) && node.callee && node.callee.object && (<API key>(settings.Model, node.callee.object) || <API key>(settings.View, node.callee.object) || <API key>(settings.Collection, node.callee.object)); } exports.isBackboneAny = isBackboneAny; exports.isBackboneModel = isBackboneModel; exports.isBackboneView = isBackboneView; exports.<API key> = <API key>; exports.<API key> = function(node, settings) { "use strict"; var parent = node.parent, grandparent = parent.parent, greatgrandparent = grandparent.parent; return isBackboneAny(greatgrandparent, settings); }; exports.<API key> = function(node, settings) { "use strict"; var parent = node.parent, grandparent = parent.parent, greatgrandparent = grandparent.parent; return isBackboneModel(greatgrandparent, settings); }; exports.<API key> = function(node, settings) { "use strict"; var parent = node.parent, grandparent = parent.parent, greatgrandparent = grandparent.parent; return isBackboneView(greatgrandparent, settings); }; exports.<API key> = function(node, settings) { "use strict"; var parent = node.parent, grandparent = parent.parent, greatgrandparent = grandparent.parent; return <API key>(greatgrandparent, settings); };
"""Handle nice names""" import base64 from pysyte.oss import platforms def nice(data): return base64.b64encode(bytes(data, 'utf-8')) def name(data): return base64.b64decode(data).decode('utf-8') def chmod(data, *_): platforms.put_clipboard_data(name(data)) return ''
# This file is generated by gyp; do not edit. export builddir_name ?= ./build/. .PHONY: all all: $(MAKE) spi_binding
#include <hl.h> #ifndef HL_NATIVE_UCHAR_FUN #include <stdarg.h> #ifdef HL_ANDROID # include <android/log.h> # ifndef HL_ANDROID_LOG_TAG # define HL_ANDROID_LOG_TAG "hl" # endif # ifndef <API key> # define <API key> ANDROID_LOG_DEBUG # endif # define LOG_ANDROID(cfmt,cstr) __android_log_print(<API key>, HL_ANDROID_LOG_TAG, cfmt, cstr); #endif int ustrlen( const uchar *str ) { const uchar *p = str; while( *p ) p++; return (int)(p - str); } int ustrlen_utf8( const uchar *str ) { int size = 0; while(1) { uchar c = *str++; if( c == 0 ) break; if( c < 0x80 ) size++; else if( c < 0x800 ) size += 2; else size += 3; } return size; } uchar *ustrdup( const uchar *str ) { int len = ustrlen(str); int size = (len + 1) << 1; uchar *d = (uchar*)malloc(size); memcpy(d,str,size); return d; } double utod( const uchar *str, uchar **end ) { char buf[31]; char *bend; int i = 0; double v; while( *str == ' ' ) str++; while( i < 30 ) { int c = *str++; if( (c < '0' || c > '9') && c != '.' && c != 'e' && c != 'E' && c != '-' && c != '+' ) break; buf[i++] = (char)c; } buf[i] = 0; v = strtod(buf,&bend); *end = (uchar*)(str - 1) + (bend - buf); return v; } int utoi( const uchar *str, uchar **end ) { char buf[17]; char *bend; int i = 0; int v; while( *str == ' ' ) str++; while( i < 16 ) { int c = *str++; if( (c < '0' || c > '9') && c != '-' ) break; buf[i++] = (char)c; } buf[i] = 0; v = strtol(buf,&bend,10); *end = (uchar*)(str - 1) + (bend - buf); return v; } int ucmp( const uchar *a, const uchar *b ) { while(true) { int d = (unsigned)*a - (unsigned)*b; if( d ) return d; if( !*a ) return 0; a++; b++; } } int usprintf( uchar *out, int out_size, const uchar *fmt, ... ) { va_list args; int ret; va_start(args, fmt); ret = uvszprintf(out, out_size, fmt, args); va_end(args); return ret; } // USE UTF-8 encoding int utostr( char *out, int out_size, const uchar *str ) { char *start = out; char *end = out + out_size - 1; // final 0 if( out_size <= 0 ) return 0; while( out < end ) { unsigned int c = *str++; if( c == 0 ) break; if( c < 0x80 ) *out++ = (char)c; else if( c < 0x800 ) { if( out + 2 > end ) break; *out++ = (char)(0xC0|(c>>6)); *out++ = 0x80|(c&63); } else { if( out + 3 > end ) break; *out++ = (char)(0xE0|(c>>12)); *out++ = 0x80|((c>>6)&63); *out++ = 0x80|(c&63); } } *out = 0; return (int)(out - start); } static char *utos( const uchar *s ) { int len = ustrlen_utf8(s); char *out = (char*)malloc(len + 1); if( utostr(out,len+1,s) < 0 ) *out = 0; return out; } void uprintf( const uchar *fmt, const uchar *str ) { char *cfmt = utos(fmt); char *cstr = utos(str); #ifdef HL_ANDROID LOG_ANDROID(cfmt,cstr); #else printf(cfmt,cstr); #endif free(cfmt); free(cstr); } #endif #if !defined(HL_NATIVE_UCHAR_FUN) || defined(HL_WIN) HL_PRIM int uvszprintf( uchar *out, int out_size, const uchar *fmt, va_list arglist ) { uchar *start = out; uchar *end = out + out_size - 1; char cfmt[20]; char tmp[32]; uchar c; while(true) { sprintf_loop: c = *fmt++; if( out == end ) c = 0; switch( c ) { case 0: *out = 0; return (int)(out - start); case '%': { int i = 0, size = 0; cfmt[i++] = '%'; while( true ) { c = *fmt++; cfmt[i++] = (char)c; switch( c ) { case 'd': cfmt[i++] = 0; size = sprintf(tmp,cfmt,va_arg(arglist,int)); goto sprintf_add; case 'f': cfmt[i++] = 0; size = sprintf(tmp,cfmt,va_arg(arglist,double)); // according to GCC warning, float is promoted to double in var_args goto sprintf_add; case 'g': cfmt[i++] = 0; size = sprintf(tmp,cfmt,va_arg(arglist,double)); goto sprintf_add; case 'x': case 'X': cfmt[i++] = 0; if( cfmt[i-3] == 'l' ) size = sprintf(tmp,cfmt,va_arg(arglist,void*)); else size = sprintf(tmp,cfmt,va_arg(arglist,int)); goto sprintf_add; case 's': if( i != 2 ) hl_fatal("Unsupported printf format"); // no support for precision qualifier { uchar *s = va_arg(arglist,uchar *); while( *s && out < end ) *out++ = *s++; goto sprintf_loop; } case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'l': break; default: hl_fatal("Unsupported printf format"); break; } } sprintf_add: // copy from c string to u string i = 0; while( i < size && out < end ) *out++ = tmp[i++]; } break; default: *out++ = c; break; } } return 0; } #endif
import <API key> from "@babel/runtime/helpers/esm/<API key>"; import _extends from "@babel/runtime/helpers/esm/extends"; import * as React from 'react'; import PropTypes from 'prop-types'; import * as ReactDOM from 'react-dom'; import { <API key> } from '@material-ui/utils'; import { getThemeProps } from '@material-ui/styles'; import Drawer, { getAnchor, isHorizontal } from '../Drawer/Drawer'; import ownerDocument from '../utils/ownerDocument'; import useEventCallback from '../utils/useEventCallback'; import { duration } from '../styles/transitions'; import useTheme from '../styles/useTheme'; import { getTransitionProps } from '../transitions/utils'; import NoSsr from '../NoSsr'; import SwipeArea from './SwipeArea'; // This value is closed to what browsers are using internally to // trigger a native scroll. var <API key> = 3; // We can only have one node at the time claiming ownership for handling the swipe. // Otherwise, the UX would be confusing. // That's why we use a singleton here. var <API key> = null; // Exported for test purposes. export function reset() { <API key> = null; } function calculateCurrentX(anchor, touches) { return anchor === 'right' ? document.body.offsetWidth - touches[0].pageX : touches[0].pageX; } function calculateCurrentY(anchor, touches) { return anchor === 'bottom' ? window.innerHeight - touches[0].clientY : touches[0].clientY; } function getMaxTranslate(horizontalSwipe, paperInstance) { return horizontalSwipe ? paperInstance.clientWidth : paperInstance.clientHeight; } function getTranslate(currentTranslate, startLocation, open, maxTranslate) { return Math.min(Math.max(open ? startLocation - currentTranslate : maxTranslate + startLocation - currentTranslate, 0), maxTranslate); } function getDomTreeShapes(element, rootNode) { // Adapted from https://github.com/oliviertassinari/<API key>/blob/<SHA1-like>/packages/<API key>/src/SwipeableViews.js#L129 var domTreeShapes = []; while (element && element !== rootNode) { var style = window.getComputedStyle(element); if ( // Ignore the scroll children if the element is absolute positioned. style.getPropertyValue('position') === 'absolute' || // Ignore the scroll children if the element has an overflowX hidden style.getPropertyValue('overflow-x') === 'hidden') { domTreeShapes = []; } else if (element.clientWidth > 0 && element.scrollWidth > element.clientWidth || element.clientHeight > 0 && element.scrollHeight > element.clientHeight) { // Ignore the nodes that have no width. // Keep elements with a scroll domTreeShapes.push(element); } element = element.parentElement; } return domTreeShapes; } function findNativeHandler(_ref) { var domTreeShapes = _ref.domTreeShapes, start = _ref.start, current = _ref.current, anchor = _ref.anchor; // Adapted from https://github.com/oliviertassinari/<API key>/blob/<SHA1-like>/packages/<API key>/src/SwipeableViews.js#L175 var axisProperties = { scrollPosition: { x: 'scrollLeft', y: 'scrollTop' }, scrollLength: { x: 'scrollWidth', y: 'scrollHeight' }, clientLength: { x: 'clientWidth', y: 'clientHeight' } }; return domTreeShapes.some(function (shape) { // Determine if we are going backward or forward. var goingForward = current >= start; if (anchor === 'top' || anchor === 'left') { goingForward = !goingForward; } var axis = anchor === 'left' || anchor === 'right' ? 'x' : 'y'; var scrollPosition = shape[axisProperties.scrollPosition[axis]]; var areNotAtStart = scrollPosition > 0; var areNotAtEnd = scrollPosition + shape[axisProperties.clientLength[axis]] < shape[axisProperties.scrollLength[axis]]; if (goingForward && areNotAtEnd || !goingForward && areNotAtStart) { return shape; } return null; }); } var <API key> = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent); var <API key> = { enter: duration.enteringScreen, exit: duration.leavingScreen }; var useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect; var SwipeableDrawer = React.forwardRef(function SwipeableDrawer(inProps, ref) { var theme = useTheme(); var props = getThemeProps({ name: 'MuiSwipeableDrawer', props: _extends({}, inProps), theme: theme }); var _props$anchor = props.anchor, anchor = _props$anchor === void 0 ? 'left' : _props$anchor, _props$disableBackdro = props.<API key>, <API key> = _props$disableBackdro === void 0 ? false : _props$disableBackdro, _props$disableDiscove = props.disableDiscovery, disableDiscovery = _props$disableDiscove === void 0 ? false : _props$disableDiscove, _props$disableSwipeTo = props.disableSwipeToOpen, disableSwipeToOpen = _props$disableSwipeTo === void 0 ? <API key> : _props$disableSwipeTo, hideBackdrop = props.hideBackdrop, _props$hysteresis = props.hysteresis, hysteresis = _props$hysteresis === void 0 ? 0.52 : _props$hysteresis, _props$minFlingVeloci = props.minFlingVelocity, minFlingVelocity = _props$minFlingVeloci === void 0 ? 450 : _props$minFlingVeloci, _props$ModalProps = props.ModalProps; _props$ModalProps = _props$ModalProps === void 0 ? {} : _props$ModalProps; var BackdropProps = _props$ModalProps.BackdropProps, ModalPropsProp = <API key>(_props$ModalProps, ["BackdropProps"]), onClose = props.onClose, onOpen = props.onOpen, open = props.open, _props$PaperProps = props.PaperProps, PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps, SwipeAreaProps = props.SwipeAreaProps, _props$swipeAreaWidth = props.swipeAreaWidth, swipeAreaWidth = _props$swipeAreaWidth === void 0 ? 20 : _props$swipeAreaWidth, _props$transitionDura = props.transitionDuration, transitionDuration = _props$transitionDura === void 0 ? <API key> : _props$transitionDura, _props$variant = props.variant, variant = _props$variant === void 0 ? 'temporary' : _props$variant, other = <API key>(props, ["anchor", "<API key>", "disableDiscovery", "disableSwipeToOpen", "hideBackdrop", "hysteresis", "minFlingVelocity", "ModalProps", "onClose", "onOpen", "open", "PaperProps", "SwipeAreaProps", "swipeAreaWidth", "transitionDuration", "variant"]); var _React$useState = React.useState(false), maybeSwiping = _React$useState[0], setMaybeSwiping = _React$useState[1]; var swipeInstance = React.useRef({ isSwiping: null }); var swipeAreaRef = React.useRef(); var backdropRef = React.useRef(); var paperRef = React.useRef(); var touchDetected = React.useRef(false); // Ref for transition duration based on / to match swipe speed var <API key> = React.useRef(); // Use a ref so the open value used is always up to date inside useCallback. useEnhancedEffect(function () { <API key>.current = null; }, [open]); var setPosition = React.useCallback(function (translate) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _options$mode = options.mode, mode = _options$mode === void 0 ? null : _options$mode, _options$changeTransi = options.changeTransition, changeTransition = _options$changeTransi === void 0 ? true : _options$changeTransi; var anchorRtl = getAnchor(theme, anchor); var <API key> = ['right', 'bottom'].indexOf(anchorRtl) !== -1 ? 1 : -1; var horizontalSwipe = isHorizontal(anchor); var transform = horizontalSwipe ? "translate(".concat(<API key> * translate, "px, 0)") : "translate(0, ".concat(<API key> * translate, "px)"); var drawerStyle = paperRef.current.style; drawerStyle.webkitTransform = transform; drawerStyle.transform = transform; var transition = ''; if (mode) { transition = theme.transitions.create('all', getTransitionProps({ timeout: transitionDuration }, { mode: mode })); } if (changeTransition) { drawerStyle.webkitTransition = transition; drawerStyle.transition = transition; } if (!<API key> && !hideBackdrop) { var backdropStyle = backdropRef.current.style; backdropStyle.opacity = 1 - translate / getMaxTranslate(horizontalSwipe, paperRef.current); if (changeTransition) { backdropStyle.webkitTransition = transition; backdropStyle.transition = transition; } } }, [anchor, <API key>, hideBackdrop, theme, transitionDuration]); var handleBodyTouchEnd = useEventCallback(function (event) { if (!touchDetected.current) { return; } <API key> = null; touchDetected.current = false; setMaybeSwiping(false); // The swipe wasn't started. if (!swipeInstance.current.isSwiping) { swipeInstance.current.isSwiping = null; return; } swipeInstance.current.isSwiping = null; var anchorRtl = getAnchor(theme, anchor); var horizontal = isHorizontal(anchor); var current; if (horizontal) { current = calculateCurrentX(anchorRtl, event.changedTouches); } else { current = calculateCurrentY(anchorRtl, event.changedTouches); } var startLocation = horizontal ? swipeInstance.current.startX : swipeInstance.current.startY; var maxTranslate = getMaxTranslate(horizontal, paperRef.current); var currentTranslate = getTranslate(current, startLocation, open, maxTranslate); var translateRatio = currentTranslate / maxTranslate; if (Math.abs(swipeInstance.current.velocity) > minFlingVelocity) { // Calculate transition duration to match swipe speed <API key>.current = Math.abs((maxTranslate - currentTranslate) / swipeInstance.current.velocity) * 1000; } if (open) { if (swipeInstance.current.velocity > minFlingVelocity || translateRatio > hysteresis) { onClose(); } else { // Reset the position, the swipe was aborted. setPosition(0, { mode: 'exit' }); } return; } if (swipeInstance.current.velocity < -minFlingVelocity || 1 - translateRatio > hysteresis) { onOpen(); } else { // Reset the position, the swipe was aborted. setPosition(getMaxTranslate(horizontal, paperRef.current), { mode: 'enter' }); } }); var handleBodyTouchMove = useEventCallback(function (event) { // the ref may be null when a parent component updates while swiping if (!paperRef.current || !touchDetected.current) { return; } // We are not supposed to handle this touch move because the swipe was started in a scrollable container in the drawer if (<API key> != null && <API key> !== swipeInstance.current) { return; } var anchorRtl = getAnchor(theme, anchor); var horizontalSwipe = isHorizontal(anchor); var currentX = calculateCurrentX(anchorRtl, event.touches); var currentY = calculateCurrentY(anchorRtl, event.touches); if (open && paperRef.current.contains(event.target) && <API key> == null) { var domTreeShapes = getDomTreeShapes(event.target, paperRef.current); var nativeHandler = findNativeHandler({ domTreeShapes: domTreeShapes, start: horizontalSwipe ? swipeInstance.current.startX : swipeInstance.current.startY, current: horizontalSwipe ? currentX : currentY, anchor: anchor }); if (nativeHandler) { <API key> = nativeHandler; return; } <API key> = swipeInstance.current; } // We don't know yet. if (swipeInstance.current.isSwiping == null) { var dx = Math.abs(currentX - swipeInstance.current.startX); var dy = Math.abs(currentY - swipeInstance.current.startY); // We are likely to be swiping, let's prevent the scroll event on iOS. if (dx > dy) { if (event.cancelable) { event.preventDefault(); } } var definitelySwiping = horizontalSwipe ? dx > dy && dx > <API key> : dy > dx && dy > <API key>; if (definitelySwiping === true || (horizontalSwipe ? dy > <API key> : dx > <API key>)) { swipeInstance.current.isSwiping = definitelySwiping; if (!definitelySwiping) { handleBodyTouchEnd(event); return; } // Shift the starting point. swipeInstance.current.startX = currentX; swipeInstance.current.startY = currentY; // Compensate for the part of the drawer displayed on touch start. if (!disableDiscovery && !open) { if (horizontalSwipe) { swipeInstance.current.startX -= swipeAreaWidth; } else { swipeInstance.current.startY -= swipeAreaWidth; } } } } if (!swipeInstance.current.isSwiping) { return; } var maxTranslate = getMaxTranslate(horizontalSwipe, paperRef.current); var startLocation = horizontalSwipe ? swipeInstance.current.startX : swipeInstance.current.startY; if (open && !swipeInstance.current.paperHit) { startLocation = Math.min(startLocation, maxTranslate); } var translate = getTranslate(horizontalSwipe ? currentX : currentY, startLocation, open, maxTranslate); if (open) { if (!swipeInstance.current.paperHit) { var paperHit = horizontalSwipe ? currentX < maxTranslate : currentY < maxTranslate; if (paperHit) { swipeInstance.current.paperHit = true; swipeInstance.current.startX = currentX; swipeInstance.current.startY = currentY; } else { return; } } else if (translate === 0) { swipeInstance.current.startX = currentX; swipeInstance.current.startY = currentY; } } if (swipeInstance.current.lastTranslate === null) { swipeInstance.current.lastTranslate = translate; swipeInstance.current.lastTime = performance.now() + 1; } var velocity = (translate - swipeInstance.current.lastTranslate) / (performance.now() - swipeInstance.current.lastTime) * 1e3; // Low Pass filter. swipeInstance.current.velocity = swipeInstance.current.velocity * 0.4 + velocity * 0.6; swipeInstance.current.lastTranslate = translate; swipeInstance.current.lastTime = performance.now(); // We are swiping, let's prevent the scroll event on iOS. if (event.cancelable) { event.preventDefault(); } setPosition(translate); }); var <API key> = useEventCallback(function (event) { // We are not supposed to handle this touch move. // Example of use case: ignore the event if there is a Slider. if (event.defaultPrevented) { return; } // We can only have one node at the time claiming ownership for handling the swipe. if (event.muiHandled) { return; } // At least one element clogs the drawer interaction zone. if (open && !backdropRef.current.contains(event.target) && !paperRef.current.contains(event.target)) { return; } var anchorRtl = getAnchor(theme, anchor); var horizontalSwipe = isHorizontal(anchor); var currentX = calculateCurrentX(anchorRtl, event.touches); var currentY = calculateCurrentY(anchorRtl, event.touches); if (!open) { if (disableSwipeToOpen || event.target !== swipeAreaRef.current) { return; } if (horizontalSwipe) { if (currentX > swipeAreaWidth) { return; } } else if (currentY > swipeAreaWidth) { return; } } event.muiHandled = true; <API key> = null; swipeInstance.current.startX = currentX; swipeInstance.current.startY = currentY; setMaybeSwiping(true); if (!open && paperRef.current) { // The ref may be null when a parent component updates while swiping. setPosition(getMaxTranslate(horizontalSwipe, paperRef.current) + (disableDiscovery ? 20 : -swipeAreaWidth), { changeTransition: false }); } swipeInstance.current.velocity = 0; swipeInstance.current.lastTime = null; swipeInstance.current.lastTranslate = null; swipeInstance.current.paperHit = false; touchDetected.current = true; }); React.useEffect(function () { if (variant === 'temporary') { var doc = ownerDocument(paperRef.current); doc.addEventListener('touchstart', <API key>); doc.addEventListener('touchmove', handleBodyTouchMove, { passive: false }); doc.addEventListener('touchend', handleBodyTouchEnd); return function () { doc.removeEventListener('touchstart', <API key>); doc.removeEventListener('touchmove', handleBodyTouchMove, { passive: false }); doc.removeEventListener('touchend', handleBodyTouchEnd); }; } return undefined; }, [variant, <API key>, handleBodyTouchMove, handleBodyTouchEnd]); React.useEffect(function () { return function () { // We need to release the lock. if (<API key> === swipeInstance.current) { <API key> = null; } }; }, []); React.useEffect(function () { if (!open) { setMaybeSwiping(false); } }, [open]); var handleBackdropRef = React.useCallback(function (instance) { // #StrictMode ready backdropRef.current = ReactDOM.findDOMNode(instance); }, []); return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer, _extends({ open: variant === 'temporary' && maybeSwiping ? true : open, variant: variant, ModalProps: _extends({ BackdropProps: _extends(_extends({}, BackdropProps), {}, { ref: handleBackdropRef }) }, ModalPropsProp), PaperProps: _extends(_extends({}, PaperProps), {}, { style: _extends({ pointerEvents: variant === 'temporary' && !open ? 'none' : '' }, PaperProps.style), ref: paperRef }), anchor: anchor, transitionDuration: <API key>.current || transitionDuration, onClose: onClose, ref: ref }, other)), !disableSwipeToOpen && variant === 'temporary' && /*#__PURE__*/React.createElement(NoSsr, null, /*#__PURE__*/React.createElement(SwipeArea, _extends({ anchor: anchor, ref: swipeAreaRef, width: swipeAreaWidth }, SwipeAreaProps)))); }); process.env.NODE_ENV !== "production" ? SwipeableDrawer.propTypes = { /** * @ignore */ anchor: PropTypes.oneOf(['left', 'top', 'right', 'bottom']), /** * The content of the component. */ children: PropTypes.node, /** * Disable the backdrop transition. * This can improve the FPS on low-end devices. */ <API key>: PropTypes.bool, /** * If `true`, touching the screen near the edge of the drawer will not slide in the drawer a bit * to promote accidental discovery of the swipe gesture. */ disableDiscovery: PropTypes.bool, /** * If `true`, swipe to open is disabled. This is useful in browsers where swiping triggers * navigation actions. Swipe to open is disabled on iOS browsers by default. */ disableSwipeToOpen: PropTypes.bool, /** * @ignore */ hideBackdrop: PropTypes.bool, /** * Affects how far the drawer must be opened/closed to change his state. * Specified as percent (0-1) of the width of the drawer */ hysteresis: PropTypes.number, /** * Defines, from which (average) velocity on, the swipe is * defined as complete although hysteresis isn't reached. * Good threshold is between 250 - 1000 px/s */ minFlingVelocity: PropTypes.number, /** * @ignore */ ModalProps: PropTypes.shape({ BackdropProps: PropTypes.shape({ component: <API key> }) }), /** * Callback fired when the component requests to be closed. * * @param {object} event The event source of the callback. */ onClose: PropTypes.func.isRequired, /** * Callback fired when the component requests to be opened. * * @param {object} event The event source of the callback. */ onOpen: PropTypes.func.isRequired, /** * If `true`, the drawer is open. */ open: PropTypes.bool.isRequired, /** * @ignore */ PaperProps: PropTypes.shape({ component: <API key>, style: PropTypes.object }), /** * The element is used to intercept the touch events on the edge. */ SwipeAreaProps: PropTypes.object, /** * The width of the left most (or right most) area in pixels where the * drawer can be swiped open from. */ swipeAreaWidth: PropTypes.number, /** * The duration for the transition, in milliseconds. * You may specify a single timeout for all transitions, or individually with an object. */ transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({ enter: PropTypes.number, exit: PropTypes.number })]), /** * @ignore */ variant: PropTypes.oneOf(['permanent', 'persistent', 'temporary']) } : void 0; export default SwipeableDrawer;
(function(angular) { 'use strict'; var controllers = angular.module('newTab.controllers'); controllers.constant('popularPages', [ {name: 'Google+', location: 'https://plus.google.com'}, {name: 'Facebook', location: 'https: {name: 'Twitter', location: 'https://twitter.com'}, {name: 'Reddit', location: 'http: {name: 'Wikipedia', location: 'http: {name: 'Yahoo', location: 'https: {name: 'Digg', location: 'http://digg.com'}, {name: 'Delicious', location: 'https://delicious.com'}, {name: 'Slashdot', location: 'http: ]); controllers.constant('internalPages', [ { name: 'Chrome Apps', location: 'chrome://apps/' }, { name: 'Extensions', location: 'chrome://extensions/' }, { name: 'History', location: 'chrome://history/' }, { name: 'Downloads', location: 'chrome://downloads/' }, { name: 'Bookmarks', location: 'chrome://bookmarks/' }, { name: 'Internals', location: 'chrome://net-internals/' }, { name: 'Devices', location: 'chrome://devices/' }, { name: 'Flags', location: 'chrome://flags/' }, { name: 'Inspect', location: 'chrome://inspect/' }, { name: 'Memory', location: 'chrome://memory-redirect/' }, { name: 'Version', location: 'chrome://version/' }, { name: 'Blank Page', location: 'about:blank' } ]); })(angular);
#include "auth-common.h" #include "ioloop.h" #include "array.h" #include "aqueue.h" #include "base64.h" #include "hash.h" #include "net.h" #include "str.h" #include "strescape.h" #include "str-sanitize.h" #include "master-interface.h" #include "auth-penalty.h" #include "auth-request.h" #include "auth-token.h" #include "<API key>.h" #include "<API key>.h" #include <stdlib.h> #define <API key> 500 struct <API key> { int refcount; pool_t pool; HASH_TABLE(void *, struct auth_request *) requests; unsigned int connect_uid, client_pid; <API key> *callback; void *context; <API key> *master_callback; unsigned int destroyed:1; unsigned int token_auth:1; }; static ARRAY(struct auth_request *) auth_failures_arr; static struct aqueue *auth_failures; static struct timeout *to_auth_failures; static void <API key>(void *context) ATTR_NULL(1); #undef <API key> struct <API key> * <API key>(bool token_auth, <API key> *callback, void *context, <API key> *master_callback) { struct <API key> *handler; pool_t pool; pool = <API key>("auth request handler", 4096); handler = p_new(pool, struct <API key>, 1); handler->refcount = 1; handler->pool = pool; <API key>(&handler->requests, pool, 0); handler->callback = callback; handler->context = context; handler->master_callback = master_callback; handler->token_auth = token_auth; return handler; } unsigned int <API key>(struct <API key> *handler) { return hash_table_count(handler->requests); } void <API key>(struct <API key> *handler) { struct <API key> *iter; void *key; struct auth_request *auth_request; iter = <API key>(handler->requests); while (hash_table_iterate(iter, handler->requests, &key, &auth_request)) { switch (auth_request->state) { case <API key>: case <API key>: case <API key>: auth_request_unref(&auth_request); hash_table_remove(handler->requests, key); break; case <API key>: case <API key>: /* can't abort a pending passdb/userdb lookup */ break; case <API key>: i_unreached(); } } <API key>(&iter); } void <API key>(struct <API key> **_handler) { struct <API key> *handler = *_handler; *_handler = NULL; i_assert(handler->refcount > 0); if (--handler->refcount > 0) return; i_assert(hash_table_count(handler->requests) == 0); /* notify parent that we're done with all requests */ handler->callback(NULL, handler->context); hash_table_destroy(&handler->requests); pool_unref(&handler->pool); } void <API key>(struct <API key> **_handler) { struct <API key> *handler = *_handler; *_handler = NULL; i_assert(!handler->destroyed); handler->destroyed = TRUE; <API key>(&handler); } void <API key>(struct <API key> *handler, unsigned int connect_uid, unsigned int client_pid) { handler->connect_uid = connect_uid; handler->client_pid = client_pid; } static void <API key>(struct <API key> *handler, struct auth_request *request) { i_assert(request->handler == handler); if (request-><API key>) { /* already removed it */ return; } request-><API key> = TRUE; /* if db lookup is stuck, this call doesn't actually free the auth request, so make sure we don't get back here. */ timeout_remove(&request->to_abort); hash_table_remove(handler->requests, POINTER_CAST(request->id)); auth_request_unref(&request); } static void <API key>(string_t *dest, const char *key, const char *value) { str_append_c(dest, '\t'); str_append(dest, key); str_append_c(dest, '='); <API key>(dest, value); } static void <API key>(struct auth_request *request, string_t *dest) { if (!<API key>(request->extra_fields)) { str_append_c(dest, '\t'); auth_fields_append(request->extra_fields, dest, <API key>, 0); } if (request->original_username != NULL && null_strcmp(request->original_username, request->user) != 0 && !auth_fields_exists(request->extra_fields, "original_user")) { <API key>(dest, "original_user", request->original_username); } if (request->master_user != NULL && !auth_fields_exists(request->extra_fields, "auth_user")) <API key>(dest, "auth_user", request->master_user); if (!request->auth_only && auth_fields_exists(request->extra_fields, "proxy")) { /* we're proxying */ if (!auth_fields_exists(request->extra_fields, "pass") && request->mech_password != NULL) { /* send back the password that was sent by user (not the password in passdb). */ <API key>(dest, "pass", request->mech_password); } if (request->master_user != NULL && !auth_fields_exists(request->extra_fields, "master")) { /* the master username needs to be forwarded */ <API key>(dest, "master", request->master_user); } } } static void <API key>(struct auth_request *request, const char *reply) { struct <API key> *handler = request->handler; if (request-><API key>) { /* we came here from flush_failures() */ handler->callback(reply, handler->context); return; } /* remove the request from requests-list */ auth_request_ref(request); <API key>(handler, request); if (auth_fields_exists(request->extra_fields, "nodelay")) { /* passdb specifically requested not to delay the reply. */ handler->callback(reply, handler->context); auth_request_unref(&request); return; } /* failure. don't announce it immediately to avoid a) timing attacks, b) flooding */ request-><API key> = TRUE; handler->refcount++; if (auth_penalty != NULL) { auth_penalty_update(auth_penalty, request, request->last_penalty + 1); } <API key>(request); aqueue_append(auth_failures, &request); if (to_auth_failures == NULL) { to_auth_failures = timeout_add_short(<API key>, <API key>, (void *)NULL); } } static void <API key>(struct auth_request *request) { struct <API key> *handler = request->handler; string_t *str = t_str_new(128); if (request->last_penalty != 0 && auth_penalty != NULL) { /* reset penalty */ auth_penalty_update(auth_penalty, request, 0); } /* sanitize these fields, since the login code currently assumes they are exactly in this format. */ <API key>(request->extra_fields, "nologin"); <API key>(request->extra_fields, "proxy"); str_printfa(str, "OK\t%u\tuser=", request->id); <API key>(str, request->user); <API key>(request, str); if (handler->master_callback == NULL || auth_fields_exists(request->extra_fields, "nologin") || auth_fields_exists(request->extra_fields, "proxy")) { /* this request doesn't have to wait for master process to pick it up. delete it */ <API key>(handler, request); } handler->callback(str_c(str), handler->context); } static void <API key>(struct auth_request *request) { string_t *str = t_str_new(128); auth_fields_remove(request->extra_fields, "nologin"); str_printfa(str, "FAIL\t%u", request->id); if (request->user != NULL) <API key>(str, "user", request->user); else if (request->original_username != NULL) { <API key>(str, "user", request->original_username); } if (request->internal_failure) str_append(str, "\ttemp"); else if (request->master_user != NULL) { /* authentication succeeded, but we can't log in as the wanted user */ str_append(str, "\tauthz"); } if (auth_fields_exists(request->extra_fields, "nodelay")) { /* this is normally a hidden field, need to add it explicitly */ str_append(str, "\tnodelay"); } <API key>(request, str); switch (request->passdb_result) { case <API key>: case <API key>: case <API key>: case <API key>: case PASSDB_RESULT_OK: break; case <API key>: str_append(str, "\tuser_disabled"); break; case <API key>: str_append(str, "\tpass_expired"); break; } <API key>(request, str_c(str)); } static void <API key>(bool success, struct auth_request *request) { struct <API key> *handler = request->handler; if (success) <API key>(request); else <API key>(request); <API key>(&handler); } void <API key>(struct auth_request *request, enum auth_client_result result, const void *auth_reply, size_t reply_size) { struct <API key> *handler = request->handler; string_t *str; int ret; if (handler->destroyed) { /* the client connection was already closed. we can't do anything but abort this request */ request->internal_failure = TRUE; result = <API key>; /* make sure this request is set to finished state (it's not with result=continue) */ <API key>(request, <API key>); } switch (result) { case <API key>: str = t_str_new(16 + <API key>(reply_size)); str_printfa(str, "CONT\t%u\t", request->id); base64_encode(auth_reply, reply_size, str); request->accept_cont_input = TRUE; handler->callback(str_c(str), handler->context); break; case <API key>: if (reply_size > 0) { str = t_str_new(<API key>(reply_size)); base64_encode(auth_reply, reply_size, str); auth_fields_add(request->extra_fields, "resp", str_c(str), 0); } ret = <API key>(request, <API key>); if (ret < 0) <API key>(request); else if (ret > 0) <API key>(request); else return; break; case <API key>: <API key>(request); <API key>(request); break; } /* NOTE: request may be destroyed now */ <API key>(&handler); } void <API key>(struct auth_request *request, const void *reply, size_t reply_size) { <API key>(request, <API key>, reply, reply_size); } static void <API key>(struct <API key> *handler, struct auth_request *request, const char *reason) { string_t *str = t_str_new(128); <API key>(request, AUTH_SUBSYS_MECH, "%s", reason); str_printfa(str, "FAIL\t%u\treason=", request->id); <API key>(str, reason); handler->callback(str_c(str), handler->context); <API key>(handler, request); } static void <API key>(struct auth_request *request) { unsigned int secs = (unsigned int)(time(NULL) - request->last_access); if (request->state != <API key>) { /* client's fault */ <API key>(request, AUTH_SUBSYS_MECH, "Request %u.%u timed out after %u secs, state=%d", request->handler->client_pid, request->id, secs, request->state); } else if (request->set->verbose) { <API key>(request, AUTH_SUBSYS_MECH, "Request timed out waiting for client to continue authentication " "(%u secs)", secs); } <API key>(request->handler, request); } static void <API key>(struct auth_request *request) { timeout_remove(&request->to_penalty); <API key>(request); } static void <API key>(unsigned int penalty, struct auth_request *request) { unsigned int secs; request->last_penalty = penalty; if (penalty == 0) <API key>(request); else { secs = <API key>(penalty); request->to_penalty = timeout_add(secs * 1000, <API key>, request); } } bool <API key>(struct <API key> *handler, const char *args) { const struct mech_module *mech; struct auth_request *request; const char *const *list, *name, *arg, *initial_resp; void *initial_resp_data; unsigned int id; buffer_t *buf; i_assert(!handler->destroyed); /* <id> <mechanism> [...] */ list = t_strsplit_tab(args); if (list[0] == NULL || list[1] == NULL || str_to_uint(list[0], &id) < 0) { i_error("BUG: Authentication client %u " "sent broken AUTH request", handler->client_pid); return FALSE; } if (handler->token_auth) { mech = &mech_dovecot_token; if (strcmp(list[1], mech->mech_name) != 0) { /* unsupported mechanism */ i_error("BUG: Authentication client %u requested invalid " "authentication mechanism %s (DOVECOT-TOKEN required)", handler->client_pid, str_sanitize(list[1], MAX_MECH_NAME_LEN)); return FALSE; } } else { mech = mech_module_find(list[1]); if (mech == NULL) { /* unsupported mechanism */ i_error("BUG: Authentication client %u requested unsupported " "authentication mechanism %s", handler->client_pid, str_sanitize(list[1], MAX_MECH_NAME_LEN)); return FALSE; } } request = auth_request_new(mech); request->handler = handler; request->connect_uid = handler->connect_uid; request->client_pid = handler->client_pid; request->id = id; request->auth_only = handler->master_callback == NULL; /* parse optional parameters */ initial_resp = NULL; for (list += 2; *list != NULL; list++) { arg = strchr(*list, '='); if (arg == NULL) { name = *list; arg = ""; } else { name = t_strdup_until(*list, arg); arg++; } if (<API key>(request, name, arg)) ; else if (strcmp(name, "resp") == 0) { initial_resp = arg; /* this must be the last parameter */ list++; break; } } if (*list != NULL) { i_error("BUG: Authentication client %u " "sent AUTH parameters after 'resp'", handler->client_pid); auth_request_unref(&request); return FALSE; } if (request->service == NULL) { i_error("BUG: Authentication client %u " "didn't specify service in request", handler->client_pid); auth_request_unref(&request); return FALSE; } if (hash_table_lookup(handler->requests, POINTER_CAST(id)) != NULL) { i_error("BUG: Authentication client %u " "sent a duplicate ID %u", handler->client_pid, id); auth_request_unref(&request); return FALSE; } auth_request_init(request); request->to_abort = timeout_add(MASTER_<API key> * 1000, <API key>, request); hash_table_insert(handler->requests, POINTER_CAST(id), request); if (request->set-><API key> && !request->valid_client_cert) { /* we fail without valid certificate */ <API key>(handler, request, "Client didn't present valid SSL certificate"); return TRUE; } /* Empty initial response is a "=" base64 string. Completely empty string shouldn't really be sent, but at least Exim does it, so just allow it for backwards compatibility.. */ if (initial_resp != NULL && *initial_resp != '\0') { size_t len = strlen(initial_resp); buf = <API key>(<API key>(), <API key>(len)); if (base64_decode(initial_resp, len, NULL, buf) < 0) { <API key>(handler, request, "Invalid base64 data in initial response"); return TRUE; } initial_resp_data = p_malloc(request->pool, I_MAX(buf->used, 1)); memcpy(initial_resp_data, buf->data, buf->used); request->initial_response = initial_resp_data; request-><API key> = buf->used; } /* handler is referenced until <API key>() is called. */ handler->refcount++; /* before we start authenticating, see if we need to wait first */ auth_penalty_lookup(auth_penalty, request, <API key>); return TRUE; } bool <API key>(struct <API key> *handler, const char *args) { struct auth_request *request; const char *data; size_t data_len; buffer_t *buf; unsigned int id; data = strchr(args, '\t'); if (data == NULL || str_to_uint(t_strdup_until(args, data), &id) < 0) { i_error("BUG: Authentication client sent broken CONT request"); return FALSE; } data++; request = hash_table_lookup(handler->requests, POINTER_CAST(id)); if (request == NULL) { const char *reply = t_strdup_printf( "FAIL\t%u\treason=Authentication request timed out", id); handler->callback(reply, handler->context); return TRUE; } /* accept input only once after mechanism has sent a CONT reply */ if (!request->accept_cont_input) { <API key>(handler, request, "Unexpected continuation"); return TRUE; } request->accept_cont_input = FALSE; data_len = strlen(data); buf = <API key>(<API key>(), <API key>(data_len)); if (base64_decode(data, data_len, NULL, buf) < 0) { <API key>(handler, request, "Invalid base64 data in continued response"); return TRUE; } /* handler is referenced until <API key>() is called. */ handler->refcount++; <API key>(request, buf->data, buf->used); return TRUE; } static void <API key>(struct auth_request *request, string_t *dest) { str_append_c(dest, '\t'); auth_fields_append(request->userdb_reply, dest, <API key>, 0); if (request->master_user != NULL && !auth_fields_exists(request->userdb_reply, "master_user")) { <API key>(dest, "master_user", request->master_user); } if (*request->set->anonymous_username != '\0' && strcmp(request->user, request->set->anonymous_username) == 0) { /* this is an anonymous login, either via ANONYMOUS SASL mechanism or simply logging in as the anonymous user via another mechanism */ str_append(dest, "\tanonymous"); } /* generate auth_token when master service provided session_pid */ if (request->request_auth_token && request->session_pid != (pid_t)-1) { const char *auth_token = auth_token_get(request->service, dec2str(request->session_pid), request->user, request->session_id); <API key>(dest, "auth_token", auth_token); } if (request->master_user != NULL) { <API key>(dest, "auth_user", request->master_user); } else if (request->original_username != NULL && strcmp(request->original_username, request->user) != 0) { <API key>(dest, "auth_user", request->original_username); } } static void userdb_callback(enum userdb_result result, struct auth_request *request) { struct <API key> *handler = request->handler; string_t *str; const char *value; i_assert(request->state == <API key>); <API key>(request, <API key>); if (request-><API key>) result = <API key>; str = t_str_new(128); switch (result) { case <API key>: str_printfa(str, "FAIL\t%u", request->id); if (request-><API key>) { value = auth_fields_find(request->userdb_reply, "reason"); if (value != NULL) <API key>(str, "reason", value); } break; case <API key>: str_printfa(str, "NOTFOUND\t%u", request->id); break; case USERDB_RESULT_OK: str_printfa(str, "USER\t%u\t", request->id); <API key>(str, request->user); <API key>(request, str); break; } handler->master_callback(str_c(str), request->master); <API key>(&request->master); auth_request_unref(&request); <API key>(&handler); } static bool <API key>(struct <API key> *handler, struct <API key> *master, unsigned int id) { if (handler->master_callback == NULL) return FALSE; handler->master_callback(t_strdup_printf("FAIL\t%u", id), master); return TRUE; } bool <API key>(struct <API key> *handler, struct <API key> *master, unsigned int id, unsigned int client_id, const char *const *params) { struct auth_request *request; struct net_unix_cred cred; request = hash_table_lookup(handler->requests, POINTER_CAST(client_id)); if (request == NULL) { i_error("Master request %u.%u not found", handler->client_pid, client_id); return <API key>(handler, master, id); } auth_request_ref(request); <API key>(handler, request); for (; *params != NULL; params++) { const char *name, *param = strchr(*params, '='); if (param == NULL) { name = *params; param = ""; } else { name = t_strdup_until(*params, param); param++; } (void)<API key>(request, name, param); } /* verify session pid if specified and possible */ if (request->session_pid != (pid_t)-1 && net_getunixcred(master->fd, &cred) == 0 && cred.pid != (pid_t)-1 && request->session_pid != cred.pid) { i_error("Session pid %ld provided by master for request %u.%u " "did not match peer credentials (pid=%ld, uid=%ld)", (long)request->session_pid, handler->client_pid, client_id, (long)cred.pid, (long)cred.uid); return <API key>(handler, master, id); } if (request->state != <API key> || !request->successful) { i_error("Master requested unfinished authentication request " "%u.%u", handler->client_pid, client_id); handler->master_callback(t_strdup_printf("FAIL\t%u", id), master); auth_request_unref(&request); } else { /* the request isn't being referenced anywhere anymore, so we can do a bit of kludging.. replace the request's old client_id with master's id. */ <API key>(request, <API key>); request->id = id; request->master = master; /* master and handler are referenced until userdb_callback i s called. */ <API key>(master); handler->refcount++; <API key>(request, userdb_callback); } return TRUE; } void <API key>(struct <API key> *handler, unsigned int client_id) { struct auth_request *request; request = hash_table_lookup(handler->requests, POINTER_CAST(client_id)); if (request != NULL) <API key>(handler, request); } void <API key>(bool flush_all) { struct auth_request **auth_requests, *auth_request; unsigned int i, count; time_t diff; count = aqueue_count(auth_failures); if (count == 0) { if (to_auth_failures != NULL) timeout_remove(&to_auth_failures); return; } auth_requests = <API key>(&auth_failures_arr, 0); for (i = 0; i < count; i++) { auth_request = auth_requests[aqueue_idx(auth_failures, 0)]; /* FIXME: assumess that failure_delay is always the same. */ diff = ioloop_time - auth_request->last_access; if (diff < (time_t)auth_request->set->failure_delay && !flush_all) break; aqueue_delete_tail(auth_failures); i_assert(auth_request->state == <API key>); <API key>(auth_request, <API key>, &uchar_nul, 0); auth_request_unref(&auth_request); } } static void <API key>(void *context ATTR_UNUSED) { <API key>(FALSE); } void <API key>(void) { i_array_init(&auth_failures_arr, 128); auth_failures = aqueue_init(&auth_failures_arr.arr); } void <API key>(void) { <API key>(TRUE); array_free(&auth_failures_arr); aqueue_deinit(&auth_failures); if (to_auth_failures != NULL) timeout_remove(&to_auth_failures); }
import type { Backend, Identifier } from 'dnd-core'; import type { Connector } from './SourceConnector'; import type { DropTargetOptions } from '../types'; export declare class TargetConnector implements Connector { hooks: any; private handlerId; private dropTargetRef; private dropTargetNode; private <API key>; private <API key>; private <API key>; private <API key>; private <API key>; private readonly backend; constructor(backend: Backend); get connectTarget(): any; reconnect(): void; receiveHandlerId(newHandlerId: Identifier | null): void; get dropTargetOptions(): DropTargetOptions; set dropTargetOptions(options: DropTargetOptions); private didHandlerIdChange; private didDropTargetChange; private didOptionsChange; <API key>(): void; private get dropTarget(); private clearDropTarget; }
module Parser ()where import Text.XML.HXT.Core import Data.String.UTF8 import Control.Monad odd :: (->) Int Bool odd a = True css tag = multi (hasName tag) testDoc = do html <- readFile "test.html" let doc = readString [withParseHTML yes, withWarnings no] html texts <- runX $ doc //> getText mapM_ putStrLn texts main = do html <- readFile "test.html" let doc = readString [withParseHTML yes, withWarnings no] html links <- runX $ doc //> hasName "a" >>> getAttrValue "href" mapM_ putStrLn links
//of this software and associated documentation files (the "Software"), to deal //in the Software without restriction, including without limitation the rights //copies of the Software, and to permit persons to whom the Software is //furnished to do so, subject to the following conditions: //all copies or substantial portions of the Software. //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN //THE SOFTWARE. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace EnhancedMonitoring.Configuration { public enum <API key> { Multiple = 0, Single } }
export { default } from 'ember-d3-components/components/d3-line';
package docker import ( "archive/tar" "errors" "fmt" "io" "io/ioutil" "strings" "sync" dkc "github.com/fsouza/go-dockerclient" "github.com/satori/go.uuid" ) type mockContainer struct { *dkc.Container Running bool } // BuildImageOptions represents the parameters in a call to BuildImage. type BuildImageOptions struct { Name, Dockerfile string NoCache bool } // <API key> represents the parameters in a call to UploadToContainer. type <API key> struct { ContainerID, UploadPath, TarPath, Contents string } // MockClient gives unit testers access to the internals of the mock docker client // returned by NewMock. type MockClient struct { *sync.Mutex Built map[BuildImageOptions]struct{} Pulled map[string]struct{} Pushed map[dkc.PushImageOptions]struct{} Containers map[string]mockContainer Networks map[string]*dkc.Network Uploads map[<API key>]struct{} Images map[string]*dkc.Image createdExecs map[string]dkc.CreateExecOptions Executions map[string][]string CreateError bool CreateNetworkError bool ListNetworksError bool CreateExecError bool <API key> bool InspectImageError bool ListError bool BuildError bool PullError bool PushError bool RemoveError bool StartError bool StartExecError bool UploadError bool } // NewMock creates a mock docker client suitable for use in unit tests, and a MockClient // that allows testers to manipulate it's behavior. func NewMock() (*MockClient, Client) { md := &MockClient{ Mutex: &sync.Mutex{}, Built: map[BuildImageOptions]struct{}{}, Pulled: map[string]struct{}{}, Pushed: map[dkc.PushImageOptions]struct{}{}, Containers: map[string]mockContainer{}, Networks: map[string]*dkc.Network{}, Uploads: map[<API key>]struct{}{}, Images: map[string]*dkc.Image{}, createdExecs: map[string]dkc.CreateExecOptions{}, Executions: map[string][]string{}, } return md, Client{md, &sync.Mutex{}, map[string]*cacheEntry{}} } // StartContainer starts the given docker container. func (dk MockClient) StartContainer(id string, hostConfig *dkc.HostConfig) error { dk.Lock() defer dk.Unlock() if dk.StartError { return errors.New("start error") } container := dk.Containers[id] container.Running = true container.HostConfig = hostConfig dk.Containers[id] = container return nil } // StopContainer stops the given docker container. func (dk MockClient) StopContainer(id string) { dk.Lock() defer dk.Unlock() container := dk.Containers[id] container.Running = false dk.Containers[id] = container } // RemoveContainer removes the given docker container. func (dk MockClient) RemoveContainer(opts dkc.<API key>) error { dk.Lock() defer dk.Unlock() if dk.RemoveError { return errors.New("remove error") } delete(dk.Containers, opts.ID) return nil } func readDockerfile(inp io.Reader) ([]byte, error) { tarball := tar.NewReader(inp) for { hdr, err := tarball.Next() if err != nil { return nil, fmt.Errorf("malformed build tarball: %s", err.Error()) } if hdr.Name == "Dockerfile" { return ioutil.ReadAll(tarball) } } } // BuildImage builds the requested image. func (dk MockClient) BuildImage(opts dkc.BuildImageOptions) error { dk.Lock() defer dk.Unlock() if dk.BuildError { return errors.New("build error") } dockerfile, err := readDockerfile(opts.InputStream) dk.Built[BuildImageOptions{ Name: opts.Name, Dockerfile: string(dockerfile), NoCache: opts.NoCache, }] = struct{}{} dk.Images[opts.Name] = &dkc.Image{ID: uuid.NewV4().String()} return err } // ResetBuilt clears the list of built images, for use by the unit tests. func (dk *MockClient) ResetBuilt() { dk.Lock() defer dk.Unlock() dk.Built = map[BuildImageOptions]struct{}{} } // InspectImage inspects the requested image. func (dk MockClient) InspectImage(name string) (*dkc.Image, error) { dk.Lock() defer dk.Unlock() if dk.InspectImageError { return nil, errors.New("inspect image error") } img, ok := dk.Images[name] if !ok { return nil, fmt.Errorf("no image with name %s", name) } return img, nil } // PullImage pulls the requested image. func (dk MockClient) PullImage(opts dkc.PullImageOptions, auth dkc.AuthConfiguration) error { dk.Lock() defer dk.Unlock() if dk.PullError { return errors.New("pull error") } dk.Pulled[opts.Repository+":"+opts.Tag] = struct{}{} return nil } // PushImage pushes the requested image. func (dk MockClient) PushImage(opts dkc.PushImageOptions, _ dkc.AuthConfiguration) error { dk.Lock() defer dk.Unlock() if dk.PushError { return errors.New("push error") } dk.Pushed[opts] = struct{}{} return nil } // ListContainers lists the running containers. func (dk MockClient) ListContainers(opts dkc.<API key>) ([]dkc.APIContainers, error) { dk.Lock() defer dk.Unlock() if dk.ListError { return nil, errors.New("list error") } var name string if opts.Filters != nil { names := opts.Filters["name"] if len(names) == 1 { name = names[0] } } var apics []dkc.APIContainers for id, container := range dk.Containers { if !container.Running && !opts.All { continue } if name != "" && container.Name != name { continue } apics = append(apics, dkc.APIContainers{ID: id}) } return apics, nil } // CreateNetwork creates a network according to opts. func (dk MockClient) CreateNetwork(opts dkc.<API key>) (*dkc.Network, error) { dk.Lock() defer dk.Unlock() if dk.CreateNetworkError { return nil, errors.New("create network error") } network := &dkc.Network{ Name: opts.Name, Driver: opts.Driver, IPAM: opts.IPAM, } dk.Networks[opts.Driver] = network return network, nil } // ListNetworks lists all networks. func (dk MockClient) ListNetworks() ([]dkc.Network, error) { dk.Lock() defer dk.Unlock() if dk.ListNetworksError { return nil, errors.New("list networks error") } var networks []dkc.Network for _, nw := range dk.Networks { networks = append(networks, *nw) } return networks, nil } // InspectContainer returns details of the specified container. func (dk MockClient) InspectContainer(id string) (*dkc.Container, error) { dk.Lock() defer dk.Unlock() if dk.<API key> { return nil, errors.New("inspect error") } container, ok := dk.Containers[id] if !ok { return nil, ErrNoSuchContainer } return container.Container, nil } // CreateContainer creates a container in accordance with the supplied options. func (dk *MockClient) CreateContainer(opts dkc.<API key>) (*dkc.Container, error) { dk.Lock() defer dk.Unlock() if dk.CreateError { return nil, errors.New("create error") } image := opts.Config.Image if strings.Count(image, ":") == 0 { image = image + ":latest" } if _, ok := dk.Pulled[image]; !ok { return nil, errors.New("create a missing image") } id := uuid.NewV4().String() container := &dkc.Container{ ID: id, Name: opts.Name, Args: opts.Config.Cmd, Config: opts.Config, HostConfig: opts.HostConfig, NetworkSettings: &dkc.NetworkSettings{}, } if img, ok := dk.Images[image]; ok { container.Image = img.ID } dk.Containers[id] = mockContainer{container, false} return container, nil } // CreateExec creates an execution option to be started by StartExec. func (dk MockClient) CreateExec(opts dkc.CreateExecOptions) (*dkc.Exec, error) { dk.Lock() defer dk.Unlock() if dk.CreateExecError { return nil, errors.New("create exec error") } if _, ok := dk.Containers[opts.Container]; !ok { return nil, errors.New("unknown container") } id := uuid.NewV4().String() dk.createdExecs[id] = opts return &dkc.Exec{ID: id}, nil } // StartExec starts the supplied execution object. func (dk MockClient) StartExec(id string, opts dkc.StartExecOptions) error { dk.Lock() defer dk.Unlock() if dk.StartExecError { return errors.New("start exec error") } exec, _ := dk.createdExecs[id] dk.Executions[exec.Container] = append(dk.Executions[exec.Container], strings.Join(exec.Cmd, " ")) return nil } // ResetExec clears the list of created and started executions, for use by the unit // tests. func (dk *MockClient) ResetExec() { dk.Lock() defer dk.Unlock() dk.createdExecs = map[string]dkc.CreateExecOptions{} dk.Executions = map[string][]string{} } // UploadToContainer extracts a tarball into the given container. func (dk MockClient) UploadToContainer(id string, opts dkc.<API key>) error { dk.Lock() defer dk.Unlock() if dk.UploadError { return errors.New("upload error") } tr := tar.NewReader(opts.InputStream) for { hdr, err := tr.Next() if err == io.EOF { break } else if err != nil { return err } file, err := ioutil.ReadAll(tr) if err != nil { return err } dk.Uploads[<API key>{ ContainerID: id, UploadPath: opts.Path, TarPath: hdr.Name, Contents: string(file), }] = struct{}{} } return nil }
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Device Connect SDK for iOS: </title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Device Connect SDK for iOS &#160;<span id="projectnumber">1.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- : Doxygen 1.8.13 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,''); </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',true,false,'search.php',''); $(document).ready(function() { init_search(); }); }); </script> <div id="main-nav"></div> </div><!-- top --> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="contents"> &#160;<ul> <li>DConnectEventError : <a class="el" href="da/d3c/_d_connect_event_8h.html#<API key>">DConnectEvent.h</a> </li> <li><API key> : <a class="el" href="d8/d18/<API key>.html#<API key>">DConnectFileProfile.h</a> </li> <li><API key> : <a class="el" href="db/d77/<API key>.html#<API key>">DConnectMessage.h</a> </li> <li><API key> : <a class="el" href="db/d77/<API key>.html#<API key>">DConnectMessage.h</a> </li> <li><API key> : <a class="el" href="db/d77/<API key>.html#<API key>">DConnectMessage.h</a> </li> <li><API key> : <a class="el" href="da/dba/<API key>.html#<API key>"><API key>.h</a> </li> <li><API key> : <a class="el" href="d9/de6/<API key>.html#<API key>"><API key>.h</a> </li> <li><API key> : <a class="el" href="d9/de6/<API key>.html#<API key>"><API key>.h</a> </li> <li><API key> : <a class="el" href="d0/d03/<API key>.html#<API key>"><API key>.h</a> </li> <li><API key> : <a class="el" href="d4/dbe/<API key>.html#<API key>"><API key>.h</a> </li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> 20200706() 125950 - Device Connect SDK for iOS / : & <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.13 </small></address> </body> </html>
<?php namespace Helpers; /** * RainCaptcha: Anti-spam protection for your website. */ class RainCaptcha { /** * Constant holding the API url. */ const HOST = 'http://raincaptcha.driversworld.us/api/v1'; /** * Hold the session id. * * @var string */ private $sessionId; /** * When the class is called, the $sessionId is stored or the server settings are used as a reference. * * @param string $sessionId instance id */ public function __construct($sessionId = null) { if ($sessionId === null) { $this->sessionId = md5($_SERVER['SERVER_NAME'] . ':' . $_SERVER['REMOTE_ADDR']); } else { $this->sessionId = $sessionId; } } /** * Generate an image for the captcha. * * @return image */ public function getImage() { return self::HOST . '/image/' . $this->sessionId . '?rand' . rand(100000, 999999); } /** * Compare the given answer against the generated session. * * @param string $answer * @return boolean */ public function checkAnswer($answer) { if (empty($answer)) { return false; } $response = file_get_contents(self::HOST . '/check/' . $this->sessionId. '/' . $answer); if ($response === false) { return true; } return $response === 'true'; } }
import <API key> from "@babel/runtime/helpers/esm/<API key>"; import _extends from "@babel/runtime/helpers/esm/extends"; const _excluded = ["checked", "color", "name", "onChange", "size"]; import * as React from 'react'; import PropTypes from 'prop-types'; import { refType } from '@material-ui/utils'; import { <API key> as composeClasses } from '@material-ui/unstyled'; import { alpha } from '@material-ui/system'; import SwitchBase from '../internal/SwitchBase'; import useThemeProps from '../styles/useThemeProps'; import RadioButtonIcon from './RadioButtonIcon'; import capitalize from '../utils/capitalize'; import <API key> from '../utils/<API key>'; import useRadioGroup from '../RadioGroup/useRadioGroup'; import radioClasses, { <API key> } from './radioClasses'; import styled, { <API key> } from '../styles/styled'; import { jsx as _jsx } from "react/jsx-runtime"; const useUtilityClasses = styleProps => { const { classes, color } = styleProps; const slots = { root: ['root', `color${capitalize(color)}`] }; return _extends({}, classes, composeClasses(slots, <API key>, classes)); }; const RadioRoot = styled(SwitchBase, { shouldForwardProp: prop => <API key>(prop) || prop === 'classes', name: 'MuiRadio', slot: 'Root', overridesResolver: (props, styles) => { const { styleProps } = props; return _extends({}, styles.root, styles[`color${capitalize(styleProps.color)}`]); } })(({ theme, styleProps }) => _extends({ /* Styles applied to the root element. */ color: theme.palette.text.secondary, '&:hover': { backgroundColor: alpha(styleProps.color === 'default' ? theme.palette.action.active : theme.palette[styleProps.color].main, theme.palette.action.hoverOpacity), // Reset on touch devices, it doesn't add specificity '@media (hover: none)': { backgroundColor: 'transparent' } } }, styleProps.color !== 'default' && { [`&.${radioClasses.checked}`]: { color: theme.palette[styleProps.color].main } }, { [`&.${radioClasses.disabled}`]: { color: theme.palette.action.disabled } })); const defaultCheckedIcon = /*#__PURE__*/_jsx(RadioButtonIcon, { checked: true }); const defaultIcon = /*#__PURE__*/_jsx(RadioButtonIcon, {}); const Radio = /*#__PURE__*/React.forwardRef(function Radio(inProps, ref) { const props = useThemeProps({ props: inProps, name: 'MuiRadio' }); const { checked: checkedProp, color = 'primary', name: nameProp, onChange: onChangeProp, size = 'medium' } = props, other = <API key>(props, _excluded); const styleProps = _extends({}, props, { color, size }); const classes = useUtilityClasses(styleProps); const radioGroup = useRadioGroup(); let checked = checkedProp; const onChange = <API key>(onChangeProp, radioGroup && radioGroup.onChange); let name = nameProp; if (radioGroup) { if (typeof checked === 'undefined') { checked = radioGroup.value === props.value; } if (typeof name === 'undefined') { name = radioGroup.name; } } return /*#__PURE__*/_jsx(RadioRoot, _extends({ type: "radio", icon: /*#__PURE__*/React.cloneElement(defaultIcon, { fontSize: size === 'small' ? 'small' : 'medium' }), checkedIcon: /*#__PURE__*/React.cloneElement(defaultCheckedIcon, { fontSize: size === 'small' ? 'small' : 'medium' }), styleProps: styleProps, classes: classes, name: name, checked: checked, onChange: onChange, ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? Radio.propTypes /* remove-proptypes */ = { // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | /** * If `true`, the component is checked. */ checked: PropTypes.bool, /** * The icon to display when the component is checked. */ checkedIcon: PropTypes.node, /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * The color of the component. It supports those theme colors that make sense for this component. * @default 'primary' */ color: PropTypes /* @<API key> */ .oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]), /** * If `true`, the component is disabled. */ disabled: PropTypes.bool, /** * If `true`, the ripple effect is disabled. */ disableRipple: PropTypes.bool, /** * The icon to display when the component is unchecked. */ icon: PropTypes.node, /** * The id of the `input` element. */ id: PropTypes.string, inputProps: PropTypes.object, /** * Pass a ref to the `input` element. */ inputRef: refType, /** * Name attribute of the `input` element. */ name: PropTypes.string, /** * Callback fired when the state is changed. * * @param {object} event The event source of the callback. * You can pull out the new value by accessing `event.target.value` (string). * You can pull out the new checked state by accessing `event.target.checked` (boolean). */ onChange: PropTypes.func, /** * If `true`, the `input` element is required. */ required: PropTypes.bool, /** * The size of the component. * `small` is equivalent to the dense radio styling. * @default 'medium' */ size: PropTypes /* @<API key> */ .oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]), /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: PropTypes.object, /** * The value of the component. The DOM API casts this to a string. */ value: PropTypes.any } : void 0; export default Radio;
.ui.label { display: inline-block; line-height: 1; vertical-align: baseline; margin: 0 0.14285714em; background-color: #E8E8E8; background-image: none; padding: 0.5833em 0.833em; color: rgba(0, 0, 0, 0.6); text-transform: none; font-weight: bold; border: 0 solid transparent; border-radius: 0.28571429rem; -webkit-transition: background 0.1s ease; transition: background 0.1s ease; } .ui.label:first-child { margin-left: 0; } .ui.label:last-child { margin-right: 0; } /* Link */ a.ui.label { cursor: pointer; } /* Inside Link */ .ui.label > a { cursor: pointer; color: inherit; opacity: 0.5; -webkit-transition: 0.1s opacity ease; transition: 0.1s opacity ease; } .ui.label > a:hover { opacity: 1; } /* Image */ .ui.label > img { width: auto !important; vertical-align: middle; height: 2.1666em; } /* Icon */ .ui.left.icon.label > .icon, .ui.label > .icon { width: auto; margin: 0 0.75em 0 0; } /* Detail */ .ui.label > .detail { display: inline-block; vertical-align: top; font-weight: bold; margin-left: 1em; opacity: 0.8; } .ui.label > .detail .icon { margin: 0 0.25em 0 0; } /* Removable label */ .ui.label > .close.icon, .ui.label > .delete.icon { cursor: pointer; font-size: 0.92857143em; opacity: 0.5; -webkit-transition: background 0.1s ease; transition: background 0.1s ease; } .ui.label > .close.icon:hover, .ui.label > .delete.icon:hover { opacity: 1; } /* Backward compatible positioning */ .ui.label.left.icon > .close.icon, .ui.label.left.icon > .delete.icon { margin: 0 0.5em 0 0; } .ui.label:not(.icon) > .close.icon, .ui.label:not(.icon) > .delete.icon { margin: 0 0 0 0.5em; } /* Label for only an icon */ .ui.icon.label > .icon { margin: 0 auto; } /* Right Side Icon */ .ui.right.icon.label > .icon { margin: 0 0 0 0.75em; } .ui.labels > .label { margin: 0 0.5em 0.5em 0; } .ui.header > .ui.label { margin-top: -0.29165em; } /* Remove border radius on attached segment */ .ui.attached.segment > .ui.top.left.attached.label, .ui.bottom.attached.segment > .ui.top.left.attached.label { <API key>: 0; } .ui.attached.segment > .ui.top.right.attached.label, .ui.bottom.attached.segment > .ui.top.right.attached.label { <API key>: 0; } .ui.top.attached.segment > .ui.bottom.left.attached.label { <API key>: 0; } .ui.top.attached.segment > .ui.bottom.right.attached.label { <API key>: 0; } /* Padding on next content after a label */ .ui.top.attached.label ~ .ui.bottom.attached.label + :not(.attached), .ui.top.attached.label + :not(.attached) { margin-top: 2rem !important; } .ui.bottom.attached.label ~ :last-child:not(.attached) { margin-top: 0; margin-bottom: 2rem !important; } .ui.segment:not(.basic) > .ui.top.attached.label { margin-top: -1px; } .ui.segment:not(.basic) > .ui.bottom.attached.label { margin-bottom: -1px; } .ui.segment:not(.basic) > .ui.attached.label:not(.right) { margin-left: -1px; } .ui.segment:not(.basic) > .ui.right.attached.label { margin-right: -1px; } .ui.segment:not(.basic) > .ui.attached.label:not(.left):not(.right) { width: calc(100% + 2px); } .ui.image.label { width: auto; margin-top: 0; margin-bottom: 0; max-width: 9999px; vertical-align: baseline; text-transform: none; background: #E8E8E8; padding: 0.5833em 0.833em 0.5833em 0.5em; border-radius: 0.28571429rem; -webkit-box-shadow: none; box-shadow: none; } .ui.image.label.attached:not(.basic) { padding: 0.5833em 0.833em 0.5833em 0.5em; } .ui.image.label img { display: inline-block; vertical-align: top; height: 2.1666em; margin: -0.5833em 0.5em -0.5833em -0.5em; border-radius: 0.28571429rem 0 0 0.28571429rem; } .ui.image.label .detail { background: rgba(0, 0, 0, 0.1); margin: -0.5833em -0.833em -0.5833em 0.5em; padding: 0.5833em 0.833em; border-radius: 0 0.28571429rem 0.28571429rem 0; } .ui.bottom.attached.image.label:not(.right) > img, .ui.top.right.attached.image.label > img { <API key>: 0; } .ui.top.attached.image.label:not(.right) > img, .ui.bottom.right.attached.image.label > img { <API key>: 0; } .ui.tag.labels .label, .ui.tag.label { margin-left: 1em; position: relative; padding-left: 1.5em; padding-right: 1.5em; border-radius: 0 0.28571429rem 0.28571429rem 0; -webkit-transition: none; transition: none; } .ui.tag.labels .label:before, .ui.tag.label:before { position: absolute; -webkit-transform: translateY(-50%) translateX(50%) rotate(-45deg); transform: translateY(-50%) translateX(50%) rotate(-45deg); top: 50%; right: 100%; content: ''; background-color: inherit; background-image: none; width: 1.56em; height: 1.56em; -webkit-transition: none; transition: none; } .ui.tag.labels .label:after, .ui.tag.label:after { position: absolute; content: ''; top: 50%; left: -0.25em; margin-top: -0.25em; background-color: #FFFFFF; width: 0.5em; height: 0.5em; -webkit-box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.3); box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.3); border-radius: 500rem; } .ui.basic.tag.labels .label:before, .ui.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; right: calc(100% + 1px); } .ui.basic.tag.labels .label:after, .ui.basic.tag.label:after { -webkit-box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.8); box-shadow: 0 -1px 3px 0 rgba(0, 0, 0, 0.8); } .ui.corner.label { position: absolute; top: 0; right: 0; margin: 0; padding: 0; text-align: center; border-color: #E8E8E8; width: 4em; height: 4em; z-index: 1; -webkit-transition: border-color 0.1s ease; transition: border-color 0.1s ease; } /* Icon Label */ .ui.corner.label { background-color: transparent !important; } .ui.corner.label:after { position: absolute; content: ""; right: 0; top: 0; z-index: -1; width: 0; height: 0; background-color: transparent; border-top: 0 solid transparent; border-right: 4em solid transparent; border-bottom: 4em solid transparent; border-left: 0 solid transparent; border-right-color: inherit; -webkit-transition: border-color 0.1s ease; transition: border-color 0.1s ease; } .ui.corner.label .icon { cursor: inherit; position: absolute; top: 0.64285714em; left: auto; right: 0.57142857em; font-size: 1.14285714em; margin: 0; } /* Left Corner */ .ui.left.corner.label, .ui.left.corner.label:after { right: auto; left: 0; } .ui.left.corner.label:after { border-top: 4em solid transparent; border-right: 4em solid transparent; border-bottom: 0 solid transparent; border-left: 0 solid transparent; border-top-color: inherit; } .ui.left.corner.label .icon { left: 0.57142857em; right: auto; } /* Segment */ .ui.segment > .ui.corner.label { top: -1px; right: -1px; } .ui.segment > .ui.left.corner.label { right: auto; left: -1px; } .ui.ribbon.label { position: relative; margin: 0; min-width: -webkit-max-content; min-width: -moz-max-content; min-width: max-content; border-radius: 0 0.28571429rem 0.28571429rem 0; border-color: rgba(0, 0, 0, 0.15); } .ui.ribbon.label:after { position: absolute; content: ''; top: 100%; left: 0; background-color: transparent; border-style: solid; border-width: 0 1.2em 1.2em 0; border-color: transparent; border-right-color: inherit; width: 0; height: 0; } /* Positioning */ .ui.ribbon.label { left: calc(-1rem - 1.2em); margin-right: -1.2em; padding-left: calc(1rem + 1.2em); padding-right: 1.2em; } .ui[class*="right ribbon"].label { left: calc(100% + 1rem + 1.2em); padding-left: 1.2em; padding-right: calc(1rem + 1.2em); } .ui.basic.ribbon.label { padding-top: calc(0.5833em - 1px); padding-bottom: calc(0.5833em - 1px); } .ui.basic.ribbon.label:not([class*="right ribbon"]) { padding-left: calc(1rem + 1.2em - 1px); padding-right: calc(1.2em - 1px); } .ui.basic[class*="right ribbon"].label { padding-left: calc(1.2em - 1px); padding-right: calc(1rem + 1.2em - 1px); } .ui.basic.ribbon.label::after { top: calc(100% + 1px); } .ui.basic.ribbon.label:not([class*="right ribbon"])::after { left: -1px; } .ui.basic[class*="right ribbon"].label::after { right: -1px; } /* Right Ribbon */ .ui[class*="right ribbon"].label { text-align: left; -webkit-transform: translateX(-100%); transform: translateX(-100%); border-radius: 0.28571429rem 0 0 0.28571429rem; } .ui[class*="right ribbon"].label:after { left: auto; right: 0; border-style: solid; border-width: 1.2em 1.2em 0 0; border-color: transparent; border-top-color: inherit; } /* Inside Table */ .ui.image > .ribbon.label, .ui.card .image > .ribbon.label { position: absolute; top: 1rem; } .ui.card .image > .ui.ribbon.label, .ui.image > .ui.ribbon.label { left: calc(0.05rem - 1.2em); } .ui.card .image > .ui[class*="right ribbon"].label, .ui.image > .ui[class*="right ribbon"].label { left: calc(100% + -0.05rem + 1.2em); padding-left: 0.833em; } /* Inside Table */ .ui.table td > .ui.ribbon.label { left: calc(-1em - 1.2em); } .ui.table td > .ui[class*="right ribbon"].label { left: calc(100% + 1em + 1.2em); padding-left: 0.833em; } .ui[class*="top attached"].label, .ui.attached.label { width: 100%; position: absolute; margin: 0; top: 0; left: 0; padding: 0.75em 1em; border-radius: 0.21428571rem 0.21428571rem 0 0; } .ui[class*="bottom attached"].label { top: auto; bottom: 0; border-radius: 0 0 0.21428571rem 0.21428571rem; } .ui[class*="top left attached"].label { width: auto; margin-top: 0; border-radius: 0.21428571rem 0 0.28571429rem 0; } .ui[class*="top right attached"].label { width: auto; left: auto; right: 0; border-radius: 0 0.21428571rem 0 0.28571429rem; } .ui[class*="bottom left attached"].label { width: auto; top: auto; bottom: 0; border-radius: 0 0.28571429rem 0 0.21428571rem; } .ui[class*="bottom right attached"].label { top: auto; bottom: 0; left: auto; right: 0; width: auto; border-radius: 0.28571429rem 0 0.21428571rem 0; } .ui.label.disabled { opacity: 0.5; } .ui.labels a.label:hover, a.ui.label:hover { background-color: #E0E0E0; border-color: #E0E0E0; background-image: none; color: rgba(0, 0, 0, 0.8); } .ui.labels a.label:hover:before, a.ui.label:hover:before { color: rgba(0, 0, 0, 0.8); } .ui.active.label { background-color: #D0D0D0; border-color: #D0D0D0; background-image: none; color: rgba(0, 0, 0, 0.95); } .ui.active.label:before { background-color: #D0D0D0; background-image: none; color: rgba(0, 0, 0, 0.95); } .ui.labels a.active.label:hover, a.ui.active.label:hover { background-color: #C8C8C8; border-color: #C8C8C8; background-image: none; color: rgba(0, 0, 0, 0.95); } .ui.labels a.active.label:hover:before, a.ui.active.label:hover:before { background-color: #C8C8C8; background-image: none; color: rgba(0, 0, 0, 0.95); } .ui.labels.visible .label, .ui.label.visible:not(.dropdown) { display: inline-block !important; } .ui.labels.hidden .label, .ui.label.hidden { display: none !important; } .ui.basic.labels .label, .ui.basic.label { background: none #FFFFFF; border: 1px solid rgba(34, 36, 38, 0.15); color: rgba(0, 0, 0, 0.87); -webkit-box-shadow: none; box-shadow: none; padding-top: calc(0.5833em - 1px); padding-bottom: calc(0.5833em - 1px); padding-right: calc(0.833em - 1px); } .ui.basic.labels:not(.tag):not(.image):not(.ribbon) .label, .ui.basic.label:not(.tag):not(.image):not(.ribbon) { padding-left: calc(0.833em - 1px); } .ui.basic.image.label { padding-left: calc(0.5em - 1px); } /* Link */ .ui.basic.labels a.label:hover, a.ui.basic.label:hover { text-decoration: none; background: none #FFFFFF; color: #1e70bf; -webkit-box-shadow: none; box-shadow: none; } /* Pointing */ .ui.basic.pointing.label:before { border-color: inherit; } .ui.label.fluid, .ui.fluid.labels > .label { width: 100%; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui.inverted.labels .label, .ui.inverted.label { color: rgba(255, 255, 255, 0.9); background-color: #b5b5b5; } .ui.inverted.corner.label { border-color: #b5b5b5; } .ui.inverted.corner.label:hover { border-color: #E8E8E8; -webkit-transition: none; transition: none; } .ui.inverted.basic.labels .label, .ui.inverted.basic.label, .ui.inverted.basic.label:hover { border-color: rgba(255, 255, 255, 0.5); background: #1B1C1D; } .ui.inverted.basic.label:hover { color: #4183C4; } .ui.primary.labels .label, .ui.ui.ui.primary.label { background-color: #2185D0; border-color: #2185D0; color: rgba(255, 255, 255, 0.9); } /* Link */ .ui.primary.labels a.label:hover, a.ui.ui.ui.primary.label:hover { background-color: #1678c2; border-color: #1678c2; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.primary.ribbon.label { border-color: #1a69a4; } /* Basic */ .ui.basic.labels .primary.label, .ui.ui.ui.basic.primary.label { background: none #FFFFFF; border-color: #2185D0; color: #2185D0; } .ui.basic.labels a.primary.label:hover, a.ui.ui.ui.basic.primary.label:hover { background: none #FFFFFF; border-color: #1678c2; color: #1678c2; } /* Inverted */ .ui.inverted.labels .primary.label, .ui.ui.ui.inverted.primary.label { background-color: #54C8FF; border-color: #54C8FF; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.primary.label:hover, a.ui.ui.ui.inverted.primary.label:hover { background-color: #21b8ff; border-color: #21b8ff; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.primary.ribbon.label { border-color: #21b8ff; } /* Inverted Basic */ .ui.inverted.basic.labels .primary.label, .ui.ui.ui.inverted.basic.primary.label { background-color: #1B1C1D; border-color: #54C8FF; color: #54C8FF; } .ui.inverted.basic.labels a.primary.label:hover, a.ui.ui.ui.inverted.basic.primary.label:hover { border-color: #21b8ff; background-color: #1B1C1D; color: #21b8ff; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .primary.label, .ui.ui.ui.inverted.primary.basic.tag.label { border: 1px solid #54C8FF; } .ui.inverted.basic.tag.labels .primary.label:before, .ui.ui.ui.inverted.primary.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.secondary.labels .label, .ui.ui.ui.secondary.label { background-color: #1B1C1D; border-color: #1B1C1D; color: rgba(255, 255, 255, 0.9); } /* Link */ .ui.secondary.labels a.label:hover, a.ui.ui.ui.secondary.label:hover { background-color: #27292a; border-color: #27292a; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.secondary.ribbon.label { border-color: #020203; } /* Basic */ .ui.basic.labels .secondary.label, .ui.ui.ui.basic.secondary.label { background: none #FFFFFF; border-color: #1B1C1D; color: #1B1C1D; } .ui.basic.labels a.secondary.label:hover, a.ui.ui.ui.basic.secondary.label:hover { background: none #FFFFFF; border-color: #27292a; color: #27292a; } /* Inverted */ .ui.inverted.labels .secondary.label, .ui.ui.ui.inverted.secondary.label { background-color: #545454; border-color: #545454; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.secondary.label:hover, a.ui.ui.ui.inverted.secondary.label:hover { background-color: #6e6e6e; border-color: #6e6e6e; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.secondary.ribbon.label { border-color: #3b3b3b; } /* Inverted Basic */ .ui.inverted.basic.labels .secondary.label, .ui.ui.ui.inverted.basic.secondary.label { background-color: #1B1C1D; border-color: #545454; color: #545454; } .ui.inverted.basic.labels a.secondary.label:hover, a.ui.ui.ui.inverted.basic.secondary.label:hover { border-color: #6e6e6e; background-color: #1B1C1D; color: #6e6e6e; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .secondary.label, .ui.ui.ui.inverted.secondary.basic.tag.label { border: 1px solid #545454; } .ui.inverted.basic.tag.labels .secondary.label:before, .ui.ui.ui.inverted.secondary.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.red.labels .label, .ui.ui.ui.red.label { background-color: #DB2828; border-color: #DB2828; color: #FFFFFF; } /* Link */ .ui.red.labels a.label:hover, a.ui.ui.ui.red.label:hover { background-color: #d01919; border-color: #d01919; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.red.ribbon.label { border-color: #b21e1e; } /* Basic */ .ui.basic.labels .red.label, .ui.ui.ui.basic.red.label { background: none #FFFFFF; border-color: #DB2828; color: #DB2828; } .ui.basic.labels a.red.label:hover, a.ui.ui.ui.basic.red.label:hover { background: none #FFFFFF; border-color: #d01919; color: #d01919; } /* Inverted */ .ui.inverted.labels .red.label, .ui.ui.ui.inverted.red.label { background-color: #FF695E; border-color: #FF695E; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.red.label:hover, a.ui.ui.ui.inverted.red.label:hover { background-color: #ff392b; border-color: #ff392b; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.red.ribbon.label { border-color: #ff392b; } /* Inverted Basic */ .ui.inverted.basic.labels .red.label, .ui.ui.ui.inverted.basic.red.label { background-color: #1B1C1D; border-color: #FF695E; color: #FF695E; } .ui.inverted.basic.labels a.red.label:hover, a.ui.ui.ui.inverted.basic.red.label:hover { border-color: #ff392b; background-color: #1B1C1D; color: #ff392b; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .red.label, .ui.ui.ui.inverted.red.basic.tag.label { border: 1px solid #FF695E; } .ui.inverted.basic.tag.labels .red.label:before, .ui.ui.ui.inverted.red.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.orange.labels .label, .ui.ui.ui.orange.label { background-color: #F2711C; border-color: #F2711C; color: #FFFFFF; } /* Link */ .ui.orange.labels a.label:hover, a.ui.ui.ui.orange.label:hover { background-color: #f26202; border-color: #f26202; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.orange.ribbon.label { border-color: #cf590c; } /* Basic */ .ui.basic.labels .orange.label, .ui.ui.ui.basic.orange.label { background: none #FFFFFF; border-color: #F2711C; color: #F2711C; } .ui.basic.labels a.orange.label:hover, a.ui.ui.ui.basic.orange.label:hover { background: none #FFFFFF; border-color: #f26202; color: #f26202; } /* Inverted */ .ui.inverted.labels .orange.label, .ui.ui.ui.inverted.orange.label { background-color: #FF851B; border-color: #FF851B; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.orange.label:hover, a.ui.ui.ui.inverted.orange.label:hover { background-color: #e76b00; border-color: #e76b00; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.orange.ribbon.label { border-color: #e76b00; } /* Inverted Basic */ .ui.inverted.basic.labels .orange.label, .ui.ui.ui.inverted.basic.orange.label { background-color: #1B1C1D; border-color: #FF851B; color: #FF851B; } .ui.inverted.basic.labels a.orange.label:hover, a.ui.ui.ui.inverted.basic.orange.label:hover { border-color: #e76b00; background-color: #1B1C1D; color: #e76b00; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .orange.label, .ui.ui.ui.inverted.orange.basic.tag.label { border: 1px solid #FF851B; } .ui.inverted.basic.tag.labels .orange.label:before, .ui.ui.ui.inverted.orange.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.yellow.labels .label, .ui.ui.ui.yellow.label { background-color: #FBBD08; border-color: #FBBD08; color: #FFFFFF; } /* Link */ .ui.yellow.labels a.label:hover, a.ui.ui.ui.yellow.label:hover { background-color: #eaae00; border-color: #eaae00; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.yellow.ribbon.label { border-color: #cd9903; } /* Basic */ .ui.basic.labels .yellow.label, .ui.ui.ui.basic.yellow.label { background: none #FFFFFF; border-color: #FBBD08; color: #FBBD08; } .ui.basic.labels a.yellow.label:hover, a.ui.ui.ui.basic.yellow.label:hover { background: none #FFFFFF; border-color: #eaae00; color: #eaae00; } /* Inverted */ .ui.inverted.labels .yellow.label, .ui.ui.ui.inverted.yellow.label { background-color: #FFE21F; border-color: #FFE21F; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.yellow.label:hover, a.ui.ui.ui.inverted.yellow.label:hover { background-color: #ebcd00; border-color: #ebcd00; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.yellow.ribbon.label { border-color: #ebcd00; } /* Inverted Basic */ .ui.inverted.basic.labels .yellow.label, .ui.ui.ui.inverted.basic.yellow.label { background-color: #1B1C1D; border-color: #FFE21F; color: #FFE21F; } .ui.inverted.basic.labels a.yellow.label:hover, a.ui.ui.ui.inverted.basic.yellow.label:hover { border-color: #ebcd00; background-color: #1B1C1D; color: #ebcd00; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .yellow.label, .ui.ui.ui.inverted.yellow.basic.tag.label { border: 1px solid #FFE21F; } .ui.inverted.basic.tag.labels .yellow.label:before, .ui.ui.ui.inverted.yellow.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.olive.labels .label, .ui.ui.ui.olive.label { background-color: #B5CC18; border-color: #B5CC18; color: #FFFFFF; } /* Link */ .ui.olive.labels a.label:hover, a.ui.ui.ui.olive.label:hover { background-color: #a7bd0d; border-color: #a7bd0d; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.olive.ribbon.label { border-color: #8d9e13; } /* Basic */ .ui.basic.labels .olive.label, .ui.ui.ui.basic.olive.label { background: none #FFFFFF; border-color: #B5CC18; color: #B5CC18; } .ui.basic.labels a.olive.label:hover, a.ui.ui.ui.basic.olive.label:hover { background: none #FFFFFF; border-color: #a7bd0d; color: #a7bd0d; } /* Inverted */ .ui.inverted.labels .olive.label, .ui.ui.ui.inverted.olive.label { background-color: #D9E778; border-color: #D9E778; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.olive.label:hover, a.ui.ui.ui.inverted.olive.label:hover { background-color: #d2e745; border-color: #d2e745; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.olive.ribbon.label { border-color: #cddf4d; } /* Inverted Basic */ .ui.inverted.basic.labels .olive.label, .ui.ui.ui.inverted.basic.olive.label { background-color: #1B1C1D; border-color: #D9E778; color: #D9E778; } .ui.inverted.basic.labels a.olive.label:hover, a.ui.ui.ui.inverted.basic.olive.label:hover { border-color: #d2e745; background-color: #1B1C1D; color: #d2e745; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .olive.label, .ui.ui.ui.inverted.olive.basic.tag.label { border: 1px solid #D9E778; } .ui.inverted.basic.tag.labels .olive.label:before, .ui.ui.ui.inverted.olive.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.green.labels .label, .ui.ui.ui.green.label { background-color: #21BA45; border-color: #21BA45; color: #FFFFFF; } /* Link */ .ui.green.labels a.label:hover, a.ui.ui.ui.green.label:hover { background-color: #16ab39; border-color: #16ab39; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.green.ribbon.label { border-color: #198f35; } /* Basic */ .ui.basic.labels .green.label, .ui.ui.ui.basic.green.label { background: none #FFFFFF; border-color: #21BA45; color: #21BA45; } .ui.basic.labels a.green.label:hover, a.ui.ui.ui.basic.green.label:hover { background: none #FFFFFF; border-color: #16ab39; color: #16ab39; } /* Inverted */ .ui.inverted.labels .green.label, .ui.ui.ui.inverted.green.label { background-color: #2ECC40; border-color: #2ECC40; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.green.label:hover, a.ui.ui.ui.inverted.green.label:hover { background-color: #1ea92e; border-color: #1ea92e; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.green.ribbon.label { border-color: #25a233; } /* Inverted Basic */ .ui.inverted.basic.labels .green.label, .ui.ui.ui.inverted.basic.green.label { background-color: #1B1C1D; border-color: #2ECC40; color: #2ECC40; } .ui.inverted.basic.labels a.green.label:hover, a.ui.ui.ui.inverted.basic.green.label:hover { border-color: #1ea92e; background-color: #1B1C1D; color: #1ea92e; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .green.label, .ui.ui.ui.inverted.green.basic.tag.label { border: 1px solid #2ECC40; } .ui.inverted.basic.tag.labels .green.label:before, .ui.ui.ui.inverted.green.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.teal.labels .label, .ui.ui.ui.teal.label { background-color: #00B5AD; border-color: #00B5AD; color: #FFFFFF; } /* Link */ .ui.teal.labels a.label:hover, a.ui.ui.ui.teal.label:hover { background-color: #009c95; border-color: #009c95; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.teal.ribbon.label { border-color: #00827c; } /* Basic */ .ui.basic.labels .teal.label, .ui.ui.ui.basic.teal.label { background: none #FFFFFF; border-color: #00B5AD; color: #00B5AD; } .ui.basic.labels a.teal.label:hover, a.ui.ui.ui.basic.teal.label:hover { background: none #FFFFFF; border-color: #009c95; color: #009c95; } /* Inverted */ .ui.inverted.labels .teal.label, .ui.ui.ui.inverted.teal.label { background-color: #6DFFFF; border-color: #6DFFFF; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.teal.label:hover, a.ui.ui.ui.inverted.teal.label:hover { background-color: #3affff; border-color: #3affff; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.teal.ribbon.label { border-color: #3affff; } /* Inverted Basic */ .ui.inverted.basic.labels .teal.label, .ui.ui.ui.inverted.basic.teal.label { background-color: #1B1C1D; border-color: #6DFFFF; color: #6DFFFF; } .ui.inverted.basic.labels a.teal.label:hover, a.ui.ui.ui.inverted.basic.teal.label:hover { border-color: #3affff; background-color: #1B1C1D; color: #3affff; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .teal.label, .ui.ui.ui.inverted.teal.basic.tag.label { border: 1px solid #6DFFFF; } .ui.inverted.basic.tag.labels .teal.label:before, .ui.ui.ui.inverted.teal.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.blue.labels .label, .ui.ui.ui.blue.label { background-color: #2185D0; border-color: #2185D0; color: #FFFFFF; } /* Link */ .ui.blue.labels a.label:hover, a.ui.ui.ui.blue.label:hover { background-color: #1678c2; border-color: #1678c2; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.blue.ribbon.label { border-color: #1a69a4; } /* Basic */ .ui.basic.labels .blue.label, .ui.ui.ui.basic.blue.label { background: none #FFFFFF; border-color: #2185D0; color: #2185D0; } .ui.basic.labels a.blue.label:hover, a.ui.ui.ui.basic.blue.label:hover { background: none #FFFFFF; border-color: #1678c2; color: #1678c2; } /* Inverted */ .ui.inverted.labels .blue.label, .ui.ui.ui.inverted.blue.label { background-color: #54C8FF; border-color: #54C8FF; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.blue.label:hover, a.ui.ui.ui.inverted.blue.label:hover { background-color: #21b8ff; border-color: #21b8ff; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.blue.ribbon.label { border-color: #21b8ff; } /* Inverted Basic */ .ui.inverted.basic.labels .blue.label, .ui.ui.ui.inverted.basic.blue.label { background-color: #1B1C1D; border-color: #54C8FF; color: #54C8FF; } .ui.inverted.basic.labels a.blue.label:hover, a.ui.ui.ui.inverted.basic.blue.label:hover { border-color: #21b8ff; background-color: #1B1C1D; color: #21b8ff; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .blue.label, .ui.ui.ui.inverted.blue.basic.tag.label { border: 1px solid #54C8FF; } .ui.inverted.basic.tag.labels .blue.label:before, .ui.ui.ui.inverted.blue.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.violet.labels .label, .ui.ui.ui.violet.label { background-color: #6435C9; border-color: #6435C9; color: #FFFFFF; } /* Link */ .ui.violet.labels a.label:hover, a.ui.ui.ui.violet.label:hover { background-color: #5829bb; border-color: #5829bb; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.violet.ribbon.label { border-color: #502aa1; } /* Basic */ .ui.basic.labels .violet.label, .ui.ui.ui.basic.violet.label { background: none #FFFFFF; border-color: #6435C9; color: #6435C9; } .ui.basic.labels a.violet.label:hover, a.ui.ui.ui.basic.violet.label:hover { background: none #FFFFFF; border-color: #5829bb; color: #5829bb; } /* Inverted */ .ui.inverted.labels .violet.label, .ui.ui.ui.inverted.violet.label { background-color: #A291FB; border-color: #A291FB; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.violet.label:hover, a.ui.ui.ui.inverted.violet.label:hover { background-color: #745aff; border-color: #745aff; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.violet.ribbon.label { border-color: #7860f9; } /* Inverted Basic */ .ui.inverted.basic.labels .violet.label, .ui.ui.ui.inverted.basic.violet.label { background-color: #1B1C1D; border-color: #A291FB; color: #A291FB; } .ui.inverted.basic.labels a.violet.label:hover, a.ui.ui.ui.inverted.basic.violet.label:hover { border-color: #745aff; background-color: #1B1C1D; color: #745aff; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .violet.label, .ui.ui.ui.inverted.violet.basic.tag.label { border: 1px solid #A291FB; } .ui.inverted.basic.tag.labels .violet.label:before, .ui.ui.ui.inverted.violet.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.purple.labels .label, .ui.ui.ui.purple.label { background-color: #A333C8; border-color: #A333C8; color: #FFFFFF; } /* Link */ .ui.purple.labels a.label:hover, a.ui.ui.ui.purple.label:hover { background-color: #9627ba; border-color: #9627ba; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.purple.ribbon.label { border-color: #82299f; } /* Basic */ .ui.basic.labels .purple.label, .ui.ui.ui.basic.purple.label { background: none #FFFFFF; border-color: #A333C8; color: #A333C8; } .ui.basic.labels a.purple.label:hover, a.ui.ui.ui.basic.purple.label:hover { background: none #FFFFFF; border-color: #9627ba; color: #9627ba; } /* Inverted */ .ui.inverted.labels .purple.label, .ui.ui.ui.inverted.purple.label { background-color: #DC73FF; border-color: #DC73FF; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.purple.label:hover, a.ui.ui.ui.inverted.purple.label:hover { background-color: #cf40ff; border-color: #cf40ff; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.purple.ribbon.label { border-color: #cf40ff; } /* Inverted Basic */ .ui.inverted.basic.labels .purple.label, .ui.ui.ui.inverted.basic.purple.label { background-color: #1B1C1D; border-color: #DC73FF; color: #DC73FF; } .ui.inverted.basic.labels a.purple.label:hover, a.ui.ui.ui.inverted.basic.purple.label:hover { border-color: #cf40ff; background-color: #1B1C1D; color: #cf40ff; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .purple.label, .ui.ui.ui.inverted.purple.basic.tag.label { border: 1px solid #DC73FF; } .ui.inverted.basic.tag.labels .purple.label:before, .ui.ui.ui.inverted.purple.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.pink.labels .label, .ui.ui.ui.pink.label { background-color: #E03997; border-color: #E03997; color: #FFFFFF; } /* Link */ .ui.pink.labels a.label:hover, a.ui.ui.ui.pink.label:hover { background-color: #e61a8d; border-color: #e61a8d; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.pink.ribbon.label { border-color: #c71f7e; } /* Basic */ .ui.basic.labels .pink.label, .ui.ui.ui.basic.pink.label { background: none #FFFFFF; border-color: #E03997; color: #E03997; } .ui.basic.labels a.pink.label:hover, a.ui.ui.ui.basic.pink.label:hover { background: none #FFFFFF; border-color: #e61a8d; color: #e61a8d; } /* Inverted */ .ui.inverted.labels .pink.label, .ui.ui.ui.inverted.pink.label { background-color: #FF8EDF; border-color: #FF8EDF; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.pink.label:hover, a.ui.ui.ui.inverted.pink.label:hover { background-color: #ff5bd1; border-color: #ff5bd1; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.pink.ribbon.label { border-color: #ff5bd1; } /* Inverted Basic */ .ui.inverted.basic.labels .pink.label, .ui.ui.ui.inverted.basic.pink.label { background-color: #1B1C1D; border-color: #FF8EDF; color: #FF8EDF; } .ui.inverted.basic.labels a.pink.label:hover, a.ui.ui.ui.inverted.basic.pink.label:hover { border-color: #ff5bd1; background-color: #1B1C1D; color: #ff5bd1; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .pink.label, .ui.ui.ui.inverted.pink.basic.tag.label { border: 1px solid #FF8EDF; } .ui.inverted.basic.tag.labels .pink.label:before, .ui.ui.ui.inverted.pink.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.brown.labels .label, .ui.ui.ui.brown.label { background-color: #A5673F; border-color: #A5673F; color: #FFFFFF; } /* Link */ .ui.brown.labels a.label:hover, a.ui.ui.ui.brown.label:hover { background-color: #975b33; border-color: #975b33; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.brown.ribbon.label { border-color: #805031; } /* Basic */ .ui.basic.labels .brown.label, .ui.ui.ui.basic.brown.label { background: none #FFFFFF; border-color: #A5673F; color: #A5673F; } .ui.basic.labels a.brown.label:hover, a.ui.ui.ui.basic.brown.label:hover { background: none #FFFFFF; border-color: #975b33; color: #975b33; } /* Inverted */ .ui.inverted.labels .brown.label, .ui.ui.ui.inverted.brown.label { background-color: #D67C1C; border-color: #D67C1C; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.brown.label:hover, a.ui.ui.ui.inverted.brown.label:hover { background-color: #b0620f; border-color: #b0620f; color: #1B1C1D; } /* Inverted Ribbon */ .ui.ui.ui.inverted.brown.ribbon.label { border-color: #a96216; } /* Inverted Basic */ .ui.inverted.basic.labels .brown.label, .ui.ui.ui.inverted.basic.brown.label { background-color: #1B1C1D; border-color: #D67C1C; color: #D67C1C; } .ui.inverted.basic.labels a.brown.label:hover, a.ui.ui.ui.inverted.basic.brown.label:hover { border-color: #b0620f; background-color: #1B1C1D; color: #b0620f; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .brown.label, .ui.ui.ui.inverted.brown.basic.tag.label { border: 1px solid #D67C1C; } .ui.inverted.basic.tag.labels .brown.label:before, .ui.ui.ui.inverted.brown.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.grey.labels .label, .ui.ui.ui.grey.label { background-color: #767676; border-color: #767676; color: #FFFFFF; } /* Link */ .ui.grey.labels a.label:hover, a.ui.ui.ui.grey.label:hover { background-color: #838383; border-color: #838383; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.grey.ribbon.label { border-color: #5d5d5d; } /* Basic */ .ui.basic.labels .grey.label, .ui.ui.ui.basic.grey.label { background: none #FFFFFF; border-color: #767676; color: #767676; } .ui.basic.labels a.grey.label:hover, a.ui.ui.ui.basic.grey.label:hover { background: none #FFFFFF; border-color: #838383; color: #838383; } /* Inverted */ .ui.inverted.labels .grey.label, .ui.ui.ui.inverted.grey.label { background-color: #DCDDDE; border-color: #DCDDDE; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.grey.label:hover, a.ui.ui.ui.inverted.grey.label:hover { background-color: #c2c4c5; border-color: #c2c4c5; color: #FFFFFF; } /* Inverted Ribbon */ .ui.ui.ui.inverted.grey.ribbon.label { border-color: #e9eaea; } /* Inverted Basic */ .ui.inverted.basic.labels .grey.label, .ui.ui.ui.inverted.basic.grey.label { background-color: #1B1C1D; border-color: #DCDDDE; color: rgba(255, 255, 255, 0.9); } .ui.inverted.basic.labels a.grey.label:hover, a.ui.ui.ui.inverted.basic.grey.label:hover { border-color: #c2c4c5; background-color: #1B1C1D; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .grey.label, .ui.ui.ui.inverted.grey.basic.tag.label { border: 1px solid #DCDDDE; } .ui.inverted.basic.tag.labels .grey.label:before, .ui.ui.ui.inverted.grey.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.black.labels .label, .ui.ui.ui.black.label { background-color: #1B1C1D; border-color: #1B1C1D; color: #FFFFFF; } /* Link */ .ui.black.labels a.label:hover, a.ui.ui.ui.black.label:hover { background-color: #27292a; border-color: #27292a; color: #FFFFFF; } /* Ribbon */ .ui.ui.ui.black.ribbon.label { border-color: #020203; } /* Basic */ .ui.basic.labels .black.label, .ui.ui.ui.basic.black.label { background: none #FFFFFF; border-color: #1B1C1D; color: #1B1C1D; } .ui.basic.labels a.black.label:hover, a.ui.ui.ui.basic.black.label:hover { background: none #FFFFFF; border-color: #27292a; color: #27292a; } /* Inverted */ .ui.inverted.labels .black.label, .ui.ui.ui.inverted.black.label { background-color: #545454; border-color: #545454; color: #1B1C1D; } /* Inverted Link */ .ui.inverted.labels a.black.label:hover, a.ui.ui.ui.inverted.black.label:hover { background-color: #000000; border-color: #000000; color: #FFFFFF; } /* Inverted Ribbon */ .ui.ui.ui.inverted.black.ribbon.label { border-color: #616161; } /* Inverted Basic */ .ui.inverted.basic.labels .black.label, .ui.ui.ui.inverted.basic.black.label { background-color: #1B1C1D; border-color: #545454; color: rgba(255, 255, 255, 0.9); } .ui.inverted.basic.labels a.black.label:hover, a.ui.ui.ui.inverted.basic.black.label:hover { border-color: #000000; background-color: #1B1C1D; } /* Inverted Basic Tags */ .ui.inverted.basic.tag.labels .black.label, .ui.ui.ui.inverted.black.basic.tag.label { border: 1px solid #545454; } .ui.inverted.basic.tag.labels .black.label:before, .ui.ui.ui.inverted.black.basic.tag.label:before { border-color: inherit; border-width: 1px 0 0 1px; border-style: inherit; background-color: #1B1C1D; right: calc(100% + 1px); } .ui.horizontal.labels .label, .ui.horizontal.label { margin: 0 0.5em 0 0; padding: 0.4em 0.833em; min-width: 3em; text-align: center; } .ui.circular.labels .label, .ui.circular.label { min-width: 2em; min-height: 2em; padding: 0.5em !important; line-height: 1em; text-align: center; border-radius: 500rem; } .ui.empty.circular.labels .label, .ui.empty.circular.label { min-width: 0; min-height: 0; overflow: hidden; width: 0.5em; height: 0.5em; vertical-align: baseline; } .ui.pointing.label { position: relative; } .ui.attached.pointing.label { position: absolute; } .ui.pointing.label:before { background-color: inherit; background-image: inherit; border-width: 0; border-style: solid; border-color: inherit; } /* Arrow */ .ui.pointing.label:before { position: absolute; content: ''; -webkit-transform: rotate(45deg); transform: rotate(45deg); background-image: none; z-index: 2; width: 0.6666em; height: 0.6666em; -webkit-transition: none; transition: none; } .ui.pointing.label, .ui[class*="pointing above"].label { margin-top: 1em; } .ui.pointing.label:before, .ui[class*="pointing above"].label:before { border-width: 1px 0 0 1px; -webkit-transform: translateX(-50%) translateY(-50%) rotate(45deg); transform: translateX(-50%) translateY(-50%) rotate(45deg); top: 0; left: 50%; } .ui[class*="bottom pointing"].label, .ui[class*="pointing below"].label { margin-top: 0; margin-bottom: 1em; } .ui[class*="bottom pointing"].label:before, .ui[class*="pointing below"].label:before { border-width: 0 1px 1px 0; top: auto; right: auto; -webkit-transform: translateX(-50%) translateY(-50%) rotate(45deg); transform: translateX(-50%) translateY(-50%) rotate(45deg); top: 100%; left: 50%; } .ui[class*="left pointing"].label { margin-top: 0; margin-left: 0.6666em; } .ui[class*="left pointing"].label:before { border-width: 0 0 1px 1px; -webkit-transform: translateX(-50%) translateY(-50%) rotate(45deg); transform: translateX(-50%) translateY(-50%) rotate(45deg); bottom: auto; right: auto; top: 50%; left: 0; } .ui[class*="right pointing"].label { margin-top: 0; margin-right: 0.6666em; } .ui[class*="right pointing"].label:before { border-width: 1px 1px 0 0; -webkit-transform: translateX(50%) translateY(-50%) rotate(45deg); transform: translateX(50%) translateY(-50%) rotate(45deg); top: 50%; right: 0; bottom: auto; left: auto; } /* Basic Pointing */ .ui.basic.pointing.label:before, .ui.basic[class*="pointing above"].label:before { margin-top: -1px; } .ui.basic[class*="bottom pointing"].label:before, .ui.basic[class*="pointing below"].label:before { bottom: auto; top: 100%; margin-top: 1px; } .ui.basic[class*="left pointing"].label:before { top: 50%; left: -1px; } .ui.basic[class*="right pointing"].label:before { top: 50%; right: -1px; } .ui.floating.label { position: absolute; z-index: 100; top: -1em; right: 0; white-space: nowrap; -webkit-transform: translateX(50%); transform: translateX(50%); } .ui.right.aligned.floating.label { -webkit-transform: translateX(1.2em); transform: translateX(1.2em); } .ui.left.floating.label { left: 0; right: auto; -webkit-transform: translateX(-50%); transform: translateX(-50%); } .ui.left.aligned.floating.label { -webkit-transform: translateX(-1.2em); transform: translateX(-1.2em); } .ui.bottom.floating.label { top: auto; bottom: -1em; } .ui.labels .label, .ui.label { font-size: 0.85714286rem; } .ui.mini.labels .label, .ui.mini.label { font-size: 0.64285714rem; } .ui.tiny.labels .label, .ui.tiny.label { font-size: 0.71428571rem; } .ui.small.labels .label, .ui.small.label { font-size: 0.78571429rem; } .ui.large.labels .label, .ui.large.label { font-size: 1rem; } .ui.big.labels .label, .ui.big.label { font-size: 1.28571429rem; } .ui.huge.labels .label, .ui.huge.label { font-size: 1.42857143rem; } .ui.massive.labels .label, .ui.massive.label { font-size: 1.71428571rem; }
//>>built define({"widgets/Measurement/nls/strings":{_widgetLabel:"M\u00f5\u00f5tmine",_localized:{}}});
subroutine wndgen(j) !! ~ ~ ~ PURPOSE ~ ~ ~ !! this subroutine generates wind speed !! ~ ~ ~ INCOMING VARIABLES ~ ~ ~ !! name |units |definition !! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ !! idg(:) |none |array location of random number seed used !! |for a given process !! j |none |HRU number !! i_mo |none |month being simulated !! rndseed(:,:)|none |random number seeds !! wndav(:,:) |m/s |average wind speed for the month in HRU !! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ !! ~ ~ ~ OUTGOING VARIABLES ~ ~ ~ !! name |units |definition !! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ !! u10(:) |m/s |wind speed for the day in HRU !! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ !! ~ ~ ~ LOCAL DEFINITIONS ~ ~ ~ !! name |units |definition !! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ !! v6 |none |random number between 0.0 and 1.0 !! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ !! ~ ~ ~ SUBROUTINES/FUNCTIONS CALLED ~ ~ ~ !! Intrinsic: Log !! SWAT: Aunif !! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~ use parm integer, intent (in) :: j real :: v6 !! Generate wind speed !! v6 = 0. v6 = Aunif(rndseed(idg(5),j)) u10(j) = wndav(i_mo,hru_sub(j)) * (-Log(v6)) ** 0.3 return end
layout: default <div class="header"> <h1>{{ page.title }}</h1> <h2>{{ page.subtitle }}</h2> </div> <div class="content"> {{ content }} </div>
layout: post title: Magazine layout proposal for ONG organization WWF "Great Animals" preview: /previews/<API key>.jpg date: 2014-06-10 width: 2 /assets/wwf/<API key>.jpg
//>>built define({"dijit/_editor/nls/commands":{bold:"Kal\u0131n",copy:"Kopyala",cut:"Kes","delete":"Sil",indent:"Girinti",<API key>:"Yatay Kural",insertOrderedList:"Numaral\u0131 Liste",insertUnorderedList:"Madde \u0130\u015faretli Liste",italic:"\u0130talik",justifyCenter:"Ortaya Hizala",justifyFull:"Yasla",justifyLeft:"Sola Hizala",justifyRight:"Sa\u011fa Hizala",outdent:"\u00c7\u0131k\u0131nt\u0131",paste:"Yap\u0131\u015ft\u0131r",redo:"Yinele",removeFormat:"Bi\u00e7imi Kald\u0131r",selectAll:"T\u00fcm\u00fcn\u00fc Se\u00e7", strikethrough:"\u00dcst\u00fc \u00c7izili",subscript:"Alt Simge",superscript:"\u00dcst Simge",underline:"Alt\u0131 \u00c7izili",undo:"Geri Al",unlink:"Ba\u011flant\u0131y\u0131 Kald\u0131r",createLink:"Ba\u011flant\u0131 Olu\u015ftur",toggleDir:"Y\u00f6n\u00fc De\u011fi\u015ftir",insertImage:"Resim Ekle",insertTable:"Tablo Ekle/D\u00fczenle",toggleTableBorder:"Tablo Kenarl\u0131\u011f\u0131n\u0131 G\u00f6ster/Gizle",deleteTable:"Tabloyu Sil",tableProp:"Tablo \u00d6zelli\u011fi",htmlToggle:"HTML Kayna\u011f\u0131", foreColor:"\u00d6n Plan Rengi",hiliteColor:"Arka Plan Rengi",plainFormatBlock:"Paragraf Stili",formatBlock:"Paragraf Stili",fontSize:"Yaz\u0131 Tipi Boyutu",fontName:"Yaz\u0131 Tipi Ad\u0131",tabIndent:"Sekme Girintisi",fullScreen:"Tam Ekran\u0131 A\u00e7/Kapat",viewSource:"HTML Kayna\u011f\u0131n\u0131 G\u00f6r\u00fcnt\u00fcle",print:"Yazd\u0131r",newPage:"Yeni Sayfa",systemShortcut:'"${0}" i\u015flemi yaln\u0131zca taray\u0131c\u0131n\u0131zda bir klavye k\u0131sayoluyla birlikte kullan\u0131labilir. \u015eunu kullan\u0131n: ${1}.', ctrlKey:"ctrl+${0}",appleKey:"\u2318${0}",_localized:{}},"dijit/_editor/nls/FontChoice":{1:"xx-k\u00fc\u00e7\u00fck",2:"x-k\u00fc\u00e7\u00fck",3:"k\u00fc\u00e7\u00fck",4:"orta",5:"b\u00fcy\u00fck",6:"x-b\u00fcy\u00fck",7:"xx-b\u00fcy\u00fck",fontSize:"Boyut",fontName:"Yaz\u0131 Tipi",formatBlock:"Bi\u00e7im",serif:"serif","sans-serif":"sans-serif",monospace:"tek aral\u0131kl\u0131",cursive:"el yaz\u0131s\u0131",fantasy:"fantazi",noFormat:"Yok",p:"Paragraf",h1:"Ba\u015fl\u0131k",h2:"Alt Ba\u015fl\u0131k", h3:"Alt Alt Ba\u015fl\u0131k",pre:"\u00d6nceden Bi\u00e7imlendirilmi\u015f",_localized:{}},"dojox/editor/plugins/nls/Preview":{preview:"\u00d6nizleme",_localized:{}},"dojox/editor/plugins/nls/FindReplace":{findLabel:"Bul:",findTooltip:"Bulunacak metni girin",replaceLabel:"De\u011fi\u015ftir:",replaceTooltip:"De\u011fi\u015ftirilecek metni girin",findReplace:"Bul ve De\u011fi\u015ftir",matchCase:"B\u00fcy\u00fck/k\u00fc\u00e7\u00fck harf e\u015fle\u015ftir",matchCaseTooltip:"B\u00fcy\u00fck/k\u00fc\u00e7\u00fck harf e\u015fle\u015ftir", backwards:"Geri",backwardsTooltip:"Metni geriye do\u011fru ara",replaceAllButton:"T\u00fcm\u00fcn\u00fc De\u011fi\u015ftir",<API key>:"T\u00fcm metni de\u011fi\u015ftir",findButton:"Bul",findButtonTooltip:"Metni bul",replaceButton:"De\u011fi\u015ftir",<API key>:"Metni de\u011fi\u015ftir",replaceDialogText:"${0} tekrar de\u011fi\u015ftirildi.",eofDialogText:"Son tekrar ${0}",eofDialogTextFind:"bulundu",<API key>:"de\u011fi\u015ftirildi",_localized:{}},"dojox/editor/plugins/nls/PasteFromWord":{pasteFromWord:"Word'den Kopyala", instructions:"\u0130\u00e7eri\u011fi Word'den a\u015fa\u011f\u0131daki metin kutusuna yap\u0131\u015ft\u0131r\u0131n. Ekledi\u011finiz i\u00e7erikten memnunsan\u0131z, Yap\u0131\u015ft\u0131r d\u00fc\u011fmesini t\u0131klat\u0131n. Metin eklemeyi durdurmak i\u00e7in \u0130ptal d\u00fc\u011fmesini t\u0131klat\u0131n.",_localized:{}},"dojox/editor/plugins/nls/InsertAnchor":{insertAnchor:"Tutturucu Ekle",title:"Tutturucu \u00d6zellikleri",anchor:"Ad:",text:"A\u00e7\u0131klama:",set:"Ayarla",cancel:"\u0130ptal", _localized:{}},"dojox/editor/plugins/nls/Blockquote":{blockquote:"\u00d6bek",_localized:{}},"widgets/About/setting/nls/strings":{instruction:"Bu ara\u00e7ta g\u00f6r\u00fcnt\u00fclenecek i\u00e7eri\u011fi olu\u015fturun.",defaultContent:"Buraya metin, ba\u011flant\u0131lar ve k\u00fc\u00e7\u00fck grafikler ekleyin.",_localized:{}}});
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Wed Jun 18 17:00:57 EDT 2014 --> <TITLE> umontreal.iro.lecuyer.charts (Java Libraries for Stochastic Simulation) </TITLE> <META NAME="date" CONTENT="2014-06-18"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="umontreal.iro.lecuyer.charts (Java Libraries for Stochastic Simulation)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>SSJ </b><br>V. 2.6.</EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV PACKAGE&nbsp; &nbsp;<A HREF="../../../../umontreal/iro/lecuyer/functionfit/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?umontreal/iro/lecuyer/charts/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <H2> Package umontreal.iro.lecuyer.charts </H2> This package contains classes to produce charts used in the Java software developed in the <EM>simulation laboratory</EM> of the DIRO, at the Universite de Montreal. <P> <B>See:</B> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A> <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Class Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/Axis.html" title="class in umontreal.iro.lecuyer.charts">Axis</A></B></TD> <TD>Represents an axis of a chart encapsulated by an instance of <TT>XYChart</TT>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/BoxChart.html" title="class in umontreal.iro.lecuyer.charts">BoxChart</A></B></TD> <TD>This class provides tools to create and manage box-and-whisker plots.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/BoxSeriesCollection.html" title="class in umontreal.iro.lecuyer.charts">BoxSeriesCollection</A></B></TD> <TD>This class stores data used in a <A HREF="../../../../umontreal/iro/lecuyer/charts/CategoryChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>CategoryChart</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/CategoryChart.html" title="class in umontreal.iro.lecuyer.charts">CategoryChart</A></B></TD> <TD>This class provides tools to create charts from data in a simple way.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/ContinuousDistChart.html" title="class in umontreal.iro.lecuyer.charts">ContinuousDistChart</A></B></TD> <TD>This class provides tools to plot the density and the cumulative probability of a continuous probability distribution.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><API key></A></B></TD> <TD>A dataset that can be used for creating histograms.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><API key></A></B></TD> <TD>This class provides tools to plot the mass function and the cumulative probability of a discrete probability distribution over the integers.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/EmpiricalChart.html" title="class in umontreal.iro.lecuyer.charts">EmpiricalChart</A></B></TD> <TD>This class provides additional tools to create and manage empirical plots.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/EmpiricalRenderer.html" title="class in umontreal.iro.lecuyer.charts">EmpiricalRenderer</A></B></TD> <TD>A renderer that draws horizontal lines between points and/or draws shapes at each data point to provide an empirical style chart.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><API key></A></B></TD> <TD>Stores data used in a <TT>EmpiricalChart</TT>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/HistogramChart.html" title="class in umontreal.iro.lecuyer.charts">HistogramChart</A></B></TD> <TD>This class provides tools to create and manage histograms.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><API key></A></B></TD> <TD>Stores data used in a <TT>HistogramChart</TT>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><API key></A></B></TD> <TD>Provides tools to plot many datasets on the same chart.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/PlotFormat.html" title="class in umontreal.iro.lecuyer.charts">PlotFormat</A></B></TD> <TD>Provide tools to import and export data set tables to and from Gnuplot, MATLAB and Mathematica compatible formats, or customized format.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/PPPlot.html" title="class in umontreal.iro.lecuyer.charts">PPPlot</A></B></TD> <TD>This class implements <SPAN CLASS="textit">PP-plot</SPAN> (or <API key> plot) objects that compare two probability distributions.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/QQPlot.html" title="class in umontreal.iro.lecuyer.charts">QQPlot</A></B></TD> <TD>This class implements <SPAN CLASS="textit">QQ-plot</SPAN> (or quantile-quantile plot) objects that compare two probability distributions.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/ScatterChart.html" title="class in umontreal.iro.lecuyer.charts">ScatterChart</A></B></TD> <TD>This class provides tools to create and manage scatter plots.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><API key></A></B></TD> <TD>Stores data used in a <TT>CategoryChart</TT>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><API key></A></B></TD> <TD>Stores data used in a <TT>XYChart</TT>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/XYChart.html" title="class in umontreal.iro.lecuyer.charts">XYChart</A></B></TD> <TD>This class provides tools to create charts from data in a simple way.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/XYLineChart.html" title="class in umontreal.iro.lecuyer.charts">XYLineChart</A></B></TD> <TD>This class provides tools to create and manage curve plots.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><API key></A></B></TD> <TD>This class extends <A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><CODE><API key></CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/YListChart.html" title="class in umontreal.iro.lecuyer.charts">YListChart</A></B></TD> <TD>This class extends the class <A HREF="../../../../umontreal/iro/lecuyer/charts/XYLineChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>XYLineChart</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD WIDTH="15%"><B><A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><API key></A></B></TD> <TD>This class extends <A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><CODE><API key></CODE></A>.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="package_description"></A><H2> Package umontreal.iro.lecuyer.charts Description </H2> <P> This package contains classes to produce charts used in the Java software developed in the <EM>simulation laboratory</EM> of the DIRO, at the Universite de Montreal. This package provides tools for easy construction, visualization, and customization of XY plots, histograms, and empirical styled charts from a Java program. It uses and extends the free and ``open source'' JFreeChart tool to manage the charts. JFreeChart is distributed under the terms of the GNU Lesser General Public License (LGPL), and can be found at <TT><A NAME="tex2html1" HREF="http: <P> This package also provides facilities to export charts to PGF/TikZ source code, which can be included into <SPAN CLASS="logo,LaTeX">L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X</SPAN> documents. TikZ is a free <SPAN CLASS="logo,LaTeX">L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X</SPAN> package to produce pictures such as plots, and can be downloaded from <TT><A NAME="tex2html2" HREF="http: <P> The user does not need to be familiar with the JFreeChart package or the TikZ syntax to use these tools, except if customization is required. For this, one may see the API specification of JFreeChart, and the reference manual of TikZ. <P> The two basic abstract classes of package <TT>charts</TT> are <A HREF="../../../../umontreal/iro/lecuyer/charts/XYChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>XYChart</CODE></A> and <A HREF="../../../../umontreal/iro/lecuyer/charts/CategoryChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>CategoryChart</CODE></A>. All other charts inherit from one of these two. Charts are managed by the mother class which contains the data tables in a <TT>*SeriesCollection</TT> object, and the information about <SPAN CLASS="MATH"><I>x</I></SPAN>-axis and <SPAN CLASS="MATH"><I>y</I></SPAN>-axis in <A HREF="../../../../umontreal/iro/lecuyer/charts/Axis.html" title="class in umontreal.iro.lecuyer.charts"><CODE>Axis</CODE></A> instances. All these objects encapsulate JFreeChart instances along with some additional TikZ-specific attributes. The method <A HREF="../../../../umontreal/iro/lecuyer/charts/XYChart.html#view(int, int)"><CODE>view</CODE></A> displays charts on screen while the method <TT>toLatex</TT> formats and returns a <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><CODE>String</CODE></A> which contains the TikZ source code that can be written to a <SPAN CLASS="logo,LaTeX">L<SUP><SMALL>A</SMALL></SUP>T<SMALL>E</SMALL>X</SPAN> file. <P> Several chart styles are available and each one is represented by a subclass of <A HREF="../../../../umontreal/iro/lecuyer/charts/XYChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>XYChart</CODE></A> or of <A HREF="../../../../umontreal/iro/lecuyer/charts/CategoryChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>CategoryChart</CODE></A>. The <A HREF="../../../../umontreal/iro/lecuyer/charts/XYLineChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>XYLineChart</CODE></A> uses <A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><CODE><API key></CODE></A> to plot curves and lines, the <A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><CODE><API key></CODE></A> class is used by <A HREF="../../../../umontreal/iro/lecuyer/charts/HistogramChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>HistogramChart</CODE></A> to plot histograms, and the <A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><CODE><API key></CODE></A> is used by <A HREF="../../../../umontreal/iro/lecuyer/charts/EmpiricalChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>EmpiricalChart</CODE></A> to plot empirical style charts. It is possible to draw a scatter plot or a box plot using <A HREF="../../../../umontreal/iro/lecuyer/charts/ScatterChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>ScatterChart</CODE></A> or <A HREF="../../../../umontreal/iro/lecuyer/charts/BoxChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>BoxChart</CODE></A> respectively. These concrete subclasses have similar APIs, but they are specialized for different kinds of charts. <P> These charts can be customized using <TT>*SeriesCollection</TT> subclasses and <A HREF="../../../../umontreal/iro/lecuyer/charts/Axis.html" title="class in umontreal.iro.lecuyer.charts"><CODE>Axis</CODE></A>. First, one can use methods in the <A HREF="../../../../umontreal/iro/lecuyer/charts/XYChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>XYChart</CODE></A> class for setting the range values and a background grid. One can also use the method <TT>getSeriesCollection()</TT> for subclasses of charts to obtain the dataset of the chart, which is represented by a <TT>*SeriesCollection</TT> object. This dataset can be customized in the following ways by calling methods on the series collection: selecting color, changing plot style (straight lines, curves, marks only, ...), putting marks on points, setting a label and selecting the dash pattern (solid, dotted, dashed, ...). The available properties depend on the type of chart. Moreover, objects representing the axes can be retrieved with <A HREF="../../../../umontreal/iro/lecuyer/charts/XYChart.html#getXAxis()"><CODE>getXAxis</CODE></A> for the <SPAN CLASS="MATH"><I>x</I></SPAN>-axis, and <A HREF="../../../../umontreal/iro/lecuyer/charts/XYChart.html#getYAxis()"><CODE>getYAxis</CODE></A> for the <SPAN CLASS="MATH"><I>y</I></SPAN>-axis. By using methods in <A HREF="../../../../umontreal/iro/lecuyer/charts/Axis.html" title="class in umontreal.iro.lecuyer.charts"><CODE>Axis</CODE></A>, many customizations are possible: setting a label to the axis, setting ticks labels and values (auto ticks, periodical ticks or manually defined ticks) and changing the twin axis position on the current axis to select where axes must appear. These settings are independent for each axis. <P> Each chart object from SSJ encapsulates a JFreeChart object: a <A HREF="../../../../umontreal/iro/lecuyer/charts/XYChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>XYChart</CODE></A> instance contains a <TT>JFreeChart</TT> instance from JFreeChart API, a <TT>*SeriesCollection</TT> contains a <TT>XYDataset</TT> and a <TT>XYItemRenderer</TT>, and finally an <A HREF="../../../../umontreal/iro/lecuyer/charts/Axis.html" title="class in umontreal.iro.lecuyer.charts"><CODE>Axis</CODE></A> contains a <TT>NumberAxis</TT>. So any parameter proposed by JFreeChart is reachable through getter methods. However, changing the JFreeChart parameters directly may have no impact on the produced TikZ source code. <P> The two special classes <A HREF="../../../../umontreal/iro/lecuyer/charts/ContinuousDistChart.html" title="class in umontreal.iro.lecuyer.charts"><CODE>ContinuousDistChart</CODE></A> and <A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><CODE><API key></CODE></A> can be used to plot probability densities, mass functions, and cumulative probabilities for continuous or discrete distributions, which are implemented in package <A HREF="../../../../umontreal/iro/lecuyer/probdist/package-summary.html"><CODE>probdist</CODE></A> of SSJ. <P> The package <TT>charts</TT> provides additional tools for formatting data plot, and creating charts with multiple datasets. The <A HREF="../../../../umontreal/iro/lecuyer/charts/PlotFormat.html" title="class in umontreal.iro.lecuyer.charts"><CODE>PlotFormat</CODE></A> class offers basic tools to import and export data from files. Supported file formats are GNUPlot and standard CSV, which is widely used and accepted by most mathematical softwares such as MATLAB and Mathematica. Customizing file input and output format is also possible. Finally <A HREF="../../../../umontreal/iro/lecuyer/charts/<API key>.html" title="class in umontreal.iro.lecuyer.charts"><CODE><API key></CODE></A> provides tools to plot with different styles on the same chart. <P> For a series of examples, see the <SPAN CLASS="textbf">pdf</SPAN> documentation. <P> <P> <DL> </DL> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>SSJ </b><br>V. 2.6.</EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV PACKAGE&nbsp; &nbsp;<A HREF="../../../../umontreal/iro/lecuyer/functionfit/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?umontreal/iro/lecuyer/charts/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> To submit a bug or ask questions, send an e-mail to <a href="mailto:Pierre L'Ecuyer <lecuyer@IRO.UMontreal.CA>">Pierre L'Ecuyer</a>. </BODY> </HTML>
package com.longview.gsa.repository; import java.util.List; import org.springframework.data.mongodb.repository.MongoRepository; import com.longview.gsa.domain.WarningCategory; public interface <API key> extends MongoRepository<WarningCategory, String> { List<WarningCategory> fetchValidWarnings(); }
<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Expires" content="-1"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <title>105</title> <link href="../css/style.css" rel="stylesheet" type="text/css"> <link href="../css/style2.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="../js/ftiens4.js"></script> <script type="text/javascript" src="../js/ua.js"></script> <script type="text/javascript" src="../js/func.js"></script> <script type="text/javascript" src="../js/treeT.js"></script> <script type="text/javascript" src="../js/refresh.js"></script> </head> <body id="main-body"> <div id="main-header"> <div id="main-top"> <a class="main-top-logo" href=" <ul class="main-top-list"> <li class="main-top-item"><a class="main-top-link main-top-link-home" href="../index.html"></a></li> <li class="main-top-item"><a class="main-top-link main-top-link-cec" href="http://2016.cec.gov.tw"></a></li> <li class="main-top-item"><a class="main-top-link <API key>" href="../../en/index.html">English</a></li> </ul> </div> </div> <div id="main-wrap"> <div id="main-banner"> <div class="slideshow"> <img src="../img/main_bg_2.jpg" width="1024" height="300" alt="background" title="background"> </div> <div class="main-deco"></div> <div class="main-title"></div> <a class="main-pvpe" href="../IDX/indexP1.html"></a> <a class="main-le main-le-current" href="../IDX/indexT.html"></a> </div> <div id="main-container"> <div id="main-content"> <table width="1024" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="180" valign="top"> <div id="divMenu"> <table border="0"> <tr> <td><a style="text-decoration:none;color:silver" href="http: </tr> </table> <span class="TreeviewSpanArea"> <script>initializeDocument()</script> <noscript>Javascript</noscript> </span> </div> </td> <td width="796" valign="top"> <div id="divContent"> <table width="100%" border="0" cellpadding="0" cellspacing="4"> <tr> <td><img src="../images/search.png" alt="" title="">&nbsp;<b>&nbsp;&nbsp;1&nbsp;&nbsp;</b></td> </tr> <tr valign="bottom"> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr valign="bottom"> <td class="fontNumber">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;6&nbsp;&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;1&nbsp;&nbsp; <!--<img src="../images/nav.gif" alt="" title="">&nbsp; <img src="../images/nav.gif" alt="" title="">&nbsp;0--> </td> <td align="right"> <select name="selector_order" class="selectC" tabindex="1" id="orderBy" onChange="changeOrder();"> <option value="n"></option> <option value="s"></option> </select> </td> </tr> </table> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellpadding="6" cellspacing="1" class="tableT"> <tr class="trHeaderT"> <td></td> <td></td> <td></td> <td></td> <td></td> <td>%</td> <td></td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>1</td> <td></td> <td></td> <td class="tdAlignRight">0</td> <td class="tdAlignRight">0.0000</td> <td></td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>2</td> <td></td> <td></td> <td class="tdAlignRight">0</td> <td class="tdAlignRight">0.0000</td> <td></td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>3</td> <td></td> <td></td> <td class="tdAlignRight">0</td> <td class="tdAlignRight">0.0000</td> <td></td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>4</td> <td></td> <td></td> <td class="tdAlignRight">0</td> <td class="tdAlignRight">0.0000</td> <td></td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>5</td> <td></td> <td></td> <td class="tdAlignRight">0</td> <td class="tdAlignRight">0.0000</td> <td></td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>6</td> <td></td> <td></td> <td class="tdAlignRight">0</td> <td class="tdAlignRight">0.0000</td> <td></td> </tr> <tr class="trFooterT"> <td colspan="7" align="right">/:&nbsp;0/236&nbsp;</td> </tr> </table> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="10"></td> <td valign="top" class="fontNote"> <table> <tr> <td></td> <td align="center"></td> <td></td> </tr> <tr> <td></td> <td align="center"></td> <td></td> </tr> </table> </td> <td valign="top" class="fontTimer"><img src="../images/clock2.png" alt="Sat, 16 Jan 2016 16:48:11 +0800" title="Sat, 16 Jan 2016 16:48:11 +0800">&nbsp;01/16&nbsp;16:48:06&nbsp;<br>(3)</td> </tr> <tr> <td colspan="3" class="fontNote"></td> </tr> </table> </td> </tr> </table> </div> </td> </tr> </table> </div> <div class="main-footer"></div> <div id="divFooter">[] </div> <!--main-content </div><!--main-container </div><!--END main-wrap <script>setOrder();</script> <script>setMenuScrollPosY();</script> </body> </html>
<!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"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content="The Official Website of the New York City Asian American Student Conference"> <meta name="author" content="Amelia Chu"> <link rel="icon" href="/assets/favicon.ico"> <title>New York City Asian American Student Conference</title> <!-- Bootstrap core CSS --> <link href="/assets/css/bootstrap.min.css" rel="stylesheet"> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <link href="/assets/css/<API key>.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="/assets/css/navbar-fixed-top.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="/assets/css/nycaasc-custom.css" rel="stylesheet"> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9]><script src="..//assets/js/<API key>.js"></script><![endif]--> <script src="/assets/js/<API key>.js"></script> <!-- HTML5 shim and Respond.js for 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> <!-- Fixed navbar --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/index.html">NYC<font color = "#cf3537">AA</font>SC</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="/index.html">Home</a></li> <li class="dropdown"> <a href="/index.html#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Conference <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="/theme.html">Theme</a></li> <li><a href="/index.html#<API key>">Featured Performances + Keynote</a></li> <li><a href="/index.html#schedule">Schedule</a></li> <li><a href="https: <li role="separator" class="divider"></li> <li class="dropdown-header">Support the Conference</li> <li><a href="/partners.html">Community Partnerships</a></li> <li><a href="/sponsorship.html">Sponsorship Opportunities</a></li> </ul> </li> <li><a href="/events.html">Satellite Events</a></li> <li><a href="/hslprogram.html">High School Liaison 2017</a></li> <li class="dropdown"> <a href="/index.html#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">About Us <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="/mission.html">Mission + History</a></li> <li><a href="/currentboard.html">Current Board</a></li> <li role="separator" class="divider"></li> <li class="dropdown-header">Join Us!</li> <li><a href="/apply.html">Apply for Membership</a></li> <li><a href="/hslprogram.html">High School Liason Program</a></li> </ul> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="social-menu--link"><a href="https: <li class="social-menu--link"><a href="https://twitter.com/nycaasc"><img src="/assets/img/tw.svg" height="16" width="16" alt="Twitter"></a></li> <li class="social-menu--link"><a href="https: </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="container"> <div class="jumbotron" style="background-image:url('/assets/img/network.svg');background-position:right bottom;background-repeat: no-repeat;"> <h2>Executive Board</h2> <p>The Executive Board is dedicated to our mission of addressing issues pertinent to Asian/Pacific/Americans on local, national, and global scales. </p> </div> </div> <br> <div class="container"> <div class="container"> <div class="row"> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/mkt_chu.jpg?raw=true" alt="Amelia Chu - Marketing"> </div> <div class="col-md-8"> <p id="BioName">Amelia Chu</p> <p id="BioTitle">Marketing Chair</p> <p id="BioDescript">Amelia Chu is a senior in the Applied Psychology program at NYU. Outside of the classroom, she has experience managing marketing Chairs for student groups as well as over 5 years of experience in digital + print design. In her spare time, she enjoys exploring the intersection between humans, data, and design.</p> </div> </div> </div> </div> <br> <div class="container"> <h3>Current Board</h3> <div class="container"> <div class="row"> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://raw.githubusercontent.com/ameliachu/nycaasc/<SHA1-like>/assets/img/eb/dir_kam.jpg" alt="Kristopher Kam - Director"> <p id="MemberName">Kristopher Kam</p> <p id="ePosition">Director</p> <p id="moreInfo"><a href="dir_kam.html">+</a></p> </div> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://raw.githubusercontent.com/ameliachu/nycaasc/<SHA1-like>/assets/img/eb/dir_yuan.jpg" alt="Jonathan Yuan - Director"> <p id="MemberName">Jonathan Yuan</p> <p id="ePosition">Director</p> <p id="moreInfo"><a href="dir_yuan.html">+</a></p> </div> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/evt_hsu.jpg?raw=true" alt="Jolene Hsu - Events"> <p id="MemberName">Jolene Hsu</p> <p id="ePosition">Events Chair</p> <p id="moreInfo"><a href="evt_hsu.html">+</a></p> </div> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/evt_liu.jpg?raw=true" alt="Yaxin Liu - Events"> <p id="MemberName">Yaxin Liu</p> <p id="ePosition">Events Chair</p> <p id="moreInfo"><a href="evt_liu.html">+</a></p> </div> </div> <div class="row"> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/hsl_hexter.jpg?raw=true" alt="Nora Hexter - High School Liaison"> <p id="MemberName">Nora Hexter</p> <p id="ePosition">High School Liaison Chair</p> <p id="moreInfo"><a href="hsl_hexter.html">+</a></p> </div> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/hsl_wu.png?raw=true" alt="Aimee Wu - High School Liaison"> <p id="MemberName">Aimee Wu</p> <p id="ePosition">High School Liaison Chair</p> <p id="moreInfo"><a href="hsl_wu.html">+</a></p> </div> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/log_woo.jpg?raw=true" alt="Jennie Woo - Logistics"> <p id="MemberName">Jennie Woo</p> <p id="ePosition">Logistics Chair</p> <p id="moreInfo"><a href="log_woo.html">+</a></p> </div> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/log_xu.png?raw=true" alt="Iving Xu - Logistics"> <p id="MemberName">Iving Xu</p> <p id="ePosition">Logistics Chair</p> <p id="moreInfo"><a href="log_xu.html">+</a></p> </div> </div> <div class="row"> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/pub_liu.png?raw=true.png" alt="Xinting Liu - Publicity"> <p id="MemberName">Xinting Liu</p> <p id="ePosition">Publicity Chair</p> <p id="moreInfo"><a href="pub_liu.html">+</a></p> </div> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/pub_muangchan.jpg?raw=true.jpg" alt="Pongsathorn Muangchan - Publicity"> <p id="MemberName">Pongsathorn Muangchan</p> <p id="ePosition">Publicity Chair</p> <p id="moreInfo"><a href="pub_muangchan.html">+</a></p> </div> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/wks_nguyen.png?raw=true.png" alt="Kimberly Nguyen - Workshops"> <p id="MemberName">Kimberly Nguyen</p> <p id="ePosition">Workshops Chair</p> <p id="moreInfo"><a href="wks_nguyen.html">+</a></p> </div> <div class="col-md-3"> <img class="headshots" height="200" width="200" src="https://github.com/ameliachu/nycaasc/blob/<SHA1-like>/assets/img/eb/wks_pareek.jpg?raw=true.jpg" alt="Purti Pareek - Workshops"> <p id="MemberName">Purti Pareek</p> <p id="ePosition">Workshops Chair</p> <p id="moreInfo"><a href="wks_pareek.html">+</a></p> </div> </div> </div> </div> <!-- /container --> <br> <footer class="footer"> <div class="container"> <br><p class="text-muted">The New York City Asian American Student Conference 2016.</p> </div> </footer> <!-- Bootstrap core JavaScript =============================================== <!-- Placed at the end of the document so the pages load faster --> <script> (function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https: ga('create', 'UA-68409586-1', 'auto'); ga('send', 'pageview'); </script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="assets/js/vendor/jquery.min.js"><\/script>')</script> <script src="assets/js/bootstrap.min.js"></script> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <script src="assets/js/<API key>.js"></script> </body> </html>
package org.jboss.windup.rules.apps.java.scan.provider; import java.io.File; import java.util.*; import java.util.logging.Logger; import org.apache.commons.lang3.StringUtils; import org.jboss.windup.config.<API key>; import org.jboss.windup.config.GraphRewrite; import org.jboss.windup.config.loader.RuleLoaderContext; import org.jboss.windup.config.metadata.RuleMetadata; import org.jboss.windup.config.operation.iteration.<API key>; import org.jboss.windup.config.phase.<API key>; import org.jboss.windup.config.query.Query; import org.jboss.windup.graph.model.ArchiveModel; import org.jboss.windup.graph.model.<API key>; import org.jboss.windup.graph.model.FileLocationModel; import org.jboss.windup.graph.model.<API key>; import org.jboss.windup.graph.model.resource.FileModel; import org.jboss.windup.graph.service.FileService; import org.jboss.windup.graph.service.GraphService; import org.jboss.windup.reporting.model.TechnologyTagLevel; import org.jboss.windup.reporting.service.<API key>; import org.jboss.windup.reporting.service.<API key>; import org.jboss.windup.rules.apps.java.model.project.MavenProjectModel; import org.jboss.windup.rules.apps.java.scan.operation.packagemapping.PackageNameMapping; import org.jboss.windup.rules.apps.maven.dao.MavenProjectService; import org.jboss.windup.rules.apps.xml.model.XmlFileModel; import org.jboss.windup.rules.apps.xml.service.XmlFileService; import org.jboss.windup.util.Logging; import org.jboss.windup.util.exception.<API key>; import org.jboss.windup.util.xml.<API key>; import org.jboss.windup.util.xml.XmlUtil; import org.ocpsoft.rewrite.config.ConditionBuilder; import org.ocpsoft.rewrite.config.Configuration; import org.ocpsoft.rewrite.config.<API key>; import org.ocpsoft.rewrite.context.EvaluationContext; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; /** * Discover Maven pom files and build a {@link MavenProjectModel} containing this metadata. */ @RuleMetadata(phase = <API key>.class, haltOnException = true) public class <API key> extends <API key> { private static final Logger LOG = Logging.get(<API key>.class); private static final Map<String, String> namespaces = new HashMap<>(); static { namespaces.put("pom", "http://maven.apache.org/POM/4.0.0"); } @Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { ConditionBuilder fileWhen = Query .fromType(XmlFileModel.class) .withProperty(FileModel.FILE_NAME, "pom.xml"); <API key><XmlFileModel> evaluatePomFiles = new <API key><XmlFileModel>() { @Override public void perform(GraphRewrite event, EvaluationContext context, XmlFileModel payload) { /* * Make sure we don't add try to create multiple projects out of it */ if (payload.getProjectModel() != null) return; final <API key> <API key> = new <API key>(event.getGraphContext()); final <API key> <API key> = new <API key>(event.getGraphContext()); // get a default name from the parent file (if the maven project doesn't contain one) String defaultName = payload.getArchive() == null ? payload.asFile().getParentFile().getName() : payload.getArchive() .getFileName(); MavenProjectModel mavenProjectModel = <API key>(event, context, defaultName, payload); if (mavenProjectModel != null) { // add classification information to file. <API key>.<API key>(event, context, payload, "Maven POM (pom.xml)", "Maven Project Object Model (POM) File"); <API key>.addTagToFileModel(payload, "Maven XML", TechnologyTagLevel.INFORMATIONAL); ArchiveModel archiveModel = payload.getArchive(); if (archiveModel != null && !<API key>(archiveModel)) { mavenProjectModel.addFileModel(archiveModel); mavenProjectModel.setRootFileModel(archiveModel); // Attach the project to all files within the archive for (FileModel f : archiveModel.getAllFiles()) { // don't add archive models, as those really are separate projects... // also, don't set the project model if one is already set if (!(f instanceof ArchiveModel) && f.getProjectModel() == null) { // only set it if it has not already been set mavenProjectModel.addFileModel(f); } } } else { // add the parent file File parentFile = payload.asFile().getParentFile(); FileModel parentFileModel = new FileService(event.getGraphContext()).findByPath(parentFile.getAbsolutePath()); if (parentFileModel != null && !<API key>(parentFileModel)) { mavenProjectModel.addFileModel(parentFileModel); mavenProjectModel.setRootFileModel(parentFileModel); // now add all child folders that do not contain pom files for (FileModel childFile : parentFileModel.getFilesInDirectory()) { addFilesToModel(mavenProjectModel, childFile); } } } } } @Override public String toString() { return "ScanMavenProject"; } }; // @formatter:off return <API key>.begin() .addRule() .when(fileWhen) .perform(evaluatePomFiles); // @formatter:on } /** * This method is here so that the caller can know not to try to reset the project model for an archive (or * directory) if the archive (or directory) is already a maven project. * <p/> * This can sometimes help in cases in which an archive includes multiple poms in its META-INF. */ private boolean <API key>(FileModel fileModel) { return fileModel.getProjectModel() != null && fileModel.getProjectModel() instanceof MavenProjectModel; } private void addFilesToModel(MavenProjectModel mavenProjectModel, FileModel fileModel) { // First, make sure we aren't looking at a separate module (we assume that if a pom.xml is in the folder, // it is a separate module) for (FileModel childFile : fileModel.getFilesInDirectory()) { String filename = childFile.getFileName(); if (filename.equals("pom.xml")) { // this is a new project (submodule) -- break; return; } } // Also, make sure it isn't a zip file with a pom (that also couldn't be part of the same project) if (fileModel instanceof ArchiveModel) { ArchiveModel childArchive = (ArchiveModel)fileModel; if (childArchive instanceof <API key>) childArchive = ((<API key>) childArchive).getCanonicalArchive(); for (FileModel archiveChild : childArchive.getAllFiles()) { String filename = archiveChild.getFileName(); if (filename.equals("pom.xml")) { // this is a new project (submodule) -- break; return; } } } mavenProjectModel.addFileModel(fileModel); // now recursively all files to the project for (FileModel childFile : fileModel.getFilesInDirectory()) { addFilesToModel(mavenProjectModel, childFile); } } public MavenProjectModel <API key>(GraphRewrite event, EvaluationContext context, String defaultProjectName, XmlFileModel xmlFileModel) { Document document; try { document = new XmlFileService(event.getGraphContext()).loadDocument(event, context, xmlFileModel); } catch (Exception ex) { xmlFileModel.setParseError("Could not parse POM XML: " + ex.getMessage()); LOG.warning("Could not parse POM XML for '" + xmlFileModel.getFilePath() + "':"+System.lineSeparator()+"\t" + ex.getMessage() + System.lineSeparator()+" \tSkipping Maven project discovery."); return null; } File xmlFile = xmlFileModel.asFile(); // modelVersion String modelVersion = XmlUtil.xpathExtract(document, "/pom:project/pom:modelVersion | /project/modelVersion", namespaces); String name = XmlUtil.xpathExtract(document, "/pom:project/pom:name | /project/name", namespaces); String organization = XmlUtil.xpathExtract(document, "/pom:project/pom:organization | /project/organization", namespaces); String description = XmlUtil.xpathExtract(document, "/pom:project/pom:description | /project/description", namespaces); String url = XmlUtil.xpathExtract(document, "/pom:project/pom:url | /project/url", namespaces); String groupId = XmlUtil.xpathExtract(document, "/pom:project/pom:groupId | /project/groupId", namespaces); String artifactId = XmlUtil.xpathExtract(document, "/pom:project/pom:artifactId | /project/artifactId", namespaces); String version = XmlUtil.xpathExtract(document, "/pom:project/pom:version | /project/version", namespaces); String parentGroupId = XmlUtil.xpathExtract(document, "/pom:project/pom:parent/pom:groupId | /project/parent/groupId", namespaces); String parentArtifactId = XmlUtil.xpathExtract(document, "/pom:project/pom:parent/pom:artifactId | /project/parent/artifactId", namespaces); String parentVersion = XmlUtil.xpathExtract(document, "/pom:project/pom:parent/pom:version | /project/parent/version", namespaces); if (StringUtils.isBlank(groupId) && StringUtils.isNotBlank(parentGroupId)) { groupId = parentGroupId; } if (StringUtils.isBlank(version) && StringUtils.isNotBlank(parentVersion)) { version = parentVersion; } if (StringUtils.isBlank(organization)) { organization = PackageNameMapping.<API key>(event, groupId); } MavenProjectService mavenProjectService = new MavenProjectService(event.getGraphContext()); MavenProjectModel mavenProjectModel = getMavenStubProject(mavenProjectService, groupId, artifactId, version); /* * We don't want to reuse one that is already associated with a file (defined twice). This happens sometimes if * the same maven gav is defined multiple times within the input application. */ if (mavenProjectModel == null) { LOG.info("Creating maven project for pom at: " + xmlFileModel.getFilePath() + " with gav: " + groupId + "," + artifactId + "," + version); mavenProjectModel = mavenProjectService.createMavenStub(groupId, artifactId, version); mavenProjectModel.addMavenPom(xmlFileModel); } else { // make sure we are associated as a file that provides this maven project information boolean found = false; for (XmlFileModel foundPom : mavenProjectModel.getMavenPom()) { File foundPomFile = foundPom.asFile(); if (foundPomFile.getAbsoluteFile().equals(xmlFile)) { // this one is already there found = true; break; } } // if this mavenprojectmodel isn't already associated with a pom file, add it now if (!found) { mavenProjectModel.addMavenPom(xmlFileModel); } } if (StringUtils.isBlank(name)) { name = defaultProjectName; } mavenProjectModel.setName(<API key>(name, groupId, artifactId, version)); if (StringUtils.isNotBlank(organization)) { mavenProjectModel.setOrganization(organization); } if (StringUtils.isNotBlank(description)) { mavenProjectModel.setDescription(StringUtils.trim(description)); } if (StringUtils.isNotBlank(url)) { mavenProjectModel.setURL(StringUtils.trim(url)); } if (StringUtils.isNotBlank(modelVersion)) { mavenProjectModel.<API key>(modelVersion); } if (StringUtils.isNotBlank(parentGroupId)) { // parent parentGroupId = resolveProperty(document, namespaces, parentGroupId, version); parentArtifactId = resolveProperty(document, namespaces, parentArtifactId, version); parentVersion = resolveProperty(document, namespaces, parentVersion, version); MavenProjectModel parent = getMavenProject(mavenProjectService, parentGroupId, parentArtifactId, parentVersion); if (parent == null) { parent = mavenProjectService.createMavenStub(parentGroupId, parentArtifactId, parentVersion); parent.setName(<API key>(null, parentGroupId, parentArtifactId, parentVersion)); } mavenProjectModel.setParentMavenPOM(parent); } NodeList nodes = XmlUtil .xpathNodeList(document, "/pom:project/pom:dependencies/pom:dependency | /project/dependencies/dependency", namespaces); for (int i = 0, j = nodes.getLength(); i < j; i++) { Node node = nodes.item(i); String dependencyGroupId = XmlUtil.xpathExtract(node, "./pom:groupId | ./groupId", namespaces); String <API key> = XmlUtil.xpathExtract(node, "./pom:artifactId | ./artifactId", namespaces); String dependencyVersion = XmlUtil.xpathExtract(node, "./pom:version | ./version", namespaces); String <API key> = XmlUtil.xpathExtract(node, "./pom:classifier | ./classifier", namespaces); String dependencyScope = XmlUtil.xpathExtract(node, "./pom:scope | ./scope", namespaces); String dependencyType = XmlUtil.xpathExtract(node, "./pom:type | ./type", namespaces); dependencyGroupId = resolveProperty(document, namespaces, dependencyGroupId, version); <API key> = resolveProperty(document, namespaces, <API key>, version); dependencyVersion = resolveProperty(document, namespaces, dependencyVersion, version); if (StringUtils.isNotBlank(dependencyGroupId)) { MavenProjectModel dependency = getMavenProject(mavenProjectService, dependencyGroupId, <API key>, dependencyVersion); if (dependency == null) { dependency = mavenProjectService.createMavenStub(dependencyGroupId, <API key>, dependencyVersion); dependency.setName(<API key>(null, dependencyGroupId, <API key>, dependencyVersion)); } <API key> projectDep = new GraphService<>(event.getGraphContext(), <API key>.class).create(); projectDep.setClassifier(<API key>); projectDep.setScope(dependencyScope); projectDep.setType(dependencyType); projectDep.setProject(dependency); int lineNumber = (int) node.getUserData(<API key>.<API key>); int columnNumber = (int) node.getUserData(<API key>.<API key>); FileLocationModel fileLocation = new GraphService<>(event.getGraphContext(), FileLocationModel.class).create(); String sourceSnippet = XmlUtil.nodeToString(node); fileLocation.setSourceSnippit(sourceSnippet); fileLocation.setLineNumber(lineNumber); fileLocation.setColumnNumber(columnNumber); fileLocation.setLength(node.toString().length()); fileLocation.setFile(xmlFileModel); List<FileLocationModel> fileLocationList = new ArrayList<FileLocationModel>(1); fileLocationList.add(fileLocation); projectDep.<API key>(fileLocationList); mavenProjectModel.addDependency(projectDep); } } return mavenProjectModel; } /** * This will return a {@link MavenProjectModel} with the give gav, preferring one that has been found in the input * application as opposed to a stub. */ private MavenProjectModel getMavenProject(MavenProjectService mavenProjectService, String groupId, String artifactId, String version) { Iterable<MavenProjectModel> possibleProjects = mavenProjectService.<API key>(groupId, artifactId, version); MavenProjectModel project = null; for (MavenProjectModel possibleProject : possibleProjects) { if (possibleProject.getRootFileModel() != null) { return possibleProject; } else if (project == null) { project = possibleProject; } } return project; } /** * A Maven stub is a Maven Project for which we have found information, but the project has not yet been located * within the input application. If we have found an application of the same GAV within the input app, we should * fill out this stub instead of creating a new one. */ private MavenProjectModel getMavenStubProject(MavenProjectService mavenProjectService, String groupId, String artifactId, String version) { Iterable<MavenProjectModel> mavenProjectModels = mavenProjectService.<API key>(groupId, artifactId, version); if (!mavenProjectModels.iterator().hasNext()) { return null; } for (MavenProjectModel mavenProjectModel : mavenProjectModels) { if (mavenProjectModel.getRootFileModel() == null) { // this is a stub... we can fill it in with details return mavenProjectModel; } } return null; } private String <API key>(String mavenName, String groupId, String artifactId, String version) { StringBuilder sb = new StringBuilder(); if (StringUtils.isNotBlank(mavenName)) { sb.append(mavenName); } else if (StringUtils.isNotBlank(groupId) || StringUtils.isNotBlank(artifactId) || StringUtils.isNotBlank(version)) { sb.append(groupId).append(":").append(artifactId).append(":").append(version); } return sb.toString(); } private String resolveProperty(Document document, Map<String, String> namespaces, String property, String projectVersion) throws <API key> { if (StringUtils.startsWith(property, "${")) { String propertyName = StringUtils.removeStart(property, "${"); propertyName = StringUtils.removeEnd(propertyName, "}"); switch (propertyName) { case "pom.version": case "project.version": return projectVersion; default: NodeList nodes = XmlUtil.xpathNodeList(document, "//pom:properties/pom:" + propertyName + " | " + "//properties/" + propertyName, namespaces); if (nodes.getLength() == 0 || nodes.item(0) == null) { LOG.warning("Expected: " + property + " but it wasn't found in the POM."); } else { Node node = nodes.item(0); return node.getTextContent(); } } } return property; } }
package org.eclipse.imp.pdb.facts; /* * Desired: * public interface IRelationalAlgebra<T extends ISetAlgebra<T>> */ public interface IRelationalAlgebra<R, A1 extends IRelationalAlgebra<R, A1>> { R compose(A1 other); R closure(); R closureStar(); int arity(); R project(int... fields); @Deprecated R projectByFieldNames(String... fields); R carrier(); R domain(); R range(); }
package org.openhab.binding.dscalarm.internal.factory; import static org.openhab.binding.dscalarm.internal.<API key>.<API key>; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; import org.eclipse.smarthome.config.core.Configuration; import org.eclipse.smarthome.config.discovery.DiscoveryService; import org.eclipse.smarthome.core.thing.Bridge; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingTypeUID; import org.eclipse.smarthome.core.thing.ThingUID; import org.eclipse.smarthome.core.thing.binding.<API key>; import org.eclipse.smarthome.core.thing.binding.ThingHandler; import org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory; import org.openhab.binding.dscalarm.internal.<API key>; import org.openhab.binding.dscalarm.internal.config.<API key>; import org.openhab.binding.dscalarm.internal.config.<API key>; import org.openhab.binding.dscalarm.internal.config.<API key>; import org.openhab.binding.dscalarm.internal.config.<API key>; import org.openhab.binding.dscalarm.internal.config.<API key>; import org.openhab.binding.dscalarm.internal.discovery.<API key>; import org.openhab.binding.dscalarm.internal.handler.<API key>; import org.openhab.binding.dscalarm.internal.handler.<API key>; import org.openhab.binding.dscalarm.internal.handler.IT100BridgeHandler; import org.openhab.binding.dscalarm.internal.handler.KeypadThingHandler; import org.openhab.binding.dscalarm.internal.handler.PanelThingHandler; import org.openhab.binding.dscalarm.internal.handler.<API key>; import org.openhab.binding.dscalarm.internal.handler.<API key>; import org.openhab.binding.dscalarm.internal.handler.ZoneThingHandler; import org.osgi.framework.ServiceRegistration; import org.osgi.service.component.annotations.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The {@link <API key>} is responsible for creating things and thing. handlers. * * @author Russell Stephens - Initial Contribution */ @Component(service = ThingHandlerFactory.class, configurationPid = "binding.dscalarm") public class <API key> extends <API key> { private final Logger logger = LoggerFactory.getLogger(<API key>.class); private final Map<ThingUID, ServiceRegistration<?>> <API key> = new HashMap<>(); @Override public Thing createThing(ThingTypeUID thingTypeUID, Configuration configuration, ThingUID thingUID, ThingUID bridgeUID) { if (<API key>.<API key>.equals(thingTypeUID)) { ThingUID envisalinkBridgeUID = <API key>(thingTypeUID, thingUID, configuration); logger.debug("createThing(): ENVISALINK_BRIDGE: Creating an '{}' type Thing - {}", thingTypeUID, envisalinkBridgeUID.getId()); return super.createThing(thingTypeUID, configuration, envisalinkBridgeUID, null); } else if (<API key>.<API key>.equals(thingTypeUID)) { ThingUID it100BridgeUID = <API key>(thingTypeUID, thingUID, configuration); logger.debug("createThing(): IT100_BRIDGE: Creating an '{}' type Thing - {}", thingTypeUID, it100BridgeUID.getId()); return super.createThing(thingTypeUID, configuration, it100BridgeUID, null); } else if (<API key>.<API key>.equals(thingTypeUID)) { ThingUID tcpServerBridgeUID = <API key>(thingTypeUID, thingUID, configuration); logger.debug("createThing(): TCP_SERVER_BRIDGE: Creating an '{}' type Thing - {}", thingTypeUID, tcpServerBridgeUID.getId()); return super.createThing(thingTypeUID, configuration, tcpServerBridgeUID, null); } else if (<API key>.PANEL_THING_TYPE.equals(thingTypeUID)) { ThingUID panelThingUID = getDSCAlarmPanelUID(thingTypeUID, thingUID, configuration, bridgeUID); logger.debug("createThing(): PANEL_THING: Creating '{}' type Thing - {}", thingTypeUID, panelThingUID.getId()); return super.createThing(thingTypeUID, configuration, panelThingUID, bridgeUID); } else if (<API key>.<API key>.equals(thingTypeUID)) { ThingUID partitionThingUID = <API key>(thingTypeUID, thingUID, configuration, bridgeUID); logger.debug("createThing(): PARTITION_THING: Creating '{}' type Thing - {}", thingTypeUID, partitionThingUID.getId()); return super.createThing(thingTypeUID, configuration, partitionThingUID, bridgeUID); } else if (<API key>.ZONE_THING_TYPE.equals(thingTypeUID)) { ThingUID zoneThingUID = getDSCAlarmZoneUID(thingTypeUID, thingUID, configuration, bridgeUID); logger.debug("createThing(): ZONE_THING: Creating '{}' type Thing - {}", thingTypeUID, zoneThingUID.getId()); return super.createThing(thingTypeUID, configuration, zoneThingUID, bridgeUID); } else if (<API key>.KEYPAD_THING_TYPE.equals(thingTypeUID)) { ThingUID keypadThingUID = <API key>(thingTypeUID, thingUID, configuration, bridgeUID); logger.debug("createThing(): KEYPAD_THING: Creating '{}' type Thing - {}", thingTypeUID, keypadThingUID.getId()); return super.createThing(thingTypeUID, configuration, keypadThingUID, bridgeUID); } throw new <API key>( "createThing(): The thing type " + thingTypeUID + " is not supported by the DSC Alarm binding."); } @Override public boolean supportsThingType(ThingTypeUID thingTypeUID) { return <API key>.contains(thingTypeUID); } /** * Get the Envisalink Bridge Thing UID. * * @param thingTypeUID * @param thingUID * @param configuration * @return thingUID */ private ThingUID <API key>(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration) { if (thingUID == null) { String ipAddress = (String) configuration.get(<API key>.IP_ADDRESS); String bridgeID = ipAddress.replace('.', '_'); thingUID = new ThingUID(thingTypeUID, bridgeID); } return thingUID; } /** * Get the IT-100 Bridge Thing UID. * * @param thingTypeUID * @param thingUID * @param configuration * @return thingUID */ private ThingUID <API key>(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration) { if (thingUID == null) { String serialPort = (String) configuration.get(<API key>.SERIAL_PORT); String bridgeID = serialPort.replace('.', '_'); thingUID = new ThingUID(thingTypeUID, bridgeID); } return thingUID; } /** * Get the IT-100 Bridge Thing UID. * * @param thingTypeUID * @param thingUID * @param configuration * @return thingUID */ private ThingUID <API key>(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration) { if (thingUID == null) { String ipAddress = (String) configuration.get(<API key>.IP_ADDRESS); String port = (String) configuration.get(<API key>.PORT); String bridgeID = ipAddress.replace('.', '_') + "_" + port; thingUID = new ThingUID(thingTypeUID, bridgeID); } return thingUID; } /** * Get the Panel Thing UID. * * @param thingTypeUID * @param thingUID * @param configuration * @param bridgeUID * @return thingUID */ private ThingUID getDSCAlarmPanelUID(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration, ThingUID bridgeUID) { if (thingUID == null) { String panelId = "panel"; thingUID = new ThingUID(thingTypeUID, panelId, bridgeUID.getId()); } return thingUID; } /** * Get the Partition Thing UID. * * @param thingTypeUID * @param thingUID * @param configuration * @param bridgeUID * @return thingUID */ private ThingUID <API key>(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration, ThingUID bridgeUID) { if (thingUID == null) { String partitionId = "partition" + (String) configuration.get(<API key>.PARTITION_NUMBER); thingUID = new ThingUID(thingTypeUID, partitionId, bridgeUID.getId()); } return thingUID; } /** * Get the Zone Thing UID. * * @param thingTypeUID * @param thingUID * @param configuration * @param bridgeUID * @return thingUID */ private ThingUID getDSCAlarmZoneUID(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration, ThingUID bridgeUID) { if (thingUID == null) { String zoneId = "zone" + (String) configuration.get(<API key>.ZONE_NUMBER); thingUID = new ThingUID(thingTypeUID, zoneId, bridgeUID.getId()); } return thingUID; } /** * Get the Keypad Thing UID. * * @param thingTypeUID * @param thingUID * @param configuration * @param bridgeUID * @return thingUID */ private ThingUID <API key>(ThingTypeUID thingTypeUID, ThingUID thingUID, Configuration configuration, ThingUID bridgeUID) { if (thingUID == null) { String keypadId = "keypad"; thingUID = new ThingUID(thingTypeUID, keypadId, bridgeUID.getId()); } return thingUID; } /** * Register the Thing Discovery Service for a bridge. * * @param <API key> */ private void <API key>(<API key> <API key>) { <API key> discoveryService = new <API key>(<API key>); discoveryService.activate(); ServiceRegistration<?> <API key> = bundleContext .registerService(DiscoveryService.class.getName(), discoveryService, new Hashtable<>()); <API key>.put(<API key>.getThing().getUID(), <API key>); logger.debug("<API key>(): Bridge Handler - {}, Class Name - {}, Discovery Service - {}", <API key>, DiscoveryService.class.getName(), discoveryService); } @Override protected ThingHandler createHandler(Thing thing) { ThingTypeUID thingTypeUID = thing.getThingTypeUID(); if (thingTypeUID.equals(<API key>.<API key>)) { <API key> handler = new <API key>((Bridge) thing); <API key>(handler); logger.debug("createHandler(): <API key>: ThingHandler created for {}", thingTypeUID); return handler; } else if (thingTypeUID.equals(<API key>.<API key>)) { IT100BridgeHandler handler = new IT100BridgeHandler((Bridge) thing); <API key>(handler); logger.debug("createHandler(): IT100BRIDGE_THING: ThingHandler created for {}", thingTypeUID); return handler; } else if (thingTypeUID.equals(<API key>.<API key>)) { <API key> handler = new <API key>((Bridge) thing); <API key>(handler); logger.debug("createHandler(): <API key>: ThingHandler created for {}", thingTypeUID); return handler; } else if (thingTypeUID.equals(<API key>.PANEL_THING_TYPE)) { logger.debug("createHandler(): PANEL_THING: ThingHandler created for {}", thingTypeUID); return new PanelThingHandler(thing); } else if (thingTypeUID.equals(<API key>.<API key>)) { logger.debug("createHandler(): PARTITION_THING: ThingHandler created for {}", thingTypeUID); return new <API key>(thing); } else if (thingTypeUID.equals(<API key>.ZONE_THING_TYPE)) { logger.debug("createHandler(): ZONE_THING: ThingHandler created for {}", thingTypeUID); return new ZoneThingHandler(thing); } else if (thingTypeUID.equals(<API key>.KEYPAD_THING_TYPE)) { logger.debug("createHandler(): KEYPAD_THING: ThingHandler created for {}", thingTypeUID); return new KeypadThingHandler(thing); } else { logger.debug("createHandler(): ThingHandler not found for {}", thingTypeUID); return null; } } @Override protected void removeHandler(ThingHandler thingHandler) { ServiceRegistration<?> <API key> = <API key> .get(thingHandler.getThing().getUID()); if (<API key> != null) { <API key> discoveryService = (<API key>) bundleContext .getService(<API key>.getReference()); discoveryService.deactivate(); <API key>.unregister(); <API key> = null; <API key>.remove(thingHandler.getThing().getUID()); } super.removeHandler(thingHandler); } }
package org.openhab.binding.openthermgateway.internal; /** * The {@link CodeType} field is not part of OpenTherm specification, but added by OpenTherm Gateway. * It can be any of the following: * * T: Message received from the thermostat * B: Message received from the boiler * R: Request sent to the boiler * A: Response returned to the thermostat * E: Parity or stop bit error * * @author Arjen Korevaar - Initial contribution * @author James Melville - Introduced code filtering functionality */ public enum CodeType { /** * Message received from the thermostat */ T, /** * Message received from the boiler */ B, R, A, /** * Parity or stop bit error */ E }
package org.eclipse.hawkbit.repository.event.entity; /** * Marker interface to indicate event has updated an entity. */ public interface EntityUpdatedEvent extends EntityIdEvent { }
#ifndef <API key> #define <API key> #include "../source/<API key>.h" #include <string> #include "typedefs.h" #include "audio_device.h" #include "<API key>.h" #include "file_wrapper.h" #include "list_wrapper.h" #include "resampler.h" #if defined(MAC_IPHONE) || defined(ANDROID) #define USE_SLEEP_AS_PAUSE #else //#define USE_SLEEP_AS_PAUSE #endif // Sets the default pause time if using sleep as pause #define DEFAULT_PAUSE_TIME 5000 #if defined(USE_SLEEP_AS_PAUSE) #define PAUSE(a) AudioDeviceUtility::Sleep(a); #else #define PAUSE(a) AudioDeviceUtility::WaitForKey(); #endif #define SLEEP(a) AudioDeviceUtility::Sleep(a); #define ADM_AUDIO_LAYER AudioDeviceModule::<API key> //#define ADM_AUDIO_LAYER AudioDeviceModule::kLinuxPulseAudio enum TestType { TTInvalid = -1, TTAll = 0, <API key> = 1, TTDeviceEnumeration = 2, TTDeviceSelection = 3, TTAudioTransport = 4, TTSpeakerVolume = 5, TTMicrophoneVolume = 6, TTSpeakerMute = 7, TTMicrophoneMute = 8, TTMicrophoneBoost = 9, TTMicrophoneAGC = 10, TTLoopback = 11, TTDeviceRemoval = 13, TTMobileAPI = 14, TTTest = 66, }; class ProcessThread; namespace webrtc { class AudioDeviceModule; class AudioEventObserver; class AudioTransport; // AudioEventObserver class AudioEventObserver: public AudioDeviceObserver { public: virtual void OnErrorIsReported(const ErrorCode error); virtual void OnWarningIsReported(const WarningCode warning); AudioEventObserver(AudioDeviceModule* audioDevice); ~AudioEventObserver(); public: ErrorCode _error; WarningCode _warning; private: AudioDeviceModule* _audioDevice; }; // AudioTransport class AudioTransportImpl: public AudioTransport { public: virtual WebRtc_Word32 <API key>(const WebRtc_Word8* audioSamples, const WebRtc_UWord32 nSamples, const WebRtc_UWord8 nBytesPerSample, const WebRtc_UWord8 nChannels, const WebRtc_UWord32 samplesPerSec, const WebRtc_UWord32 totalDelayMS, const WebRtc_Word32 clockDrift, const WebRtc_UWord32 currentMicLevel, WebRtc_UWord32& newMicLevel); virtual WebRtc_Word32 NeedMorePlayData(const WebRtc_UWord32 nSamples, const WebRtc_UWord8 nBytesPerSample, const WebRtc_UWord8 nChannels, const WebRtc_UWord32 samplesPerSec, WebRtc_Word8* audioSamples, WebRtc_UWord32& nSamplesOut); AudioTransportImpl(AudioDeviceModule* audioDevice); ~AudioTransportImpl(); public: WebRtc_Word32 SetFilePlayout(bool enable, const WebRtc_Word8* fileName = NULL); void SetFullDuplex(bool enable); void SetSpeakerVolume(bool enable) { _speakerVolume = enable; } ; void SetSpeakerMute(bool enable) { _speakerMute = enable; } ; void SetMicrophoneMute(bool enable) { _microphoneMute = enable; } ; void SetMicrophoneVolume(bool enable) { _microphoneVolume = enable; } ; void SetMicrophoneBoost(bool enable) { _microphoneBoost = enable; } ; void <API key>(bool enable) { <API key> = enable; } ; void SetMicrophoneAGC(bool enable) { _microphoneAGC = enable; } ; private: AudioDeviceModule* _audioDevice; bool _playFromFile; bool _fullDuplex; bool _speakerVolume; bool _speakerMute; bool _microphoneVolume; bool _microphoneMute; bool _microphoneBoost; bool _microphoneAGC; bool <API key>; FileWrapper& _playFile; WebRtc_UWord32 _recCount; WebRtc_UWord32 _playCount; ListWrapper _audioList; Resampler _resampler; }; // FuncTestManager class FuncTestManager { public: FuncTestManager(); ~FuncTestManager(); WebRtc_Word32 Init(); WebRtc_Word32 Close(); WebRtc_Word32 DoTest(const TestType testType); private: WebRtc_Word32 <API key>(); WebRtc_Word32 <API key>(); WebRtc_Word32 TestDeviceSelection(); WebRtc_Word32 TestAudioTransport(); WebRtc_Word32 TestSpeakerVolume(); WebRtc_Word32 <API key>(); WebRtc_Word32 TestSpeakerMute(); WebRtc_Word32 TestMicrophoneMute(); WebRtc_Word32 TestMicrophoneBoost(); WebRtc_Word32 TestLoopback(); WebRtc_Word32 TestDeviceRemoval(); WebRtc_Word32 TestExtra(); WebRtc_Word32 TestMicrophoneAGC(); WebRtc_Word32 SelectPlayoutDevice(); WebRtc_Word32 <API key>(); WebRtc_Word32 TestAdvancedMBAPI(); private: // Paths to where the resource files to be used for this test are located. std::string _resourcePath; std::string _playoutFile48; std::string _playoutFile44; std::string _playoutFile16; std::string _playoutFile8; ProcessThread* _processThread; AudioDeviceModule* _audioDevice; AudioEventObserver* _audioEventObserver; AudioTransportImpl* _audioTransport; }; } // namespace webrtc #endif // #ifndef <API key>
package org.openhab.binding.bosesoundtouch.internal; import static org.openhab.binding.bosesoundtouch.internal.<API key>.*; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.openhab.binding.bosesoundtouch.internal.handler.<API key>; import org.openhab.core.library.types.DecimalType; import org.openhab.core.library.types.NextPreviousType; import org.openhab.core.library.types.OnOffType; import org.openhab.core.library.types.PercentType; import org.openhab.core.library.types.PlayPauseType; import org.openhab.core.library.types.StringType; import org.openhab.core.types.Command; import org.openhab.core.types.State; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The {@link CommandExecutor} class executes commands on the websocket * * @author Thomas Traunbauer - Initial contribution * @author Kai Kreuzer - code clean up */ public class CommandExecutor implements AvailableSources { private final Logger logger = LoggerFactory.getLogger(CommandExecutor.class); private final <API key> handler; private boolean currentMuted; private ContentItem currentContentItem; private OperationModeType <API key>; private Map<String, Boolean> <API key>; /** * Creates a new instance of this class * * @param handler the handler that created this CommandExecutor */ public CommandExecutor(<API key> handler) { this.handler = handler; init(); } /** * Synchronizes the underlying storage container with the current value for the presets stored on the player * by updating the available ones and deleting the cleared ones * * @param playerPresets a Map<Integer, ContentItems> containing the items currently stored on the player */ public void <API key>(Map<Integer, ContentItem> playerPresets) { playerPresets.forEach((k, v) -> { try { if (v != null) { handler.getPresetContainer().put(k, v); } else { handler.getPresetContainer().remove(k); } } catch (<API key> e) { logger.debug("{}: ContentItem is not presetable", handler.getDeviceName()); } }); handler.<API key>(); } /** * Adds a ContentItem to the PresetContainer * * @param id the id the ContentItem should be reached * @param contentItem the contentItem that should be saved as PRESET. Note that a eventually set presetID of the * ContentItem will be overwritten with id */ public void <API key>(int id, ContentItem contentItem) { contentItem.setPresetID(id); try { handler.getPresetContainer().put(id, contentItem); } catch (<API key> e) { logger.debug("{}: ContentItem is not presetable", handler.getDeviceName()); } handler.<API key>(); } /** * Adds the current selected ContentItem to the PresetContainer * * @param command the command is a DecimalType, thats intValue will be used as id. The id the ContentItem should be * reached */ public void <API key>(DecimalType command) { if (command.intValue() > 6) { <API key>(command.intValue(), currentContentItem); } else { logger.warn("{}: Only PresetID >6 is allowed", handler.getDeviceName()); } } /** * Initializes a API Request on this device * * @param apiRequest the apiRequest thats informations should be collected */ public void getInformations(APIRequest apiRequest) { String msg = "<msg><header " + "deviceID=\"" + handler.getMacAddress() + "\"" + " url=\"" + apiRequest + "\" method=\"GET\"><request requestID=\"0\"><info type=\"new\"/></request></header></msg>"; handler.getSession().getRemote().sendStringByFuture(msg); logger.debug("{}: sending request: {}", handler.getDeviceName(), msg); } /** * Sets the current ContentItem if it is valid, and inits an update of the operating values * * @param contentItem */ public void <API key>(ContentItem contentItem) { if ((contentItem != null) && (contentItem.isValid())) { ContentItem psFound = null; if (handler.getPresetContainer() != null) { Collection<ContentItem> listOfPresets = handler.getPresetContainer().getAllPresets(); for (ContentItem ps : listOfPresets) { if (ps.isPresetable()) { if (ps.getLocation().equals(contentItem.getLocation())) { psFound = ps; } } } int presetID = 0; if (psFound != null) { presetID = psFound.getPresetID(); } contentItem.setPresetID(presetID); currentContentItem = contentItem; } } <API key>(); } /** * Sets the device is currently muted * * @param muted */ public void setCurrentMuted(boolean muted) { currentMuted = muted; } /** * Post Bass on the device * * @param command the command is Type of DecimalType */ public void postBass(DecimalType command) { if (isBassAvailable()) { <API key>("bass", "<bass deviceID=\"" + handler.getMacAddress() + "\"" + ">" + command.intValue() + "</bass>"); } else { logger.warn("{}: Bass modification not supported for this device", handler.getDeviceName()); } } /** * Post OperationMode on the device * * @param command the command is Type of OperationModeType */ public void postOperationMode(OperationModeType command) { if (command == OperationModeType.STANDBY) { postPower(OnOffType.OFF); } else { try { ContentItemMaker contentItemMaker = new ContentItemMaker(this, handler.getPresetContainer()); ContentItem contentItem = contentItemMaker.getContentItem(command); postContentItem(contentItem); } catch (<API key> e) { logger.warn("{}: OperationMode \"{}\" is not supported yet", handler.getDeviceName(), command.toString()); } catch (<API key> e) { logger.warn("{}: Unable to switch to mode \"INTERNET_RADIO\". No PRESET defined", handler.getDeviceName()); } catch (<API key> e) { logger.warn("{}: Unable to switch to mode: \"STORED_MUSIC\". No PRESET defined", handler.getDeviceName()); } <API key>(); } } /** * Post PlayerControl on the device * * @param command the command is Type of Command */ public void postPlayerControl(Command command) { if (command.equals(PlayPauseType.PLAY)) { if (<API key> == OperationModeType.STANDBY) { postRemoteKey(RemoteKeyType.POWER); } else { postRemoteKey(RemoteKeyType.PLAY); } } else if (command.equals(PlayPauseType.PAUSE)) { postRemoteKey(RemoteKeyType.PAUSE); } else if (command.equals(NextPreviousType.NEXT)) { postRemoteKey(RemoteKeyType.NEXT_TRACK); } else if (command.equals(NextPreviousType.PREVIOUS)) { postRemoteKey(RemoteKeyType.PREV_TRACK); } } /** * Post Power on the device * * @param command the command is Type of OnOffType */ public void postPower(OnOffType command) { if (command.equals(OnOffType.ON)) { if (<API key> == OperationModeType.STANDBY) { postRemoteKey(RemoteKeyType.POWER); } } else if (command.equals(OnOffType.OFF)) { if (<API key> != OperationModeType.STANDBY) { postRemoteKey(RemoteKeyType.POWER); } } <API key>(); } /** * Post Preset on the device * * @param command the command is Type of DecimalType */ public void postPreset(DecimalType command) { ContentItem item = null; try { item = handler.getPresetContainer().get(command.intValue()); postContentItem(item); } catch (<API key> e) { logger.warn("{}: No preset found at id: {}", handler.getDeviceName(), command.intValue()); } } /** * Post RemoteKey on the device * * @param command the command is Type of RemoteKeyType */ public void postRemoteKey(RemoteKeyType key) { <API key>("key", "mainNode=\"keyPress\"", "<key state=\"press\" sender=\"Gabbo\">" + key.name() + "</key>"); <API key>("key", "mainNode=\"keyRelease\"", "<key state=\"release\" sender=\"Gabbo\">" + key.name() + "</key>"); } /** * Post Volume on the device * * @param command the command is Type of PercentType */ public void postVolume(PercentType command) { <API key>("volume", "<volume deviceID=\"" + handler.getMacAddress() + "\"" + ">" + command.intValue() + "</volume>"); } /** * Post VolumeMute on the device * * @param command the command is Type of OnOffType */ public void postVolumeMuted(OnOffType command) { if (command.equals(OnOffType.ON)) { if (!currentMuted) { currentMuted = true; postRemoteKey(RemoteKeyType.MUTE); } } else if (command.equals(OnOffType.OFF)) { if (currentMuted) { currentMuted = false; postRemoteKey(RemoteKeyType.MUTE); } } } /** * Update GUI for Basslevel * * @param state the state is Type of DecimalType */ public void <API key>(DecimalType state) { handler.updateState(CHANNEL_BASS, state); } /** * Update GUI for Volume * * @param state the state is Type of PercentType */ public void <API key>(PercentType state) { handler.updateState(CHANNEL_VOLUME, state); } /** * Update GUI for OperationMode * * @param state the state is Type of StringType */ public void <API key>(StringType state) { handler.updateState(<API key>, state); } /** * Update GUI for PlayerControl * * @param state the state is Type of State */ public void <API key>(State state) { handler.updateState(<API key>, state); } /** * Update GUI for Power * * @param state the state is Type of OnOffType */ public void <API key>(OnOffType state) { handler.updateState(CHANNEL_POWER, state); } /** * Update GUI for Preset * * @param state the state is Type of DecimalType */ public void <API key>(DecimalType state) { handler.updateState(CHANNEL_PRESET, state); } private void init() { getInformations(APIRequest.INFO); <API key> = OperationModeType.OFFLINE; currentContentItem = null; <API key> = new HashMap<>(); } private void postContentItem(ContentItem contentItem) { if (contentItem != null) { <API key>(contentItem); <API key>("select", "", contentItem.generateXML()); } } private void <API key>(String url, String postData) { <API key>(url, "", postData); } private void <API key>(String url, String infoAddon, String postData) { int id = 0; String msg = "<msg><header " + "deviceID=\"" + handler.getMacAddress() + "\"" + " url=\"" + url + "\" method=\"POST\"><request requestID=\"" + id + "\"><info " + infoAddon + " type=\"new\"/></request></header><body>" + postData + "</body></msg>"; try { handler.getSession().getRemote().sendStringByFuture(msg); logger.debug("{}: sending request: {}", handler.getDeviceName(), msg); } catch (<API key> e) { handler.onWebSocketError(e); } } private void <API key>() { OperationModeType operationMode; if (currentContentItem != null) { <API key>(new DecimalType(currentContentItem.getPresetID())); operationMode = currentContentItem.getOperationMode(); } else { operationMode = OperationModeType.STANDBY; } <API key>(new StringType(operationMode.toString())); <API key> = operationMode; if (<API key> == OperationModeType.STANDBY) { <API key>(OnOffType.OFF); <API key>(PlayPauseType.PAUSE); } else { <API key>(OnOffType.ON); } } @Override public boolean <API key>() { return isSourceAvailable("bluetooth"); } @Override public boolean isAUXAvailable() { return isSourceAvailable("aux"); } @Override public boolean isAUX1Available() { return isSourceAvailable("aux1"); } @Override public boolean isAUX2Available() { return isSourceAvailable("aux2"); } @Override public boolean isAUX3Available() { return isSourceAvailable("aux3"); } @Override public boolean isTVAvailable() { return isSourceAvailable("tv"); } @Override public boolean isHDMI1Available() { return isSourceAvailable("hdmi1"); } @Override public boolean <API key>() { return isSourceAvailable("internetRadio"); } @Override public boolean <API key>() { return isSourceAvailable("storedMusic"); } @Override public boolean isBassAvailable() { return isSourceAvailable("bass"); } @Override public void <API key>(boolean bluetooth) { <API key>.put("bluetooth", bluetooth); } @Override public void setAUXAvailable(boolean aux) { <API key>.put("aux", aux); } @Override public void setAUX1Available(boolean aux1) { <API key>.put("aux1", aux1); } @Override public void setAUX2Available(boolean aux2) { <API key>.put("aux2", aux2); } @Override public void setAUX3Available(boolean aux3) { <API key>.put("aux3", aux3); } @Override public void <API key>(boolean storedMusic) { <API key>.put("storedMusic", storedMusic); } @Override public void <API key>(boolean internetRadio) { <API key>.put("internetRadio", internetRadio); } @Override public void setTVAvailable(boolean tv) { <API key>.put("tv", tv); } @Override public void setHDMI1Available(boolean hdmi1) { <API key>.put("hdmi1", hdmi1); } @Override public void setBassAvailable(boolean bass) { <API key>.put("bass", bass); } private boolean isSourceAvailable(String source) { Boolean isAvailable = <API key>.get(source); if (isAvailable == null) { return false; } else { return isAvailable; } } public void <API key>(String appKey, <API key> notificationConfig, String fileUrl) { String msg = "<play_info>" + "<app_key>" + appKey + "</app_key>" + "<url>" + fileUrl + "</url>" + "<service>" + notificationConfig.notificationService + "</service>" + (notificationConfig.notificationReason != null ? "<reason>" + notificationConfig.notificationReason + "</reason>" : "") + (notificationConfig.notificationMessage != null ? "<message>" + notificationConfig.notificationMessage + "</message>" : "") + (notificationConfig.notificationVolume != null ? "<volume>" + notificationConfig.notificationVolume + "</volume>" : "") + "</play_info>"; <API key>("speaker", msg); } }
package org.python.pydev.parser.prettyprinter; import org.python.pydev.core.<API key>; import org.python.pydev.parser.jython.ast.ClassDef; import org.python.pydev.parser.jython.ast.Module; import org.python.pydev.parser.jython.ast.commentType; public class PrettyPrinter30Test extends <API key> { public static void main(String[] args) { try { DEBUG = true; PrettyPrinter30Test test = new PrettyPrinter30Test(); test.setUp(); test.testYield4(); test.tearDown(); System.out.println("Finished"); junit.textui.TestRunner.run(PrettyPrinter30Test.class); } catch (Throwable e) { e.printStackTrace(); } } @Override protected void setUp() throws Exception { super.setUp(); setDefaultVersion(<API key>.<API key>); } public void testMetaClass() throws Exception { String s = "" + "class IOBase(metaclass=abc.ABCMeta):\n" + " pass\n" + ""; <API key>(s); } public void testMetaClass2() throws Exception { String s = "" + "class IOBase(object,*args,metaclass=abc.ABCMeta):\n" + " pass\n" + ""; <API key>(s); } public void testIf() throws Exception { String s = "" + "if a:\n" + " pass\n" + ""; <API key>(s); } public void testIf2() throws Exception { String s = "" + "if a:\n" + " pass\n" + "elif b:\n" + " pass\n" + ""; <API key>(s); } public void testIf3() throws Exception { String s = "" + "if a:\n" + " pass\n" + "elif b:\n" + " pass\n" + "elif c:\n" + " pass\n" + "else:\n" + " pass\n" + ""; <API key>(s); } public void testMetaClass3() throws Exception { String s = "" + "class B(*[x for x in [object]]):\n" + " pass\n" + ""; <API key>(s); } public void testAnnotations() throws Exception { String s = "" + "def seek(self,pos,whence)->int:\n" + " pass\n"; <API key>(s); } public void testAnnotations2() throws Exception { String s = "" + "def seek(self,pos:int,whence:int)->int:\n" + " pass\n"; <API key>(s); } public void testAnnotations3() throws Exception { String s = "" + "def seek(self,pos:int,whence:int,*args:list,foo:int=10,**kwargs:dict)->int:\n" + " pass\n"; <API key>(s); } public void testAnnotations4() throws Exception { String s = "" + "def seek(whence:int,*,foo:int=10):\n" + " pass\n"; <API key>(s); } public void testAnnotations5() throws Exception { String s = "" + "def seek(self,pos:int=None,whence:int=0)->int:\n" + " pass\n"; <API key>(s); } public void testLambdaArgs2() throws Exception { String s = "a = lambda self,a,*,xx=10,yy=20:1\n" + ""; <API key>(s); } public void testLambdaArgs3() throws Exception { String s = "a = lambda self,a,*args,xx=10,yy=20:1\n" + ""; <API key>(s); } public void testFuncCall() throws Exception { String s = "Call(1,2,3,*(4,5,6),keyword=13)\n" + ""; <API key>(s); } public void testClassDecorator() throws Exception { String s = "" + "@classdec\n" + "@classdec2\n" + "class A:\n" + " pass\n" + ""; <API key>(s); } public void <API key>() throws Exception { String s = "" + "namespace = {'a':1,'b':2,'c':1,'d':1}\n" + "abstracts = {name for name,value in namespace.items() if value == 1}\n" + "print(abstracts)\n" + ""; <API key>(s); } public void <API key>() throws Exception { String s = "" + "namespace = {'a':1,'b':2,'c':1,'d':1}\n" + "abstracts = {name:value for name,value in namespace.items() if value == 1}\n" + "print(abstracts)\n" + ""; <API key>(s); } public void testSet() throws Exception { String s = "" + "namespace = {'a','b','c','d'}\n" + "print(abstracts)\n" + ""; <API key>(s); } public void testRaiseFrom() throws Exception { String s = "" + "try:\n" + " print(a)\n" + "except Exception as e:\n" + " raise SyntaxError() from e\n" + ""; <API key>(s); } public void testMisc() throws Exception { String s = "" + "class ABCMeta(type):\n" + " <API key> = 0\n" + " def __new__(mcls,name,bases,namespace):\n" + " cls = super().__new__(mcls,name,bases,namespace)\n" + " # Compute set of abstract method names\n" + " abstracts = {name for name,value in namespace.items() if getattr(value,'<API key>',False)}\n" + ""; String v3 = "" + "class ABCMeta(type):\n" + " <API key> = 0\n" + " def __new__(mcls,name,bases,namespace):\n" + " cls = super().__new__(mcls,name,bases,namespace)# Compute set of abstract method names\n" + " abstracts = {name for name,value in namespace.items() if getattr(value,'<API key>',False)}\n" + ""; <API key>(s, s, s, v3); } public void testMethodDef() throws Exception { String s = "" + "def _dump_registry(cls,file=None):\n" + " pass\n" + ""; <API key>(s); } public void testMethodDef2() throws Exception { String s = "" + "def _set_stopinfo(stoplineno=-1):\n" + " pass\n" + ""; <API key>(s); } public void testMethodDef3() throws Exception { String s = "" + "def _set_stopinfo(lnum=[arg]):\n" + " pass\n" + ""; <API key>(s); } public void testExec() throws Exception { String s = "" + "try:\n" + " exec(cmd,globals,locals)\n" + "except BdbQuit:\n" + " pass\n" + ""; <API key>(s); } public void testExec2() throws Exception { String s = "" + "try:\n" + " exec(cmd,globals,locals)\n" + "except BdbQuit:\n" + " pass\n" + "finally:\n" + " self.quitting = 1\n" + " sys.settrace(None)\n" + ""; <API key>(s); } public void testTryExcept() throws Exception { String s = "" + "try:\n" + " a = 10\n" + "except BdbQuit:\n" + " b = 10\n" + "else:\n" + " c = 10\n" + "finally:\n" + " d = 10\n" + ""; <API key>(s); } public void testTryExcept2() throws Exception { String s = "" + "try:\n" + " try:\n" + " a = 10\n" + " except BdbQuit:\n" + " b = 10\n" + " else:\n" + " c = 10\n" + "finally:\n" + " d = 10\n" + ""; String v2 = "" + "try:\n" + " a = 10\n" + "except BdbQuit:\n" + " b = 10\n" + "else:\n" + " c = 10\n" + "finally:\n" + " d = 10\n" + ""; <API key>(s, s, v2); } public void testComment() throws Exception { String s = "" + "def __enter__(self)->'IOBase':#That's a forward reference\n" + " pass\n"; <API key>(s); } public void testListComp() throws Exception { String s = "" + "lines = [line if isinstance(line,str) else str(line,coding) for line in lines]\n"; <API key>(s); } public void testNewIf() throws Exception { String s = "" + "j = stop if (arg in gets) else start\n" + ""; String v2 = "" + "j = stop if arg in gets else start\n" + ""; <API key>(s, s, v2); } public void testEndWithComment() { String s = "class C:\n" + " pass\n" + "#end\n" + ""; String v3 = "class C:\n" + " pass#end\n" + ""; Module ast = (Module) parseLegalDocStr(s); ClassDef d = (ClassDef) ast.body[0]; assertEquals(1, d.specialsAfter.size()); commentType c = (commentType) d.specialsAfter.get(0); assertEquals("#end", c.id); <API key>(s, s, s, v3); } public void testOnlyComment() { String s = "#end\n" + ""; Module ast = (Module) parseLegalDocStr(s); assertEquals(1, ast.specialsBefore.size()); commentType c = (commentType) ast.specialsBefore.get(0); assertEquals("#end", c.id); <API key>(s); } public void testCall() { String s = "save_reduce(obj=obj,*rv)\n" + ""; <API key>(s); } public void testOthers() throws Exception { String s = "def __instancecheck__(cls,instance):\n" + " '''Override for isinstance(instance,cls).'''\n" + " # Inline the cache checking\n" + " subclass = instance.__class__\n" + " if subclass in cls._abc_cache:\n" + " return True\n" + ""; String v3 = "def __instancecheck__(cls,instance):\n" + " '''Override for isinstance(instance,cls).'''# Inline the cache checking\n" + " subclass = instance.__class__\n" + " if subclass in cls._abc_cache:\n" + " return True\n" + ""; <API key>(s, s, s, v3); } public void testOthers1() throws Exception { String s = "_skiplist = b'COMT',\\\n" + " b'ANNO'\n" + ""; String expected = "_skiplist = b'COMT',b'ANNO'\n" + ""; <API key>(s, expected); } public void testOthers2() throws Throwable { final String s = "" + "def _format(node):\n" + " rv = '%s(%s' % (node.__class__.__name__,', '.join((\n" + " '%s=%s' % field for field in fields)\n" + " if annotate_fields else \n" + " (b for (a,b) in fields)\n" + " ))\n" + ""; final String v2 = "" + "def _format(node):\n" + " rv = '%s(%s' % (node.__class__.__name__,', '.join((\n" + " '%s=%s' % field for field in fields) if \n" + " annotate_fields else \n" + " (b for (a,b) in fields)))\n" + ""; final String v3 = "" + "def _format(node):\n" + " rv = '%s(%s' % (node.__class__.__name__,', '.join(('%s=%s' % field for field in fields) if annotate_fields else (b for (a,b) in fields)))\n" + ""; <API key>(s, s, v2, v3); } public void testManyGlobals() throws Throwable { final String s = "" + "global logfp,log\n" + ""; <API key>(s); } public void testVarious1() throws Throwable { final String s = "" + "def _incrementudc(self):\n" + " \"Increment update counter.\"\"\"\n" + " if not TurtleScreen._RUNNING:\n" + " TurtleScreen._RUNNNING = True\n" + " raise Terminator\n" + ""; final String v3 = "" + "def _incrementudc(self):\n" + " \"Increment update counter.\"\\\n" + " \"\"\n" + " if not TurtleScreen._RUNNING:\n" + " TurtleScreen._RUNNNING = True\n" + " raise Terminator\n" + ""; <API key>(s, s, s, v3); } public void testNums() throws Throwable { final String s = "" + "0o700\n" + "0O700\n" + "0x700\n" + "0X700\n" + "0b100\n" + "0B100\n" + "0o700l\n" + "0O700L\n" + "0x700l\n" + "0X700L\n" + "0b100l\n" + "0B100L\n" + ""; <API key>(s); } public void testWith() throws Throwable { final String s = "" + "with open(cfile,'rb') as chandle,open('cc') as d:\n" + " pass\n" + ""; <API key>(s); } public void testTupleInDict() throws Throwable { final String s = "" + "NAME_MAPPING = {(1,2):(3,4)}\n" + ""; <API key>(s); } public void testCalledDecorator() throws Throwable { final String s = "" + "class foo:\n" + " @decorator()\n" + " def method(self):\n" + " pass\n" + ""; <API key>(s); } public void testYieldFrom() { String s = "" + "def m1():\n" + " yield from a\n" + ""; <API key>(s); } public void testYieldFrom2() { String s = "" + "def m1():\n" + " yield from call(a)\n" + ""; <API key>(s); } public void testYield() { String s = "" + "def m1():\n" + " yield \n" + ""; <API key>(s); } public void testYield2() { String s = "" + "def m1():\n" + " yield a,b\n" + ""; <API key>(s); } public void testYield3() { String s = "" + "def m1():\n" + " yield (a,b)\n" + ""; String v2 = "" + "def m1():\n" + " yield a,b\n" + ""; <API key>(s, s, v2); } public void testYield4() { String s = "" + "def m1():\n" + " #comment 1\n" + " yield a,b#comment 2\n" + " #comment 3\n" + ""; String v2 = "" + "def m1():#comment 1\n" + " yield a,b#comment 2\n" + "#comment 3\n" + ""; <API key>(s, s, s, v2); } public void testAsync() throws Exception { String s = "" + "async def m1():\n" + " pass\n"; <API key>(s, s, s, s); } public void testAsync1() throws Exception { String s = "" + "@param\n" + "async def m1():\n" + " pass\n"; <API key>(s, s, s, s); } public void testAsync2() throws Exception { String s = "" + "async with a:\n" + " pass\n"; <API key>(s, s, s, s); } public void testAsync3() throws Exception { String s = "" + "async with a:\n" + " pass\n"; <API key>(s, s, s, s); } public void testAwait() throws Exception { String s = "" + "async with a:\n" + " b = await foo()\n"; <API key>(s, s, s, s); } public void testAsyncFor() throws Exception { String s = "" + "async for a in [1,2]:\n" + " pass\n"; <API key>(s, s, s, s); } public void testListRemainder() throws Exception { String s = "" + "first,middle,*last = lst\n" + ""; <API key>(s, s, s, s); } public void testDotOperator() throws Exception { String s = "" + "a = a @ a\n" + ""; <API key>(s, s, s, s); } public void testDotOperator2() throws Exception { String s = "" + "a @= a\n" + ""; <API key>(s, s, s, s); } public void <API key>() throws Exception { String s = "" + "class F(**args):\n" + " pass\n" + ""; <API key>(s, s, s, s); } }
package org.openhab.binding.zway.internal.handler; import static de.fh_zwickau.informatik.sensor.ZWayConstants.*; import static org.openhab.binding.zway.internal.<API key>.*; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import org.openhab.binding.zway.internal.<API key>; import org.openhab.binding.zway.internal.converter.<API key>; import org.openhab.core.library.types.DecimalType; import org.openhab.core.library.types.HSBType; import org.openhab.core.library.types.OnOffType; import org.openhab.core.library.types.PercentType; import org.openhab.core.library.types.StopMoveType; import org.openhab.core.library.types.UpDownType; import org.openhab.core.thing.Bridge; import org.openhab.core.thing.Channel; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingStatus; import org.openhab.core.thing.ThingStatusDetail; import org.openhab.core.thing.ThingStatusInfo; import org.openhab.core.thing.binding.BaseThingHandler; import org.openhab.core.thing.binding.ThingHandler; import org.openhab.core.thing.binding.builder.ChannelBuilder; import org.openhab.core.thing.binding.builder.ThingBuilder; import org.openhab.core.thing.type.ChannelTypeUID; import org.openhab.core.types.Command; import org.openhab.core.types.RefreshType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import de.fh_zwickau.informatik.sensor.model.devices.Device; import de.fh_zwickau.informatik.sensor.model.devices.DeviceList; import de.fh_zwickau.informatik.sensor.model.devices.types.Battery; import de.fh_zwickau.informatik.sensor.model.devices.types.Doorlock; import de.fh_zwickau.informatik.sensor.model.devices.types.SensorBinary; import de.fh_zwickau.informatik.sensor.model.devices.types.SensorDiscrete; import de.fh_zwickau.informatik.sensor.model.devices.types.SensorMultilevel; import de.fh_zwickau.informatik.sensor.model.devices.types.SwitchBinary; import de.fh_zwickau.informatik.sensor.model.devices.types.SwitchControl; import de.fh_zwickau.informatik.sensor.model.devices.types.SwitchMultilevel; import de.fh_zwickau.informatik.sensor.model.devices.types.SwitchRGBW; import de.fh_zwickau.informatik.sensor.model.devices.types.SwitchToggle; import de.fh_zwickau.informatik.sensor.model.devices.types.Thermostat; import de.fh_zwickau.informatik.sensor.model.devices.types.ToggleButton; import de.fh_zwickau.informatik.sensor.model.zwaveapi.devices.ZWaveDevice; /** * The {@link ZWayDeviceHandler} is responsible for handling commands, which are * sent to one of the channels. * * @author Patrick Hecker - Initial contribution, remove observer mechanism * @author Johannes Einig - Now uses the bridge handler cached device list */ public abstract class ZWayDeviceHandler extends BaseThingHandler { private final Logger logger = LoggerFactory.getLogger(getClass()); private DevicePolling devicePolling; private ScheduledFuture<?> pollingJob; protected Calendar lastUpdate; protected abstract void refreshLastUpdate(); /** * Initialize polling job */ private class Initializer implements Runnable { @Override public void run() { // If any execution of the task encounters an exception, subsequent executions are // suppressed. Otherwise, the task will only terminate via cancellation or // termination of the executor. try { // Z-Way bridge have to be ONLINE because configuration is needed ZWayBridgeHandler zwayBridgeHandler = <API key>(); if (zwayBridgeHandler == null || !zwayBridgeHandler.getThing().getStatus().equals(ThingStatus.ONLINE)) { logger.debug("Z-Way bridge handler not found or not ONLINE."); return; } // Initialize device polling if (pollingJob == null || pollingJob.isCancelled()) { logger.debug("Starting polling job at intervall {}", zwayBridgeHandler.<API key>().getPollingInterval()); pollingJob = scheduler.<API key>(devicePolling, 10, zwayBridgeHandler.<API key>().getPollingInterval(), TimeUnit.SECONDS); } else { // Called when thing or bridge updated ... logger.debug("Polling is allready active"); } } catch (Throwable t) { if (t instanceof Exception) { logger.error("{}", t.getMessage()); } else if (t instanceof Error) { logger.error("{}", t.getMessage()); } else { logger.error("Unexpected error"); } if (getThing().getStatus() == ThingStatus.ONLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.<API key>, "Error occurred when starting polling."); } } } } private class Disposer implements Runnable { @Override public void run() { // Z-Way bridge have to be ONLINE because configuration is needed ZWayBridgeHandler zwayBridgeHandler = <API key>(); if (zwayBridgeHandler == null || !zwayBridgeHandler.getThing().getStatus().equals(ThingStatus.ONLINE)) { logger.debug("Z-Way bridge handler not found or not ONLINE."); // status update will remove finally updateStatus(ThingStatus.REMOVED); return; } // status update will remove finally updateStatus(ThingStatus.REMOVED); } } public ZWayDeviceHandler(Thing thing) { super(thing); devicePolling = new DevicePolling(); } protected synchronized ZWayBridgeHandler <API key>() { Bridge bridge = getBridge(); if (bridge == null) { return null; } ThingHandler handler = bridge.getHandler(); if (handler instanceof ZWayBridgeHandler) { return (ZWayBridgeHandler) handler; } else { return null; } } @Override public void initialize() { setLocation(); // Start an extra thread to check the connection, because it takes sometimes more // than 5000 milliseconds and the handler will suspend (ThingStatus.UNINITIALIZED). scheduler.execute(new Initializer()); } @Override public void dispose() { if (pollingJob != null && !pollingJob.isCancelled()) { pollingJob.cancel(true); pollingJob = null; } super.dispose(); } @Override public void handleRemoval() { logger.debug("Handle removal Z-Way device ..."); // Start an extra thread, because it takes sometimes more // than 5000 milliseconds and the handler will suspend (ThingStatus.UNINITIALIZED). scheduler.execute(new Disposer()); // super.handleRemoval() called in every case in scheduled task ... } @Override public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { // Only called if status ONLINE or OFFLINE logger.debug("Z-Way bridge status changed: {}", bridgeStatusInfo); if (bridgeStatusInfo.getStatus().equals(ThingStatus.OFFLINE)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE, "Bridge status is offline."); } else if (bridgeStatusInfo.getStatus().equals(ThingStatus.ONLINE)) { // Initialize thing, if all OK the status of device thing will be ONLINE // Start an extra thread to check the connection, because it takes sometimes more // than 5000 milliseconds and the handler will suspend (ThingStatus.UNINITIALIZED). scheduler.execute(new Initializer()); } } private class DevicePolling implements Runnable { @Override public void run() { logger.debug("Starting polling for device: {}", getThing().getLabel()); if (getThing().getStatus().equals(ThingStatus.ONLINE)) { // Refresh device states for (Channel channel : getThing().getChannels()) { logger.debug("Checking link state of channel: {}", channel.getLabel()); if (isLinked(channel.getUID().getId())) { logger.debug("Refresh items that linked with channel: {}", channel.getLabel()); // If any execution of the task encounters an exception, subsequent executions are // suppressed. Otherwise, the task will only terminate via cancellation or // termination of the executor. try { refreshChannel(channel); } catch (Throwable t) { if (t instanceof Exception) { logger.error("Error occurred when performing polling:{}", t.getMessage()); } else if (t instanceof Error) { logger.error("Error occurred when performing polling:{}", t.getMessage()); } else { logger.error("Error occurred when performing polling: Unexpected error"); } if (getThing().getStatus() == ThingStatus.ONLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Error occurred when performing polling."); } } } else { logger.debug("Polling for device: {} not possible (channel {} not linked", thing.getLabel(), channel.getLabel()); } } // Refresh last update refreshLastUpdate(); } else { logger.debug("Polling not possible, Z-Way device isn't ONLINE"); } } } private synchronized void setLocation() { Map<String, String> properties = getThing().getProperties(); // Load location from properties String location = properties.get(<API key>.<API key>); if (location != null && !location.equals("") && getThing().getLocation() == null) { logger.debug("Set location to {}", location); ThingBuilder thingBuilder = editThing(); thingBuilder.withLocation(location); thingBuilder.withLabel(thing.getLabel()); updateThing(thingBuilder.build()); } } protected void refreshAllChannels() { scheduler.execute(new DevicePolling()); } private void refreshChannel(Channel channel) { // Check Z-Way bridge handler ZWayBridgeHandler zwayBridgeHandler = <API key>(); if (zwayBridgeHandler == null || !zwayBridgeHandler.getThing().getStatus().equals(ThingStatus.ONLINE)) { logger.debug("Z-Way bridge handler not found or not ONLINE."); return; } // Check device id associated with channel String deviceId = channel.getProperties().get("deviceId"); if (deviceId != null) { // Load and check device from Z-Way server DeviceList deviceList = zwayBridgeHandler.getZWayApi().getDevices(); if (deviceList != null) { // 1.) Load only the current value from Z-Way server Device device = deviceList.getDeviceById(deviceId); if (device == null) { logger.debug("ZAutomation device not found."); return; } try { updateState(channel.getUID(), <API key>.toState(device, channel)); } catch (<API key> iae) { logger.debug( "<API key> ({}) during refresh channel for device: {} (level: {}) with channel: {}", iae.getMessage(), device.getMetrics().getTitle(), device.getMetrics().getLevel(), channel.getChannelTypeUID()); updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Channel refresh for device: " + device.getMetrics().getTitle() + " (level: " + device.getMetrics().getLevel() + ") with channel: " + channel.getChannelTypeUID() + " failed!"); } // 2.) Trigger update function, soon as the value has been updated, openHAB will be notified try { device.update(); } catch (Exception e) { logger.debug("{} doesn't support update (triggered during refresh channel)", device.getMetrics().getTitle()); } } else { logger.warn("Devices not loaded"); } } else { // Check channel for command classes // Channel thermostat mode if (channel.getUID().equals(new ChannelUID(getThing().getUID(), <API key>))) { // Load physical device String nodeIdString = channel.getProperties().get("nodeId"); ZWaveDevice physicalDevice = nodeIdString == null ? null : zwayBridgeHandler.getZWayApi().getZWaveDevice(Integer.parseInt(nodeIdString)); if (physicalDevice != null) { updateState(channel.getUID(), new DecimalType(physicalDevice.getInstances().get0() .getCommandClasses().get64().getData().getMode().getValue())); } } } } @Override public void channelLinked(ChannelUID channelUID) { logger.debug("Z-Way device channel linked: {}", channelUID); ZWayBridgeHandler zwayBridgeHandler = <API key>(); if (zwayBridgeHandler == null || !zwayBridgeHandler.getThing().getStatus().equals(ThingStatus.ONLINE)) { logger.debug("Z-Way bridge handler not found or not ONLINE."); return; } // Method called when channel linked and not when server started!!! super.channelLinked(channelUID); // performs a refresh command } @Override public void channelUnlinked(ChannelUID channelUID) { logger.debug("Z-Way device channel unlinked: {}", channelUID); ZWayBridgeHandler zwayBridgeHandler = <API key>(); if (zwayBridgeHandler == null || !zwayBridgeHandler.getThing().getStatus().equals(ThingStatus.ONLINE)) { logger.debug("Z-Way bridge handler not found or not ONLINE."); return; } super.channelUnlinked(channelUID); } @Override public void handleCommand(ChannelUID channelUID, final Command command) { logger.debug("Handle command for channel: {} with command: {}", channelUID.getId(), command.toString()); // Check Z-Way bridge handler ZWayBridgeHandler zwayBridgeHandler = <API key>(); if (zwayBridgeHandler == null || !zwayBridgeHandler.getThing().getStatus().equals(ThingStatus.ONLINE)) { logger.debug("Z-Way bridge handler not found or not ONLINE."); return; } // Load device id from channel's properties for the compatibility of ZAutomation and ZWave devices final Channel channel = getThing().getChannel(channelUID.getId()); final String deviceId = channel.getProperties().get("deviceId"); if (deviceId != null) { DeviceList deviceList = zwayBridgeHandler.getDeviceList(); if (deviceList != null) { Device device = deviceList.getDeviceById(deviceId); if (device == null) { logger.debug("ZAutomation device not found."); return; } try { if (command instanceof RefreshType) { logger.debug("Handle command: RefreshType"); refreshChannel(channel); } else { if (device instanceof Battery) { // possible commands: update() } else if (device instanceof Doorlock) { // possible commands: open(), close() if (command instanceof OnOffType) { logger.debug("Handle command: OnOffType"); if (command.equals(OnOffType.ON)) { device.open(); } else if (command.equals(OnOffType.OFF)) { device.close(); } } } else if (device instanceof SensorBinary) { // possible commands: update() } else if (device instanceof SensorMultilevel) { // possible commands: update() } else if (device instanceof SwitchBinary) { // possible commands: update(), on(), off() if (command instanceof OnOffType) { logger.debug("Handle command: OnOffType"); if (command.equals(OnOffType.ON)) { device.on(); } else if (command.equals(OnOffType.OFF)) { device.off(); } } } else if (device instanceof SwitchMultilevel) { // possible commands: update(), on(), up(), off(), down(), min(), max(), upMax(), // increase(), decrease(), exact(level), exactSmooth(level, duration), stop(), startUp(), // startDown() if (command instanceof DecimalType || command instanceof PercentType) { logger.debug("Handle command: DecimalType"); device.exact(command.toString()); } else if (command instanceof UpDownType) { if (command.equals(UpDownType.UP)) { logger.debug("Handle command: UpDownType.Up"); device.startUp(); } else if (command.equals(UpDownType.DOWN)) { logger.debug("Handle command: UpDownType.Down"); device.startDown(); } } else if (command instanceof StopMoveType) { logger.debug("Handle command: StopMoveType"); device.stop(); } else if (command instanceof OnOffType) { logger.debug("Handle command: OnOffType"); if (command.equals(OnOffType.ON)) { device.on(); } else if (command.equals(OnOffType.OFF)) { device.off(); } } } else if (device instanceof SwitchRGBW) { // possible commands: on(), off(), exact(red, green, blue) if (command instanceof HSBType) { logger.debug("Handle command: HSBType"); HSBType hsb = (HSBType) command; // first set on/off if (hsb.getBrightness().intValue() > 0) { if (device.getMetrics().getLevel().toLowerCase().equals("off")) { device.on(); } // then set color int red = (int) Math.round(255 * (hsb.getRed().doubleValue() / 100)); int green = (int) Math.round(255 * (hsb.getGreen().doubleValue() / 100)); int blue = (int) Math.round(255 * (hsb.getBlue().doubleValue() / 100)); device.exact(red, green, blue); } else { device.off(); } } } else if (device instanceof Thermostat) { if (command instanceof DecimalType) { logger.debug("Handle command: DecimalType"); device.exact(command.toString()); } } else if (device instanceof SwitchControl) { // possible commands: on(), off(), exact(level), upstart(), upstop(), downstart(), // downstop() if (command instanceof OnOffType) { logger.debug("Handle command: OnOffType"); if (command.equals(OnOffType.ON)) { device.on(); } else if (command.equals(OnOffType.OFF)) { device.off(); } } } else if (device instanceof ToggleButton || device instanceof SwitchToggle) { // possible commands: on(), off(), exact(level), upstart(), upstop(), downstart(), // downstop() if (command instanceof OnOffType) { logger.debug("Handle command: OnOffType"); if (command.equals(OnOffType.ON)) { device.on(); } // no else - only ON command is sent to Z-Way } } } } catch (<API key> e) { logger.warn("Unknown command: {}", e.getMessage()); } } else { logger.warn("Devices not loaded"); } } else if (channel.getUID().equals(new ChannelUID(getThing().getUID(), <API key>))) { // Load physical device if (command instanceof DecimalType) { String nodeIdString = channel.getProperties().get("nodeId"); logger.debug("Handle command: DecimalType"); if (nodeIdString != null) { zwayBridgeHandler.getZWayApi().<API key>(Integer.parseInt(nodeIdString), Integer.parseInt(command.toString())); } } else if (command instanceof RefreshType) { logger.debug("Handle command: RefreshType"); refreshChannel(channel); } } } protected synchronized void addDeviceAsChannel(Device device) { // Device.probeType // Device.metrics.probeType // Device.metrics.icon // Command class // Default, depends on device type if (device != null) { logger.debug("Add virtual device as channel: {}", device.getMetrics().getTitle()); HashMap<String, String> properties = new HashMap<>(); properties.put("deviceId", device.getDeviceId()); String id = ""; String acceptedItemType = ""; // 1. Set basically channel types without further information if (device instanceof Battery) { id = BATTERY_CHANNEL; acceptedItemType = "Number"; } else if (device instanceof Doorlock) { id = DOORLOCK_CHANNEL; acceptedItemType = "Switch"; } else if (device instanceof SensorBinary) { id = <API key>; acceptedItemType = "Switch"; } else if (device instanceof SensorMultilevel) { id = <API key>; acceptedItemType = "Number"; } else if (device instanceof SwitchBinary) { id = <API key>; acceptedItemType = "Switch"; } else if (device instanceof SwitchMultilevel) { id = <API key>; acceptedItemType = "Dimmer"; } else if (device instanceof SwitchRGBW) { id = <API key>; acceptedItemType = "Color"; } else if (device instanceof Thermostat) { id = <API key>; acceptedItemType = "Number"; } else if (device instanceof SwitchControl) { id = <API key>; acceptedItemType = "Switch"; } else if (device instanceof ToggleButton || device instanceof SwitchToggle) { id = <API key>; acceptedItemType = "Switch"; } else if (device instanceof SensorDiscrete) { id = <API key>; acceptedItemType = "Number"; } // 2. Check if device information includes further information about sensor type if (!device.getProbeType().equals("")) { if (device instanceof SensorMultilevel) { switch (device.getProbeType()) { case <API key>: id = <API key>; acceptedItemType = "Number"; break; case <API key>: id = <API key>; acceptedItemType = "Number"; break; case PROBE_TYPE_HUMIDITY: id = <API key>; acceptedItemType = "Number"; break; case <API key>: id = <API key>; acceptedItemType = "Number"; break; case <API key>: id = <API key>; acceptedItemType = "Number"; break; case PROBE_TYPE_ENERGY: id = <API key>; acceptedItemType = "Number"; break; case <API key>: id = <API key>; acceptedItemType = "Number"; break; case <API key>: id = <API key>; acceptedItemType = "Number"; break; default: break; } } else if (device instanceof SensorBinary) { switch (device.getProbeType()) { case <API key>: if (device.getMetrics().getIcon().equals(ICON_MOTION)) { id = <API key>; acceptedItemType = "Switch"; } break; case PROBE_TYPE_SMOKE: id = <API key>; acceptedItemType = "Switch"; break; case PROBE_TYPE_CO: id = SENSOR_CO_CHANNEL; acceptedItemType = "Switch"; break; case PROBE_TYPE_FLOOD: id = <API key>; acceptedItemType = "Switch"; break; case PROBE_TYPE_COOLING: // TODO break; case PROBE_TYPE_TAMPER: id = <API key>; acceptedItemType = "Switch"; break; case <API key>: id = <API key>; acceptedItemType = "Contact"; break; case PROBE_TYPE_MOTION: id = <API key>; acceptedItemType = "Switch"; break; default: break; } } else if (device instanceof SwitchMultilevel) { switch (device.getProbeType()) { case <API key>: id = <API key>; acceptedItemType = "Dimmer"; break; case <API key>: id = <API key>; acceptedItemType = "Dimmer"; break; case PROBE_TYPE_MOTOR: id = <API key>; acceptedItemType = "Rollershutter"; default: break; } } else if (device instanceof SwitchBinary) { switch (device.getProbeType()) { case <API key>: id = <API key>; acceptedItemType = "Switch"; break; default: break; } } } else if (!device.getMetrics().getProbeTitle().equals("")) { if (device instanceof SensorMultilevel) { switch (device.getMetrics().getProbeTitle()) { case <API key>: id = SENSOR_CO2_CHANNEL; acceptedItemType = "Number"; break; default: break; } } } else if (!device.getMetrics().getIcon().equals("")) { if (device instanceof SwitchBinary) { switch (device.getMetrics().getIcon()) { case ICON_SWITCH: id = <API key>; acceptedItemType = "Switch"; break; default: break; } } } else { // Eventually take account of the command classes } // If at least one rule could mapped to a channel if (!id.equals("")) { addChannel(id, acceptedItemType, device.getMetrics().getTitle(), properties); logger.debug( "Channel for virtual device added with channel id: {}, accepted item type: {} and title: {}", id, acceptedItemType, device.getMetrics().getTitle()); } else { // Thing status will not be updated because thing could have more than one channel logger.warn("No channel for virtual device added: {}", device); } } } private synchronized void addChannel(String id, String acceptedItemType, String label, HashMap<String, String> properties) { boolean channelExists = false; // Check if a channel for this virtual device exist. Attention: same channel type could multiple assigned to a // thing. That's why not check the existence of channel type. List<Channel> channels = getThing().getChannels(); for (Channel channel : channels) { if (channel.getProperties().get("deviceId") != null && channel.getProperties().get("deviceId").equals(properties.get("deviceId"))) { channelExists = true; } } if (!channelExists) { ThingBuilder thingBuilder = editThing(); ChannelTypeUID channelTypeUID = new ChannelTypeUID(BINDING_ID, id); Channel channel = ChannelBuilder .create(new ChannelUID(getThing().getUID(), id + "-" + properties.get("deviceId")), acceptedItemType) .withType(channelTypeUID).withLabel(label).withProperties(properties).build(); thingBuilder.withChannel(channel); thingBuilder.withLabel(thing.getLabel()); updateThing(thingBuilder.build()); } } protected synchronized void <API key>(Map<Integer, String> modes, Integer nodeId) { logger.debug("Add command class thermostat mode as channel"); ChannelUID channelUID = new ChannelUID(getThing().getUID(), <API key>); boolean channelExists = false; // Check if a channel for this virtual device exist. Attention: same channel type could multiple assigned to a // thing. That's why not check the existence of channel type. List<Channel> channels = getThing().getChannels(); for (Channel channel : channels) { if (channel.getUID().equals(channelUID)) { channelExists = true; } } if (!channelExists) { // Prepare properties (convert modes map) HashMap<String, String> properties = new HashMap<>(); // Add node id (for refresh and command handling) properties.put("nodeId", nodeId.toString()); // Add channel ThingBuilder thingBuilder = editThing(); Channel channel = ChannelBuilder.create(channelUID, "Number") .withType(new ChannelTypeUID(BINDING_ID, <API key>)) .withLabel("Thermostat mode (Command Class)").withDescription("Possible modes: " + modes.toString()) .withProperties(properties).build(); thingBuilder.withChannel(channel); thingBuilder.withLabel(thing.getLabel()); updateThing(thingBuilder.build()); } } }
package org.openhab.binding.caddx.internal.handler; import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.caddx.internal.CaddxEvent; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; import org.openhab.core.thing.ThingStatus; import org.openhab.core.types.Command; /** * This is a class for handling a Keypad type Thing. * * @author Georgios Moutsos - Initial contribution */ @NonNullByDefault public class ThingHandlerKeypad extends <API key> { /** * Constructor. * * @param thing */ public ThingHandlerKeypad(Thing thing) { super(thing, CaddxThingType.KEYPAD); } @Override public void updateChannel(ChannelUID channelUID, String data) { } @Override public void handleCommand(ChannelUID channelUID, Command command) { } @Override public void caddxEventReceived(CaddxEvent event, Thing thing) { updateStatus(ThingStatus.ONLINE); } }
package junit.tests.framework; import junit.framework.TestCase; /** * Test class used in SuiteTest */ public class OneTestCase extends TestCase { public void noTestCase() { } public void testCase() { } public void testCase(int arg) { } }
@TraceOptions(traceGroup = "archive.artifact.xml", messageBundle = "com.ibm.ws.artifact.loose.internal.resources.LooseApiMessages") package com.ibm.ws.artifact.loose.internal; import com.ibm.websphere.ras.annotation.TraceOptions;
/** * @version 2.0 */ @org.osgi.annotation.versioning.Version("2.0") @TraceOptions(traceGroup = "com.ibm.ws.annocache", messageBundle = "com.ibm.ws.anno.resources.internal.AnnoMessages") package com.ibm.ws.annocache.targets; import com.ibm.websphere.ras.annotation.TraceOptions;
package com.jaxb.test.servlet; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import com.ibm.jaxb.test.bean.Customer; import com.jaxb.test.util.TestUtils; public class TestUsingIBMImpl { public static void main(String[] args) { Customer customer = TestUtils.createCustomer(); try { JAXBContext jaxbContext = JAXBContext.newInstance(Customer.class); /** * Test if using IBM fast path implementation */ if (!jaxbContext.getClass().getName().contains("com.ibm.xml.xlxp2")) { System.out.println("The jaxb implementation is not from IBM"); return; } Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); // output pretty printed jaxbMarshaller.setProperty(Marshaller.<API key>, true); jaxbMarshaller.marshal(customer, System.out); } catch (JAXBException e) { e.printStackTrace(); } finally { System.out.flush(); System.out.close(); } } }
package org.openhab.binding.nikohomecontrol.internal.protocol.nhc2; import static org.openhab.binding.nikohomecontrol.internal.protocol.<API key>.*; import java.lang.reflect.Type; import java.net.InetAddress; import java.net.<API key>; import java.security.cert.<API key>; import java.util.ArrayList; import java.util.List; import java.util.<API key>; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.<API key>; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.io.transport.mqtt.MqttException; import org.eclipse.smarthome.io.transport.mqtt.<API key>; import org.openhab.binding.nikohomecontrol.internal.protocol.NhcControllerEvent; import org.openhab.binding.nikohomecontrol.internal.protocol.<API key>; import org.openhab.binding.nikohomecontrol.internal.protocol.<API key>.ActionType; import org.openhab.binding.nikohomecontrol.internal.protocol.nhc2.NhcDevice2.NhcProperty; import org.openhab.binding.nikohomecontrol.internal.protocol.nhc2.NhcMessage2.NhcMessageParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; /** * The {@link <API key>} class is able to do the following tasks with Niko Home Control II * systems: * <ul> * <li>Start and stop MQTT connection with Niko Home Control II Connected Controller. * <li>Read all setup and status information from the Niko Home Control Controller. * <li>Execute Niko Home Control commands. * <li>Listen for events from Niko Home Control. * </ul> * * @author Mark Herwege - Initial Contribution */ @NonNullByDefault public class <API key> extends <API key> implements <API key> { private final Logger logger = LoggerFactory.getLogger(<API key>.class); private final NhcMqttConnection2 mqttConnection; private final List<NhcProfile2> profiles = new <API key><>(); private final List<NhcService2> services = new <API key><>(); private final List<NhcLocation2> locations = new <API key><>(); private volatile @Nullable NhcSystemInfo2 nhcSystemInfo; private volatile @Nullable NhcTimeInfo2 nhcTimeInfo; private volatile String profileUuid = ""; private volatile @Nullable CompletableFuture<Boolean> <API key>; private final Gson gson = new GsonBuilder().<API key>(FieldNamingPolicy.UPPER_CAMEL_CASE).create(); /** * Constructor for Niko Home Control communication object, manages communication with * Niko Home Control II Connected Controller. * * @throws <API key> when the SSL context for MQTT communication cannot be created * @throws <API key> when the IP address is not provided * */ public <API key>(NhcControllerEvent handler, String clientId, String persistencePath) throws <API key> { super(handler); mqttConnection = new NhcMqttConnection2(clientId, persistencePath); } @Override public synchronized void startCommunication() { <API key> = new CompletableFuture<>(); <API key>(); } /** * This method executes the first part of the communication start. A public connection (no username or password, but * secured with SSL) will be started and the controller will be queried for existing capabilities and profiles. */ private void <API key>() { InetAddress addr = handler.getAddr(); if (addr == null) { logger.warn("Niko Home Control: IP address cannot be empty"); stopCommunication(); return; } String addrString = addr.getHostAddress(); @SuppressWarnings("null") // default provided, so cannot be null int port = handler.getPort(); logger.debug("Niko Home Control: initializing for mqtt connection to CoCo on {}:{}", addrString, port); try { mqttConnection.<API key>(this, addrString, port); initializePublic(); } catch (MqttException e) { logger.debug("Niko Home Control: error in mqtt communication"); stopCommunication(); } } /** * This method executes the second part of the communication start. After the list of profiles are received on the * public MQTT connection, this method should be called to stop the general connection and start a touch profile * specific MQTT connection. This will allow receiving state information and updating state of devices. */ private void <API key>() { String profile = handler.getProfile(); String password = handler.getPassword(); if (profile.isEmpty()) { logger.warn("Niko Home Control: no profile set"); stopCommunication(); return; } try { profileUuid = profiles.stream().filter(p -> profile.equals(p.name)).findFirst().get().uuid; } catch (<API key> e) { logger.warn("Niko Home Control: profile '{}' does not match a profile in the controller", profile); stopCommunication(); return; } if (password.isEmpty()) { logger.warn("Niko Home Control: password for profile cannot be empty"); stopCommunication(); return; } mqttConnection.<API key>(); try { mqttConnection.<API key>(this, profileUuid, password); initializeProfile(); } catch (MqttException e) { logger.warn("Niko Home Control: error in mqtt communication"); stopCommunication(); } } @Override public synchronized void stopCommunication() { if (<API key> != null) { <API key>.complete(false); } <API key> = null; mqttConnection.<API key>(); mqttConnection.<API key>(); } @Override public boolean communicationActive() { CompletableFuture<Boolean> started = <API key>; if (started == null) { return false; } try { // Wait until we received all devices info to confirm we are active. return started.get(5000, TimeUnit.MILLISECONDS); } catch (<API key> | ExecutionException | TimeoutException e) { logger.debug("Niko Home Control: exception waiting for connection start"); return false; } } /** * After setting up the communication with the Niko Home Control Connected Controller, send all initialization * messages. * */ private void initializePublic() throws MqttException { NhcMessage2 message = new NhcMessage2(); message.method = "systeminfo.publish"; mqttConnection.<API key>("public/system/cmd", gson.toJson(message)); message.method = "profiles.list"; mqttConnection.<API key>("public/authentication/cmd", gson.toJson(message)); } /** * After setting up the profile communication with the Niko Home Control Connected Controller, send all profile * specific initialization messages. * */ private void initializeProfile() throws MqttException { NhcMessage2 message = new NhcMessage2(); message.method = "services.list"; mqttConnection.<API key>(profileUuid + "/authentication/cmd", gson.toJson(message)); message.method = "devices.list"; mqttConnection.<API key>(profileUuid + "/control/devices/cmd", gson.toJson(message)); message.method = "locations.list"; mqttConnection.<API key>(profileUuid + "/control/locations/cmd", gson.toJson(message)); message.method = "notifications.list"; mqttConnection.<API key>(profileUuid + "/notification/cmd", gson.toJson(message)); } private void connectionLost() { logger.debug("Niko Home Control: connection lost"); stopCommunication(); handler.controllerOffline(); } private void timePublishEvt(String response) { Type messageType = new TypeToken<NhcMessage2>() { }.getType(); List<NhcTimeInfo2> timeInfo = null; try { NhcMessage2 message = gson.fromJson(response, messageType); if (message.params != null) { timeInfo = message.params.stream().filter(p -> (p.timeInfo != null)).findFirst().get().timeInfo; } } catch (JsonSyntaxException e) { logger.debug("Niko Home Control: unexpected json {}", response); } catch (<API key> ignore) { // Ignore if timeInfo not present in response, this should not happen in a timeInfo response } if (timeInfo != null) { nhcTimeInfo = timeInfo.get(0); } } private void <API key>(String response) { Type messageType = new TypeToken<NhcMessage2>() { }.getType(); List<NhcSystemInfo2> systemInfo = null; try { NhcMessage2 message = gson.fromJson(response, messageType); if (message.params != null) { systemInfo = message.params.stream().filter(p -> (p.systemInfo != null)).findFirst().get().systemInfo; } } catch (JsonSyntaxException e) { logger.debug("Niko Home Control: unexpected json {}", response); } catch (<API key> ignore) { // Ignore if systemInfo not present in response, this should not happen in a systemInfo response } if (systemInfo != null) { nhcSystemInfo = systemInfo.get(0); } } private void profilesListRsp(String response) { Type messageType = new TypeToken<NhcMessage2>() { }.getType(); List<NhcProfile2> profileList = null; try { NhcMessage2 message = gson.fromJson(response, messageType); if (message.params != null) { profileList = message.params.stream().filter(p -> (p.profiles != null)).findFirst().get().profiles; } } catch (JsonSyntaxException e) { logger.debug("Niko Home Control: unexpected json {}", response); } catch (<API key> ignore) { // Ignore if profiles not present in response, this should not happen in a profiles response } profiles.clear(); if (profileList != null) { profiles.addAll(profileList); } } private void servicesListRsp(String response) { Type messageType = new TypeToken<NhcMessage2>() { }.getType(); List<NhcService2> serviceList = null; try { NhcMessage2 message = gson.fromJson(response, messageType); if (message.params != null) { serviceList = message.params.stream().filter(p -> (p.services != null)).findFirst().get().services; } } catch (JsonSyntaxException e) { logger.debug("Niko Home Control: unexpected json {}", response); } catch (<API key> ignore) { // Ignore if services not present in response, this should not happen in a services response } services.clear(); if (serviceList != null) { services.addAll(serviceList); } } private void locationsListRsp(String response) { Type messageType = new TypeToken<NhcMessage2>() { }.getType(); List<NhcLocation2> locationList = null; try { NhcMessage2 message = gson.fromJson(response, messageType); if (message.params != null) { locationList = message.params.stream().filter(p -> (p.locations != null)).findFirst().get().locations; } } catch (JsonSyntaxException e) { logger.debug("Niko Home Control: unexpected json {}", response); } catch (<API key> ignore) { // Ignore if locations not present in response, this should not happen in a locations response } locations.clear(); if (locationList != null) { locations.addAll(locationList); } } private void devicesListRsp(String response) { Type messageType = new TypeToken<NhcMessage2>() { }.getType(); List<NhcDevice2> deviceList = null; try { NhcMessage2 message = gson.fromJson(response, messageType); if (message.params != null) { deviceList = message.params.stream().filter(p -> (p.devices != null)).findFirst().get().devices; } } catch (JsonSyntaxException e) { logger.debug("Niko Home Control: unexpected json {}", response); } catch (<API key> ignore) { // Ignore if devices not present in response, this should not happen in a devices response } if (deviceList == null) { return; } for (NhcDevice2 device : deviceList) { String location; try { location = device.parameters.stream().filter(p -> (p.locationId != null)).findFirst() .get().locationName; } catch (<API key> e) { location = null; } if ("action".equals(device.type)) { ActionType actionType = ActionType.GENERIC; switch (device.model) { case "generic": case "pir": case "simulation": case "comfort": case "alarms": case "alloff": actionType = ActionType.TRIGGER; break; case "light": case "socket": case "switched-generic": actionType = ActionType.RELAY; break; case "dimmer": actionType = ActionType.DIMMER; break; case "rolldownshutter": case "sunblind": case "venetianblind": actionType = ActionType.ROLLERSHUTTER; break; } if (!actions.containsKey(device.uuid)) { logger.debug("Niko Home Control: adding action device {}, {}", device.uuid, device.name); NhcAction2 nhcAction = new NhcAction2(device.uuid, device.name, device.model, device.technology, actionType, location); nhcAction.setNhcComm(this); actions.put(device.uuid, nhcAction); } updateActionState((NhcAction2) actions.get(device.uuid), device); } else if ("thermostat".equals(device.type)) { if (!thermostats.containsKey(device.uuid)) { logger.debug("Niko Home Control: adding thermostatdevice {}, {}", device.uuid, device.name); NhcThermostat2 nhcThermostat = new NhcThermostat2(device.uuid, device.name, location); nhcThermostat.setNhcComm(this); thermostats.put(device.uuid, nhcThermostat); } <API key>((NhcThermostat2) thermostats.get(device.uuid), device); } else { logger.debug("Niko Home Control: device type {} not supported for {}, {}", device.type, device.uuid, device.name); } } // Once a devices list response is received, we know the communication is fully started. logger.debug("Niko Home Control: Communication start complete."); handler.controllerOnline(); if (<API key> != null) { <API key>.complete(true); } } private void devicesStatusEvt(String response) { Type messageType = new TypeToken<NhcMessage2>() { }.getType(); List<NhcDevice2> deviceList = null; try { NhcMessage2 message = gson.fromJson(response, messageType); if (message.params != null) { deviceList = message.params.stream().filter(p -> (p.devices != null)).findFirst().get().devices; } } catch (JsonSyntaxException e) { logger.debug("Niko Home Control: unexpected json {}", response); } catch (<API key> ignore) { // Ignore if devices not present in response, this should not happen in a devices event } if (deviceList == null) { return; } for (NhcDevice2 device : deviceList) { if (actions.containsKey(device.uuid)) { updateActionState((NhcAction2) actions.get(device.uuid), device); } else if (thermostats.containsKey(device.uuid)) { <API key>((NhcThermostat2) thermostats.get(device.uuid), device); } } } private void notificationEvt(String response) { Type messageType = new TypeToken<NhcMessage2>() { }.getType(); List<NhcNotification2> notificationList = null; try { NhcMessage2 message = gson.fromJson(response, messageType); if (message.params != null) { notificationList = message.params.stream().filter(p -> (p.notifications != null)).findFirst() .get().notifications; } } catch (JsonSyntaxException e) { logger.debug("Niko Home Control: unexpected json {}", response); } catch (<API key> ignore) { // Ignore if notifications not present in response, this should not happen in a notifications event } logger.debug("Niko Home Control: notifications {}", notificationList); if (notificationList == null) { return; } for (NhcNotification2 notification : notificationList) { if ("new".equals(notification.status)) { String alarmText = notification.text; switch (notification.type) { case "alarm": handler.alarmEvent(alarmText); break; case "notification": handler.noticeEvent(alarmText); break; default: logger.debug("Niko Home Control: unexpected message type {}", notification.type); } } } } private void updateActionState(NhcAction2 action, NhcDevice2 device) { if (action.getType() == ActionType.ROLLERSHUTTER) { <API key>(action, device); } else { updateLightState(action, device); } } private void updateLightState(NhcAction2 action, NhcDevice2 device) { Optional<NhcProperty> statusProperty = device.properties.stream().filter(p -> (p.status != null)).findFirst(); Optional<NhcProperty> dimmerProperty = device.properties.stream().filter(p -> (p.brightness != null)) .findFirst(); Optional<NhcProperty> basicStateProperty = device.properties.stream().filter(p -> (p.basicState != null)) .findFirst(); String booleanState = null; if (statusProperty.isPresent()) { booleanState = statusProperty.get().status; } else if (basicStateProperty.isPresent()) { booleanState = basicStateProperty.get().basicState; } if (booleanState != null) { if (NHCON.equals(booleanState)) { action.setBooleanState(true); logger.debug("Niko Home Control: setting action {} internally to ON", action.getId()); } else if (NHCOFF.equals(booleanState)) { action.setBooleanState(false); logger.debug("Niko Home Control: setting action {} internally to OFF", action.getId()); } } if (dimmerProperty.isPresent()) { action.setState(Integer.parseInt(dimmerProperty.get().brightness)); logger.debug("Niko Home Control: setting action {} internally to {}", action.getId(), dimmerProperty.get().brightness); } } private void <API key>(NhcAction2 action, NhcDevice2 device) { Optional<NhcProperty> positionProperty = device.properties.stream().filter(p -> (p.position != null)) .findFirst(); Optional<NhcProperty> movingProperty = device.properties.stream().filter(p -> (p.moving != null)).findFirst(); if (!(movingProperty.isPresent() && Boolean.parseBoolean(movingProperty.get().moving)) && positionProperty.isPresent()) { action.setState(Integer.parseInt(positionProperty.get().position)); logger.debug("Niko Home Control: setting action {} internally to {}", action.getId(), positionProperty.get().position); } } private void <API key>(NhcThermostat2 thermostat, NhcDevice2 device) { Optional<NhcProperty> <API key> = device.properties.stream() .filter(p -> (p.overruleActive != null)).findFirst(); Optional<NhcProperty> <API key> = device.properties.stream() .filter(p -> (p.overruleSetpoint != null)).findFirst(); Optional<NhcProperty> <API key> = device.properties.stream().filter(p -> (p.overruleTime != null)) .findFirst(); Optional<NhcProperty> programProperty = device.properties.stream().filter(p -> (p.program != null)).findFirst(); Optional<NhcProperty> <API key> = device.properties.stream() .filter(p -> (p.setpointTemperature != null)).findFirst(); Optional<NhcProperty> ecoSaveProperty = device.properties.stream().filter(p -> (p.ecoSave != null)).findFirst(); Optional<NhcProperty> <API key> = device.properties.stream() .filter(p -> (p.ambientTemperature != null)).findFirst(); Optional<NhcProperty> demandProperty = device.properties.stream().filter(p -> (p.demand != null)).findFirst(); String modeString = programProperty.isPresent() ? programProperty.get().program : ""; int mode = IntStream.range(0, THERMOSTATMODES.length).filter(i -> THERMOSTATMODES[i].equals(modeString)) .findFirst().orElse(thermostat.getMode()); int measured = <API key>.isPresent() ? Math.round(Float.parseFloat(<API key>.get().ambientTemperature) * 10) : thermostat.getMeasured(); int setpoint = <API key>.isPresent() ? Math.round(Float.parseFloat(<API key>.get().setpointTemperature) * 10) : thermostat.getSetpoint(); int overrule = 0; int overruletime = 0; if (<API key>.isPresent() && "True".equals(<API key>.get().overruleActive)) { overrule = <API key>.isPresent() ? Math.round(Float.parseFloat(<API key>.get().overruleSetpoint) * 10) : 0; overruletime = <API key>.isPresent() ? Integer.parseInt(<API key>.get().overruleTime) : 0; } int ecosave = ecoSaveProperty.isPresent() ? ("True".equals(ecoSaveProperty.get().ecoSave) ? 1 : 0) : thermostat.getEcosave(); int demand = thermostat.getDemand(); if (demandProperty.isPresent()) { switch (demandProperty.get().demand) { case "None": demand = 0; break; case "Heating": demand = 1; break; case "Cooling": demand = -1; break; } } logger.debug( "Niko Home Control: setting thermostat {} with measured {}, setpoint {}, mode {}, overrule {}, overruletime {}, ecosave {}, demand {}", thermostat.getId(), measured, setpoint, mode, overrule, overruletime, ecosave, demand); thermostat.updateState(measured, setpoint, mode, overrule, overruletime, ecosave, demand); } @Override public void executeAction(String actionId, String value) { NhcMessage2 message = new NhcMessage2(); message.method = "devices.control"; ArrayList<NhcMessageParam> params = new ArrayList<>(); NhcMessageParam param = message.new NhcMessageParam(); params.add(param); message.params = params; ArrayList<NhcDevice2> devices = new ArrayList<>(); NhcDevice2 device = new NhcDevice2(); devices.add(device); param.devices = devices; device.uuid = actionId; device.properties = new ArrayList<>(); NhcProperty property = device.new NhcProperty(); device.properties.add(property); NhcAction2 action = (NhcAction2) actions.get(actionId); switch (action.getType()) { case GENERIC: case TRIGGER: property.basicState = NHCTRIGGERED; break; case RELAY: property.status = value; break; case DIMMER: if (NHCON.equals(value)) { action.setBooleanState(true); // this will trigger sending the stored brightness value event out property.status = value; } else if (NHCOFF.equals(value)) { property.status = value; } else { // If the light is off, turn the light on before sending the brightness value, needs to happen // in 2 separate messages. if (!action.booleanState()) { executeAction(actionId, NHCON); } property.brightness = value; } break; case ROLLERSHUTTER: if (NHCSTOP.equals(value)) { property.action = value; } else if (NHCUP.equals(value)) { property.position = "100"; } else if (NHCDOWN.equals(value)) { property.position = "0"; } else { int position = 100 - Integer.parseInt(value); property.position = String.valueOf(position); } break; } String topic = profileUuid + "/control/devices/cmd"; String gsonMessage = gson.toJson(message); sendDeviceMessage(topic, gsonMessage); } @Override public void executeThermostat(String thermostatId, String mode) { NhcMessage2 message = new NhcMessage2(); message.method = "devices.control"; ArrayList<NhcMessageParam> params = new ArrayList<>(); NhcMessageParam param = message.new NhcMessageParam(); params.add(param); message.params = params; ArrayList<NhcDevice2> devices = new ArrayList<>(); NhcDevice2 device = new NhcDevice2(); devices.add(device); param.devices = devices; device.uuid = thermostatId; device.properties = new ArrayList<>(); NhcProperty overruleActiveProp = device.new NhcProperty(); device.properties.add(overruleActiveProp); overruleActiveProp.overruleActive = "False"; NhcProperty program = device.new NhcProperty(); device.properties.add(program); program.program = mode; String topic = profileUuid + "/control/devices/cmd"; String gsonMessage = gson.toJson(message); sendDeviceMessage(topic, gsonMessage); } @Override public void executeThermostat(String thermostatId, int overruleTemp, int overruleTime) { NhcMessage2 message = new NhcMessage2(); message.method = "devices.control"; ArrayList<NhcMessageParam> params = new ArrayList<>(); NhcMessageParam param = message.new NhcMessageParam(); params.add(param); message.params = params; ArrayList<NhcDevice2> devices = new ArrayList<>(); NhcDevice2 device = new NhcDevice2(); devices.add(device); param.devices = devices; device.uuid = thermostatId; device.properties = new ArrayList<>(); if (overruleTime > 0) { NhcProperty overruleActiveProp = device.new NhcProperty(); overruleActiveProp.overruleActive = "True"; device.properties.add(overruleActiveProp); NhcProperty <API key> = device.new NhcProperty(); <API key>.overruleSetpoint = String.valueOf(overruleTemp); device.properties.add(<API key>); NhcProperty overruleTimeProp = device.new NhcProperty(); overruleTimeProp.overruleTime = String.valueOf(overruleTime); device.properties.add(overruleTimeProp); } else { NhcProperty overruleActiveProp = device.new NhcProperty(); overruleActiveProp.overruleActive = "False"; device.properties.add(overruleActiveProp); } String topic = profileUuid + "/control/devices/cmd"; String gsonMessage = gson.toJson(message); sendDeviceMessage(topic, gsonMessage); } private void sendDeviceMessage(String topic, String gsonMessage) { try { mqttConnection.<API key>(topic, gsonMessage); } catch (MqttException e) { logger.warn("Niko Home Control: sending command failed, trying to restart communication"); <API key>(); // retry sending after restart try { if (communicationActive()) { mqttConnection.<API key>(topic, gsonMessage); } else { logger.warn("Niko Home Control: failed to restart communication"); connectionLost(); } } catch (MqttException e1) { logger.warn("Niko Home Control: error resending thermostat command"); connectionLost(); } } } @Override public void processMessage(String topic, byte[] payload) { String message = new String(payload); if ("public/system/evt".equals(topic)) { timePublishEvt(message); } else if ((profileUuid + "/system/evt").equals(topic)) { // ignore } else if ("public/system/rsp".equals(topic)) { logger.debug("Niko Home Control: received topic {}, payload {}", topic, message); <API key>(message); } else if ("public/authentication/rsp".equals(topic)) { logger.debug("Niko Home Control: received topic {}, payload {}", topic, message); profilesListRsp(message); <API key>(); } else if ((profileUuid + "/notification/evt").equals(topic)) { logger.debug("Niko Home Control: received topic {}, payload {}", topic, message); notificationEvt(message); } else if ((profileUuid + "/control/devices/evt").equals(topic)) { logger.debug("Niko Home Control: received topic {}, payload {}", topic, message); devicesStatusEvt(message); } else if ((profileUuid + "/control/devices/rsp").equals(topic)) { logger.debug("Niko Home Control: received topic {}, payload {}", topic, message); devicesListRsp(message); } else if ((profileUuid + "/authentication/rsp").equals(topic)) { logger.debug("Niko Home Control: received topic {}, payload {}", topic, message); servicesListRsp(message); } else if ((profileUuid + "/locations/rsp").equals(topic)) { logger.debug("Niko Home Control: received topic {}, payload {}", topic, message); locationsListRsp(message); } else { logger.trace("Niko Home Control: not acted on received message topic {}, payload {}", topic, message); } } /** * @return system info retrieved from Connected Controller */ public NhcSystemInfo2 getSystemInfo() { NhcSystemInfo2 systemInfo = nhcSystemInfo; if (systemInfo == null) { systemInfo = new NhcSystemInfo2(); } return systemInfo; } /** * @return time info retrieved from Connected Controller */ public NhcTimeInfo2 getTimeInfo() { NhcTimeInfo2 timeInfo = nhcTimeInfo; if (timeInfo == null) { timeInfo = new NhcTimeInfo2(); } return timeInfo; } /** * @return comma separated list of services retrieved from Connected Controller */ public String getServices() { return services.stream().map(NhcService2::name).collect(Collectors.joining(", ")); } }
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2018.06.07 at 01:36:00 PM CDT package com.ibm.ws.jpa.diagnostics.ormparser.jaxb.orm22xml; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "cascade-type", propOrder = { "cascadeAll", "cascadePersist", "cascadeMerge", "cascadeRemove", "cascadeRefresh", "cascadeDetach" }) public class CascadeType { @XmlElement(name = "cascade-all") protected EmptyType cascadeAll; @XmlElement(name = "cascade-persist") protected EmptyType cascadePersist; @XmlElement(name = "cascade-merge") protected EmptyType cascadeMerge; @XmlElement(name = "cascade-remove") protected EmptyType cascadeRemove; @XmlElement(name = "cascade-refresh") protected EmptyType cascadeRefresh; @XmlElement(name = "cascade-detach") protected EmptyType cascadeDetach; /** * Gets the value of the cascadeAll property. * * @return * possible object is * {@link EmptyType } * */ public EmptyType getCascadeAll() { return cascadeAll; } /** * Sets the value of the cascadeAll property. * * @param value * allowed object is * {@link EmptyType } * */ public void setCascadeAll(EmptyType value) { this.cascadeAll = value; } /** * Gets the value of the cascadePersist property. * * @return * possible object is * {@link EmptyType } * */ public EmptyType getCascadePersist() { return cascadePersist; } /** * Sets the value of the cascadePersist property. * * @param value * allowed object is * {@link EmptyType } * */ public void setCascadePersist(EmptyType value) { this.cascadePersist = value; } /** * Gets the value of the cascadeMerge property. * * @return * possible object is * {@link EmptyType } * */ public EmptyType getCascadeMerge() { return cascadeMerge; } /** * Sets the value of the cascadeMerge property. * * @param value * allowed object is * {@link EmptyType } * */ public void setCascadeMerge(EmptyType value) { this.cascadeMerge = value; } /** * Gets the value of the cascadeRemove property. * * @return * possible object is * {@link EmptyType } * */ public EmptyType getCascadeRemove() { return cascadeRemove; } /** * Sets the value of the cascadeRemove property. * * @param value * allowed object is * {@link EmptyType } * */ public void setCascadeRemove(EmptyType value) { this.cascadeRemove = value; } /** * Gets the value of the cascadeRefresh property. * * @return * possible object is * {@link EmptyType } * */ public EmptyType getCascadeRefresh() { return cascadeRefresh; } /** * Sets the value of the cascadeRefresh property. * * @param value * allowed object is * {@link EmptyType } * */ public void setCascadeRefresh(EmptyType value) { this.cascadeRefresh = value; } /** * Gets the value of the cascadeDetach property. * * @return * possible object is * {@link EmptyType } * */ public EmptyType getCascadeDetach() { return cascadeDetach; } /** * Sets the value of the cascadeDetach property. * * @param value * allowed object is * {@link EmptyType } * */ public void setCascadeDetach(EmptyType value) { this.cascadeDetach = value; } }
'use strict'; /** * @ngdoc controller * @name workspaces.list.controller:WorkspaceItemCtrl * @description This class is handling the controller for item of workspace list * @author Ann Shumilova */ export class WorkspaceItemCtrl { /** * Default constructor that is using resource * @ngInject for Dependency injection */ constructor($location, lodash, cheWorkspace) { this.$location = $location; this.lodash = lodash; this.cheWorkspace = cheWorkspace; } <API key>() { this.$location.path('/workspace/' + this.workspace.namespace +'/' + this.workspace.config.name); } <API key>(workspace) { let environments = workspace.config.environments; let envName = workspace.config.defaultEnv; let defaultEnvironment = environments[envName]; return defaultEnvironment; } getMemoryLimit(workspace) { if (workspace.runtime && workspace.runtime.machines && workspace.runtime.machines.length > 0) { let limits = this.lodash.pluck(workspace.runtime.machines, 'config.limits.ram'); let total = 0; limits.forEach((limit) => { total += limit; }); return total + ' MB'; } let environment = this.<API key>(workspace); if (environment) { let limits = this.lodash.pluck(environment.machines, 'attributes.memoryLimitBytes'); let total = 0; limits.forEach((limit) => { if (limit) { total += limit / (1024*1024); } }); return (total > 0) ? total + ' MB' : '-'; } return '-'; } /** * Returns current status of workspace * @returns {String} */ getWorkspaceStatus() { let workspace = this.cheWorkspace.getWorkspaceById(this.workspace.id); return workspace ? workspace.status : 'unknown'; } }
package org.eclipse.che.ide.workspace; import com.google.gwt.core.client.Callback; import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; import com.google.web.bindery.event.shared.EventBus; import org.eclipse.che.api.core.model.workspace.WorkspaceStatus; import org.eclipse.che.api.factory.shared.dto.Factory; import org.eclipse.che.api.promises.client.Function; import org.eclipse.che.api.promises.client.FunctionException; import org.eclipse.che.api.promises.client.Operation; import org.eclipse.che.api.promises.client.OperationException; import org.eclipse.che.api.promises.client.Promise; import org.eclipse.che.api.promises.client.PromiseError; import org.eclipse.che.api.workspace.shared.dto.WorkspaceDto; import org.eclipse.che.ide.<API key>; import org.eclipse.che.ide.api.app.AppContext; import org.eclipse.che.ide.api.component.Component; import org.eclipse.che.ide.api.dialogs.DialogFactory; import org.eclipse.che.ide.api.factory.<API key>; import org.eclipse.che.ide.api.machine.MachineManager; import org.eclipse.che.ide.api.notification.NotificationManager; import org.eclipse.che.ide.api.preferences.PreferencesManager; import org.eclipse.che.ide.api.workspace.<API key>; import org.eclipse.che.ide.collections.Jso; import org.eclipse.che.ide.collections.js.JsoArray; import org.eclipse.che.ide.context.AppContextImpl; import org.eclipse.che.ide.context.<API key>; import org.eclipse.che.ide.dto.DtoFactory; import org.eclipse.che.ide.rest.<API key>; import org.eclipse.che.ide.ui.loaders.initialization.InitialLoadingInfo; import org.eclipse.che.ide.ui.loaders.initialization.LoaderPresenter; import org.eclipse.che.ide.util.loging.Log; import org.eclipse.che.ide.websocket.MessageBusProvider; import org.eclipse.che.ide.workspace.create.<API key>; import org.eclipse.che.ide.workspace.start.<API key>; import java.util.HashMap; import java.util.Map; import static org.eclipse.che.api.core.model.workspace.WorkspaceStatus.RUNNING; import static org.eclipse.che.ide.api.notification.StatusNotification.DisplayMode.FLOAT_MODE; import static org.eclipse.che.ide.api.notification.StatusNotification.Status.FAIL; /** * Retrieves specified factory, and reuse previously created workspace for this factory. * * @author Max Shaposhnik * @author Florent Benoit */ @Singleton public class <API key> extends WorkspaceComponent { private final <API key> <API key>; private String workspaceId; @Inject public <API key>(<API key> <API key>, <API key> <API key>, <API key> <API key>, <API key> <API key>, <API key> locale, <API key> <API key>, EventBus eventBus, LoaderPresenter loader, AppContext appContext, Provider<MachineManager> <API key>, NotificationManager notificationManager, MessageBusProvider messageBusProvider, <API key> <API key>, DialogFactory dialogFactory, PreferencesManager preferencesManager, DtoFactory dtoFactory, InitialLoadingInfo initialLoadingInfo, <API key> <API key>) { super(<API key>, <API key>, <API key>, locale, <API key>, eventBus, loader, appContext, <API key>, notificationManager, messageBusProvider, <API key>, dialogFactory, preferencesManager, dtoFactory, initialLoadingInfo, <API key>); this.<API key> = <API key>; } @Override public void start(final Callback<Component, Exception> callback) { this.callback = callback; Jso factoryParams = <API key>.getParameters(); JsoArray<String> keys = factoryParams.getKeys(); Map<String, String> factoryParameters = new HashMap<>(); // check all factory parameters for (String key : keys.toList()) { if (key.startsWith("factory-")) { String value = factoryParams.getStringField(key); factoryParameters.put(key.substring("factory-".length()), value); } } // get workspace ID to use dedicated workspace for this factory this.workspaceId = <API key>.<API key>("workspaceId"); Promise<Factory> factoryPromise; // now search if it's a factory based on id or from parameters if (factoryParameters.containsKey("id")) { factoryPromise = <API key>.getFactory(factoryParameters.get("id"), true); } else { factoryPromise = <API key>.resolveFactory(factoryParameters, true); } factoryPromise.then(new Function<Factory, Void>() { @Override public Void apply(final Factory factory) throws FunctionException { if (appContext instanceof AppContextImpl) { ((AppContextImpl)appContext).setFactory(factory); } // get workspace tryStartWorkspace(); return null; } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError error) throws OperationException { Log.error(<API key>.class, "Unable to load Factory", error); callback.onFailure(new Exception(error.getCause())); } }); } @Override public void tryStartWorkspace() { if (this.workspaceId == null) { notificationManager.notify(locale.failedToLoadFactory(), locale.<API key>(), FAIL, FLOAT_MODE); return; } getWorkspaceToStart().then(<API key>()).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { notificationManager.notify(locale.workspaceNotReady(workspaceId), locale.workspaceGetFailed(), FAIL, FLOAT_MODE); Log.error(getClass(), arg.getMessage()); } }); } /** * Checks if specified workspace has {@link WorkspaceStatus} which is {@code RUNNING} */ protected Operation<WorkspaceDto> <API key>() { return new Operation<WorkspaceDto>() { @Override public void apply(WorkspaceDto workspace) throws OperationException { if (!RUNNING.equals(workspace.getStatus())) { notificationManager.notify(locale.failedToLoadFactory(), locale.workspaceNotRunning(), FAIL, FLOAT_MODE); throw new OperationException(locale.workspaceNotRunning()); } else { startWorkspace().apply(workspace); } } }; } /** * Gets {@link Promise} of workspace according to workspace ID specified in parameter. */ private Promise<WorkspaceDto> getWorkspaceToStart() { // get workspace from the given id return this.<API key>.getWorkspace(workspaceId); } }
package de.cooperateproject.modeling.textual.component.derivedstate.remover; import static de.cooperateproject.modeling.textual.xtext.runtime.derivedstate.initializer.<API key>.CLEANING; import java.util.Optional; import org.eclipse.uml2.uml.<API key>; import de.cooperateproject.modeling.textual.component.component.Classifier; import de.cooperateproject.modeling.textual.component.component.ComponentPackage; import de.cooperateproject.modeling.textual.component.component.Generalization; import de.cooperateproject.modeling.textual.xtext.runtime.derivedstate.initializer.Applicability; import de.cooperateproject.modeling.textual.xtext.runtime.derivedstate.initializer.<API key>; /** * State remover for {@link TypedConnector} elements. */ @Applicability(applicabilities = CLEANING) public class <API key> extends <API key><Generalization> { /** * Instantiates the remover. */ @SuppressWarnings("unchecked") public <API key>() { super((Class<Generalization>) (Class<?>) Generalization.class); } @Override protected void applyTyped(Generalization object) { if (object.<API key>() != null) { if (Optional.ofNullable(object.getLeftClassifier()).map(Classifier::<API key>) .equals(Optional.ofNullable(object.<API key>()).map(<API key>::getSources) .flatMap(l -> l.stream().findFirst()))) { object.eUnset(ComponentPackage.Literals.<API key>); } if (Optional.ofNullable(object.getRightClassifier()).map(Classifier::<API key>) .equals(Optional.ofNullable(object.<API key>()).map(<API key>::getTargets) .flatMap(l -> l.stream().findFirst()))) { object.eUnset(ComponentPackage.Literals.<API key>); } } } }
package org.eclipse.hawkbit.ui.distributions.dstable; import org.eclipse.hawkbit.repository.<API key>; import org.eclipse.hawkbit.repository.builder.<API key>; import org.eclipse.hawkbit.repository.model.DistributionSet; import org.eclipse.hawkbit.ui.common.<API key>; import org.eclipse.hawkbit.ui.common.<API key>; import org.eclipse.hawkbit.ui.common.EntityWindowLayout; import org.eclipse.hawkbit.ui.common.data.proxies.<API key>; import org.eclipse.hawkbit.ui.common.data.proxies.<API key>; import org.eclipse.hawkbit.ui.utils.HawkbitCommonUtil; import org.springframework.util.StringUtils; /** * Controller for update distribution set window */ public class <API key> extends <API key><<API key>, <API key>, DistributionSet> { private final <API key> dsManagement; private final DsWindowLayout layout; private final ProxyDsValidator validator; private String nameBeforeEdit; private String versionBeforeEdit; /** * Constructor for <API key> * * @param uiDependencies * {@link <API key>} * @param dsManagement * <API key> * @param layout * DsWindowLayout */ public <API key>(final <API key> uiDependencies, final <API key> dsManagement, final DsWindowLayout layout) { super(uiDependencies); this.dsManagement = dsManagement; this.layout = layout; this.validator = new ProxyDsValidator(uiDependencies); } @Override protected <API key> <API key>(final <API key> proxyEntity) { final <API key> ds = new <API key>(); ds.setId(proxyEntity.getId()); ds.setTypeInfo(proxyEntity.getTypeInfo()); ds.setName(proxyEntity.getName()); ds.setVersion(proxyEntity.getVersion()); ds.setDescription(proxyEntity.getDescription()); ds.<API key>(proxyEntity.<API key>()); nameBeforeEdit = proxyEntity.getName(); versionBeforeEdit = proxyEntity.getVersion(); return ds; } @Override public EntityWindowLayout<<API key>> getLayout() { return layout; } @Override protected void adaptLayout(final <API key> proxyEntity) { layout.disableDsTypeSelect(); } @Override protected DistributionSet <API key>(final <API key> entity) { final <API key> dsUpdate = getEntityFactory().distributionSet().update(entity.getId()) .name(entity.getName()).version(entity.getVersion()).description(entity.getDescription()) .<API key>(entity.<API key>()); return dsManagement.update(dsUpdate); } @Override protected String getDisplayableName(final DistributionSet entity) { return HawkbitCommonUtil.<API key>(entity.getName(), entity.getVersion()); } @Override protected String <API key>(final <API key> entity) { return HawkbitCommonUtil.<API key>(entity.getName(), entity.getVersion()); } @Override protected Class<? extends <API key>> getEntityClass() { return <API key>.class; } @Override protected boolean isEntityValid(final <API key> entity) { final String trimmedName = StringUtils.trimWhitespace(entity.getName()); final String trimmedVersion = StringUtils.trimWhitespace(entity.getVersion()); return validator.isEntityValid(entity, () -> <API key>(trimmedName, trimmedVersion) && dsManagement.getByNameAndVersion(trimmedName, trimmedVersion).isPresent()); } private boolean <API key>(final String trimmedName, final String trimmedVersion) { return !nameBeforeEdit.equals(trimmedName) || !versionBeforeEdit.equals(trimmedVersion); } }
package seg.jUCMNav.model.commands.delete.internal; import org.eclipse.gef.commands.Command; import seg.jUCMNav.model.commands.JUCMNavCommand; import urn.URNspec; import urncore.Component; /** * Command to delete a Component. (Remove it from the model). Can only do it if it has no references. * * @author jkealey * */ public class <API key> extends Command implements JUCMNavCommand { // the component definition to delete private Component compDef; // the URNspec in which it is contained private URNspec urn; public <API key>(Component cd) { setCompDef(cd); setLabel("Delete Component"); //$NON-NLS-1$ } /** * Only if not referenced. * * @see org.eclipse.gef.commands.Command#canExecute() */ public boolean canExecute() { return getCompDef() != null; } /** * @see org.eclipse.gef.commands.Command#execute() */ public void execute() { // also set the relations urn = getCompDef().getUrndefinition().getUrnspec(); redo(); } /** * @return the component definition to delete */ public Component getCompDef() { return compDef; } /** * @see org.eclipse.gef.commands.Command#redo() */ public void redo() { testPreConditions(); // break relations and remove compDef urn.getUrndef().getComponents().remove(getCompDef()); testPostConditions(); } /** * * @param compDef * the component definition to delete. */ public void setCompDef(Component compDef) { this.compDef = compDef; } /** * @see seg.jUCMNav.model.commands.JUCMNavCommand#testPostConditions() */ public void testPostConditions() { // lists could be empty but not null assert getCompDef() != null && urn != null : "post something is null"; //$NON-NLS-1$ assert getCompDef().getContRefs().size() == 0 : "post there are still children"; //$NON-NLS-1$ assert !urn.getUrndef().getComponents().contains(getCompDef()) : "post component element still in model"; //$NON-NLS-1$ } /** * @see seg.jUCMNav.model.commands.JUCMNavCommand#testPreConditions() */ public void testPreConditions() { // lists could be empty but not null assert getCompDef() != null && urn != null : "pre something is null"; //$NON-NLS-1$ assert getCompDef().getContRefs().size() == 0 : "pre can't delete if still referenced."; //$NON-NLS-1$ assert urn.getUrndef().getComponents().contains(getCompDef()) : "pre component element in model"; //$NON-NLS-1$ } /** * * @see org.eclipse.gef.commands.Command#undo() */ public void undo() { testPostConditions(); // re-add compDef urn.getUrndef().getComponents().add(getCompDef()); testPreConditions(); } }
package org.python.pydev.shared_core.index; import java.util.HashSet; import java.util.Set; import org.python.pydev.shared_core.partitioner.IToken; class StaticInit { static Set<String> createFieldsNegated() { Set<String> set = new HashSet<String>(); set.add(IFields.FILEPATH); set.add(IFields.MODULE_PATH); set.add(IFields.FILENAME); set.add(IFields.EXTENSION); set.add(IFields.MODIFIED_TIME); return set; } }; public interface IFields { // Metadata public static String FILEPATH = "filepath"; public static String MODULE_PATH = "module_path"; public static String FILENAME = "filename"; public static String EXTENSION = "ext"; public static String MODIFIED_TIME = "mod_time"; // Content-related public static String PYTHON = "python"; public static String COMMENT = "comment"; public static String STRING = "string"; public static String GENERAL_CONTENTS = "contents"; String getTokenFieldName(IToken nextToken); public static Set<String> <API key> = StaticInit.createFieldsNegated(); }
package org.jboss.forge.addon.configuration; import javax.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.forge.arquillian.AddonDependencies; import org.jboss.forge.arquillian.AddonDependency; import org.jboss.forge.arquillian.archive.AddonArchive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(Arquillian.class) public class <API key> { @Deployment @AddonDependencies({ @AddonDependency(name = "org.jboss.forge.furnace.container:cdi"), @AddonDependency(name = "org.jboss.forge.addon:configuration") }) public static AddonArchive getDeployment() { return ShrinkWrap.create(AddonArchive.class).addBeansXML(); } @Inject private Configuration userConfiguration; @Test public void <API key>() { userConfiguration.setProperty("key", "value"); Assert.assertEquals("value", userConfiguration.getString("key")); } @Test public void <API key>() { Configuration subset = userConfiguration.subset("subset-1"); subset.setProperty("key", "value"); Assert.assertEquals("value", userConfiguration.subset("subset-1").getString("key")); subset.setProperty("another-key", 123L); Assert.assertEquals(123L, userConfiguration.subset("subset-1").getLong("another-key")); } }
/* Include files */ #include "<API key>.h" #include "<API key>.h" #include "<API key>.h" #include "<API key>.h" /* Type Definitions */ /* Named Constants */ /* Variable Declarations */ /* Variable Definitions */ uint32_T <API key>; real_T _sfTime_; /* Function Declarations */ /* Function Definitions */ void <API key>(void) { } void <API key>(void) { } /* SFunction Glue Code */ unsigned int <API key>(SimStruct *simstructPtr, unsigned int chartFileNumber, const char* specsCksum, int_T method, void *data) { if (chartFileNumber==1) { <API key>(simstructPtr, method, data); return 1; } if (chartFileNumber==2) { <API key>(simstructPtr, method, data); return 1; } return 0; } unsigned int <API key>( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] ) { #ifdef MATLAB_MEX_FILE char commandName[20]; if (nrhs<1 || !mxIsChar(prhs[0]) ) return 0; /* Possible call to get the checksum */ mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char)); commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0'; if (strcmp(commandName,"sf_get_check_sum")) return 0; plhs[0] = <API key>( 1,4,mxREAL); if (nrhs>1 && mxIsChar(prhs[1])) { mxGetString(prhs[1], commandName,sizeof(commandName)/sizeof(char)); commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0'; if (!strcmp(commandName,"machine")) { ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(941308805U); ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(646878916U); ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1438773747U); ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(236087398U); } else if (!strcmp(commandName,"exportedFcn")) { ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(0U); ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(0U); ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(0U); ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(0U); } else if (!strcmp(commandName,"makefile")) { ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(2520643153U); ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3775692023U); ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(2618684608U); ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(613100348U); } else if (nrhs==3 && !strcmp(commandName,"chart")) { unsigned int chartFileNumber; chartFileNumber = (unsigned int)mxGetScalar(prhs[2]); switch (chartFileNumber) { case 1: { extern void <API key>(mxArray *plhs[]); <API key>(plhs); break; } case 2: { extern void <API key>(mxArray *plhs[]); <API key>(plhs); break; } default: ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(0.0); ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(0.0); ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(0.0); ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(0.0); } } else if (!strcmp(commandName,"target")) { ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(3564696471U); ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(678668628U); ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1090454852U); ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(3896867807U); } else { return 0; } } else { ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(756207404U); ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(2359079924U); ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(3125711712U); ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(1456838169U); } return 1; #else return 0; #endif } unsigned int <API key>( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] ) { #ifdef MATLAB_MEX_FILE char commandName[32]; char aiChksum[64]; if (nrhs<3 || !mxIsChar(prhs[0]) ) return 0; /* Possible call to get the <API key> */ mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char)); commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0'; if (strcmp(commandName,"<API key>")) return 0; mxGetString(prhs[2], aiChksum,sizeof(aiChksum)/sizeof(char)); aiChksum[(sizeof(aiChksum)/sizeof(char)-1)] = '\0'; { unsigned int chartFileNumber; chartFileNumber = (unsigned int)mxGetScalar(prhs[1]); switch (chartFileNumber) { case 1: { if (strcmp(aiChksum, "<API key>") == 0) { extern mxArray *<API key>(void); plhs[0] = <API key>(); break; } plhs[0] = <API key>(0,0,mxREAL); break; } case 2: { if (strcmp(aiChksum, "<API key>") == 0) { extern mxArray *<API key>(void); plhs[0] = <API key>(); break; } plhs[0] = <API key>(0,0,mxREAL); break; } default: plhs[0] = <API key>(0,0,mxREAL); } } return 1; #else return 0; #endif } unsigned int <API key>( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] ) { #ifdef MATLAB_MEX_FILE char commandName[64]; if (nrhs<2 || !mxIsChar(prhs[0])) return 0; /* Possible call to get the <API key> */ mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char)); commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0'; if (strcmp(commandName,"<API key>")) return 0; { unsigned int chartFileNumber; chartFileNumber = (unsigned int)mxGetScalar(prhs[1]); switch (chartFileNumber) { case 1: { extern const mxArray *<API key>(void); mxArray *persistentMxArray = (mxArray *) <API key>(); plhs[0] = mxDuplicateArray(persistentMxArray); mxDestroyArray(persistentMxArray); break; } case 2: { extern const mxArray *<API key>(void); mxArray *persistentMxArray = (mxArray *) <API key>(); plhs[0] = mxDuplicateArray(persistentMxArray); mxDestroyArray(persistentMxArray); break; } default: plhs[0] = <API key>(0,0,mxREAL); } } return 1; #else return 0; #endif } unsigned int <API key>( int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[] ) { char commandName[64]; char tpChksum[64]; if (nrhs<3 || !mxIsChar(prhs[0])) return 0; /* Possible call to get the <API key> */ mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char)); commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0'; mxGetString(prhs[2], tpChksum,sizeof(tpChksum)/sizeof(char)); tpChksum[(sizeof(tpChksum)/sizeof(char)-1)] = '\0'; if (strcmp(commandName,"<API key>")) return 0; { unsigned int chartFileNumber; chartFileNumber = (unsigned int)mxGetScalar(prhs[1]); switch (chartFileNumber) { case 1: { if (strcmp(tpChksum, "<API key>") == 0) { extern mxArray *<API key> (void); plhs[0] = <API key>(); break; } } case 2: { if (strcmp(tpChksum, "<API key>") == 0) { extern mxArray *<API key> (void); plhs[0] = <API key>(); break; } } default: plhs[0] = <API key>(0,0,mxREAL); } } return 1; } void <API key>(struct <API key>* debugInstance) { <API key> = <API key> (debugInstance,"<API key>","sfun",0,2,0,0,0); <API key>(debugInstance, <API key>,0,0); <API key>(debugInstance, <API key>,0); } void <API key>(SimStruct* S) { } static mxArray* <API key>= NULL; mxArray* <API key>(void) { if (<API key>==NULL) { <API key> = <API key>( "<API key>", "<API key>"); <API key>(<API key>); } return(<API key>); } void <API key>(void) { if (<API key>!=NULL) { mxDestroyArray(<API key>); <API key> = NULL; } }
package org.eclipse.kapua.qa.common; import org.eclipse.kapua.commons.util.ThrowingRunnable; import org.eclipse.kapua.locator.KapuaLocator; import org.eclipse.kapua.service.authentication.<API key>; import org.eclipse.kapua.service.authentication.LoginCredentials; import org.eclipse.kapua.service.device.registry.Device; import org.eclipse.kapua.service.device.registry.<API key>; import org.eclipse.kapua.service.user.User; import org.eclipse.kapua.service.user.UserService; import org.junit.Assert; public final class With { private With() { } public static void withLogin(final LoginCredentials credentials, final ThrowingRunnable runnable) throws Exception { final <API key> service = KapuaLocator.getInstance().getService(<API key>.class); try { service.login(credentials); runnable.run(); } finally { service.logout(); } } public static void withUserAccount(final String accountName, final ThrowingConsumer<User> consumer) throws Exception { final UserService userService = KapuaLocator.getInstance().getService(UserService.class); final User account = userService.findByName(accountName); Assert.assertNotNull(String.format("Account %s should be found", accountName), account); consumer.accept(account); } public static void withDevice(final User account, final String clientId, final ThrowingConsumer<Device> consumer) throws Exception { <API key> service = KapuaLocator.getInstance().getService(<API key>.class); Device device = service.findByClientId(account.getId(), clientId); Assert.assertNotNull("Device should not be null", device); consumer.accept(device); } }
package com.ibm.ws.lars.testutils; import static org.junit.Assert.fail; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Reader; import java.util.List; /** * Launches a program, providing options for checking its output and return code. * <p> * Note there is no timeout and the output from the program is stored in a buffer so it is not * suitable for testing programs with a very large output or which may hang. */ public class TestProcess { private static final String NOT_YET_RUN = "Cannot check output before program has been run"; private final ProcessBuilder processBuilder; private Process process; private String systemInput; private StringBuilder outputBuilder; private StringBuilder errorBuilder; private Integer returnCode; /** * Set up the TestProcess * * @param commandLine the command line (program followed by arguments) to execute */ public TestProcess(List<String> commandLine) { processBuilder = new ProcessBuilder(commandLine); returnCode = null; } /** * Set up the TestProcess * * @param commandLine the command line (program followed by arguments) to execute * @param systemInput the system input to be read during execution of the process */ public TestProcess(List<String> commandLine, String systemInput) { this(commandLine); this.systemInput = systemInput; } /** * Run the program passed in the constructor and wait for it to finish * * @throws IOException if any exceptions are thrown when starting or reading from the process */ public void run() throws IOException { process = processBuilder.start(); outputBuilder = new StringBuilder(); errorBuilder = new StringBuilder(); if (systemInput != null) { OutputStreamWriter osw = new OutputStreamWriter(process.getOutputStream()); osw.write(systemInput); osw.flush(); } ProcessStreamReader outReader = new ProcessStreamReader(process.getInputStream(), outputBuilder); new Thread(outReader).start(); ProcessStreamReader errReader = new ProcessStreamReader(process.getErrorStream(), errorBuilder); new Thread(errReader).start(); while (true) { try { returnCode = process.waitFor(); break; } catch (<API key> e) { } } if (outReader.getException() != null) { throw outReader.getException(); } if (errReader.getException() != null) { throw errReader.getException(); } } /** * Assert that the program wrote the given string to stdout * <p> * This can only be called after calling <code>run</code> * * @param string the string to look for */ public void <API key>(String string) { if (returnCode == null) { fail(NOT_YET_RUN); } if (outputBuilder.indexOf(string) == -1) { fail("Program output did not contain " + string + "\n" + "Actual output:\n" + outputBuilder.toString()); } } /** * Assert that the program wrote the given string to stderr * <p> * This can only be called after calling <code>run</code> * * @param string the string to look for */ public void assertErrorContains(String string) { if (returnCode == null) { fail(NOT_YET_RUN); } if (errorBuilder.indexOf(string) == -1) { fail("Program error output did not contain " + string + "\n" + "Actual output:\n" + errorBuilder.toString()); } } public String getOutput() { if (returnCode == null) { fail(NOT_YET_RUN); } return outputBuilder.toString(); } /** * Assert that the program exited with the given return code * <p> * This can only be called after calling <code>run</code> * * @param returnCode the return code */ public void assertReturnCode(int returnCode) { if (this.returnCode == null) { fail("Cannot check return code before program has been run"); } if (this.returnCode.intValue() != returnCode) { fail("Incorrect return code, expected <" + returnCode + "> but was <" + this.returnCode + ">\n" + "Program output:\n" + outputBuilder.toString() + "\n" + "Program error output:\n" + errorBuilder.toString() + "\n"); } } /** * Handles reading from an input stream into a string builder */ private class ProcessStreamReader implements Runnable { private final Reader in; private final StringBuilder out; private IOException ex; public ProcessStreamReader(InputStream in, StringBuilder out) { this.in = new BufferedReader(new InputStreamReader(in)); this.out = out; ex = null; } /** {@inheritDoc} */ @Override public void run() { try { char[] buffer = new char[1024]; int length; while ((length = in.read(buffer)) != -1) { out.append(buffer, 0, length); } } catch (IOException e) { this.ex = e; } } public IOException getException() { return ex; } } }
package org.openhab.binding.tradfri.internal.model; import static org.openhab.binding.tradfri.internal.<API key>.*; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.openhab.core.library.types.PercentType; import com.google.gson.JsonElement; import com.google.gson.JsonPrimitive; /** * The {@link TradfriBlindData} class is a Java wrapper for the raw JSON data about the blinds state. * * @author Manuel Raffel - Initial contribution */ @NonNullByDefault public class TradfriBlindData extends <API key> { public TradfriBlindData() { super(BLINDS); } public TradfriBlindData(JsonElement json) { super(BLINDS, json); } public TradfriBlindData setPosition(PercentType position) { attributes.add(POSITION, new JsonPrimitive(position.intValue())); return this; } public TradfriBlindData stop() { attributes.add(STOP_TRIGGER, new JsonPrimitive(0)); return this; } public @Nullable PercentType getPosition() { PercentType result = null; JsonElement position = attributes.get(POSITION); if (position != null) { int percent = position.getAsInt(); percent = Math.max(percent, 0); percent = Math.min(100, percent); result = new PercentType(percent); } return result; } public String getJsonString() { return root.toString(); } }
package io.openliberty.microprofile.faulttolerance30.internal.metrics.integration; import static com.ibm.ws.microprofile.faulttolerance.spi.MetricRecorder.FallbackOccurred.NO_FALLBACK; import static com.ibm.ws.microprofile.faulttolerance.spi.MetricRecorder.FallbackOccurred.WITH_FALLBACK; import static com.ibm.ws.microprofile.faulttolerance.spi.MetricRecorder.RetriesOccurred.NO_RETRIES; import static com.ibm.ws.microprofile.faulttolerance.spi.MetricRecorder.RetriesOccurred.WITH_RETRIES; import static com.ibm.ws.microprofile.faulttolerance.spi.RetryResultCategory.<API key>; import static com.ibm.ws.microprofile.faulttolerance.spi.RetryResultCategory.<API key>; import static com.ibm.ws.microprofile.faulttolerance.spi.RetryResultCategory.<API key>; import static com.ibm.ws.microprofile.faulttolerance.spi.RetryResultCategory.MAX_RETRIES_REACHED; import static com.ibm.ws.microprofile.faulttolerance.spi.RetryResultCategory.NO_EXCEPTION; import static org.eclipse.microprofile.metrics.MetricType.COUNTER; import java.util.EnumMap; import java.util.function.LongSupplier; import org.eclipse.microprofile.metrics.Counter; import org.eclipse.microprofile.metrics.Gauge; import org.eclipse.microprofile.metrics.Histogram; import org.eclipse.microprofile.metrics.Metadata; import org.eclipse.microprofile.metrics.MetricRegistry; import org.eclipse.microprofile.metrics.MetricType; import org.eclipse.microprofile.metrics.MetricUnits; import org.eclipse.microprofile.metrics.Tag; import com.ibm.websphere.ras.annotation.Trivial; import com.ibm.ws.ffdc.annotation.FFDCIgnore; import com.ibm.ws.microprofile.faulttolerance.spi.BulkheadPolicy; import com.ibm.ws.microprofile.faulttolerance.spi.<API key>; import com.ibm.ws.microprofile.faulttolerance.spi.FallbackPolicy; import com.ibm.ws.microprofile.faulttolerance.spi.MetricRecorder; import com.ibm.ws.microprofile.faulttolerance.spi.<API key>.AsyncType; import com.ibm.ws.microprofile.faulttolerance.spi.RetryPolicy; import com.ibm.ws.microprofile.faulttolerance.spi.RetryResultCategory; import com.ibm.ws.microprofile.faulttolerance.spi.TimeoutPolicy; /** * Records Fault Tolerance metrics for the FT 3.0 spec * <p> * The FT 3.0 spec changes from using lots of separate metrics to using fewer metrics but storing multiple values by using tags. * From a recording perspective, this introduces very little change as we just treat each combination of name and tag as a separate metric. * <p> * This class initializes all of the metrics for the method up front in the constructor and stores them in fields so that we don't have to register or look up metrics while the * method is running. * <p> * In some cases, where a metric has tags with lots of values, we use an EnumSet to store the metrics for each tag combination. * <p> * In other cases, where a metric has few or no possible tag values, we just use a separate field for each tag combination. */ public class <API key> implements MetricRecorder { /** * Constant map from a {@link RetryResultCategory} to its corresponding metric {@link Tag} */ private static final EnumMap<RetryResultCategory, Tag> RETRY_RESULT_TAGS = new EnumMap<>(RetryResultCategory.class); /** * Constant map from a {@link RetriesOccurred} to its corresponding metric {@link Tag} */ private static final EnumMap<RetriesOccurred, Tag> <API key> = new EnumMap<>(RetriesOccurred.class); static { RETRY_RESULT_TAGS.put(NO_EXCEPTION, new Tag("retryResult", "valueReturned")); RETRY_RESULT_TAGS.put(<API key>, new Tag("retryResult", "<API key>")); RETRY_RESULT_TAGS.put(<API key>, new Tag("retryResult", "<API key>")); RETRY_RESULT_TAGS.put(<API key>, new Tag("retryResult", "maxDurationReached")); RETRY_RESULT_TAGS.put(MAX_RETRIES_REACHED, new Tag("retryResult", "maxRetriesReached")); <API key>.put(WITH_RETRIES, new Tag("retried", "true")); <API key>.put(NO_RETRIES, new Tag("retried", "false")); } private final EnumMap<FallbackOccurred, Counter> <API key>; private final EnumMap<FallbackOccurred, Counter> <API key>; private final EnumMap<RetryResultCategory, EnumMap<RetriesOccurred, Counter>> retryCallsCounter; private final Counter retryRetriesCounter; private final Histogram <API key>; private final Counter timeoutTrueCalls; private final Counter timeoutFalseCalls; private final Counter <API key>; private final Counter <API key>; private final Counter <API key>; @SuppressWarnings("unused") private final Gauge<Long> <API key>; @SuppressWarnings("unused") private final Gauge<Long> <API key>; @SuppressWarnings("unused") private final Gauge<Long> <API key>; private final Counter <API key>; @SuppressWarnings("unused") private final Gauge<Long> <API key>; private final Counter <API key>; private final Counter <API key>; private final Histogram <API key>; @SuppressWarnings("unused") private final Gauge<Long> <API key>; private final Histogram <API key>; private LongSupplier <API key> = null; private LongSupplier <API key> = null; /* * Fields storing required state for circuit breaker metrics */ private long openNanos; private long halfOpenNanos; private long closedNanos; private CircuitBreakerState circuitBreakerState = CircuitBreakerState.CLOSED; protected long <API key>; private enum CircuitBreakerState { CLOSED, HALF_OPEN, OPEN } public <API key>(String methodName, MetricRegistry registry, RetryPolicy retryPolicy, <API key> <API key>, TimeoutPolicy timeoutPolicy, BulkheadPolicy bulkheadPolicy, FallbackPolicy fallbackPolicy, AsyncType isAsync) { /* * Register all of the metrics required for this method and store them in fields */ // Every metric uses this tag to identify the method it's reporting metrics for Tag methodTag = new Tag("method", methodName); if (retryPolicy != null || timeoutPolicy != null || <API key> != null || bulkheadPolicy != null || fallbackPolicy != null) { Metadata invocationsMetadata = Metadata.builder().withName("ft.invocations.total").withType(COUNTER).build(); Tag valueReturnedTag = new Tag("result", "valueReturned"); Tag exceptionThrownTag = new Tag("result", "exceptionThrown"); <API key> = new EnumMap<>(FallbackOccurred.class); <API key> = new EnumMap<>(FallbackOccurred.class); if (fallbackPolicy != null) { // If there's a fallback policy we need four metrics to cover the combinations of // fallback = [applied|notApplied] and result = [valueReturned|exceptionThrown] Tag withFallbackTag = new Tag("fallback", "applied"); Tag withoutFallbackTag = new Tag("fallback", "notApplied"); <API key>.put(NO_FALLBACK, registry.counter(invocationsMetadata, methodTag, valueReturnedTag, withoutFallbackTag)); <API key>.put(WITH_FALLBACK, registry.counter(invocationsMetadata, methodTag, valueReturnedTag, withFallbackTag)); <API key>.put(NO_FALLBACK, registry.counter(invocationsMetadata, methodTag, exceptionThrownTag, withoutFallbackTag)); <API key>.put(WITH_FALLBACK, registry.counter(invocationsMetadata, methodTag, exceptionThrownTag, withFallbackTag)); } else { // If there's no fallback, then we only need two metrics to cover the combinations of // fallback = [notDefined] and result = [valueReturned|exceptionThrown] Tag noFallbackTag = new Tag("fallback", "notDefined"); Counter invocationSuccess = registry.counter(invocationsMetadata, methodTag, valueReturnedTag, noFallbackTag); <API key>.put(NO_FALLBACK, invocationSuccess); <API key>.put(WITH_FALLBACK, invocationSuccess); Counter invocationFailed = registry.counter(invocationsMetadata, methodTag, exceptionThrownTag, noFallbackTag); <API key>.put(NO_FALLBACK, invocationFailed); <API key>.put(WITH_FALLBACK, invocationFailed); } } else { <API key> = null; <API key> = null; } if (retryPolicy != null) { retryCallsCounter = new EnumMap<>(RetryResultCategory.class); // Iterate through the combinations of retry tags, creating each counter for (RetryResultCategory resultCategory : RETRY_RESULT_TAGS.keySet()) { EnumMap<RetriesOccurred, Counter> submap = new EnumMap<>(RetriesOccurred.class); retryCallsCounter.put(resultCategory, submap); for (RetriesOccurred retriesOccurred : <API key>.keySet()) { submap.put(retriesOccurred, registry.counter("ft.retry.calls.total", methodTag, RETRY_RESULT_TAGS.get(resultCategory), <API key>.get(retriesOccurred))); } } retryRetriesCounter = registry.counter("ft.retry.retries.total", methodTag); } else { retryCallsCounter = null; retryRetriesCounter = null; } if (timeoutPolicy != null) { Metadata <API key> = Metadata.builder().withName("ft.timeout.executionDuration").withType(MetricType.HISTOGRAM).withUnit(MetricUnits.NANOSECONDS).build(); <API key> = registry.histogram(<API key>, methodTag); Metadata <API key> = Metadata.builder().withName("ft.timeout.calls.total").withType(COUNTER).build(); timeoutTrueCalls = registry.counter(<API key>, methodTag, new Tag("timedOut", "true")); timeoutFalseCalls = registry.counter(<API key>, methodTag, new Tag("timedOut", "false")); } else { <API key> = null; timeoutTrueCalls = null; timeoutFalseCalls = null; } if (<API key> != null) { Metadata cbCallsMetadata = Metadata.builder().withName("ft.circuitbreaker.calls.total").withType(COUNTER).build(); <API key> = registry.counter(cbCallsMetadata, methodTag, new Tag("<API key>", "failure")); <API key> = registry.counter(cbCallsMetadata, methodTag, new Tag("<API key>", "success")); <API key> = registry.counter(cbCallsMetadata, methodTag, new Tag("<API key>", "circuitBreakerOpen")); Metadata cbStateTimeMetadata = Metadata.builder().withName("ft.circuitbreaker.state.total").withType(MetricType.GAUGE).withUnit(MetricUnits.NANOSECONDS).build(); <API key> = gauge(registry, cbStateTimeMetadata, this::<API key>, methodTag, new Tag("state", "open")); <API key> = gauge(registry, cbStateTimeMetadata, this::<API key>, methodTag, new Tag("state", "halfOpen")); <API key> = gauge(registry, cbStateTimeMetadata, this::<API key>, methodTag, new Tag("state", "closed")); <API key> = registry.counter("ft.circuitbreaker.opened.total", methodTag); } else { <API key> = null; <API key> = null; <API key> = null; <API key> = null; <API key> = null; <API key> = null; <API key> = null; } if (bulkheadPolicy != null) { Metadata <API key> = Metadata.builder().withName("ft.bulkhead.calls.total").withType(COUNTER).build(); <API key> = registry.counter(<API key>, methodTag, new Tag("bulkheadResult", "accepted")); <API key> = registry.counter(<API key>, methodTag, new Tag("bulkheadResult", "rejected")); Metadata <API key> = Metadata.builder().withName("ft.bulkhead.executionsRunning").withType(MetricType.GAUGE).build(); <API key> = gauge(registry, <API key>, this::<API key>, methodTag); Metadata <API key> = Metadata.builder().withName("ft.bulkhead.runningDuration").withType(MetricType.HISTOGRAM).withUnit(MetricUnits.NANOSECONDS).build(); <API key> = registry.histogram(<API key>, methodTag); } else { <API key> = null; <API key> = null; <API key> = null; <API key> = null; } if (bulkheadPolicy != null && isAsync == AsyncType.ASYNC) { Metadata <API key> = Metadata.builder().withName("ft.bulkhead.executionsWaiting").withType(MetricType.GAUGE).build(); <API key> = gauge(registry, <API key>, this::getQueuePopulation, methodTag); Metadata <API key> = Metadata.builder().withName("ft.bulkhead.waitingDuration").withType(MetricType.HISTOGRAM).withUnit(MetricUnits.NANOSECONDS).build(); <API key> = registry.histogram(<API key>, methodTag); } else { <API key> = null; <API key> = null; } <API key> = System.nanoTime(); } /** {@inheritDoc} */ @Trivial @Override public void <API key>(FallbackOccurred fallbackOccurred) { if (<API key> != null) { <API key>.get(fallbackOccurred).inc(); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>(FallbackOccurred fallbackOccurred) { if (<API key> != null) { <API key>.get(fallbackOccurred).inc(); } } /** {@inheritDoc} */ @Trivial @Override public void incrementRetryCalls(RetryResultCategory resultCategory, RetriesOccurred retriesOccurred) { if (retryCallsCounter != null) { retryCallsCounter.get(resultCategory).get(retriesOccurred).inc(); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>() { if (retryRetriesCounter != null) { retryRetriesCounter.inc(); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>(long executionNanos) { if (<API key> != null) { <API key>.update(executionNanos); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>() { if (timeoutTrueCalls != null) { timeoutTrueCalls.inc(); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>() { if (timeoutFalseCalls != null) { timeoutFalseCalls.inc(); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>() { if (<API key> != null) { <API key>.inc(); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>() { if (<API key> != null) { <API key>.inc(); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>() { if (<API key> != null) { <API key>.inc(); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>() { if (<API key> != null) { <API key>.inc(); } } /** {@inheritDoc} */ @Trivial @Override public void <API key>() { if (<API key> != null) { <API key>.inc(); } } @Trivial @Override public synchronized void reportCircuitOpen() { if (circuitBreakerState != CircuitBreakerState.OPEN) { <API key>(circuitBreakerState); circuitBreakerState = CircuitBreakerState.OPEN; <API key>.inc(); } } /** {@inheritDoc} */ @Trivial @Override public synchronized void <API key>() { if (circuitBreakerState != CircuitBreakerState.HALF_OPEN) { <API key>(circuitBreakerState); circuitBreakerState = CircuitBreakerState.HALF_OPEN; } } @Trivial @Override public synchronized void reportCircuitClosed() { if (circuitBreakerState != CircuitBreakerState.CLOSED) { <API key>(circuitBreakerState); circuitBreakerState = CircuitBreakerState.CLOSED; } } @Trivial private void <API key>(CircuitBreakerState oldState) { long now = System.nanoTime(); switch (oldState) { case CLOSED: closedNanos += (now - <API key>); break; case HALF_OPEN: halfOpenNanos += (now - <API key>); break; case OPEN: openNanos += (now - <API key>); break; } <API key> = now; } @Trivial @Override public void reportQueueWaitTime(long queueWaitNanos) { if (<API key> != null) { <API key>.update(queueWaitNanos); } } @Trivial private synchronized long <API key>() { long computedNanos = openNanos; if (circuitBreakerState == CircuitBreakerState.OPEN) { computedNanos += System.nanoTime() - <API key>; } return computedNanos; } @Trivial private synchronized long <API key>() { long computedNanos = halfOpenNanos; if (circuitBreakerState == CircuitBreakerState.HALF_OPEN) { computedNanos += System.nanoTime() - <API key>; } return computedNanos; } @Trivial private synchronized long <API key>() { long computedNanos = closedNanos; if (circuitBreakerState == CircuitBreakerState.CLOSED) { computedNanos += System.nanoTime() - <API key>; } return computedNanos; } @Trivial private Long <API key>() { if (<API key> != null) { return <API key>.getAsLong(); } else { return 0L; } } /** {@inheritDoc} */ @Trivial @Override public void <API key>(LongSupplier <API key>) { this.<API key> = <API key>; } @Trivial private Long getQueuePopulation() { if (<API key> != null) { return <API key>.getAsLong(); } else { return 0L; } } /** {@inheritDoc} */ @Trivial @Override public void <API key>(LongSupplier <API key>) { this.<API key> = <API key>; } /** {@inheritDoc} */ @Trivial @Override public void <API key>(long executionTime) { if (<API key> != null) { <API key>.update(executionTime); } } @FFDCIgnore(<API key>.class) private Gauge<Long> gauge(MetricRegistry registry, Metadata gaugeMeta, Gauge<Long> supplier, Tag... tags) { Gauge<Long> result = null; try { result = registry.register(gaugeMeta, supplier, tags); } catch (<API key> ex) { // Thrown if metric already exists } return result; } }
package io.usethesource.vallang.basic; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ArgumentsSource; import io.usethesource.vallang.IConstructor; import io.usethesource.vallang.IMapWriter; import io.usethesource.vallang.INode; import io.usethesource.vallang.IValueFactory; import io.usethesource.vallang.ValueProvider; import io.usethesource.vallang.type.Type; import io.usethesource.vallang.type.TypeFactory; import io.usethesource.vallang.type.TypeStore; public final class EqualitySmokeTest { @ParameterizedTest @ArgumentsSource(ValueProvider.class) public void testInteger(IValueFactory vf) { assertTrue(vf.integer(0).equals(vf.integer(0))); assertFalse(vf.integer(0).equals(vf.integer(1))); } @ParameterizedTest @ArgumentsSource(ValueProvider.class) public void testDouble(IValueFactory vf) { assertTrue(vf.real(0.0).equals(vf.real(0.0))); assertTrue(vf.real(1.0).equals(vf.real(1.00000))); assertFalse(vf.real(0.0).equals(vf.real(1.0))); } @ParameterizedTest @ArgumentsSource(ValueProvider.class) public void testString(IValueFactory vf) { assertTrue(vf.string("").equals(vf.string(""))); assertTrue(vf.string("a").equals(vf.string("a"))); assertFalse(vf.string("a").equals(vf.string("b"))); } @ParameterizedTest @ArgumentsSource(ValueProvider.class) public void <API key>(IValueFactory vf, TypeFactory tf) { assertTrue(vf.list().getElementType().isSubtypeOf(tf.voidType())); assertTrue(vf.set().getElementType().isSubtypeOf(tf.voidType())); assertTrue(vf.map().getKeyType().isSubtypeOf(tf.voidType())); assertTrue(vf.map().getValueType().isSubtypeOf(tf.voidType())); assertTrue(vf.listWriter().done().getElementType().isSubtypeOf(tf.voidType())); assertTrue(vf.setWriter().done().getElementType().isSubtypeOf(tf.voidType())); assertTrue(vf.mapWriter().done().getKeyType().isSubtypeOf(tf.voidType())); assertTrue(vf.mapWriter().done().getValueType().isSubtypeOf(tf.voidType())); } @ParameterizedTest @ArgumentsSource(ValueProvider.class) public void testList(IValueFactory vf) { assertTrue(vf.list().equals(vf.list()), "empty lists are always equal"); assertTrue(vf.list(vf.integer(1)).equals(vf.list(vf.integer(1)))); assertFalse(vf.list(vf.integer(1)).equals(vf.list(vf.integer(0)))); assertTrue(vf.list(vf.list()).equals(vf.list(vf.list()))); } @ParameterizedTest @ArgumentsSource(ValueProvider.class) public void testSet(IValueFactory vf) { assertTrue(vf.set().equals(vf.set()), "empty sets are always equal"); assertTrue(vf.set(vf.integer(1)).equals(vf.set(vf.integer(1)))); assertFalse(vf.set(vf.integer(1)).equals(vf.set(vf.integer(0)))); assertTrue(vf.set(vf.set()).equals(vf.set(vf.set()))); } /** * Documenting the current relationship between Node and Constructor in terms of equality and hash * codes. */ @ParameterizedTest @ArgumentsSource(ValueProvider.class) public void <API key>(IValueFactory vf, TypeFactory tf) { final INode n = vf.node("<API key>", vf.integer(1), vf.integer(2)); final TypeStore ts = new TypeStore(); final Type adtType = tf.abstractDataType(ts, "<API key>"); final Type constructorType = tf.constructor(ts, adtType, "<API key>", tf.integerType(), tf.integerType()); final IConstructor c = vf.constructor(constructorType, vf.integer(1), vf.integer(2)); // they are not the same assertFalse(n.equals(c)); assertFalse(c.equals(n)); /* * TODO: what is the general contract between equals() and hashCode()? */ assertFalse(n.hashCode() == c.hashCode()); // unidirectional: n -> c = false assertFalse(n.equals(c)); // unidirectional: c -> n = false assertFalse(c.equals(n)); } @ParameterizedTest @ArgumentsSource(ValueProvider.class) public void testNodeMatch(IValueFactory vf) { final INode n = vf.node("hello"); final INode m = n.<API key>().setParameter("x", vf.integer(0)); assertFalse(n.equals(m)); assertFalse(m.equals(n)); assertTrue(n.match(m)); assertTrue(m.match(n)); assertFalse(m.equals(n)); assertFalse(n.equals(m)); final INode a = vf.node("hello", vf.string("bye")); final INode b = a.<API key>().setParameter("x", vf.integer(0)); assertFalse(a.equals(b)); assertFalse(b.equals(a)); assertTrue(a.match(b)); assertTrue(b.match(a)); assertTrue(a.match(a)); assertTrue(b.match(b)); assertFalse(b.equals(a)); assertFalse(a.equals(b)); assertTrue(vf.list(a).match(vf.list(b))); assertTrue(vf.list(b).match(vf.list(a))); assertTrue(vf.set(a).match(vf.set(b))); assertTrue(vf.set(b).match(vf.set(a))); assertTrue(vf.tuple(a).match(vf.tuple(b))); assertTrue(vf.tuple(b).match(vf.tuple(a))); final IMapWriter map1 = vf.mapWriter(); final IMapWriter map2 = vf.mapWriter(); map1.put(a, vf.integer(0)); map2.put(b, vf.integer(0)); assertTrue(map1.done().match(map2.done())); } @ParameterizedTest @ArgumentsSource(ValueProvider.class) public void <API key>(IValueFactory vf, TypeFactory tf) { final TypeStore store = new TypeStore(); final Type Hello = tf.abstractDataType(store, "Hello"); final Type Cons = tf.constructor(store, Hello, "bye"); store.<API key>(Cons, "x", tf.integerType()); final IConstructor n = vf.constructor(Cons); final IConstructor m = n.<API key>().setParameter("x", vf.integer(0)); assertFalse(n.equals(m)); assertFalse(m.equals(n)); assertTrue(n.match(m)); assertTrue(m.match(n)); assertTrue(n.match(n)); assertTrue(m.match(m)); assertFalse(m.equals(n)); assertFalse(n.equals(m)); Type AR = tf.constructor(store, Hello, "aurevoir", tf.stringType(), "greeting"); store.<API key>(AR, "x", tf.integerType()); final IConstructor a = vf.constructor(AR, vf.string("bye")); final IConstructor b = a.<API key>().setParameter("x", vf.integer(0)); assertFalse(a.equals(b)); assertFalse(b.equals(a)); assertTrue(a.match(b)); assertTrue(b.match(a)); assertTrue(a.match(a)); assertTrue(b.match(b)); assertFalse(b.equals(a)); assertFalse(a.equals(b)); assertTrue(vf.list(a).match(vf.list(b))); assertTrue(vf.list(b).match(vf.list(a))); assertTrue(vf.set(a).match(vf.set(b))); assertTrue(vf.set(b).match(vf.set(a))); assertTrue(vf.tuple(a).match(vf.tuple(b))); assertTrue(vf.tuple(b).match(vf.tuple(a))); final IMapWriter map1 = vf.mapWriter(); final IMapWriter map2 = vf.mapWriter(); map1.put(a, vf.integer(0)); map2.put(b, vf.integer(0)); assertTrue(map1.done().match(map2.done())); } }
package org.openhab.binding.openweathermap.internal.handler; import static org.openhab.binding.openweathermap.internal.<API key>.*; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.smarthome.core.thing.Channel; import org.eclipse.smarthome.core.thing.ChannelUID; import org.eclipse.smarthome.core.thing.Thing; import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder; import org.eclipse.smarthome.core.types.State; import org.eclipse.smarthome.core.types.UnDefType; import org.openhab.binding.openweathermap.internal.config.<API key>; import org.openhab.binding.openweathermap.internal.connection.<API key>; import org.openhab.binding.openweathermap.internal.connection.<API key>; import org.openhab.binding.openweathermap.internal.connection.<API key>; import org.openhab.binding.openweathermap.internal.model.<API key>; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.gson.JsonSyntaxException; /** * The {@link <API key>} is responsible for handling commands, which are sent to one of the * channels. * * @author Christoph Weitkamp - Initial contribution */ @NonNullByDefault public class <API key> extends <API key> { private final Logger logger = LoggerFactory.getLogger(<API key>.class); private static final String <API key> = "forecastDay"; private static final Pattern <API key> = Pattern .compile(<API key> + "([0-9]*)"); // keeps track of the parsed count private int forecastDays = 6; private @Nullable <API key> uvindexData; private @Nullable List<<API key>> uvindexForecastData; public <API key>(Thing thing) { super(thing); } @Override public void initialize() { super.initialize(); logger.debug("Initialize <API key> handler '{}'.", getThing().getUID()); <API key> config = getConfigAs(<API key>.class); boolean configValid = true; int newForecastDays = config.getForecastDays(); if (newForecastDays < 1 || newForecastDays > 8) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "@text/offline.<API key>"); configValid = false; } if (configValid) { logger.debug("Rebuilding thing '{}'.", getThing().getUID()); List<Channel> toBeAddedChannels = new ArrayList<>(); List<Channel> toBeRemovedChannels = new ArrayList<>(); if (forecastDays != newForecastDays) { logger.debug("Rebuilding UV index channel groups."); if (forecastDays > newForecastDays) { if (newForecastDays < 2) { toBeRemovedChannels.addAll(<API key>(<API key>)); } for (int i = newForecastDays; i < forecastDays; ++i) { toBeRemovedChannels .addAll(<API key>(<API key> + Integer.toString(i))); } } else { if (forecastDays <= 1 && newForecastDays > 1) { toBeAddedChannels.addAll( <API key>(<API key>, <API key>)); } for (int i = (forecastDays < 2) ? 2 : forecastDays; i < newForecastDays; ++i) { toBeAddedChannels.addAll(<API key>( <API key> + Integer.toString(i), <API key>)); } } forecastDays = newForecastDays; } ThingBuilder builder = editThing().withoutChannels(toBeRemovedChannels); for (Channel channel : toBeAddedChannels) { builder.withChannel(channel); } updateThing(builder.build()); } } @Override protected boolean requestData(<API key> connection) throws <API key>, <API key> { logger.debug("Update UV Index data of thing '{}'.", getThing().getUID()); try { uvindexData = connection.getUVIndexData(location); if (forecastDays > 0) { uvindexForecastData = connection.<API key>(location, forecastDays); } return true; } catch (JsonSyntaxException e) { logger.debug("JsonSyntaxException occurred during execution: {}", e.getLocalizedMessage(), e); return false; } } @Override protected void updateChannel(ChannelUID channelUID) { switch (channelUID.getGroupId()) { case <API key>: <API key>(channelUID); break; case <API key>: <API key>(channelUID, 1); break; default: Matcher m = <API key>.matcher(channelUID.getGroupId()); int i; if (m.find() && (i = Integer.parseInt(m.group(1))) > 1 && i <= 8) { <API key>(channelUID, i); } break; } } /** * Update the channel from the last OpenWeatherMap data retrieved. * * @param channelUID the id identifying the channel to be updated */ private void <API key>(ChannelUID channelUID) { String channelId = channelUID.getIdWithoutGroup(); String channelGroupId = channelUID.getGroupId(); <API key> localUVIndexData = uvindexData; if (localUVIndexData != null) { State state = UnDefType.UNDEF; switch (channelId) { case CHANNEL_TIME_STAMP: state = <API key>(localUVIndexData.getDate()); break; case CHANNEL_UVINDEX: state = getDecimalTypeState(localUVIndexData.getValue()); break; } logger.debug("Update channel '{}' of group '{}' with new state '{}'.", channelId, channelGroupId, state); updateState(channelUID, state); } else { logger.debug("No UV Index data available to update channel '{}' of group '{}'.", channelId, channelGroupId); } } /** * Update the channel from the last OpenWeatherMap data retrieved. * * @param channelUID the id identifying the channel to be updated * @param count */ private void <API key>(ChannelUID channelUID, int count) { String channelId = channelUID.getIdWithoutGroup(); String channelGroupId = channelUID.getGroupId(); if (uvindexForecastData != null && uvindexForecastData.size() >= count) { <API key> forecastData = uvindexForecastData.get(count - 1); State state = UnDefType.UNDEF; switch (channelId) { case CHANNEL_TIME_STAMP: state = <API key>(forecastData.getDate()); break; case CHANNEL_UVINDEX: state = getDecimalTypeState(forecastData.getValue()); break; } logger.debug("Update channel '{}' of group '{}' with new state '{}'.", channelId, channelGroupId, state); updateState(channelUID, state); } else { logger.debug("No UV Index data available to update channel '{}' of group '{}'.", channelId, channelGroupId); } } }
package com.intuit.tank.auth; import org.junit.*; import com.intuit.tank.auth.AccountModify; import static org.junit.Assert.*; /** * The class <code>PasswordChangeTest</code> contains tests for the class <code>{@link AccountModify}</code>. * * @generatedBy CodePro at 12/15/14 3:53 PM */ public class PasswordChangeTest { /** * Run the PasswordChange() constructor test. * * @generatedBy CodePro at 12/15/14 3:53 PM */ @Test public void <API key>() throws Exception { AccountModify result = new AccountModify(); assertNotNull(result); } /** * Run the String getPassword() method test. * * @throws Exception * * @generatedBy CodePro at 12/15/14 3:53 PM */ @Test public void testGetPassword_1() throws Exception { AccountModify fixture = new AccountModify(); fixture.setPassword(""); fixture.setPasswordConfirm(""); String result = fixture.getPassword(); // An unexpected exception was thrown in user code while executing this test: // java.lang.<API key>: com_cenqua_clover/CoverageRecorder // at com.intuit.tank.auth.PasswordChange.setPassword(PasswordChange.java:78) assertNotNull(result); } /** * Run the String getPasswordConfirm() method test. * * @throws Exception * * @generatedBy CodePro at 12/15/14 3:53 PM */ @Test public void <API key>() throws Exception { AccountModify fixture = new AccountModify(); fixture.setPassword(""); fixture.setPasswordConfirm(""); String result = fixture.getPasswordConfirm(); // An unexpected exception was thrown in user code while executing this test: // java.lang.<API key>: com_cenqua_clover/CoverageRecorder // at com.intuit.tank.auth.PasswordChange.setPassword(PasswordChange.java:78) assertNotNull(result); } /** * Run the boolean isSucceeded() method test. * * @throws Exception * * @generatedBy CodePro at 12/15/14 3:53 PM */ @Test public void testIsSucceeded_1() throws Exception { AccountModify fixture = new AccountModify(); fixture.setPassword(""); fixture.setPasswordConfirm(""); boolean result = fixture.isSucceeded(); // An unexpected exception was thrown in user code while executing this test: // java.lang.<API key>: com_cenqua_clover/CoverageRecorder // at com.intuit.tank.auth.PasswordChange.setPassword(PasswordChange.java:78) assertTrue(!result); } /** * Run the boolean isSucceeded() method test. * * @throws Exception * * @generatedBy CodePro at 12/15/14 3:53 PM */ @Test public void testIsSucceeded_2() throws Exception { AccountModify fixture = new AccountModify(); fixture.setPassword(""); fixture.setPasswordConfirm(""); boolean result = fixture.isSucceeded(); // An unexpected exception was thrown in user code while executing this test: // java.lang.<API key>: com_cenqua_clover/CoverageRecorder // at com.intuit.tank.auth.PasswordChange.setPassword(PasswordChange.java:78) assertTrue(!result); } /** * Run the void setPassword(String) method test. * * @throws Exception * * @generatedBy CodePro at 12/15/14 3:53 PM */ @Test public void testSetPassword_1() throws Exception { AccountModify fixture = new AccountModify(); fixture.setPassword(""); fixture.setPasswordConfirm(""); String password = ""; fixture.setPassword(password); // An unexpected exception was thrown in user code while executing this test: // java.lang.<API key>: com_cenqua_clover/CoverageRecorder // at com.intuit.tank.auth.PasswordChange.setPassword(PasswordChange.java:78) } /** * Run the void setPasswordConfirm(String) method test. * * @throws Exception * * @generatedBy CodePro at 12/15/14 3:53 PM */ @Test public void <API key>() throws Exception { AccountModify fixture = new AccountModify(); fixture.setPassword(""); fixture.setPasswordConfirm(""); String passwordConfirm = ""; fixture.setPasswordConfirm(passwordConfirm); // An unexpected exception was thrown in user code while executing this test: // java.lang.<API key>: com_cenqua_clover/CoverageRecorder // at com.intuit.tank.auth.PasswordChange.setPassword(PasswordChange.java:78) } }
package org.jcryptool.visual.ssl.protocol; /** * @author Kapfer * */ public interface ProtocolStep { String OK = "Oll Korrekt"; /** * Disables all controls of the ProtocolStep */ public void disableControls(); /** * Enables all controls of the ProtocolStep */ public void enableControls(); /** * Checks if all chosen parameters are correct * * @return * the error reason, if parameters are incorrect. May be empty to not complain at all * "Oll Korrekt" if parameters are correct */ public String checkParameters(); /** * Refreshes the information shown in stxInformation */ public void refreshInformations(); /** * Resets the step */ public void resetStep(); }
<!doctype html> <!-- paulirish.com/2008/<API key>/ --> <!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]--> <!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]--> <!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]--> <!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"> <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame Remove this if you use the .htaccess <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title><API key></title> <!-- Mobile viewport optimized: j.mp/bplateviewport --> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- CSS: implied media="all" --> <link rel="stylesheet" href="css/style.css?v=2"> <link rel="stylesheet" href="css/prettify.css"> <!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects --> <script src="js/libs/modernizr-1.7.min.js"></script> </head> <body class="home"> <div class="container"> <header> <div id="header" class="column first last span-20"> <div id="site-name" class="column span-18 append-1 prepend-1 first last"><a href="index.html"><API key></a></div> <div id="primary" class="column span-18 append-1 prepend-1 first last"> <ul class="navigation"> <li id="nav-rest"><a href="rest.html">REST</a></li> <li id="nav-data"><a href="model.html">Data Model</a></li> <li id="nav-downloads"><a href="downloads.html">Files and Libraries</a></li> </ul> </div> <div> <ul class="xbreadcrumbs" id="breadcrumbs"> <li> <a href="index.html" class="home">Home</a> &gt; </li> <li> <a href="rest.html">REST</a> &gt; <ul> <li><a href="model.html">Data Model</a></li> <li><a href="downloads.html">Files and Libraries</a></li> <li><a href="rest.html">REST</a></li> </ul> </li> <li class="current"> <a href="<API key>.html"><API key></a> <ul> <li><a href="<API key>.html"><API key></a></li> </ul> </li> </ul> </div> </div> </header> <div id="main" class="column first last span-20"> <h1><API key></h1> <p>Northbound APIs that returns various Statistics exposed by the Southbound plugins such as Openflow. <br> <br> Authentication scheme : <b>HTTP Basic</b><br> Authentication realm : <b>opendaylight</b><br> Transport : <b>HTTP and HTTPS</b><br> <br> HTTPS Authentication is disabled by default. Administrator can enable it in tomcat-server.xml after adding a proper keystore / SSL certificate from a trusted authority.<br> More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration</p> <p>The following resources are part of this group:</p> <ul> <li><a href="#<API key>.html">/{containerName}/flowstats</a></li> <li><a href="#<API key>.html">/{containerName}/portstats</a></li> <li><a href="#<API key>.html">/{containerName}/tablestats</a></li> <li><a href="#<API key>-.html">/{containerName}/flowstats/{nodeType}/{nodeId}</a></li> <li><a href="#<API key>-.html">/{containerName}/portstats/{nodeType}/{nodeId}</a></li> <li><a href="#<API key>-.html">/{containerName}/tablestats/{nodeType}/{nodeId}</a></li> </ul> <a name="<API key>.html"></a> <h1>/{containerName}/flowstats</h1> <p class="note">Mount Point: <a href="../controller/nb/v2/statistics/{containerName}/flowstats">/controller/nb/v2/statistics/{containerName}/flowstats</a></p> <a name="GET"></a> <h2>GET</h2> <p> Returns a list of all Flow Statistics from all the Nodes. </p> <h3>Parameters</h3> <table> <tr> <th>name</th> <th>description</th> <th>type</th> <th>default</th> </tr> <tr> <td>containerName</td> <td> Name of the Container. The Container name for the base controller is "default". </td> <td>path</td> <td></td> </tr> </table> <h3>Response Body</h3> <table> <tr> <td align="right">element:</td> <td><a href="<API key>.html">allFlowStatistics</a></td> </tr> <tr> <td align="right">media types:</td> <td>application/xml<br/>application/json</td> </tr> </table> <p>List of FlowStatistics from all the Nodes</p> <h3>Status Codes</h3> <table> <tr> <th>code</th> <th>description</th> </tr> <tr> <td>200</td> <td> Operation successful </td> </tr> <tr> <td>404</td> <td> The containerName is not found </td> </tr> <tr> <td>503</td> <td> One or more of Controller Services are unavailable </td> </tr> </table> <a name="<API key>.html"></a> <h1>/{containerName}/portstats</h1> <p class="note">Mount Point: <a href="../controller/nb/v2/statistics/{containerName}/portstats">/controller/nb/v2/statistics/{containerName}/portstats</a></p> <a name="GET"></a> <h2>GET</h2> <p> Returns a list of all the Port Statistics across all the NodeConnectors on all the Nodes. </p> <h3>Parameters</h3> <table> <tr> <th>name</th> <th>description</th> <th>type</th> <th>default</th> </tr> <tr> <td>containerName</td> <td> Name of the Container. The Container name for the base controller is "default". </td> <td>path</td> <td></td> </tr> </table> <h3>Response Body</h3> <table> <tr> <td align="right">element:</td> <td><a href="<API key>.html">allPortStatistics</a></td> </tr> <tr> <td align="right">media types:</td> <td>application/xml<br/>application/json</td> </tr> </table> <p>List of all the Port Statistics across all the NodeConnectors on all the Nodes.</p> <h3>Status Codes</h3> <table> <tr> <th>code</th> <th>description</th> </tr> <tr> <td>200</td> <td> Operation successful </td> </tr> <tr> <td>404</td> <td> The containerName is not found </td> </tr> <tr> <td>503</td> <td> One or more of Controller Services are unavailable </td> </tr> </table> <a name="<API key>.html"></a> <h1>/{containerName}/tablestats</h1> <p class="note">Mount Point: <a href="../controller/nb/v2/statistics/{containerName}/tablestats">/controller/nb/v2/statistics/{containerName}/tablestats</a></p> <a name="GET"></a> <h2>GET</h2> <p> Returns a list of all the Table Statistics on all Nodes. </p> <h3>Parameters</h3> <table> <tr> <th>name</th> <th>description</th> <th>type</th> <th>default</th> </tr> <tr> <td>containerName</td> <td> Name of the Container. The Container name for the base controller is "default". </td> <td>path</td> <td></td> </tr> </table> <h3>Response Body</h3> <table> <tr> <td align="right">element:</td> <td><a href="<API key>.html">tableStatistics</a></td> </tr> <tr> <td align="right">media types:</td> <td>application/xml<br/>application/json</td> </tr> </table> <p>Returns a list of all the Table Statistics in a given Node.</p> <h3>Status Codes</h3> <table> <tr> <th>code</th> <th>description</th> </tr> <tr> <td>200</td> <td> Operation successful </td> </tr> <tr> <td>404</td> <td> The containerName is not found </td> </tr> <tr> <td>503</td> <td> One or more of Controller Services are unavailable </td> </tr> </table> <a name="<API key>-.html"></a> <h1>/{containerName}/flowstats/{nodeType}/{nodeId}</h1> <p class="note">Mount Point: <a href="../controller/nb/v2/statistics/{containerName}/flowstats/{nodeType}/{nodeId}">/controller/nb/v2/statistics/{containerName}/flowstats/{nodeType}/{nodeId}</a></p> <a name="GET"></a> <h2>GET</h2> <p> Returns a list of Flow Statistics for a given Node. </p> <h3>Parameters</h3> <table> <tr> <th>name</th> <th>description</th> <th>type</th> <th>default</th> </tr> <tr> <td>containerName</td> <td> Name of the Container. The Container name for the base controller is "default". </td> <td>path</td> <td></td> </tr> <tr> <td>nodeType</td> <td> Node Type as specifid by Node class </td> <td>path</td> <td></td> </tr> <tr> <td>nodeId</td> <td> Node Identifier </td> <td>path</td> <td></td> </tr> </table> <h3>Response Body</h3> <table> <tr> <td align="right">element:</td> <td><a href="<API key>.html">flowStatistics</a></td> </tr> <tr> <td align="right">media types:</td> <td>application/xml<br/>application/json</td> </tr> </table> <p>List of Flow Statistics for a given Node.</p> <h3>Status Codes</h3> <table> <tr> <th>code</th> <th>description</th> </tr> <tr> <td>200</td> <td> Operation successful </td> </tr> <tr> <td>404</td> <td> The containerName is not found </td> </tr> <tr> <td>503</td> <td> One or more of Controller Services are unavailable </td> </tr> </table> <a name="<API key>-.html"></a> <h1>/{containerName}/portstats/{nodeType}/{nodeId}</h1> <p class="note">Mount Point: <a href="../controller/nb/v2/statistics/{containerName}/portstats/{nodeType}/{nodeId}">/controller/nb/v2/statistics/{containerName}/portstats/{nodeType}/{nodeId}</a></p> <a name="GET"></a> <h2>GET</h2> <p> Returns a list of all the Port Statistics across all the NodeConnectors in a given Node. </p> <h3>Parameters</h3> <table> <tr> <th>name</th> <th>description</th> <th>type</th> <th>default</th> </tr> <tr> <td>containerName</td> <td> Name of the Container. The Container name for the base controller is "default". </td> <td>path</td> <td></td> </tr> <tr> <td>nodeType</td> <td> Node Type as specifid by Node class </td> <td>path</td> <td></td> </tr> <tr> <td>nodeId</td> <td> (no documentation provided) </td> <td>path</td> <td></td> </tr> </table> <h3>Response Body</h3> <table> <tr> <td align="right">element:</td> <td><a href="<API key>.html">portStatistics</a></td> </tr> <tr> <td align="right">media types:</td> <td>application/xml<br/>application/json</td> </tr> </table> <p>Returns a list of all the Port Statistics across all the NodeConnectors in a given Node.</p> <h3>Status Codes</h3> <table> <tr> <th>code</th> <th>description</th> </tr> <tr> <td>200</td> <td> Operation successful </td> </tr> <tr> <td>404</td> <td> The containerName is not found </td> </tr> <tr> <td>503</td> <td> One or more of Controller Services are unavailable </td> </tr> </table> <a name="<API key>-.html"></a> <h1>/{containerName}/tablestats/{nodeType}/{nodeId}</h1> <p class="note">Mount Point: <a href="../controller/nb/v2/statistics/{containerName}/tablestats/{nodeType}/{nodeId}">/controller/nb/v2/statistics/{containerName}/tablestats/{nodeType}/{nodeId}</a></p> <a name="GET"></a> <h2>GET</h2> <p> Returns a list of all the Table Statistics on all Nodes. </p> <h3>Parameters</h3> <table> <tr> <th>name</th> <th>description</th> <th>type</th> <th>default</th> </tr> <tr> <td>containerName</td> <td> Name of the Container. The Container name for the base controller is "default". </td> <td>path</td> <td></td> </tr> <tr> <td>nodeType</td> <td> Node Type as specifid by Node class </td> <td>path</td> <td></td> </tr> <tr> <td>nodeId</td> <td> (no documentation provided) </td> <td>path</td> <td></td> </tr> </table> <h3>Response Body</h3> <table> <tr> <td align="right">element:</td> <td><a href="<API key>.html">tableStatistics</a></td> </tr> <tr> <td align="right">media types:</td> <td>application/xml<br/>application/json</td> </tr> </table> <p>Returns a list of all the Table Statistics in a given Node.</p> <h3>Status Codes</h3> <table> <tr> <th>code</th> <th>description</th> </tr> <tr> <td>200</td> <td> Operation successful </td> </tr> <tr> <td>404</td> <td> The containerName is not found </td> </tr> <tr> <td>503</td> <td> One or more of Controller Services are unavailable </td> </tr> </table> <div class="clear" /> </div> <footer> <div id="footer"> Generated by <a href="http://enunciate.codehaus.org">Enunciate</a>. </div> </footer> </div> <!--! end of #container --> <!-- JavaScript at the bottom for fast page loading --> <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if necessary --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script> <script>window.jQuery || document.write("<script src='js/libs/jquery-1.5.1.min.js'>\x3C/script>")</script> <!--manage the navigation menu <script src="js/libs/xbreadcrumbs.js"></script> <script> $(function() { $('#breadcrumbs').xBreadcrumbs(); }); </script> <script src="js/libs/prettify/prettify.js"></script> <script> $(function() { prettyPrint(); }); </script> <!--[if lt IE 7 ]> <script src="js/libs/dd_belatedpng.js"></script> <script>DD_belatedPNG.fix("img, .png_bg"); // Fix any <img> or .png_bg bg-images. Also, please read goo.gl/mZiyb </script> <![endif] </body> </html>
package org.eclipse.kapua.service.device.management.request.message.request; import org.eclipse.kapua.service.device.management.message.request.KapuaRequestPayload; import org.eclipse.kapua.service.device.management.request.<API key>; import javax.xml.bind.annotation.XmlType; /** * Generic {@link KapuaRequestPayload} definition. * * @since 1.0.0 */ @XmlType(factoryClass = <API key>.class, factoryMethod = "newRequestPayload") public interface <API key> extends KapuaRequestPayload { }