text
stringlengths
2
1.04M
meta
dict
package org.apache.camel.component.jms; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.QueueBrowser; import javax.jms.Session; import org.apache.camel.Exchange; import org.springframework.jms.core.BrowserCallback; import org.springframework.jms.core.JmsOperations; /** * A default implementation of queue browsing using the Spring {@link BrowserCallback} */ public class DefaultQueueBrowseStrategy implements QueueBrowseStrategy { @Override public List<Exchange> browse(JmsOperations template, String queue, final JmsBrowsableEndpoint endpoint) { if (endpoint.getSelector() != null) { return template.browseSelected(queue, endpoint.getSelector(), (session, browser) -> doBrowse(endpoint, session, browser)); } else { return template.browse(queue, (session, browser) -> doBrowse(endpoint, session, browser)); } } private static List<Exchange> doBrowse(JmsBrowsableEndpoint endpoint, Session session, QueueBrowser browser) throws JMSException { int size = endpoint.getMaximumBrowseSize(); if (size <= 0) { size = Integer.MAX_VALUE; } // not the best implementation in the world as we have to browse // the entire queue, which could be massive List<Exchange> answer = new ArrayList<>(); Enumeration<?> iter = browser.getEnumeration(); for (int i = 0; i < size && iter.hasMoreElements(); i++) { Message message = (Message) iter.nextElement(); Exchange exchange = endpoint.createExchange(message, session); answer.add(exchange); } return answer; } }
{ "content_hash": "584c3e43c0f22d66e3cb8cfeac9a4e5a", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 112, "avg_line_length": 34.48076923076923, "alnum_prop": 0.6748466257668712, "repo_name": "apache/camel", "id": "4f349f510f3fa5c85db3e40bdc0978f191bf4d73", "size": "2595", "binary": false, "copies": "5", "ref": "refs/heads/main", "path": "components/camel-jms/src/main/java/org/apache/camel/component/jms/DefaultQueueBrowseStrategy.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Apex", "bytes": "6695" }, { "name": "Batchfile", "bytes": "2353" }, { "name": "CSS", "bytes": "5472" }, { "name": "Dockerfile", "bytes": "5676" }, { "name": "Elm", "bytes": "10852" }, { "name": "FreeMarker", "bytes": "8015" }, { "name": "Groovy", "bytes": "412301" }, { "name": "HTML", "bytes": "213802" }, { "name": "Java", "bytes": "114936384" }, { "name": "JavaScript", "bytes": "103655" }, { "name": "Jsonnet", "bytes": "1734" }, { "name": "Kotlin", "bytes": "41869" }, { "name": "Mustache", "bytes": "525" }, { "name": "RobotFramework", "bytes": "8461" }, { "name": "Ruby", "bytes": "88" }, { "name": "Shell", "bytes": "15327" }, { "name": "Tcl", "bytes": "4974" }, { "name": "Thrift", "bytes": "6979" }, { "name": "XQuery", "bytes": "699" }, { "name": "XSLT", "bytes": "276597" } ], "symlink_target": "" }
import eventlet import six from oslo_context import context as oslo_context from oslo_log import log as logging from senlin.common import exception from senlin.common.i18n import _ from senlin.common.i18n import _LE from senlin.drivers import base from senlin.drivers.openstack import neutron_v2 as neutronclient LOG = logging.getLogger(__name__) class LoadBalancerDriver(base.DriverBase): """Load-balancing driver based on Neutron LBaaS V2 service.""" def __init__(self, params): super(LoadBalancerDriver, self).__init__(params) self._nc = None def nc(self): if self._nc: return self._nc self._nc = neutronclient.NeutronClient(self.conn_params) return self._nc def _wait_for_lb_ready(self, lb_id, timeout=60, ignore_not_found=False): """Keep waiting until loadbalancer is ready This method will keep waiting until loadbalancer resource specified by lb_id becomes ready, i.e. its provisioning_status is ACTIVE and its operating_status is ONLINE. :param lb_id: ID of the load-balancer to check. :param timeout: timeout in seconds. :param ignore_not_found: if set to True, nonexistent loadbalancer resource is also an acceptable result. """ waited = 0 while waited < timeout: try: lb = self.nc().loadbalancer_get(lb_id) except exception.InternalError as ex: msg = _LE('Failed in getting loadbalancer: %s.' ) % six.text_type(ex) LOG.exception(msg) return False if lb is None: lb_ready = ignore_not_found else: lb_ready = ((lb.provisioning_status == 'ACTIVE') and (lb.operating_status == 'ONLINE')) if lb_ready is True: return True LOG.debug(_('Waiting for loadbalancer %(lb)s to become ready'), {'lb': lb_id}) eventlet.sleep(2) waited += 2 return False def lb_create(self, vip, pool, hm=None): """Create a LBaaS instance :param vip: A dict containing the properties for the VIP; :param pool: A dict describing the pool of load-balancer members. :param pool: A dict describing the health monitor. """ def _cleanup(msg, **kwargs): LOG.error(msg) self.lb_delete(**kwargs) return result = {} # Create loadblancer try: subnet = self.nc().subnet_get(vip['subnet']) except exception.InternalError as ex: msg = _LE('Failed in getting subnet: %s.') % six.text_type(ex) LOG.exception(msg) return False, msg subnet_id = subnet.id try: lb = self.nc().loadbalancer_create(subnet_id, vip.get('address', None), vip['admin_state_up']) except exception.InternalError as ex: msg = _LE('Failed in creating loadbalancer: %s.' ) % six.text_type(ex) LOG.exception(msg) return False, msg result['loadbalancer'] = lb.id result['vip_address'] = lb.vip_address res = self._wait_for_lb_ready(lb.id) if res is False: msg = _LE('Failed in creating load balancer (%s).') % lb.id del result['vip_address'] _cleanup(msg, **result) return False, msg # Create listener try: listener = self.nc().listener_create(lb.id, vip['protocol'], vip['protocol_port'], vip.get('connection_limit', None), vip['admin_state_up']) except exception.InternalError as ex: msg = _LE('Failed in creating lb listener: %s.' ) % six.text_type(ex) LOG.exception(msg) return False, msg result['listener'] = listener.id res = self._wait_for_lb_ready(lb.id) if res is False: msg = _LE('Failed in creating listener (%s).') % listener.id del result['vip_address'] _cleanup(msg, **result) return res, msg # Create pool try: pool = self.nc().pool_create(pool['lb_method'], listener.id, pool['protocol'], pool['admin_state_up']) except exception.InternalError as ex: msg = _LE('Failed in creating lb pool: %s.' ) % six.text_type(ex) LOG.exception(msg) return False, msg result['pool'] = pool.id res = self._wait_for_lb_ready(lb.id) if res is False: msg = _LE('Failed in creating pool (%s).') % pool.id del result['vip_address'] _cleanup(msg, **result) return res, msg if not hm: return True, result if not hm: return True, result # Create health monitor try: health_monitor = self.nc().healthmonitor_create( hm['type'], hm['delay'], hm['timeout'], hm['max_retries'], pool.id, hm['admin_state_up'], hm['http_method'], hm['url_path'], hm['expected_codes']) except exception.InternalError as ex: msg = _LE('Failed in creating lb health monitor: %s.' ) % six.text_type(ex) LOG.exception(msg) return False, msg result['healthmonitor'] = health_monitor.id res = self._wait_for_lb_ready(lb.id) if res is False: msg = _LE('Failed in creating health monitor (%s).' ) % health_monitor.id del result['vip_address'] _cleanup(msg, **result) return res, msg return True, result def lb_delete(self, **kwargs): """Delete a Neutron lbaas instance The following Neutron lbaas resources will be deleted in order: 1)healthmonitor; 2)pool; 3)listener; 4)loadbalancer. """ lb_id = kwargs.pop('loadbalancer') healthmonitor_id = kwargs.pop('healthmonitor', None) if healthmonitor_id: try: self.nc().healthmonitor_delete(healthmonitor_id) except exception.InternalError as ex: msg = _LE('Failed in deleting healthmonitor: %s.' ) % six.text_type(ex) LOG.exception(msg) return False, msg res = self._wait_for_lb_ready(lb_id) if res is False: msg = _LE('Failed in deleting healthmonitor ' '(%s).') % healthmonitor_id return False, msg pool_id = kwargs.pop('pool', None) if pool_id: try: self.nc().pool_delete(pool_id) except exception.InternalError as ex: msg = _LE('Failed in deleting lb pool: %s.' ) % six.text_type(ex) LOG.exception(msg) return False, msg res = self._wait_for_lb_ready(lb_id) if res is False: msg = _LE('Failed in deleting pool (%s).') % pool_id return False, msg listener_id = kwargs.pop('listener', None) if listener_id: try: self.nc().listener_delete(listener_id) except exception.InternalError as ex: msg = _LE('Failed in deleting listener: %s.' ) % six.text_type(ex) LOG.exception(msg) return False, msg res = self._wait_for_lb_ready(lb_id) if res is False: msg = _LE('Failed in deleting listener (%s).') % listener_id return False, msg self.nc().loadbalancer_delete(lb_id) res = self._wait_for_lb_ready(lb_id, ignore_not_found=True) if res is False: msg = _LE('Failed in deleting loadbalancer (%s).') % lb_id return False, msg return True, _('LB deletion succeeded') def member_add(self, node, lb_id, pool_id, port, subnet): """Add a member to Neutron lbaas pool. :param node: A node object to be added to the specified pool. :param lb_id: The ID of the loadbalancer. :param pool_id: The ID of the pool for receiving the node. :param port: The port for the new LB member to be created. :param subnet: The subnet to be used by the new LB member. :returns: The ID of the new LB member or None if errors occurred. """ try: subnet_obj = self.nc().subnet_get(subnet) net_id = subnet_obj.network_id net = self.nc().network_get(net_id) except exception.InternalError as ex: resource = 'subnet' if subnet in ex.message else 'network' msg = _LE('Failed in getting %(resource)s: %(msg)s.' ) % {'resource': resource, 'msg': six.text_type(ex)} LOG.exception(msg) return None net_name = net.name node_detail = node.get_details(oslo_context.get_current()) addresses = node_detail.get('addresses') if net_name not in addresses: LOG.error(_LE('Node is not in subnet %(subnet)s'), {'subnet': subnet}) return None # Use the first IP address if more than one are found in target network address = addresses[net_name][0] try: member = self.nc().pool_member_create(pool_id, address, port, subnet_obj.id) except exception.InternalError as ex: msg = _LE('Failed in creating lb pool member: %s.' ) % six.text_type(ex) LOG.exception(msg) return None res = self._wait_for_lb_ready(lb_id) if res is False: LOG.error(_LE('Failed in creating pool member (%s).') % member.id) return None return member.id def member_remove(self, lb_id, pool_id, member_id): """Delete a member from Neutron lbaas pool. :param lb_id: The ID of the loadbalancer the operation is targeted at; :param pool_id: The ID of the pool from which the member is deleted; :param member_id: The ID of the LB member. :returns: True if the operation succeeded or False if errors occurred. """ try: self.nc().pool_member_delete(pool_id, member_id) except exception.InternalError as ex: msg = _LE('Failed in removing member %(m)s from pool %(p)s: ' '%(ex)s') % {'m': member_id, 'p': pool_id, 'ex': six.text_type(ex)} LOG.exception(msg) return None res = self._wait_for_lb_ready(lb_id) if res is False: LOG.error(_LE('Failed in deleting pool member (%s).') % member_id) return None return True
{ "content_hash": "1f640423e612b1543c590c080e4c2d67", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 79, "avg_line_length": 38.193333333333335, "alnum_prop": 0.5215569907488218, "repo_name": "tengqm/senlin-container", "id": "738c37a87388c0139a92a7c72983d7c0c7896cef", "size": "12007", "binary": false, "copies": "1", "ref": "refs/heads/container_cluster_support", "path": "senlin/drivers/openstack/lbaas.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "2239281" }, { "name": "Shell", "bytes": "18730" } ], "symlink_target": "" }
( function () { var toolbar = { "toolbar-new": function () { Manager.clear(); }, "toolbar-open": function () { Manager.load(Manager.collectionURI); document.getElementById("open").removeClass("hidden"); }, "toolbar-save": function () { document.getElementById("article-submit").click(); }, "toolbar-delete": function () { Manager.remove() }, "toolbar-edit": function () { if (!Manager.editable) { alert("I can't edit this (yet)!"); return; } var content = document.getElementById("content"); var atomcontent = content.atomcontent; var textarea = document.createElement("textarea"); textarea.rows = "20"; textarea.cols = "80"; textarea.addAtomContent(atomcontent); content.empty(); content.appendChild(textarea); document.getElementById("toolbar-edit").parentNode.addClass("hidden"); document.getElementById("toolbar-preview").parentNode.removeClass("hidden"); }, "toolbar-preview": function () { var content = document.getElementById("content"); var atomcontent = content.atomcontent; var textarea = content.firstElementChild; if (!textarea.updateAtomContent()) { return; } content.addAtomContent(atomcontent); document.getElementById("toolbar-edit").parentNode.removeClass("hidden"); document.getElementById("toolbar-preview").parentNode.addClass("hidden"); }, "toolbar-media": function () { document.getElementById("media").removeClass("hidden"); Manager.showMedia(); } }; document.addEventListener("load", function () { document.getElementById("toolbar-preview").parentNode.addClass("hidden"); document.getElementById("toolbar").addEventListener("click", function (ev) { ev.preventDefault(); ev.stopPropagation(); if (event.target.id) { if (toolbar[event.target.id]) { toolbar[event.target.id](); } } }, false); document.getElementById("article-form").addEventListener("submit", function (ev) { ev.preventDefault(); ev.stopPropagation(); if (this.checkValidity()) { Manager.save(); } }, false); document.getElementById("media-form").addEventListener("submit", function (ev) { var title = this.elements["media-title"].value; var summary = this.elements["media-summary"].value; var author = this.elements["media-author"].value; var filename = this.elements["file"].value; if (title||summary||author) { var entry = document.implementation.createDocument("http://www.w3.org/2005/Atom", "entry", null); var titleEl = entry.createElementNS("http://www.w3.org/2005/Atom", "title"); titleEl.textContent = title||"Untitled"; entry.documentElement.appendChild(titleEl); var authorEl = entry.createElementNS("http://www.w3.org/2005/Atom", "author"); var name = entry.createElementNS("http://www.w3.org/2005/Atom", "name"); name.textContent = author||"Anonymous"; authorEl.appendChild(name); entry.documentElement.appendChild(authorEl); var id = entry.createElementNS("http://www.w3.org/2005/Atom", "id"); var now = new Date(); id.textContent = "tag:"+document.domain+","+now.getFullYear()+"-"+(now.getMonth()+1)+"-"+now.getDate()+":"+parseInt(Math.random()*100000,10); entry.documentElement.appendChild(id); var updated = entry.createElementNS("http://www.w3.org/2005/Atom", "updated"); updated.textContent = now.toAtomString(); entry.documentElement.appendChild(updated); var summaryEl = entry.createElementNS("http://www.w3.org/2005/Atom", "summary"); summaryEl.setAttribute("type","text"); summaryEl.textContent = summary||""; entry.documentElement.appendChild(summaryEl); var content = entry.createElementNS("http://www.w3.org/2005/Atom", "content"); content.setAttribute("src",filename); entry.documentElement.appendChild(content); var xml = document.implementation.createLSSerializer().writeToString(entry); this.elements["entry"].value = xml; } }, false); document.getElementById("media-frame").addEventListener("load", function () { if (this.contentDocument.documentElement.localName == "entry") { var content = this.contentDocument.documentElement.selectSingleNode("atom:content", function () {return "http://www.w3.org/2005/Atom"}); var uri = resolveURI(content.getAttributeNode("src")); var list = document.getElementById("media-list"); var li = document.createElement("li"); var a = document.createElement("a"); a.href = uri; a.textContent = uri; li.appendChild(a); list.appendChild(li); document.getElementById("media-form").reset(); } }, false); var popups = document.getElementsByClassName("popup-close"); for (var i=0, popup; popup=popups[i]; i++) { popup.addEventListener("click", function (ev) { ev.preventDefault(); ev.stopPropagation(); ev.target.parentNode.parentNode.addClass("hidden"); }, false); } }, false); })();
{ "content_hash": "e9cd184483e9d414a9c0479570c50023", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 157, "avg_line_length": 42.61073825503356, "alnum_prop": 0.5282721688454874, "repo_name": "jhoekx/php-atompub-server", "id": "2ccc0713efefd45ca9b7cb9389dcbd25c2dcc620", "size": "6350", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/manager/toolbar.js", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "107187" } ], "symlink_target": "" }
import { piratebay } from 'piratebay-scraper'; import { TPBProvider } from 'piratebay-scraper/interfaces'; const PROVIDERS = ['https://tpb.party', 'https://thepiratebay.zone/', 'https://pirateproxy.live/']; let index = 0; chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { if (request.contentScriptQuery === 'fetchData') { getData(request, sender, sendResponse, PROVIDERS[index]); return true; } else { return false; } }); const getData = (request: any, sender: any, sendResponse: any, provider: TPBProvider) => { piratebay .search(request.searchQuery, provider) .then((response) => { if (response) { return response; } throw new Error("Can't connect to movie provider :("); }) .then((response) => { sendResponse(response); }) .catch((error) => { if (index <= PROVIDERS.length - 1) { console.log(PROVIDERS[index]); index = index + 1; getData(request, sender, sendResponse, PROVIDERS[index]); } else { console.log('csfd-magnets error:', error); sendResponse(error); } }); };
{ "content_hash": "d1ed7378f72574bf89dcf35dd9743b7f", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 99, "avg_line_length": 29.205128205128204, "alnum_prop": 0.617208077260755, "repo_name": "bartholomej/csfd-magnets", "id": "9ff1f6647733091d123cb9fbcc60325758f378af", "size": "1139", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/background.ts", "mode": "33188", "license": "mit", "language": [ { "name": "SCSS", "bytes": "1372" }, { "name": "Shell", "bytes": "68" }, { "name": "TypeScript", "bytes": "34491" } ], "symlink_target": "" }
<?php /* SVN FILE: $Id$ */ /** * Javascript Helper class file. * * PHP versions 4 and 5 * * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org) * Copyright 2009, Damian Jóźwiak (http://www.cakephp.bee.pl) * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. */ /** * Javascript Helper class for easy use of JavaScript. * * JavascriptHelper encloses all methods needed while working with JavaScript. * * @package cake * @subpackage cake.cake.libs.view.helpers */ class JavascriptHelper extends AppHelper { } ?>
{ "content_hash": "b28670cd79491f27f62993c9bc1e0bb8", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 78, "avg_line_length": 23.153846153846153, "alnum_prop": 0.6976744186046512, "repo_name": "katedoloverio/PCInventory", "id": "760d0105ed44aa3197c0b99bab00e7a48061c09c", "size": "604", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "app/View/Helper/JavascriptHelper.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ActionScript", "bytes": "32064" }, { "name": "ApacheConf", "bytes": "1034" }, { "name": "Batchfile", "bytes": "2888" }, { "name": "CSS", "bytes": "552875" }, { "name": "HTML", "bytes": "1994196" }, { "name": "JavaScript", "bytes": "2118546" }, { "name": "PHP", "bytes": "8610058" }, { "name": "Shell", "bytes": "7478" } ], "symlink_target": "" }
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model backend\models\DetailKompensasiDanBenefitBulananSearch */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="detail-kompensasi-dan-benefit-bulanan-search"> <?php $form = ActiveForm::begin([ 'action' => ['index'], 'method' => 'get', ]); ?> <?= $form->field($model, 'Id_KomBen') ?> <?= $form->field($model, 'Id_Karyawan') ?> <?= $form->field($model, 'Keterangan') ?> <?= $form->field($model, 'Jumlah') ?> <div class="form-group"> <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?> </div> <?php ActiveForm::end(); ?> </div>
{ "content_hash": "3182756f3ad25cdcc11e6d8ddd5be703", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 75, "avg_line_length": 23.87878787878788, "alnum_prop": 0.5621827411167513, "repo_name": "propensic7/propensic7", "id": "4377eaa7b932c00e933b48ad415d3ca965b54d5e", "size": "788", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "backend/views/detail-kompensasi-dan-benefit-bulanan/_search.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "1541" }, { "name": "CSS", "bytes": "3332" }, { "name": "PHP", "bytes": "214410" } ], "symlink_target": "" }
package org.nick.nfcsmime; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers; import org.spongycastle.asn1.x509.AlgorithmIdentifier; import org.spongycastle.operator.ContentSigner; public class MuscleCardContentSigner implements ContentSigner { private ByteArrayOutputStream baos = new ByteArrayOutputStream(); private MuscleCard msc; private String pin; public MuscleCardContentSigner(MuscleCard msc, String pin) { this.msc = msc; this.pin = pin; } @Override public AlgorithmIdentifier getAlgorithmIdentifier() { return AlgorithmIdentifier .getInstance(PKCSObjectIdentifiers.sha512WithRSAEncryption); } @Override public OutputStream getOutputStream() { return baos; } @Override public byte[] getSignature() { try { msc.select(); boolean pinValid = msc.verifyPin(pin); if (!pinValid) { throw new IllegalStateException("Invalid PIN"); } byte[] data = baos.toByteArray(); baos.reset(); return msc.sign(data); } catch (IOException e) { throw new RuntimeException(e); } } }
{ "content_hash": "e97657268ae02f0e3f894ff16bef6a88", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 76, "avg_line_length": 26.42, "alnum_prop": 0.6510219530658592, "repo_name": "nelenkov/nfc-smime", "id": "5e8a835f153ce0c01d7e8baa66c4440917da9aac", "size": "1321", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/org/nick/nfcsmime/MuscleCardContentSigner.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "38419" } ], "symlink_target": "" }
<?php namespace MagazineBundle\MagazineBundle; use MagazineBundle\MagazineBundle\Base\Issue as BaseIssue; /** * Skeleton subclass for representing a row from the 'issue' table. * * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as * long as it does not already exist in the output directory. * */ class Issue extends BaseIssue { }
{ "content_hash": "d47cc93c3f6330b275f10d4b5bbdfb81", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 67, "avg_line_length": 21.2, "alnum_prop": 0.75, "repo_name": "jessier3/vallen_challenge", "id": "5ebfb6b26ef6d1301e3b73265bd7501ed902c953", "size": "424", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/MagazineBundle/generated-classes/MagazineBundle/MagazineBundle/Issue.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3073" }, { "name": "CSS", "bytes": "104" }, { "name": "HTML", "bytes": "5669" }, { "name": "JavaScript", "bytes": "97" }, { "name": "PHP", "bytes": "244743" } ], "symlink_target": "" }
#pragma once #include "ElementBuilder.h" #include "IntegerParameterType.h" /** Specialized element builder for IntegerParameterType * * Dispatch to the correct template instance according to the signedness and * size. */ class IntegerParameterBuilder : public CElementBuilder { public: CElement *createElement(const CXmlElement &xmlElement) const override { size_t sizeInBits; sizeInBits = xmlElement.getAttribute("Size", sizeInBits) ? sizeInBits : 32; bool isSigned = false; xmlElement.getAttribute("Signed", isSigned); auto name = xmlElement.getNameAttribute(); switch (sizeInBits) { case 8: if (isSigned) { return new CIntegerParameterType<true, 8>(name); } return new CIntegerParameterType<false, 8>(name); case 16: if (isSigned) { return new CIntegerParameterType<true, 16>(name); } return new CIntegerParameterType<false, 16>(name); case 32: if (isSigned) { return new CIntegerParameterType<true, 32>(name); } return new CIntegerParameterType<false, 32>(name); default: return nullptr; } } };
{ "content_hash": "596ccedb696773d8f9dd94fbb61cb913", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 83, "avg_line_length": 28.377777777777776, "alnum_prop": 0.60610806577917, "repo_name": "dawagner/parameter-framework", "id": "d6204ace19888f9de73ddee7863c241254213017", "size": "2847", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "parameter/IntegerParameterBuilder.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "15260" }, { "name": "C++", "bytes": "1342192" }, { "name": "CMake", "bytes": "83634" }, { "name": "Python", "bytes": "666061" } ], "symlink_target": "" }
// Code generated by Wire protocol buffer compiler, do not edit. // Source file: one_of.proto at 20:1 package com.squareup.wire.protos.oneof; import com.squareup.wire.FieldEncoding; import com.squareup.wire.Message; import com.squareup.wire.ProtoAdapter; import com.squareup.wire.ProtoReader; import com.squareup.wire.ProtoWriter; import java.io.IOException; import java.lang.Integer; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.lang.StringBuilder; import okio.ByteString; public final class OneOfMessage extends Message<OneOfMessage, OneOfMessage.Builder> { public static final ProtoAdapter<OneOfMessage> ADAPTER = new ProtoAdapter<OneOfMessage>(FieldEncoding.LENGTH_DELIMITED, OneOfMessage.class) { @Override public int encodedSize(OneOfMessage value) { return (value.foo != null ? ProtoAdapter.INT32.encodedSizeWithTag(1, value.foo) : 0) + (value.bar != null ? ProtoAdapter.STRING.encodedSizeWithTag(3, value.bar) : 0) + (value.baz != null ? ProtoAdapter.STRING.encodedSizeWithTag(4, value.baz) : 0) + value.unknownFields().size(); } @Override public void encode(ProtoWriter writer, OneOfMessage value) throws IOException { if (value.foo != null) ProtoAdapter.INT32.encodeWithTag(writer, 1, value.foo); if (value.bar != null) ProtoAdapter.STRING.encodeWithTag(writer, 3, value.bar); if (value.baz != null) ProtoAdapter.STRING.encodeWithTag(writer, 4, value.baz); writer.writeBytes(value.unknownFields()); } @Override public OneOfMessage decode(ProtoReader reader) throws IOException { Builder builder = new Builder(); long token = reader.beginMessage(); for (int tag; (tag = reader.nextTag()) != -1;) { switch (tag) { case 1: builder.foo(ProtoAdapter.INT32.decode(reader)); break; case 3: builder.bar(ProtoAdapter.STRING.decode(reader)); break; case 4: builder.baz(ProtoAdapter.STRING.decode(reader)); break; default: { FieldEncoding fieldEncoding = reader.peekFieldEncoding(); Object value = fieldEncoding.rawProtoAdapter().decode(reader); builder.addUnknownField(tag, fieldEncoding, value); } } } reader.endMessage(token); return builder.build(); } @Override public OneOfMessage redact(OneOfMessage value) { Builder builder = value.newBuilder(); builder.clearUnknownFields(); return builder.build(); } }; private static final long serialVersionUID = 0L; public static final Integer DEFAULT_FOO = 0; public static final String DEFAULT_BAR = ""; public static final String DEFAULT_BAZ = ""; /** * What foo. */ public final Integer foo; /** * Such bar. */ public final String bar; /** * Nice baz. */ public final String baz; public OneOfMessage(Integer foo, String bar, String baz) { this(foo, bar, baz, ByteString.EMPTY); } public OneOfMessage(Integer foo, String bar, String baz, ByteString unknownFields) { super(unknownFields); if (countNonNull(foo, bar, baz) > 1) { throw new IllegalArgumentException("at most one of foo, bar, baz may be non-null"); } this.foo = foo; this.bar = bar; this.baz = baz; } @Override public Builder newBuilder() { Builder builder = new Builder(); builder.foo = foo; builder.bar = bar; builder.baz = baz; builder.addUnknownFields(unknownFields()); return builder; } @Override public boolean equals(Object other) { if (other == this) return true; if (!(other instanceof OneOfMessage)) return false; OneOfMessage o = (OneOfMessage) other; return equals(unknownFields(), o.unknownFields()) && equals(foo, o.foo) && equals(bar, o.bar) && equals(baz, o.baz); } @Override public int hashCode() { int result = super.hashCode; if (result == 0) { result = unknownFields().hashCode(); result = result * 37 + (foo != null ? foo.hashCode() : 0); result = result * 37 + (bar != null ? bar.hashCode() : 0); result = result * 37 + (baz != null ? baz.hashCode() : 0); super.hashCode = result; } return result; } @Override public String toString() { StringBuilder builder = new StringBuilder(); if (foo != null) builder.append(", foo=").append(foo); if (bar != null) builder.append(", bar=").append(bar); if (baz != null) builder.append(", baz=").append(baz); return builder.replace(0, 2, "OneOfMessage{").append('}').toString(); } public static final class Builder extends Message.Builder<OneOfMessage, Builder> { public Integer foo; public String bar; public String baz; public Builder() { } /** * What foo. */ public Builder foo(Integer foo) { this.foo = foo; this.bar = null; this.baz = null; return this; } /** * Such bar. */ public Builder bar(String bar) { this.bar = bar; this.foo = null; this.baz = null; return this; } /** * Nice baz. */ public Builder baz(String baz) { this.baz = baz; this.foo = null; this.bar = null; return this; } @Override public OneOfMessage build() { return new OneOfMessage(foo, bar, baz, buildUnknownFields()); } } }
{ "content_hash": "18256fb784e0d182f90b200de4e56180", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 143, "avg_line_length": 28.6984126984127, "alnum_prop": 0.6391961651917404, "repo_name": "brandingbrand/wire", "id": "8b09c85d88d7d64e77ae1a4f7309c89b74abfc7d", "size": "5424", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "wire-runtime/src/test/proto-java/com/squareup/wire/protos/oneof/OneOfMessage.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1429627" }, { "name": "Protocol Buffer", "bytes": "64841" }, { "name": "Shell", "bytes": "3737" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_10-beta) on Fri Dec 11 16:07:43 PST 2009 --> <TITLE> NoSuchElementException (Java Card API, Connected Edition) </TITLE> <META NAME="date" CONTENT="2009-12-11"> <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="NoSuchElementException (Java Card API, Connected Edition)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="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="../../java/util/MissingResourceException.html" title="class in java.util"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../java/util/Random.html" title="class in java.util"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?java/util/NoSuchElementException.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NoSuchElementException.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="#methods_inherited_from_class_java.lang.Throwable">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;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> java.util</FONT> <BR> Class NoSuchElementException</H2> <PRE> <A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A> <IMG SRC="../../resources/inherit.gif" ALT="extended by "><A HREF="../../java/lang/Throwable.html" title="class in java.lang">java.lang.Throwable</A> <IMG SRC="../../resources/inherit.gif" ALT="extended by "><A HREF="../../java/lang/Exception.html" title="class in java.lang">java.lang.Exception</A> <IMG SRC="../../resources/inherit.gif" ALT="extended by "><A HREF="../../java/lang/RuntimeException.html" title="class in java.lang">java.lang.RuntimeException</A> <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>java.util.NoSuchElementException</B> </PRE> <HR> <DL> <DT><PRE><FONT SIZE="-1"><A HREF="../../javacardx/framework/TransactionType.html" title="annotation in javacardx.framework">@TransactionType</A>(<A HREF="../../javacardx/framework/TransactionType.html#value()">value</A>=<A HREF="../../javacardx/framework/TransactionTypeValue.html#NOT_SUPPORTED">NOT_SUPPORTED</A>) </FONT>public class <B>NoSuchElementException</B><DT>extends <A HREF="../../java/lang/RuntimeException.html" title="class in java.lang">RuntimeException</A></DL> </PRE> <P> Thrown by the <code>nextElement</code> method of an <code>Enumeration</code> to indicate that there are no more elements in the enumeration. <p> Direct instances of this exception class are not bound to any context and can be passed between contexts without any restrictions. Objects created and returned by the methods of this class are owned by the caller. In particular, a call to the <A HREF="../../java/lang/Throwable.html#getMessage()"><CODE>Throwable.getMessage()</CODE></A> returns a String instance bound to the owner context of the caller. <p> See <em>Runtime Environment Specification for the Java Card Platform, Connected Edition</em>, chapter 7 for details regarding transfer of ownership. <P> <P> <DL> <DT><B>Since:</B></DT> <DD>JDK1.0, CLDC 1.0, Java card 3.0</DD> <DT><B>See Also:</B><DD><A HREF="../../java/util/Enumeration.html" title="interface in java.util"><CODE>Enumeration</CODE></A>, <A HREF="../../java/util/Enumeration.html#nextElement()"><CODE>Enumeration.nextElement()</CODE></A></DL> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <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="../../java/util/NoSuchElementException.html#NoSuchElementException()">NoSuchElementException</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <code>NoSuchElementException</code> with <tt>null</tt> as its error message string.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../java/util/NoSuchElementException.html#NoSuchElementException(java.lang.String)">NoSuchElementException</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;s)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <code>NoSuchElementException</code>, saving a reference to the error message string <tt>s</tt> for later retrieval by the <tt>getMessage</tt> method.</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Throwable"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Throwable.html" title="class in java.lang">Throwable</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../java/lang/Throwable.html#getMessage()">getMessage</A>, <A HREF="../../java/lang/Throwable.html#printStackTrace()">printStackTrace</A>, <A HREF="../../java/lang/Throwable.html#toString()">toString</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <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="NoSuchElementException()"><!-- --></A><H3> NoSuchElementException</H3> <PRE> public <B>NoSuchElementException</B>()</PRE> <DL> <DD>Constructs a <code>NoSuchElementException</code> with <tt>null</tt> as its error message string. <P> </DL> <HR> <A NAME="NoSuchElementException(java.lang.String)"><!-- --></A><H3> NoSuchElementException</H3> <PRE> public <B>NoSuchElementException</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;s)</PRE> <DL> <DD>Constructs a <code>NoSuchElementException</code>, saving a reference to the error message string <tt>s</tt> for later retrieval by the <tt>getMessage</tt> method. <P> <DL> <DT><B>Parameters:</B><DD><CODE>s</CODE> - the detail message.</DL> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="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="../../java/util/MissingResourceException.html" title="class in java.util"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../java/util/Random.html" title="class in java.util"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?java/util/NoSuchElementException.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="NoSuchElementException.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="#methods_inherited_from_class_java.lang.Throwable">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;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <a href=../../COPYRIGHT_jcspecs.html>Copyright</a> (c) 2009 Sun Microsystems, Inc. All rights reserved. </BODY> </HTML>
{ "content_hash": "c4738aaeeabe53bba6c899346e328d0c", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 523, "avg_line_length": 47.48571428571429, "alnum_prop": 0.6408694344163658, "repo_name": "evolution411/symfonyfos", "id": "7c96ad57c463137e0bad3782f6af98ed6cb1abfa", "size": "13296", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Acme/HelloBundle/Resources/public/images/NetBeans 7.3/javacard/JCDK3.0.2_ConnectedEdition/docs/api/java/util/NoSuchElementException.html", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "2647" }, { "name": "Batchfile", "bytes": "68313" }, { "name": "CSS", "bytes": "115896" }, { "name": "HTML", "bytes": "9995101" }, { "name": "Java", "bytes": "163040" }, { "name": "JavaScript", "bytes": "25142" }, { "name": "PHP", "bytes": "3222652" }, { "name": "Perl", "bytes": "10177" }, { "name": "Python", "bytes": "3401" }, { "name": "Shell", "bytes": "129432" }, { "name": "XSLT", "bytes": "221100" } ], "symlink_target": "" }
""" A connection to the VMware ESX platform. **Related Flags** :vmwareapi_host_ip: IP address or Name of VMware ESX/VC server. :vmwareapi_host_username: Username for connection to VMware ESX/VC Server. :vmwareapi_host_password: Password for connection to VMware ESX/VC Server. :vmwareapi_cluster_name: Name of a VMware Cluster ComputeResource. :vmwareapi_task_poll_interval: The interval (seconds) used for polling of remote tasks (default: 5.0). :vmwareapi_api_retry_count: The API retry count in case of failure such as network failures (socket errors etc.) (default: 10). :vnc_port: VNC starting port (default: 5900) :vnc_port_total: Total number of VNC ports (default: 10000) :vnc_password: VNC password :use_linked_clone: Whether to use linked clone (default: True) """ import time from eventlet import event from oslo.config import cfg from nova import exception from nova.openstack.common import jsonutils from nova.openstack.common import log as logging from nova.openstack.common import loopingcall from nova.virt import driver from nova.virt.vmwareapi import error_util from nova.virt.vmwareapi import host from nova.virt.vmwareapi import vim from nova.virt.vmwareapi import vim_util from nova.virt.vmwareapi import vm_util from nova.virt.vmwareapi import vmops from nova.virt.vmwareapi import volumeops LOG = logging.getLogger(__name__) vmwareapi_opts = [ cfg.StrOpt('vmwareapi_host_ip', default=None, help='URL for connection to VMware ESX/VC host. Required if ' 'compute_driver is vmwareapi.VMwareESXDriver or ' 'vmwareapi.VMwareVCDriver.'), cfg.StrOpt('vmwareapi_host_username', default=None, help='Username for connection to VMware ESX/VC host. ' 'Used only if compute_driver is ' 'vmwareapi.VMwareESXDriver or vmwareapi.VMwareVCDriver.'), cfg.StrOpt('vmwareapi_host_password', default=None, help='Password for connection to VMware ESX/VC host. ' 'Used only if compute_driver is ' 'vmwareapi.VMwareESXDriver or vmwareapi.VMwareVCDriver.', secret=True), cfg.StrOpt('vmwareapi_cluster_name', default=None, help='Name of a VMware Cluster ComputeResource. ' 'Used only if compute_driver is ' 'vmwareapi.VMwareVCDriver.'), cfg.FloatOpt('vmwareapi_task_poll_interval', default=5.0, help='The interval used for polling of remote tasks. ' 'Used only if compute_driver is ' 'vmwareapi.VMwareESXDriver or ' 'vmwareapi.VMwareVCDriver.'), cfg.IntOpt('vmwareapi_api_retry_count', default=10, help='The number of times we retry on failures, e.g., ' 'socket error, etc. ' 'Used only if compute_driver is ' 'vmwareapi.VMwareESXDriver or vmwareapi.VMwareVCDriver.'), cfg.IntOpt('vnc_port', default=5900, help='VNC starting port'), cfg.IntOpt('vnc_port_total', default=10000, help='Total number of VNC ports'), cfg.StrOpt('vnc_password', default=None, help='VNC password', secret=True), cfg.BoolOpt('use_linked_clone', default=True, help='Whether to use linked clone'), ] CONF = cfg.CONF CONF.register_opts(vmwareapi_opts) TIME_BETWEEN_API_CALL_RETRIES = 2.0 class Failure(Exception): """Base Exception class for handling task failures.""" def __init__(self, details): self.details = details def __str__(self): return str(self.details) class VMwareESXDriver(driver.ComputeDriver): """The ESX host connection object.""" def __init__(self, virtapi, read_only=False, scheme="https"): super(VMwareESXDriver, self).__init__(virtapi) self._host_ip = CONF.vmwareapi_host_ip host_username = CONF.vmwareapi_host_username host_password = CONF.vmwareapi_host_password api_retry_count = CONF.vmwareapi_api_retry_count if not self._host_ip or host_username is None or host_password is None: raise Exception(_("Must specify vmwareapi_host_ip," "vmwareapi_host_username " "and vmwareapi_host_password to use" "compute_driver=vmwareapi.VMwareESXDriver or " "vmwareapi.VMwareVCDriver")) self._session = VMwareAPISession(self._host_ip, host_username, host_password, api_retry_count, scheme=scheme) self._volumeops = volumeops.VMwareVolumeOps(self._session) self._vmops = vmops.VMwareVMOps(self._session, self.virtapi, self._volumeops) self._host = host.Host(self._session) self._host_state = None @property def host_state(self): if not self._host_state: self._host_state = host.HostState(self._session, self._host_ip) return self._host_state def init_host(self, host): """Do the initialization that needs to be done.""" # FIXME(sateesh): implement this pass def legacy_nwinfo(self): return False def list_instances(self): """List VM instances.""" return self._vmops.list_instances() def spawn(self, context, instance, image_meta, injected_files, admin_password, network_info=None, block_device_info=None): """Create VM instance.""" self._vmops.spawn(context, instance, image_meta, network_info, block_device_info) def snapshot(self, context, instance, name, update_task_state): """Create snapshot from a running VM instance.""" self._vmops.snapshot(context, instance, name, update_task_state) def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None): """Reboot VM instance.""" self._vmops.reboot(instance, network_info) def destroy(self, instance, network_info, block_device_info=None, destroy_disks=True): """Destroy VM instance.""" self._vmops.destroy(instance, network_info, destroy_disks) def pause(self, instance): """Pause VM instance.""" self._vmops.pause(instance) def unpause(self, instance): """Unpause paused VM instance.""" self._vmops.unpause(instance) def suspend(self, instance): """Suspend the specified instance.""" self._vmops.suspend(instance) def resume(self, instance, network_info, block_device_info=None): """Resume the suspended VM instance.""" self._vmops.resume(instance) def rescue(self, context, instance, network_info, image_meta, rescue_password): """Rescue the specified instance.""" self._vmops.rescue(context, instance, network_info, image_meta) def unrescue(self, instance, network_info): """Unrescue the specified instance.""" self._vmops.unrescue(instance) def power_off(self, instance): """Power off the specified instance.""" self._vmops.power_off(instance) def power_on(self, instance): """Power on the specified instance.""" self._vmops.power_on(instance) def poll_rebooting_instances(self, timeout, instances): """Poll for rebooting instances.""" self._vmops.poll_rebooting_instances(timeout, instances) def get_info(self, instance): """Return info about the VM instance.""" return self._vmops.get_info(instance) def get_diagnostics(self, instance): """Return data about VM diagnostics.""" return self._vmops.get_info(instance) def get_console_output(self, instance): """Return snapshot of console.""" return self._vmops.get_console_output(instance) def get_vnc_console(self, instance): """Return link to instance's VNC console.""" return self._vmops.get_vnc_console(instance) def get_volume_connector(self, instance): """Return volume connector information.""" return self._volumeops.get_volume_connector(instance) def get_host_ip_addr(self): """Retrieves the IP address of the ESX host.""" return self._host_ip def attach_volume(self, connection_info, instance, mountpoint): """Attach volume storage to VM instance.""" return self._volumeops.attach_volume(connection_info, instance, mountpoint) def detach_volume(self, connection_info, instance, mountpoint): """Detach volume storage to VM instance.""" return self._volumeops.detach_volume(connection_info, instance, mountpoint) def get_console_pool_info(self, console_type): """Get info about the host on which the VM resides.""" return {'address': CONF.vmwareapi_host_ip, 'username': CONF.vmwareapi_host_username, 'password': CONF.vmwareapi_host_password} def get_available_resource(self, nodename): """Retrieve resource info. This method is called when nova-compute launches, and as part of a periodic task. :returns: dictionary describing resources """ host_stats = self.get_host_stats(refresh=True) # Updating host information dic = {'vcpus': host_stats["vcpus"], 'memory_mb': host_stats['host_memory_total'], 'local_gb': host_stats['disk_total'], 'vcpus_used': 0, 'memory_mb_used': host_stats['host_memory_total'] - host_stats['host_memory_free'], 'local_gb_used': host_stats['disk_used'], 'hypervisor_type': host_stats['hypervisor_type'], 'hypervisor_version': host_stats['hypervisor_version'], 'hypervisor_hostname': host_stats['hypervisor_hostname'], 'cpu_info': jsonutils.dumps(host_stats['cpu_info'])} return dic def update_host_status(self): """Update the status info of the host, and return those values to the calling program.""" return self.host_state.update_status() def get_host_stats(self, refresh=False): """Return the current state of the host. If 'refresh' is True, run the update first.""" return self.host_state.get_host_stats(refresh=refresh) def host_power_action(self, host, action): """Reboots, shuts down or powers up the host.""" return self._host.host_power_action(host, action) def host_maintenance_mode(self, host, mode): """Start/Stop host maintenance window. On start, it triggers guest VMs evacuation.""" return self._host.host_maintenance_mode(host, mode) def set_host_enabled(self, host, enabled): """Sets the specified host's ability to accept new instances.""" return self._host.set_host_enabled(host, enabled) def inject_network_info(self, instance, network_info): """inject network info for specified instance.""" self._vmops.inject_network_info(instance, network_info) def plug_vifs(self, instance, network_info): """Plug VIFs into networks.""" self._vmops.plug_vifs(instance, network_info) def unplug_vifs(self, instance, network_info): """Unplug VIFs from networks.""" self._vmops.unplug_vifs(instance, network_info) def list_interfaces(self, instance_name): """ Return the IDs of all the virtual network interfaces attached to the specified instance, as a list. These IDs are opaque to the caller (they are only useful for giving back to this layer as a parameter to interface_stats). These IDs only need to be unique for a given instance. """ return self._vmops.list_interfaces(instance_name) class VMwareVCDriver(VMwareESXDriver): """The ESX host connection object.""" def __init__(self, virtapi, read_only=False, scheme="https"): super(VMwareVCDriver, self).__init__(virtapi) self._cluster_name = CONF.vmwareapi_cluster_name if not self._cluster_name: self._cluster = None else: self._cluster = vm_util.get_cluster_ref_from_name( self._session, self._cluster_name) if self._cluster is None: raise exception.NotFound(_("VMware Cluster %s is not found") % self._cluster_name) self._volumeops = volumeops.VMwareVolumeOps(self._session, self._cluster) self._vmops = vmops.VMwareVMOps(self._session, self.virtapi, self._volumeops, self._cluster) self._vc_state = None @property def host_state(self): if not self._vc_state: self._vc_state = host.VCState(self._session, self._host_ip, self._cluster) return self._vc_state def migrate_disk_and_power_off(self, context, instance, dest, instance_type, network_info, block_device_info=None): """ Transfers the disk of a running instance in multiple phases, turning off the instance before the end. """ return self._vmops.migrate_disk_and_power_off(context, instance, dest, instance_type) def confirm_migration(self, migration, instance, network_info): """Confirms a resize, destroying the source VM.""" self._vmops.confirm_migration(migration, instance, network_info) def finish_revert_migration(self, instance, network_info, block_device_info=None): """Finish reverting a resize, powering back on the instance.""" self._vmops.finish_revert_migration(instance) def finish_migration(self, context, migration, instance, disk_info, network_info, image_meta, resize_instance=False, block_device_info=None): """Completes a resize, turning on the migrated instance.""" self._vmops.finish_migration(context, migration, instance, disk_info, network_info, image_meta, resize_instance) def live_migration(self, context, instance_ref, dest, post_method, recover_method, block_migration=False, migrate_data=None): """Live migration of an instance to another host.""" self._vmops.live_migration(context, instance_ref, dest, post_method, recover_method, block_migration) class VMwareAPISession(object): """ Sets up a session with the ESX host and handles all the calls made to the host. """ def __init__(self, host_ip, host_username, host_password, api_retry_count, scheme="https"): self._host_ip = host_ip self._host_username = host_username self._host_password = host_password self.api_retry_count = api_retry_count self._scheme = scheme self._session_id = None self.vim = None self._create_session() def _get_vim_object(self): """Create the VIM Object instance.""" return vim.Vim(protocol=self._scheme, host=self._host_ip) def _create_session(self): """Creates a session with the ESX host.""" while True: try: # Login and setup the session with the ESX host for making # API calls self.vim = self._get_vim_object() session = self.vim.Login( self.vim.get_service_content().sessionManager, userName=self._host_username, password=self._host_password) # Terminate the earlier session, if possible ( For the sake of # preserving sessions as there is a limit to the number of # sessions we can have ) if self._session_id: try: self.vim.TerminateSession( self.vim.get_service_content().sessionManager, sessionId=[self._session_id]) except Exception as excep: # This exception is something we can live with. It is # just an extra caution on our side. The session may # have been cleared. We could have made a call to # SessionIsActive, but that is an overhead because we # anyway would have to call TerminateSession. LOG.debug(excep) self._session_id = session.key return except Exception as excep: LOG.critical(_("In vmwareapi:_create_session, " "got this exception: %s") % excep) raise exception.NovaException(excep) def __del__(self): """Logs-out the session.""" # Logout to avoid un-necessary increase in session count at the # ESX host try: self.vim.Logout(self.vim.get_service_content().sessionManager) except Exception as excep: # It is just cautionary on our part to do a logout in del just # to ensure that the session is not left active. LOG.debug(excep) def _is_vim_object(self, module): """Check if the module is a VIM Object instance.""" return isinstance(module, vim.Vim) def _call_method(self, module, method, *args, **kwargs): """ Calls a method within the module specified with args provided. """ args = list(args) retry_count = 0 exc = None last_fault_list = [] while True: try: if not self._is_vim_object(module): # If it is not the first try, then get the latest # vim object if retry_count > 0: args = args[1:] args = [self.vim] + args retry_count += 1 temp_module = module for method_elem in method.split("."): temp_module = getattr(temp_module, method_elem) return temp_module(*args, **kwargs) except error_util.VimFaultException as excep: # If it is a Session Fault Exception, it may point # to a session gone bad. So we try re-creating a session # and then proceeding ahead with the call. exc = excep if error_util.FAULT_NOT_AUTHENTICATED in excep.fault_list: # Because of the idle session returning an empty # RetrievePropertiesResponse and also the same is returned # when there is say empty answer to the query for # VMs on the host ( as in no VMs on the host), we have no # way to differentiate. # So if the previous response was also am empty response # and after creating a new session, we get the same empty # response, then we are sure of the response being supposed # to be empty. if error_util.FAULT_NOT_AUTHENTICATED in last_fault_list: return [] last_fault_list = excep.fault_list self._create_session() else: # No re-trying for errors for API call has gone through # and is the caller's fault. Caller should handle these # errors. e.g, InvalidArgument fault. break except error_util.SessionOverLoadException as excep: # For exceptions which may come because of session overload, # we retry exc = excep except Exception as excep: # If it is a proper exception, say not having furnished # proper data in the SOAP call or the retry limit having # exceeded, we raise the exception exc = excep break # If retry count has been reached then break and # raise the exception if retry_count > self.api_retry_count: break time.sleep(TIME_BETWEEN_API_CALL_RETRIES) LOG.critical(_("In vmwareapi:_call_method, " "got this exception: %s") % exc) raise def _get_vim(self): """Gets the VIM object reference.""" if self.vim is None: self._create_session() return self.vim def _wait_for_task(self, instance_uuid, task_ref): """ Return a Deferred that will give the result of the given task. The task is polled until it completes. """ done = event.Event() loop = loopingcall.FixedIntervalLoopingCall(self._poll_task, instance_uuid, task_ref, done) loop.start(CONF.vmwareapi_task_poll_interval) ret_val = done.wait() loop.stop() return ret_val def _poll_task(self, instance_uuid, task_ref, done): """ Poll the given task, and fires the given Deferred if we get a result. """ try: task_info = self._call_method(vim_util, "get_dynamic_property", task_ref, "Task", "info") task_name = task_info.name if task_info.state in ['queued', 'running']: return elif task_info.state == 'success': LOG.debug(_("Task [%(task_name)s] %(task_ref)s " "status: success") % locals()) done.send("success") else: error_info = str(task_info.error.localizedMessage) LOG.warn(_("Task [%(task_name)s] %(task_ref)s " "status: error %(error_info)s") % locals()) done.send_exception(exception.NovaException(error_info)) except Exception as excep: LOG.warn(_("In vmwareapi:_poll_task, Got this error %s") % excep) done.send_exception(excep)
{ "content_hash": "06a23e9624d8030281110e6c4a2c2769", "timestamp": "", "source": "github", "line_count": 566, "max_line_length": 79, "avg_line_length": 41.52650176678445, "alnum_prop": 0.5639891082368959, "repo_name": "sridevikoushik31/nova", "id": "4fa1614e0335086396ccd81f2a37a960e8816e44", "size": "24301", "binary": false, "copies": "1", "ref": "refs/heads/port_id_in_vif_on_devide", "path": "nova/virt/vmwareapi/driver.py", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "7403" }, { "name": "Python", "bytes": "9944606" }, { "name": "Ruby", "bytes": "782" }, { "name": "Shell", "bytes": "17522" } ], "symlink_target": "" }
'use strict'; // MODULES // var bench = require( '@stdlib/bench' ); var isArray = require( '@stdlib/assert/is-array' ); var randu = require( '@stdlib/random/base/randu' ); var defineProperty = require( '@stdlib/utils/define-property' ); var pkg = require( './../package.json' ).name; var inheritedWritablePropertySymbols = require( './../lib' ); // eslint-disable-line id-length // MAIN // bench( pkg, function benchmark( b ) { var out; var obj; var i; function Foo() { this.a = 'beep'; this.b = 'boop'; this.c = [ 1, 2, 3 ]; this.d = {}; this.e = null; this.f = randu(); defineProperty( this, 'g', { 'value': 'bar', 'configurable': true, 'writable': false, 'enumerable': true }); return this; } Foo.prototype.h = [ 'foo' ]; obj = new Foo(); b.tic(); for ( i = 0; i < b.iterations; i++ ) { obj.f = randu(); out = inheritedWritablePropertySymbols( obj ); if ( typeof out !== 'object' ) { b.fail( 'should return an array' ); } } b.toc(); if ( !isArray( out ) ) { b.fail( 'should return an array' ); } b.pass( 'benchmark finished' ); b.end(); });
{ "content_hash": "34aede575f0b339e62e2b2398b083fb7", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 94, "avg_line_length": 19.875, "alnum_prop": 0.5831087151841868, "repo_name": "stdlib-js/stdlib", "id": "d9616094893c1954051e7c6ab86f48550f56de87", "size": "1729", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "lib/node_modules/@stdlib/utils/inherited-writable-property-symbols/benchmark/benchmark.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "21739" }, { "name": "C", "bytes": "15336495" }, { "name": "C++", "bytes": "1349482" }, { "name": "CSS", "bytes": "58039" }, { "name": "Fortran", "bytes": "198059" }, { "name": "HTML", "bytes": "56181" }, { "name": "Handlebars", "bytes": "16114" }, { "name": "JavaScript", "bytes": "85975525" }, { "name": "Julia", "bytes": "1508654" }, { "name": "Makefile", "bytes": "4806816" }, { "name": "Python", "bytes": "3343697" }, { "name": "R", "bytes": "576612" }, { "name": "Shell", "bytes": "559315" }, { "name": "TypeScript", "bytes": "19309407" }, { "name": "WebAssembly", "bytes": "5980" } ], "symlink_target": "" }
/* ** PairSum.java ** Author: Sushil Parti Problem: Given an array of numbers, find all combinations of two numbers whose sum is a given number n by using a sorted array */ import java.util.Arrays; public class PairSum { public static void main(String[] args) { int[] numbers = {10,11,7,8,9,4,25,15,9,6,23,5}; printValidPairs(numbers, numbers.length, 15); } private static void printValidPairs(int[] numbers, int size, int sum) { //first sort the array Arrays.sort(numbers); //now use binary search to find sum - each element in the array for(int i=0; i<size; i++) { if(numbers[i] < sum) { System.out.println("Binary Search for : "+ numbers[i]+" :: "+ (sum - numbers[i])); int x = binarySearch(sum - numbers[i], numbers); if(x != -1) { System.out.println("Pair: "+ numbers[i] +" :: " + x); } } } } private static int binarySearch(int a, int[] array) { while(array.length > 0) { int middle = array.length/2; if(array[middle] == a) { return a; } else if(array[middle] > a) { array = Arrays.copyOfRange(array, 0, middle); } else { array = Arrays.copyOfRange(array, middle, array.length); } } return -1; } }
{ "content_hash": "812ee0297d6b300482f6055c5b907a4d", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 127, "avg_line_length": 20.728813559322035, "alnum_prop": 0.6116107931316435, "repo_name": "sushilparti/leisure", "id": "050d08bb3e9e9b7ed4a90164d3084538ae0f637c", "size": "1223", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "General/PairSum.java", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "1974" }, { "name": "HTML", "bytes": "449" }, { "name": "Java", "bytes": "88047" }, { "name": "JavaScript", "bytes": "3924" } ], "symlink_target": "" }
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [puppeteer](./puppeteer.md) &gt; [Protocol](./puppeteer.protocol.md) &gt; [Browser](./puppeteer.protocol.browser.md) &gt; [SetDockTileRequest](./puppeteer.protocol.browser.setdocktilerequest.md) &gt; [badgeLabel](./puppeteer.protocol.browser.setdocktilerequest.badgelabel.md) ## Protocol.Browser.SetDockTileRequest.badgeLabel property <b>Signature:</b> ```typescript badgeLabel?: string; ```
{ "content_hash": "efff1287cd8e322db1066b6ee7e6743e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 299, "avg_line_length": 46.54545454545455, "alnum_prop": 0.728515625, "repo_name": "GoogleChrome/puppeteer", "id": "080b70b752455ba3c692329563878e7da658b683", "size": "512", "binary": false, "copies": "1", "ref": "refs/heads/1060080_cross_origin_iframe", "path": "new-docs/puppeteer.protocol.browser.setdocktilerequest.badgelabel.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "393" }, { "name": "HTML", "bytes": "17624" }, { "name": "JavaScript", "bytes": "1087838" }, { "name": "TypeScript", "bytes": "8164" } ], "symlink_target": "" }
namespace gfx { class GLContext; class GLSurface; } namespace gpu { class StreamTextureManager; namespace gles2 { class ContextGroup; class QueryManager; class MockGLES2Decoder : public GLES2Decoder { public: MockGLES2Decoder(); virtual ~MockGLES2Decoder(); MOCK_METHOD7(Initialize, bool(const scoped_refptr<gfx::GLSurface>& surface, const scoped_refptr<gfx::GLContext>& context, bool offscreen, const gfx::Size& size, const DisallowedFeatures& disallowed_features, const char* allowed_extensions, const std::vector<int32>& attribs)); MOCK_METHOD1(Destroy, void(bool have_context)); MOCK_METHOD1(SetSurface, void(const scoped_refptr<gfx::GLSurface>& surface)); MOCK_METHOD2(SetParent, bool(GLES2Decoder* parent, uint32 parent_texture_id)); MOCK_METHOD1(ResizeOffscreenFrameBuffer, bool(const gfx::Size& size)); MOCK_METHOD0(MakeCurrent, bool()); MOCK_METHOD0(ReleaseCurrent, void()); MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id)); MOCK_METHOD0(GetGLES2Util, GLES2Util*()); MOCK_METHOD0(GetGLSurface, gfx::GLSurface*()); MOCK_METHOD0(GetGLContext, gfx::GLContext*()); MOCK_METHOD0(GetContextGroup, ContextGroup*()); MOCK_METHOD0(ProcessPendingQueries, bool()); MOCK_METHOD0(GetQueryManager, gpu::gles2::QueryManager*()); MOCK_METHOD0(GetVertexArrayManager, gpu::gles2::VertexArrayManager*()); MOCK_METHOD1(SetResizeCallback, void(const base::Callback<void(gfx::Size)>&)); MOCK_METHOD1(SetStreamTextureManager, void(StreamTextureManager*)); MOCK_METHOD3(DoCommand, error::Error(unsigned int command, unsigned int arg_count, const void* cmd_data)); MOCK_METHOD2(GetServiceTextureId, bool(uint32 client_texture_id, uint32* service_texture_id)); MOCK_METHOD0(GetContextLostReason, error::ContextLostReason()); MOCK_CONST_METHOD1(GetCommandName, const char*(unsigned int command_id)); MOCK_METHOD9(ClearLevel, bool( unsigned service_id, unsigned bind_target, unsigned target, int level, unsigned format, unsigned type, int width, int height, bool is_texture_immutable)); MOCK_METHOD0(GetGLError, uint32()); MOCK_METHOD1(SetMsgCallback, void(const MsgCallback& callback)); MOCK_METHOD0(GetTextureUploadCount, uint32()); MOCK_METHOD0(GetTotalTextureUploadTime, base::TimeDelta()); MOCK_METHOD0(GetTotalProcessingCommandsTime, base::TimeDelta()); MOCK_METHOD1(AddProcessingCommandsTime, void(base::TimeDelta)); DISALLOW_COPY_AND_ASSIGN(MockGLES2Decoder); }; } // namespace gles2 } // namespace gpu #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_MOCK_H_
{ "content_hash": "cdfac1359c8c76f8519b7af95f29f03a", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 80, "avg_line_length": 39.06849315068493, "alnum_prop": 0.6858345021037868, "repo_name": "junmin-zhu/chromium-rivertrail", "id": "d2a14b4c5a62174d19e3e25a935063344ec31f82", "size": "3382", "binary": false, "copies": "1", "ref": "refs/heads/v8-binding", "path": "gpu/command_buffer/service/gles2_cmd_decoder_mock.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "1172794" }, { "name": "Awk", "bytes": "9519" }, { "name": "C", "bytes": "75806807" }, { "name": "C#", "bytes": "1132" }, { "name": "C++", "bytes": "145161929" }, { "name": "DOT", "bytes": "1559" }, { "name": "F#", "bytes": "381" }, { "name": "Java", "bytes": "1546515" }, { "name": "JavaScript", "bytes": "18675242" }, { "name": "Logos", "bytes": "4517" }, { "name": "Matlab", "bytes": "5234" }, { "name": "Objective-C", "bytes": "6981387" }, { "name": "PHP", "bytes": "97817" }, { "name": "Perl", "bytes": "926245" }, { "name": "Python", "bytes": "8088373" }, { "name": "R", "bytes": "262" }, { "name": "Ragel in Ruby Host", "bytes": "3239" }, { "name": "Shell", "bytes": "1513486" }, { "name": "Tcl", "bytes": "277077" }, { "name": "XML", "bytes": "13493" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "7d3702adcf6875c0ff11549c289f8dd2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "428e8430f5d55f5606c868b99f53b33c35d7c8aa", "size": "207", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Brassicales/Brassicaceae/Iberis/Iberis carnosa/Iberis carnosa embergeri/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
{% extends './html.html' %} {% block title %} {%parent%} | {{title}} | {{pageSlogan}} {% endblock %} {% block contents %} <article id="article"> <div id="header-title"> <div class="container"> <div class="row header"> <div class="col-md-12 text-center"> <h1>{{ title|safe }}</h1> <small>by <img class="avatar" src="images/authors/teaser/{{author|slug}}.jpg" alt="author" /> {{author|safe}} on {{date|date('F jS Y')}}</small> </div> </div> </div> </div> {% if mainImage %} <div id="main-pic"> <div class="container"> <div class="row"> <div class="col-md-12"> <img src="{{mainImage}}" class="img-responsive blog-main-image" alt="blogpost" /> </div> </div> </div> </div> {% endif %} <div id="page-content"> <div class="container"> {{ contents|safe }} </div> </div> <div id="email-subscribe"> <div class="container text-center"> <a href="http://eepurl.com/caz4hn"> <i class="fa fa-envelope"></i> Click here to get instant notifications on all our most recent posts <i class="fa fa-envelope"></i> </a> </div> </div> </article> {% include '../components/organisms/recent/recent.html' %} {% include '../components/organisms/cta/cta.html' %} {% include '../components/organisms/social/social.html' %} {% endblock %}
{ "content_hash": "5f3b49ab4fd42e1a059a44f1aeab05f5", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 156, "avg_line_length": 26.75, "alnum_prop": 0.5173564753004005, "repo_name": "kalabox/tandem", "id": "4c25f3fdd83588436df3c13fcc5cc80ec9c25019", "size": "1498", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/layouts/article.html", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "39305" }, { "name": "CSS", "bytes": "120806" }, { "name": "HTML", "bytes": "1010097" }, { "name": "JavaScript", "bytes": "10380" }, { "name": "PHP", "bytes": "436" } ], "symlink_target": "" }
.welcome-body { background-color: lightyellow; font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; margin: 0; padding: 20px; } .welcome-body h1 { font-size: larger; }
{ "content_hash": "1c66b88c403eb525dd22aa558789afe7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 82, "avg_line_length": 21.5, "alnum_prop": 0.6372093023255814, "repo_name": "angular-template/ng1-template", "id": "94c97c41fe8c4dcb0e47acdb43aa9076ddc47dce", "size": "215", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "client/modules/common/welcome/welcome.css", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "339" }, { "name": "CSS", "bytes": "695" }, { "name": "HTML", "bytes": "499" }, { "name": "JavaScript", "bytes": "2273" }, { "name": "Shell", "bytes": "40" }, { "name": "TypeScript", "bytes": "29826" } ], "symlink_target": "" }
/** * references: * https://developer.chrome.com/apps/first_app * https://developer.chrome.com/apps/fileSystem * https://developer.chrome.com/apps/app_storage * http://www.html5rocks.com/en/tutorials/file/filesystem/ * https://developer.chrome.com/extensions/messaging */ var done_init = false; chrome.app.runtime.onLaunched.addListener(init); function init() { if (done_init) { return; } // start the main window to start measurements chrome.app.window.create('filechooser.html', { bounds: {width: 500, height: 170}, id: "ChromePerformanceCVSWriterAppWindow"} ); done_init = true; }
{ "content_hash": "ade0e245370972fcb1742b9c14f8c9da", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 58, "avg_line_length": 23.923076923076923, "alnum_prop": 0.7009646302250804, "repo_name": "dosx3/Chrome-Performance-CVS-Logger", "id": "5afc06081c0316b81ae9bf0e59414deb73f12ac2", "size": "622", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ChromePerformanceCVSLoggerApp/initialising.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "6175" } ], "symlink_target": "" }
package org.jitsi.impl.neomedia; import java.awt.*; import java.awt.event.*; import java.beans.*; import java.io.*; import java.util.*; import java.util.List; import javax.media.*; import javax.media.control.*; import javax.media.format.*; import javax.media.protocol.*; import javax.swing.*; import org.jitsi.impl.neomedia.codec.*; import org.jitsi.impl.neomedia.codec.video.*; import org.jitsi.impl.neomedia.device.*; import org.jitsi.impl.neomedia.format.*; import org.jitsi.impl.neomedia.recording.*; import org.jitsi.impl.neomedia.rtp.translator.*; import org.jitsi.impl.neomedia.transform.dtls.*; import org.jitsi.impl.neomedia.transform.sdes.*; import org.jitsi.impl.neomedia.transform.zrtp.*; import org.jitsi.service.configuration.*; import org.jitsi.service.libjitsi.*; import org.jitsi.service.neomedia.*; import org.jitsi.service.neomedia.codec.*; import org.jitsi.service.neomedia.device.*; import org.jitsi.service.neomedia.format.*; import org.jitsi.service.neomedia.recording.*; import org.jitsi.service.resources.*; import org.jitsi.util.*; import org.jitsi.util.event.*; import org.jitsi.util.swing.*; import org.json.simple.*; import com.sun.media.util.*; /** * Implements <tt>MediaService</tt> for JMF. * * @author Lyubomir Marinov * @author Dmitri Melnikov */ public class MediaServiceImpl extends PropertyChangeNotifier implements MediaService { /** * The <tt>Logger</tt> used by the <tt>MediaServiceImpl</tt> class and its * instances for logging output. */ private static final Logger logger = Logger.getLogger(MediaServiceImpl.class); /** * The name of the <tt>boolean</tt> <tt>ConfigurationService</tt> property * which indicates whether the detection of audio <tt>CaptureDevice</tt>s is * to be disabled. The default value is <tt>false</tt> i.e. the audio * <tt>CaptureDevice</tt>s are detected. */ public static final String DISABLE_AUDIO_SUPPORT_PNAME = "net.java.sip.communicator.service.media.DISABLE_AUDIO_SUPPORT"; /** * The name of the <tt>boolean</tt> <tt>ConfigurationService</tt> property * which indicates whether the method * {@link DeviceConfiguration#setAudioSystem(AudioSystem, boolean)} is to be * considered disabled for the user i.e. the user is not presented with user * interface which allows selecting a particular <tt>AudioSystem</tt>. */ public static final String DISABLE_SET_AUDIO_SYSTEM_PNAME = "net.java.sip.communicator.impl.neomedia.audiosystem.DISABLED"; /** * The name of the <tt>boolean</tt> <tt>ConfigurationService</tt> property * which indicates whether the detection of video <tt>CaptureDevice</tt>s is * to be disabled. The default value is <tt>false</tt> i.e. the video * <tt>CaptureDevice</tt>s are detected. */ public static final String DISABLE_VIDEO_SUPPORT_PNAME = "net.java.sip.communicator.service.media.DISABLE_VIDEO_SUPPORT"; /** * The prefix of the property names the values of which specify the dynamic * payload type preferences. */ private static final String DYNAMIC_PAYLOAD_TYPE_PREFERENCES_PNAME_PREFIX = "net.java.sip.communicator.impl.neomedia.dynamicPayloadTypePreferences"; /** * The value of the <tt>devices</tt> property of <tt>MediaServiceImpl</tt> * when no <tt>MediaDevice</tt>s are available. Explicitly defined in order * to reduce unnecessary allocations. */ private static final List<MediaDevice> EMPTY_DEVICES = Collections.emptyList(); /** * The name of the <tt>System</tt> boolean property which specifies whether * the committing of the JMF/FMJ <tt>Registry</tt> is to be disabled. */ private static final String JMF_REGISTRY_DISABLE_COMMIT = "net.sf.fmj.utility.JmfRegistry.disableCommit"; /** * The name of the <tt>System</tt> boolean property which specifies whether * the loading of the JMF/FMJ <tt>Registry</tt> is to be disabled. */ private static final String JMF_REGISTRY_DISABLE_LOAD = "net.sf.fmj.utility.JmfRegistry.disableLoad"; /** * The indicator which determines whether the loading of the JMF/FMJ * <tt>Registry</tt> is disabled. */ private static boolean jmfRegistryDisableLoad; /** * The indicator which determined whether * {@link #postInitializeOnce(MediaServiceImpl)} has been executed in order * to perform one-time initialization after initializing the first instance * of <tt>MediaServiceImpl</tt>. */ private static boolean postInitializeOnce; /** * The prefix that is used to store configuration for encodings preference. */ private static final String ENCODING_CONFIG_PROP_PREFIX = "net.java.sip.communicator.impl.neomedia.codec.EncodingConfiguration"; /** * The value which will be used for the canonical end-point identifier * (CNAME) in RTCP packets sent by this running instance of libjitsi. */ private static final String rtpCname = UUID.randomUUID().toString(); /** * The <tt>CaptureDevice</tt> user choices such as the default audio and * video capture devices. */ private final DeviceConfiguration deviceConfiguration = new DeviceConfiguration(); /** * The <tt>PropertyChangeListener</tt> which listens to * {@link #deviceConfiguration}. */ private final PropertyChangeListener deviceConfigurationPropertyChangeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { deviceConfigurationPropertyChange(event); } }; /** * The list of audio <tt>MediaDevice</tt>s reported by this instance when * its {@link MediaService#getDevices(MediaType, MediaUseCase)} method is * called with an argument {@link MediaType#AUDIO}. */ private final List<MediaDeviceImpl> audioDevices = new ArrayList<MediaDeviceImpl>(); /** * The {@link EncodingConfiguration} instance that holds the current (global) * list of formats and their preference. */ private final EncodingConfiguration currentEncodingConfiguration; /** * The <tt>MediaFormatFactory</tt> through which <tt>MediaFormat</tt> * instances may be created for the purposes of working with the * <tt>MediaStream</tt>s created by this <tt>MediaService</tt>. */ private MediaFormatFactory formatFactory; /** * The one and only <tt>MediaDevice</tt> instance with * <tt>MediaDirection</tt> not allowing sending and <tt>MediaType</tt> equal * to <tt>AUDIO</tt>. */ private MediaDevice nonSendAudioDevice; /** * The one and only <tt>MediaDevice</tt> instance with * <tt>MediaDirection</tt> not allowing sending and <tt>MediaType</tt> equal * to <tt>VIDEO</tt>. */ private MediaDevice nonSendVideoDevice; /** * The list of video <tt>MediaDevice</tt>s reported by this instance when * its {@link MediaService#getDevices(MediaType, MediaUseCase)} method is * called with an argument {@link MediaType#VIDEO}. */ private final List<MediaDeviceImpl> videoDevices = new ArrayList<MediaDeviceImpl>(); /** * A {@link Map} that binds indicates whatever preferences this * media service implementation may have for the RTP payload type numbers * that get dynamically assigned to {@link MediaFormat}s with no static * payload type. The method is useful for formats such as "telephone-event" * for example that is statically assigned the 101 payload type by some * legacy systems. Signalling protocol implementations such as SIP and XMPP * should make sure that, whenever this is possible, they assign to formats * the dynamic payload type returned in this {@link Map}. */ private static Map<MediaFormat, Byte> dynamicPayloadTypePreferences; /** * The volume control of the media service playback. */ private static VolumeControl outputVolumeControl; /** * The volume control of the media service capture. */ private static VolumeControl inputVolumeControl; /** * Listeners interested in Recorder events without the need to * have access to their instances. */ private final List<Recorder.Listener> recorderListeners = new ArrayList<Recorder.Listener>(); static { setupFMJ(); } /** * Initializes a new <tt>MediaServiceImpl</tt> instance. */ public MediaServiceImpl() { /* * XXX The deviceConfiguration is initialized and referenced by this * instance so adding deviceConfigurationPropertyChangeListener does not * need a matching removal. */ deviceConfiguration.addPropertyChangeListener( deviceConfigurationPropertyChangeListener); currentEncodingConfiguration = new EncodingConfigurationConfigImpl(ENCODING_CONFIG_PROP_PREFIX); /* * Perform one-time initialization after initializing the first instance * of MediaServiceImpl. */ synchronized (MediaServiceImpl.class) { if (!postInitializeOnce) { postInitializeOnce = true; postInitializeOnce(this); } } } /** * Create a <tt>MediaStream</tt> which will use a specific * <tt>MediaDevice</tt> for capture and playback of media. The new instance * will not have a <tt>StreamConnector</tt> at the time of its construction * and a <tt>StreamConnector</tt> will be specified later on in order to * enable the new instance to send and receive media. * * @param device the <tt>MediaDevice</tt> to be used by the new instance for * capture and playback of media * @return a newly-created <tt>MediaStream</tt> which will use the specified * <tt>device</tt> for capture and playback of media * @see MediaService#createMediaStream(MediaDevice) */ public MediaStream createMediaStream(MediaDevice device) { return createMediaStream(null, device); } /** * {@inheritDoc} * * Implements {@link MediaService#createMediaStream(MediaType)}. Initializes * a new <tt>AudioMediaStreamImpl</tt> or <tt>VideoMediaStreamImpl</tt> in * accord with <tt>mediaType</tt> */ public MediaStream createMediaStream(MediaType mediaType) { return createMediaStream(mediaType, null, null, null); } /** * Creates a new <tt>MediaStream</tt> instance which will use the specified * <tt>MediaDevice</tt> for both capture and playback of media exchanged * via the specified <tt>StreamConnector</tt>. * * @param connector the <tt>StreamConnector</tt> that the new * <tt>MediaStream</tt> instance is to use for sending and receiving media * @param device the <tt>MediaDevice</tt> that the new <tt>MediaStream</tt> * instance is to use for both capture and playback of media exchanged via * the specified <tt>connector</tt> * @return a new <tt>MediaStream</tt> instance * @see MediaService#createMediaStream(StreamConnector, MediaDevice) */ public MediaStream createMediaStream( StreamConnector connector, MediaDevice device) { return createMediaStream(connector, device, null); } /** * {@inheritDoc} */ public MediaStream createMediaStream( StreamConnector connector, MediaType mediaType) { return createMediaStream(connector, mediaType, null); } /** * Creates a new <tt>MediaStream</tt> instance which will use the specified * <tt>MediaDevice</tt> for both capture and playback of media exchanged * via the specified <tt>StreamConnector</tt>. * * @param connector the <tt>StreamConnector</tt> that the new * <tt>MediaStream</tt> instance is to use for sending and receiving media * @param device the <tt>MediaDevice</tt> that the new <tt>MediaStream</tt> * instance is to use for both capture and playback of media exchanged via * the specified <tt>connector</tt> * @param srtpControl a control which is already created, used to control * the SRTP operations. * * @return a new <tt>MediaStream</tt> instance * @see MediaService#createMediaStream(StreamConnector, MediaDevice) */ public MediaStream createMediaStream( StreamConnector connector, MediaDevice device, SrtpControl srtpControl) { return createMediaStream(null, connector, device, srtpControl); } /** * {@inheritDocs} */ public MediaStream createMediaStream( StreamConnector connector, MediaType mediaType, SrtpControl srtpControl) { return createMediaStream(mediaType, connector, null, srtpControl); } /** * Initializes a new <tt>MediaStream</tt> instance. The method is the actual * implementation to which the public <tt>createMediaStream</tt> methods of * <tt>MediaServiceImpl</tt> delegate. * * @param mediaType the <tt>MediaType</tt> of the new <tt>MediaStream</tt> * instance to be initialized. If <tt>null</tt>, <tt>device</tt> must be * non-<tt>null</tt> and its {@link MediaDevice#getMediaType()} will be used * to determine the <tt>MediaType</tt> of the new instance. If * non-<tt>null</tt>, <tt>device</tt> may be <tt>null</tt>. If * non-<tt>null</tt> and <tt>device</tt> is non-<tt>null</tt>, the * <tt>MediaType</tt> of <tt>device</tt> must be (equal to) * <tt>mediaType</tt>. * @param connector the <tt>StreamConnector</tt> to be used by the new * instance if non-<tt>null</tt> * @param device the <tt>MediaDevice</tt> to be used by the instance if * non-<tt>null</tt> * @param srtpControl the <tt>SrtpControl</tt> to be used by the new * instance if non-<tt>null</tt> * @return a new <tt>MediaStream</tt> instance */ private MediaStream createMediaStream( MediaType mediaType, StreamConnector connector, MediaDevice device, SrtpControl srtpControl) { // Make sure that mediaType and device are in accord. if (mediaType == null) { if (device == null) throw new NullPointerException("device"); else mediaType = device.getMediaType(); } else if ((device != null) && !mediaType.equals(device.getMediaType())) throw new IllegalArgumentException("device"); switch (mediaType) { case AUDIO: return new AudioMediaStreamImpl(connector, device, srtpControl); case VIDEO: return new VideoMediaStreamImpl(connector, device, srtpControl); default: return null; } } /** * Creates a new <tt>MediaDevice</tt> which uses a specific * <tt>MediaDevice</tt> to capture and play back media and performs mixing * of the captured media and the media played back by any other users of the * returned <tt>MediaDevice</tt>. For the <tt>AUDIO</tt> <tt>MediaType</tt>, * the returned device is commonly referred to as an audio mixer. The * <tt>MediaType</tt> of the returned <tt>MediaDevice</tt> is the same as * the <tt>MediaType</tt> of the specified <tt>device</tt>. * * @param device the <tt>MediaDevice</tt> which is to be used by the * returned <tt>MediaDevice</tt> to actually capture and play back media * @return a new <tt>MediaDevice</tt> instance which uses <tt>device</tt> to * capture and play back media and performs mixing of the captured media and * the media played back by any other users of the returned * <tt>MediaDevice</tt> instance * @see MediaService#createMixer(MediaDevice) */ public MediaDevice createMixer(MediaDevice device) { switch (device.getMediaType()) { case AUDIO: return new AudioMixerMediaDevice((AudioMediaDeviceImpl) device); case VIDEO: return new VideoTranslatorMediaDevice((MediaDeviceImpl) device); default: /* * TODO If we do not support mixing, should we return null or rather * a MediaDevice with INACTIVE MediaDirection? */ return null; } } /** * Gets the default <tt>MediaDevice</tt> for the specified * <tt>MediaType</tt>. * * @param mediaType a <tt>MediaType</tt> value indicating the type of media * to be handled by the <tt>MediaDevice</tt> to be obtained * @param useCase the <tt>MediaUseCase</tt> to obtain the * <tt>MediaDevice</tt> list for * @return the default <tt>MediaDevice</tt> for the specified * <tt>mediaType</tt> if such a <tt>MediaDevice</tt> exists; otherwise, * <tt>null</tt> * @see MediaService#getDefaultDevice(MediaType, MediaUseCase) */ public MediaDevice getDefaultDevice( MediaType mediaType, MediaUseCase useCase) { CaptureDeviceInfo captureDeviceInfo; switch (mediaType) { case AUDIO: captureDeviceInfo = getDeviceConfiguration().getAudioCaptureDevice(); break; case VIDEO: captureDeviceInfo = getDeviceConfiguration().getVideoCaptureDevice(useCase); break; default: captureDeviceInfo = null; break; } MediaDevice defaultDevice = null; if (captureDeviceInfo != null) { for (MediaDevice device : getDevices(mediaType, useCase)) { if ((device instanceof MediaDeviceImpl) && captureDeviceInfo.equals( ((MediaDeviceImpl) device) .getCaptureDeviceInfo())) { defaultDevice = device; break; } } } if (defaultDevice == null) { switch (mediaType) { case AUDIO: defaultDevice = getNonSendAudioDevice(); break; case VIDEO: defaultDevice = getNonSendVideoDevice(); break; default: /* * There is no MediaDevice with direction which does not allow * sending and mediaType other than AUDIO and VIDEO. */ break; } } return defaultDevice; } /** * Gets the <tt>CaptureDevice</tt> user choices such as the default audio * and video capture devices. * * @return the <tt>CaptureDevice</tt> user choices such as the default audio * and video capture devices. */ public DeviceConfiguration getDeviceConfiguration() { return deviceConfiguration; } /** * Gets a list of the <tt>MediaDevice</tt>s known to this * <tt>MediaService</tt> and handling the specified <tt>MediaType</tt>. * * @param mediaType the <tt>MediaType</tt> to obtain the * <tt>MediaDevice</tt> list for * @param useCase the <tt>MediaUseCase</tt> to obtain the * <tt>MediaDevice</tt> list for * @return a new <tt>List</tt> of <tt>MediaDevice</tt>s known to this * <tt>MediaService</tt> and handling the specified <tt>MediaType</tt>. The * returned <tt>List</tt> is a copy of the internal storage and, * consequently, modifications to it do not affect this instance. Despite * the fact that a new <tt>List</tt> instance is returned by each call to * this method, the <tt>MediaDevice</tt> instances are the same if they are * still known to this <tt>MediaService</tt> to be available. * @see MediaService#getDevices(MediaType, MediaUseCase) */ public List<MediaDevice> getDevices( MediaType mediaType, MediaUseCase useCase) { List<? extends CaptureDeviceInfo> cdis; List<MediaDeviceImpl> privateDevices; if (MediaType.VIDEO.equals(mediaType)) { /* * In case a video capture device has been added to or removed from * system (i.e. webcam, monitor, etc.), rescan the video capture * devices. */ DeviceSystem.initializeDeviceSystems(MediaType.VIDEO); } switch (mediaType) { case AUDIO: cdis = getDeviceConfiguration().getAvailableAudioCaptureDevices(); privateDevices = audioDevices; break; case VIDEO: cdis = getDeviceConfiguration().getAvailableVideoCaptureDevices( useCase); privateDevices = videoDevices; break; default: /* * MediaService does not understand MediaTypes other than AUDIO and * VIDEO. */ return EMPTY_DEVICES; } List<MediaDevice> publicDevices; synchronized (privateDevices) { if ((cdis == null) || (cdis.size() <= 0)) privateDevices.clear(); else { Iterator<MediaDeviceImpl> deviceIter = privateDevices.iterator(); while (deviceIter.hasNext()) { Iterator<? extends CaptureDeviceInfo> cdiIter = cdis.iterator(); CaptureDeviceInfo captureDeviceInfo = deviceIter.next().getCaptureDeviceInfo(); boolean deviceIsFound = false; while (cdiIter.hasNext()) { if (captureDeviceInfo.equals(cdiIter.next())) { deviceIsFound = true; cdiIter.remove(); break; } } if (!deviceIsFound) deviceIter.remove(); } for (CaptureDeviceInfo cdi : cdis) { if (cdi == null) continue; MediaDeviceImpl device; switch (mediaType) { case AUDIO: device = new AudioMediaDeviceImpl(cdi); break; case VIDEO: device = new MediaDeviceImpl(cdi, mediaType); break; default: device = null; break; } if (device != null) privateDevices.add(device); } } publicDevices = new ArrayList<MediaDevice>(privateDevices); } /* * If there are no MediaDevice instances of the specified mediaType, * make sure that there is at least one MediaDevice which does not allow * sending. */ if (publicDevices.isEmpty()) { MediaDevice nonSendDevice; switch (mediaType) { case AUDIO: nonSendDevice = getNonSendAudioDevice(); break; case VIDEO: nonSendDevice = getNonSendVideoDevice(); break; default: /* * There is no MediaDevice with direction not allowing sending * and mediaType other than AUDIO and VIDEO. */ nonSendDevice = null; break; } if (nonSendDevice != null) publicDevices.add(nonSendDevice); } return publicDevices; } /** * Returns the current encoding configuration -- the instance that contains * the global settings. Note that any changes made to this instance will * have immediate effect on the configuration. * * @return the current encoding configuration -- the instance that contains * the global settings. */ public EncodingConfiguration getCurrentEncodingConfiguration() { return currentEncodingConfiguration; } /** * Gets the <tt>MediaFormatFactory</tt> through which <tt>MediaFormat</tt> * instances may be created for the purposes of working with the * <tt>MediaStream</tt>s created by this <tt>MediaService</tt>. * * @return the <tt>MediaFormatFactory</tt> through which * <tt>MediaFormat</tt> instances may be created for the purposes of working * with the <tt>MediaStream</tt>s created by this <tt>MediaService</tt> * @see MediaService#getFormatFactory() */ public MediaFormatFactory getFormatFactory() { if (formatFactory == null) formatFactory = new MediaFormatFactoryImpl(); return formatFactory; } /** * Gets the one and only <tt>MediaDevice</tt> instance with * <tt>MediaDirection</tt> not allowing sending and <tt>MediaType</tt> equal * to <tt>AUDIO</tt>. * * @return the one and only <tt>MediaDevice</tt> instance with * <tt>MediaDirection</tt> not allowing sending and <tt>MediaType</tt> equal * to <tt>AUDIO</tt> */ private MediaDevice getNonSendAudioDevice() { if (nonSendAudioDevice == null) nonSendAudioDevice = new AudioMediaDeviceImpl(); return nonSendAudioDevice; } /** * Gets the one and only <tt>MediaDevice</tt> instance with * <tt>MediaDirection</tt> not allowing sending and <tt>MediaType</tt> equal * to <tt>VIDEO</tt>. * * @return the one and only <tt>MediaDevice</tt> instance with * <tt>MediaDirection</tt> not allowing sending and <tt>MediaType</tt> equal * to <tt>VIDEO</tt> */ private MediaDevice getNonSendVideoDevice() { if (nonSendVideoDevice == null) nonSendVideoDevice = new MediaDeviceImpl(MediaType.VIDEO); return nonSendVideoDevice; } /** * {@inheritDoc} */ public SrtpControl createSrtpControl(SrtpControlType srtpControlType) { switch (srtpControlType) { case DTLS_SRTP: return new DtlsControlImpl(); case SDES: return new SDesControlImpl(); case ZRTP: return new ZrtpControlImpl(); default: return null; } } /** * Gets the <tt>VolumeControl</tt> which controls the volume level of audio * output/playback. * * @return the <tt>VolumeControl</tt> which controls the volume level of * audio output/playback * @see MediaService#getOutputVolumeControl() */ public VolumeControl getOutputVolumeControl() { if (outputVolumeControl == null) { outputVolumeControl = new BasicVolumeControl( VolumeControl.PLAYBACK_VOLUME_LEVEL_PROPERTY_NAME); } return outputVolumeControl; } /** * Gets the <tt>VolumeControl</tt> which controls the volume level of audio * input/capture. * * @return the <tt>VolumeControl</tt> which controls the volume level of * audio input/capture * @see MediaService#getInputVolumeControl() */ public VolumeControl getInputVolumeControl() { if (inputVolumeControl == null) { // If available, use hardware. try { inputVolumeControl = new HardwareVolumeControl( this, VolumeControl.CAPTURE_VOLUME_LEVEL_PROPERTY_NAME); } catch (Throwable t) { if (t instanceof ThreadDeath) throw (ThreadDeath) t; else if (t instanceof InterruptedException) Thread.currentThread().interrupt(); } // Otherwise, use software. if (inputVolumeControl == null) { inputVolumeControl = new BasicVolumeControl( VolumeControl.CAPTURE_VOLUME_LEVEL_PROPERTY_NAME); } } return inputVolumeControl; } /** * Get available screens. * * @return screens */ public List<ScreenDevice> getAvailableScreenDevices() { ScreenDevice[] screens = ScreenDeviceImpl.getAvailableScreenDevices(); List<ScreenDevice> screenList; if ((screens != null) && (screens.length != 0)) screenList = new ArrayList<ScreenDevice>(Arrays.asList(screens)); else screenList = Collections.emptyList(); return screenList; } /** * Get default screen device. * * @return default screen device */ public ScreenDevice getDefaultScreenDevice() { return ScreenDeviceImpl.getDefaultScreenDevice(); } /** * Creates a new <tt>Recorder</tt> instance that can be used to record a * call which captures and plays back media using a specific * <tt>MediaDevice</tt>. * * @param device the <tt>MediaDevice</tt> which is used for media capture * and playback by the call to be recorded * @return a new <tt>Recorder</tt> instance that can be used to record a * call which captures and plays back media using the specified * <tt>MediaDevice</tt> * @see MediaService#createRecorder(MediaDevice) */ public Recorder createRecorder(MediaDevice device) { if (device instanceof AudioMixerMediaDevice) return new RecorderImpl((AudioMixerMediaDevice) device); else return null; } /** * {@inheritDoc} */ @Override public Recorder createRecorder(RTPTranslator translator) { return new RecorderRtpImpl(translator); } /** * Returns a {@link Map} that binds indicates whatever preferences this * media service implementation may have for the RTP payload type numbers * that get dynamically assigned to {@link MediaFormat}s with no static * payload type. The method is useful for formats such as "telephone-event" * for example that is statically assigned the 101 payload type by some * legacy systems. Signaling protocol implementations such as SIP and XMPP * should make sure that, whenever this is possible, they assign to formats * the dynamic payload type returned in this {@link Map}. * * @return a {@link Map} binding some formats to a preferred dynamic RTP * payload type number. */ public Map<MediaFormat, Byte> getDynamicPayloadTypePreferences() { if(dynamicPayloadTypePreferences == null) { dynamicPayloadTypePreferences = new HashMap<MediaFormat, Byte>(); /* * Set the dynamicPayloadTypePreferences to their default values. If * the user chooses to override them through the * ConfigurationService, they will be overwritten later on. */ MediaFormat telephoneEvent = MediaUtils.getMediaFormat("telephone-event", 8000); if (telephoneEvent != null) dynamicPayloadTypePreferences.put(telephoneEvent, (byte) 101); MediaFormat h264 = MediaUtils.getMediaFormat( "H264", VideoMediaFormatImpl.DEFAULT_CLOCK_RATE); if (h264 != null) dynamicPayloadTypePreferences.put(h264, (byte) 99); /* * Try to load dynamicPayloadTypePreferences from the * ConfigurationService. */ ConfigurationService cfg = LibJitsi.getConfigurationService(); if (cfg != null) { String prefix = DYNAMIC_PAYLOAD_TYPE_PREFERENCES_PNAME_PREFIX; List<String> propertyNames = cfg.getPropertyNamesByPrefix(prefix, true); for (String propertyName : propertyNames) { /* * The dynamic payload type is the name of the property name * and the format which prefers it is the property value. */ byte dynamicPayloadTypePreference = 0; Throwable exception = null; try { dynamicPayloadTypePreference = Byte.parseByte( propertyName.substring( prefix.length() + 1)); } catch (IndexOutOfBoundsException ioobe) { exception = ioobe; } catch (NumberFormatException nfe) { exception = nfe; } if (exception != null) { logger.warn( "Ignoring dynamic payload type preference" + " which could not be parsed: " + propertyName, exception); continue; } String source = cfg.getString(propertyName); if ((source != null) && (source.length() != 0)) { try { JSONObject json = (JSONObject)JSONValue .parseWithException(source); String encoding = (String)json.get( MediaFormatImpl.ENCODING_PNAME); long clockRate = (Long)json.get( MediaFormatImpl.CLOCK_RATE_PNAME); Map<String, String> fmtps = new HashMap<String, String>(); if (json.containsKey( MediaFormatImpl.FORMAT_PARAMETERS_PNAME)) { JSONObject jsonFmtps = (JSONObject)json.get( MediaFormatImpl .FORMAT_PARAMETERS_PNAME); Iterator<?> jsonFmtpsIter = jsonFmtps.keySet().iterator(); while (jsonFmtpsIter.hasNext()) { String key = jsonFmtpsIter.next().toString(); String value = (String)jsonFmtps.get(key); fmtps.put(key, value); } } MediaFormat mediaFormat = MediaUtils.getMediaFormat( encoding, clockRate, fmtps); if (mediaFormat != null) { dynamicPayloadTypePreferences.put( mediaFormat, dynamicPayloadTypePreference); } } catch (Throwable jsone) { logger.warn( "Ignoring dynamic payload type preference" + " which could not be parsed: " + source, jsone); } } } } } return dynamicPayloadTypePreferences; } /** * Creates a preview component for the specified device(video device) used * to show video preview from that device. * * @param device the video device * @param preferredWidth the width we prefer for the component * @param preferredHeight the height we prefer for the component * @return the preview component. */ public Object getVideoPreviewComponent( MediaDevice device, int preferredWidth, int preferredHeight) { ResourceManagementService resources = LibJitsi.getResourceManagementService(); String noPreviewText = (resources == null) ? "" : resources.getI18NString("impl.media.configform.NO_PREVIEW"); JLabel noPreview = new JLabel(noPreviewText); noPreview.setHorizontalAlignment(SwingConstants.CENTER); noPreview.setVerticalAlignment(SwingConstants.CENTER); final JComponent videoContainer = new VideoContainer(noPreview, false); if ((preferredWidth > 0) && (preferredHeight > 0)) { videoContainer.setPreferredSize( new Dimension(preferredWidth, preferredHeight)); } try { CaptureDeviceInfo captureDeviceInfo; if ((device != null) && ((captureDeviceInfo = ((MediaDeviceImpl) device) .getCaptureDeviceInfo()) != null)) { DataSource dataSource = Manager.createDataSource(captureDeviceInfo.getLocator()); /* * Don't let the size be uselessly small just because the * videoContainer has too small a preferred size. */ if ((preferredWidth < 128) || (preferredHeight < 96)) { preferredWidth = 128; preferredHeight = 96; } VideoMediaStreamImpl.selectVideoSize( dataSource, preferredWidth, preferredHeight); // A Player is documented to be created on a connected // DataSource. dataSource.connect(); Processor player = Manager.createProcessor(dataSource); final VideoContainerHierarchyListener listener = new VideoContainerHierarchyListener( videoContainer, player); videoContainer.addHierarchyListener(listener); final MediaLocator locator = dataSource.getLocator(); player.addControllerListener(new ControllerListener() { public void controllerUpdate(ControllerEvent event) { controllerUpdateForPreview( event, videoContainer, locator, listener); } }); player.configure(); } } catch (Throwable t) { if (t instanceof ThreadDeath) throw (ThreadDeath) t; else logger.error("Failed to create video preview", t); } return videoContainer; } /** * Listens and shows the video in the video container when needed. * @param event the event when player has ready visual component. * @param videoContainer the container. * @param locator input DataSource locator * @param listener the hierarchy listener we created for the video container. */ private static void controllerUpdateForPreview( ControllerEvent event, JComponent videoContainer, MediaLocator locator, VideoContainerHierarchyListener listener) { if (event instanceof ConfigureCompleteEvent) { Processor player = (Processor) event.getSourceController(); /* * Use SwScale for the scaling since it produces an image with * better quality and add the "flip" effect to the video. */ TrackControl[] trackControls = player.getTrackControls(); if ((trackControls != null) && (trackControls.length != 0)) try { for (TrackControl trackControl : trackControls) { Codec codecs[] = null; SwScale scaler = new SwScale(); // do not flip desktop if (DeviceSystem.LOCATOR_PROTOCOL_IMGSTREAMING.equals( locator.getProtocol())) codecs = new Codec[] { scaler }; else codecs = new Codec[] { new HFlip(), scaler }; trackControl.setCodecChain(codecs); break; } } catch (UnsupportedPlugInException upiex) { logger.warn( "Failed to add SwScale/VideoFlipEffect to " + "codec chain", upiex); } // Turn the Processor into a Player. try { player.setContentDescriptor(null); } catch (NotConfiguredError nce) { logger.error( "Failed to set ContentDescriptor of Processor", nce); } player.realize(); } else if (event instanceof RealizeCompleteEvent) { Player player = (Player) event.getSourceController(); Component video = player.getVisualComponent(); // sets the preview to the listener listener.setPreview(video); showPreview(videoContainer, video, player); } } /** * Shows the preview panel. * @param previewContainer the container * @param preview the preview component. * @param player the player. */ private static void showPreview( final JComponent previewContainer, final Component preview, final Player player) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(new Runnable() { public void run() { showPreview(previewContainer, preview, player); } }); return; } previewContainer.removeAll(); if (preview != null) { previewContainer.add(preview); player.start(); if (previewContainer.isDisplayable()) { previewContainer.revalidate(); previewContainer.repaint(); } else previewContainer.doLayout(); } else disposePlayer(player); } /** * Dispose the player used for the preview. * @param player the player. */ private static void disposePlayer(final Player player) { // launch disposing preview player in separate thread // will lock renderer and can produce lock if user has quickly // requested preview component and can lock ui thread new Thread(new Runnable() { public void run() { player.stop(); player.deallocate(); player.close(); } }).start(); } /** * Get a <tt>MediaDevice</tt> for a part of desktop streaming/sharing. * * @param width width of the part * @param height height of the part * @param x origin of the x coordinate (relative to the full desktop) * @param y origin of the y coordinate (relative to the full desktop) * @return <tt>MediaDevice</tt> representing the part of desktop or null * if problem */ public MediaDevice getMediaDeviceForPartialDesktopStreaming( int width, int height, int x, int y) { MediaDevice device = null; String name = "Partial desktop streaming"; Dimension size = null; int multiple = 0; Point p = new Point((x < 0) ? 0 : x, (y < 0) ? 0 : y); ScreenDevice dev = getScreenForPoint(p); int display = -1; if(dev != null) display = dev.getIndex(); else return null; /* on Mac OS X, width have to be a multiple of 16 */ if(OSUtils.IS_MAC) { multiple = Math.round(width / 16f); width = multiple * 16; } else { /* JMF filter graph seems to not like odd width */ multiple = Math.round(width / 2f); width = multiple * 2; } /* JMF filter graph seems to not like odd height */ multiple = Math.round(height / 2f); height = multiple * 2; size = new Dimension(width, height); Format formats[] = new Format[] { new AVFrameFormat( size, Format.NOT_SPECIFIED, FFmpeg.PIX_FMT_ARGB, Format.NOT_SPECIFIED), new RGBFormat( size, // size Format.NOT_SPECIFIED, // maxDataLength Format.byteArray, // dataType Format.NOT_SPECIFIED, // frameRate 32, // bitsPerPixel 2 /* red */, 3 /* green */, 4 /* blue */) }; Rectangle bounds = ((ScreenDeviceImpl)dev).getBounds(); x -= bounds.x; y -= bounds.y; CaptureDeviceInfo devInfo = new CaptureDeviceInfo( name + " " + display, new MediaLocator( DeviceSystem.LOCATOR_PROTOCOL_IMGSTREAMING + ":" + display + "," + x + "," + y), formats); device = new MediaDeviceImpl(devInfo, MediaType.VIDEO); return device; } /** * If the <tt>MediaDevice</tt> corresponds to partial desktop streaming * device. * * @param mediaDevice <tt>MediaDevice</tt> * @return true if <tt>MediaDevice</tt> is a partial desktop streaming * device, false otherwise */ public boolean isPartialStreaming(MediaDevice mediaDevice) { if(mediaDevice == null) return false; MediaDeviceImpl dev = (MediaDeviceImpl)mediaDevice; CaptureDeviceInfo cdi = dev.getCaptureDeviceInfo(); return (cdi != null) && cdi.getName().startsWith("Partial desktop streaming"); } /** * Find the screen device that contains specified point. * * @param p point coordinates * @return screen device that contains point */ public ScreenDevice getScreenForPoint(Point p) { for(ScreenDevice dev : getAvailableScreenDevices()) if(dev.containsPoint(p)) return dev; return null; } /** * Gets the origin of a specific desktop streaming device. * * @param mediaDevice the desktop streaming device to get the origin on * @return the origin of the specified desktop streaming device */ public Point getOriginForDesktopStreamingDevice(MediaDevice mediaDevice) { MediaDeviceImpl dev = (MediaDeviceImpl)mediaDevice; CaptureDeviceInfo cdi = dev.getCaptureDeviceInfo(); if(cdi == null) return null; MediaLocator locator = cdi.getLocator(); if(!DeviceSystem.LOCATOR_PROTOCOL_IMGSTREAMING.equals( locator.getProtocol())) return null; String remainder = locator.getRemainder(); String split[] = remainder.split(","); int index = Integer.parseInt( ((split != null) && (split.length > 1)) ? split[0] : remainder); List<ScreenDevice> devs = getAvailableScreenDevices(); if (devs.size() - 1 >= index) { Rectangle r = ((ScreenDeviceImpl) devs.get(index)).getBounds(); return new Point(r.x, r.y); } return null; } /** * Those interested in Recorder events add listener through MediaService. * This way they don't need to have access to the Recorder instance. * Adds a new <tt>Recorder.Listener</tt> to the list of listeners * interested in notifications from a <tt>Recorder</tt>. * * @param listener the new <tt>Recorder.Listener</tt> to be added to the * list of listeners interested in notifications from <tt>Recorder</tt>s. */ public void addRecorderListener(Recorder.Listener listener) { synchronized(recorderListeners) { if(!recorderListeners.contains(listener)) recorderListeners.add(listener); } } /** * Removes an existing <tt>Recorder.Listener</tt> from the list of listeners * interested in notifications from <tt>Recorder</tt>s. * * @param listener the existing <tt>Listener</tt> to be removed from the * list of listeners interested in notifications from <tt>Recorder</tt>s */ public void removeRecorderListener(Recorder.Listener listener) { synchronized(recorderListeners) { recorderListeners.remove(listener); } } /** * Gives access to currently registered <tt>Recorder.Listener</tt>s. * @return currently registered <tt>Recorder.Listener</tt>s. */ public Iterator<Recorder.Listener> getRecorderListeners() { return recorderListeners.iterator(); } /** * Notifies this instance that the value of a property of * {@link #deviceConfiguration} has changed. * * @param event a <tt>PropertyChangeEvent</tt> which specifies the name of * the property which had its value changed and the old and the new values * of that property */ private void deviceConfigurationPropertyChange(PropertyChangeEvent event) { String propertyName = event.getPropertyName(); /* * While AUDIO_CAPTURE_DEVICE is sure to affect the DEFAULT_DEVICE, * AUDIO_PLAYBACK_DEVICE is not. Anyway, MediaDevice is supposed to * represent the device to be used for capture AND playback (though its * current implementation MediaDeviceImpl may be incomplete with respect * to the playback representation). Since it is not clear at this point * of the execution whether AUDIO_PLAYBACK_DEVICE really affects the * DEFAULT_DEVICE and for the sake of completeness, throw in the changes * to the AUDIO_NOTIFY_DEVICE as well. */ if (DeviceConfiguration.AUDIO_CAPTURE_DEVICE.equals(propertyName) || DeviceConfiguration.AUDIO_NOTIFY_DEVICE.equals(propertyName) || DeviceConfiguration.AUDIO_PLAYBACK_DEVICE.equals( propertyName) || DeviceConfiguration.VIDEO_CAPTURE_DEVICE.equals( propertyName)) { /* * We do not know the old value of the property at the time of this * writing. We cannot report the new value either because we do not * know the MediaType and the MediaUseCase. */ firePropertyChange(DEFAULT_DEVICE, null, null); } } /** * Initializes a new <tt>RTPTranslator</tt> which is to forward RTP and RTCP * traffic between multiple <tt>MediaStream</tt>s. * * @return a new <tt>RTPTranslator</tt> which is to forward RTP and RTCP * traffic between multiple <tt>MediaStream</tt>s * @see MediaService#createRTPTranslator() */ public RTPTranslator createRTPTranslator() { return new RTPTranslatorImpl(); } /** * Gets the indicator which determines whether the loading of the JMF/FMJ * <tt>Registry</tt> has been disabled. * * @return <tt>true</tt> if the loading of the JMF/FMJ <tt>Registry</tt> has * been disabled; otherwise, <tt>false</tt> */ public static boolean isJmfRegistryDisableLoad() { return jmfRegistryDisableLoad; } /** * Performs one-time initialization after initializing the first instance of * <tt>MediaServiceImpl</tt>. * * @param mediaServiceImpl the <tt>MediaServiceImpl</tt> instance which has * caused the need to perform the one-time initialization */ private static void postInitializeOnce(MediaServiceImpl mediaServiceImpl) { new ZrtpFortunaEntropyGatherer( mediaServiceImpl.getDeviceConfiguration()) .setEntropy(); } /** * Sets up FMJ for execution. For example, sets properties which instruct * FMJ whether it is to create a log, where the log is to be created. */ private static void setupFMJ() { /* * FMJ now uses java.util.logging.Logger, but only logs if allowLogging * is set in its registry. Since the levels can be configured through * properties for the net.sf.fmj.media.Log class, we always enable this * (as opposed to only enabling it when this.logger has debug enabled). */ Registry.set("allowLogging", true); /* * Disable the loading of .fmj.registry because Kertesz Laszlo has * reported that audio input devices duplicate after restarting Jitsi. * Besides, Jitsi does not really need .fmj.registry on startup. */ if (System.getProperty(JMF_REGISTRY_DISABLE_LOAD) == null) System.setProperty(JMF_REGISTRY_DISABLE_LOAD, "true"); jmfRegistryDisableLoad = "true".equalsIgnoreCase(System.getProperty( JMF_REGISTRY_DISABLE_LOAD)); if (System.getProperty(JMF_REGISTRY_DISABLE_COMMIT) == null) System.setProperty(JMF_REGISTRY_DISABLE_COMMIT, "true"); String scHomeDirLocation = System.getProperty( ConfigurationService.PNAME_SC_CACHE_DIR_LOCATION); if (scHomeDirLocation != null) { String scHomeDirName = System.getProperty( ConfigurationService.PNAME_SC_HOME_DIR_NAME); if (scHomeDirName != null) { File scHomeDir = new File(scHomeDirLocation, scHomeDirName); /* Write FMJ's log in Jitsi's log directory. */ Registry.set( "secure.logDir", new File(scHomeDir, "log").getPath()); /* Write FMJ's registry in Jitsi's user data directory. */ String jmfRegistryFilename = "net.sf.fmj.utility.JmfRegistry.filename"; if (System.getProperty(jmfRegistryFilename) == null) { System.setProperty( jmfRegistryFilename, new File(scHomeDir, ".fmj.registry") .getAbsolutePath()); } } } ConfigurationService cfg = LibJitsi.getConfigurationService(); if (cfg != null) { for (String prop : cfg.getPropertyNamesByPrefix( "net.java.sip.communicator.impl.neomedia" + ".adaptive_jitter_buffer", true)) { String suffix = prop.substring(prop.lastIndexOf(".") + 1); Registry.set( "adaptive_jitter_buffer_" + suffix, cfg.getString(prop)); } } FMJPlugInConfiguration.registerCustomPackages(); FMJPlugInConfiguration.registerCustomCodecs(); FMJPlugInConfiguration.registerCustomMultiplexers(); } /** * Returns a new {@link EncodingConfiguration} instance that can be * used by other bundles. * * @return a new {@link EncodingConfiguration} instance. */ public EncodingConfiguration createEmptyEncodingConfiguration() { return new EncodingConfigurationImpl(); } /** * Determines whether the support for a specific <tt>MediaType</tt> is * enabled. The <tt>ConfigurationService</tt> and <tt>System</tt> properties * {@link #DISABLE_AUDIO_SUPPORT_PNAME} and * {@link #DISABLE_VIDEO_SUPPORT_PNAME} allow disabling the support for, * respectively, {@link MediaType#AUDIO} and {@link MediaType#VIDEO}. * * @param mediaType the <tt>MediaType</tt> to be determined whether the * support for it is enabled * @return <tt>true</tt> if the support for the specified <tt>mediaType</tt> * is enabled; otherwise, <tt>false</tt> */ public static boolean isMediaTypeSupportEnabled(MediaType mediaType) { String propertyName; switch (mediaType) { case AUDIO: propertyName = DISABLE_AUDIO_SUPPORT_PNAME; break; case VIDEO: propertyName = DISABLE_VIDEO_SUPPORT_PNAME; break; default: return true; } ConfigurationService cfg = LibJitsi.getConfigurationService(); return ((cfg == null) || !cfg.getBoolean(propertyName, false)) && !Boolean.getBoolean(propertyName); } /** * {@inheritDoc} */ public String getRtpCname() { return rtpCname; } /** * The listener which will be notified for changes in the video container. * Whether the container is displayable or not we will stop the player * or start it. */ private static class VideoContainerHierarchyListener implements HierarchyListener { /** * The parent window. */ private Window window; /** * The listener for the parent window. Used to dispose player on close. */ private WindowListener windowListener; /** * The parent container of our preview. */ private JComponent container; /** * The player showing the video preview. */ private Player player; /** * The preview component of the player, must be set once the * player has been realized. */ private Component preview = null; /** * Creates VideoContainerHierarchyListener. * @param container the video container. * @param player the player. */ VideoContainerHierarchyListener(JComponent container, Player player) { this.container = container; this.player = player; } /** * After the player has been realized the preview can be obtained and supplied * to this listener. Normally done on player RealizeCompleteEvent. * @param preview the preview. */ void setPreview(Component preview) { this.preview = preview; } /** * Disposes player and cleans listeners as we will no longer need them. */ public void dispose() { if (windowListener != null) { if (window != null) { window.removeWindowListener(windowListener); window = null; } windowListener = null; } container.removeHierarchyListener(this); disposePlayer(player); /* * We've just disposed the player which created the preview * component so the preview component is of no use * regardless of whether the Media configuration form will * be redisplayed or not. And since the preview component * appears to be a huge object even after its player is * disposed, make sure to not reference it. */ if(preview != null) container.remove(preview); } /** * Change in container. * @param event the event for the chnage. */ public void hierarchyChanged(HierarchyEvent event) { if ((event.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) == 0) return; if (!container.isDisplayable()) { dispose(); return; } else { // if this is just a change in the video container // and preview has not been created yet, do nothing // otherwise start the player which will show in preview if(preview != null) { player.start(); } } if (windowListener == null) { window = SwingUtilities.windowForComponent(container); if (window != null) { windowListener = new WindowAdapter() { @Override public void windowClosing(WindowEvent event) { dispose(); } }; window.addWindowListener(windowListener); } } } } /** * {@inheritDoc} */ @Override public RecorderEventHandler createRecorderEventHandlerJson(String filename) throws IOException { return new RecorderEventHandlerJSONImpl(filename); } }
{ "content_hash": "5ee9ccc2c4184ed73891787b694c5342", "timestamp": "", "source": "github", "line_count": 1801, "max_line_length": 86, "avg_line_length": 35.373126041088284, "alnum_prop": 0.5584786601158428, "repo_name": "gpolitis/libjitsi", "id": "36bac708fb9e082843ecc8632628f229934149d4", "size": "64309", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/org/jitsi/impl/neomedia/MediaServiceImpl.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "548703" }, { "name": "C++", "bytes": "82184" }, { "name": "Java", "bytes": "7231875" }, { "name": "Makefile", "bytes": "2023" }, { "name": "Objective-C", "bytes": "53135" } ], "symlink_target": "" }
using JsonApiDotNetCore.Middleware; using JsonApiDotNetCore.Resources; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.DependencyInjection; namespace JsonApiDotNetCore.Configuration; /// <summary> /// Validation filter that blocks ASP.NET ModelState validation on data according to the JSON:API spec. /// </summary> internal sealed class JsonApiValidationFilter : IPropertyValidationFilter { private readonly IHttpContextAccessor _httpContextAccessor; public JsonApiValidationFilter(IHttpContextAccessor httpContextAccessor) { ArgumentGuard.NotNull(httpContextAccessor); _httpContextAccessor = httpContextAccessor; } /// <inheritdoc /> public bool ShouldValidateEntry(ValidationEntry entry, ValidationEntry parentEntry) { IServiceProvider serviceProvider = GetScopedServiceProvider(); var request = serviceProvider.GetRequiredService<IJsonApiRequest>(); if (IsId(entry.Key)) { return true; } bool isTopResourceInPrimaryRequest = string.IsNullOrEmpty(parentEntry.Key) && IsAtPrimaryEndpoint(request); if (!isTopResourceInPrimaryRequest) { return false; } if (request.WriteOperation == WriteOperationKind.UpdateResource) { var targetedFields = serviceProvider.GetRequiredService<ITargetedFields>(); return IsFieldTargeted(entry, targetedFields); } return true; } private IServiceProvider GetScopedServiceProvider() { HttpContext? httpContext = _httpContextAccessor.HttpContext; if (httpContext == null) { throw new InvalidOperationException("Cannot resolve scoped services outside the context of an HTTP request."); } return httpContext.RequestServices; } private static bool IsId(string key) { return key == nameof(Identifiable<object>.Id) || key.EndsWith($".{nameof(Identifiable<object>.Id)}", StringComparison.Ordinal); } private static bool IsAtPrimaryEndpoint(IJsonApiRequest request) { return request.Kind is EndpointKind.Primary or EndpointKind.AtomicOperations; } private static bool IsFieldTargeted(ValidationEntry entry, ITargetedFields targetedFields) { return targetedFields.Attributes.Any(attribute => attribute.Property.Name == entry.Key) || targetedFields.Relationships.Any(relationship => relationship.Property.Name == entry.Key); } }
{ "content_hash": "a4d2856ff89f3d7dc17983509cf787fd", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 135, "avg_line_length": 32.94871794871795, "alnum_prop": 0.711284046692607, "repo_name": "json-api-dotnet/JsonApiDotNetCore", "id": "a27acf8ebdacd2594794d51301d72210732b8207", "size": "2570", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/JsonApiDotNetCore/Configuration/JsonApiValidationFilter.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "3762090" }, { "name": "PowerShell", "bytes": "7865" }, { "name": "XSLT", "bytes": "1605" } ], "symlink_target": "" }
package org.jboss.hal.meta.processing; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import org.jboss.hal.meta.AddressTemplate; import org.jboss.hal.meta.MissingMetadataException; class LookupResult { /** * Bit mask for missing / present metadata. 0 means metadata missing, 1 means metadata present. First bit stands for * resource description second one for security context. */ static final int NOTHING_PRESENT = 0b00; static final int RESOURCE_DESCRIPTION_PRESENT = 0b10; static final int SECURITY_CONTEXT_PRESENT = 0b01; static final int ALL_PRESENT = 0b11; private final Map<AddressTemplate, Integer> templates; LookupResult(Set<AddressTemplate> templates) { this.templates = new HashMap<>(); for (AddressTemplate template : templates) { this.templates.put(template, NOTHING_PRESENT); } } Set<AddressTemplate> templates() { return templates.keySet(); } void markMetadataPresent(AddressTemplate template, int flag) { int combined = failFastGet(template) | flag; templates.put(template, combined); } int missingMetadata(AddressTemplate template) { return failFastGet(template); } boolean allPresent() { for (Integer flags : templates.values()) { if (flags != ALL_PRESENT) { return false; } } return true; } private int failFastGet(AddressTemplate template) { if (!templates.containsKey(template)) { throw new MissingMetadataException("MetadataContext", template); } return templates.get(template); } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("LookupResult("); for (Iterator<Map.Entry<AddressTemplate, Integer>> iterator = templates.entrySet().iterator(); iterator.hasNext();) { Map.Entry<AddressTemplate, Integer> entry = iterator.next(); builder.append(entry.getKey()).append(" -> "); switch (entry.getValue()) { case NOTHING_PRESENT: builder.append("nothing present"); break; case RESOURCE_DESCRIPTION_PRESENT: builder.append("resource description present"); break; case SECURITY_CONTEXT_PRESENT: builder.append("security context present"); break; case ALL_PRESENT: builder.append("all present"); break; default: break; } if (iterator.hasNext()) { builder.append(", "); } } builder.append(")"); return builder.toString(); } }
{ "content_hash": "0faac35477657c7a642d53eedd4fa378", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 125, "avg_line_length": 32.010989010989015, "alnum_prop": 0.5904565739787161, "repo_name": "michpetrov/hal.next", "id": "f62df91b9252c00e3e084fbd89e1161fce7598f3", "size": "3514", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "meta/src/main/java/org/jboss/hal/meta/processing/LookupResult.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "38443" }, { "name": "HTML", "bytes": "218186" }, { "name": "Java", "bytes": "6810395" }, { "name": "JavaScript", "bytes": "45507" }, { "name": "Less", "bytes": "72087" }, { "name": "Shell", "bytes": "15270" } ], "symlink_target": "" }
package com.endusersoft.svnconverter; import org.junit.Assert; import org.junit.Test; /** * Created by Oblio.Leitch on 3/18/14. */ public class TestModel { }
{ "content_hash": "a2b284a78e44463a170528f526e92cb7", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 38, "avg_line_length": 14.818181818181818, "alnum_prop": 0.7239263803680982, "repo_name": "end-user/svgconverter", "id": "41be0295ac88a086f9baadcd21bb37791a80cd4d", "size": "163", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/com/endusersoft/svnconverter/TestModel.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "21040" } ], "symlink_target": "" }
// Copyright 2012 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.collide.client.editor.input; import org.waveprotocol.wave.client.common.util.SignalEvent; import elemental.js.util.JsMapFromIntTo; /** * Controller around a group of {@link InputMode}s to direct text/modifier * key input to the active mode. Provides access to the current {@link InputController} * to the active mode for performing shortcut actions. * * Each scheme can contain additional state that needs to be shared between modes, * such as a vi line-mode search "/class", and additional command-mode next match * "n" commands * * Tied to the lifetime of an editor instance * * */ public abstract class InputScheme { /** * Store a reference to the editor's input controller to pass to active mode */ private InputController inputController; private InputMode activeMode = null; /** * Map from mode number to mode object. Mode numbers should be constants * defined for each scheme. */ private JsMapFromIntTo<InputMode> modes; public InputScheme() { this.inputController = null; this.modes = JsMapFromIntTo.create(); } public InputScheme(InputController input) { this.inputController = input; this.modes = JsMapFromIntTo.create(); } /** * Add all Scheme modes and setup the default {@link InputMode} by calling * switchMode. Optionally make any scheme-specific document changes * (add status bar, etc) */ public abstract void setup(); /** * Called when switching editor modes, this should undo all document * changes made in {@link InputScheme#setup()} */ public void teardown() { if (activeMode != null) { activeMode.teardown(); } } /** * Add a new mode to this scheme */ public void addMode(int modeNumber, InputMode mode) { mode.setScheme(this); modes.put(modeNumber, mode); } public InputController getInputController() { return inputController; } public InputMode getMode() { return activeMode; } /** * Switch to the new mode: * call teardown() on active mode (if there is one) * call setup() on new mode */ public void switchMode(int modeNumber) { if (modes.hasKey(modeNumber)) { if (activeMode != null) { activeMode.teardown(); } activeMode = modes.get(modeNumber); activeMode.setup(); } } /** * Called from the event handler, dispatch this event to the active mode */ public boolean handleEvent(SignalEvent event, String text) { if (activeMode != null) { return activeMode.handleEvent(event, text); } else { return false; } } /** * This is called after a shortcut has been dispatched. */ protected void handleShortcutCalled() { } }
{ "content_hash": "3bbd6afa3b0e7ffe286d97b6bdbf7268", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 87, "avg_line_length": 27.368852459016395, "alnum_prop": 0.6885294998502546, "repo_name": "WeTheInternet/collide", "id": "6df81cb3d99db07bcf75b5fbb8ce810b66eb4a0f", "size": "3339", "binary": false, "copies": "1", "ref": "refs/heads/superdev", "path": "client/src/main/java/com/google/collide/client/editor/input/InputScheme.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "112429" }, { "name": "HTML", "bytes": "6092" }, { "name": "Java", "bytes": "6908238" }, { "name": "JavaScript", "bytes": "213795" }, { "name": "Shell", "bytes": "3512" } ], "symlink_target": "" }
<div class="customer-table extra-gutter"> <div class="row table-header"> <div class="col-xs-12"> <h4> Yritykset </h4> </div> </div> <div class="row"> <div class="col-sm-6 col-xs-12"> <div class="row"> <div class="col-lg-2 col-xs-12"> <label for="sel1" (click)="addLine()">Toimiala </label> </div> <div class="col-lg-10 col-xs-12"> <dropdown [collection]="linesStorage.getOriginal()" (collectionUpdated)="linesUpdated($event)"></dropdown> </div> </div> <div class="row"> <div class="col-xs-12"> <span *ngFor="let line of linesStorage.getModified()" class="badge" (click)="removeElement(line, linesStorage)"> {{line.getName()}} </span> </div> </div> </div> <div class="col-sm-6 col-xs-12"> <div class="row"> <div class="col-lg-2 col-xs-12"> <label for="sel1">Kaupunki</label> </div> <div class="col-lg-10 col-xs-12"> <dropdown [collection]="cityStorage.getOriginal()" (collectionUpdated)="citiesUpdated($event)"></dropdown> </div> </div> <div class="row"> <div class="col-xs-12"> <span *ngFor="let city of cityStorage.getModified()" class="badge" (click)="removeElement(city, cityStorage)"> {{city.getName()}} </span> </div> </div> </div> </div> <div class="row"> <div class="col-xs-12 col-sm-6"> <div class="form-group"> <label for="sel1">Näytä</label> <select class="form-control" id="sel1" (change)="onChange($event)"> <option>10</option> <option selected="selected">25</option> <option>50</option> <option>100</option> </select> <label> tulosta </label> </div> </div> <div class="col-xs-12 col-sm-6 right-align"> <button type="button" class="btn btn-tlp" (click)="fetchResults()"><i class="fa fa-refresh" aria-hidden="true"></i>Päivitä</button> <button type="button" class="btn btn-tlp" data-toggle="modal" data-target="#myModal"><i class="fa fa-users" aria-hidden="true"></i>Generoi lista</button> </div> </div> <div class="table-content table-responsive table-bordered"> <div class="loader" *ngIf="shownPages > collectionSize || loading"></div> <table class="table"> <thead> <tr> <th> Nimi</th> <th> Y-tunnus</th> <th> Yritysmuoto</th> <th> Toimiala </th> <th> Puhelin </th> <th> Kaupunki </th> </tr> </thead> <tbody> <tr *ngFor="let company of companies; let i=index"> <template [ngIf]="i<limiter + shownPages && i >= shownPages"> <td> {{company.name}} </td> <td> {{company.businessId}} </td> <td> {{company.companyForm}} </td> <td> {{company.businesslines.name}}</td> <td> {{company.contact_details.matkapuhelin ? company.contact_details.matkapuhelin : company.contact_details.puhelin }}</td> <td> {{company.city}} </td> </template> </tr> </tbody> </table> </div> <div class="row row-eq-height"> <div class="col-xs-12 col-sm-6"> <h5> Näytetään {{ajaxConf.currentPosition - limiter}} - {{ajaxConf.currentPosition}} / {{size}} </h5> </div> <div class="col-xs-12 right-align"> <pagination [count]="count" [size]="size" [perPage]="limiter" (pageChanged)="pageChanged($event)"></pagination> </div> </div> <!-- MODAALI KOMPONENTIKSI --> <div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Generoi lista</h4> </div> <div class="modal-body"> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <label class="col-lg-4" for="sel1">Listan koko</label> <div class="col-lg-8"> <select class="form-control" id="sel1"> <option selected="selected" #sizeSelect>25</option> <option>50</option> <option>100</option> <option>200</option> </select> </div> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="form-group"> <label class="col-lg-4" for="sel1">Näkyvyydet</label> <div class="col-lg-8"> <select class="form-control" id="sel1" #visibilitiesSelect> <option selected="selected"></option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </div> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="sel1" class="col-lg-4">Kaupungit</label> <div class="col-lg-8"> <span *ngFor="let city of cityStorage.getModified()" class="badge" (click)="removeElement(city, addedCities)"> {{city}} </span> <span *ngIf="cityStorage.getModified().length == 0"> Satunnainen </span> </div> </div> </div> <div class="row"> <div class="col-xs-12"> <label for="sel1" class="col-lg-4">Toimialat</label> <div class="col-lg-8"> <span *ngFor="let line of linesStorage.getModified()" class="badge" (click)="removeElement(line, addedLines)"> {{line.getName()}} </span> <span *ngIf="linesStorage.getModified().length == 0"> Satunnainen </span> </div> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal" (click)="generateList()"> Tulosta </button> <button type="button" class="btn btn-default" data-dismiss="modal">Sulje</button> </div> </div> </div> </div> </div>
{ "content_hash": "bf2ae765386522fded94e339fea84d46", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 165, "avg_line_length": 44.99444444444445, "alnum_prop": 0.4065934065934066, "repo_name": "Goodman92/TeleBuddy", "id": "a51297284c24021888267d5049ef5cd5b2d510b2", "size": "8107", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "resources/assets/typescript/components/Homepage/home-maincomponent/home-main.component.html", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "553" }, { "name": "HTML", "bytes": "17467" }, { "name": "JavaScript", "bytes": "3028" }, { "name": "PHP", "bytes": "97794" }, { "name": "Shell", "bytes": "257" }, { "name": "TypeScript", "bytes": "30491" } ], "symlink_target": "" }
function CustomGrid(opt, items) { var language = opt.language; var self = this.view = Ti.UI.createScrollView(opt); self.scrollType = "vertical"; this.gridItems = items || []; this.itemWidth = opt.itemWidth || 10; this.columns = opt.columns || 'auto'; if(this.columns !== 'auto') this.cols = this.columns; this.itemHeight = opt.itemHeight || 10; this.marginLeft = opt.marginLeft || 0; this.marginRight = opt.marginRight || 0; this.marginTop = opt.marginTop || 0; this.marginBottom = opt.marginBottom || 0; var tableHeader; if (opt.pullToRefresh) { tableHeader = this.tableHeader = Ti.UI.createView({ //backgroundColor:"#e2e7ed", //borderColor:"white", borderWidth: 1, touchEnabled: false, top: -60, width:225, height:60, visible: true, }); //fake it til ya make it.. create a 2 pixel //bottom border //this.tableHeader.add(border); var arrow = Ti.UI.createView({ touchEnabled: false, backgroundImage:"/images/whiteArrow.png", width:23, height:60, bottom:0, left:0 }); var statusLabel = Ti.UI.createLabel({ touchEnabled: false, text:L(language+"_pull_to_reload"), left:24, right: 0, bottom:30, height:14, color:"#bbbbbb", textAlign:"center", font:{fontSize:14,fontWeight:"bold"}, shadowColor:"#333399", shadowOffset:{x:1,y:0} }); var lastUpdatedLabel = Ti.UI.createLabel({ touchEnabled: false, text:L(language+"_updated")+" "+String.formatDate(new Date())+ " " +String.formatTime(new Date()), left:24, right: 0, bottom:15, height:12, color:"#bbbbbb", textAlign:"center", font:{fontSize:12}, shadowColor:"#333399", shadowOffset:{x:1,y:0} }); var isAndroid = Ti.Platform.osname == 'android'; var actInd = Titanium.UI.createActivityIndicator({ left:0, bottom:13, width:30, height:30 }); this.tableHeader.add(arrow); this.tableHeader.add(statusLabel); this.tableHeader.add(lastUpdatedLabel); if (!isAndroid) this.tableHeader.add(actInd); this.view.add(this.tableHeader); var pull = 0, loading, readyToPull = 0; var setLoading = function(){ loading = 1; //self.contentOffset = {x:0, y:-60}; statusLabel.text = L(language+"_loading"); arrow.hide(); if (!isAndroid) actInd.show(); }; var setLoaded = function(scrollToTop){ if (!isAndroid) actInd.hide(); arrow.show(); arrow.animate({transform: Ti.UI.create2DMatrix({rotate:0}), duration: 180}); statusLabel.text = L(language+"_pull_to_reload"); readyToPull = false; lastUpdatedLabel.text = L(language+"_updated")+" "+String.formatDate(new Date())+ " " +String.formatTime(new Date()); //if (scrollToTop) // self.contentOffset = {x:0, y:0}; pull = 0; loading = 0; }; this.view.addEventListener("setLoading", function(e){ setLoading(); }); this.view.addEventListener("setLoaded", function(e){ setLoaded(e.scrollToTop); }); this.view.addEventListener("scroll", function(e){ ////Ti.API.info(e); if (e.source !=self) return; if (pull) { pull = 0; this.contentOffset = {x:0, y:-60}; } if (loading) return; if (!e.decelerating && e.dragging) { if (e.y < -65 && !readyToPull) { readyToPull = 1; arrow.animate({transform: Ti.UI.create2DMatrix({rotate:-180}), duration: 200}); statusLabel.text = L(language+"_release_to_reload"); } if (e.y > -65 && readyToPull) { readyToPull = 0; arrow.animate({transform: Ti.UI.create2DMatrix({rotate:0}), duration: 200}); statusLabel.text = L(language+"_pull_to_reload"); } //tableHeader.visible = e.y < -60; } if (e.decelerating == 1 && !e.dragging && tableHeader.visible) { if (readyToPull) { setLoading(); opt.refreshCallback(setLoaded); } } }); } this.calcSpaces = function() { this.xSpace = Math.round((this.view.size.width - (this.cols * this.itemWidth) - this.marginLeft * 2) / (this.cols + 1)); this.xSpace = this.xSpace < 0 ? 0 : this.xSpace; this.ySpace = typeof this.ySpace == 'undefined' ? this.xSpace : this.ySpace; } this.calcCols = function() { this.cols = Math.floor((this.view.size.width - this.marginLeft - this.marginRight) / (this.itemWidth)); if (this.cols == 0) this.cols = 1; ////Ti.API.info(this.view.size.width + " " + this.itemWidth); } this.holder = Ti.UI.createView({ left : this.marginLeft, top : this.marginTop, right : this.marginRight, height : 700, }); this.view.add(this.holder); //only vertical scroll this.view.contentWidth = 'auto'; this.view.contentHeight = 'auto'; this.view.showVerticalScrollIndicator = true; this.addGridItems = function(list) { for(var i = 0; i < list.length; i++) { this.addGridItem(list[i], i); } }; this.addGridItem = function(item, rand, hidden) { try { if(rand||hidden) item.hide(); this.gridItems.push(item); this.moveItem(item, rand||hidden); this.holder.add(item); if(rand) { var t = Math.round(Math.random() * 200); item.top = item.toY + t * (Math.random()*2 > 1 ? -1 : 1); var l = Math.round(Math.random() * 200); item.left = item.toX + l * (Math.random()*2 > 1 ? -1 : 1); } if (hidden) { item.top = 0; item.left = - this.itemWidth - this.xSpace * 2; } } catch(e) { throw e; } }; this.insertGridItem = function(index, item, rand, hidden) { if(rand||hidden) item.hide(); this.gridItems.splice(index,0,item); this.moveItem(item, rand||hidden); this.holder.add(item); if(rand) { var t = Math.round(Math.random() * 200); item.top = item.toY + t * (Math.random()*2 > 1 ? -1 : 1); var l = Math.round(Math.random() * 200); item.left = item.toX + l * (Math.random()*2 > 1 ? -1 : 1); } if (hidden) { item.top = 0; item.left = - this.itemWidth - this.xSpace * 2; } }; this.removeAllGridItems = function() { for(var i = 0; i < this.gridItems.length; i++) { this.holder.remove(this.gridItems[i]); } this.gridItems = []; }; this.removeGridItem = function(item) { var ind = this.gridItems.indexOf(item); this.gridItems.splice(ind, 1); this.holder.remove(item); }; this.moveItem = function(item, fake) { if( typeof this.cols == 'undefined') this.calcCols(); if( typeof this.xSpace == 'undefined') this.calcSpaces(); var ind = this.gridItems.indexOf(item); var row = Math.floor(ind / this.cols); var col = ind - row * this.cols; var x = this.xSpace + (this.itemWidth + this.xSpace) * col; var y = (this.itemHeight + this.ySpace) * row; item.toX = x; item.toY = y; if(!fake) { item.left = x; item.top = y; } item.width = this.itemWidth; //this.holder.height = y + this.itemHeight + this.ySpace + this.marginBottom; ////Ti.API.info(this.holder.size.width + " " + this.holder.size.height + " " + (this.holder.center.x) + " " + this.holder.center.y); }; this.rearrange = function(animate, onlyFirstN, resize, newWidth) { if(!onlyFirstN) onlyFirstN = this.gridItems.length; delete this.xSpace; if(this.columns == 'auto') delete this.cols; if(resize) { this.itemWidth = newWidth; } for(var i = 0; i < this.gridItems.length; i++) { var item = this.gridItems[i]; if(resize) { item.width = newWidth; } this.moveItem(item, animate && i < onlyFirstN); if(animate && i < onlyFirstN) { var t = Math.round(Math.random() * 200); item.top = item.toY + t * (Math.random()*2 > 1 ? -1 : 1); var l = Math.round(Math.random() * 200); item.left = item.toX + l * (Math.random()*2 > 1 ? -1 : 1); item.animate({ left : item.toX, top : item.toY, duration : 200 }); } }; }; this.arrange = function(animate, onlyFirstN) { if(!onlyFirstN) onlyFirstN = this.gridItems.length; for(var i = 0; i < this.gridItems.length; i++) { var item = this.gridItems[i]; this.moveItem(item,1); item.show(); if(animate && i < onlyFirstN) { item.animate({ left : item.toX, top : item.toY, duration : 200 }); } else { item.left = item.toX; item.top = item.toY; } }; }; this.update = function() { if (this.gridItems.length > 0) { //Ti.API.info("GRID UPDATED:" + (parseInt(this.gridItems[this.gridItems.length-1].toY) + parseInt(this.itemHeight) + parseInt(this.ySpace) + parseInt(this.marginBottom))); this.holder.height = parseInt(this.gridItems[this.gridItems.length-1].toY) + parseInt(this.itemHeight) + parseInt(this.ySpace) + parseInt(this.marginBottom) + parseInt(this.marginTop); this.view.contentHeight = parseInt(this.gridItems[this.gridItems.length-1].toY) + parseInt(this.itemHeight) + parseInt(this.ySpace) + parseInt(this.marginBottom) + parseInt(this.marginTop); } } }; module.exports = CustomGrid;
{ "content_hash": "9f650763a450e5a7752fceef8fb52f50", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 201, "avg_line_length": 35.80065359477124, "alnum_prop": 0.5005933363760839, "repo_name": "darknos/Memkit", "id": "1f4b6e25c93be6e83f1f96e6e42ffb3f71c5e8c5", "size": "10955", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/widgets/ip.customGrid/controllers/widget.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "147870" }, { "name": "C++", "bytes": "56135" }, { "name": "CSS", "bytes": "35019" }, { "name": "D", "bytes": "832479" }, { "name": "JavaScript", "bytes": "381008" }, { "name": "Objective-C", "bytes": "3397437" }, { "name": "Python", "bytes": "4668" }, { "name": "Shell", "bytes": "450" } ], "symlink_target": "" }
/** * External dependencies */ import { StoryPropTypes } from '@googleforcreators/elements'; /** * Internal dependencies */ import MediaFrame from '../media/frame'; function ImageFrame({ element }) { return <MediaFrame element={element} />; } ImageFrame.propTypes = { element: StoryPropTypes.elements.image.isRequired, }; export default ImageFrame;
{ "content_hash": "c44a87063c68391257835a5f7b2dcada", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 61, "avg_line_length": 18.1, "alnum_prop": 0.7182320441988951, "repo_name": "GoogleForCreators/web-stories-wp", "id": "6694553b023807f433cb7a6dd89442bbafda00e0", "size": "956", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "packages/element-library/src/image/frame.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "45312" }, { "name": "HTML", "bytes": "81613" }, { "name": "JavaScript", "bytes": "9026703" }, { "name": "PHP", "bytes": "1840505" }, { "name": "Shell", "bytes": "28629" }, { "name": "TypeScript", "bytes": "3393384" } ], "symlink_target": "" }
namespace spvtools { namespace opt { namespace { const uint32_t kBranchCondTrueLabIdInIdx = 1; const uint32_t kBranchCondFalseLabIdInIdx = 2; } // anonymous namespace bool DeadBranchElimPass::GetConstCondition(uint32_t condId, bool* condVal) { bool condIsConst; Instruction* cInst = get_def_use_mgr()->GetDef(condId); switch (cInst->opcode()) { case SpvOpConstantNull: case SpvOpConstantFalse: { *condVal = false; condIsConst = true; } break; case SpvOpConstantTrue: { *condVal = true; condIsConst = true; } break; case SpvOpLogicalNot: { bool negVal; condIsConst = GetConstCondition(cInst->GetSingleWordInOperand(0), &negVal); if (condIsConst) *condVal = !negVal; } break; default: { condIsConst = false; } break; } return condIsConst; } bool DeadBranchElimPass::GetConstInteger(uint32_t selId, uint32_t* selVal) { Instruction* sInst = get_def_use_mgr()->GetDef(selId); uint32_t typeId = sInst->type_id(); Instruction* typeInst = get_def_use_mgr()->GetDef(typeId); if (!typeInst || (typeInst->opcode() != SpvOpTypeInt)) return false; // TODO(greg-lunarg): Support non-32 bit ints if (typeInst->GetSingleWordInOperand(0) != 32) return false; if (sInst->opcode() == SpvOpConstant) { *selVal = sInst->GetSingleWordInOperand(0); return true; } else if (sInst->opcode() == SpvOpConstantNull) { *selVal = 0; return true; } return false; } void DeadBranchElimPass::AddBranch(uint32_t labelId, BasicBlock* bp) { assert(get_def_use_mgr()->GetDef(labelId) != nullptr); std::unique_ptr<Instruction> newBranch( new Instruction(context(), SpvOpBranch, 0, 0, {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {labelId}}})); context()->AnalyzeDefUse(&*newBranch); context()->set_instr_block(&*newBranch, bp); bp->AddInstruction(std::move(newBranch)); } BasicBlock* DeadBranchElimPass::GetParentBlock(uint32_t id) { return context()->get_instr_block(get_def_use_mgr()->GetDef(id)); } bool DeadBranchElimPass::MarkLiveBlocks( Function* func, std::unordered_set<BasicBlock*>* live_blocks) { std::vector<std::pair<BasicBlock*, uint32_t>> conditions_to_simplify; std::unordered_set<BasicBlock*> blocks_with_backedge; std::vector<BasicBlock*> stack; stack.push_back(&*func->begin()); bool modified = false; while (!stack.empty()) { BasicBlock* block = stack.back(); stack.pop_back(); // Live blocks doubles as visited set. if (!live_blocks->insert(block).second) continue; uint32_t cont_id = block->ContinueBlockIdIfAny(); if (cont_id != 0) { AddBlocksWithBackEdge(cont_id, block->id(), block->MergeBlockIdIfAny(), &blocks_with_backedge); } Instruction* terminator = block->terminator(); uint32_t live_lab_id = 0; // Check if the terminator has a single valid successor. if (terminator->opcode() == SpvOpBranchConditional) { bool condVal; if (GetConstCondition(terminator->GetSingleWordInOperand(0u), &condVal)) { live_lab_id = terminator->GetSingleWordInOperand( condVal ? kBranchCondTrueLabIdInIdx : kBranchCondFalseLabIdInIdx); } } else if (terminator->opcode() == SpvOpSwitch) { uint32_t sel_val; if (GetConstInteger(terminator->GetSingleWordInOperand(0u), &sel_val)) { // Search switch operands for selector value, set live_lab_id to // corresponding label, use default if not found. uint32_t icnt = 0; uint32_t case_val; terminator->WhileEachInOperand( [&icnt, &case_val, &sel_val, &live_lab_id](const uint32_t* idp) { if (icnt == 1) { // Start with default label. live_lab_id = *idp; } else if (icnt > 1) { if (icnt % 2 == 0) { case_val = *idp; } else { if (case_val == sel_val) { live_lab_id = *idp; return false; } } } ++icnt; return true; }); } } // Don't simplify back edges unless it becomes a branch to the header. Every // loop must have exactly one back edge to the loop header, so we cannot // remove it. bool simplify = false; if (live_lab_id != 0) { if (!blocks_with_backedge.count(block)) { // This is not a back edge. simplify = true; } else { const auto& struct_cfg_analysis = context()->GetStructuredCFGAnalysis(); uint32_t header_id = struct_cfg_analysis->ContainingLoop(block->id()); if (live_lab_id == header_id) { // The new branch will be a branch to the header. simplify = true; } } } if (simplify) { conditions_to_simplify.push_back({block, live_lab_id}); stack.push_back(GetParentBlock(live_lab_id)); } else { // All successors are live. const auto* const_block = block; const_block->ForEachSuccessorLabel([&stack, this](const uint32_t label) { stack.push_back(GetParentBlock(label)); }); } } // Traverse |conditions_to_simplify| in reverse order. This is done so that // we simplify nested constructs before simplifying the constructs that // contain them. for (auto b = conditions_to_simplify.rbegin(); b != conditions_to_simplify.rend(); ++b) { modified |= SimplifyBranch(b->first, b->second); } return modified; } bool DeadBranchElimPass::SimplifyBranch(BasicBlock* block, uint32_t live_lab_id) { Instruction* merge_inst = block->GetMergeInst(); Instruction* terminator = block->terminator(); if (merge_inst && merge_inst->opcode() == SpvOpSelectionMerge) { if (merge_inst->NextNode()->opcode() == SpvOpSwitch && SwitchHasNestedBreak(block->id())) { if (terminator->NumInOperands() == 2) { // We cannot remove the branch, and it already has a single case, so no // work to do. return false; } // We have to keep the switch because it has a nest break, so we // remove all cases except for the live one. Instruction::OperandList new_operands; new_operands.push_back(terminator->GetInOperand(0)); new_operands.push_back({SPV_OPERAND_TYPE_ID, {live_lab_id}}); terminator->SetInOperands(move(new_operands)); context()->UpdateDefUse(terminator); } else { // Check if the merge instruction is still needed because of a // non-nested break from the construct. Move the merge instruction if // it is still needed. StructuredCFGAnalysis* cfg_analysis = context()->GetStructuredCFGAnalysis(); Instruction* first_break = FindFirstExitFromSelectionMerge( live_lab_id, merge_inst->GetSingleWordInOperand(0), cfg_analysis->LoopMergeBlock(live_lab_id), cfg_analysis->LoopContinueBlock(live_lab_id), cfg_analysis->SwitchMergeBlock(live_lab_id)); AddBranch(live_lab_id, block); context()->KillInst(terminator); if (first_break == nullptr) { context()->KillInst(merge_inst); } else { merge_inst->RemoveFromList(); first_break->InsertBefore(std::unique_ptr<Instruction>(merge_inst)); context()->set_instr_block(merge_inst, context()->get_instr_block(first_break)); } } } else { AddBranch(live_lab_id, block); context()->KillInst(terminator); } return true; } void DeadBranchElimPass::MarkUnreachableStructuredTargets( const std::unordered_set<BasicBlock*>& live_blocks, std::unordered_set<BasicBlock*>* unreachable_merges, std::unordered_map<BasicBlock*, BasicBlock*>* unreachable_continues) { for (auto block : live_blocks) { if (auto merge_id = block->MergeBlockIdIfAny()) { BasicBlock* merge_block = GetParentBlock(merge_id); if (!live_blocks.count(merge_block)) { unreachable_merges->insert(merge_block); } if (auto cont_id = block->ContinueBlockIdIfAny()) { BasicBlock* cont_block = GetParentBlock(cont_id); if (!live_blocks.count(cont_block)) { (*unreachable_continues)[cont_block] = block; } } } } } bool DeadBranchElimPass::FixPhiNodesInLiveBlocks( Function* func, const std::unordered_set<BasicBlock*>& live_blocks, const std::unordered_map<BasicBlock*, BasicBlock*>& unreachable_continues) { bool modified = false; for (auto& block : *func) { if (live_blocks.count(&block)) { for (auto iter = block.begin(); iter != block.end();) { if (iter->opcode() != SpvOpPhi) { break; } bool changed = false; bool backedge_added = false; Instruction* inst = &*iter; std::vector<Operand> operands; // Build a complete set of operands (not just input operands). Start // with type and result id operands. operands.push_back(inst->GetOperand(0u)); operands.push_back(inst->GetOperand(1u)); // Iterate through the incoming labels and determine which to keep // and/or modify. If there in an unreachable continue block, there will // be an edge from that block to the header. We need to keep it to // maintain the structured control flow. If the header has more that 2 // incoming edges, then the OpPhi must have an entry for that edge. // However, if there is only one other incoming edge, the OpPhi can be // eliminated. for (uint32_t i = 1; i < inst->NumInOperands(); i += 2) { BasicBlock* inc = GetParentBlock(inst->GetSingleWordInOperand(i)); auto cont_iter = unreachable_continues.find(inc); if (cont_iter != unreachable_continues.end() && cont_iter->second == &block && inst->NumInOperands() > 4) { if (get_def_use_mgr() ->GetDef(inst->GetSingleWordInOperand(i - 1)) ->opcode() == SpvOpUndef) { // Already undef incoming value, no change necessary. operands.push_back(inst->GetInOperand(i - 1)); operands.push_back(inst->GetInOperand(i)); backedge_added = true; } else { // Replace incoming value with undef if this phi exists in the // loop header. Otherwise, this edge is not live since the // unreachable continue block will be replaced with an // unconditional branch to the header only. operands.emplace_back( SPV_OPERAND_TYPE_ID, std::initializer_list<uint32_t>{Type2Undef(inst->type_id())}); operands.push_back(inst->GetInOperand(i)); changed = true; backedge_added = true; } } else if (live_blocks.count(inc) && inc->IsSuccessor(&block)) { // Keep live incoming edge. operands.push_back(inst->GetInOperand(i - 1)); operands.push_back(inst->GetInOperand(i)); } else { // Remove incoming edge. changed = true; } } if (changed) { modified = true; uint32_t continue_id = block.ContinueBlockIdIfAny(); if (!backedge_added && continue_id != 0 && unreachable_continues.count(GetParentBlock(continue_id)) && operands.size() > 4) { // Changed the backedge to branch from the continue block instead // of a successor of the continue block. Add an entry to the phi to // provide an undef for the continue block. Since the successor of // the continue must also be unreachable (dominated by the continue // block), any entry for the original backedge has been removed // from the phi operands. operands.emplace_back( SPV_OPERAND_TYPE_ID, std::initializer_list<uint32_t>{Type2Undef(inst->type_id())}); operands.emplace_back(SPV_OPERAND_TYPE_ID, std::initializer_list<uint32_t>{continue_id}); } // Either replace the phi with a single value or rebuild the phi out // of |operands|. // // We always have type and result id operands. So this phi has a // single source if there are two more operands beyond those. if (operands.size() == 4) { // First input data operands is at index 2. uint32_t replId = operands[2u].words[0]; context()->KillNamesAndDecorates(inst->result_id()); context()->ReplaceAllUsesWith(inst->result_id(), replId); iter = context()->KillInst(&*inst); } else { // We've rewritten the operands, so first instruct the def/use // manager to forget uses in the phi before we replace them. After // replacing operands update the def/use manager by re-analyzing // the used ids in this phi. get_def_use_mgr()->EraseUseRecordsOfOperandIds(inst); inst->ReplaceOperands(operands); get_def_use_mgr()->AnalyzeInstUse(inst); ++iter; } } else { ++iter; } } } } return modified; } bool DeadBranchElimPass::EraseDeadBlocks( Function* func, const std::unordered_set<BasicBlock*>& live_blocks, const std::unordered_set<BasicBlock*>& unreachable_merges, const std::unordered_map<BasicBlock*, BasicBlock*>& unreachable_continues) { bool modified = false; for (auto ebi = func->begin(); ebi != func->end();) { if (unreachable_continues.count(&*ebi)) { uint32_t cont_id = unreachable_continues.find(&*ebi)->second->id(); if (ebi->begin() != ebi->tail() || ebi->terminator()->opcode() != SpvOpBranch || ebi->terminator()->GetSingleWordInOperand(0u) != cont_id) { // Make unreachable, but leave the label. KillAllInsts(&*ebi, false); // Add unconditional branch to header. assert(unreachable_continues.count(&*ebi)); ebi->AddInstruction(MakeUnique<Instruction>( context(), SpvOpBranch, 0, 0, std::initializer_list<Operand>{{SPV_OPERAND_TYPE_ID, {cont_id}}})); get_def_use_mgr()->AnalyzeInstUse(&*ebi->tail()); context()->set_instr_block(&*ebi->tail(), &*ebi); modified = true; } ++ebi; } else if (unreachable_merges.count(&*ebi)) { if (ebi->begin() != ebi->tail() || ebi->terminator()->opcode() != SpvOpUnreachable) { // Make unreachable, but leave the label. KillAllInsts(&*ebi, false); // Add unreachable terminator. ebi->AddInstruction( MakeUnique<Instruction>(context(), SpvOpUnreachable, 0, 0, std::initializer_list<Operand>{})); context()->AnalyzeUses(ebi->terminator()); context()->set_instr_block(ebi->terminator(), &*ebi); modified = true; } ++ebi; } else if (!live_blocks.count(&*ebi)) { // Kill this block. KillAllInsts(&*ebi); ebi = ebi.Erase(); modified = true; } else { ++ebi; } } return modified; } bool DeadBranchElimPass::EliminateDeadBranches(Function* func) { if (func->IsDeclaration()) { return false; } bool modified = false; std::unordered_set<BasicBlock*> live_blocks; modified |= MarkLiveBlocks(func, &live_blocks); std::unordered_set<BasicBlock*> unreachable_merges; std::unordered_map<BasicBlock*, BasicBlock*> unreachable_continues; MarkUnreachableStructuredTargets(live_blocks, &unreachable_merges, &unreachable_continues); modified |= FixPhiNodesInLiveBlocks(func, live_blocks, unreachable_continues); modified |= EraseDeadBlocks(func, live_blocks, unreachable_merges, unreachable_continues); return modified; } void DeadBranchElimPass::FixBlockOrder() { context()->BuildInvalidAnalyses(IRContext::kAnalysisCFG | IRContext::kAnalysisDominatorAnalysis); // Reorders blocks according to DFS of dominator tree. ProcessFunction reorder_dominators = [this](Function* function) { DominatorAnalysis* dominators = context()->GetDominatorAnalysis(function); std::vector<BasicBlock*> blocks; for (auto iter = dominators->GetDomTree().begin(); iter != dominators->GetDomTree().end(); ++iter) { if (iter->id() != 0) { blocks.push_back(iter->bb_); } } for (uint32_t i = 1; i < blocks.size(); ++i) { function->MoveBasicBlockToAfter(blocks[i]->id(), blocks[i - 1]); } return true; }; // Reorders blocks according to structured order. ProcessFunction reorder_structured = [this](Function* function) { std::list<BasicBlock*> order; context()->cfg()->ComputeStructuredOrder(function, &*function->begin(), &order); std::vector<BasicBlock*> blocks; for (auto block : order) { blocks.push_back(block); } for (uint32_t i = 1; i < blocks.size(); ++i) { function->MoveBasicBlockToAfter(blocks[i]->id(), blocks[i - 1]); } return true; }; // Structured order is more intuitive so use it where possible. if (context()->get_feature_mgr()->HasCapability(SpvCapabilityShader)) { context()->ProcessReachableCallTree(reorder_structured); } else { context()->ProcessReachableCallTree(reorder_dominators); } } Pass::Status DeadBranchElimPass::Process() { // Do not process if module contains OpGroupDecorate. Additional // support required in KillNamesAndDecorates(). // TODO(greg-lunarg): Add support for OpGroupDecorate for (auto& ai : get_module()->annotations()) if (ai.opcode() == SpvOpGroupDecorate) return Status::SuccessWithoutChange; // Process all entry point functions ProcessFunction pfn = [this](Function* fp) { return EliminateDeadBranches(fp); }; bool modified = context()->ProcessReachableCallTree(pfn); if (modified) FixBlockOrder(); return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange; } Instruction* DeadBranchElimPass::FindFirstExitFromSelectionMerge( uint32_t start_block_id, uint32_t merge_block_id, uint32_t loop_merge_id, uint32_t loop_continue_id, uint32_t switch_merge_id) { // To find the "first" exit, we follow branches looking for a conditional // branch that is not in a nested construct and is not the header of a new // construct. We follow the control flow from |start_block_id| to find the // first one. while (start_block_id != merge_block_id && start_block_id != loop_merge_id && start_block_id != loop_continue_id) { BasicBlock* start_block = context()->get_instr_block(start_block_id); Instruction* branch = start_block->terminator(); uint32_t next_block_id = 0; switch (branch->opcode()) { case SpvOpBranchConditional: next_block_id = start_block->MergeBlockIdIfAny(); if (next_block_id == 0) { // If a possible target is the |loop_merge_id| or |loop_continue_id|, // which are not the current merge node, then we continue the search // with the other target. for (uint32_t i = 1; i < 3; i++) { if (branch->GetSingleWordInOperand(i) == loop_merge_id && loop_merge_id != merge_block_id) { next_block_id = branch->GetSingleWordInOperand(3 - i); break; } if (branch->GetSingleWordInOperand(i) == loop_continue_id && loop_continue_id != merge_block_id) { next_block_id = branch->GetSingleWordInOperand(3 - i); break; } if (branch->GetSingleWordInOperand(i) == switch_merge_id && switch_merge_id != merge_block_id) { next_block_id = branch->GetSingleWordInOperand(3 - i); break; } } if (next_block_id == 0) { return branch; } } break; case SpvOpSwitch: next_block_id = start_block->MergeBlockIdIfAny(); if (next_block_id == 0) { // A switch with no merge instructions can have at most 5 targets: // a. |merge_block_id| // b. |loop_merge_id| // c. |loop_continue_id| // d. |switch_merge_id| // e. 1 block inside the current region. // // Note that because this is a switch, |merge_block_id| must equal // |switch_merge_id|. // // This leads to a number of cases of what to do. // // 1. Does not jump to a block inside of the current construct. In // this case, there is not conditional break, so we should return // |nullptr|. // // 2. Jumps to |merge_block_id| and a block inside the current // construct. In this case, this branch conditionally break to the // end of the current construct, so return the current branch. // // 3. Otherwise, this branch may break, but not to the current merge // block. So we continue with the block that is inside the loop. bool found_break = false; for (uint32_t i = 1; i < branch->NumInOperands(); i += 2) { uint32_t target = branch->GetSingleWordInOperand(i); if (target == merge_block_id) { found_break = true; } else if (target != loop_merge_id && target != loop_continue_id) { next_block_id = branch->GetSingleWordInOperand(i); } } if (next_block_id == 0) { // Case 1. return nullptr; } if (found_break) { // Case 2. return branch; } // The fall through is case 3. } break; case SpvOpBranch: // Need to check if this is the header of a loop nested in the // selection construct. next_block_id = start_block->MergeBlockIdIfAny(); if (next_block_id == 0) { next_block_id = branch->GetSingleWordInOperand(0); } break; default: return nullptr; } start_block_id = next_block_id; } return nullptr; } void DeadBranchElimPass::AddBlocksWithBackEdge( uint32_t cont_id, uint32_t header_id, uint32_t merge_id, std::unordered_set<BasicBlock*>* blocks_with_back_edges) { std::unordered_set<uint32_t> visited; visited.insert(cont_id); visited.insert(header_id); visited.insert(merge_id); std::vector<uint32_t> work_list; work_list.push_back(cont_id); while (!work_list.empty()) { uint32_t bb_id = work_list.back(); work_list.pop_back(); BasicBlock* bb = context()->get_instr_block(bb_id); bool has_back_edge = false; bb->ForEachSuccessorLabel([header_id, &visited, &work_list, &has_back_edge](uint32_t* succ_label_id) { if (visited.insert(*succ_label_id).second) { work_list.push_back(*succ_label_id); } if (*succ_label_id == header_id) { has_back_edge = true; } }); if (has_back_edge) { blocks_with_back_edges->insert(bb); } } } bool DeadBranchElimPass::SwitchHasNestedBreak(uint32_t switch_header_id) { std::vector<BasicBlock*> block_in_construct; BasicBlock* start_block = context()->get_instr_block(switch_header_id); uint32_t merge_block_id = start_block->MergeBlockIdIfAny(); StructuredCFGAnalysis* cfg_analysis = context()->GetStructuredCFGAnalysis(); return !get_def_use_mgr()->WhileEachUser( merge_block_id, [this, cfg_analysis, switch_header_id](Instruction* inst) { if (!inst->IsBranch()) { return true; } BasicBlock* bb = context()->get_instr_block(inst); if (bb->id() == switch_header_id) { return true; } return (cfg_analysis->ContainingConstruct(inst) == switch_header_id && bb->GetMergeInst() == nullptr); }); } } // namespace opt } // namespace spvtools
{ "content_hash": "305c75224322948727b1339c06efffe9", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 80, "avg_line_length": 38.49369085173502, "alnum_prop": 0.600040975209998, "repo_name": "pierremoreau/SPIRV-Tools", "id": "356dbcb34a375b43d289d9b0ff43909a0bbf881a", "size": "25391", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "source/opt/dead_branch_elim_pass.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "9867" }, { "name": "C", "bytes": "68388" }, { "name": "C++", "bytes": "18228934" }, { "name": "CMake", "bytes": "115791" }, { "name": "Emacs Lisp", "bytes": "1654" }, { "name": "Go", "bytes": "859552" }, { "name": "HTML", "bytes": "493" }, { "name": "JavaScript", "bytes": "136536" }, { "name": "Makefile", "bytes": "15151" }, { "name": "Python", "bytes": "156232" }, { "name": "Ruby", "bytes": "2885" }, { "name": "Shell", "bytes": "30449" }, { "name": "Starlark", "bytes": "22705" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.Objects; using ASPPatterns.Chap7.Library.Infrastructure.Query; namespace ASPPatterns.Chap7.Library.Repository.EF.QueryTranslators { public abstract class QueryTranslator { public void CreateQueryAndObjectParameters(Query query, StringBuilder queryBuilder, IList<ObjectParameter> paraColl) { foreach (Criterion criterion in query.Criteria) { switch (criterion.criteriaOperator) { case CriteriaOperator.Equal: queryBuilder.Append(String.Format("it.{0} = @{0}", criterion.PropertyName)); break; case CriteriaOperator.LesserThanOrEqual: queryBuilder.Append(String.Format("it.{0} <= @{0}", criterion.PropertyName)); break; default: throw new ApplicationException("No operator defined"); } paraColl.Add(new ObjectParameter(criterion.PropertyName, criterion.Value)); } } } }
{ "content_hash": "1ad9bf4c42b05498e02e1049f5f33878", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 124, "avg_line_length": 37.53125, "alnum_prop": 0.5870108243130724, "repo_name": "liqipeng/helloGithub", "id": "243b28d653f185e8f4af90a204c857590795f7da", "size": "1203", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Book-Code/ASP.NET Design Pattern/ASPPatternsc07/ASPPatterns.Chap7.Library/ASPPatterns.Chap7.Library.Repository.EF/QueryTranslators/QueryTranslator.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "696846" }, { "name": "C#", "bytes": "5669849" }, { "name": "CSS", "bytes": "75115" }, { "name": "HTML", "bytes": "4916" }, { "name": "JavaScript", "bytes": "405514" }, { "name": "Shell", "bytes": "67" }, { "name": "Visual Basic", "bytes": "196606" }, { "name": "XSLT", "bytes": "12347" } ], "symlink_target": "" }
namespace mate { Locker::Locker(v8::Isolate* isolate) { if (v8::Locker::IsActive()) locker_.reset(new v8::Locker(isolate)); } Locker::~Locker() { } } // namespace mate
{ "content_hash": "2be2057924d4e35559a26e1a6322be3f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 43, "avg_line_length": 16.181818181818183, "alnum_prop": 0.6348314606741573, "repo_name": "Don-1/info3180-project3-4", "id": "c85e68e35f34c158170198a2a6118976acf40ee4", "size": "386", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "app/static/invader-node_modules/grunt-asar/node_modules/asar/node_modules/chromium-pickle/node_modules/native-mate/vendor/src/native_mate/locker.cc", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2224" }, { "name": "HTML", "bytes": "13310" }, { "name": "JavaScript", "bytes": "1592952" }, { "name": "Python", "bytes": "6964" } ], "symlink_target": "" }
function squares( context ) { this.init( context ); } squares.prototype = { name: "Squares", context: null, prevMouseX: null, prevMouseY: null, init: function( context ) { this.context = context; this.context.globalCompositeOperation = 'source-over'; }, destroy: function() { }, strokeStart: function( mouseX, mouseY ) { this.prevMouseX = mouseX; this.prevMouseY = mouseY; }, stroke: function( mouseX, mouseY ) { var dx, dy, angle, px, py; dx = mouseX - this.prevMouseX; dy = mouseY - this.prevMouseY; angle = 1.57079633; px = Math.cos(angle) * dx - Math.sin(angle) * dy; py = Math.sin(angle) * dx + Math.cos(angle) * dy; this.context.lineWidth = BRUSH_SIZE; this.context.fillStyle = "rgba(" + BACKGROUND_COLOR[0] + ", " + BACKGROUND_COLOR[1] + ", " + BACKGROUND_COLOR[2] + ", " + BRUSH_PRESSURE + ")"; this.context.strokeStyle = "rgba(" + COLOR[0] + ", " + COLOR[1] + ", " + COLOR[2] + ", " + BRUSH_PRESSURE + ")"; this.context.beginPath(); this.context.moveTo(this.prevMouseX - px, this.prevMouseY - py); this.context.lineTo(this.prevMouseX + px, this.prevMouseY + py); this.context.lineTo(mouseX + px, mouseY + py); this.context.lineTo(mouseX - px, mouseY - py); this.context.lineTo(this.prevMouseX - px, this.prevMouseY - py); this.context.fill(); this.context.stroke(); this.prevMouseX = mouseX; this.prevMouseY = mouseY; }, strokeEnd: function() { } }
{ "content_hash": "4ff7632e8b34cc81339396d74e06a5a0", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 151, "avg_line_length": 26.737704918032787, "alnum_prop": 0.5665236051502146, "repo_name": "shdxiang/shdxiang.github.io", "id": "ac9983adf3d15dd5ab53f32df91e99a7a0d8d6d8", "size": "1631", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "drawing/js/brushes/squares.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "27652" }, { "name": "HTML", "bytes": "13876" }, { "name": "JavaScript", "bytes": "56689" } ], "symlink_target": "" }
export default 'comment';
{ "content_hash": "ec5978580c9c9ddbcd602f2fd7aaf178", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 25, "avg_line_length": 26, "alnum_prop": 0.7692307692307693, "repo_name": "theseushu/funong-web", "id": "6d5b5ba421ae8bc605ebee4bcdd4f47fcdc06874", "size": "26", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/modules/common/comments/form/formName.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1787" }, { "name": "CSS", "bytes": "52514" }, { "name": "HTML", "bytes": "11224" }, { "name": "JavaScript", "bytes": "1044939" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en"> <!-- generated by Apache Maven JXR (jdk8) --> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>fax4j 0.45.0 Reference Package org.fax4j.util</title> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="style" /> </head> <body> <div class="topNav"> <a name="navbar_top"><!-- --></a> <a href="#skip-navbar_top" title="Skip navigation links"></a> <a name="navbar_top_firstrow"><!-- --></a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li>Use</li> <li>Tree</li> <li>Deprecated</li> <li>Index</li> <li>Help</li> </ul> <div class="aboutLanguage"><em><strong>fax4j 0.45.0 Reference</strong></em></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?overview-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li>All Classes</li> </ul> <div> </div> <a name="skip-navbar_top"><!-- --></a> </div> <div class="header"> <h1 title="Package" class="title">Package org.fax4j.util</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <thead> <tr> <th class="colFirst colLast" scope="col">Class</th> </tr> </thead> <tbody> <tr class="altColor"> <td class="colFirst colLast"> <a href="AbstractCloseable.html#AbstractCloseable" target="classFrame" title="class in org.fax4j.util">AbstractCloseable</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="AbstractConnectionFactory.html#AbstractConnectionFactory" target="classFrame" title="class in org.fax4j.util">AbstractConnectionFactory</a> </td> </tr> <tr class="altColor"> <td class="colFirst colLast"> <a href="AbstractFax4JConnectionFactory.html#AbstractFax4JConnectionFactory" target="classFrame" title="class in org.fax4j.util">AbstractFax4JConnectionFactory</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="AbstractProcessExecutor.html#AbstractProcessExecutor" target="classFrame" title="class in org.fax4j.util">AbstractProcessExecutor</a> </td> </tr> <tr class="altColor"> <td class="colFirst colLast"> <a href="CloseableResourceManager.html#CloseableResourceManager" target="classFrame" title="class in org.fax4j.util">CloseableResourceManager</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="CloseableResourceManager.html#CloseableResourceManager.CloseableResourceShutdownHook" target="classFrame" title="class in org.fax4j.util">CloseableResourceManager.CloseableResourceShutdownHook</a> </td> </tr> <tr class="altColor"> <td class="colFirst colLast"> <a href="Connection.html#Connection" target="classFrame" title="class in org.fax4j.util">Connection</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="ConnectionFactory.html#ConnectionFactory" target="classFrame" title="class in org.fax4j.util">ConnectionFactory</a> </td> </tr> <tr class="altColor"> <td class="colFirst colLast"> <a href="ConnectionImpl.html#ConnectionImpl" target="classFrame" title="class in org.fax4j.util">ConnectionImpl</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="DefaultProcessExecutor.html#DefaultProcessExecutor" target="classFrame" title="class in org.fax4j.util">DefaultProcessExecutor</a> </td> </tr> <tr class="altColor"> <td class="colFirst colLast"> <a href="IOHelper.html#IOHelper" target="classFrame" title="class in org.fax4j.util">IOHelper</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="IOHelper.html#IOHelper.OutputReadThread" target="classFrame" title="class in org.fax4j.util">IOHelper.OutputReadThread</a> </td> </tr> <tr class="altColor"> <td class="colFirst colLast"> <a href="LibraryConfigurationLoader.html#LibraryConfigurationLoader" target="classFrame" title="class in org.fax4j.util">LibraryConfigurationLoader</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="ProcessExecutor.html#ProcessExecutor" target="classFrame" title="class in org.fax4j.util">ProcessExecutor</a> </td> </tr> <tr class="altColor"> <td class="colFirst colLast"> <a href="ProcessExecutorHelper.html#ProcessExecutorHelper" target="classFrame" title="class in org.fax4j.util">ProcessExecutorHelper</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="ProcessExecutorHelper.html#ProcessExecutorHelper.ProcessOutput" target="classFrame" title="class in org.fax4j.util">ProcessExecutorHelper.ProcessOutput</a> </td> </tr> <tr class="altColor"> <td class="colFirst colLast"> <a href="ReflectionHelper.html#ReflectionHelper" target="classFrame" title="class in org.fax4j.util">ReflectionHelper</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="SpiUtil.html#SpiUtil" target="classFrame" title="class in org.fax4j.util">SpiUtil</a> </td> </tr> <tr class="altColor"> <td class="colFirst colLast"> <a href="SpiUtil.html#SpiUtil.TemplateParameterEncoder" target="classFrame" title="class in org.fax4j.util">SpiUtil.TemplateParameterEncoder</a> </td> </tr> <tr class="rowColor"> <td class="colFirst colLast"> <a href="SpiUtil.html#SpiUtil.URLTemplateParameterEncoder" target="classFrame" title="class in org.fax4j.util">SpiUtil.URLTemplateParameterEncoder</a> </td> </tr> </tbody> </table> </li> </ul> </div> <div class="bottomNav"> <a name="navbar_bottom"><!-- --></a> <a href="#skip-navbar_bottom" title="Skip navigation links"></a> <a name="navbar_bottom_firstrow"><!-- --></a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li>Use</li> <li>Tree</li> <li>Deprecated</li> <li>Index</li> <li>Help</li> </ul> <div class="aboutLanguage"><em><strong>fax4j 0.45.0 Reference</strong></em></div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../index.html?overview-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li>All Classes</li> </ul> <div> </div> <a name="skip-navbar_bottom"><!-- --></a> </div> <div id="footer"> Copyright &#169; 2009&#x2013;2020 <a href="https://github.com/sagiegurari/fax4j">fax4j</a>. All rights reserved. </div> </body> </html>
{ "content_hash": "c016ba6d2dfb32bc2a4102ff276f0770", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 241, "avg_line_length": 65.81094527363184, "alnum_prop": 0.37322346537647416, "repo_name": "sagiegurari/fax4j", "id": "6505e9319b5f6b6ffaba6cb3b093b5539af82c87", "size": "13229", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/xref/org/fax4j/util/package-summary.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "340" }, { "name": "C", "bytes": "5384" }, { "name": "C++", "bytes": "28759" }, { "name": "CMake", "bytes": "42888" }, { "name": "HTML", "bytes": "245" }, { "name": "Java", "bytes": "1258648" }, { "name": "Shell", "bytes": "24" }, { "name": "VBScript", "bytes": "5882" } ], "symlink_target": "" }
require "gem_logger/version" require 'logger' require 'active_support/concern' require 'active_support/core_ext/object' require 'active_support/core_ext/module/delegation' require "gem_logger/basic_logger" require "gem_logger/context_handler" require "gem_logger/gem_logger" require "gem_logger/logger_support" require "gem_logger/log4r_handler/context_handler"
{ "content_hash": "85bf639f8c8bcae6d5142f3db51cbc6b", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 51, "avg_line_length": 30.333333333333332, "alnum_prop": 0.8021978021978022, "repo_name": "wr0ngway/gem_logger", "id": "7e318b635f0001e50dfce177541aa1716b99fa53", "size": "364", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/gem_logger.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "27691" } ], "symlink_target": "" }
@interface UITableViewCell (ERNHelper) +(instancetype)createWithCellReuser:(UITableViewCell *(^)(NSString *identifier))block style:(UITableViewCellStyle)style; @end
{ "content_hash": "83ee31409a5f1e68993724231740c9d5", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 85, "avg_line_length": 39.2, "alnum_prop": 0.6938775510204082, "repo_name": "ernstsson/ErnKit", "id": "cfc080d3b3ff5f1eb89c86e0257d7fb7252c91cd", "size": "221", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/ErnKitUIKitIntegration/TableViewHelpers/UITableViewCell+ERNHelper.h", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "831" }, { "name": "Objective-C", "bytes": "501590" }, { "name": "Ruby", "bytes": "5618" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>libhyps: 19 s 🏆</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.12.0 / libhyps - 2.0.5</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> libhyps <small> 2.0.5 <span class="label label-success">19 s 🏆</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-09-13 14:50:05 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-09-13 14:50:05 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.12.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.10.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.10.2 Official release 4.10.2 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.5 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Pierre.Courtieu@lecnam.net&quot; synopsis: &quot;Hypotheses manipulation library&quot; homepage: &quot;https://github.com/Matafou/LibHyps&quot; dev-repo: &quot;git+https://github.com/Matafou/LibHyps.git&quot; bug-reports: &quot;https://github.com/Matafou/LibHyps/issues&quot; doc: &quot;https://github.com/Matafou/LibHyps/blob/master/Demo/demo.v&quot; license: &quot;MIT&quot; build: [ [&quot;./configure.sh&quot;] [make &quot;-j%{jobs}%&quot;] ] install: [make &quot;install&quot;] depends: [ &quot;coq&quot; {(&gt;= &quot;8.11&quot; &amp; &lt; &quot;8.17~&quot;) | (= &quot;dev&quot;)} ] tags: [ &quot;keyword:proof environment manipulation&quot; &quot;keyword:forward reasoning&quot; &quot;keyword:hypothesis naming&quot; &quot;category:Miscellaneous/Coq Tactics Library&quot; &quot;logpath:LibHyps&quot; &quot;date:2021-11-18&quot; ] authors: [ &quot;Pierre Courtieu&quot; ] description: &quot; This library defines a set of tactics to manipulate hypothesis individually or by group. In particular it allows applying a tactic on each hypothesis of a goal, or only on *new* hypothesis after some tactic. Examples of manipulations: automatic renaming, subst, revert, or any tactic expecting a hypothesis name as argument. It also provides the especialize tactic to ease forward reasoning by instantianting one, several or all premisses of a hypothesis. &quot; url { http: &quot;https://github.com/Matafou/LibHyps/archive/libhyps-2.0.5.tar.gz&quot; checksum: &quot;sha512=226406461c91f700367752b3bc0c4be2596ebc60889d8441719f67ab97e3582083e935d2ecba0ed576244420df9f6fa7126f0125ecaeff27a3de96bb252118e1&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-libhyps.2.0.5 coq.8.12.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-libhyps.2.0.5 coq.8.12.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>12 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-libhyps.2.0.5 coq.8.12.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>19 s</dd> </dl> <h2>Installation size</h2> <p>Total: 354 K</p> <ul> <li>103 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibHypsNaming.vo</code></li> <li>52 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibHypsTactics.vo</code></li> <li>46 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibSpecialize.vo</code></li> <li>39 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibHyps.vo</code></li> <li>21 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibHypsNaming.v</code></li> <li>18 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibSpecialize.v</code></li> <li>15 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/TacNewHyps.vo</code></li> <li>14 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibHypsTactics.glob</code></li> <li>11 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibHypsTactics.v</code></li> <li>11 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/TacNewHyps.v</code></li> <li>9 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibHypsNaming.glob</code></li> <li>6 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibDecomp.vo</code></li> <li>5 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibHyps.v</code></li> <li>2 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/TacNewHyps.glob</code></li> <li>2 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibDecomp.v</code></li> <li>1 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibDecomp.glob</code></li> <li>1 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibHyps.glob</code></li> <li>1 K <code>../ocaml-base-compiler.4.10.2/lib/coq/user-contrib/LibHyps/LibSpecialize.glob</code></li> </ul> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-libhyps.2.0.5</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "134f2aaff459a7b619d08e960dc122cf", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 161, "avg_line_length": 47.62303664921466, "alnum_prop": 0.5732189973614775, "repo_name": "coq-bench/coq-bench.github.io", "id": "19fc92b0d244602f62ae41eeddfde2e4c8bb0169", "size": "9121", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.10.2-2.0.6/released/8.12.0/libhyps/2.0.5.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?xml version ="1.0"?> <package> <name>glados</name> <version>0.0.1</version> <description> evil robotic toyOS </description> <maintainer email="evilOverlord@cse.sc.edu"> evil overlord Thijs </maintainer> <license >free to attack people</license > <buildtool_depend>catkin </buildtool_depend> <build_depend>geometry_msgs</build_depend> <run_depend>geometry_msgs</run_depend> <build_depend>std_msgs</build_depend> <run_depend>std_msgs</run_depend> <build_depend>turtlesim </build_depend> <run_depend>turtlesim </run_depend> <build_depend>roscpp</build_depend> <run_depend>roscpp</run_depend> </package>
{ "content_hash": "d6a9f6ef236483d1038f8c45ab1f5be0", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 44, "avg_line_length": 28.666666666666668, "alnum_prop": 0.7524916943521595, "repo_name": "thijser/robotica-minor-5", "id": "810fe55ed46aaa0f08e8e2853d5434e7ffc84120", "size": "602", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "turtleCode/install/share/glados/package.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Arduino", "bytes": "19131" }, { "name": "C", "bytes": "1087410" }, { "name": "C++", "bytes": "3671938" }, { "name": "D", "bytes": "28193" }, { "name": "Makefile", "bytes": "10682" }, { "name": "Python", "bytes": "203232" }, { "name": "Shell", "bytes": "354040" }, { "name": "TeX", "bytes": "103504" } ], "symlink_target": "" }
package com.wrapper.spotify.methods; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.SettableFuture; import com.wrapper.spotify.Api; import com.wrapper.spotify.TestUtil; import com.wrapper.spotify.models.Artist; import org.junit.Test; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import static junit.framework.TestCase.*; public class RelatedArtistsRequestTest { @Test public void shouldGetRelatedArtists_async() throws Exception { final Api api = Api.DEFAULT_API; final RelatedArtistsRequest request = api .getArtistRelatedArtists("0qeei9KQnptjwb8MgkqEoy") .httpManager(TestUtil.MockedHttpManager.returningJson("related-artists.json")) .build(); final CountDownLatch asyncCompleted = new CountDownLatch(1); final SettableFuture<List<Artist>> artistFuture = request.getAsync(); Futures.addCallback(artistFuture, new FutureCallback<List<Artist>>() { @Override public void onSuccess(List<Artist> artists) { assertFalse(artists.isEmpty()); final Artist firstArtist = artists.get(0); final String id = firstArtist.getId(); assertEquals("https://api.spotify.com/v1/artists/" + id, firstArtist.getHref()); assertEquals(id, firstArtist.getId()); assertEquals("spotify:artist:" + id, firstArtist.getUri()); asyncCompleted.countDown(); } @Override public void onFailure(Throwable throwable) { fail("Failed to resolve future"); } }); asyncCompleted.await(1, TimeUnit.SECONDS); } @Test public void shouldGetRelatedArtists_sync() throws Exception { final Api api = Api.DEFAULT_API; final RelatedArtistsRequest request = api .getArtistRelatedArtists("0qeei9KQnptjwb8MgkqEoy") .httpManager(TestUtil.MockedHttpManager.returningJson("related-artists.json")) .build(); final List<Artist> artists = request.get(); assertFalse(artists.isEmpty()); final Artist firstArtist = artists.get(0); final String id = firstArtist.getId(); assertEquals("https://api.spotify.com/v1/artists/" + id, firstArtist.getHref()); assertEquals(id, firstArtist.getId()); assertEquals("spotify:artist:" + id, firstArtist.getUri()); } }
{ "content_hash": "9a81732c820a9ca862d40a7538d9ec31", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 88, "avg_line_length": 31.96, "alnum_prop": 0.7150604922820192, "repo_name": "PatMulvihill/spotify-web-api-java", "id": "d5743ab4a7417d9bd69b3b04c57c27bf2fad770b", "size": "2397", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/java/com/wrapper/spotify/methods/RelatedArtistsRequestTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "262113" }, { "name": "Protocol Buffer", "bytes": "741" }, { "name": "Shell", "bytes": "132" } ], "symlink_target": "" }
package org.jenkinsci.plugins.jiraissue.restclientextensions; import com.atlassian.jira.rest.client.internal.json.JsonObjectParser; import com.atlassian.jira.rest.client.internal.json.JsonParseUtil; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; import java.net.URI; /** * Created by tuicu. */ public class StatusCategoryJsonParser implements JsonObjectParser<StatusCategory> { @Override public StatusCategory parse(JSONObject jsonObject) throws JSONException { URI self = JsonParseUtil.getSelfUri(jsonObject); Long id = JsonParseUtil.getOptionalLong(jsonObject, "id"); String key = jsonObject.getString("key"); String colorName = jsonObject.getString("colorName"); return new StatusCategory(self, id, key, colorName); } }
{ "content_hash": "ac703b656d1a62f9926590aced16264b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 83, "avg_line_length": 34.541666666666664, "alnum_prop": 0.7611580217129071, "repo_name": "andreituicu/JenkinsJiraPlugin", "id": "5118777fb55c200ec95e83ed84db2cfb78e8b393", "size": "1395", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "JiraIssue/src/main/java/org/jenkinsci/plugins/jiraissue/restclientextensions/StatusCategoryJsonParser.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "4200" }, { "name": "Java", "bytes": "100499" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "e0204161fa9796044edee45e6307417a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "2062b7c4d467f0354b936194db64edd1af78b57f", "size": "188", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Campanulaceae/Adenophora/Adenophora jasionifolia/ Syn. Adenophora forrestii minor/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php function contents($mod, $loc){ return Johnguild\Muffincms\MVC\Controllers\PageController::getContents($mod, $loc); } function mypage(){ return Johnguild\Muffincms\MVC\Controllers\PageController::getMyPage(); }
{ "content_hash": "6d58ea94fc613c35dac45c6c5f22f0ac", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 84, "avg_line_length": 20.09090909090909, "alnum_prop": 0.7647058823529411, "repo_name": "johnguild/muffincms", "id": "e3604501a9e84a846a6f66323974bcf12976295f", "size": "221", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Helpers/Contents.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "210877" }, { "name": "HTML", "bytes": "78297" }, { "name": "JavaScript", "bytes": "308211" }, { "name": "PHP", "bytes": "40753" } ], "symlink_target": "" }
namespace onnxruntime { namespace training { OrtValue SliceTensor(const OrtValue& orig_value, const size_t slice_id, const size_t slice_axis, const size_t num_slices, onnxruntime::InferenceSession& session_state); OrtValue ConcatenateTensors(const std::vector<OrtValue>& orig_values, const size_t axis, onnxruntime::InferenceSession& session_state); } // namespace training } // namespace onnxruntime
{ "content_hash": "1827737c81371c13e21e8a80ca2b2284", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 135, "avg_line_length": 60.42857142857143, "alnum_prop": 0.7565011820330969, "repo_name": "microsoft/onnxruntime", "id": "6a0647d104bd97b59cce8bb51bac51e0ed840881", "size": "603", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "orttraining/orttraining/core/session/tensor_helper.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "1763425" }, { "name": "Batchfile", "bytes": "17040" }, { "name": "C", "bytes": "955390" }, { "name": "C#", "bytes": "2304597" }, { "name": "C++", "bytes": "39435305" }, { "name": "CMake", "bytes": "514764" }, { "name": "CSS", "bytes": "138431" }, { "name": "Cuda", "bytes": "1104338" }, { "name": "Dockerfile", "bytes": "8089" }, { "name": "HLSL", "bytes": "11234" }, { "name": "HTML", "bytes": "5933" }, { "name": "Java", "bytes": "418665" }, { "name": "JavaScript", "bytes": "212575" }, { "name": "Jupyter Notebook", "bytes": "218327" }, { "name": "Kotlin", "bytes": "4653" }, { "name": "Liquid", "bytes": "5457" }, { "name": "NASL", "bytes": "2628" }, { "name": "Objective-C", "bytes": "151027" }, { "name": "Objective-C++", "bytes": "107084" }, { "name": "Pascal", "bytes": "9597" }, { "name": "PowerShell", "bytes": "16419" }, { "name": "Python", "bytes": "5041661" }, { "name": "Roff", "bytes": "27539" }, { "name": "Ruby", "bytes": "3545" }, { "name": "Shell", "bytes": "116513" }, { "name": "Swift", "bytes": "115" }, { "name": "TypeScript", "bytes": "973087" } ], "symlink_target": "" }
/* jshint latedef:false */ /* jshint forin:false */ /* jshint noempty:false */ 'use strict'; exports.Operations = require('./operations'); exports.Namespaces = require('./namespaces'); exports.DisasterRecoveryConfigs = require('./disasterRecoveryConfigs'); exports.MigrationConfigs = require('./migrationConfigs'); exports.Queues = require('./queues'); exports.Topics = require('./topics'); exports.Subscriptions = require('./subscriptions'); exports.Rules = require('./rules'); exports.Regions = require('./regions'); exports.PremiumMessagingRegionsOperations = require('./premiumMessagingRegionsOperations'); exports.EventHubs = require('./eventHubs');
{ "content_hash": "9a2086d6b877a340c60c890481c42bc1", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 91, "avg_line_length": 34.68421052631579, "alnum_prop": 0.7450682852807283, "repo_name": "xingwu1/azure-sdk-for-node", "id": "dfb03b75a38012a0942acf3d46431d9f4cca5b72", "size": "976", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/services/serviceBusManagement2/lib/operations/index.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "661" }, { "name": "JavaScript", "bytes": "122792600" }, { "name": "Shell", "bytes": "437" }, { "name": "TypeScript", "bytes": "2558" } ], "symlink_target": "" }
include $(srctree)/drivers/misc/mediatek/Makefile.custom obj-y := ami304.o
{ "content_hash": "cf982ed25660216a9bb665d9ae429cca", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 56, "avg_line_length": 25.333333333333332, "alnum_prop": 0.7631578947368421, "repo_name": "zhengdejin/X1_Code", "id": "8756ff9ff80322196ff210cd69732c7159fd3747", "size": "76", "binary": false, "copies": "146", "ref": "refs/heads/master", "path": "kernel-3.10/drivers/misc/mediatek/magnetometer/ami304_auto/Makefile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "4528" }, { "name": "Assembly", "bytes": "10107915" }, { "name": "Awk", "bytes": "18681" }, { "name": "Batchfile", "bytes": "144" }, { "name": "C", "bytes": "519266172" }, { "name": "C++", "bytes": "11700846" }, { "name": "GDB", "bytes": "18113" }, { "name": "Lex", "bytes": "47705" }, { "name": "M4", "bytes": "3388" }, { "name": "Makefile", "bytes": "1619668" }, { "name": "Objective-C", "bytes": "2963724" }, { "name": "Perl", "bytes": "570279" }, { "name": "Perl 6", "bytes": "3727" }, { "name": "Python", "bytes": "92743" }, { "name": "Roff", "bytes": "55837" }, { "name": "Scilab", "bytes": "21433" }, { "name": "Shell", "bytes": "185922" }, { "name": "SourcePawn", "bytes": "2711" }, { "name": "UnrealScript", "bytes": "6113" }, { "name": "XS", "bytes": "1240" }, { "name": "Yacc", "bytes": "92226" } ], "symlink_target": "" }
package ru.job4j.simpleset; import java.util.Iterator; import java.util.NoSuchElementException; /** * Class simple set on linked list. * * @since 25/08/2017 * @version 1 */ public class SimpleSetOnLinkedList<E> implements Iterable<E>, SimpleSets<E> { /** * First element. */ private Node<E> first; /** * Last element. */ private Node<E> last; /** * List's size; */ private int size = 0; /** * Add new element to the end of list. * @param e - new element * @return false if operation is unsuccessful */ public boolean add(E e) { boolean result = false; if(!contains(e)) { if(size == 0) { Node<E> newNode = new Node<>(e); first = last = newNode; size++; result = true; } else { Node<E> newNode = new Node<>(e); last.next = newNode; last = newNode; size++; result = true; } } return result; } /** * Tests is there element in this set. * @param e element * @return true if set contains this element */ public boolean contains(E e) { boolean result = false; for (E elem : this) { if (elem.equals(e)) { result = true; } } return result; } /** * Iterator * @return iterator */ @Override public Iterator<E> iterator() { return new Iterator<E>() { int pointer = 0; Node<E> x = null; @Override public boolean hasNext() { return first != null && pointer != size; } @Override public E next() { if(first == null || pointer == size) { throw new NoSuchElementException(); } if (pointer == 0) { x = first; pointer++; } else { x = x.next; pointer++; } return x.data; } }; } /** * Class is node in linked list. * @param <E> is type of data */ private class Node<E> { /** * Next element. */ public Node<E> next = null; /** * Data. */ public E data; /** * Constructor. * @param data data */ public Node(E data) { this.data = data; } } }
{ "content_hash": "264c0abf05492e86496f528a539ad80c", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 77, "avg_line_length": 20.89763779527559, "alnum_prop": 0.420120572720422, "repo_name": "danailKondov/dkondov", "id": "329f1ed002384cefce4c32cce02884bfd6fd6823", "size": "2654", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chapter_005/src/main/java/ru/job4j/simpleset/SimpleSetOnLinkedList.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "700" }, { "name": "HTML", "bytes": "2030" }, { "name": "Java", "bytes": "442180" }, { "name": "JavaScript", "bytes": "2855" }, { "name": "XSLT", "bytes": "410" } ], "symlink_target": "" }
@interface LightGrayView : UIView @end
{ "content_hash": "57602a9e929cec9ae42df8a15e3e44d6", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 33, "avg_line_length": 13.333333333333334, "alnum_prop": 0.775, "repo_name": "petester42/skejool", "id": "2998f3033e4e75de25b846d907a7220182be9836", "size": "252", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Skejool_iOS/Skejool/Views/LightGrayView.h", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "108154" }, { "name": "HTML", "bytes": "3383" }, { "name": "Java", "bytes": "130728" }, { "name": "Objective-C", "bytes": "802167" }, { "name": "Objective-C++", "bytes": "2398" } ], "symlink_target": "" }
This repository provides code to reproduce results from the paper: [Compressed Sensing using Generative Models](https://arxiv.org/abs/1703.03208). Here are a few example results: Reconstruction | Super-resolution | Inpainting ---------------|-----------------|------------ <img src="https://github.com/AshishBora/csgm/blob/master/example_results/celebA_reconstr_500_orig_lasso-dct_lasso-wavelet_dcgan.png" alt="celebA_reconstr" width="300"> | <img src="https://github.com/AshishBora/csgm/blob/master/example_results/celebA_superres_orig_blurred_dcgan.png" alt="celebA_superres" width="300"> | <img src="https://github.com/AshishBora/csgm/blob/master/example_results/celebA_inpaint_orig_blocked_dcgan.png" alt="celebA_inpaint" width="300"> <img src="https://github.com/AshishBora/csgm/blob/master/example_results/mnist_reconstr_100_orig_lasso_vae.png" alt="mnist_reconstr" width="300"> | <img src="https://github.com/AshishBora/csgm/blob/master/example_results/mnist_superres_orig_blurred_vae.png" alt="mnist_superres" width="300"> | <img src="https://github.com/AshishBora/csgm/blob/master/example_results/mnist_inpaint_orig_blocked_vae.png" alt="mnist_inpaint" width="300"> Here we show the evolution of the reconstructed image for different number of iterations: ![](https://github.com/AshishBora/csgm/blob/master/example_results/celebA.gif) ## Steps to reproduce the results NOTE: Please run **all** commands from the root directory of the repository, i.e from ```csgm/``` ### Requirements: --- 1. Python 2.7 2. [Tensorflow 1.0.1](https://www.tensorflow.org/install/) 3. [Scipy](https://www.scipy.org/install.html) 4. [PyPNG](http://stackoverflow.com/a/31143108/3537687) 5. (Optional : for lasso-wavelet) [PyWavelets](http://pywavelets.readthedocs.io/en/latest/#install) 6. (Optional) [CVXOPT](http://cvxopt.org/install/index.html) Pip installation can be done by ```$ pip install -r requirements.txt``` ### Preliminaries --- 1. Clone the repository and dependencies ```shell $ git clone https://github.com/AshishBora/csgm.git $ cd csgm $ git submodule update --init --recursive ``` 2. Download/extract the datasets: ```shell $ ./setup/download_data.sh ``` 3. Download/extract pretrained models or train your own! - To download pretrained models: ```$ ./setup/download_models.sh``` - To train your own - VAE on MNIST: ```$ ./setup/train_mnist_vae.sh``` - DCGAN on celebA, see https://github.com/carpedm20/DCGAN-tensorflow 4. To use wavelet based estimators, you need to create the basis matrix: ```shell $ python ./src/wavelet_basis.py ``` ### Demos --- The following are the supported experiments and example commands to run the demos: [Note: For celebA experiments, we run very few iterations per experiment (30) to give a quick demo. To get results with better quality, increase the number of iterations to at least 500 and use at least 2 random restarts.] 1. Reconstruction from Gaussian measurements - ```$ ./quick_scripts/mnist_reconstr.sh``` - ```$ ./quick_scripts/celebA_reconstr.sh "./images/182659.jpg"``` 2. Super-resolution - ```$ ./quick_scripts/mnist_superres.sh``` - ```$ ./quick_scripts/celebA_superres.sh "./images/182659.jpg"``` 3. Reconstruction for images in the span of the generator - ```$ ./quick_scripts/mnist_genspan.sh``` - ```$ ./quick_scripts/celebA_genspan.sh``` 4. Quantifying representation error - ```$ ./quick_scripts/mnist_projection.sh``` - ```$ ./quick_scripts/celebA_projection.sh "./images/182659.jpg"``` 5. Inpainting - ```$ ./quick_scripts/mnist_inpaint.sh``` - ```$ ./quick_scripts/celebA_inpaint.sh "./images/182659.jpg"``` ### Reproducing quantitative results --- 1. Create a scripts directory ```$ mkdir scripts``` 2. Identfy a dataset you would like to get the quantitative results on. Locate the file ```./quant_scripts/{dataset}_reconstr.sh```. 3. Change ```BASE_SCRIPT``` in ```src/create_scripts.py``` to be the same as given at the top of ```./quant_scripts/{dataset}_reconstr.sh```. 4. Optionally, comment out the parts of ```./quant_scripts/{dataset}_reconstr.sh``` that you don't want to run. 5. Run ```./quant_scripts/{dataset}_reconstr.sh```. This will create a bunch of ```.sh``` files in the ```./scripts/``` directory, each one of them for a different parameter setting. 6. Start running these scripts. - You can run ```$ ./utils/run_sequentially.sh``` to run them one by one. - Alternatively use ```$ ./utils/run_all_by_number.sh``` to create screens and start proccessing them in parallel. [REQUIRES: gnu screen][WARNING: This may overwhelm the computer]. You can use ```$ ./utils/stop_all_by_number.sh``` to stop the running processes, and clear up the screens started this way. 8. Create a results directory : ```$ mkdir results```. To get the plots, see ```src/metrics.ipynb```. To get matrix of images (as in the paper), run ```$ python src/view_estimated_{dataset}.py```. 9. You can also manually access the results saved by the scripts. These can be found in appropriately named directories in ```estimated/```. Directory name conventions are defined in ```get_checkpoint_dir()``` in ```src/utils.py``` ### Miscellaneous --- For a complete list of images not used while training on celebA, see [here](https://www.cs.utexas.edu/~ashishb/csgm/celebA_unused.txt).
{ "content_hash": "d2cb900722625ec3b1a6937021b8f4f0", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 465, "avg_line_length": 49.08181818181818, "alnum_prop": 0.7017966290053713, "repo_name": "AshishBora/csgm", "id": "e5148578381ad47f23ad21d12339eea7b721abc2", "size": "5445", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Jupyter Notebook", "bytes": "41979" }, { "name": "Python", "bytes": "99210" }, { "name": "Shell", "bytes": "18723" } ], "symlink_target": "" }
class TasksController < ApplicationController before_filter :set_project before_filter :set_task, only: [:show, :edit, :update, :destroy] # POST /tasks def create @task = @project.tasks.new(task_params) if @task.save redirect_to @project, notice: 'Task was successfully created.' else render :new end end def update if @task.update(task_params) redirect_to @project, notice: 'Task was successfully updated.' else render :edit end end # DELETE /tasks/1 def destroy @task.destroy redirect_to tasks_url, notice: 'Task was successfully destroyed.' end private def set_project @project = Project.find(params[:project_id]) end def set_task @task = @project.tasks.find(params[:id]) end def task_params params.require(:task).permit(:name, :completed_at) end end
{ "content_hash": "eb1fd9c22db61613404ace67a8266f88", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 69, "avg_line_length": 20.209302325581394, "alnum_prop": 0.6605293440736478, "repo_name": "afcapel/auto_presenter", "id": "b386971f0274d78a324037f31507713e9d16f9fb", "size": "869", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/dummy/app/controllers/tasks_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "683" }, { "name": "JavaScript", "bytes": "599" }, { "name": "Ruby", "bytes": "19603" } ], "symlink_target": "" }
package com.amazonaws.services.iotthingsgraph; import javax.annotation.Generated; import com.amazonaws.services.iotthingsgraph.model.*; import com.amazonaws.client.AwsAsyncClientParams; import com.amazonaws.annotation.ThreadSafe; import java.util.concurrent.ExecutorService; /** * Client for accessing AWS IoT Things Graph asynchronously. Each asynchronous method will return a Java Future object * representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive * notification when an asynchronous operation completes. * <p> * <fullname>AWS IoT Things Graph</fullname> * <p> * AWS IoT Things Graph provides an integrated set of tools that enable developers to connect devices and services that * use different standards, such as units of measure and communication protocols. AWS IoT Things Graph makes it possible * to build IoT applications with little to no code by connecting devices and services and defining how they interact at * an abstract level. * </p> * <p> * For more information about how AWS IoT Things Graph works, see the <a * href="https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-whatis.html">User Guide</a>. * </p> * <p> * The AWS IoT Things Graph service is discontinued. * </p> */ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSIoTThingsGraphAsyncClient extends AWSIoTThingsGraphClient implements AWSIoTThingsGraphAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AWSIoTThingsGraphAsyncClientBuilder asyncBuilder() { return AWSIoTThingsGraphAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on AWS IoT Things Graph using the specified * parameters. * * @param asyncClientParams * Object providing client parameters. */ AWSIoTThingsGraphAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on AWS IoT Things Graph using the specified * parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AWSIoTThingsGraphAsyncClient(AwsAsyncClientParams asyncClientParams, boolean endpointDiscoveryEnabled) { super(asyncClientParams, endpointDiscoveryEnabled); this.executorService = asyncClientParams.getExecutor(); } /** * Returns the executor service used by this client to execute async requests. * * @return The executor service used by this client to execute async requests. */ public ExecutorService getExecutorService() { return executorService; } @Override @Deprecated public java.util.concurrent.Future<AssociateEntityToThingResult> associateEntityToThingAsync(AssociateEntityToThingRequest request) { return associateEntityToThingAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<AssociateEntityToThingResult> associateEntityToThingAsync(final AssociateEntityToThingRequest request, final com.amazonaws.handlers.AsyncHandler<AssociateEntityToThingRequest, AssociateEntityToThingResult> asyncHandler) { final AssociateEntityToThingRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<AssociateEntityToThingResult>() { @Override public AssociateEntityToThingResult call() throws Exception { AssociateEntityToThingResult result = null; try { result = executeAssociateEntityToThing(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<CreateFlowTemplateResult> createFlowTemplateAsync(CreateFlowTemplateRequest request) { return createFlowTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<CreateFlowTemplateResult> createFlowTemplateAsync(final CreateFlowTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<CreateFlowTemplateRequest, CreateFlowTemplateResult> asyncHandler) { final CreateFlowTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<CreateFlowTemplateResult>() { @Override public CreateFlowTemplateResult call() throws Exception { CreateFlowTemplateResult result = null; try { result = executeCreateFlowTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<CreateSystemInstanceResult> createSystemInstanceAsync(CreateSystemInstanceRequest request) { return createSystemInstanceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<CreateSystemInstanceResult> createSystemInstanceAsync(final CreateSystemInstanceRequest request, final com.amazonaws.handlers.AsyncHandler<CreateSystemInstanceRequest, CreateSystemInstanceResult> asyncHandler) { final CreateSystemInstanceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<CreateSystemInstanceResult>() { @Override public CreateSystemInstanceResult call() throws Exception { CreateSystemInstanceResult result = null; try { result = executeCreateSystemInstance(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<CreateSystemTemplateResult> createSystemTemplateAsync(CreateSystemTemplateRequest request) { return createSystemTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<CreateSystemTemplateResult> createSystemTemplateAsync(final CreateSystemTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<CreateSystemTemplateRequest, CreateSystemTemplateResult> asyncHandler) { final CreateSystemTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<CreateSystemTemplateResult>() { @Override public CreateSystemTemplateResult call() throws Exception { CreateSystemTemplateResult result = null; try { result = executeCreateSystemTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<DeleteFlowTemplateResult> deleteFlowTemplateAsync(DeleteFlowTemplateRequest request) { return deleteFlowTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<DeleteFlowTemplateResult> deleteFlowTemplateAsync(final DeleteFlowTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<DeleteFlowTemplateRequest, DeleteFlowTemplateResult> asyncHandler) { final DeleteFlowTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DeleteFlowTemplateResult>() { @Override public DeleteFlowTemplateResult call() throws Exception { DeleteFlowTemplateResult result = null; try { result = executeDeleteFlowTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<DeleteNamespaceResult> deleteNamespaceAsync(DeleteNamespaceRequest request) { return deleteNamespaceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<DeleteNamespaceResult> deleteNamespaceAsync(final DeleteNamespaceRequest request, final com.amazonaws.handlers.AsyncHandler<DeleteNamespaceRequest, DeleteNamespaceResult> asyncHandler) { final DeleteNamespaceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DeleteNamespaceResult>() { @Override public DeleteNamespaceResult call() throws Exception { DeleteNamespaceResult result = null; try { result = executeDeleteNamespace(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<DeleteSystemInstanceResult> deleteSystemInstanceAsync(DeleteSystemInstanceRequest request) { return deleteSystemInstanceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<DeleteSystemInstanceResult> deleteSystemInstanceAsync(final DeleteSystemInstanceRequest request, final com.amazonaws.handlers.AsyncHandler<DeleteSystemInstanceRequest, DeleteSystemInstanceResult> asyncHandler) { final DeleteSystemInstanceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DeleteSystemInstanceResult>() { @Override public DeleteSystemInstanceResult call() throws Exception { DeleteSystemInstanceResult result = null; try { result = executeDeleteSystemInstance(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<DeleteSystemTemplateResult> deleteSystemTemplateAsync(DeleteSystemTemplateRequest request) { return deleteSystemTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<DeleteSystemTemplateResult> deleteSystemTemplateAsync(final DeleteSystemTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<DeleteSystemTemplateRequest, DeleteSystemTemplateResult> asyncHandler) { final DeleteSystemTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DeleteSystemTemplateResult>() { @Override public DeleteSystemTemplateResult call() throws Exception { DeleteSystemTemplateResult result = null; try { result = executeDeleteSystemTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<DeploySystemInstanceResult> deploySystemInstanceAsync(DeploySystemInstanceRequest request) { return deploySystemInstanceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<DeploySystemInstanceResult> deploySystemInstanceAsync(final DeploySystemInstanceRequest request, final com.amazonaws.handlers.AsyncHandler<DeploySystemInstanceRequest, DeploySystemInstanceResult> asyncHandler) { final DeploySystemInstanceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DeploySystemInstanceResult>() { @Override public DeploySystemInstanceResult call() throws Exception { DeploySystemInstanceResult result = null; try { result = executeDeploySystemInstance(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<DeprecateFlowTemplateResult> deprecateFlowTemplateAsync(DeprecateFlowTemplateRequest request) { return deprecateFlowTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<DeprecateFlowTemplateResult> deprecateFlowTemplateAsync(final DeprecateFlowTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<DeprecateFlowTemplateRequest, DeprecateFlowTemplateResult> asyncHandler) { final DeprecateFlowTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DeprecateFlowTemplateResult>() { @Override public DeprecateFlowTemplateResult call() throws Exception { DeprecateFlowTemplateResult result = null; try { result = executeDeprecateFlowTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<DeprecateSystemTemplateResult> deprecateSystemTemplateAsync(DeprecateSystemTemplateRequest request) { return deprecateSystemTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<DeprecateSystemTemplateResult> deprecateSystemTemplateAsync(final DeprecateSystemTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<DeprecateSystemTemplateRequest, DeprecateSystemTemplateResult> asyncHandler) { final DeprecateSystemTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DeprecateSystemTemplateResult>() { @Override public DeprecateSystemTemplateResult call() throws Exception { DeprecateSystemTemplateResult result = null; try { result = executeDeprecateSystemTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<DescribeNamespaceResult> describeNamespaceAsync(DescribeNamespaceRequest request) { return describeNamespaceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<DescribeNamespaceResult> describeNamespaceAsync(final DescribeNamespaceRequest request, final com.amazonaws.handlers.AsyncHandler<DescribeNamespaceRequest, DescribeNamespaceResult> asyncHandler) { final DescribeNamespaceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DescribeNamespaceResult>() { @Override public DescribeNamespaceResult call() throws Exception { DescribeNamespaceResult result = null; try { result = executeDescribeNamespace(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<DissociateEntityFromThingResult> dissociateEntityFromThingAsync(DissociateEntityFromThingRequest request) { return dissociateEntityFromThingAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<DissociateEntityFromThingResult> dissociateEntityFromThingAsync(final DissociateEntityFromThingRequest request, final com.amazonaws.handlers.AsyncHandler<DissociateEntityFromThingRequest, DissociateEntityFromThingResult> asyncHandler) { final DissociateEntityFromThingRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<DissociateEntityFromThingResult>() { @Override public DissociateEntityFromThingResult call() throws Exception { DissociateEntityFromThingResult result = null; try { result = executeDissociateEntityFromThing(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<GetEntitiesResult> getEntitiesAsync(GetEntitiesRequest request) { return getEntitiesAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<GetEntitiesResult> getEntitiesAsync(final GetEntitiesRequest request, final com.amazonaws.handlers.AsyncHandler<GetEntitiesRequest, GetEntitiesResult> asyncHandler) { final GetEntitiesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetEntitiesResult>() { @Override public GetEntitiesResult call() throws Exception { GetEntitiesResult result = null; try { result = executeGetEntities(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<GetFlowTemplateResult> getFlowTemplateAsync(GetFlowTemplateRequest request) { return getFlowTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<GetFlowTemplateResult> getFlowTemplateAsync(final GetFlowTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<GetFlowTemplateRequest, GetFlowTemplateResult> asyncHandler) { final GetFlowTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetFlowTemplateResult>() { @Override public GetFlowTemplateResult call() throws Exception { GetFlowTemplateResult result = null; try { result = executeGetFlowTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<GetFlowTemplateRevisionsResult> getFlowTemplateRevisionsAsync(GetFlowTemplateRevisionsRequest request) { return getFlowTemplateRevisionsAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<GetFlowTemplateRevisionsResult> getFlowTemplateRevisionsAsync(final GetFlowTemplateRevisionsRequest request, final com.amazonaws.handlers.AsyncHandler<GetFlowTemplateRevisionsRequest, GetFlowTemplateRevisionsResult> asyncHandler) { final GetFlowTemplateRevisionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetFlowTemplateRevisionsResult>() { @Override public GetFlowTemplateRevisionsResult call() throws Exception { GetFlowTemplateRevisionsResult result = null; try { result = executeGetFlowTemplateRevisions(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<GetNamespaceDeletionStatusResult> getNamespaceDeletionStatusAsync(GetNamespaceDeletionStatusRequest request) { return getNamespaceDeletionStatusAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<GetNamespaceDeletionStatusResult> getNamespaceDeletionStatusAsync(final GetNamespaceDeletionStatusRequest request, final com.amazonaws.handlers.AsyncHandler<GetNamespaceDeletionStatusRequest, GetNamespaceDeletionStatusResult> asyncHandler) { final GetNamespaceDeletionStatusRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetNamespaceDeletionStatusResult>() { @Override public GetNamespaceDeletionStatusResult call() throws Exception { GetNamespaceDeletionStatusResult result = null; try { result = executeGetNamespaceDeletionStatus(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<GetSystemInstanceResult> getSystemInstanceAsync(GetSystemInstanceRequest request) { return getSystemInstanceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<GetSystemInstanceResult> getSystemInstanceAsync(final GetSystemInstanceRequest request, final com.amazonaws.handlers.AsyncHandler<GetSystemInstanceRequest, GetSystemInstanceResult> asyncHandler) { final GetSystemInstanceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetSystemInstanceResult>() { @Override public GetSystemInstanceResult call() throws Exception { GetSystemInstanceResult result = null; try { result = executeGetSystemInstance(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<GetSystemTemplateResult> getSystemTemplateAsync(GetSystemTemplateRequest request) { return getSystemTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<GetSystemTemplateResult> getSystemTemplateAsync(final GetSystemTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<GetSystemTemplateRequest, GetSystemTemplateResult> asyncHandler) { final GetSystemTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetSystemTemplateResult>() { @Override public GetSystemTemplateResult call() throws Exception { GetSystemTemplateResult result = null; try { result = executeGetSystemTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<GetSystemTemplateRevisionsResult> getSystemTemplateRevisionsAsync(GetSystemTemplateRevisionsRequest request) { return getSystemTemplateRevisionsAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<GetSystemTemplateRevisionsResult> getSystemTemplateRevisionsAsync(final GetSystemTemplateRevisionsRequest request, final com.amazonaws.handlers.AsyncHandler<GetSystemTemplateRevisionsRequest, GetSystemTemplateRevisionsResult> asyncHandler) { final GetSystemTemplateRevisionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetSystemTemplateRevisionsResult>() { @Override public GetSystemTemplateRevisionsResult call() throws Exception { GetSystemTemplateRevisionsResult result = null; try { result = executeGetSystemTemplateRevisions(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<GetUploadStatusResult> getUploadStatusAsync(GetUploadStatusRequest request) { return getUploadStatusAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<GetUploadStatusResult> getUploadStatusAsync(final GetUploadStatusRequest request, final com.amazonaws.handlers.AsyncHandler<GetUploadStatusRequest, GetUploadStatusResult> asyncHandler) { final GetUploadStatusRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<GetUploadStatusResult>() { @Override public GetUploadStatusResult call() throws Exception { GetUploadStatusResult result = null; try { result = executeGetUploadStatus(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<ListFlowExecutionMessagesResult> listFlowExecutionMessagesAsync(ListFlowExecutionMessagesRequest request) { return listFlowExecutionMessagesAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<ListFlowExecutionMessagesResult> listFlowExecutionMessagesAsync(final ListFlowExecutionMessagesRequest request, final com.amazonaws.handlers.AsyncHandler<ListFlowExecutionMessagesRequest, ListFlowExecutionMessagesResult> asyncHandler) { final ListFlowExecutionMessagesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<ListFlowExecutionMessagesResult>() { @Override public ListFlowExecutionMessagesResult call() throws Exception { ListFlowExecutionMessagesResult result = null; try { result = executeListFlowExecutionMessages(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<ListTagsForResourceResult> listTagsForResourceAsync(ListTagsForResourceRequest request) { return listTagsForResourceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<ListTagsForResourceResult> listTagsForResourceAsync(final ListTagsForResourceRequest request, final com.amazonaws.handlers.AsyncHandler<ListTagsForResourceRequest, ListTagsForResourceResult> asyncHandler) { final ListTagsForResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<ListTagsForResourceResult>() { @Override public ListTagsForResourceResult call() throws Exception { ListTagsForResourceResult result = null; try { result = executeListTagsForResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<SearchEntitiesResult> searchEntitiesAsync(SearchEntitiesRequest request) { return searchEntitiesAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<SearchEntitiesResult> searchEntitiesAsync(final SearchEntitiesRequest request, final com.amazonaws.handlers.AsyncHandler<SearchEntitiesRequest, SearchEntitiesResult> asyncHandler) { final SearchEntitiesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<SearchEntitiesResult>() { @Override public SearchEntitiesResult call() throws Exception { SearchEntitiesResult result = null; try { result = executeSearchEntities(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<SearchFlowExecutionsResult> searchFlowExecutionsAsync(SearchFlowExecutionsRequest request) { return searchFlowExecutionsAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<SearchFlowExecutionsResult> searchFlowExecutionsAsync(final SearchFlowExecutionsRequest request, final com.amazonaws.handlers.AsyncHandler<SearchFlowExecutionsRequest, SearchFlowExecutionsResult> asyncHandler) { final SearchFlowExecutionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<SearchFlowExecutionsResult>() { @Override public SearchFlowExecutionsResult call() throws Exception { SearchFlowExecutionsResult result = null; try { result = executeSearchFlowExecutions(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<SearchFlowTemplatesResult> searchFlowTemplatesAsync(SearchFlowTemplatesRequest request) { return searchFlowTemplatesAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<SearchFlowTemplatesResult> searchFlowTemplatesAsync(final SearchFlowTemplatesRequest request, final com.amazonaws.handlers.AsyncHandler<SearchFlowTemplatesRequest, SearchFlowTemplatesResult> asyncHandler) { final SearchFlowTemplatesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<SearchFlowTemplatesResult>() { @Override public SearchFlowTemplatesResult call() throws Exception { SearchFlowTemplatesResult result = null; try { result = executeSearchFlowTemplates(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<SearchSystemInstancesResult> searchSystemInstancesAsync(SearchSystemInstancesRequest request) { return searchSystemInstancesAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<SearchSystemInstancesResult> searchSystemInstancesAsync(final SearchSystemInstancesRequest request, final com.amazonaws.handlers.AsyncHandler<SearchSystemInstancesRequest, SearchSystemInstancesResult> asyncHandler) { final SearchSystemInstancesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<SearchSystemInstancesResult>() { @Override public SearchSystemInstancesResult call() throws Exception { SearchSystemInstancesResult result = null; try { result = executeSearchSystemInstances(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<SearchSystemTemplatesResult> searchSystemTemplatesAsync(SearchSystemTemplatesRequest request) { return searchSystemTemplatesAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<SearchSystemTemplatesResult> searchSystemTemplatesAsync(final SearchSystemTemplatesRequest request, final com.amazonaws.handlers.AsyncHandler<SearchSystemTemplatesRequest, SearchSystemTemplatesResult> asyncHandler) { final SearchSystemTemplatesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<SearchSystemTemplatesResult>() { @Override public SearchSystemTemplatesResult call() throws Exception { SearchSystemTemplatesResult result = null; try { result = executeSearchSystemTemplates(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<SearchThingsResult> searchThingsAsync(SearchThingsRequest request) { return searchThingsAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<SearchThingsResult> searchThingsAsync(final SearchThingsRequest request, final com.amazonaws.handlers.AsyncHandler<SearchThingsRequest, SearchThingsResult> asyncHandler) { final SearchThingsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<SearchThingsResult>() { @Override public SearchThingsResult call() throws Exception { SearchThingsResult result = null; try { result = executeSearchThings(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<TagResourceResult> tagResourceAsync(TagResourceRequest request) { return tagResourceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<TagResourceResult> tagResourceAsync(final TagResourceRequest request, final com.amazonaws.handlers.AsyncHandler<TagResourceRequest, TagResourceResult> asyncHandler) { final TagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<TagResourceResult>() { @Override public TagResourceResult call() throws Exception { TagResourceResult result = null; try { result = executeTagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<UndeploySystemInstanceResult> undeploySystemInstanceAsync(UndeploySystemInstanceRequest request) { return undeploySystemInstanceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<UndeploySystemInstanceResult> undeploySystemInstanceAsync(final UndeploySystemInstanceRequest request, final com.amazonaws.handlers.AsyncHandler<UndeploySystemInstanceRequest, UndeploySystemInstanceResult> asyncHandler) { final UndeploySystemInstanceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<UndeploySystemInstanceResult>() { @Override public UndeploySystemInstanceResult call() throws Exception { UndeploySystemInstanceResult result = null; try { result = executeUndeploySystemInstance(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(UntagResourceRequest request) { return untagResourceAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<UntagResourceResult> untagResourceAsync(final UntagResourceRequest request, final com.amazonaws.handlers.AsyncHandler<UntagResourceRequest, UntagResourceResult> asyncHandler) { final UntagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<UntagResourceResult>() { @Override public UntagResourceResult call() throws Exception { UntagResourceResult result = null; try { result = executeUntagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<UpdateFlowTemplateResult> updateFlowTemplateAsync(UpdateFlowTemplateRequest request) { return updateFlowTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<UpdateFlowTemplateResult> updateFlowTemplateAsync(final UpdateFlowTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<UpdateFlowTemplateRequest, UpdateFlowTemplateResult> asyncHandler) { final UpdateFlowTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<UpdateFlowTemplateResult>() { @Override public UpdateFlowTemplateResult call() throws Exception { UpdateFlowTemplateResult result = null; try { result = executeUpdateFlowTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<UpdateSystemTemplateResult> updateSystemTemplateAsync(UpdateSystemTemplateRequest request) { return updateSystemTemplateAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<UpdateSystemTemplateResult> updateSystemTemplateAsync(final UpdateSystemTemplateRequest request, final com.amazonaws.handlers.AsyncHandler<UpdateSystemTemplateRequest, UpdateSystemTemplateResult> asyncHandler) { final UpdateSystemTemplateRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<UpdateSystemTemplateResult>() { @Override public UpdateSystemTemplateResult call() throws Exception { UpdateSystemTemplateResult result = null; try { result = executeUpdateSystemTemplate(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future<UploadEntityDefinitionsResult> uploadEntityDefinitionsAsync(UploadEntityDefinitionsRequest request) { return uploadEntityDefinitionsAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future<UploadEntityDefinitionsResult> uploadEntityDefinitionsAsync(final UploadEntityDefinitionsRequest request, final com.amazonaws.handlers.AsyncHandler<UploadEntityDefinitionsRequest, UploadEntityDefinitionsResult> asyncHandler) { final UploadEntityDefinitionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable<UploadEntityDefinitionsResult>() { @Override public UploadEntityDefinitionsResult call() throws Exception { UploadEntityDefinitionsResult result = null; try { result = executeUploadEntityDefinitions(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } /** * Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending * asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should * call {@code getExecutorService().shutdown()} followed by {@code getExecutorService().awaitTermination()} prior to * calling this method. */ @Override public void shutdown() { super.shutdown(); executorService.shutdownNow(); } }
{ "content_hash": "400b84b2b130ca8885587b5520644cc6", "timestamp": "", "source": "github", "line_count": 1314, "max_line_length": 153, "avg_line_length": 38.611111111111114, "alnum_prop": 0.623218685325712, "repo_name": "aws/aws-sdk-java", "id": "cd85e487c118e61eda5c95ce4174024afc7fc2d4", "size": "51315", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-iotthingsgraph/src/main/java/com/amazonaws/services/iotthingsgraph/AWSIoTThingsGraphAsyncClient.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
namespace autoboost { namespace asio { namespace detail { template <typename Handler> class win_iocp_overlapped_op : public operation { public: AUTOBOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_overlapped_op); win_iocp_overlapped_op(Handler& handler) : operation(&win_iocp_overlapped_op::do_complete), handler_(AUTOBOOST_ASIO_MOVE_CAST(Handler)(handler)) { } static void do_complete(io_service_impl* owner, operation* base, const autoboost::system::error_code& ec, std::size_t bytes_transferred) { // Take ownership of the operation object. win_iocp_overlapped_op* o(static_cast<win_iocp_overlapped_op*>(base)); ptr p = { autoboost::asio::detail::addressof(o->handler_), o, o }; AUTOBOOST_ASIO_HANDLER_COMPLETION((o)); // Make a copy of the handler so that the memory can be deallocated before // the upcall is made. Even if we're not about to make an upcall, a // sub-object of the handler may be the true owner of the memory associated // with the handler. Consequently, a local copy of the handler is required // to ensure that any owning sub-object remains valid until after we have // deallocated the memory here. detail::binder2<Handler, autoboost::system::error_code, std::size_t> handler(o->handler_, ec, bytes_transferred); p.h = autoboost::asio::detail::addressof(handler.handler_); p.reset(); // Make the upcall if required. if (owner) { fenced_block b(fenced_block::half); AUTOBOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); autoboost_asio_handler_invoke_helpers::invoke(handler, handler.handler_); AUTOBOOST_ASIO_HANDLER_INVOCATION_END; } } private: Handler handler_; }; } // namespace detail } // namespace asio } // namespace autoboost #include <autoboost/asio/detail/pop_options.hpp> #endif // defined(AUTOBOOST_ASIO_HAS_IOCP) #endif // AUTOBOOST_ASIO_DETAIL_WIN_IOCP_OVERLAPPED_OP_HPP
{ "content_hash": "b26f80c162b60c84b1c40a60d59ec315", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 79, "avg_line_length": 33.16949152542373, "alnum_prop": 0.7005620848237097, "repo_name": "leapmotion/autowiring", "id": "9a0fc37e235c44a086516896e99f157f5f6256e9", "size": "2984", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "contrib/autoboost/autoboost/asio/detail/win_iocp_overlapped_op.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "171894" }, { "name": "C++", "bytes": "27531690" }, { "name": "CMake", "bytes": "100114" }, { "name": "HTML", "bytes": "1995" }, { "name": "Perl", "bytes": "1313" }, { "name": "PowerShell", "bytes": "595" }, { "name": "Python", "bytes": "44062" }, { "name": "Shell", "bytes": "4017" } ], "symlink_target": "" }
[&#9664;](system.md) system components | __back__ to contents [&#9654;](https://github.com/happner/happner#documentation) ## Using the Client ### From the browser The api client script can be accessed from the browser at `/api/client`. #### Loading the script. __something.html__ ```html <html> <head> <script src=/api/client></script> <!-- script src="http://some.other.node.com:55000/api/client"></script --> </head> ... ``` #### Initialize and Login. __something.html__ ```html ... <body> <script> window.LOG_LEVEL = 'trace'; // Connection options (displaying defaults) var options = { hostname: window.location.hostname, port: window.location.port || 80, }; // Create the client instance. var client = new MeshClient( /* options */ ); // Credentials for the login method var credentials = { // username: 'username', // pending // password: 'password', // pending } client.login(credentials); // .then(function() {... etc. client.on('login/allow', function() { }); // pending // client.on('login/deny', function() { // // }); client.on('login/error', function(err) { }); </script> </body> </html> ``` #### Other Events __something.html__ ```html ... <body> <script> // got client from above // Component notifications to enable the dynamic creation of // widgets or menu updates (or similar) into the running app. client.on('create/components', function(array) { // First call lists all components. // Subsequent calls list only new components // inserted into the running mesh node. // (see: mesh._createElement()) }); client.on('destroy/components', function(array) { // Components being removed from the mesh. }); </script> </body> </html> ``` #### Additional Functionality The client loads the following additional classes into the browser's runtime: [Promise](https://github.com/petkaantonov/bluebird/blob/master/API.md) - Bluebird promise implementation.</br> [Primus](https://github.com/primus/primus) - The websocket client used by the MeshClient.</br> __EventEmitter__ - Same as node's EventEmitter. (Part of Primus).</br> ### From a node process ```javascript var MeshClient = require('happner').MeshClient; var client = new MeshClient(... // same as for the browser ```
{ "content_hash": "2952ef12a6ff19ddd6fecff404c39b07", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 121, "avg_line_length": 19.5078125, "alnum_prop": 0.6071285542651181, "repo_name": "FieldServer/happner_brain", "id": "c309813174507e02e946a4fd3d2ddcc49572b611", "size": "2497", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/client.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "5534" }, { "name": "JavaScript", "bytes": "382438" }, { "name": "Shell", "bytes": "54" } ], "symlink_target": "" }
(function(document) { var IE_SELECT_ATTRIBUTE = 'data-datalist'; var LIST_CLASS = 'datalist-polyfill'; var ACTIVE_CLASS = 'datalist-polyfill__active'; var datalistSupported = !!(document.createElement('datalist') && window.HTMLDataListElement); var ua = navigator.userAgent; // Android does not have actual support var isAndroidBrowser = ua.match(/Android/) && !ua.match(/(Firefox|Chrome|Opera|OPR)/); if( datalistSupported && !isAndroidBrowser ) { return; } var inputs = document.querySelectorAll('input[list]'); var triggerEvent = function(elem, eventType) { var event; if (document.createEvent) { event = document.createEvent("HTMLEvents"); event.initEvent(eventType, true, true); elem.dispatchEvent(event); } else { event = document.createEventObject(); event.eventType = eventType; elem.fireEvent("on" + eventType, event); } }; for( var i = 0; i < inputs.length; i++ ) { var input = inputs[i]; var listId = input.getAttribute('list'); var datalist = document.getElementById(listId); if( !datalist ) { console.error('No datalist found for input: ' + listId); return; } // Only visible to <= IE9 var childSelect = document.querySelector('select[' + IE_SELECT_ATTRIBUTE + '="' + listId + '"]'); var parent = childSelect || datalist; var listItems = parent.getElementsByTagName('option'); convert(input, datalist, listItems); if( childSelect ) { childSelect.parentNode.removeChild( childSelect ); } } function convert(input, datalist, listItems) { var fakeList = document.createElement('ul'); var visibleItems = null; fakeList.id = listId; fakeList.className = LIST_CLASS; document.body.appendChild( fakeList ); var scrollValue = 0; // Used to prevent reflow var tempItems = document.createDocumentFragment(); for( var i = 0; i < listItems.length; i++ ) { var item = listItems[i]; var li = document.createElement('li'); li.innerText = item.value; tempItems.appendChild( li ); } fakeList.appendChild( tempItems ); var fakeItems = fakeList.childNodes; var eachItem = function(callback) { for( var i = 0; i < fakeItems.length; i++ ) { callback(fakeItems[i]); } }; var listen = function(elem, event, func) { if( elem.addEventListener ) { elem.addEventListener(event, func, false); } else { elem.attachEvent('on' + event, func); } }; datalist.parentNode.removeChild( datalist ); listen(input, 'focus', function() { // Reset scroll fakeList.scrollTop = 0; scrollValue = 0; }); listen(input, 'blur', function(evt) { // If this fires immediately, it prevents click-to-select from working setTimeout(function() { fakeList.style.display = 'none'; eachItem( function(item) { // Note: removes all, not just ACTIVE_CLASS, but should be safe item.className = ''; }); }, 100); }); var positionList = function() { fakeList.style.top = input.offsetTop + input.offsetHeight + 'px'; fakeList.style.left = input.offsetLeft + 'px'; fakeList.style.width = input.offsetWidth + 'px'; }; var itemSelected = function(item) { input.value = item.innerText; triggerEvent(input, 'change'); setTimeout(function() { fakeList.style.display = 'none'; }, 100); }; var buildList = function(e) { // Build datalist fakeList.style.display = 'block'; positionList(); visibleItems = []; eachItem( function(item) { // Note: removes all, not just ACTIVE_CLASS, but should be safe var query = input.value.toLowerCase(); var isFound = query.length && item.innerText.toLowerCase().indexOf( query ) > -1; if( isFound ) { visibleItems.push( item ); } item.style.display = isFound ? 'block' : 'none'; } ); }; listen(input, 'keyup', buildList); listen(input, 'focus', buildList); // Don't want to use :hover in CSS so doing this instead // really helps with arrow key navigation eachItem( function(item) { // Note: removes all, not just ACTIVE_CLASS, but should be safe listen(item, 'mouseover', function(evt) { eachItem( function(_item) { _item.className = item == _item ? ACTIVE_CLASS : ''; }); }); listen(item, 'mouseout', function(evt) { item.className = ''; }); // Mousedown fires before native 'change' event is triggered // So we use this instead of click so only the new value is passed to 'change' listen(item, 'mousedown', function(evt) { itemSelected(item); }); }); listen(window, 'resize', positionList); listen(input, 'keydown', function(e) { var activeItem = fakeList.querySelector("." + ACTIVE_CLASS); if( !visibleItems.length ) { return; } var lastVisible = visibleItems[ visibleItems.length-1 ]; var datalistItemsHeight = lastVisible.offsetTop + lastVisible.offsetHeight; // up/down arrows var isUp = e.keyCode == 38; var isDown = e.keyCode == 40; if ( (isUp || isDown) ) { if( isDown && !activeItem ) { visibleItems[0].className = ACTIVE_CLASS; } else if (activeItem) { var prevVisible = null; var nextVisible = null; for( var i = 0; i < visibleItems.length; i++ ) { var visItem = visibleItems[i]; if( visItem == activeItem ) { prevVisible = visibleItems[i-1]; nextVisible = visibleItems[i+1]; break; } } activeItem.className = ''; if ( isUp ) { if( prevVisible ) { prevVisible.className = ACTIVE_CLASS; if ( prevVisible.offsetTop < fakeList.scrollTop ) { fakeList.scrollTop -= prevVisible.offsetHeight; } } else { visibleItems[visibleItems.length - 1].className = ACTIVE_CLASS; } } if ( isDown ) { if( nextVisible ) { nextVisible.className = ACTIVE_CLASS; if( nextVisible.offsetTop + nextVisible.offsetHeight > fakeList.scrollTop + fakeList.offsetHeight ) { fakeList.scrollTop += nextVisible.offsetHeight; } } else { visibleItems[0].className = ACTIVE_CLASS; } } } } // return or tab key if ( activeItem && (e.keyCode == 13 || e.keyCode == 9) ){ itemSelected(activeItem); } }); } }(document));
{ "content_hash": "222f379c5fe05ea327b67ccb4fd0be14", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 129, "avg_line_length": 38.485849056603776, "alnum_prop": 0.48608898149283003, "repo_name": "Fyrd/purejs-datalist-polyfill", "id": "010fa5afa32a579cfbb889919bc071fb9b2304f8", "size": "8227", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "datalist.polyfill.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package org.nfunk.jep.function; import java.lang.Math; import java.util.*; import org.nfunk.jep.*; import org.nfunk.jep.type.*; public class ArcSineH extends PostfixMathCommand { public ArcSineH() { numberOfParameters = 1; } public void run(Stack inStack) throws ParseException { checkStack(inStack);// check the stack Object param = inStack.pop(); inStack.push(asinh(param));//push the result on the inStack return; } public Object asinh(Object param) throws ParseException { if (param instanceof Number) { Complex temp = new Complex(((Number)param).doubleValue(),0.0); return temp.asinh(); } else if (param instanceof Complex) { return ((Complex)param).asinh(); } throw new ParseException("Invalid parameter type"); } }
{ "content_hash": "3eb22a393dfc67cf684e3b25567a8cc5", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 65, "avg_line_length": 19.975609756097562, "alnum_prop": 0.6654456654456654, "repo_name": "Faiva78/NeuralNetProject", "id": "0c206d1730098a088c5835e89e8795f7321fc4d6", "size": "2001", "binary": false, "copies": "2", "ref": "refs/heads/NNet1", "path": "jep-2.23/jep-2.23/src/org/nfunk/jep/function/ArcSineH.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "3739" }, { "name": "CSS", "bytes": "1253" }, { "name": "HTML", "bytes": "130616" }, { "name": "Java", "bytes": "466073" } ], "symlink_target": "" }
/** * @flow * @jsx React.DOM */ var React = require('react'); var Base = require('./base'); var Color = React.createClass({ render(): ?ReactElement { return <Base {...this.props} type="color" />; } }); module.exports = Color;
{ "content_hash": "76dac5d0bb9291e4aa6bc44d0485bd70", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 49, "avg_line_length": 17, "alnum_prop": 0.592436974789916, "repo_name": "korbin/react-form-inputs", "id": "6b7e7365307924e577588219c631ee2fe5855c79", "size": "238", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/color.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "18421" } ], "symlink_target": "" }
namespace base { class DictionaryValue; } class GoogleServiceAuthError { public: // // These enumerations are referenced by integer value in HTML login code. // Do not change the numeric values. // enum State { // The user is authenticated. NONE = 0, // The credentials supplied to GAIA were either invalid, or the locally // cached credentials have expired. INVALID_GAIA_CREDENTIALS = 1, // The GAIA user is not authorized to use the service. USER_NOT_SIGNED_UP = 2, // Could not connect to server to verify credentials. This could be in // response to either failure to connect to GAIA or failure to connect to // the service needing GAIA tokens during authentication. CONNECTION_FAILED = 3, // The user needs to satisfy a CAPTCHA challenge to unlock their account. // If no other information is available, this can be resolved by visiting // https://accounts.google.com/DisplayUnlockCaptcha. Otherwise, captcha() // will provide details about the associated challenge. CAPTCHA_REQUIRED = 4, // The user account has been deleted. ACCOUNT_DELETED = 5, // The user account has been disabled. ACCOUNT_DISABLED = 6, // The service is not available; try again later. SERVICE_UNAVAILABLE = 7, // The password is valid but we need two factor to get a token. TWO_FACTOR = 8, // The requestor of the authentication step cancelled the request // prior to completion. REQUEST_CANCELED = 9, // The user has provided a HOSTED account, when this service requires // a GOOGLE account. HOSTED_NOT_ALLOWED = 10, // The number of known error states. NUM_STATES = 11, }; // Additional data for CAPTCHA_REQUIRED errors. struct Captcha { Captcha(); Captcha(const std::string& token, const GURL& audio, const GURL& img, const GURL& unlock, int width, int height); ~Captcha(); // For test only. bool operator==(const Captcha &b) const; std::string token; // Globally identifies the specific CAPTCHA challenge. GURL audio_url; // The CAPTCHA audio to use instead of image. GURL image_url; // The CAPTCHA image to show the user. GURL unlock_url; // Pretty unlock page containing above captcha. int image_width; // Width of captcha image. int image_height; // Height of capture image. }; // Additional data for TWO_FACTOR errors. struct SecondFactor { SecondFactor(); SecondFactor(const std::string& token, const std::string& prompt, const std::string& alternate, int length); ~SecondFactor(); // For test only. bool operator==(const SecondFactor &b) const; // Globally identifies the specific second-factor challenge. std::string token; // Localised prompt text, eg “Enter the verification code sent to your // phone number ending in XXX”. std::string prompt_text; // Localized text describing an alternate option, eg “Get a verification // code in a text message”. std::string alternate_text; // Character length for the challenge field. int field_length; }; // For test only. bool operator==(const GoogleServiceAuthError &b) const; // Construct a GoogleServiceAuthError from a State with no additional data. explicit GoogleServiceAuthError(State s); // Construct a GoogleServiceAuthError from a network error. // It will be created with CONNECTION_FAILED set. static GoogleServiceAuthError FromConnectionError(int error); // Construct a CAPTCHA_REQUIRED error with CAPTCHA challenge data from the // the ClientLogin endpoint. // TODO(rogerta): once ClientLogin is no longer used, may be able to get // rid of this function. static GoogleServiceAuthError FromClientLoginCaptchaChallenge( const std::string& captcha_token, const GURL& captcha_image_url, const GURL& captcha_unlock_url); // Construct a CAPTCHA_REQUIRED error with CAPTCHA challenge data from the // ClientOAuth endpoint. static GoogleServiceAuthError FromCaptchaChallenge( const std::string& captcha_token, const GURL& captcha_audio_url, const GURL& captcha_image_url, int image_width, int image_height); // Construct a TWO_FACTOR error with second-factor challenge data. static GoogleServiceAuthError FromSecondFactorChallenge( const std::string& captcha_token, const std::string& prompt_text, const std::string& alternate_text, int field_length); // Construct an INVALID_GAIA_CREDENTIALS error from a ClientOAuth response. // |data| is the JSON response from the server explaning the error. static GoogleServiceAuthError FromClientOAuthError(const std::string& data); // Provided for convenience for clients needing to reset an instance to NONE. // (avoids err_ = GoogleServiceAuthError(GoogleServiceAuthError::NONE), due // to explicit class and State enum relation. Note: shouldn't be inlined! static GoogleServiceAuthError None(); // The error information. State state() const; const Captcha& captcha() const; const SecondFactor& second_factor() const; int network_error() const; const std::string& token() const; const std::string& error_message() const; // Returns info about this object in a dictionary. Caller takes // ownership of returned dictionary. base::DictionaryValue* ToValue() const; // Returns a message describing the error. std::string ToString() const; private: GoogleServiceAuthError(State s, int error); explicit GoogleServiceAuthError(const std::string& error_message); GoogleServiceAuthError(State s, const std::string& captcha_token, const GURL& captcha_audio_url, const GURL& captcha_image_url, const GURL& captcha_unlock_url, int image_width, int image_height); GoogleServiceAuthError(State s, const std::string& captcha_token, const std::string& prompt_text, const std::string& alternate_text, int field_length); State state_; Captcha captcha_; SecondFactor second_factor_; int network_error_; std::string error_message_; }; #endif // GOOGLE_APIS_GAIA_GOOGLE_SERVICE_AUTH_ERROR_H_
{ "content_hash": "f46fc9caa72604e276c1eaa97aae6557", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 79, "avg_line_length": 34.983695652173914, "alnum_prop": 0.6787323287245611, "repo_name": "leighpauls/k2cro4", "id": "a4747aca3d9f67856bba58126990374901165797", "size": "7824", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "google_apis/gaia/google_service_auth_error.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "3062" }, { "name": "AppleScript", "bytes": "25392" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "68131038" }, { "name": "C", "bytes": "242794338" }, { "name": "C#", "bytes": "11024" }, { "name": "C++", "bytes": "353525184" }, { "name": "Common Lisp", "bytes": "3721" }, { "name": "D", "bytes": "1931" }, { "name": "Emacs Lisp", "bytes": "1639" }, { "name": "F#", "bytes": "4992" }, { "name": "FORTRAN", "bytes": "10404" }, { "name": "Java", "bytes": "3845159" }, { "name": "JavaScript", "bytes": "39146656" }, { "name": "Lua", "bytes": "13768" }, { "name": "Matlab", "bytes": "22373" }, { "name": "Objective-C", "bytes": "21887598" }, { "name": "PHP", "bytes": "2344144" }, { "name": "Perl", "bytes": "49033099" }, { "name": "Prolog", "bytes": "2926122" }, { "name": "Python", "bytes": "39863959" }, { "name": "R", "bytes": "262" }, { "name": "Racket", "bytes": "359" }, { "name": "Ruby", "bytes": "304063" }, { "name": "Scheme", "bytes": "14853" }, { "name": "Shell", "bytes": "9195117" }, { "name": "Tcl", "bytes": "1919771" }, { "name": "Verilog", "bytes": "3092" }, { "name": "Visual Basic", "bytes": "1430" }, { "name": "eC", "bytes": "5079" } ], "symlink_target": "" }
using base::android::JavaParamRef; using base::android::JavaRef; using base::android::ScopedJavaGlobalRef; using base::android::ScopedJavaLocalRef; using base::android::AttachCurrentThread; using base::android::ConvertJavaStringToUTF16; using base::android::ConvertJavaStringToUTF8; using base::android::ConvertUTF8ToJavaString; namespace { void OnLocalFaviconAvailable( const JavaRef<jobject>& j_favicon_image_callback, const favicon_base::FaviconRawBitmapResult& result) { JNIEnv* env = AttachCurrentThread(); // Convert favicon_image_result to java objects. ScopedJavaLocalRef<jstring> j_icon_url = ConvertUTF8ToJavaString(env, result.icon_url.spec()); ScopedJavaLocalRef<jobject> j_favicon_bitmap; if (result.is_valid()) { SkBitmap favicon_bitmap; gfx::PNGCodec::Decode(result.bitmap_data->front(), result.bitmap_data->size(), &favicon_bitmap); if (!favicon_bitmap.isNull()) j_favicon_bitmap = gfx::ConvertToJavaBitmap(&favicon_bitmap); } // Call java side OnLocalFaviconAvailable method. Java_FaviconImageCallback_onFaviconAvailable(env, j_favicon_image_callback, j_favicon_bitmap, j_icon_url); } } // namespace static jlong Init(JNIEnv* env, const JavaParamRef<jclass>& clazz) { return reinterpret_cast<intptr_t>(new FaviconHelper()); } FaviconHelper::FaviconHelper() { cancelable_task_tracker_.reset(new base::CancelableTaskTracker()); } void FaviconHelper::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { delete this; } jboolean FaviconHelper::GetLocalFaviconImageForURL( JNIEnv* env, const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& j_profile, const JavaParamRef<jstring>& j_page_url, jint j_icon_types, jint j_desired_size_in_pixel, const JavaParamRef<jobject>& j_favicon_image_callback) { Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); DCHECK(profile); if (!profile) return false; favicon::FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS); DCHECK(favicon_service); if (!favicon_service) return false; favicon_base::FaviconRawBitmapCallback callback_runner = base::Bind(&OnLocalFaviconAvailable, ScopedJavaGlobalRef<jobject>(j_favicon_image_callback)); favicon_service->GetRawFaviconForPageURL( GURL(ConvertJavaStringToUTF16(env, j_page_url)), static_cast<int>(j_icon_types), static_cast<int>(j_desired_size_in_pixel), callback_runner, cancelable_task_tracker_.get()); return true; } ScopedJavaLocalRef<jobject> FaviconHelper::GetSyncedFaviconImageForURL( JNIEnv* env, const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& jprofile, const JavaParamRef<jstring>& j_page_url) { Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); DCHECK(profile); std::string page_url = ConvertJavaStringToUTF8(env, j_page_url); browser_sync::ProfileSyncService* sync_service = ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); DCHECK(sync_service); scoped_refptr<base::RefCountedMemory> favicon_png; sync_sessions::OpenTabsUIDelegate* open_tabs = sync_service->GetOpenTabsUIDelegate(); DCHECK(open_tabs); if (!open_tabs->GetSyncedFaviconForPageURL(page_url, &favicon_png)) return ScopedJavaLocalRef<jobject>(); // Convert favicon_image_result to java objects. gfx::Image favicon_image = gfx::Image::CreateFrom1xPNGBytes(favicon_png); SkBitmap favicon_bitmap = favicon_image.AsBitmap(); ScopedJavaLocalRef<jobject> j_favicon_bitmap; if (favicon_bitmap.isNull()) return ScopedJavaLocalRef<jobject>(); return gfx::ConvertToJavaBitmap(&favicon_bitmap); } void FaviconHelper::EnsureIconIsAvailable( JNIEnv* env, const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& j_profile, const JavaParamRef<jobject>& j_web_contents, const JavaParamRef<jstring>& j_page_url, const JavaParamRef<jstring>& j_icon_url, jboolean j_is_large_icon, jboolean j_is_temporary, const JavaParamRef<jobject>& j_availability_callback) { Profile* profile = ProfileAndroid::FromProfileAndroid(j_profile); DCHECK(profile); content::WebContents* web_contents = content::WebContents::FromJavaWebContents(j_web_contents); DCHECK(web_contents); GURL page_url(ConvertJavaStringToUTF8(env, j_page_url)); GURL icon_url(ConvertJavaStringToUTF8(env, j_icon_url)); favicon_base::IconType icon_type = j_is_large_icon ? favicon_base::TOUCH_ICON : favicon_base::FAVICON; // TODO(treib): Optimize this by creating a FaviconService::HasFavicon method // so that we don't have to actually get the image. ScopedJavaGlobalRef<jobject> j_scoped_callback(env, j_availability_callback); favicon_base::FaviconImageCallback callback_runner = base::Bind(&OnFaviconImageResultAvailable, j_scoped_callback, profile, web_contents, page_url, icon_url, icon_type, j_is_temporary); favicon::FaviconService* service = FaviconServiceFactory::GetForProfile( profile, ServiceAccessType::IMPLICIT_ACCESS); favicon::GetFaviconImageForPageURL(service, page_url, icon_type, callback_runner, cancelable_task_tracker_.get()); } FaviconHelper::~FaviconHelper() {} static jint GetDominantColorForBitmap(JNIEnv* env, const JavaParamRef<jclass>& clazz, const JavaParamRef<jobject>& bitmap) { if (!bitmap) return 0; gfx::JavaBitmap bitmap_lock(bitmap); SkBitmap skbitmap = gfx::CreateSkBitmapFromJavaBitmap(bitmap_lock); return color_utils::CalculateKMeanColorOfBitmap(skbitmap); } // static // Return the index of |sizes| whose area is largest but not exceeds int type // range. If all |sizes|'s area exceed int type range, return the first one. size_t FaviconHelper::GetLargestSizeIndex(const std::vector<gfx::Size>& sizes) { DCHECK(!sizes.empty()); size_t ret = 0; // Find the first element whose area doesn't exceed max value, then use it // to compare with rest elements to find largest size index. for (size_t i = 0; i < sizes.size(); ++i) { base::CheckedNumeric<int> checked_area = sizes[i].GetCheckedArea(); if (checked_area.IsValid()) { ret = i; int largest_area = checked_area.ValueOrDie(); for (i = ret + 1; i < sizes.size(); ++i) { int area = sizes[i].GetCheckedArea().ValueOrDefault(-1); if (largest_area < area) { ret = i; largest_area = area; } } } } return ret; } void FaviconHelper::OnFaviconDownloaded( const ScopedJavaGlobalRef<jobject>& j_availability_callback, Profile* profile, const GURL& page_url, favicon_base::IconType icon_type, bool is_temporary, int download_request_id, int http_status_code, const GURL& image_url, const std::vector<SkBitmap>& bitmaps, const std::vector<gfx::Size>& original_sizes) { bool success = !bitmaps.empty(); if (success) { // Only keep the largest icon available. gfx::Image image = gfx::Image(gfx::ImageSkia( gfx::ImageSkiaRep(bitmaps[GetLargestSizeIndex(original_sizes)], 0))); favicon_base::SetFaviconColorSpace(&image); favicon::FaviconService* service = FaviconServiceFactory::GetForProfile( profile, ServiceAccessType::IMPLICIT_ACCESS); service->SetFavicons(page_url, image_url, icon_type, image); if (is_temporary) service->SetFaviconOutOfDateForPage(page_url); } JNIEnv* env = AttachCurrentThread(); Java_IconAvailabilityCallback_onIconAvailabilityChecked( env, j_availability_callback, success); } void FaviconHelper::OnFaviconImageResultAvailable( const ScopedJavaGlobalRef<jobject>& j_availability_callback, Profile* profile, content::WebContents* web_contents, const GURL& page_url, const GURL& icon_url, favicon_base::IconType icon_type, bool is_temporary, const favicon_base::FaviconImageResult& result) { // If there already is a favicon, return immediately. if (!result.image.IsEmpty()) { JNIEnv* env = AttachCurrentThread(); Java_IconAvailabilityCallback_onIconAvailabilityChecked( env, j_availability_callback, false); return; } web_contents->DownloadImage( icon_url, true, 0, false, base::Bind(OnFaviconDownloaded, j_availability_callback, profile, page_url, icon_type, is_temporary)); } bool FaviconHelper::RegisterFaviconHelper(JNIEnv* env) { return RegisterNativesImpl(env); }
{ "content_hash": "1be8c0e40af74902c763c2eefee3ee2b", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 80, "avg_line_length": 36.01229508196721, "alnum_prop": 0.699214749061113, "repo_name": "google-ar/WebARonARCore", "id": "6ac5e36478a9a393c173cb40f266e83b22226354", "size": "10174", "binary": false, "copies": "1", "ref": "refs/heads/webarcore_57.0.2987.5", "path": "chrome/browser/android/favicon_helper.cc", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
using System; using System.Drawing; using System.IO; using System.Windows.Forms; using EOLib.Config; using EOLib.IO.Services; using EOLib.Logger; using EOLib.Net; using EOLib.Net.PacketProcessing; namespace PacketDecoder { public partial class MainForm : Form { private enum DataTypes { None = -1, PacketFamily, PacketAction, Byte, Char, Short, Three, Int, BreakString, EndString, FixedString, } private DataTypes m_type; private readonly IPacketProcessActions _packetProcessActions; private readonly IPacketEncoderRepository _packetEncoderRepository; private int m_packetOffset, m_dataLength; private bool m_suppressEvent; public MainForm() { InitializeComponent(); cmbOutputFmt_SelectedIndexChanged(null, null); _packetEncoderRepository = new PacketEncoderRepository(); _packetProcessActions = new PacketProcessActions(new SequenceRepository(), _packetEncoderRepository, new PacketEncoderService(new NumberEncoderService(), new DataEncoderService()), new PacketSequenceService(), new LoggerProvider(new LoggerFactory(new ConfigurationRepository()))); } private void cmbOutputFmt_SelectedIndexChanged(object sender, EventArgs e) { m_type = (DataTypes) cmbOutputFmt.SelectedIndex; if (m_type == DataTypes.FixedString) { txtLength.Enabled = true; txtLength.Text = ""; } else { txtLength.Enabled = false; switch (m_type) { case DataTypes.BreakString: case DataTypes.EndString: case DataTypes.None: txtLength.Text = ""; break; case DataTypes.PacketFamily: txtLength.Text = "1"; break; case DataTypes.PacketAction: txtLength.Text = "1"; break; case DataTypes.Byte: txtLength.Text = "1"; break; case DataTypes.Char: txtLength.Text = "1"; break; case DataTypes.Short: txtLength.Text = "2"; break; case DataTypes.Three: txtLength.Text = "3"; break; case DataTypes.Int: txtLength.Text = "4"; break; } } _checkRequiredInputs(); } private void intTextValidate(object sender, EventArgs e) { if (m_suppressEvent) return; TextBox txt = sender as TextBox; if (txt == null) return; int param; if (!int.TryParse(txt.Text, out param)) { if (txt == txtLength) m_dataLength = 0; return; } if (txt == txtDMulti) { _packetProcessActions.SetEncodeMultiples((byte)param, _packetEncoderRepository.SendMultiplier); if (param < 6 || param > 12) { txtDMulti.BackColor = Color.FromArgb(255, 255, 128, 128); } else { txtDMulti.BackColor = Color.White; } } else if (txt == txtEMulti) { _packetProcessActions.SetEncodeMultiples(_packetEncoderRepository.ReceiveMultiplier, (byte)param); if (param < 6 || param > 12) { txtEMulti.BackColor = Color.FromArgb(255, 255, 128, 128); } else { txtEMulti.BackColor = Color.White; } } else if (txt == txtOffset) { m_packetOffset = param; if (param >= txtInputData.TextLength) param = txtInputData.TextLength - 1; } else if (txt == txtLength) m_dataLength = param; _checkRequiredInputs(); } private void _checkRequiredInputs() { txtOutput.Text = ""; if (txtDMulti.TextLength == 0 || txtEMulti.TextLength == 0 || txtOffset.TextLength == 0) return; if (txtLength.TextLength == 0 && m_type == DataTypes.FixedString) return; string inputData = txtInputData.Text; if (inputData.Length == 0) return; //input data is copied from wireshark. colon delimited. string bytes = inputData.Replace(":", ""); string len = bytes.Substring(0, 4);//first 2 bytes are the length! bytes = bytes.Substring(4); byte[] data = new byte[bytes.Length / 2]; byte[] lenDat = new byte[2]; for (int i = 0; i < len.Length; i += 2) { lenDat[i/2] = Convert.ToByte(len.Substring(i, 2), 16); } lblPacketLength.Text = "Packet Length: " + new NumberEncoderService().DecodeNumber(lenDat).ToString(); for (int i = 0; i < bytes.Length; i += 2) { data[i/2] = Convert.ToByte(bytes.Substring(i, 2), 16); } var pkt = _packetProcessActions.DecodeData(data); pkt.Seek(m_packetOffset, SeekOrigin.Begin); lblFamily.Text = pkt.Family.ToString(); lblAction.Text = pkt.Action.ToString(); string decoded = ""; for (int i = 0; i < pkt.Length; i++) { decoded += $"{pkt.RawData[i].ToString("D3")} "; } txtDecoded.Text = decoded; switch ((DataTypes) cmbOutputFmt.SelectedIndex) { case DataTypes.None: txtOutput.Text = pkt.ReadEndString(); break; case DataTypes.PacketFamily: txtOutput.Text = ((PacketFamily) pkt.PeekByte()).ToString(); break; case DataTypes.PacketAction: txtOutput.Text = ((PacketAction)pkt.PeekByte()).ToString(); break; case DataTypes.Byte: txtOutput.Text = pkt.PeekByte().ToString(); break; case DataTypes.Char: txtOutput.Text = pkt.PeekChar().ToString(); break; case DataTypes.Short: txtOutput.Text = pkt.PeekShort().ToString(); break; case DataTypes.Three: txtOutput.Text = pkt.PeekThree().ToString(); break; case DataTypes.Int: txtOutput.Text = pkt.PeekInt().ToString(); break; case DataTypes.BreakString: txtOutput.Text = pkt.PeekBreakString(); break; case DataTypes.EndString: txtOutput.Text = pkt.PeekEndString(); break; case DataTypes.FixedString: txtOutput.Text = pkt.PeekString(m_dataLength); break; default: throw new ArgumentOutOfRangeException(); } int selLen; if (m_dataLength > 0) selLen = m_dataLength; else switch (m_type) { case DataTypes.EndString: selLen = 3*(pkt.Length - pkt.ReadPosition) - 1; break; case DataTypes.BreakString: int oldPos = pkt.ReadPosition; while (pkt.ReadByte() != 255) ; selLen = pkt.ReadPosition - oldPos; pkt.Seek(oldPos, SeekOrigin.Begin); break; default: selLen = 0; break; } txtDecoded.Select(4 * m_packetOffset, 4 * selLen - 1); if (m_type == DataTypes.EndString || m_type == DataTypes.BreakString) { m_suppressEvent = true; txtLength.Text = selLen.ToString(); m_suppressEvent = false; } } private void btnImportMultis_Click(object sender, EventArgs e) { string inp = Microsoft.VisualBasic.Interaction.InputBox("Paste the raw, colon-delimited packet data here: ", "Enter packet data"); if (inp.Length == 0) return; inp = inp.Replace(":", ""); if (inp.Length%2 != 0) return; inp = inp.Substring(4); byte[] data = new byte[inp.Length / 2]; for (int i = 0; i < inp.Length; i += 2) data[i/2] = Convert.ToByte(inp.Substring(i, 2), 16); //no need to decrypt since it's init data var pkt = new Packet(data); pkt.Seek(3, SeekOrigin.Current); txtDMulti.Text = pkt.ReadByte().ToString(); txtEMulti.Text = pkt.ReadByte().ToString(); _packetProcessActions.SetEncodeMultiples(pkt.RawData[5], pkt.RawData[6]); } } }
{ "content_hash": "e9f5708b5d82c84126d52c2e191a1d85", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 142, "avg_line_length": 35.98571428571429, "alnum_prop": 0.4572250893211592, "repo_name": "ethanmoffat/EndlessClient", "id": "19a95539480e8461cbd942094e6c9c2d6b2d0fb0", "size": "10078", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PacketDecoder/MainForm.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "2416390" }, { "name": "HLSL", "bytes": "292" } ], "symlink_target": "" }
require 'spec_helper' describe CheckoutController do let(:order) { mock_model(Order, :checkout_allowed? => true, :completed? => false, :update_attributes => true, :payment? => false).as_null_object } before { controller.stub :current_order => order } it "should understand checkout routes" do assert_routing("/checkout/delivery", {:controller => "checkout", :action => "edit", :state => "delivery"}) assert_routing("/checkout/update/delivery", {:controller => "checkout", :action => "update", :state => "delivery"}) end context "#edit" do it "should redirect to the cart path unless checkout_allowed?" do order.stub :checkout_allowed? => false get :edit, { :state => "delivery" } response.should redirect_to cart_path end it "should redirect to the cart path if current_order is nil" do controller.stub!(:current_order).and_return(nil) get :edit, { :state => "delivery" } response.should redirect_to cart_path end it "should change to the requested state" do order.should_receive(:state=).with("payment").and_return true get :edit, { :state => "payment" } end it "should redirect to cart if order is completed" do order.stub(:completed? => true) get :edit, {:state => "address"} response.should redirect_to(cart_path) end end context "#update" do context "save successful" do before do order.stub(:update_attribute).and_return true order.should_receive(:update_attributes).and_return true end it "should assign order" do post :update, {:state => "confirm"} assigns[:order].should_not be_nil end it "should change to requested state" do order.should_receive(:state=).with('confirm') post :update, {:state => "confirm"} end context "with next state" do before { order.stub :next => true } it "should advance the state" do order.should_receive(:next).and_return true post :update, {:state => "delivery"} end it "should redirect the next state" do order.stub :state => "payment" post :update, {:state => "delivery"} response.should redirect_to checkout_state_path("payment") end context "when in the confirm state" do before { order.stub :state => "complete" } it "should redirect to the order view" do post :update, {:state => "confirm"} response.should redirect_to order_path(order) end it "should populate the flash message" do post :update, {:state => "confirm"} flash[:notice].should == I18n.t(:order_processed_successfully) end it "should remove completed order from the session" do post :update, {:state => "confirm"}, {:order_id => "foofah"} session[:order_id].should be_nil end end end end context "save unsuccessful" do before { order.should_receive(:update_attributes).and_return false } it "should assign order" do post :update, {:state => "confirm"} assigns[:order].should_not be_nil end it "should not change the order state" do order.should_not_receive(:update_attribute) post :update, { :state => 'confirm' } end it "should render the edit template" do post :update, { :state => 'confirm' } response.should render_template :edit end end context "when current_order is nil" do before { controller.stub! :current_order => nil } it "should not change the state if order is completed" do order.should_not_receive(:update_attribute) post :update, {:state => "confirm"} end it "should redirect to the cart_path" do post :update, {:state => "confirm"} response.should redirect_to cart_path end end context "Spree::GatewayError" do before do order.stub(:update_attributes).and_raise(Spree::GatewayError) post :update, {:state => "whatever"} end it "should render the edit template" do response.should render_template :edit end it "should set appropriate flash message" do flash[:error].should == I18n.t('spree_gateway_error_flash_for_checkout') end end end end
{ "content_hash": "0df98dbcbba214da6bf886f8205aa695", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 148, "avg_line_length": 30.666666666666668, "alnum_prop": 0.608016304347826, "repo_name": "collin/spree_core", "id": "776b7c56c1a080c9b1c01ad1b78fda7a5b49aeb4", "size": "4416", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/controllers/checkout_controller_spec.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "253027" }, { "name": "Ruby", "bytes": "476308" } ], "symlink_target": "" }
require 'yaml' require 'review_site_builder/runner' module ReviewSiteBuilder VERSION = "0.3.2" SUMMARY = "Review Site Builder/Generator for images, links, and banner ads" DESCRIPTION = "Builds a website for a client to easily review each files listed in the *.yml config (optional)" def self.build! (base_path='./') #check for config.yml in current directory cnf_file = File.join(base_path, 'config.yml'); #raise ArgumentError, 'config.yml was not found' unless File.exists? cnf_file #File.exists? load config.yml cnf = File.exists?(cnf_file) ? YAML::load_file( cnf_file ) : {} #run internal builder and return result return Runner.run!( base_path, cnf ) end end
{ "content_hash": "d4eb1c33db6b86fdbc10b193cee11b53", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 113, "avg_line_length": 30.75, "alnum_prop": 0.6693766937669376, "repo_name": "jasonsavage/ruby_review_site_builder", "id": "27f6ad2f2f46b7779269d1b58af81f11afdd6e15", "size": "759", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/review_site_builder.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "49514" }, { "name": "Ruby", "bytes": "15014" } ], "symlink_target": "" }
package org.apache.curator.framework.recipes.queue; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.utils.PathUtils; import org.apache.curator.utils.ZKPaths; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; import org.apache.zookeeper.Watcher; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Collections; import java.util.List; import java.util.NoSuchElementException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; /** * <p> * Drop in replacement for: org.apache.zookeeper.recipes.queue.DistributedQueue that is part of * the ZooKeeper distribution * </p> * * <p> * This class is data compatible with the ZK version. i.e. it uses the same naming scheme so * it can read from an existing queue * </p> */ public class SimpleDistributedQueue { private final Logger log = LoggerFactory.getLogger(getClass()); private final CuratorFramework client; private final String path; private final String PREFIX = "qn-"; /** * @param client the client * @param path path to store queue nodes */ public SimpleDistributedQueue(CuratorFramework client, String path) { this.client = client; this.path = PathUtils.validatePath(path); } /** * Return the head of the queue without modifying the queue. * * @return the data at the head of the queue. * @throws Exception errors * @throws NoSuchElementException if the queue is empty */ public byte[] element() throws Exception { byte[] bytes = internalElement(false, null); if ( bytes == null ) { throw new NoSuchElementException(); } return bytes; } /** * Attempts to remove the head of the queue and return it. * * @return The former head of the queue * @throws Exception errors * @throws NoSuchElementException if the queue is empty */ public byte[] remove() throws Exception { byte[] bytes = internalElement(true, null); if ( bytes == null ) { throw new NoSuchElementException(); } return bytes; } /** * Removes the head of the queue and returns it, blocks until it succeeds. * * @return The former head of the queue * @throws Exception errors */ public byte[] take() throws Exception { return internalPoll(0, null); } /** * Inserts data into queue. * * @param data the data * @return true if data was successfully added * @throws Exception errors */ public boolean offer(byte[] data) throws Exception { String thisPath = ZKPaths.makePath(path, PREFIX); client.create().creatingParentContainersIfNeeded().withMode(CreateMode.PERSISTENT_SEQUENTIAL).forPath(thisPath, data); return true; } /** * Returns the data at the first element of the queue, or null if the queue is empty. * * @return data at the first element of the queue, or null. * @throws Exception errors */ public byte[] peek() throws Exception { try { return element(); } catch ( NoSuchElementException e ) { return null; } } /** * Retrieves and removes the head of this queue, waiting up to the * specified wait time if necessary for an element to become available. * * @param timeout how long to wait before giving up, in units of * <tt>unit</tt> * @param unit a <tt>TimeUnit</tt> determining how to interpret the * <tt>timeout</tt> parameter * @return the head of this queue, or <tt>null</tt> if the * specified waiting time elapses before an element is available * @throws Exception errors */ public byte[] poll(long timeout, TimeUnit unit) throws Exception { return internalPoll(timeout, unit); } /** * Attempts to remove the head of the queue and return it. Returns null if the queue is empty. * * @return Head of the queue or null. * @throws Exception errors */ public byte[] poll() throws Exception { try { return remove(); } catch ( NoSuchElementException e ) { return null; } } private byte[] internalPoll(long timeout, TimeUnit unit) throws Exception { ensurePath(); long startMs = System.currentTimeMillis(); boolean hasTimeout = (unit != null); long maxWaitMs = hasTimeout ? TimeUnit.MILLISECONDS.convert(timeout, unit) : Long.MAX_VALUE; for(;;) { final CountDownLatch latch = new CountDownLatch(1); Watcher watcher = new Watcher() { @Override public void process(WatchedEvent event) { latch.countDown(); } }; byte[] bytes = internalElement(true, watcher); if ( bytes != null ) { return bytes; } if ( hasTimeout ) { long elapsedMs = System.currentTimeMillis() - startMs; long thisWaitMs = maxWaitMs - elapsedMs; if ( thisWaitMs <= 0 ) { return null; } latch.await(thisWaitMs, TimeUnit.MILLISECONDS); } else { latch.await(); } } } private void ensurePath() throws Exception { client.createContainers(path); } private byte[] internalElement(boolean removeIt, Watcher watcher) throws Exception { ensurePath(); List<String> nodes; try { nodes = (watcher != null) ? client.getChildren().usingWatcher(watcher).forPath(path) : client.getChildren().forPath(path); } catch ( KeeperException.NoNodeException dummy ) { return null; } Collections.sort(nodes); for ( String node : nodes ) { if ( !node.startsWith(PREFIX) ) { log.warn("Foreign node in queue path: " + node); continue; } String thisPath = ZKPaths.makePath(path, node); try { byte[] bytes = client.getData().forPath(thisPath); if ( removeIt ) { client.delete().forPath(thisPath); } return bytes; } catch ( KeeperException.NoNodeException ignore ) { //Another client removed the node first, try next } } return null; } }
{ "content_hash": "d78ff28fd5e8448723b6f7d39d286a5e", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 134, "avg_line_length": 28.611336032388664, "alnum_prop": 0.5647375123814914, "repo_name": "yepuv1/curator.net", "id": "9650ffb5c1844e7348628ad0da5dd13de717adaf", "size": "7875", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/SimpleDistributedQueue.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "59256" }, { "name": "CSS", "bytes": "1449" }, { "name": "Java", "bytes": "1892483" }, { "name": "Shell", "bytes": "3244" }, { "name": "Thrift", "bytes": "9944" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <extension version="3.4" type="plugin" group="system" method="upgrade"> <name>plg_system_advancedmodules</name> <description>PLG_SYSTEM_ADVANCEDMODULES_DESC</description> <version>7.1.1</version> <creationDate>February 2017</creationDate> <author>Regular Labs (Peter van Westen)</author> <authorEmail>info@regularlabs.com</authorEmail> <authorUrl>https://www.regularlabs.com</authorUrl> <copyright>Copyright © 2017 Regular Labs - All Rights Reserved</copyright> <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license> <scriptfile>script.install.php</scriptfile> <updateservers> <server type="extension" priority="1" name="Regular Labs Advanced Module Manager"> http://download.regularlabs.com/updates.xml?e=advancedmodulemanager&amp;type=.xml </server> </updateservers> <files> <filename plugin="advancedmodules">advancedmodules.php</filename> <filename>script.install.helper.php</filename> <folder>language</folder> <folder>src</folder> <folder>vendor</folder> </files> <config> <fields name="params" addfieldpath="/libraries/regularlabs/fields"> <fieldset name="description"> <field name="@loadlanguage_regularlabs" type="rl_loadlanguage" extension="plg_system_regularlabs" /> <field name="@loadlanguage" type="rl_loadlanguage" extension="plg_system_advancedmodules" /> <field name="@license" type="rl_license" extension="ADVANCED_MODULE_MANAGER" /> <field name="@version" type="rl_version" extension="ADVANCED_MODULE_MANAGER" /> <field name="@dependency" type="rl_dependency" label="AMM_THE_COMPONENT" file="/administrator/components/com_advancedmodules/advancedmodules.php" /> <field name="@header" type="rl_header" label="ADVANCED_MODULE_MANAGER" description="ADVANCED_MODULE_MANAGER_DESC" url="https://www.regularlabs.com/advancedmodulemanager" /> <field name="@notice_settings" type="rl_plaintext" description="AMM_SETTINGS,&lt;a href=&quot;index.php?option=com_advancedmodules&quot; target=&quot;_blank&quot;&gt;,&lt;/a&gt;" /> </fieldset> </fields> </config> </extension>
{ "content_hash": "d8e2481805e7581b4da52504db0e5bca", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 138, "avg_line_length": 44, "alnum_prop": 0.7235621521335807, "repo_name": "yaelduckwen/lo_imaginario", "id": "0fa97400aabe6935af1cb70ee394955e63541edd", "size": "2157", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web2/plugins/system/advancedmodules/advancedmodules.xml", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "468" }, { "name": "CSS", "bytes": "6260484" }, { "name": "HTML", "bytes": "104589" }, { "name": "Java", "bytes": "14870" }, { "name": "JavaScript", "bytes": "3918522" }, { "name": "PHP", "bytes": "27434460" }, { "name": "PLpgSQL", "bytes": "2393" }, { "name": "SQLPL", "bytes": "17688" } ], "symlink_target": "" }
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('excel', '0001_initial'), ] operations = [ migrations.AddField( model_name='excel', name='name', field=models.CharField(default='', max_length=100), preserve_default=False, ), ]
{ "content_hash": "2bd8e3d6d417ba288a44b1550cca273e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 63, "avg_line_length": 21.526315789473685, "alnum_prop": 0.5745721271393643, "repo_name": "stone5495/zebra", "id": "63893141848ebde58f748971aa57e80309f71063", "size": "433", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/excel/migrations/0002_excel_name.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "30" }, { "name": "HTML", "bytes": "16980" }, { "name": "Python", "bytes": "87002" } ], "symlink_target": "" }
'use strict'; describe('TodoApp Controllers', function() { beforeEach(module('todoApp')); describe('TodoCtrl', function() { var $httpBackend, $rootScope, $controller, createController, todoRequestHandler; var todos = [ {_id: "1", title:"Todo 1", done:false, dueDate:new Date(), description:"First todo item"}, {_id: "2", title:"Todo 2", done:true, dueDate:new Date(), description:"Second todo item"}, {_id: "3", title:"Todo 3", done:false, dueDate:new Date(), description:"Third todo item"} ]; var newTodo = {title:"New Todo", done:false}; beforeEach(inject(function($injector) { $httpBackend = $injector.get('$httpBackend'); $rootScope = $injector.get('$rootScope'); $controller = $injector.get('$controller'); todoRequestHandler = $httpBackend.when('GET', '/todos').respond(todos); createController = function() { return $controller('TodoCtrl', {$scope: $rootScope}); }; })); afterEach(function() { $httpBackend.verifyNoOutstandingExpectation(); $httpBackend.verifyNoOutstandingRequest(); }); it('should get all todos from the service', function() { $httpBackend.expectGET('/todos'); var controller = createController(); $httpBackend.flush(); expect($rootScope.todos.length).toEqual(todos.length); }); it('should handle an empty todo set from the service', function() { $httpBackend.expectGET('/todos').respond([]); var controller = createController(); $httpBackend.flush(); expect($rootScope.todos.length).toEqual(0); }); it('should handle a null set from the service', function() { $httpBackend.expectGET('/todos').respond(null); var controller = createController(); $httpBackend.flush(); expect($rootScope.todos.length).toEqual(0); }); it('should handle a single todo from the service', function() { $httpBackend.expectGET('/todos').respond([todos[0]]); var controller = createController(); $httpBackend.flush(); expect($rootScope.todos.length).toEqual(1); }); it('should not show completed todos by default', function() { var controller = createController(); $httpBackend.flush(); expect($rootScope.showCompleted).toBe(false); }); it('should not have an active todo by default', function() { var controller = createController(); $httpBackend.flush(); expect($rootScope.activeTodo).toBe(undefined); }); it('should set the active todo when setActive is called', function() { var controller = createController(); $httpBackend.flush(); $rootScope.setActive(todos[1]); expect($rootScope.activeTodo).toEqual(todos[1]); }); describe('when creating a new todo', function() { var cbObj = { cb: function(){} }; beforeEach(function() { $httpBackend.expectPOST('/todos', newTodo).respond(newTodo); }); it('should create a new todo on the service with the add method', function() { var controller = createController(); $rootScope.add(newTodo.title); $httpBackend.flush(); }); it('should create a new todo on the service with the addFromInput method', function() { var controller = createController(); $rootScope.todoInput = newTodo.title; $rootScope.addFromInput(); $httpBackend.flush(); }); it('should not create a new todo on the service with the addFromInput method if the input is empty', function() { var controller = createController(); $rootScope.todoInput = ""; $rootScope.addFromInput(); $httpBackend.resetExpectations(); $httpBackend.flush(); }); it('should add the new todo to the controller', function() { var controller = createController(); $rootScope.add(newTodo.title); $httpBackend.flush(); expect($rootScope.todos.length).toEqual(todos.length + 1); }); it('should invoke the provided callback when a todo is added', function() { var controller = createController(); spyOn(cbObj, "cb"); $rootScope.add(newTodo.title, cbObj.cb); $httpBackend.flush(); expect(cbObj.cb).toHaveBeenCalled(); }); }); describe('when updating an existing todo', function() { it('should update the existing todo on the service with the update method', function() { var controller = createController(); $httpBackend.flush(); $rootScope.todos[0].title += " (updated)"; $httpBackend.expectPOST('/todos/'+todos[0]._id).respond($rootScope.todos[0]); $rootScope.update($rootScope.todos[0]); $httpBackend.flush(); }); it('should update the active todo when updateActive is called', function() { var controller = createController(); $httpBackend.flush(); $rootScope.setActive($rootScope.todos[1]); $rootScope.activeTodo.title += " (updated)"; $httpBackend.expectPOST('/todos/'+$rootScope.activeTodo._id).respond($rootScope.activeTodo); $rootScope.updateActive(); $httpBackend.flush(); }); it('should not update the active todo when updateActive is called and the active todo is not set', function() { var controller = createController(); $httpBackend.flush(); spyOn($rootScope, 'update'); $rootScope.updateActive(); expect($rootScope.update).not.toHaveBeenCalled(); }); }); describe('when deleting an existing todo', function() { it('should delete the existing todo on the service with the delete method', function() { var controller = createController(); $httpBackend.flush(); $rootScope.delete($rootScope.todos[1]); $httpBackend.expectDELETE('/todos/' + $rootScope.todos[1]._id).respond($rootScope.todos[1]); $httpBackend.flush(); }); }); }); });
{ "content_hash": "b6e3b94bd5fd200befd7029b0b29d0b6", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 116, "avg_line_length": 32.48255813953488, "alnum_prop": 0.6706640415249687, "repo_name": "mwindle/todos", "id": "539bbaa30d5fe009ff73576587c9359c2b8964f6", "size": "5587", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/unit/controllerSpec.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "58" }, { "name": "JavaScript", "bytes": "13637" } ], "symlink_target": "" }
#ifndef HTMLTextFormControlElement_h #define HTMLTextFormControlElement_h #include "HTMLFormControlElementWithState.h" namespace WebCore { class Position; class RenderTextControl; class VisiblePosition; enum TextFieldSelectionDirection { SelectionHasNoDirection, SelectionHasForwardDirection, SelectionHasBackwardDirection }; enum TextFieldEventBehavior { DispatchNoEvent, DispatchChangeEvent, DispatchInputAndChangeEvent }; class HTMLTextFormControlElement : public HTMLFormControlElementWithState { public: // Common flag for HTMLInputElement::tooLong() and HTMLTextAreaElement::tooLong(). enum NeedsToCheckDirtyFlag {CheckDirtyFlag, IgnoreDirtyFlag}; virtual ~HTMLTextFormControlElement(); void forwardEvent(Event*); virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; // The derived class should return true if placeholder processing is needed. virtual bool supportsPlaceholder() const = 0; String strippedPlaceholder() const; bool placeholderShouldBeVisible() const; virtual HTMLElement* placeholderElement() const = 0; void updatePlaceholderVisibility(bool); static void fixPlaceholderRenderer(HTMLElement* placeholder, HTMLElement* siblingElement); int indexForVisiblePosition(const VisiblePosition&) const; int selectionStart() const; int selectionEnd() const; const AtomicString& selectionDirection() const; void setSelectionStart(int); void setSelectionEnd(int); void setSelectionDirection(const String&); void select(); virtual void setRangeText(const String& replacement, ExceptionCode&); virtual void setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode&); void setSelectionRange(int start, int end, const String& direction); void setSelectionRange(int start, int end, TextFieldSelectionDirection = SelectionHasNoDirection); PassRefPtr<Range> selection() const; String selectedText() const; virtual void dispatchFormControlChangeEvent(); virtual int maxLength() const = 0; virtual String value() const = 0; virtual HTMLElement* innerTextElement() const = 0; void selectionChanged(bool userTriggered); bool lastChangeWasUserEdit() const; void setInnerTextValue(const String&); String innerTextValue() const; String directionForFormData() const; void setTextAsOfLastFormControlChangeEvent(const String& text) { m_textAsOfLastFormControlChangeEvent = text; } virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; protected: HTMLTextFormControlElement(const QualifiedName&, Document*, HTMLFormElement*); bool isPlaceholderEmpty() const; virtual void updatePlaceholderText() = 0; virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; void cacheSelection(int start, int end, TextFieldSelectionDirection direction) { m_cachedSelectionStart = start; m_cachedSelectionEnd = end; m_cachedSelectionDirection = direction; } void restoreCachedSelection(); bool hasCachedSelection() const { return m_cachedSelectionStart >= 0; } virtual void defaultEventHandler(Event*); virtual void subtreeHasChanged() = 0; void setLastChangeWasNotUserEdit() { m_lastChangeWasUserEdit = false; } String valueWithHardLineBreaks() const; private: int computeSelectionStart() const; int computeSelectionEnd() const; TextFieldSelectionDirection computeSelectionDirection() const; virtual void dispatchFocusEvent(PassRefPtr<Node> oldFocusedNode); virtual void dispatchBlurEvent(PassRefPtr<Node> newFocusedNode); virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE; // Returns true if user-editable value is empty. Used to check placeholder visibility. virtual bool isEmptyValue() const = 0; // Returns true if suggested value is empty. Used to check placeholder visibility. virtual bool isEmptySuggestedValue() const { return true; } // Called in dispatchFocusEvent(), after placeholder process, before calling parent's dispatchFocusEvent(). virtual void handleFocusEvent() { } // Called in dispatchBlurEvent(), after placeholder process, before calling parent's dispatchBlurEvent(). virtual void handleBlurEvent() { } RenderTextControl* textRendererAfterUpdateLayout(); String m_textAsOfLastFormControlChangeEvent; bool m_lastChangeWasUserEdit; int m_cachedSelectionStart; int m_cachedSelectionEnd; TextFieldSelectionDirection m_cachedSelectionDirection; }; // This function returns 0 when node is an input element and not a text field. inline HTMLTextFormControlElement* toTextFormControl(Node* node) { return (node && node->isElementNode() && static_cast<Element*>(node)->isTextFormControl()) ? static_cast<HTMLTextFormControlElement*>(node) : 0; } HTMLTextFormControlElement* enclosingTextFormControl(const Position&); } // namespace #endif
{ "content_hash": "bc7330459627a5fa7573474196c0a69d", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 148, "avg_line_length": 38.083333333333336, "alnum_prop": 0.770041774418142, "repo_name": "leighpauls/k2cro4", "id": "ed9522825a78ca9a5174713d4b1ba0486f05ddbf", "size": "6126", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "third_party/WebKit/Source/WebCore/html/HTMLTextFormControlElement.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "3062" }, { "name": "AppleScript", "bytes": "25392" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "68131038" }, { "name": "C", "bytes": "242794338" }, { "name": "C#", "bytes": "11024" }, { "name": "C++", "bytes": "353525184" }, { "name": "Common Lisp", "bytes": "3721" }, { "name": "D", "bytes": "1931" }, { "name": "Emacs Lisp", "bytes": "1639" }, { "name": "F#", "bytes": "4992" }, { "name": "FORTRAN", "bytes": "10404" }, { "name": "Java", "bytes": "3845159" }, { "name": "JavaScript", "bytes": "39146656" }, { "name": "Lua", "bytes": "13768" }, { "name": "Matlab", "bytes": "22373" }, { "name": "Objective-C", "bytes": "21887598" }, { "name": "PHP", "bytes": "2344144" }, { "name": "Perl", "bytes": "49033099" }, { "name": "Prolog", "bytes": "2926122" }, { "name": "Python", "bytes": "39863959" }, { "name": "R", "bytes": "262" }, { "name": "Racket", "bytes": "359" }, { "name": "Ruby", "bytes": "304063" }, { "name": "Scheme", "bytes": "14853" }, { "name": "Shell", "bytes": "9195117" }, { "name": "Tcl", "bytes": "1919771" }, { "name": "Verilog", "bytes": "3092" }, { "name": "Visual Basic", "bytes": "1430" }, { "name": "eC", "bytes": "5079" } ], "symlink_target": "" }
namespace glm { /// @addtogroup gtx_string_cast /// @{ /// Create a string from a GLM vector or matrix typed variable. /// @see gtx_string_cast extension. template <template <typename, precision> class matType, typename T, precision P> GLM_FUNC_DECL std::string to_string(matType<T, P> const & x); /// @} }//namespace glm #include "string_cast.inl"
{ "content_hash": "3a2423b455b415af3fbff29391300cd7", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 81, "avg_line_length": 25.642857142857142, "alnum_prop": 0.6880222841225627, "repo_name": "izzyaxel/Iridium", "id": "027f03aec9b7afb313f1610b56589b7e15d2dbe5", "size": "1422", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/include/GLM/gtx/string_cast.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "606" }, { "name": "C", "bytes": "4042313" }, { "name": "C++", "bytes": "1992010" }, { "name": "CMake", "bytes": "2101" }, { "name": "GDB", "bytes": "3" }, { "name": "GLSL", "bytes": "699" }, { "name": "Objective-C", "bytes": "40716" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_35) on Tue Oct 09 17:08:24 PDT 2012 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class com.fasterxml.jackson.databind.introspect.AnnotatedClass (jackson-databind 2.1.0 API) </TITLE> <META NAME="date" CONTENT="2012-10-09"> <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="Uses of Class com.fasterxml.jackson.databind.introspect.AnnotatedClass (jackson-databind 2.1.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</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;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/fasterxml/jackson/databind/introspect//class-useAnnotatedClass.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="AnnotatedClass.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> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>com.fasterxml.jackson.databind.introspect.AnnotatedClass</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.fasterxml.jackson.databind"><B>com.fasterxml.jackson.databind</B></A></TD> <TD>Contains basic mapper (conversion) functionality that allows for converting between regular streaming json content and Java objects (beans or Tree Model: support for both is via <A HREF="../../../../../../com/fasterxml/jackson/databind/ObjectMapper.html" title="class in com.fasterxml.jackson.databind"><CODE>ObjectMapper</CODE></A> class, as well as convenience methods included in <A HREF="http://fasterxml.github.com/jackson-core/javadoc/2.1.0/com/fasterxml/jackson/core/JsonParser.html?is-external=true" title="class or interface in com.fasterxml.jackson.core"><CODE>JsonParser</CODE></A>&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.fasterxml.jackson.databind.introspect"><B>com.fasterxml.jackson.databind.introspect</B></A></TD> <TD>Functionality needed for Bean introspection, required for detecting accessors and mutators for Beans, as well as locating and handling method annotations.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.fasterxml.jackson.databind.jsontype"><B>com.fasterxml.jackson.databind.jsontype</B></A></TD> <TD>Package that contains interfaces that define how to implement functionality for dynamically resolving type during deserialization.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.fasterxml.jackson.databind.jsontype.impl"><B>com.fasterxml.jackson.databind.jsontype.impl</B></A></TD> <TD>Package that contains standard implementations for <A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/TypeResolverBuilder.html" title="interface in com.fasterxml.jackson.databind.jsontype"><CODE>TypeResolverBuilder</CODE></A> and <A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/TypeIdResolver.html" title="interface in com.fasterxml.jackson.databind.jsontype"><CODE>TypeIdResolver</CODE></A>.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#com.fasterxml.jackson.databind.ser"><B>com.fasterxml.jackson.databind.ser</B></A></TD> <TD>Contains implementation classes of serialization part of data binding.&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.fasterxml.jackson.databind"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A> in <A HREF="../../../../../../com/fasterxml/jackson/databind/package-summary.html">com.fasterxml.jackson.databind</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/fasterxml/jackson/databind/package-summary.html">com.fasterxml.jackson.databind</A> that return <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>abstract &nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></CODE></FONT></TD> <TD><CODE><B>BeanDescription.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/BeanDescription.html#getClassInfo()">getClassInfo</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for accessing low-level information about Class this item describes.</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/fasterxml/jackson/databind/package-summary.html">com.fasterxml.jackson.databind</A> with parameters of type <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/VisibilityChecker.html" title="interface in com.fasterxml.jackson.databind.introspect">VisibilityChecker</A>&lt;?&gt;</CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findAutoDetectVisibility(com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.introspect.VisibilityChecker)">findAutoDetectVisibility</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/VisibilityChecker.html" title="interface in com.fasterxml.jackson.databind.introspect">VisibilityChecker</A>&lt;?&gt;&nbsp;checker)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for checking if annotations indicate changes to minimum visibility levels needed for auto-detecting property elements (fields, methods, constructors).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findFilterId(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findFilterId</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for finding if annotated class has associated filter; and if so, to return id that is used to locate filter.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findIgnoreUnknownProperties(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findIgnoreUnknownProperties</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for checking whether an annotation indicates that all unknown properties</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findNamingStrategy(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findNamingStrategy</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for finding <A HREF="../../../../../../com/fasterxml/jackson/databind/PropertyNamingStrategy.html" title="class in com.fasterxml.jackson.databind"><CODE>PropertyNamingStrategy</CODE></A> for given class, if any specified by annotations; and if so, either return a <A HREF="../../../../../../com/fasterxml/jackson/databind/PropertyNamingStrategy.html" title="class in com.fasterxml.jackson.databind"><CODE>PropertyNamingStrategy</CODE></A> instance, or Class to use for creating instance</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;</CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findPOJOBuilder(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findPOJOBuilder</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for finding Builder object to use for constructing value instance and binding data (sort of combining value instantiators that can construct, and deserializers that can bind data).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/annotation/JsonPOJOBuilder.Value.html" title="class in com.fasterxml.jackson.databind.annotation">JsonPOJOBuilder.Value</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findPOJOBuilderConfig(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findPOJOBuilderConfig</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/PropertyName.html" title="class in com.fasterxml.jackson.databind">PropertyName</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findRootName(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findRootName</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for locating name used as "root name" (for use by some serializers when outputting root-level object -- mostly for XML compatibility purposes) for given class, if one is defined.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findSerializationPropertyOrder(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findSerializationPropertyOrder</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for accessing defined property serialization order (which may be partial).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findSerializationSortAlphabetically(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findSerializationSortAlphabetically</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for checking whether an annotation indicates that serialized properties for which no explicit is defined should be alphabetically (lexicograpically) ordered</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findTypeName(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findTypeName</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for checking if specified type has explicit name.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/TypeResolverBuilder.html" title="interface in com.fasterxml.jackson.databind.jsontype">TypeResolverBuilder</A>&lt;?&gt;</CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findTypeResolver(com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.JavaType)">findTypeResolver</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac, <A HREF="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</A>&nbsp;baseType)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for checking if given class has annotations that indicate that specific type resolver is to be used for handling instances.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#findValueInstantiator(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findValueInstantiator</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method getting <A HREF="../../../../../../com/fasterxml/jackson/databind/deser/ValueInstantiator.html" title="class in com.fasterxml.jackson.databind.deser"><CODE>ValueInstantiator</CODE></A> to use for given type (class): return value can either be an instance of instantiator, or class of instantiator to create.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html#isIgnorableType(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">isIgnorableType</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for checking whether properties that have specified type (class, not generics aware) should be completely ignored for serialization and deserialization purposes.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.fasterxml.jackson.databind.introspect"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A> in <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/package-summary.html">com.fasterxml.jackson.databind.introspect</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Fields in <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/package-summary.html">com.fasterxml.jackson.databind.introspect</A> declared as <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></CODE></FONT></TD> <TD><CODE><B>POJOPropertiesCollector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.html#_classDef">_classDef</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Low-level introspected class information (methods, fields etc)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></CODE></FONT></TD> <TD><CODE><B>BasicBeanDescription.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/BasicBeanDescription.html#_classInfo">_classInfo</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Information collected about the class introspected.</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/package-summary.html">com.fasterxml.jackson.databind.introspect</A> that return <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></CODE></FONT></TD> <TD><CODE><B>AnnotatedClass.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html#construct(java.lang.Class, com.fasterxml.jackson.databind.AnnotationIntrospector, com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver)">construct</A></B>(<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&nbsp;cls, <A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html" title="class in com.fasterxml.jackson.databind">AnnotationIntrospector</A>&nbsp;aintr, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/ClassIntrospector.MixInResolver.html" title="interface in com.fasterxml.jackson.databind.introspect">ClassIntrospector.MixInResolver</A>&nbsp;mir)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Factory method that instantiates an instance.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></CODE></FONT></TD> <TD><CODE><B>AnnotatedClass.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html#constructWithoutSuperTypes(java.lang.Class, com.fasterxml.jackson.databind.AnnotationIntrospector, com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver)">constructWithoutSuperTypes</A></B>(<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&nbsp;cls, <A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html" title="class in com.fasterxml.jackson.databind">AnnotationIntrospector</A>&nbsp;aintr, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/ClassIntrospector.MixInResolver.html" title="interface in com.fasterxml.jackson.databind.introspect">ClassIntrospector.MixInResolver</A>&nbsp;mir)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method similar to <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html#construct(java.lang.Class, com.fasterxml.jackson.databind.AnnotationIntrospector, com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver)"><CODE>construct(java.lang.Class<?>, com.fasterxml.jackson.databind.AnnotationIntrospector, com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver)</CODE></A>, but that will NOT include information from supertypes; only class itself and any direct mix-ins it may have.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></CODE></FONT></TD> <TD><CODE><B>POJOPropertiesCollector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.html#getClassDef()">getClassDef</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></CODE></FONT></TD> <TD><CODE><B>BasicBeanDescription.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/BasicBeanDescription.html#getClassInfo()">getClassInfo</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></CODE></FONT></TD> <TD><CODE><B>AnnotatedClass.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html#withAnnotations(com.fasterxml.jackson.databind.introspect.AnnotationMap)">withAnnotations</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationMap.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotationMap</A>&nbsp;ann)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/package-summary.html">com.fasterxml.jackson.databind.introspect</A> with parameters of type <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.html" title="class in com.fasterxml.jackson.databind.introspect">POJOPropertiesCollector</A></CODE></FONT></TD> <TD><CODE><B>BasicClassIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/BasicClassIntrospector.html#constructPropertyCollector(com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.JavaType, boolean, java.lang.String)">constructPropertyCollector</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac, <A HREF="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</A>&nbsp;type, boolean&nbsp;forSerialization, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;mutatorPrefix)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Overridable method called for creating <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.html" title="class in com.fasterxml.jackson.databind.introspect"><CODE>POJOPropertiesCollector</CODE></A> instance to use; override is needed if a custom sub-class is to be used.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/VisibilityChecker.html" title="interface in com.fasterxml.jackson.databind.introspect">VisibilityChecker</A>&lt;?&gt;</CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findAutoDetectVisibility(com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.introspect.VisibilityChecker)">findAutoDetectVisibility</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/VisibilityChecker.html" title="interface in com.fasterxml.jackson.databind.introspect">VisibilityChecker</A>&lt;?&gt;&nbsp;checker)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/VisibilityChecker.html" title="interface in com.fasterxml.jackson.databind.introspect">VisibilityChecker</A>&lt;?&gt;</CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findAutoDetectVisibility(com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.introspect.VisibilityChecker)">findAutoDetectVisibility</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/VisibilityChecker.html" title="interface in com.fasterxml.jackson.databind.introspect">VisibilityChecker</A>&lt;?&gt;&nbsp;checker)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findFilterId(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findFilterId</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findFilterId(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findFilterId</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A></CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findIgnoreUnknownProperties(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findIgnoreUnknownProperties</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findIgnoreUnknownProperties(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findIgnoreUnknownProperties</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findNamingStrategy(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findNamingStrategy</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findNamingStrategy(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findNamingStrategy</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;</CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findPOJOBuilder(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findPOJOBuilder</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;</CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findPOJOBuilder(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findPOJOBuilder</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/annotation/JsonPOJOBuilder.Value.html" title="class in com.fasterxml.jackson.databind.annotation">JsonPOJOBuilder.Value</A></CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findPOJOBuilderConfig(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findPOJOBuilderConfig</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/annotation/JsonPOJOBuilder.Value.html" title="class in com.fasterxml.jackson.databind.annotation">JsonPOJOBuilder.Value</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findPOJOBuilderConfig(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findPOJOBuilderConfig</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/PropertyName.html" title="class in com.fasterxml.jackson.databind">PropertyName</A></CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findRootName(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findRootName</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/PropertyName.html" title="class in com.fasterxml.jackson.databind">PropertyName</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findRootName(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findRootName</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findSerializationPropertyOrder(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findSerializationPropertyOrder</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findSerializationPropertyOrder(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findSerializationPropertyOrder</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A></CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findSerializationSortAlphabetically(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findSerializationSortAlphabetically</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findSerializationSortAlphabetically(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findSerializationSortAlphabetically</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for checking whether an annotation indicates that serialized properties for which no explicit is defined should be alphabetically (lexicograpically) ordered</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findTypeName(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findTypeName</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findTypeName(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findTypeName</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/TypeResolverBuilder.html" title="interface in com.fasterxml.jackson.databind.jsontype">TypeResolverBuilder</A>&lt;?&gt;</CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findTypeResolver(com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.JavaType)">findTypeResolver</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac, <A HREF="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</A>&nbsp;baseType)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/TypeResolverBuilder.html" title="interface in com.fasterxml.jackson.databind.jsontype">TypeResolverBuilder</A>&lt;?&gt;</CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findTypeResolver(com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.JavaType)">findTypeResolver</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac, <A HREF="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</A>&nbsp;baseType)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#findValueInstantiator(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findValueInstantiator</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#findValueInstantiator(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">findValueInstantiator</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/BasicBeanDescription.html" title="class in com.fasterxml.jackson.databind.introspect">BasicBeanDescription</A></CODE></FONT></TD> <TD><CODE><B>BasicBeanDescription.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/BasicBeanDescription.html#forOtherUse(com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.JavaType, com.fasterxml.jackson.databind.introspect.AnnotatedClass)">forOtherUse</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, <A HREF="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</A>&nbsp;type, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Factory method to use for constructing an instance to use for purposes other than building serializers or deserializers; will only have information on class, not on properties.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A></CODE></FONT></TD> <TD><CODE><B>JacksonAnnotationIntrospector.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.html#isIgnorableType(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">isIgnorableType</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</A></CODE></FONT></TD> <TD><CODE><B>AnnotationIntrospectorPair.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotationIntrospectorPair.html#isIgnorableType(com.fasterxml.jackson.databind.introspect.AnnotatedClass)">isIgnorableType</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;ac)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Constructors in <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/package-summary.html">com.fasterxml.jackson.databind.introspect</A> with parameters of type <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/BasicBeanDescription.html#BasicBeanDescription(com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.JavaType, com.fasterxml.jackson.databind.introspect.AnnotatedClass, java.util.List)">BasicBeanDescription</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, <A HREF="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</A>&nbsp;type, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;classDef, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A>&lt;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/BeanPropertyDefinition.html" title="class in com.fasterxml.jackson.databind.introspect">BeanPropertyDefinition</A>&gt;&nbsp;props)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.html#POJOPropertiesCollector(com.fasterxml.jackson.databind.cfg.MapperConfig, boolean, com.fasterxml.jackson.databind.JavaType, com.fasterxml.jackson.databind.introspect.AnnotatedClass, java.lang.String)">POJOPropertiesCollector</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, boolean&nbsp;forSerialization, <A HREF="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</A>&nbsp;type, <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;classDef, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;mutatorPrefix)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.fasterxml.jackson.databind.jsontype"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A> in <A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/package-summary.html">com.fasterxml.jackson.databind.jsontype</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/package-summary.html">com.fasterxml.jackson.databind.jsontype</A> with parameters of type <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>abstract &nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/NamedType.html" title="class in com.fasterxml.jackson.databind.jsontype">NamedType</A>&gt;</CODE></FONT></TD> <TD><CODE><B>SubtypeResolver.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/SubtypeResolver.html#collectAndResolveSubtypes(com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.AnnotationIntrospector)">collectAndResolveSubtypes</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;basetype, <A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, <A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html" title="class in com.fasterxml.jackson.databind">AnnotationIntrospector</A>&nbsp;ai)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method for finding out all reachable subtypes for given type.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.fasterxml.jackson.databind.jsontype.impl"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A> in <A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/impl/package-summary.html">com.fasterxml.jackson.databind.jsontype.impl</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/impl/package-summary.html">com.fasterxml.jackson.databind.jsontype.impl</A> with parameters of type <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B>StdSubtypeResolver.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/impl/StdSubtypeResolver.html#_collectAndResolve(com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.jsontype.NamedType, com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.AnnotationIntrospector, java.util.HashMap)">_collectAndResolve</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;annotatedType, <A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/NamedType.html" title="class in com.fasterxml.jackson.databind.jsontype">NamedType</A>&nbsp;namedType, <A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, <A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html" title="class in com.fasterxml.jackson.databind">AnnotationIntrospector</A>&nbsp;ai, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/HashMap.html?is-external=true" title="class or interface in java.util">HashMap</A>&lt;<A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/NamedType.html" title="class in com.fasterxml.jackson.databind.jsontype">NamedType</A>,<A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/NamedType.html" title="class in com.fasterxml.jackson.databind.jsontype">NamedType</A>&gt;&nbsp;collectedSubtypes)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called to find subtypes for a specific type (class)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/NamedType.html" title="class in com.fasterxml.jackson.databind.jsontype">NamedType</A>&gt;</CODE></FONT></TD> <TD><CODE><B>StdSubtypeResolver.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/jsontype/impl/StdSubtypeResolver.html#collectAndResolveSubtypes(com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.AnnotationIntrospector)">collectAndResolveSubtypes</A></B>(<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A>&nbsp;type, <A HREF="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</A>&lt;?&gt;&nbsp;config, <A HREF="../../../../../../com/fasterxml/jackson/databind/AnnotationIntrospector.html" title="class in com.fasterxml.jackson.databind">AnnotationIntrospector</A>&nbsp;ai)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="com.fasterxml.jackson.databind.ser"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A> in <A HREF="../../../../../../com/fasterxml/jackson/databind/ser/package-summary.html">com.fasterxml.jackson.databind.ser</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../com/fasterxml/jackson/databind/ser/package-summary.html">com.fasterxml.jackson.databind.ser</A> that return <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect">AnnotatedClass</A></CODE></FONT></TD> <TD><CODE><B>BeanSerializerBuilder.</B><B><A HREF="../../../../../../com/fasterxml/jackson/databind/ser/BeanSerializerBuilder.html#getClassInfo()">getClassInfo</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../com/fasterxml/jackson/databind/introspect/AnnotatedClass.html" title="class in com.fasterxml.jackson.databind.introspect"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</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;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/fasterxml/jackson/databind/introspect//class-useAnnotatedClass.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="AnnotatedClass.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> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2012 <a href="http://fasterxml.com/">FasterXML</a>. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "8ecf2a47d724ef65ac2db33529f1daad", "timestamp": "", "source": "github", "line_count": 798, "max_line_length": 601, "avg_line_length": 88.74812030075188, "alnum_prop": 0.707261970319538, "repo_name": "FasterXML/jackson-databind", "id": "f460098f65b9e41782901f6b5dee2e6e2bc9087c", "size": "70821", "binary": false, "copies": "1", "ref": "refs/heads/2.15", "path": "docs/javadoc/2.1/com/fasterxml/jackson/databind/introspect/class-use/AnnotatedClass.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "7940640" }, { "name": "Logos", "bytes": "173041" }, { "name": "Shell", "bytes": "264" } ], "symlink_target": "" }
package io.opentelemetry.sdk.metrics; /** * All possible measurement value types. * * @since 1.14.0 */ public enum InstrumentValueType { LONG, DOUBLE, }
{ "content_hash": "1059a612a92d2adcb10a8edd5b1b8f3c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 40, "avg_line_length": 12.615384615384615, "alnum_prop": 0.6829268292682927, "repo_name": "open-telemetry/opentelemetry-java", "id": "c21e0a956568c7d54b17453ba79bb12dd2f421a7", "size": "248", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/InstrumentValueType.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "580" }, { "name": "Java", "bytes": "4754656" }, { "name": "Jinja", "bytes": "6939" }, { "name": "Kotlin", "bytes": "106188" }, { "name": "Shell", "bytes": "2675" } ], "symlink_target": "" }
SYNONYM #### According to Index Fungorum #### Published in null #### Original name Ascidium discolor var. dodecamerum Nyl. ### Remarks null
{ "content_hash": "34fffa0da09d49e7ba1907c4b7e2535b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 11, "alnum_prop": 0.7132867132867133, "repo_name": "mdoering/backbone", "id": "7ffbf579b04cb6b9240cee43173dd516cbcaf069", "size": "206", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Lecanoromycetes/Ostropales/Thelotremataceae/Thelotrema/Thelotrema dodecamerum/ Syn. Ascidium discolor dodecamerum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#ifndef _GIFABSTRACTDATASET_H_INCLUDED #define _GIFABSTRACTDATASET_H_INCLUDED #include "gdal_pam.h" CPL_C_START #include "gif_lib.h" CPL_C_END /************************************************************************/ /* ==================================================================== */ /* GIFAbstractDataset */ /* ==================================================================== */ /************************************************************************/ class GIFAbstractDataset : public GDALPamDataset { protected: VSILFILE *fp; GifFileType *hGifFile; char *pszProjection; int bGeoTransformValid; double adfGeoTransform[6]; int nGCPCount; GDAL_GCP *pasGCPList; int bHasReadXMPMetadata; void CollectXMPMetadata(); void DetectGeoreferencing( GDALOpenInfo * poOpenInfo ); public: GIFAbstractDataset(); ~GIFAbstractDataset(); virtual const char *GetProjectionRef(); virtual CPLErr GetGeoTransform( double * ); virtual int GetGCPCount(); virtual const char *GetGCPProjection(); virtual const GDAL_GCP *GetGCPs(); virtual char **GetMetadata( const char * pszDomain = "" ); static int Identify( GDALOpenInfo * ); }; #endif
{ "content_hash": "17ed639fd8cd506b22db9a73de039375", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 74, "avg_line_length": 25.9811320754717, "alnum_prop": 0.4720406681190995, "repo_name": "TUW-GEO/OGRSpatialRef3D", "id": "2c640915e329881de42325e32185cd7050fc9f19", "size": "2974", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gdal-1.10.0/frmts/gif/gifabstractdataset.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "9944221" }, { "name": "C#", "bytes": "134293" }, { "name": "C++", "bytes": "33482636" }, { "name": "IDL", "bytes": "68" }, { "name": "Java", "bytes": "741034" }, { "name": "Objective-C", "bytes": "42440" }, { "name": "OpenEdge ABL", "bytes": "28024" }, { "name": "PHP", "bytes": "106999" }, { "name": "Perl", "bytes": "41158" }, { "name": "Python", "bytes": "904411" }, { "name": "Shell", "bytes": "592442" }, { "name": "TeX", "bytes": "344" }, { "name": "Visual Basic", "bytes": "49037" } ], "symlink_target": "" }
set -e PARENTDIR=$(pwd) ARCH=`uname -m` function getProxyHost { ADDR=${1#*://} echo ${ADDR%:*} } function getProxyPort { ADDR=${1#*://} echo ${ADDR#*:} } [ -n "$http_proxy" ] && JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=$(getProxyHost $http_proxy) -Dhttp.proxyPort=$(getProxyPort $http_proxy)" [ -n "$https_proxy" ] && JAVA_OPTS="$JAVA_OPTS -Dhttps.proxyHost=$(getProxyHost $https_proxy) -Dhttps.proxyPort=$(getProxyPort $https_proxy)" [ -n "$HTTP_PROXY" ] && JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyHost=$(getProxyHost $HTTP_PROXY) -Dhttp.proxyPort=$(getProxyPort $HTTP_PROXY)" [ -n "$HTTPS_PROXY" ] && JAVA_OPTS="$JAVA_OPTS -Dhttps.proxyHost=$(getProxyHost $HTTPS_PROXY) -Dhttps.proxyPort=$(getProxyPort $HTTPS_PROXY)" export JAVA_OPTS if [ x$ARCH == xx86_64 ] then gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle clean gradle -q -b ${PARENTDIR}/core/chaincode/shim/java/build.gradle build else echo "FIXME: Java Shim code needs work on ppc64le and s390x." echo "Commenting it for now." fi
{ "content_hash": "e5eb2b07bd23aa0dd3d3ccf1aa953254", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 141, "avg_line_length": 36.67857142857143, "alnum_prop": 0.6815968841285297, "repo_name": "christo4ferris/fabric-docs", "id": "a37300c68533dc47ceaf8e245e7d6287ea7200a1", "size": "1630", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/chaincode/shim/java/javabuild.sh", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "383" }, { "name": "Gherkin", "bytes": "99203" }, { "name": "Go", "bytes": "1977486" }, { "name": "HTML", "bytes": "3077" }, { "name": "Java", "bytes": "79867" }, { "name": "Makefile", "bytes": "14004" }, { "name": "Protocol Buffer", "bytes": "62304" }, { "name": "Python", "bytes": "91354" }, { "name": "Ruby", "bytes": "3259" }, { "name": "Shell", "bytes": "27804" } ], "symlink_target": "" }
from getpass import getpass import glob import logging import os from optparse import make_option from django.core.management.base import BaseCommand from django.db.models import get_apps from eulfedora.server import Repository from eulfedora.models import ContentModel, DigitalObject from eulfedora.util import RequestFailed logger = logging.getLogger(__name__) class Command(BaseCommand): def get_password_option(option, opt, value, parser): setattr(parser.values, option.dest, getpass()) help = """Generate missing Fedora content model objects and load initial objects.""" option_list = BaseCommand.option_list + ( make_option('--username', '-u', dest='username', action='store', help='''Username to connect to fedora'''), make_option('--password', dest='password', action='callback', callback=get_password_option, help='''Prompt for password required when username used'''), ) def __init__(self, *args, **kwargs): super(Command, self).__init__(*args, **kwargs) def handle(self, *args, **options): repo_args = {} if options.get('username') is not None: repo_args['username'] = options.get('username') if options.get('password') is not None: repo_args['password'] = options.get('password') self.repo = Repository(**repo_args) self.verbosity = int(options.get('verbosity', 1)) # FIXME/TODO: add count/summary info for content models objects created ? if self.verbosity > 1: print "Generating content models for %d classes" % len(DigitalObject.defined_types) for cls in DigitalObject.defined_types.itervalues(): self.process_class(cls) self.load_initial_objects() def process_class(self, cls): try: ContentModel.for_class(cls, self.repo) except ValueError, v: # for_class raises a ValueError when a class has >1 # CONTENT_MODELS. if self.verbosity > 1: print v except RequestFailed, rf: if hasattr(rf, 'detail'): if 'ObjectExistsException' in rf.detail: # This shouldn't happen, since ContentModel.for_class # shouldn't attempt to ingest unless the object doesn't exist. # In some cases, Fedora seems to report that an object doesn't exist, # then complain on attempted ingest. full_name = '%s.%s' % (cls.__module__, cls.__name__) logger.warn('Fedora error (ObjectExistsException) on Content Model ingest for %s' % \ full_name) else: # if there is a detail message, display that print "Error ingesting ContentModel for %s: %s" % (cls, rf.detail) def load_initial_objects(self): # look for any .xml files in apps under fixtures/initial_objects # and attempt to load them as Fedora objects # NOTE! any fixtures should have pids specified, or new versions of the # fixture will be created every time syncrepo runs app_module_paths = [] # monkey see django code, monkey do for app in get_apps(): if hasattr(app, '__path__'): # It's a 'models/' subpackage for path in app.__path__: app_module_paths.append(path) else: # It's a models.py module app_module_paths.append(app.__file__) app_fixture_paths = [os.path.join(os.path.dirname(path), 'fixtures', 'initial_objects', '*.xml') for path in app_module_paths] fixture_count = 0 load_count = 0 for path in app_fixture_paths: fixtures = glob.iglob(path) for f in fixtures: # FIXME: is there a sane, sensible way to shorten file path for error/success messages? fixture_count += 1 with open(f) as fixture_data: # rather than pulling PID from fixture and checking if it already exists, # just ingest and catch appropriate excetions try: pid = self.repo.ingest(fixture_data.read(), "loaded from fixture") if self.verbosity > 1: print "Loaded fixture %s as %s" % (f, pid) load_count += 1 except RequestFailed, rf: if hasattr(rf, 'detail'): if 'ObjectExistsException' in rf.detail or \ 'already exists in the registry; the object can\'t be re-created' in rf.detail: if self.verbosity > 1: print "Fixture %s has already been loaded" % f elif 'ObjectValidityException' in rf.detail: # could also look for: fedora.server.errors.ValidationException # (e.g., RELS-EXT about does not match pid) print "Error: fixture %s is not a valid Repository object" % f else: # if there is at least a detail message, display that print "Error ingesting %s: %s" % (f, rf.detail) else: raise rf # summarize what was actually done if self.verbosity > 0: if fixture_count == 0: print "No fixtures found" else: print "Loaded %d object(s) from %d fixture(s)" % (load_count, fixture_count)
{ "content_hash": "d8a83f8f882dd21d7792d0985f21a1f4", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 109, "avg_line_length": 41.69718309859155, "alnum_prop": 0.539435906096943, "repo_name": "WSULib/eulfedora", "id": "380e10c88ed2c4cfdc4f247d479ff3ab34f41ccc", "size": "6588", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "eulfedora/management/commands/syncrepo.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "511492" } ], "symlink_target": "" }
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[ [TestAction.create_mini_vm, 'vm1', 'cluster=cluster2'], [TestAction.destroy_vm, 'vm1'], [TestAction.recover_vm, 'vm1'], [TestAction.create_mini_vm, 'vm2', 'cluster=cluster1'], [TestAction.create_vm_backup, 'vm2', 'vm2-backup1'], [TestAction.create_mini_vm, 'vm3', 'cluster=cluster1'], [TestAction.stop_vm, 'vm3'], [TestAction.start_vm, 'vm3'], [TestAction.start_vm, 'vm1'], [TestAction.migrate_vm, 'vm1'], [TestAction.poweroff_only, 'cluster=cluster2'], [TestAction.create_volume, 'volume1', 'cluster=cluster2', 'flag=scsi'], [TestAction.attach_volume, 'vm1', 'volume1'], [TestAction.create_volume, 'volume2', 'cluster=cluster1', 'flag=scsi'], [TestAction.delete_volume, 'volume2'], [TestAction.add_image, 'image1', 'root', 'http://172.20.1.28/mirror/diskimages/centos_vdbench.qcow2'], [TestAction.create_volume, 'volume3', 'cluster=cluster1', 'flag=scsi'], [TestAction.attach_volume, 'vm2', 'volume3'], [TestAction.create_volume_backup, 'volume3', 'volume3-backup2'], [TestAction.delete_volume_backup, 'volume3-backup2'], [TestAction.delete_image, 'image1'], [TestAction.recover_image, 'image1'], [TestAction.delete_image, 'image1'], [TestAction.expunge_image, 'image1'], [TestAction.create_volume, 'volume4', 'cluster=cluster2', 'flag=scsi'], [TestAction.attach_volume, 'vm1', 'volume4'], [TestAction.start_vm, 'vm1'], [TestAction.create_volume_backup, 'volume4', 'volume4-backup3'], [TestAction.stop_vm, 'vm1'], [TestAction.change_vm_ha, 'vm1'], [TestAction.poweroff_only, 'cluster=cluster1'], [TestAction.create_image_from_volume, 'vm3', 'vm3-image2'], [TestAction.detach_volume, 'volume4'], [TestAction.create_volume, 'volume5', 'cluster=cluster2', 'flag=thin,scsi'], [TestAction.use_volume_backup, 'volume4-backup3'], [TestAction.start_vm, 'vm2'], [TestAction.delete_volume, 'volume3'], [TestAction.expunge_volume, 'volume3'], [TestAction.destroy_vm, 'vm3'], [TestAction.attach_volume, 'vm1', 'volume4'], [TestAction.create_volume_backup, 'volume4', 'volume4-backup4'], [TestAction.migrate_vm, 'vm1'], [TestAction.poweroff_only, 'cluster=cluster2'], [TestAction.stop_vm, 'vm2'], [TestAction.use_vm_backup, 'vm2-backup1'], [TestAction.start_vm, 'vm2'], ]) ''' The final status: Running:['vm1', 'vm2'] Stopped:[] Enadbled:['vm2-backup1', 'volume4-backup3', 'volume4-backup4', 'vm3-image2'] attached:['volume1', 'volume4'] Detached:['volume5'] Deleted:['vm3', 'volume2', 'volume3-backup2'] Expunged:['volume3', 'image1'] Ha:['vm1'] Group: vm_backup1:['vm2-backup1']---vm2@ '''
{ "content_hash": "eee2239fdaddd35664f1bc7eb9d46b0d", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 104, "avg_line_length": 39.68571428571428, "alnum_prop": 0.6911447084233261, "repo_name": "zstackio/zstack-woodpecker", "id": "16e12186074f9e448dd4a696e83ac679ed5093df", "size": "2778", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "integrationtest/vm/mini/multiclusters/paths/multi_path270.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2356" }, { "name": "Go", "bytes": "49822" }, { "name": "Makefile", "bytes": "687" }, { "name": "Puppet", "bytes": "875" }, { "name": "Python", "bytes": "13070596" }, { "name": "Shell", "bytes": "177861" } ], "symlink_target": "" }
<?php namespace ESS\AdminBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DefaultControllerTest extends WebTestCase { public function testIndex() { $client = static::createClient(); $crawler = $client->request('GET', '/hello/Fabien'); $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); } }
{ "content_hash": "6c971335f861bec6d550e7f2ee9b78aa", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 90, "avg_line_length": 23.41176470588235, "alnum_prop": 0.6733668341708543, "repo_name": "sudinem/symfony", "id": "43da3a37879b64ae7a8601bebac816c537bdcbdf", "size": "398", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ESS/AdminBundle/Tests/Controller/DefaultControllerTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "17920" }, { "name": "PHP", "bytes": "67515" } ], "symlink_target": "" }
<!doctype html> <html class="theme-next muse use-motion"> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" /> <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"> <link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" /> <link href="/css/main.css?v=5.0.2" rel="stylesheet" type="text/css" /> <meta name="keywords" content="Canux, CHENG, Python, Linux, Django, Shell" /> <link rel="alternate" href="/atom.xml" title="Canux's Blog" type="application/atom+xml" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.2" /> <meta name="description" content="Shell/PowerShell、Vim/Git/Tmux"> <meta property="og:type" content="website"> <meta property="og:title" content="Canux's Blog"> <meta property="og:url" content="http://canuxcheng.com/tags/Java/index.html"> <meta property="og:site_name" content="Canux's Blog"> <meta property="og:description" content="Shell/PowerShell、Vim/Git/Tmux"> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="Canux's Blog"> <meta name="twitter:description" content="Shell/PowerShell、Vim/Git/Tmux"> <script type="text/javascript" id="hexo.configuration"> var NexT = window.NexT || {}; var CONFIG = { scheme: 'Muse', sidebar: {"position":"left","display":"post"}, fancybox: true, motion: true, duoshuo: { userId: '0', author: 'Author' } }; </script> <link rel="canonical" href="http://canuxcheng.com/tags/Java/"/> <title> Tag: Java | Canux's Blog </title> </head> <body itemscope itemtype="//schema.org/WebPage" lang="en"> <div style="display: none;"> <script src="//s95.cnzz.com/z_stat.php?id=1258132457&web_id=1258132457" language="JavaScript"></script> </div> <div class="container one-collumn sidebar-position-left "> <div class="headband"></div> <header id="header" class="header" itemscope itemtype="//schema.org/WPHeader"> <div class="header-inner"><div class="site-meta "> <div class="custom-logo-site-title"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <span class="site-title">Canux's Blog</span> <span class="logo-line-after"><i></i></span> </a> </div> <p class="site-subtitle">DevOps Software/Architect Engineer</p> </div> <div class="site-nav-toggle"> <button> <span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span> </button> </div> <nav class="site-nav"> <ul id="menu" class="menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"> <i class="menu-item-icon fa fa-fw fa-home"></i> <br /> Home </a> </li> <li class="menu-item menu-item-about"> <a href="/about" rel="section"> <i class="menu-item-icon fa fa-fw fa-user"></i> <br /> About </a> </li> <li class="menu-item menu-item-categories"> <a href="/categories" rel="section"> <i class="menu-item-icon fa fa-fw fa-th"></i> <br /> Categories </a> </li> <li class="menu-item menu-item-tags"> <a href="/tags" rel="section"> <i class="menu-item-icon fa fa-fw fa-tags"></i> <br /> Tags </a> </li> <li class="menu-item menu-item-archives"> <a href="/archives" rel="section"> <i class="menu-item-icon fa fa-fw fa-archive"></i> <br /> Archives </a> </li> <li class="menu-item menu-item-schedule"> <a href="/schedule" rel="section"> <i class="menu-item-icon fa fa-fw fa-calendar"></i> <br /> Schedule </a> </li> <li class="menu-item menu-item-search"> <a href="javascript:;" class="st-search-show-outputs"> <i class="menu-item-icon fa fa-search fa-fw"></i> <br /> Search </a> </li> </ul> <div class="site-search"> <form class="site-search-form"> <input type="text" id="st-search-input" class="st-search-input st-default-search-input" /> </form> <script type="text/javascript"> (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){ (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t); e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e); })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st'); _st('install', 'xGAKY5LyK8xDYvH9zzcX','2.0.0'); </script> </div> </nav> </div> </header> <main id="main" class="main"> <div class="main-inner"> <div class="content-wrap"> <div id="content" class="content"> <div id="posts" class="posts-collapse"> <div class="collection-title"> <h2 > Java <small>Tag</small> </h2> </div> <article class="post post-type-normal" itemscope itemtype="//schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/07/10/Java之java.math/" itemprop="url"> <span itemprop="name">Java之java.math</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-07-10T17:50:10+08:00" content="2016-07-10" > 07-10 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="//schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/04/02/Java总结/" itemprop="url"> <span itemprop="name">Java总结</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-04-03T10:49:13+08:00" content="2016-04-03" > 04-03 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="//schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/04/02/Java编程/" itemprop="url"> <span itemprop="name">Java编程</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-04-03T10:49:07+08:00" content="2016-04-03" > 04-03 </time> </div> </header> </article> <article class="post post-type-normal" itemscope itemtype="//schema.org/Article"> <header class="post-header"> <h1 class="post-title"> <a class="post-title-link" href="/2016/04/02/Java编程之面向对象/" itemprop="url"> <span itemprop="name">Java编程之面向对象</span> </a> </h1> <div class="post-meta"> <time class="post-time" itemprop="dateCreated" datetime="2016-04-03T10:49:07+08:00" content="2016-04-03" > 04-03 </time> </div> </header> </article> </div> </div> </div> <div class="sidebar-toggle"> <div class="sidebar-toggle-line-wrap"> <span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span> </div> </div> <aside id="sidebar" class="sidebar"> <div class="sidebar-inner"> <section class="site-overview sidebar-panel sidebar-panel-active "> <div class="site-author motion-element" itemprop="author" itemscope itemtype="//schema.org/Person"> <img class="site-author-image" itemprop="image" src="/uploads/avatar.jpg" alt="Canux CHENG" /> <p class="site-author-name" itemprop="name">Canux CHENG</p> <p class="site-description motion-element" itemprop="description">Shell/PowerShell、Vim/Git/Tmux</p> </div> <nav class="site-state motion-element"> <div class="site-state-item site-state-posts"> <a href="/archives"> <span class="site-state-item-count">133</span> <span class="site-state-item-name">posts</span> </a> </div> <div class="site-state-item site-state-categories"> <a href="/categories"> <span class="site-state-item-count">32</span> <span class="site-state-item-name">categories</span> </a> </div> <div class="site-state-item site-state-tags"> <a href="/tags"> <span class="site-state-item-count">138</span> <span class="site-state-item-name">tags</span> </a> </div> </nav> <div class="feed-link motion-element"> <a href="/atom.xml" rel="alternate"> <i class="fa fa-rss"></i> RSS </a> </div> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/crazy-canux" target="_blank" title="GitHub"> <i class="fa fa-fw fa-github"></i> GitHub </a> </span> <span class="links-of-author-item"> <a href="http://stackoverflow.com/users/4344009/canux" target="_blank" title="Stackoverflow"> <i class="fa fa-fw fa-globe"></i> Stackoverflow </a> </span> <span class="links-of-author-item"> <a href="http://www.linkedin.com/profile/preview?locale=zh_CN&trk=prof-0-sb-preview-primary-button" target="_blank" title="LinkedIn"> <i class="fa fa-fw fa-linkedin"></i> LinkedIn </a> </span> <span class="links-of-author-item"> <a href="mailto:canuxcheng@gmail.com" target="_blank" title="E-mail"> <i class="fa fa-fw fa-envelope"></i> E-mail </a> </span> </div> <div class="cc-license motion-element" itemprop="license"> <a href="https://creativecommons.org/publicdomain/zero/1.0/" class="cc-opacity" target="_blank"> <img src="/images/cc-zero.svg" alt="Creative Commons" /> </a> </div> <div class="links-of-blogroll motion-element links-of-blogroll-inline"> <div class="links-of-blogroll-title"> <i class="fa fa-fw fa-globe"></i> Links </div> <ul class="links-of-blogroll-list"> <li class="links-of-blogroll-item"> <a href="http://bbs.csdn.net/home" title="CSDN" target="_blank">CSDN</a> </li> <li class="links-of-blogroll-item"> <a href="http://bbs.51cto.com/" title="51CTO" target="_blank">51CTO</a> </li> <li class="links-of-blogroll-item"> <a href="http://bbs.chinaunix.net/" title="ChinaUnix" target="_blank">ChinaUnix</a> </li> <li class="links-of-blogroll-item"> <a href="http://www.itpub.net/forum.php" title="ITPUB" target="_blank">ITPUB</a> </li> </ul> </div> </section> </div> </aside> </div> </main> <footer id="footer" class="footer"> <div class="footer-inner"> <div class="copyright" > &copy; 2013 - <span itemprop="copyrightYear">2017</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">Canux CHENG</span> </div> <div class="powered-by"> Powered by <a class="theme-link" href="https://hexo.io">Hexo</a> </div> <div class="theme-info"> Theme - <a class="theme-link" href="https://github.com/crazy-canux/hexo-theme-canux"> NexT.Muse </a> </div> </div> </footer> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> </div> </div> <script type="text/javascript"> if (Object.prototype.toString.call(window.Promise) !== '[object Function]') { window.Promise = null; } </script> <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script> <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script> <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script> <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script> <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script> <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script> <script type="text/javascript" src="/js/src/utils.js?v=5.0.2"></script> <script type="text/javascript" src="/js/src/motion.js?v=5.0.2"></script> <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.2"></script> <script type="text/javascript"> var duoshuoQuery = {short_name:"crazy-canux"}; (function() { var ds = document.createElement('script'); ds.type = 'text/javascript';ds.async = true; ds.id = 'duoshuo-script'; ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; ds.charset = 'UTF-8'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds); })(); </script> <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script> <script src="/js/src/hook-duoshuo.js"></script> </body> </html>
{ "content_hash": "7531a7270ad78ccd0901392ce7d52ba7", "timestamp": "", "source": "github", "line_count": 711, "max_line_length": 154, "avg_line_length": 22.29957805907173, "alnum_prop": 0.511510564490697, "repo_name": "crazy-canux/blog_hexo", "id": "350f6c45191b3f4f949d780713a73d58574aa27c", "size": "15911", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/tags/Java/index.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "55591" }, { "name": "HTML", "bytes": "7486057" }, { "name": "JavaScript", "bytes": "339608" } ], "symlink_target": "" }
package net.canadensys; import net.canadensys.harvester.main.JobInitiatorMain; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.apache.commons.cli.PosixParser; public class Main { /** * Haverster entry point * * @param args */ public static void main(String[] args) { Options cmdLineOptions = new Options(); cmdLineOptions.addOption("brokerip", true, "Override ActiveMQ broker URL"); CommandLineParser parser = new PosixParser(); CommandLine cmdLine = null; try { cmdLine = parser.parse(cmdLineOptions, args); } catch (ParseException e) { System.out.println(e.getMessage()); } if (cmdLine != null) { String brokerIpAddress = cmdLine.getOptionValue("brokerip"); JobInitiatorMain.main(brokerIpAddress); } } }
{ "content_hash": "aea11dae8090ac061c1553a4342d187b", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 77, "avg_line_length": 24.88888888888889, "alnum_prop": 0.7366071428571429, "repo_name": "WingLongitude/lontra-harvester", "id": "e7279b22afe30d2108ec0b6df4ad9748ae38ac04", "size": "896", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lontra-harvester-ui/src/main/java/net/canadensys/Main.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "532840" } ], "symlink_target": "" }
import { async, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { HomeBlocComponent } from './home.component'; describe('MainViewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [RouterTestingModule], declarations: [ HomeBlocComponent, ], }).compileComponents(); })); it('should create the Main View Module', async(() => { const fixture = TestBed.createComponent(HomeBlocComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); })); });
{ "content_hash": "551e18c1c5f730eb5e156f4967854ed4", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 63, "avg_line_length": 34.666666666666664, "alnum_prop": 0.6730769230769231, "repo_name": "BaylyConsulting/alloycycles-public", "id": "05fbbacd4b40ead973cf8ac359041f526bbf85ad", "size": "624", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/home.bloc/home.component.spec.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2587" }, { "name": "HTML", "bytes": "3517" }, { "name": "JavaScript", "bytes": "2353" }, { "name": "TypeScript", "bytes": "9242" } ], "symlink_target": "" }
import path from 'path'; const repoRoot = path.resolve(__dirname, '../../'); const srcRoot = path.join(repoRoot, 'src/'); const builtRoot = path.join(repoRoot, 'built/'); export { repoRoot, srcRoot, builtRoot };
{ "content_hash": "f66d86eb5deb751187e88176fd6c997c", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 51, "avg_line_length": 18.416666666666668, "alnum_prop": 0.6561085972850679, "repo_name": "joemcbride/react-starter-kit-app", "id": "764b3f48ee73bb0e700d388dffb39d5f76c4da3d", "size": "221", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/constants.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "35" }, { "name": "JavaScript", "bytes": "6639" } ], "symlink_target": "" }
extern ICoreSystem* g_pCoreSystem; using namespace GLRenderingSystemNS; INNO_PRIVATE_SCOPE GLFinalRenderingPassUtilities { void initializeSkyPass(); void bindSkyPassUniformLocations(); void initializeTAAPass(); void bindTAAPassUniformLocations(); void initializeBloomExtractPass(); void bindBloomExtractPassUniformLocations(); void initializeBloomBlurPass(); void bindBloomBlurPassUniformLocations(); void initializeMotionBlurPass(); void bindMotionBlurUniformLocations(); void initializeBillboardPass(); void bindBillboardPassUniformLocations(); void initializeDebuggerPass(); void bindDebuggerPassUniformLocations(); void initializeFinalBlendPass(); void bindFinalBlendPassUniformLocations(); GLTextureDataComponent* updateSkyPass(); GLTextureDataComponent* updatePreTAAPass(); GLTextureDataComponent* updateTAAPass(GLTextureDataComponent* inputGLTDC); GLTextureDataComponent* updateTAASharpenPass(GLTextureDataComponent* inputGLTDC); GLTextureDataComponent* updateBloomExtractPass(GLTextureDataComponent* inputGLTDC); GLTextureDataComponent* updateBloomBlurPass(GLTextureDataComponent* inputGLTDC); GLTextureDataComponent* updateMotionBlurPass(GLTextureDataComponent * inputGLTDC); GLTextureDataComponent* updateBillboardPass(); GLTextureDataComponent* updateDebuggerPass(); GLTextureDataComponent* updateFinalBlendPass(GLTextureDataComponent * inputGLTDC); EntityID m_entityID; } void GLFinalRenderingPassUtilities::initialize() { m_entityID = InnoMath::createEntityID(); initializeSkyPass(); initializeTAAPass(); initializeBloomExtractPass(); initializeBloomBlurPass(); initializeMotionBlurPass(); initializeBillboardPass(); initializeDebuggerPass(); initializeFinalBlendPass(); } void GLFinalRenderingPassUtilities::initializeSkyPass() { GLFinalRenderPassComponent::get().m_skyPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // shader programs and shaders auto rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_skyPassShaderFilePaths); GLFinalRenderPassComponent::get().m_skyPassGLSPC = rhs; bindSkyPassUniformLocations(); } void GLFinalRenderingPassUtilities::bindSkyPassUniformLocations() { GLFinalRenderPassComponent::get().m_skyPass_uni_p = getUniformLocation( GLFinalRenderPassComponent::get().m_skyPassGLSPC->m_program, "uni_p"); GLFinalRenderPassComponent::get().m_skyPass_uni_r = getUniformLocation( GLFinalRenderPassComponent::get().m_skyPassGLSPC->m_program, "uni_r"); GLFinalRenderPassComponent::get().m_skyPass_uni_viewportSize = getUniformLocation( GLFinalRenderPassComponent::get().m_skyPassGLSPC->m_program, "uni_viewportSize"); GLFinalRenderPassComponent::get().m_skyPass_uni_eyePos = getUniformLocation( GLFinalRenderPassComponent::get().m_skyPassGLSPC->m_program, "uni_eyePos"); GLFinalRenderPassComponent::get().m_skyPass_uni_lightDir = getUniformLocation( GLFinalRenderPassComponent::get().m_skyPassGLSPC->m_program, "uni_lightDir"); } void GLFinalRenderingPassUtilities::initializeTAAPass() { // pre mix pass GLFinalRenderPassComponent::get().m_preTAAPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // Ping pass GLFinalRenderPassComponent::get().m_TAAPingPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // Pong pass GLFinalRenderPassComponent::get().m_TAAPongPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // Sharpen pass GLFinalRenderPassComponent::get().m_TAASharpenPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // shader programs and shaders // pre mix pass auto rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_preTAAPassShaderFilePaths); GLFinalRenderPassComponent::get().m_preTAAPassGLSPC = rhs; // TAA pass rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_TAAPassShaderFilePaths); GLFinalRenderPassComponent::get().m_TAAPassGLSPC = rhs; // Sharpen pass rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_TAASharpenPassShaderFilePaths); GLFinalRenderPassComponent::get().m_TAASharpenPassGLSPC = rhs; bindTAAPassUniformLocations(); } void GLFinalRenderingPassUtilities::bindTAAPassUniformLocations() { updateTextureUniformLocations(GLFinalRenderPassComponent::get().m_preTAAPassGLSPC->m_program, GLFinalRenderPassComponent::get().m_preTAAPassUniformNames); updateTextureUniformLocations(GLFinalRenderPassComponent::get().m_TAAPassGLSPC->m_program, GLFinalRenderPassComponent::get().m_TAAPassUniformNames); } void GLFinalRenderingPassUtilities::initializeBloomExtractPass() { GLFinalRenderPassComponent::get().m_bloomExtractPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // shader programs and shaders auto rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_bloomExtractPassShaderFilePaths); GLFinalRenderPassComponent::get().m_bloomExtractPassGLSPC = rhs; bindBloomExtractPassUniformLocations(); } void GLFinalRenderingPassUtilities::bindBloomExtractPassUniformLocations() { updateTextureUniformLocations(GLFinalRenderPassComponent::get().m_bloomExtractPassGLSPC->m_program, GLFinalRenderPassComponent::get().m_bloomExtractPassUniformNames); } void GLFinalRenderingPassUtilities::initializeBloomBlurPass() { //Ping pass GLFinalRenderPassComponent::get().m_bloomBlurPingPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); //Pong pass GLFinalRenderPassComponent::get().m_bloomBlurPongPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // shader programs and shaders auto rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_bloomBlurPassShaderFilePaths); GLFinalRenderPassComponent::get().m_bloomBlurPassGLSPC = rhs; bindBloomBlurPassUniformLocations(); } void GLFinalRenderingPassUtilities::bindBloomBlurPassUniformLocations() { updateTextureUniformLocations(GLFinalRenderPassComponent::get().m_bloomBlurPassGLSPC->m_program, GLFinalRenderPassComponent::get().m_bloomBlurPassUniformNames); GLFinalRenderPassComponent::get().m_bloomBlurPass_uni_horizontal = getUniformLocation( GLFinalRenderPassComponent::get().m_bloomBlurPassGLSPC->m_program, "uni_horizontal"); } void GLFinalRenderingPassUtilities::initializeMotionBlurPass() { GLFinalRenderPassComponent::get().m_motionBlurPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // shader programs and shaders auto rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_motionBlurPassShaderFilePaths); GLFinalRenderPassComponent::get().m_motionBlurPassGLSPC = rhs; bindMotionBlurUniformLocations(); } void GLFinalRenderingPassUtilities::bindMotionBlurUniformLocations() { updateTextureUniformLocations(GLFinalRenderPassComponent::get().m_motionBlurPassGLSPC->m_program, GLFinalRenderPassComponent::get().m_motionBlurPassUniformNames); } void GLFinalRenderingPassUtilities::initializeBillboardPass() { GLFinalRenderPassComponent::get().m_billboardPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // shader programs and shaders auto rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_billboardPassShaderFilePaths); GLFinalRenderPassComponent::get().m_billboardPassGLSPC = rhs; bindBillboardPassUniformLocations(); } void GLFinalRenderingPassUtilities::bindBillboardPassUniformLocations() { updateTextureUniformLocations(GLFinalRenderPassComponent::get().m_billboardPassGLSPC->m_program, GLFinalRenderPassComponent::get().m_billboardPassUniformNames); GLFinalRenderPassComponent::get().m_billboardPass_uni_p = getUniformLocation( GLFinalRenderPassComponent::get().m_billboardPassGLSPC->m_program, "uni_p"); GLFinalRenderPassComponent::get().m_billboardPass_uni_r = getUniformLocation( GLFinalRenderPassComponent::get().m_billboardPassGLSPC->m_program, "uni_r"); GLFinalRenderPassComponent::get().m_billboardPass_uni_t = getUniformLocation( GLFinalRenderPassComponent::get().m_billboardPassGLSPC->m_program, "uni_t"); GLFinalRenderPassComponent::get().m_billboardPass_uni_pos = getUniformLocation( GLFinalRenderPassComponent::get().m_billboardPassGLSPC->m_program, "uni_pos"); GLFinalRenderPassComponent::get().m_billboardPass_uni_size = getUniformLocation( GLFinalRenderPassComponent::get().m_billboardPassGLSPC->m_program, "uni_size"); } void GLFinalRenderingPassUtilities::initializeDebuggerPass() { GLFinalRenderPassComponent::get().m_debuggerPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // shader programs and shaders auto rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_debuggerPassShaderFilePaths); GLFinalRenderPassComponent::get().m_debuggerPassGLSPC = rhs; bindDebuggerPassUniformLocations(); } void GLFinalRenderingPassUtilities::bindDebuggerPassUniformLocations() { updateTextureUniformLocations(GLFinalRenderPassComponent::get().m_debuggerPassGLSPC->m_program, GLFinalRenderPassComponent::get().m_debuggerPassUniformNames); GLFinalRenderPassComponent::get().m_debuggerPass_uni_p = getUniformLocation( GLFinalRenderPassComponent::get().m_debuggerPassGLSPC->m_program, "uni_p"); GLFinalRenderPassComponent::get().m_debuggerPass_uni_r = getUniformLocation( GLFinalRenderPassComponent::get().m_debuggerPassGLSPC->m_program, "uni_r"); GLFinalRenderPassComponent::get().m_debuggerPass_uni_t = getUniformLocation( GLFinalRenderPassComponent::get().m_debuggerPassGLSPC->m_program, "uni_t"); GLFinalRenderPassComponent::get().m_debuggerPass_uni_m = getUniformLocation( GLFinalRenderPassComponent::get().m_debuggerPassGLSPC->m_program, "uni_m"); } void GLFinalRenderingPassUtilities::initializeFinalBlendPass() { GLFinalRenderPassComponent::get().m_finalBlendPassGLRPC = addGLRenderPassComponent(1, GLRenderingSystemComponent::get().deferredPassFBDesc, GLRenderingSystemComponent::get().deferredPassTextureDesc); // shader programs and shaders auto rhs = addGLShaderProgramComponent(m_entityID); initializeGLShaderProgramComponent(rhs, GLFinalRenderPassComponent::get().m_finalBlendPassShaderFilePaths); GLFinalRenderPassComponent::get().m_finalBlendPassGLSPC = rhs; bindFinalBlendPassUniformLocations(); } void GLFinalRenderingPassUtilities::bindFinalBlendPassUniformLocations() { updateTextureUniformLocations(GLFinalRenderPassComponent::get().m_finalBlendPassGLSPC->m_program, GLFinalRenderPassComponent::get().m_finalBlendPassUniformNames); } void GLFinalRenderingPassUtilities::update() { auto skyPassResult = updateSkyPass(); auto preTAAPassResult = updatePreTAAPass(); GLTextureDataComponent* finalInputGLTDC; finalInputGLTDC = updateMotionBlurPass(preTAAPassResult); if (RenderingSystemComponent::get().m_useTAA) { auto TAAPassResult = updateTAAPass(finalInputGLTDC); finalInputGLTDC = updateTAASharpenPass(TAAPassResult); } if (RenderingSystemComponent::get().m_useBloom) { auto bloomExtractPassResult = updateBloomExtractPass(finalInputGLTDC); //glEnable(GL_STENCIL_TEST); //glClear(GL_STENCIL_BUFFER_BIT); //glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); //glStencilFunc(GL_EQUAL, 0x02, 0xFF); //glStencilMask(0x00); //copyColorBuffer(GLLightRenderPassComponent::get().m_GLRPC->m_GLFBC, // GLFinalRenderPassComponent::get().m_bloomExtractPassGLRPC->m_GLFBC); //glDisable(GL_STENCIL_TEST); updateBloomBlurPass(bloomExtractPassResult); } else { cleanFBC(GLFinalRenderPassComponent::get().m_bloomExtractPassGLRPC->m_GLFBC); cleanFBC(GLFinalRenderPassComponent::get().m_bloomBlurPingPassGLRPC->m_GLFBC); cleanFBC(GLFinalRenderPassComponent::get().m_bloomBlurPongPassGLRPC->m_GLFBC); } updateBillboardPass(); if (RenderingSystemComponent::get().m_drawOverlapWireframe) { updateDebuggerPass(); } else { cleanFBC(GLFinalRenderPassComponent::get().m_debuggerPassGLRPC->m_GLFBC); } updateFinalBlendPass(finalInputGLTDC); } GLTextureDataComponent* GLFinalRenderingPassUtilities::updateSkyPass() { if (RenderingSystemComponent::get().m_drawSky) { glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); //glEnable(GL_CULL_FACE); //glFrontFace(GL_CW); //glCullFace(GL_FRONT); // bind to framebuffer auto l_FBC = GLFinalRenderPassComponent::get().m_skyPassGLRPC->m_GLFBC; bindFBC(l_FBC); activateShaderProgram(GLFinalRenderPassComponent::get().m_skyPassGLSPC); updateUniform( GLFinalRenderPassComponent::get().m_skyPass_uni_p, RenderingSystemComponent::get().m_CamProjOriginal); updateUniform( GLFinalRenderPassComponent::get().m_skyPass_uni_r, RenderingSystemComponent::get().m_CamRot); updateUniform( GLFinalRenderPassComponent::get().m_skyPass_uni_viewportSize, (float)GLRenderingSystemComponent::get().deferredPassFBDesc.sizeX, (float)GLRenderingSystemComponent::get().deferredPassFBDesc.sizeY); updateUniform( GLFinalRenderPassComponent::get().m_skyPass_uni_eyePos, RenderingSystemComponent::get().m_CamGlobalPos.x, RenderingSystemComponent::get().m_CamGlobalPos.y, RenderingSystemComponent::get().m_CamGlobalPos.z); updateUniform( GLFinalRenderPassComponent::get().m_skyPass_uni_lightDir, RenderingSystemComponent::get().m_sunDir.x, RenderingSystemComponent::get().m_sunDir.y, RenderingSystemComponent::get().m_sunDir.z); auto l_MDC = g_pCoreSystem->getAssetSystem()->getMeshDataComponent(MeshShapeType::CUBE); drawMesh(l_MDC); glDisable(GL_CULL_FACE); glDisable(GL_DEPTH_TEST); } else { cleanFBC(GLFinalRenderPassComponent::get().m_skyPassGLRPC->m_GLFBC); } return GLFinalRenderPassComponent::get().m_skyPassGLRPC->m_GLTDCs[0]; } GLTextureDataComponent* GLFinalRenderingPassUtilities::updatePreTAAPass() { auto l_FBC = GLFinalRenderPassComponent::get().m_preTAAPassGLRPC->m_GLFBC; bindFBC(l_FBC); activateShaderProgram(GLFinalRenderPassComponent::get().m_preTAAPassGLSPC); activateTexture( GLLightRenderPassComponent::get().m_GLRPC->m_GLTDCs[0], 0); activateTexture( GLGeometryRenderPassComponent::get().m_transparentPass_GLRPC->m_GLTDCs[0], 1); activateTexture( GLGeometryRenderPassComponent::get().m_transparentPass_GLRPC->m_GLTDCs[1], 2); activateTexture( GLFinalRenderPassComponent::get().m_skyPassGLRPC->m_GLTDCs[0], 3); activateTexture( GLTerrainRenderPassComponent::get().m_GLRPC->m_GLTDCs[0], 4); auto l_MDC = g_pCoreSystem->getAssetSystem()->getMeshDataComponent(MeshShapeType::QUAD); drawMesh(l_MDC); return GLFinalRenderPassComponent::get().m_preTAAPassGLRPC->m_GLTDCs[0]; } GLTextureDataComponent* GLFinalRenderingPassUtilities::updateTAAPass(GLTextureDataComponent* inputGLTDC) { GLTextureDataComponent* l_currentFrameTAAGLTDC = GLFinalRenderPassComponent::get().m_TAAPingPassGLRPC->m_GLTDCs[0]; GLTextureDataComponent* l_lastFrameTAAGLTDC = GLFinalRenderPassComponent::get().m_TAAPongPassGLRPC->m_GLTDCs[0]; activateShaderProgram(GLFinalRenderPassComponent::get().m_TAAPassGLSPC); GLFrameBufferComponent* l_FBC; if (RenderingSystemComponent::get().m_isTAAPingPass) { l_currentFrameTAAGLTDC = GLFinalRenderPassComponent::get().m_TAAPingPassGLRPC->m_GLTDCs[0]; l_lastFrameTAAGLTDC = GLFinalRenderPassComponent::get().m_TAAPongPassGLRPC->m_GLTDCs[0]; l_FBC = GLFinalRenderPassComponent::get().m_TAAPingPassGLRPC->m_GLFBC; RenderingSystemComponent::get().m_isTAAPingPass = false; } else { l_currentFrameTAAGLTDC = GLFinalRenderPassComponent::get().m_TAAPongPassGLRPC->m_GLTDCs[0]; l_lastFrameTAAGLTDC = GLFinalRenderPassComponent::get().m_TAAPingPassGLRPC->m_GLTDCs[0]; l_FBC = GLFinalRenderPassComponent::get().m_TAAPongPassGLRPC->m_GLFBC; RenderingSystemComponent::get().m_isTAAPingPass = true; } bindFBC(l_FBC); activateTexture(inputGLTDC, 0); activateTexture( l_lastFrameTAAGLTDC, 1); activateTexture( GLGeometryRenderPassComponent::get().m_opaquePass_GLRPC->m_GLTDCs[3], 2); auto l_MDC = g_pCoreSystem->getAssetSystem()->getMeshDataComponent(MeshShapeType::QUAD); drawMesh(l_MDC); return l_currentFrameTAAGLTDC; } GLTextureDataComponent* GLFinalRenderingPassUtilities::updateTAASharpenPass(GLTextureDataComponent * inputGLTDC) { auto l_FBC = GLFinalRenderPassComponent::get().m_TAASharpenPassGLRPC->m_GLFBC; bindFBC(l_FBC); activateShaderProgram(GLFinalRenderPassComponent::get().m_TAASharpenPassGLSPC); activateTexture( inputGLTDC, 0); auto l_MDC = g_pCoreSystem->getAssetSystem()->getMeshDataComponent(MeshShapeType::QUAD); drawMesh(l_MDC); return GLFinalRenderPassComponent::get().m_TAASharpenPassGLRPC->m_GLTDCs[0]; } GLTextureDataComponent* GLFinalRenderingPassUtilities::updateBloomExtractPass(GLTextureDataComponent * inputGLTDC) { auto l_FBC = GLFinalRenderPassComponent::get().m_bloomExtractPassGLRPC->m_GLFBC; bindFBC(l_FBC); activateShaderProgram(GLFinalRenderPassComponent::get().m_bloomExtractPassGLSPC); activateTexture(inputGLTDC, 0); auto l_MDC = g_pCoreSystem->getAssetSystem()->getMeshDataComponent(MeshShapeType::QUAD); drawMesh(l_MDC); return GLFinalRenderPassComponent::get().m_bloomExtractPassGLRPC->m_GLTDCs[0]; } GLTextureDataComponent* GLFinalRenderingPassUtilities::updateBloomBlurPass(GLTextureDataComponent * inputGLTDC) { GLTextureDataComponent* l_currentFrameBloomBlurGLTDC = GLFinalRenderPassComponent::get().m_bloomBlurPingPassGLRPC->m_GLTDCs[0]; GLTextureDataComponent* l_lastFrameBloomBlurGLTDC = GLFinalRenderPassComponent::get().m_bloomBlurPongPassGLRPC->m_GLTDCs[0]; activateShaderProgram(GLFinalRenderPassComponent::get().m_bloomBlurPassGLSPC); bool l_isPing = true; bool l_isFirstIteration = true; auto l_MDC = g_pCoreSystem->getAssetSystem()->getMeshDataComponent(MeshShapeType::QUAD); for (size_t i = 0; i < 5; i++) { if (l_isPing) { l_currentFrameBloomBlurGLTDC = GLFinalRenderPassComponent::get().m_bloomBlurPingPassGLRPC->m_GLTDCs[0]; l_lastFrameBloomBlurGLTDC = GLFinalRenderPassComponent::get().m_bloomBlurPongPassGLRPC->m_GLTDCs[0]; auto l_FBC = GLFinalRenderPassComponent::get().m_bloomBlurPingPassGLRPC->m_GLFBC; bindFBC(l_FBC); updateUniform( GLFinalRenderPassComponent::get().m_bloomBlurPass_uni_horizontal, true); if (l_isFirstIteration) { activateTexture( inputGLTDC, 0); l_isFirstIteration = false; } else { activateTexture( l_lastFrameBloomBlurGLTDC, 0); } drawMesh(l_MDC); l_isPing = false; } else { l_currentFrameBloomBlurGLTDC = GLFinalRenderPassComponent::get().m_bloomBlurPongPassGLRPC->m_GLTDCs[0]; l_lastFrameBloomBlurGLTDC = GLFinalRenderPassComponent::get().m_bloomBlurPingPassGLRPC->m_GLTDCs[0]; auto l_FBC = GLFinalRenderPassComponent::get().m_bloomBlurPongPassGLRPC->m_GLFBC; bindFBC(l_FBC); updateUniform( GLFinalRenderPassComponent::get().m_bloomBlurPass_uni_horizontal, false); activateTexture( l_lastFrameBloomBlurGLTDC, 0); drawMesh(l_MDC); l_isPing = true; } } return l_currentFrameBloomBlurGLTDC; } GLTextureDataComponent* GLFinalRenderingPassUtilities::updateMotionBlurPass(GLTextureDataComponent * inputGLTDC) { auto l_FBC = GLFinalRenderPassComponent::get().m_motionBlurPassGLRPC->m_GLFBC; bindFBC(l_FBC); activateShaderProgram(GLFinalRenderPassComponent::get().m_motionBlurPassGLSPC); activateTexture( GLGeometryRenderPassComponent::get().m_opaquePass_GLRPC->m_GLTDCs[3], 0); activateTexture(inputGLTDC, 1); auto l_MDC = g_pCoreSystem->getAssetSystem()->getMeshDataComponent(MeshShapeType::QUAD); drawMesh(l_MDC); return GLFinalRenderPassComponent::get().m_motionBlurPassGLRPC->m_GLTDCs[0]; } GLTextureDataComponent* GLFinalRenderingPassUtilities::updateBillboardPass() { glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); auto l_FBC = GLFinalRenderPassComponent::get().m_billboardPassGLRPC->m_GLFBC; bindFBC(l_FBC); // copy depth buffer from G-Pass copyDepthBuffer(GLGeometryRenderPassComponent::get().m_opaquePass_GLRPC->m_GLFBC, l_FBC); activateShaderProgram(GLFinalRenderPassComponent::get().m_billboardPassGLSPC); updateUniform( GLFinalRenderPassComponent::get().m_billboardPass_uni_p, RenderingSystemComponent::get().m_CamProjOriginal); updateUniform( GLFinalRenderPassComponent::get().m_billboardPass_uni_r, RenderingSystemComponent::get().m_CamRot); updateUniform( GLFinalRenderPassComponent::get().m_billboardPass_uni_t, RenderingSystemComponent::get().m_CamTrans); while (GLRenderingSystemComponent::get().m_billboardPassDataQueue.size() > 0) { auto l_renderPack = GLRenderingSystemComponent::get().m_billboardPassDataQueue.front(); auto l_GlobalPos = l_renderPack.globalPos; updateUniform( GLFinalRenderPassComponent::get().m_billboardPass_uni_pos, l_GlobalPos.x, l_GlobalPos.y, l_GlobalPos.z); auto l_distanceToCamera = l_renderPack.distanceToCamera; if (l_distanceToCamera > 1.0f) { updateUniform( GLFinalRenderPassComponent::get().m_billboardPass_uni_size, (1.0f / l_distanceToCamera) * (9.0f / 16.0f), (1.0f / l_distanceToCamera)); } else { updateUniform( GLFinalRenderPassComponent::get().m_billboardPass_uni_size, (9.0f / 16.0f), 1.0f); } GLTextureDataComponent* l_iconTexture = 0; switch (l_renderPack.iconType) { case WorldEditorIconType::DIRECTIONAL_LIGHT: l_iconTexture = GLRenderingSystemComponent::get().m_iconTemplate_DirectionalLight; break; case WorldEditorIconType::POINT_LIGHT: l_iconTexture = GLRenderingSystemComponent::get().m_iconTemplate_PointLight; break; case WorldEditorIconType::SPHERE_LIGHT: l_iconTexture = GLRenderingSystemComponent::get().m_iconTemplate_SphereLight; break; default: break; } activateTexture(l_iconTexture, 0); drawMesh(6, MeshPrimitiveTopology::TRIANGLE_STRIP, GLRenderingSystemComponent::get().m_UnitQuadGLMDC); GLRenderingSystemComponent::get().m_billboardPassDataQueue.pop(); } glDisable(GL_DEPTH_TEST); return GLFinalRenderPassComponent::get().m_billboardPassGLRPC->m_GLTDCs[0]; } GLTextureDataComponent* GLFinalRenderingPassUtilities::updateDebuggerPass() { glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); auto l_FBC = GLFinalRenderPassComponent::get().m_debuggerPassGLRPC->m_GLFBC; bindFBC(l_FBC); // copy depth buffer from G-Pass copyDepthBuffer(GLGeometryRenderPassComponent::get().m_opaquePass_GLRPC->m_GLFBC, l_FBC); activateShaderProgram(GLFinalRenderPassComponent::get().m_debuggerPassGLSPC); updateUniform( GLFinalRenderPassComponent::get().m_debuggerPass_uni_p, RenderingSystemComponent::get().m_CamProjOriginal); updateUniform( GLFinalRenderPassComponent::get().m_debuggerPass_uni_r, RenderingSystemComponent::get().m_CamRot); updateUniform( GLFinalRenderPassComponent::get().m_debuggerPass_uni_t, RenderingSystemComponent::get().m_CamTrans); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); while (GLRenderingSystemComponent::get().m_debuggerPassDataQueue.size() > 0) { auto l_renderPack = GLRenderingSystemComponent::get().m_debuggerPassDataQueue.front(); auto l_m = l_renderPack.m; updateUniform( GLFinalRenderPassComponent::get().m_debuggerPass_uni_m, l_m); drawMesh(l_renderPack.indiceSize, l_renderPack.meshPrimitiveTopology, l_renderPack.GLMDC); GLRenderingSystemComponent::get().m_debuggerPassDataQueue.pop(); } glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glDisable(GL_DEPTH_TEST); return GLFinalRenderPassComponent::get().m_debuggerPassGLRPC->m_GLTDCs[0]; } GLTextureDataComponent* GLFinalRenderingPassUtilities::updateFinalBlendPass(GLTextureDataComponent * inputGLTDC) { auto l_FBC = GLFinalRenderPassComponent::get().m_finalBlendPassGLRPC->m_GLFBC; bindFBC(l_FBC); activateShaderProgram(GLFinalRenderPassComponent::get().m_finalBlendPassGLSPC); // last pass rendering target as the mixing background activateTexture( inputGLTDC, 0); // bloom pass rendering target activateTexture( GLFinalRenderPassComponent::get().m_bloomBlurPongPassGLRPC->m_GLTDCs[0], 1); // billboard pass rendering target activateTexture( GLFinalRenderPassComponent::get().m_billboardPassGLRPC->m_GLTDCs[0], 2); // debugger pass rendering target activateTexture( GLFinalRenderPassComponent::get().m_debuggerPassGLRPC->m_GLTDCs[0], 3); // draw final pass rectangle auto l_MDC = g_pCoreSystem->getAssetSystem()->getMeshDataComponent(MeshShapeType::QUAD); drawMesh(l_MDC); // draw again for game build glBindFramebuffer(GL_FRAMEBUFFER, 0); glBindRenderbuffer(GL_RENDERBUFFER, 0); drawMesh(l_MDC); return GLFinalRenderPassComponent::get().m_finalBlendPassGLRPC->m_GLTDCs[0]; } bool GLFinalRenderingPassUtilities::resize() { resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_skyPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_preTAAPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_TAAPingPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_TAAPongPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_TAASharpenPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_bloomExtractPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_bloomBlurPingPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_bloomBlurPongPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_motionBlurPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_billboardPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_debuggerPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); resizeGLRenderPassComponent(GLFinalRenderPassComponent::get().m_finalBlendPassGLRPC, GLRenderingSystemComponent::get().deferredPassFBDesc); return true; } bool GLFinalRenderingPassUtilities::reloadFinalPassShaders() { deleteShaderProgram(GLFinalRenderPassComponent::get().m_skyPassGLSPC); deleteShaderProgram(GLFinalRenderPassComponent::get().m_preTAAPassGLSPC); deleteShaderProgram(GLFinalRenderPassComponent::get().m_TAAPassGLSPC); deleteShaderProgram(GLFinalRenderPassComponent::get().m_TAASharpenPassGLSPC); deleteShaderProgram(GLFinalRenderPassComponent::get().m_bloomExtractPassGLSPC); deleteShaderProgram(GLFinalRenderPassComponent::get().m_bloomBlurPassGLSPC); deleteShaderProgram(GLFinalRenderPassComponent::get().m_motionBlurPassGLSPC); deleteShaderProgram(GLFinalRenderPassComponent::get().m_billboardPassGLSPC); deleteShaderProgram(GLFinalRenderPassComponent::get().m_debuggerPassGLSPC); deleteShaderProgram(GLFinalRenderPassComponent::get().m_finalBlendPassGLSPC); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_skyPassGLSPC, GLFinalRenderPassComponent::get().m_skyPassShaderFilePaths); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_preTAAPassGLSPC, GLFinalRenderPassComponent::get().m_preTAAPassShaderFilePaths); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_TAAPassGLSPC, GLFinalRenderPassComponent::get().m_TAAPassShaderFilePaths); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_TAASharpenPassGLSPC, GLFinalRenderPassComponent::get().m_TAASharpenPassShaderFilePaths); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_bloomExtractPassGLSPC, GLFinalRenderPassComponent::get().m_bloomExtractPassShaderFilePaths); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_bloomBlurPassGLSPC, GLFinalRenderPassComponent::get().m_bloomBlurPassShaderFilePaths); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_motionBlurPassGLSPC, GLFinalRenderPassComponent::get().m_motionBlurPassShaderFilePaths); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_billboardPassGLSPC, GLFinalRenderPassComponent::get().m_billboardPassShaderFilePaths); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_debuggerPassGLSPC, GLFinalRenderPassComponent::get().m_billboardPassShaderFilePaths); initializeGLShaderProgramComponent(GLFinalRenderPassComponent::get().m_finalBlendPassGLSPC, GLFinalRenderPassComponent::get().m_finalBlendPassShaderFilePaths); bindSkyPassUniformLocations(); bindTAAPassUniformLocations(); bindBloomExtractPassUniformLocations(); bindBloomBlurPassUniformLocations(); bindMotionBlurUniformLocations(); bindBillboardPassUniformLocations(); bindDebuggerPassUniformLocations(); bindFinalBlendPassUniformLocations(); return true; }
{ "content_hash": "89557b4984accd36ea9dc176f10b631b", "timestamp": "", "source": "github", "line_count": 781, "max_line_length": 203, "avg_line_length": 38.8809218950064, "alnum_prop": 0.8072844628861227, "repo_name": "zhangdoa/InnocenceEngine-C-", "id": "991fcc326ca07ae9e3d511aca223e4672d5e1823", "size": "30797", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "source/engine/system/GLFinalRenderingPassUtilities.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "2605863" }, { "name": "C++", "bytes": "583561" }, { "name": "Objective-C", "bytes": "15538" } ], "symlink_target": "" }
function Response(channel, message, responseTo) { this.channel = channel; this.message = message; this.responseTo = responseTo || null; } Response.prototype = { getChannel: function() { return this.channel; }, getMessage: function() { return this.message; }, getResponseTo: function() { return this.responseTo; }, equals: function(text) { return text === this.getMessage(); }, isOnChannel: function(channel) { return this.channel.equals(channel); } }; module.exports = Response;
{ "content_hash": "7a4c118bc1bc1230a62df6cd6da3fb93", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 49, "avg_line_length": 16.64516129032258, "alnum_prop": 0.6802325581395349, "repo_name": "sgt-kabukiman/kabukibot-legacy", "id": "ce3459bdc7ebf95231ed2f130e87a220375479b0", "size": "792", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/Response.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "227630" } ], "symlink_target": "" }
#ifndef MIDI_DUMMY_H #define MIDI_DUMMY_H #include "MidiClient.h" class MidiDummy : public MidiClientRaw { public: MidiDummy() { } virtual ~MidiDummy() { } inline static QString name() { return( QT_TRANSLATE_NOOP( "MidiSetupWidget", "Dummy (no MIDI support)" ) ); } inline static QString probeDevice() { return QString::Null(); // no midi device name } inline static QString configSection() { return QString::Null(); // no configuration settings } protected: virtual void sendByte( const unsigned char ) { } } ; #endif
{ "content_hash": "38e4905e9a57cbb2efc9d7d11069515e", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 54, "avg_line_length": 12.704545454545455, "alnum_prop": 0.6726296958855098, "repo_name": "universalprojectfile/universal-project-file", "id": "980afe2883db30b070a64d79783f61f66dc46bc1", "size": "1471", "binary": false, "copies": "13", "ref": "refs/heads/master", "path": "universal-daw/include/MidiDummy.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "3868034" }, { "name": "C++", "bytes": "7919531" }, { "name": "CMake", "bytes": "134570" }, { "name": "CSS", "bytes": "41594" }, { "name": "HTML", "bytes": "74411" }, { "name": "NSIS", "bytes": "4550" }, { "name": "Python", "bytes": "763" }, { "name": "Roff", "bytes": "5047" }, { "name": "Ruby", "bytes": "1552" }, { "name": "Shell", "bytes": "13023" }, { "name": "TeX", "bytes": "6868" } ], "symlink_target": "" }
package io.yun.controller; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import io.yun.entity.TYunPriceDynamicsEntity; import io.yun.service.TYunPriceDynamicsService; import io.unicall.utils.PageUtils; import io.unicall.utils.Query; import io.unicall.utils.R; /** * 价格动态表 * * @author lankai * @email bq.zhu@unicall.com * @date 2017-06-30 10:56:33 */ @RestController @RequestMapping("yun/tyunpricedynamics") public class TYunPriceDynamicsController { @Autowired private TYunPriceDynamicsService tYunPriceDynamicsService; /** * 列表 */ @RequestMapping("/list") // @RequiresPermissions("tyunpricedynamics:list") public R list(@RequestParam Map<String, Object> params){ //查询列表数据 Query query = new Query(params); List<TYunPriceDynamicsEntity> tYunPriceDynamicsList = tYunPriceDynamicsService.queryList(query); int total = tYunPriceDynamicsService.queryTotal(query); PageUtils pageUtil = new PageUtils(tYunPriceDynamicsList, total, query.getLimit(), query.getPage()); return R.ok().put("page", pageUtil); } /** * 信息 */ @RequestMapping("/info/{id}") // @RequiresPermissions("tyunpricedynamics:info") public R info(@PathVariable("id") String id){ TYunPriceDynamicsEntity tYunPriceDynamics = tYunPriceDynamicsService.queryObject(id); return R.ok().put("tYunPriceDynamics", tYunPriceDynamics); } /** * 保存 */ @RequestMapping("/save") // @RequiresPermissions("tyunpricedynamics:save") public R save(@RequestBody TYunPriceDynamicsEntity tYunPriceDynamics){ tYunPriceDynamicsService.save(tYunPriceDynamics); return R.ok(); } /** * 修改 */ @RequestMapping("/update") // @RequiresPermissions("tyunpricedynamics:update") public R update(@RequestBody TYunPriceDynamicsEntity tYunPriceDynamics){ tYunPriceDynamicsService.update(tYunPriceDynamics); return R.ok(); } /** * 删除 */ @RequestMapping("/delete") // @RequiresPermissions("tyunpricedynamics:delete") public R delete(@RequestBody String[] ids){ tYunPriceDynamicsService.deleteBatch(ids); return R.ok(); } }
{ "content_hash": "0019f34ff7e776b657d101d70a022e18", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 102, "avg_line_length": 25.57894736842105, "alnum_prop": 0.7551440329218106, "repo_name": "xuyuqin/xuyuqin", "id": "61f708fdf05166e23e89fd9dda04722b3f484203", "size": "2472", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/io/yun/controller/TYunPriceDynamicsController.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "536665" }, { "name": "FreeMarker", "bytes": "467245" }, { "name": "HTML", "bytes": "245243" }, { "name": "Java", "bytes": "544950" }, { "name": "JavaScript", "bytes": "709044" } ], "symlink_target": "" }
// Copyright (c) DotSpatial Team. All rights reserved. // Licensed under the MIT license. See License.txt file in the project root for full license information. using System; using System.Data; using DotSpatial.Data; using DotSpatial.Modeling.Forms; using DotSpatial.Modeling.Forms.Parameters; using NetTopologySuite.Geometries; using NetTopologySuite.Simplify; namespace DotSpatial.Tools { /// <summary> /// This tool reduces the number of points on polylines using the Douglas-Peucker line /// simplification algorithm. /// </summary> public class DpSimplification : Tool { #region Fields private Parameter[] _inputParam; private Parameter[] _outputParam; #endregion #region Constructors /// <summary> /// Initializes a new instance of the <see cref="DpSimplification"/> class. /// </summary> public DpSimplification() { Name = TextStrings.SimplifyLines; Category = TextStrings.Generalization; Description = TextStrings.DouglasPeuckerlinesimplification; ToolTip = TextStrings.DPlinesimplification; } #endregion #region Properties /// <summary> /// Gets the input paramater array. /// </summary> public override Parameter[] InputParameters => _inputParam; /// <summary> /// Gets the output paramater array. /// </summary> public override Parameter[] OutputParameters => _outputParam; #endregion #region Methods /// <summary> /// Once the Parameter have been configured the Execute command can be called, it returns true if successful. /// </summary> /// <param name="cancelProgressHandler">The progress handler.</param> /// <returns>True, if executed successfully.</returns> public override bool Execute(ICancelProgressHandler cancelProgressHandler) { IFeatureSet input = _inputParam[0].Value as IFeatureSet; input?.FillAttributes(); double tolerance = (double)_inputParam[1].Value; IFeatureSet output = _outputParam[0].Value as IFeatureSet; return Execute(input, tolerance, output, cancelProgressHandler); } /// <summary> /// Executes the DP line simplefy tool programmatically. /// Ping Yang Added it for external Testing. /// </summary> /// <param name="input">The input polygon feature set.</param> /// <param name="tolerance">The tolerance to use when simplefiying.</param> /// <param name="output">The output polygon feature set.</param> /// <returns>True, if executed successfully.</returns> public bool Execute(IFeatureSet input, double tolerance, IFeatureSet output) { // Validates the input and output data if (input == null || output == null) { return false; } // We copy all the fields foreach (DataColumn inputColumn in input.DataTable.Columns) { output.DataTable.Columns.Add(new DataColumn(inputColumn.ColumnName, inputColumn.DataType)); } foreach (IFeature t in input.Features) { Geometry geom = t.Geometry as Geometry; if (geom != null) { for (int part = 0; part < geom.NumGeometries; part++) { Geometry geomPart = (Geometry)geom.GetGeometryN(part); // do the simplification Coordinate[] oldCoords = geomPart.Coordinates; Coordinate[] newCoords = DouglasPeuckerLineSimplifier.Simplify(oldCoords, tolerance); // convert the coordinates back to a geometry Geometry newGeom = new LineString(newCoords); Feature newFeature = new(newGeom, output); foreach (DataColumn colSource in input.DataTable.Columns) { newFeature.DataRow[colSource.ColumnName] = t.DataRow[colSource.ColumnName]; } } } } output.Save(); return true; } /// <summary> /// Executes the DP line simplefy tool programmatically. /// </summary> /// <param name="input">The input polygon feature set.</param> /// <param name="tolerance">The tolerance to use when simplefiying.</param> /// <param name="output">The output polygon feature set.</param> /// <param name="cancelProgressHandler">The progress handler.</param> /// <returns>True, if executed successfully.</returns> public bool Execute(IFeatureSet input, double tolerance, IFeatureSet output, ICancelProgressHandler cancelProgressHandler) { // Validates the input and output data if (input == null || output == null) { return false; } // We copy all the fields foreach (DataColumn inputColumn in input.DataTable.Columns) { output.DataTable.Columns.Add(new DataColumn(inputColumn.ColumnName, inputColumn.DataType)); } int numTotalOldPoints = 0; int numTotalNewPoints = 0; for (int j = 0; j < input.Features.Count; j++) { int numOldPoints = 0; int numNewPoints = 0; Geometry geom = input.Features[j].Geometry as Geometry; if (geom != null) { numOldPoints = geom.NumPoints; } numTotalOldPoints += numOldPoints; if (geom != null) { for (int part = 0; part < geom.NumGeometries; part++) { Geometry geomPart = (Geometry)geom.GetGeometryN(part); // do the simplification Coordinate[] oldCoords = geomPart.Coordinates; Coordinate[] newCoords = DouglasPeuckerLineSimplifier.Simplify(oldCoords, tolerance); // convert the coordinates back to a geometry Geometry newGeom = new LineString(newCoords); numNewPoints += newGeom.NumPoints; numTotalNewPoints += numNewPoints; Feature newFeature = new(newGeom, output); foreach (DataColumn colSource in input.DataTable.Columns) { newFeature.DataRow[colSource.ColumnName] = input.Features[j].DataRow[colSource.ColumnName]; } } } // Status updates is done here, shows number of old / new points cancelProgressHandler.Progress(Convert.ToInt32((Convert.ToDouble(j) / Convert.ToDouble(input.Features.Count)) * 100), numOldPoints + "-->" + numNewPoints); if (cancelProgressHandler.Cancel) { return false; } } cancelProgressHandler.Progress(100, TextStrings.Originalnumberofpoints + numTotalOldPoints + " " + TextStrings.Newnumberofpoints + numTotalNewPoints); output.Save(); return true; } /// <summary> /// The Parameter array should be populated with default values here. /// </summary> public override void Initialize() { _inputParam = new Parameter[2]; _inputParam[0] = new LineFeatureSetParam(TextStrings.LineFeatureSet); _inputParam[1] = new DoubleParam(TextStrings.Tolerance) { Value = 10.0 }; _outputParam = new Parameter[2]; _outputParam[0] = new LineFeatureSetParam(TextStrings.LineFeatureSet); _outputParam[1] = new BooleanParam(TextStrings.OutputParameter_AddToMap, TextStrings.OutputParameter_AddToMap_CheckboxText, true); } #endregion } }
{ "content_hash": "52c17b8265dc292b76735d9f9dfe968c", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 171, "avg_line_length": 38.41935483870968, "alnum_prop": 0.5609931630082764, "repo_name": "DotSpatial/DotSpatial", "id": "8ba31561e51b7beab0c9386af2e0c650ef77e9fd", "size": "8339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/Core/DotSpatial.Tools/DPSimplification.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP.NET", "bytes": "1639" }, { "name": "Batchfile", "bytes": "4625" }, { "name": "C#", "bytes": "15483649" }, { "name": "CSS", "bytes": "490" }, { "name": "HTML", "bytes": "8176" }, { "name": "JavaScript", "bytes": "133570" }, { "name": "Smalltalk", "bytes": "406360" }, { "name": "Visual Basic .NET", "bytes": "451767" } ], "symlink_target": "" }
.. _operations_traffic_tapping: Traffic tapping =============== Envoy currently provides two experimental extensions that can tap traffic: * :ref:`HTTP tap filter <config_http_filters_tap>`. See the linked filter documentation for more information. * :ref:`Tap transport socket extension <envoy_v3_api_msg_config.core.v3.TransportSocket>` that can intercept traffic and write to a :ref:`protobuf trace file <envoy_v3_api_msg_data.tap.v3.TraceWrapper>`. The remainder of this document describes the configuration of the tap transport socket. Tap transport socket configuration ---------------------------------- .. attention:: The tap transport socket is experimental and is currently under active development. There is currently a very limited set of match conditions, output configuration, output sinks, etc. Capabilities will be expanded over time and the configuration structures are likely to change. Tapping can be configured on :ref:`Listener <envoy_v3_api_field_config.listener.v3.FilterChain.transport_socket>` and :ref:`Cluster <envoy_v3_api_field_config.cluster.v3.Cluster.transport_socket>` transport sockets, providing the ability to interpose on downstream and upstream L4 connections respectively. To configure traffic tapping, add an ``envoy.transport_sockets.tap`` transport socket :ref:`configuration <envoy_v3_api_msg_extensions.filters.http.tap.v3.Tap>` to the listener or cluster. For a plain text socket this might look like: .. code-block:: yaml transport_socket: name: envoy.transport_sockets.tap typed_config: "@type": type.googleapis.com/envoy.extensions.transport_sockets.tap.v3.Tap common_config: static_config: match_config: any_match: true output_config: sinks: - format: PROTO_BINARY file_per_tap: path_prefix: /some/tap/path transport_socket: name: envoy.transport_sockets.raw_buffer typed_config: "@type": type.googleapis.com/envoy.extensions.transport_sockets.raw_buffer.v3.RawBuffer For a TLS socket, this will be: .. code-block:: yaml transport_socket: name: envoy.transport_sockets.tap typed_config: "@type": type.googleapis.com/envoy.extensions.transport_sockets.tap.v3.Tap common_config: static_config: match_config: any_match: true output_config: sinks: - format: PROTO_BINARY file_per_tap: path_prefix: /some/tap/path transport_socket: name: envoy.transport_sockets.tls typed_config: <TLS context> where the TLS context configuration replaces any existing :ref:`downstream <envoy_v3_api_msg_extensions.transport_sockets.tls.v3.DownstreamTlsContext>` or :ref:`upstream <envoy_v3_api_msg_extensions.transport_sockets.tls.v3.UpstreamTlsContext>` TLS configuration on the listener or cluster, respectively. Each unique socket instance will generate a trace file prefixed with ``path_prefix``. E.g. ``/some/tap/path_0.pb``. Buffered data limits -------------------- For buffered socket taps, Envoy will limit the amount of body data that is tapped to avoid OOM situations. The default limit is 1KiB for both received and transmitted data. This is configurable via the :ref:`max_buffered_rx_bytes <envoy_v3_api_field_config.tap.v3.OutputConfig.max_buffered_rx_bytes>` and :ref:`max_buffered_tx_bytes <envoy_v3_api_field_config.tap.v3.OutputConfig.max_buffered_tx_bytes>` settings. When a buffered socket tap is truncated, the trace will indicate truncation via the :ref:`read_truncated <envoy_v3_api_field_data.tap.v3.SocketBufferedTrace.read_truncated>` and :ref:`write_truncated <envoy_v3_api_field_data.tap.v3.SocketBufferedTrace.write_truncated>` fields as well as the body :ref:`truncated <envoy_v3_api_field_data.tap.v3.Body.truncated>` field. Streaming --------- The tap transport socket supports both buffered and streaming, controlled by the :ref:`streaming <envoy_v3_api_field_config.tap.v3.OutputConfig.streaming>` setting. When buffering, :ref:`SocketBufferedTrace <envoy_v3_api_msg_data.tap.v3.SocketBufferedTrace>` messages are emitted. When streaming, a series of :ref:`SocketStreamedTraceSegment <envoy_v3_api_msg_data.tap.v3.SocketStreamedTraceSegment>` are emitted. See the :ref:`HTTP tap filter streaming <config_http_filters_tap_streaming>` documentation for more information. Most of the concepts overlap between the HTTP filter and the transport socket. PCAP generation --------------- The generated trace file can be converted to `libpcap format <https://wiki.wireshark.org/Development/LibpcapFileFormat>`_, suitable for analysis with tools such as `Wireshark <https://www.wireshark.org/>`_ with the ``tap2pcap`` utility, e.g.: .. code-block:: bash bazel run @envoy_api//tools:tap2pcap /some/tap/path_0.pb path_0.pcap tshark -r path_0.pcap -d "tcp.port==10000,http2" -P 1 0.000000 127.0.0.1 → 127.0.0.1 HTTP2 157 Magic, SETTINGS, WINDOW_UPDATE, HEADERS 2 0.013713 127.0.0.1 → 127.0.0.1 HTTP2 91 SETTINGS, SETTINGS, WINDOW_UPDATE 3 0.013820 127.0.0.1 → 127.0.0.1 HTTP2 63 SETTINGS 4 0.128649 127.0.0.1 → 127.0.0.1 HTTP2 5586 HEADERS 5 0.130006 127.0.0.1 → 127.0.0.1 HTTP2 7573 DATA 6 0.131044 127.0.0.1 → 127.0.0.1 HTTP2 3152 DATA, DATA
{ "content_hash": "a5fe5b4a631f9d8f6a5edb9bfa5b03a6", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 121, "avg_line_length": 43.336, "alnum_prop": 0.712202326010707, "repo_name": "envoyproxy/envoy", "id": "fafb86d32ad78357417cfb4133ce4e144f514392", "size": "5429", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "docs/root/operations/traffic_tapping.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "439" }, { "name": "C", "bytes": "54172" }, { "name": "C++", "bytes": "36279350" }, { "name": "CSS", "bytes": "884" }, { "name": "Dockerfile", "bytes": "891" }, { "name": "Emacs Lisp", "bytes": "966" }, { "name": "Go", "bytes": "558" }, { "name": "HTML", "bytes": "582" }, { "name": "Java", "bytes": "1309139" }, { "name": "JavaScript", "bytes": "76" }, { "name": "Jinja", "bytes": "46306" }, { "name": "Kotlin", "bytes": "311319" }, { "name": "Makefile", "bytes": "303" }, { "name": "NASL", "bytes": "327095" }, { "name": "Objective-C", "bytes": "95941" }, { "name": "PureBasic", "bytes": "472" }, { "name": "Python", "bytes": "630897" }, { "name": "Ruby", "bytes": "47" }, { "name": "Rust", "bytes": "38041" }, { "name": "Shell", "bytes": "194810" }, { "name": "Smarty", "bytes": "3528" }, { "name": "Starlark", "bytes": "2229814" }, { "name": "Swift", "bytes": "307285" }, { "name": "Thrift", "bytes": "748" } ], "symlink_target": "" }
.class public Landroid/speech/RecognizerResultsIntent; .super Ljava/lang/Object; .source "RecognizerResultsIntent.java" # static fields .field public static final ACTION_VOICE_SEARCH_RESULTS:Ljava/lang/String; = "android.speech.action.VOICE_SEARCH_RESULTS" .field public static final EXTRA_VOICE_SEARCH_RESULT_HTML:Ljava/lang/String; = "android.speech.extras.VOICE_SEARCH_RESULT_HTML" .field public static final EXTRA_VOICE_SEARCH_RESULT_HTML_BASE_URLS:Ljava/lang/String; = "android.speech.extras.VOICE_SEARCH_RESULT_HTML_BASE_URLS" .field public static final EXTRA_VOICE_SEARCH_RESULT_HTTP_HEADERS:Ljava/lang/String; = "android.speech.extras.EXTRA_VOICE_SEARCH_RESULT_HTTP_HEADERS" .field public static final EXTRA_VOICE_SEARCH_RESULT_STRINGS:Ljava/lang/String; = "android.speech.extras.VOICE_SEARCH_RESULT_STRINGS" .field public static final EXTRA_VOICE_SEARCH_RESULT_URLS:Ljava/lang/String; = "android.speech.extras.VOICE_SEARCH_RESULT_URLS" .field public static final URI_SCHEME_INLINE:Ljava/lang/String; = "inline" # direct methods .method private constructor <init>()V .locals 0 invoke-direct {p0}, Ljava/lang/Object;-><init>()V return-void .end method
{ "content_hash": "54cffecf663ca0651f35be02b18560dd", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 149, "avg_line_length": 40.793103448275865, "alnum_prop": 0.7836010143702451, "repo_name": "BatMan-Rom/ModdedFiles", "id": "a6cd57e4c432e88db0e1f92fa4cd4d202dc9a4c4", "size": "1183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "framework.jar.out/smali_classes2/android/speech/RecognizerResultsIntent.smali", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "GLSL", "bytes": "15069" }, { "name": "HTML", "bytes": "139176" }, { "name": "Smali", "bytes": "541934400" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_232) on Tue Sep 15 08:53:08 UTC 2020 --> <title>Uses of Package org.springframework.expression.spel (Spring Framework 5.1.18.RELEASE API)</title> <meta name="date" content="2020-09-15"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package org.springframework.expression.spel (Spring Framework 5.1.18.RELEASE API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Spring Framework</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/springframework/expression/spel/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Uses of Package org.springframework.expression.spel" class="title">Uses of Package<br>org.springframework.expression.spel</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../org/springframework/expression/spel/package-summary.html">org.springframework.expression.spel</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.springframework.context.expression">org.springframework.context.expression</a></td> <td class="colLast"> <div class="block">Expression parsing support within a Spring application context.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.springframework.expression.spel">org.springframework.expression.spel</a></td> <td class="colLast"> <div class="block">SpEL's central implementation package.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.springframework.expression.spel.ast">org.springframework.expression.spel.ast</a></td> <td class="colLast"> <div class="block">SpEL's abstract syntax tree.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.springframework.expression.spel.standard">org.springframework.expression.spel.standard</a></td> <td class="colLast"> <div class="block">SpEL's standard parser implementation.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.springframework.expression.spel.support">org.springframework.expression.spel.support</a></td> <td class="colLast"> <div class="block">SpEL's default implementations for various core abstractions.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.springframework.context.expression"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../org/springframework/expression/spel/package-summary.html">org.springframework.expression.spel</a> used by <a href="../../../../org/springframework/context/expression/package-summary.html">org.springframework.context.expression</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/CodeFlow.html#org.springframework.context.expression">CodeFlow</a> <div class="block">Manages the class being generated by the compilation process.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/CompilablePropertyAccessor.html#org.springframework.context.expression">CompilablePropertyAccessor</a> <div class="block">A compilable property accessor is able to generate bytecode that represents the access operation, facilitating compilation to bytecode of expressions that use the accessor.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.springframework.expression.spel"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../org/springframework/expression/spel/package-summary.html">org.springframework.expression.spel</a> used by <a href="../../../../org/springframework/expression/spel/package-summary.html">org.springframework.expression.spel</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/CodeFlow.html#org.springframework.expression.spel">CodeFlow</a> <div class="block">Manages the class being generated by the compilation process.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/CodeFlow.ClinitAdder.html#org.springframework.expression.spel">CodeFlow.ClinitAdder</a> <div class="block">Interface used to generate <code>clinit</code> static initializer blocks.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/CodeFlow.FieldAdder.html#org.springframework.expression.spel">CodeFlow.FieldAdder</a> <div class="block">Interface used to generate fields.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/ExpressionState.html#org.springframework.expression.spel">ExpressionState</a> <div class="block">An ExpressionState is for maintaining per-expression-evaluation state, any changes to it are not seen by other expressions but it gives a place to hold local variables and for component expressions in a compound expression to communicate state.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelCompilerMode.html#org.springframework.expression.spel">SpelCompilerMode</a> <div class="block">Captures the possible configuration settings for a compiler that can be used when evaluating expressions.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelMessage.html#org.springframework.expression.spel">SpelMessage</a> <div class="block">Contains all the messages that can be produced by the Spring Expression Language.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelMessage.Kind.html#org.springframework.expression.spel">SpelMessage.Kind</a> <div class="block">Message kinds.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelNode.html#org.springframework.expression.spel">SpelNode</a> <div class="block">Represents a node in the AST for a parsed expression.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelParseException.html#org.springframework.expression.spel">SpelParseException</a> <div class="block">Root exception for Spring EL related exceptions.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelParserConfiguration.html#org.springframework.expression.spel">SpelParserConfiguration</a> <div class="block">Configuration object for the SpEL expression parser.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.springframework.expression.spel.ast"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../org/springframework/expression/spel/package-summary.html">org.springframework.expression.spel</a> used by <a href="../../../../org/springframework/expression/spel/ast/package-summary.html">org.springframework.expression.spel.ast</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/CodeFlow.html#org.springframework.expression.spel.ast">CodeFlow</a> <div class="block">Manages the class being generated by the compilation process.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/ExpressionState.html#org.springframework.expression.spel.ast">ExpressionState</a> <div class="block">An ExpressionState is for maintaining per-expression-evaluation state, any changes to it are not seen by other expressions but it gives a place to hold local variables and for component expressions in a compound expression to communicate state.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelEvaluationException.html#org.springframework.expression.spel.ast">SpelEvaluationException</a> <div class="block">Root exception for Spring EL related exceptions.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelNode.html#org.springframework.expression.spel.ast">SpelNode</a> <div class="block">Represents a node in the AST for a parsed expression.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.springframework.expression.spel.standard"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../org/springframework/expression/spel/package-summary.html">org.springframework.expression.spel</a> used by <a href="../../../../org/springframework/expression/spel/standard/package-summary.html">org.springframework.expression.spel.standard</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/CompiledExpression.html#org.springframework.expression.spel.standard">CompiledExpression</a> <div class="block">Base superclass for compiled expressions.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelNode.html#org.springframework.expression.spel.standard">SpelNode</a> <div class="block">Represents a node in the AST for a parsed expression.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelParserConfiguration.html#org.springframework.expression.spel.standard">SpelParserConfiguration</a> <div class="block">Configuration object for the SpEL expression parser.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.springframework.expression.spel.support"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../org/springframework/expression/spel/package-summary.html">org.springframework.expression.spel</a> used by <a href="../../../../org/springframework/expression/spel/support/package-summary.html">org.springframework.expression.spel.support</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/CodeFlow.html#org.springframework.expression.spel.support">CodeFlow</a> <div class="block">Manages the class being generated by the compilation process.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/CompilablePropertyAccessor.html#org.springframework.expression.spel.support">CompilablePropertyAccessor</a> <div class="block">A compilable property accessor is able to generate bytecode that represents the access operation, facilitating compilation to bytecode of expressions that use the accessor.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../org/springframework/expression/spel/class-use/SpelEvaluationException.html#org.springframework.expression.spel.support">SpelEvaluationException</a> <div class="block">Root exception for Spring EL related exceptions.</div> </td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Spring Framework</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/springframework/expression/spel/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "237aab90b966928522c9abe4dae5a3c2", "timestamp": "", "source": "github", "line_count": 349, "max_line_length": 340, "avg_line_length": 46.20916905444126, "alnum_prop": 0.7054628883239288, "repo_name": "akhr/java", "id": "b3df31e8f774c82a7b8f665e82972fa9b34c2859", "size": "16127", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Spring/jars/spring-framework-5.1.18.RELEASE/docs/javadoc-api/org/springframework/expression/spel/package-use.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "93017" }, { "name": "HTML", "bytes": "203648040" }, { "name": "Java", "bytes": "1237949" }, { "name": "JavaScript", "bytes": "827" }, { "name": "Shell", "bytes": "59" } ], "symlink_target": "" }
package com.devmarvel.creditcardentry.library; import androidx.annotation.DrawableRes; import com.devmarvel.creditcardentry.R; import java.io.Serializable; class CardRegex { // See: http://www.regular-expressions.info/creditcard.html static final String REGX_VISA = "^4[0-9]{15}?"; // VISA 16 static final String REGX_MC = "^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$"; // MC 16 static final String REGX_AMEX = "^3[47][0-9]{13}$"; // AMEX 15 static final String REGX_DISCOVER = "^6(?:011|5[0-9]{2})[0-9]{12}$"; // Discover 16 static final String REGX_DINERS_CLUB = "^3(?:0[0-5]|[68][0-9])[0-9]{11}$"; // DinersClub 14 static final String REGX_JCB = "^35[0-9]{14}$"; // JCB 16 static final String REGX_VERVE = "^(506099|5061[0-8][0-9]|50619[0-8])[0-9]{13}$"; // Interswitch Verve [Nigeria] static final String REGX_VISA_TYPE = "^4[0-9]{3}?"; // VISA 16 static final String REGX_MC_TYPE = "^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)$"; // MC 16 static final String REGX_AMEX_TYPE = "^3[47][0-9]{2}$"; // AMEX 15 static final String REGX_DISCOVER_TYPE = "^6(?:011|5[0-9]{2})$"; // Discover 16 static final String REGX_DINERS_CLUB_TYPE = "^3(?:0[0-5]|[68][0-9])[0-9]$"; // DinersClub 14 static final String REGX_JCB_TYPE = "^35[0-9]{2}$"; // JCB 15 static final String REGX_VERVE_TYPE = "^506[0,1]$"; // Interswitch Verve [Nigeria] } /** * represents the type of card the user used */ public enum CardType implements Serializable { VISA("VISA", R.drawable.visa, CardRegex.REGX_VISA, CardRegex.REGX_VISA_TYPE), MASTERCARD("MasterCard", R.drawable.master_card, CardRegex.REGX_MC, CardRegex.REGX_MC_TYPE), AMEX("American Express", R.drawable.amex, CardRegex.REGX_AMEX, CardRegex.REGX_AMEX_TYPE), DISCOVER("Discover", R.drawable.discover, CardRegex.REGX_DISCOVER, CardRegex.REGX_DISCOVER_TYPE), DINERS("DinersClub",R.drawable.diners_club,CardRegex.REGX_DINERS_CLUB,CardRegex.REGX_DINERS_CLUB_TYPE), JCB("JCB",R.drawable.jcb_payment_ico,CardRegex.REGX_JCB,CardRegex.REGX_JCB_TYPE), VERVE("Verve", R.drawable.payment_ic_verve, CardRegex.REGX_VERVE, CardRegex.REGX_VERVE_TYPE), INVALID("Unknown", R.drawable.unknown_cc, null, null); /** name for humans */ public final String friendlyName; /** regex that matches the entire card number */ public final String fullRegex; /** regex that will match when there is enough of the card to determine type */ public final String typeRegex; /** drawable for the front of the card */ public final int frontResource; /** drawable for the back of the card */ public final int backResource = R.drawable.cc_back; CardType(String friendlyName, @DrawableRes int imageResource, String fullRegex, String typeRegex) { this.friendlyName = friendlyName; this.frontResource = imageResource; this.fullRegex = fullRegex; this.typeRegex = typeRegex; } @Override public String toString() { return friendlyName; } }
{ "content_hash": "72571bb313b0e859dce0ca4dbc28edaf", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 129, "avg_line_length": 45.529411764705884, "alnum_prop": 0.66343669250646, "repo_name": "dbachelder/CreditCardEntry", "id": "8a84e70322e14330a3edddb9a44618a5b126727a", "size": "3096", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CreditCardEntry/src/com/devmarvel/creditcardentry/library/CardType.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "71235" } ], "symlink_target": "" }
module AssistedWorkflow VERSION = "0.4.0" end
{ "content_hash": "24684b042d45f6bbfcde88d70ae36d30", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 23, "avg_line_length": 16, "alnum_prop": 0.7291666666666666, "repo_name": "inaka/assisted_workflow", "id": "2302b8facb348f70ea197453cd8df4d90822ef17", "size": "48", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/assisted_workflow/version.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "50064" }, { "name": "Shell", "bytes": "1641" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <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.7"/> <title>Avisos CONAGUA: mx.org.cedn.avisosconagua.mongo.CAPFileGenerator Class Reference</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="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </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 style="padding-left: 0.5em;"> <div id="projectname">Avisos CONAGUA &#160;<span id="projectnumber">1</span> </div> <div id="projectbrief">Sistema de generación de avisos de ciclones tropicales en formato CAP</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.7 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">mx.org.cedn.avisosconagua.mongo.CAPFileGenerator Class Reference</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a3ad70c2f5c566ec75a4396a67bc71bd4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html#a3ad70c2f5c566ec75a4396a67bc71bd4">CAPFileGenerator</a> (String adviceID)</td></tr> <tr class="separator:a3ad70c2f5c566ec75a4396a67bc71bd4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a3066a90d50ed3e07a23e0d620e5146c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html#a3066a90d50ed3e07a23e0d620e5146c2">generate</a> ()</td></tr> <tr class="separator:a3066a90d50ed3e07a23e0d620e5146c2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a6a2bd0c7895e69af5f96a283c85b67f5"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html#a6a2bd0c7895e69af5f96a283c85b67f5">isOK</a> ()</td></tr> <tr class="separator:a6a2bd0c7895e69af5f96a283c85b67f5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:acba4fa4bd008bebab53509668ba3307b"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html#acba4fa4bd008bebab53509668ba3307b">getLink</a> ()</td></tr> <tr class="separator:acba4fa4bd008bebab53509668ba3307b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ad1de74efaa83b052ce82a34c5ddc39b8"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html#ad1de74efaa83b052ce82a34c5ddc39b8">getName</a> ()</td></tr> <tr class="separator:ad1de74efaa83b052ce82a34c5ddc39b8"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae2eed2b3fd9ecd284316b22786282383"><td class="memItemLeft" align="right" valign="top">Alert&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html#ae2eed2b3fd9ecd284316b22786282383">getAlert</a> ()</td></tr> <tr class="separator:ae2eed2b3fd9ecd284316b22786282383"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae3d0ca9fa74cfccefddcfd093e9dace9"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html#ae3d0ca9fa74cfccefddcfd093e9dace9">getDate</a> ()</td></tr> <tr class="separator:ae3d0ca9fa74cfccefddcfd093e9dace9"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Utility class to generate a CAP file from a MongoDB object containing advice information. </p><dl class="section author"><dt>Author</dt><dd>serch </dd></dl> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2> <a class="anchor" id="a3ad70c2f5c566ec75a4396a67bc71bd4"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">mx.org.cedn.avisosconagua.mongo.CAPFileGenerator.CAPFileGenerator </td> <td>(</td> <td class="paramtype">String&#160;</td> <td class="paramname"><em>adviceID</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Constructor. Creates a new instance of the <a class="el" href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html">CAPFileGenerator</a> with the provided advice ID. </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">adviceID</td><td>ID of the advice to get information from. </td></tr> </table> </dd> </dl> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a3066a90d50ed3e07a23e0d620e5146c2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mx.org.cedn.avisosconagua.mongo.CAPFileGenerator.generate </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Generates and stores the CAP file. </p> </div> </div> <a class="anchor" id="ae2eed2b3fd9ecd284316b22786282383"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Alert mx.org.cedn.avisosconagua.mongo.CAPFileGenerator.getAlert </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Gets the <a class="el" href="">com.google.publicalerts.cap.Alert</a> object related to the generated CAP file </p><dl class="section return"><dt>Returns</dt><dd><a class="el" href="">com.google.publicalerts.cap.Alert</a> object. </dd></dl> </div> </div> <a class="anchor" id="ae3d0ca9fa74cfccefddcfd093e9dace9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">String mx.org.cedn.avisosconagua.mongo.CAPFileGenerator.getDate </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Gets the issue date string for the advice related to the CAP file. </p><dl class="section return"><dt>Returns</dt><dd>string date of issue </dd></dl> </div> </div> <a class="anchor" id="acba4fa4bd008bebab53509668ba3307b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">String mx.org.cedn.avisosconagua.mongo.CAPFileGenerator.getLink </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Gets the CAP file Web path </p><dl class="section return"><dt>Returns</dt><dd>link path to the CAP file </dd></dl> </div> </div> <a class="anchor" id="ad1de74efaa83b052ce82a34c5ddc39b8"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">String mx.org.cedn.avisosconagua.mongo.CAPFileGenerator.getName </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Gets the CAP file name </p><dl class="section return"><dt>Returns</dt><dd>name of the CAP file </dd></dl> </div> </div> <a class="anchor" id="a6a2bd0c7895e69af5f96a283c85b67f5"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">boolean mx.org.cedn.avisosconagua.mongo.CAPFileGenerator.isOK </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Gets the OK field </p><dl class="section return"><dt>Returns</dt><dd>true if the CAP file was generated succesfully, false otherwise </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>/Users/hasdai/Desarrollo/avisos/src/main/java/mx/org/cedn/avisosconagua/mongo/CAPFileGenerator.java</li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><b>mx</b></li><li class="navelem"><b>org</b></li><li class="navelem"><b>cedn</b></li><li class="navelem"><b>avisosconagua</b></li><li class="navelem"><b>mongo</b></li><li class="navelem"><a class="el" href="classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html">CAPFileGenerator</a></li> <li class="footer">Generated on Wed Jun 11 2014 12:50:07 for Avisos CONAGUA by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li> </ul> </div> </body> </html>
{ "content_hash": "195aa2f29572a35bb9a079bae2acc57f", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 546, "avg_line_length": 51.62313432835821, "alnum_prop": 0.6692446693169498, "repo_name": "mxabierto/avisos", "id": "d3a6f3367c6a79f704de6b86d609a0b7b8c91c0f", "size": "13836", "binary": false, "copies": "1", "ref": "refs/heads/staging", "path": "doc/html/classmx_1_1org_1_1cedn_1_1avisosconagua_1_1mongo_1_1_c_a_p_file_generator.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "44448" }, { "name": "Java", "bytes": "308088" }, { "name": "JavaScript", "bytes": "141793" }, { "name": "Shell", "bytes": "340" } ], "symlink_target": "" }
'use strict'; // Use application configuration module to register a new module ApplicationConfiguration.registerModule('pieces');
{ "content_hash": "eda3a420130b5aadcc9d43d335fe4902", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 64, "avg_line_length": 32.75, "alnum_prop": 0.8091603053435115, "repo_name": "bojan12345/MeanJS-saloni", "id": "82ede2a9db9ad38bef5f3b400ecad90eba41507a", "size": "131", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/modules/pieces/pieces.client.module.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "500" }, { "name": "HTML", "bytes": "46154" }, { "name": "JavaScript", "bytes": "109960" }, { "name": "Shell", "bytes": "414" } ], "symlink_target": "" }
require 'selenium/webdriver/common/error' require 'selenium/webdriver/common/wait' module Mailgun module WaitUntil def self.wait_until(timeout = 10, message=nil, &block) wait = Selenium::WebDriver::Wait.new(:timeout => timeout, :message => message) wait.until &block end end end
{ "content_hash": "f4d6e34b0d1a8a93b37680c4793eed84", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 84, "avg_line_length": 25.333333333333332, "alnum_prop": 0.7105263157894737, "repo_name": "jwplayer/mailgun-mailbox", "id": "f2ff8dcec74b5e7822864942f1c4f3aa396bfd41", "size": "304", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/mailgun/mailbox/wait_until.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "9802" } ], "symlink_target": "" }
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <X11/Xlib.h> #include <X11/Xatom.h> #include <X11/extensions/XInput.h> #ifdef HAVE_X11_EXTENSIONS_RECORD_H #include <X11/Xproto.h> #include <X11/extensions/record.h> #endif /* HAVE_X11_EXTENSIONS_RECORD_H */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <unistd.h> #include <signal.h> #include <sys/time.h> #include <sys/stat.h> #include "synaptics.h" #include "synaptics-properties.h" typedef enum { TouchpadOn = 0, TouchpadOff = 1, TappingOff = 2 } TouchpadState; static Bool pad_disabled /* internal flag, this does not correspond to device state */; static int ignore_modifier_combos; static int ignore_modifier_keys; static int background; static const char *pid_file; static Display *display; static XDevice *dev; static Atom touchpad_off_prop; static TouchpadState previous_state; static TouchpadState disable_state = TouchpadOff; static int verbose; #define KEYMAP_SIZE 32 static unsigned char keyboard_mask[KEYMAP_SIZE]; static void usage(void) { fprintf(stderr, "Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t] [-k]\n"); fprintf(stderr, " -i How many seconds to wait after the last key press before\n"); fprintf(stderr, " enabling the touchpad. (default is 2.0s)\n"); fprintf(stderr, " -m How many milli-seconds to wait until next poll.\n"); fprintf(stderr, " (default is 200ms)\n"); fprintf(stderr, " -d Start as a daemon, i.e. in the background.\n"); fprintf(stderr, " -p Create a pid file with the specified name.\n"); fprintf(stderr, " -t Only disable tapping and scrolling, not mouse movements.\n"); fprintf(stderr, " -k Ignore modifier keys when monitoring keyboard activity.\n"); fprintf(stderr, " -K Like -k but also ignore Modifier+Key combos.\n"); fprintf(stderr, " -R Use the XRecord extension.\n"); fprintf(stderr, " -v Print diagnostic messages.\n"); exit(1); } static void store_current_touchpad_state(void) { Atom real_type; int real_format; unsigned long nitems, bytes_after; unsigned char *data; if ((XGetDeviceProperty (display, dev, touchpad_off_prop, 0, 1, False, XA_INTEGER, &real_type, &real_format, &nitems, &bytes_after, &data) == Success) && (real_type != None)) { previous_state = data[0]; } } /** * Toggle touchpad enabled/disabled state, decided by value. */ static void toggle_touchpad(Bool enable) { unsigned char data; if (pad_disabled && enable) { data = previous_state; pad_disabled = False; if (verbose) printf("Enable\n"); } else if (!pad_disabled && !enable && previous_state != disable_state && previous_state != TouchpadOff) { store_current_touchpad_state(); pad_disabled = True; data = disable_state; if (verbose) printf("Disable\n"); } else return; /* This potentially overwrites a different client's setting, but ...*/ XChangeDeviceProperty(display, dev, touchpad_off_prop, XA_INTEGER, 8, PropModeReplace, &data, 1); XFlush(display); } static void signal_handler(int signum) { toggle_touchpad(True); if (pid_file) unlink(pid_file); kill(getpid(), signum); } static void install_signal_handler(void) { static int signals[] = { SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, #ifdef SIGPWR SIGPWR #endif }; int i; struct sigaction act; sigset_t set; sigemptyset(&set); act.sa_handler = signal_handler; act.sa_mask = set; #ifdef SA_ONESHOT act.sa_flags = SA_ONESHOT; #else act.sa_flags = 0; #endif for (i = 0; i < sizeof(signals) / sizeof(int); i++) { if (sigaction(signals[i], &act, NULL) == -1) { perror("sigaction"); exit(2); } } } /** * Return non-zero if the keyboard state has changed since the last call. */ static int keyboard_activity(Display *display) { static unsigned char old_key_state[KEYMAP_SIZE]; unsigned char key_state[KEYMAP_SIZE]; int i; int ret = 0; XQueryKeymap(display, (char*)key_state); for (i = 0; i < KEYMAP_SIZE; i++) { if ((key_state[i] & ~old_key_state[i]) & keyboard_mask[i]) { ret = 1; break; } } if (ignore_modifier_combos) { for (i = 0; i < KEYMAP_SIZE; i++) { if (key_state[i] & ~keyboard_mask[i]) { ret = 0; break; } } } for (i = 0; i < KEYMAP_SIZE; i++) old_key_state[i] = key_state[i]; return ret; } static double get_time(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec + tv.tv_usec / 1000000.0; } static void main_loop(Display *display, double idle_time, int poll_delay) { double last_activity = 0.0; double current_time; keyboard_activity(display); for (;;) { current_time = get_time(); if (keyboard_activity(display)) last_activity = current_time; /* If system times goes backwards, touchpad can get locked. Make * sure our last activity wasn't in the future and reset if it was. */ if (last_activity > current_time) last_activity = current_time - idle_time - 1; if (current_time > last_activity + idle_time) { /* Enable touchpad */ toggle_touchpad(True); } else { /* Disable touchpad */ toggle_touchpad(False); } usleep(poll_delay); } } static void clear_bit(unsigned char *ptr, int bit) { int byte_num = bit / 8; int bit_num = bit % 8; ptr[byte_num] &= ~(1 << bit_num); } static void setup_keyboard_mask(Display *display, int ignore_modifier_keys) { XModifierKeymap *modifiers; int i; for (i = 0; i < KEYMAP_SIZE; i++) keyboard_mask[i] = 0xff; if (ignore_modifier_keys) { modifiers = XGetModifierMapping(display); for (i = 0; i < 8 * modifiers->max_keypermod; i++) { KeyCode kc = modifiers->modifiermap[i]; if (kc != 0) clear_bit(keyboard_mask, kc); } XFreeModifiermap(modifiers); } } /* ---- the following code is for using the xrecord extension ----- */ #ifdef HAVE_X11_EXTENSIONS_RECORD_H #define MAX_MODIFIERS 16 /* used for exchanging information with the callback function */ struct xrecord_callback_results { XModifierKeymap *modifiers; Bool key_event; Bool non_modifier_event; KeyCode pressed_modifiers[MAX_MODIFIERS]; }; /* test if the xrecord extension is found */ Bool check_xrecord(Display *display) { Bool found; Status status; int major_opcode, minor_opcode, first_error; int version[2]; found = XQueryExtension(display, "RECORD", &major_opcode, &minor_opcode, &first_error); status = XRecordQueryVersion(display, version, version+1); if (verbose && status) { printf("X RECORD extension version %d.%d\n", version[0], version[1]); } return found; } /* called by XRecordProcessReplies() */ void xrecord_callback( XPointer closure, XRecordInterceptData* recorded_data) { struct xrecord_callback_results *cbres; xEvent *xev; int nxev; cbres = (struct xrecord_callback_results *)closure; if (recorded_data->category != XRecordFromServer) { XRecordFreeData(recorded_data); return; } nxev = recorded_data->data_len / 8; xev = (xEvent *)recorded_data->data; while(nxev--) { if ( (xev->u.u.type == KeyPress) || (xev->u.u.type == KeyRelease)) { int i; int is_modifier = 0; cbres->key_event = 1; /* remember, a key was pressed or released. */ /* test if it was a modifier */ for (i = 0; i < 8 * cbres->modifiers->max_keypermod; i++) { KeyCode kc = cbres->modifiers->modifiermap[i]; if (kc == xev->u.u.detail) { is_modifier = 1; /* yes, it is a modifier. */ break; } } if (is_modifier) { if (xev->u.u.type == KeyPress) { for (i=0; i < MAX_MODIFIERS; ++i) if (!cbres->pressed_modifiers[i]) { cbres->pressed_modifiers[i] = xev->u.u.detail; break; } } else { /* KeyRelease */ for (i=0; i < MAX_MODIFIERS; ++i) if (cbres->pressed_modifiers[i] == xev->u.u.detail) cbres->pressed_modifiers[i] = 0; } } else { /* remember, a non-modifier was pressed. */ cbres->non_modifier_event = 1; } } xev++; } XRecordFreeData(recorded_data); /* cleanup */ } static int is_modifier_pressed(const struct xrecord_callback_results *cbres) { int i; for (i = 0; i < MAX_MODIFIERS; ++i) if (cbres->pressed_modifiers[i]) return 1; return 0; } void record_main_loop(Display* display, double idle_time) { struct xrecord_callback_results cbres; XRecordContext context; XRecordClientSpec cspec = XRecordAllClients; Display *dpy_data; XRecordRange *range; int i; dpy_data = XOpenDisplay(NULL); /* we need an additional data connection. */ range = XRecordAllocRange(); range->device_events.first = KeyPress; range->device_events.last = KeyRelease; context = XRecordCreateContext(dpy_data, 0, &cspec,1, &range, 1); XRecordEnableContextAsync(dpy_data, context, xrecord_callback, (XPointer)&cbres); cbres.modifiers = XGetModifierMapping(display); /* clear list of modifiers */ for (i = 0; i < MAX_MODIFIERS; ++i) cbres.pressed_modifiers[i] = 0; while (1) { int fd = ConnectionNumber(dpy_data); fd_set read_fds; int ret; int disable_event = 0; struct timeval timeout; FD_ZERO(&read_fds); FD_SET(fd, &read_fds); ret = select(fd+1 /* =(max descriptor in read_fds) + 1 */, &read_fds, NULL, NULL, pad_disabled ? &timeout : NULL /* timeout only required for enabling */ ); if (FD_ISSET(fd, &read_fds)) { cbres.key_event = 0; cbres.non_modifier_event = 0; XRecordProcessReplies(dpy_data); /* If there are any events left over, they are in error. Drain them * from the connection queue so we don't get stuck. */ while (XEventsQueued(dpy_data, QueuedAlready) > 0) { XEvent event; XNextEvent(dpy_data, &event); fprintf(stderr, "bad event received, major opcode %d\n", event.type); } /* If there are any events left over, they are in error. Drain them * from the connection queue so we don't get stuck. */ while (XEventsQueued(dpy_data, QueuedAlready) > 0) { XEvent event; XNextEvent(dpy_data, &event); fprintf(stderr, "bad event received, major opcode %d\n", event.type); } if (!ignore_modifier_keys && cbres.key_event) { disable_event = 1; } if (cbres.non_modifier_event && !(ignore_modifier_combos && is_modifier_pressed(&cbres)) ) { disable_event = 1; } } if (disable_event) { /* adjust the enable_time */ timeout.tv_sec = (int)idle_time; timeout.tv_usec = (idle_time-(double)timeout.tv_sec) * 1.e6; toggle_touchpad(False); } if (ret == 0 && pad_disabled) { /* timeout => enable event */ toggle_touchpad(True); if (verbose) printf("enable touchpad\n"); } } /* end while(1) */ XFreeModifiermap(cbres.modifiers); } #endif /* HAVE_X11_EXTENSIONS_RECORD_H */ static XDevice * dp_get_device(Display *dpy) { XDevice* dev = NULL; XDeviceInfo *info = NULL; int ndevices = 0; Atom touchpad_type = 0; Atom *properties = NULL; int nprops = 0; int error = 0; touchpad_type = XInternAtom(dpy, XI_TOUCHPAD, True); touchpad_off_prop = XInternAtom(dpy, SYNAPTICS_PROP_OFF, True); info = XListInputDevices(dpy, &ndevices); while(ndevices--) { if (info[ndevices].type == touchpad_type) { dev = XOpenDevice(dpy, info[ndevices].id); if (!dev) { fprintf(stderr, "Failed to open device '%s'.\n", info[ndevices].name); error = 1; goto unwind; } properties = XListDeviceProperties(dpy, dev, &nprops); if (!properties || !nprops) { fprintf(stderr, "No properties on device '%s'.\n", info[ndevices].name); error = 1; goto unwind; } while(nprops--) { if (properties[nprops] == touchpad_off_prop) break; } if (nprops < 0) { fprintf(stderr, "No synaptics properties on device '%s'.\n", info[ndevices].name); error = 1; goto unwind; } break; /* Yay, device is suitable */ } } unwind: XFree(properties); XFreeDeviceList(info); if (error && dev) { XCloseDevice(dpy, dev); dev = NULL; } return dev; } int main(int argc, char *argv[]) { double idle_time = 2.0; int poll_delay = 200000; /* 200 ms */ int c; int use_xrecord = 0; /* Parse command line parameters */ while ((c = getopt(argc, argv, "i:m:dtp:kKR?v")) != EOF) { switch(c) { case 'i': idle_time = atof(optarg); break; case 'm': poll_delay = atoi(optarg) * 1000; break; case 'd': background = 1; break; case 't': disable_state = TappingOff; break; case 'p': pid_file = optarg; break; case 'k': ignore_modifier_keys = 1; break; case 'K': ignore_modifier_combos = 1; ignore_modifier_keys = 1; break; case 'R': use_xrecord = 1; break; case 'v': verbose = 1; break; default: usage(); break; } } if (idle_time <= 0.0) usage(); /* Open a connection to the X server */ display = XOpenDisplay(NULL); if (!display) { fprintf(stderr, "Can't open display.\n"); exit(2); } if (!(dev = dp_get_device(display))) exit(2); /* Install a signal handler to restore synaptics parameters on exit */ install_signal_handler(); if (background) { pid_t pid; if ((pid = fork()) < 0) { perror("fork"); exit(3); } else if (pid != 0) exit(0); /* Child (daemon) is running here */ setsid(); /* Become session leader */ chdir("/"); /* In case the file system gets unmounted */ umask(0); /* We don't want any surprises */ if (pid_file) { FILE *fd = fopen(pid_file, "w"); if (!fd) { perror("Can't create pid file"); exit(2); } fprintf(fd, "%d\n", getpid()); fclose(fd); } } pad_disabled = False; store_current_touchpad_state(); #ifdef HAVE_X11_EXTENSIONS_RECORD_H if (use_xrecord) { if(check_xrecord(display)) record_main_loop(display, idle_time); else { fprintf(stderr, "Use of XRecord requested, but failed to " " initialize.\n"); exit(2); } } else #endif /* HAVE_X11_EXTENSIONS_RECORD_H */ { setup_keyboard_mask(display, ignore_modifier_keys); /* Run the main loop */ main_loop(display, idle_time, poll_delay); } return 0; }
{ "content_hash": "ef5cd134ac4bd6dd6ee343d278968e1e", "timestamp": "", "source": "github", "line_count": 612, "max_line_length": 88, "avg_line_length": 24.09313725490196, "alnum_prop": 0.6141064767717871, "repo_name": "mnunberg/xserver-xorg-input-magictrack", "id": "bed16d69ae25f682b9f933d1a284dca99c47ee82", "size": "15956", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/syndaemon.c", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "224054" }, { "name": "Shell", "bytes": "784070" } ], "symlink_target": "" }
module.exports = (app) => { const { Validate } = app.service('System'); const mongoose = app.service('Mongoose'); const Plugin = app.service('PluginService'); const ObjectId = mongoose.Schema.Types.ObjectId; const { Schema } = mongoose; const votesSchema = new Schema({ _id: false, user: { type: ObjectId, ref: 'user' }, type: { type: String }, }); const linksSchema = new Schema({ web: { type: String }, apple: { type: String }, google: { type: String }, }); const schema = new Schema({ user: { type: ObjectId, ref: 'user', display: 'email' }, name: { type: String }, email: { type: String }, slug: { type: String }, excerpt: { type: String, field: 'textArea' }, description: { type: String, field: 'richText' }, isEnabled: { type: String, default: 'n' }, isDeleted: { type: Boolean }, createdAt: { type: Date }, expiredAt: { type: Date, field: 'dateTime' }, workers: [{ type: ObjectId, ref: 'user', display: 'email' }], workerCount: { type: Number, default: 0 }, links: { type: linksSchema }, votes: { type: [votesSchema] }, tags: { type: [String] }, photo: { type: String, field: 'image' }, photoArr: { type: [String], field: 'image' }, }, { timestamps: true, }); const attributes = { en: { user: 'User', name: 'Name', email: 'E-mail', slug: 'Slug', description: 'Description', isEnabled: 'Is Enabled?', isDeleted: 'Is Deleted?', createdAt: 'Created At', workerCount: 'Worker Count', links: 'Links', votes: 'Votes', }, }; const rules = { name: 'required|min:4', email: 'email', slug: 'alpha_dash', isEnabled: 'in:y,n', isDeleted: 'boolean', }; Validate(schema, { attributes, rules }); schema.r2options = { attributes, rules }; Plugin.plugins(schema, { patchHistory: { name: 'test' }, modelPatches: true }); return mongoose.model('test', schema); };
{ "content_hash": "ca6dfc41f72018ae546b52aa083c3130", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 81, "avg_line_length": 28.014084507042252, "alnum_prop": 0.5736551030668677, "repo_name": "r2js/r2admin", "id": "84dbb27e91ea09fcaabb4626fb49148310e71b7f", "size": "1989", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "example/model/test.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10564" }, { "name": "HTML", "bytes": "21031" }, { "name": "JavaScript", "bytes": "54353" }, { "name": "Makefile", "bytes": "1273" } ], "symlink_target": "" }
namespace net { namespace internal { // The application layer can pass |policy| defined in net_util.h to // request filtering out certain type of interfaces. bool ShouldIgnoreInterface(const std::string& name, int policy) { // Filter out VMware interfaces, typically named vmnet1 and vmnet8, // which might not be useful for use cases like WebRTC. if ((policy & EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES) && ((name.find("vmnet") != std::string::npos) || (name.find("vnic") != std::string::npos))) { return true; } return false; } // Check if the address is unspecified (i.e. made of zeroes) or loopback. bool IsLoopbackOrUnspecifiedAddress(const sockaddr* addr) { if (addr->sa_family == AF_INET6) { const struct sockaddr_in6* addr_in6 = reinterpret_cast<const struct sockaddr_in6*>(addr); const struct in6_addr* sin6_addr = &addr_in6->sin6_addr; if (IN6_IS_ADDR_LOOPBACK(sin6_addr) || IN6_IS_ADDR_UNSPECIFIED(sin6_addr)) { return true; } } else if (addr->sa_family == AF_INET) { const struct sockaddr_in* addr_in = reinterpret_cast<const struct sockaddr_in*>(addr); if (addr_in->sin_addr.s_addr == INADDR_LOOPBACK || addr_in->sin_addr.s_addr == 0) { return true; } } else { // Skip non-IP addresses. return true; } return false; } } // namespace internal WifiPHYLayerProtocol GetWifiPHYLayerProtocol() { return WIFI_PHY_LAYER_PROTOCOL_UNKNOWN; } std::unique_ptr<ScopedWifiOptions> SetWifiOptions(int options) { return nullptr; } } // namespace net
{ "content_hash": "23a9f51dac6a211c926f084d383b3b36", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 80, "avg_line_length": 30.705882352941178, "alnum_prop": 0.6724137931034483, "repo_name": "chromium/chromium", "id": "ef4b5bf69342886a8d9a9afc9de61ec74c54626b", "size": "1882", "binary": false, "copies": "7", "ref": "refs/heads/main", "path": "net/base/network_interfaces_posix.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
module SidekiqUniqueJobs module Middleware # The unique sidekiq middleware for the server processor # # @author Mikael Henriksson <mikael@mhenrixon.com> class Server include Sidekiq::ServerMiddleware if defined?(Sidekiq::ServerMiddleware) # prepend "SidekiqUniqueJobs::Middleware" # @!parse prepends SidekiqUniqueJobs::Middleware prepend SidekiqUniqueJobs::Middleware # # # Runs the server middleware (used from Sidekiq::Processor#process) # # @see SidekiqUniqueJobs::Middleware#call # # @see https://github.com/mperham/sidekiq/wiki/Job-Format # @see https://github.com/mperham/sidekiq/wiki/Middleware # # @yield when uniqueness is disabled # @yield when owning the lock def call(*, &block) lock_instance.execute(&block) end end end end
{ "content_hash": "e0f819b42e4b017c879415ca63af90f5", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 78, "avg_line_length": 30.103448275862068, "alnum_prop": 0.6678121420389461, "repo_name": "mhenrixon/sidekiq-unique-jobs", "id": "fb7f1f525c3986a8bb2a5f9a1ed196b7c4153204", "size": "904", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "lib/sidekiq_unique_jobs/middleware/server.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "686" }, { "name": "Dockerfile", "bytes": "736" }, { "name": "HTML", "bytes": "12439" }, { "name": "JavaScript", "bytes": "661" }, { "name": "Lua", "bytes": "29943" }, { "name": "Procfile", "bytes": "145" }, { "name": "Ruby", "bytes": "579791" }, { "name": "Shell", "bytes": "4429" }, { "name": "Slim", "bytes": "260" } ], "symlink_target": "" }
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "sqlite3.h" #include "spatialite.h" int main (int argc, char *argv[]) { int ret; sqlite3 *handle; char *err_msg = NULL; sqlite3_int64 log_pk; spatialite_init (0); ret = sqlite3_open_v2 (":memory:", &handle, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL); if (ret != SQLITE_OK) { fprintf(stderr, "cannot open in-memory db: %s\n", sqlite3_errmsg (handle)); sqlite3_close(handle); return -1; } ret = sqlite3_exec (handle, "SELECT InitSpatialMetadata()", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf (stderr, "InitSpatialMetadata() error: %s\n", err_msg); sqlite3_free(err_msg); sqlite3_close(handle); return -2; } ret = sqlite3_exec (handle, "SELECT HasProj()", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf (stderr, "HasProj() error: %s\n", err_msg); sqlite3_free(err_msg); sqlite3_close(handle); return -3; } ret = sqlite3_exec (handle, "SELECT HasGeos()", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf (stderr, "HasGeos() error: %s\n", err_msg); sqlite3_free(err_msg); sqlite3_close(handle); return -4; } ret = sqlite3_exec (handle, "SELECT HasGeosAdvanced()", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf (stderr, "HasGeosAdvanced() error: %s\n", err_msg); sqlite3_free(err_msg); sqlite3_close(handle); return -5; } ret = sqlite3_exec (handle, "SELECT HasIconv()", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf (stderr, "HasIconv() error: %s\n", err_msg); sqlite3_free(err_msg); sqlite3_close(handle); return -6; } ret = sqlite3_exec (handle, "SELECT HasMathSql()", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf (stderr, "HasMathSql() error: %s\n", err_msg); sqlite3_free(err_msg); sqlite3_close(handle); return -7; } ret = sqlite3_exec (handle, "SELECT HasGeoCallbacks()", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf (stderr, "HasGeoCallbacks() error: %s\n", err_msg); sqlite3_free(err_msg); sqlite3_close(handle); return -8; } ret = sqlite3_exec (handle, "SELECT HasFreeXL()", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf (stderr, "HasFreeXL() error: %s\n", err_msg); sqlite3_free(err_msg); sqlite3_close(handle); return -9; } ret = sqlite3_exec (handle, "SELECT HasEpsg()", NULL, NULL, &err_msg); if (ret != SQLITE_OK) { fprintf (stderr, "HasEpsg() error: %s\n", err_msg); sqlite3_free(err_msg); sqlite3_close(handle); return -10; } gaiaInsertIntoSqlLog (handle, "test", "sql_statement_ok", &log_pk); gaiaUpdateSqlLog (handle, log_pk, 1, NULL); gaiaInsertIntoSqlLog (handle, "test", "sql_statement_no", &log_pk); gaiaUpdateSqlLog (handle, log_pk, 0, "some error message"); ret = sqlite3_close (handle); if (ret != SQLITE_OK) { fprintf (stderr, "sqlite3_close() error: %s\n", sqlite3_errmsg (handle)); return -11; } spatialite_cleanup(); return 0; }
{ "content_hash": "82afc38dd953403782d41d2859d73fa9", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 98, "avg_line_length": 30.10891089108911, "alnum_prop": 0.623150279513318, "repo_name": "zhm/node-spatialite", "id": "5ec93e551370b257723f714a190a909d6da6cc7b", "size": "4779", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/spatialite/test/check_create.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "35651" }, { "name": "C", "bytes": "18264738" }, { "name": "C++", "bytes": "4408985" }, { "name": "CMake", "bytes": "42184" }, { "name": "CoffeeScript", "bytes": "908" }, { "name": "Groff", "bytes": "215548" }, { "name": "HTML", "bytes": "189286" }, { "name": "Java", "bytes": "41530" }, { "name": "JavaScript", "bytes": "801" }, { "name": "Lex", "bytes": "22522" }, { "name": "M4", "bytes": "398827" }, { "name": "Makefile", "bytes": "3336163" }, { "name": "PHP", "bytes": "79944" }, { "name": "Python", "bytes": "74016" }, { "name": "Ruby", "bytes": "124452" }, { "name": "Shell", "bytes": "2034710" }, { "name": "Yacc", "bytes": "125002" } ], "symlink_target": "" }
package org.elasticsearch.common.settings; import org.apache.logging.log4j.Logger; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.action.support.ToXContentToBytes; import org.elasticsearch.common.Booleans; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Strings; import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.MemorySizeValue; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.EnumSet; import java.util.HashMap; import java.util.IdentityHashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; /** * A setting. Encapsulates typical stuff like default value, parsing, and scope. * Some (SettingsProperty.Dynamic) can by modified at run time using the API. * All settings inside elasticsearch or in any of the plugins should use this type-safe and generic settings infrastructure * together with {@link AbstractScopedSettings}. This class contains several utility methods that makes it straight forward * to add settings for the majority of the cases. For instance a simple boolean settings can be defined like this: * <pre>{@code * public static final Setting<Boolean>; MY_BOOLEAN = Setting.boolSetting("my.bool.setting", true, SettingsProperty.NodeScope);} * </pre> * To retrieve the value of the setting a {@link Settings} object can be passed directly to the {@link Setting#get(Settings)} method. * <pre> * final boolean myBooleanValue = MY_BOOLEAN.get(settings); * </pre> * It's recommended to use typed settings rather than string based settings. For example adding a setting for an enum type: * <pre>{@code * public enum Color { * RED, GREEN, BLUE; * } * public static final Setting<Color> MY_BOOLEAN = * new Setting<>("my.color.setting", Color.RED.toString(), Color::valueOf, SettingsProperty.NodeScope); * } * </pre> */ public class Setting<T> extends ToXContentToBytes { public enum Property { /** * should be filtered in some api (mask password/credentials) */ Filtered, /** * iff this setting is shared with more than one module ie. can be defined multiple times. */ Shared, /** * iff this setting can be dynamically updateable */ Dynamic, /** * mark this setting as deprecated */ Deprecated, /** * Node scope */ NodeScope, /** * Index scope */ IndexScope } private final Key key; protected final Function<Settings, String> defaultValue; @Nullable private final Setting<T> fallbackSetting; private final Function<String, T> parser; private final EnumSet<Property> properties; private static final EnumSet<Property> EMPTY_PROPERTIES = EnumSet.noneOf(Property.class); private Setting(Key key, @Nullable Setting<T> fallbackSetting, Function<Settings, String> defaultValue, Function<String, T> parser, Property... properties) { assert this instanceof SecureSetting || this.isGroupSetting() || parser.apply(defaultValue.apply(Settings.EMPTY)) != null : "parser returned null"; this.key = key; this.fallbackSetting = fallbackSetting; this.defaultValue = defaultValue; this.parser = parser; if (properties == null) { throw new IllegalArgumentException("properties cannot be null for setting [" + key + "]"); } if (properties.length == 0) { this.properties = EMPTY_PROPERTIES; } else { this.properties = EnumSet.copyOf(Arrays.asList(properties)); } } /** * Creates a new Setting instance * @param key the settings key for this setting. * @param defaultValue a default value function that returns the default values string representation. * @param parser a parser that parses the string rep into a complex datatype. * @param properties properties for this setting like scope, filtering... */ public Setting(Key key, Function<Settings, String> defaultValue, Function<String, T> parser, Property... properties) { this(key, null, defaultValue, parser, properties); } /** * Creates a new Setting instance * @param key the settings key for this setting. * @param defaultValue a default value. * @param parser a parser that parses the string rep into a complex datatype. * @param properties properties for this setting like scope, filtering... */ public Setting(String key, String defaultValue, Function<String, T> parser, Property... properties) { this(key, s -> defaultValue, parser, properties); } /** * Creates a new Setting instance * @param key the settings key for this setting. * @param defaultValue a default value function that returns the default values string representation. * @param parser a parser that parses the string rep into a complex datatype. * @param properties properties for this setting like scope, filtering... */ public Setting(String key, Function<Settings, String> defaultValue, Function<String, T> parser, Property... properties) { this(new SimpleKey(key), defaultValue, parser, properties); } /** * Creates a new Setting instance * @param key the settings key for this setting. * @param fallbackSetting a setting who's value to fallback on if this setting is not defined * @param parser a parser that parses the string rep into a complex datatype. * @param properties properties for this setting like scope, filtering... */ public Setting(Key key, Setting<T> fallbackSetting, Function<String, T> parser, Property... properties) { this(key, fallbackSetting, fallbackSetting::getRaw, parser, properties); } /** * Creates a new Setting instance * @param key the settings key for this setting. * @param fallBackSetting a setting to fall back to if the current setting is not set. * @param parser a parser that parses the string rep into a complex datatype. * @param properties properties for this setting like scope, filtering... */ public Setting(String key, Setting<T> fallBackSetting, Function<String, T> parser, Property... properties) { this(new SimpleKey(key), fallBackSetting, parser, properties); } /** * Returns the settings key or a prefix if this setting is a group setting. * <b>Note: this method should not be used to retrieve a value from a {@link Settings} object. * Use {@link #get(Settings)} instead</b> * * @see #isGroupSetting() */ public final String getKey() { return key.toString(); } /** * Returns the original representation of a setting key. */ public final Key getRawKey() { return key; } /** * Returns <code>true</code> if this setting is dynamically updateable, otherwise <code>false</code> */ public final boolean isDynamic() { return properties.contains(Property.Dynamic); } /** * Returns the setting properties * @see Property */ public EnumSet<Property> getProperties() { return properties; } /** * Returns <code>true</code> if this setting must be filtered, otherwise <code>false</code> */ public boolean isFiltered() { return properties.contains(Property.Filtered); } /** * Returns <code>true</code> if this setting has a node scope, otherwise <code>false</code> */ public boolean hasNodeScope() { return properties.contains(Property.NodeScope); } /** * Returns <code>true</code> if this setting has an index scope, otherwise <code>false</code> */ public boolean hasIndexScope() { return properties.contains(Property.IndexScope); } /** * Returns <code>true</code> if this setting is deprecated, otherwise <code>false</code> */ public boolean isDeprecated() { return properties.contains(Property.Deprecated); } /** * Returns <code>true</code> if this setting is shared with more than one other module or plugin, otherwise <code>false</code> */ public boolean isShared() { return properties.contains(Property.Shared); } /** * Returns <code>true</code> iff this setting is a group setting. Group settings represent a set of settings rather than a single value. * The key, see {@link #getKey()}, in contrast to non-group settings is a prefix like <tt>cluster.store.</tt> that matches all settings * with this prefix. */ boolean isGroupSetting() { return false; } boolean hasComplexMatcher() { return isGroupSetting(); } /** * Returns the default value string representation for this setting. * @param settings a settings object for settings that has a default value depending on another setting if available */ public String getDefaultRaw(Settings settings) { return defaultValue.apply(settings); } /** * Returns the default value for this setting. * @param settings a settings object for settings that has a default value depending on another setting if available */ public T getDefault(Settings settings) { return parser.apply(getDefaultRaw(settings)); } /** * Returns <code>true</code> iff this setting is present in the given settings object. Otherwise <code>false</code> */ public boolean exists(Settings settings) { return settings.getAsMap().containsKey(getKey()); } /** * Returns the settings value. If the setting is not present in the given settings object the default value is returned * instead. */ public T get(Settings settings) { String value = getRaw(settings); try { return parser.apply(value); } catch (ElasticsearchParseException ex) { throw new IllegalArgumentException(ex.getMessage(), ex); } catch (NumberFormatException ex) { throw new IllegalArgumentException("Failed to parse value [" + value + "] for setting [" + getKey() + "]", ex); } catch (IllegalArgumentException ex) { throw ex; } catch (Exception t) { throw new IllegalArgumentException("Failed to parse value [" + value + "] for setting [" + getKey() + "]", t); } } /** * Add this setting to the builder if it doesn't exists in the source settings. * The value added to the builder is taken from the given default settings object. * @param builder the settings builder to fill the diff into * @param source the source settings object to diff * @param defaultSettings the default settings object to diff against */ public void diff(Settings.Builder builder, Settings source, Settings defaultSettings) { if (exists(source) == false) { builder.put(getKey(), getRaw(defaultSettings)); } } /** * Returns the raw (string) settings value. If the setting is not present in the given settings object the default value is returned * instead. This is useful if the value can't be parsed due to an invalid value to access the actual value. */ public String getRaw(Settings settings) { checkDeprecation(settings); return settings.get(getKey(), defaultValue.apply(settings)); } /** Logs a deprecation warning if the setting is deprecated and used. */ protected void checkDeprecation(Settings settings) { // They're using the setting, so we need to tell them to stop if (this.isDeprecated() && this.exists(settings)) { // It would be convenient to show its replacement key, but replacement is often not so simple final DeprecationLogger deprecationLogger = new DeprecationLogger(Loggers.getLogger(getClass())); deprecationLogger.deprecated("[{}] setting was deprecated in Elasticsearch and will be removed in a future release! " + "See the breaking changes documentation for the next major version.", getKey()); } } /** * Returns <code>true</code> iff the given key matches the settings key or if this setting is a group setting if the * given key is part of the settings group. * @see #isGroupSetting() */ public final boolean match(String toTest) { return key.match(toTest); } @Override public final XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(); builder.field("key", key.toString()); builder.field("properties", properties); builder.field("is_group_setting", isGroupSetting()); builder.field("default", defaultValue.apply(Settings.EMPTY)); builder.endObject(); return builder; } /** * Returns the value for this setting but falls back to the second provided settings object */ public final T get(Settings primary, Settings secondary) { if (exists(primary)) { return get(primary); } if (fallbackSetting == null) { return get(secondary); } if (exists(secondary)) { return get(secondary); } if (fallbackSetting.exists(primary)) { return fallbackSetting.get(primary); } return fallbackSetting.get(secondary); } public Setting<T> getConcreteSetting(String key) { // we use startsWith here since the key might be foo.bar.0 if it's an array assert key.startsWith(this.getKey()) : "was " + key + " expected: " + getKey(); return this; } /** * Build a new updater with a noop validator. */ final AbstractScopedSettings.SettingUpdater<T> newUpdater(Consumer<T> consumer, Logger logger) { return newUpdater(consumer, logger, (s) -> {}); } /** * Build the updater responsible for validating new values, logging the new * value, and eventually setting the value where it belongs. */ AbstractScopedSettings.SettingUpdater<T> newUpdater(Consumer<T> consumer, Logger logger, Consumer<T> validator) { if (isDynamic()) { return new Updater(consumer, logger, validator); } else { throw new IllegalStateException("setting [" + getKey() + "] is not dynamic"); } } /** * Updates settings that depend on each other. * See {@link AbstractScopedSettings#addSettingsUpdateConsumer(Setting, Setting, BiConsumer)} and its usage for details. */ static <A, B> AbstractScopedSettings.SettingUpdater<Tuple<A, B>> compoundUpdater(final BiConsumer<A, B> consumer, final Setting<A> aSetting, final Setting<B> bSetting, Logger logger) { final AbstractScopedSettings.SettingUpdater<A> aSettingUpdater = aSetting.newUpdater(null, logger); final AbstractScopedSettings.SettingUpdater<B> bSettingUpdater = bSetting.newUpdater(null, logger); return new AbstractScopedSettings.SettingUpdater<Tuple<A, B>>() { @Override public boolean hasChanged(Settings current, Settings previous) { return aSettingUpdater.hasChanged(current, previous) || bSettingUpdater.hasChanged(current, previous); } @Override public Tuple<A, B> getValue(Settings current, Settings previous) { return new Tuple<>(aSettingUpdater.getValue(current, previous), bSettingUpdater.getValue(current, previous)); } @Override public void apply(Tuple<A, B> value, Settings current, Settings previous) { if (aSettingUpdater.hasChanged(current, previous)) { logger.info("updating [{}] from [{}] to [{}]", aSetting.key, aSetting.getRaw(previous), aSetting.getRaw(current)); } if (bSettingUpdater.hasChanged(current, previous)) { logger.info("updating [{}] from [{}] to [{}]", bSetting.key, bSetting.getRaw(previous), bSetting.getRaw(current)); } consumer.accept(value.v1(), value.v2()); } @Override public String toString() { return "CompoundUpdater for: " + aSettingUpdater + " and " + bSettingUpdater; } }; } public static class AffixSetting<T> extends Setting<T> { private final AffixKey key; private final Function<String, Setting<T>> delegateFactory; public AffixSetting(AffixKey key, Setting<T> delegate, Function<String, Setting<T>> delegateFactory) { super(key, delegate.defaultValue, delegate.parser, delegate.properties.toArray(new Property[0])); this.key = key; this.delegateFactory = delegateFactory; } boolean isGroupSetting() { return true; } private Stream<String> matchStream(Settings settings) { return settings.getAsMap().keySet().stream().filter((key) -> match(key)).map(settingKey -> key.getConcreteString(settingKey)); } AbstractScopedSettings.SettingUpdater<Map<AbstractScopedSettings.SettingUpdater<T>, T>> newAffixUpdater( BiConsumer<String, T> consumer, Logger logger, BiConsumer<String, T> validator) { return new AbstractScopedSettings.SettingUpdater<Map<AbstractScopedSettings.SettingUpdater<T>, T>>() { @Override public boolean hasChanged(Settings current, Settings previous) { return Stream.concat(matchStream(current), matchStream(previous)).findAny().isPresent(); } @Override public Map<AbstractScopedSettings.SettingUpdater<T>, T> getValue(Settings current, Settings previous) { // we collect all concrete keys and then delegate to the actual setting for validation and settings extraction final Map<AbstractScopedSettings.SettingUpdater<T>, T> result = new IdentityHashMap<>(); Stream.concat(matchStream(current), matchStream(previous)).distinct().forEach(aKey -> { String namespace = key.getNamespace(aKey); AbstractScopedSettings.SettingUpdater<T> updater = getConcreteSetting(aKey).newUpdater((v) -> consumer.accept(namespace, v), logger, (v) -> validator.accept(namespace, v)); if (updater.hasChanged(current, previous)) { // only the ones that have changed otherwise we might get too many updates // the hasChanged above checks only if there are any changes T value = updater.getValue(current, previous); result.put(updater, value); } }); return result; } @Override public void apply(Map<AbstractScopedSettings.SettingUpdater<T>, T> value, Settings current, Settings previous) { for (Map.Entry<AbstractScopedSettings.SettingUpdater<T>, T> entry : value.entrySet()) { entry.getKey().apply(entry.getValue(), current, previous); } } }; } @Override public T get(Settings settings) { throw new UnsupportedOperationException("affix settings can't return values" + " use #getConcreteSetting to obtain a concrete setting"); } @Override public String getRaw(Settings settings) { throw new UnsupportedOperationException("affix settings can't return values" + " use #getConcreteSetting to obtain a concrete setting"); } @Override public Setting<T> getConcreteSetting(String key) { if (match(key)) { return delegateFactory.apply(key); } else { throw new IllegalArgumentException("key [" + key + "] must match [" + getKey() + "] but didn't."); } } /** * Get a setting with the given namespace filled in for prefix and suffix. */ public Setting<T> getConcreteSettingForNamespace(String namespace) { String fullKey = key.toConcreteKey(namespace).toString(); return getConcreteSetting(fullKey); } @Override public void diff(Settings.Builder builder, Settings source, Settings defaultSettings) { matchStream(defaultSettings).forEach((key) -> getConcreteSetting(key).diff(builder, source, defaultSettings)); } /** * Returns the namespace for a concrete settting. Ie. an affix setting with prefix: <tt>search.</tt> and suffix: <tt>username</tt> * will return <tt>remote</tt> as a namespace for the setting <tt>search.remote.username</tt> */ public String getNamespace(Setting<T> concreteSetting) { return key.getNamespace(concreteSetting.getKey()); } /** * Returns a stream of all concrete setting instances for the given settings. AffixSetting is only a specification, concrete * settings depend on an actual set of setting keys. */ public Stream<Setting<T>> getAllConcreteSettings(Settings settings) { return matchStream(settings).distinct().map(this::getConcreteSetting); } } private final class Updater implements AbstractScopedSettings.SettingUpdater<T> { private final Consumer<T> consumer; private final Logger logger; private final Consumer<T> accept; Updater(Consumer<T> consumer, Logger logger, Consumer<T> accept) { this.consumer = consumer; this.logger = logger; this.accept = accept; } @Override public String toString() { return "Updater for: " + Setting.this.toString(); } @Override public boolean hasChanged(Settings current, Settings previous) { final String newValue = getRaw(current); final String value = getRaw(previous); assert isGroupSetting() == false : "group settings must override this method"; assert value != null : "value was null but can't be unless default is null which is invalid"; return value.equals(newValue) == false; } @Override public T getValue(Settings current, Settings previous) { final String newValue = getRaw(current); final String value = getRaw(previous); T inst = get(current); try { accept.accept(inst); } catch (Exception | AssertionError e) { throw new IllegalArgumentException("illegal value can't update [" + key + "] from [" + value + "] to [" + newValue + "]", e); } return inst; } @Override public void apply(T value, Settings current, Settings previous) { logger.info("updating [{}] from [{}] to [{}]", key, getRaw(previous), getRaw(current)); consumer.accept(value); } } public static Setting<Float> floatSetting(String key, float defaultValue, Property... properties) { return new Setting<>(key, (s) -> Float.toString(defaultValue), Float::parseFloat, properties); } public static Setting<Float> floatSetting(String key, float defaultValue, float minValue, Property... properties) { return new Setting<>(key, (s) -> Float.toString(defaultValue), (s) -> { float value = Float.parseFloat(s); if (value < minValue) { throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be >= " + minValue); } return value; }, properties); } public static Setting<Integer> intSetting(String key, int defaultValue, int minValue, int maxValue, Property... properties) { return new Setting<>(key, (s) -> Integer.toString(defaultValue), (s) -> parseInt(s, minValue, maxValue, key), properties); } public static Setting<Integer> intSetting(String key, int defaultValue, int minValue, Property... properties) { return new Setting<>(key, (s) -> Integer.toString(defaultValue), (s) -> parseInt(s, minValue, key), properties); } public static Setting<Integer> intSetting(String key, Setting<Integer> fallbackSetting, int minValue, Property... properties) { return new Setting<>(key, fallbackSetting, (s) -> parseInt(s, minValue, key), properties); } public static Setting<Long> longSetting(String key, long defaultValue, long minValue, Property... properties) { return new Setting<>(key, (s) -> Long.toString(defaultValue), (s) -> parseLong(s, minValue, key), properties); } public static Setting<String> simpleString(String key, Property... properties) { return new Setting<>(key, s -> "", Function.identity(), properties); } public static int parseInt(String s, int minValue, String key) { return parseInt(s, minValue, Integer.MAX_VALUE, key); } public static int parseInt(String s, int minValue, int maxValue, String key) { int value = Integer.parseInt(s); if (value < minValue) { throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be >= " + minValue); } if (value > maxValue) { throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be <= " + maxValue); } return value; } public static long parseLong(String s, long minValue, String key) { long value = Long.parseLong(s); if (value < minValue) { throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be >= " + minValue); } return value; } public static TimeValue parseTimeValue(String s, TimeValue minValue, String key) { TimeValue timeValue = TimeValue.parseTimeValue(s, null, key); if (timeValue.millis() < minValue.millis()) { throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be >= " + minValue); } return timeValue; } public static Setting<Integer> intSetting(String key, int defaultValue, Property... properties) { return intSetting(key, defaultValue, Integer.MIN_VALUE, properties); } public static Setting<Boolean> boolSetting(String key, boolean defaultValue, Property... properties) { return new Setting<>(key, (s) -> Boolean.toString(defaultValue), Booleans::parseBoolean, properties); } public static Setting<Boolean> boolSetting(String key, Setting<Boolean> fallbackSetting, Property... properties) { return new Setting<>(key, fallbackSetting, Booleans::parseBoolean, properties); } public static Setting<Boolean> boolSetting(String key, Function<Settings, String> defaultValueFn, Property... properties) { return new Setting<>(key, defaultValueFn, Booleans::parseBoolean, properties); } public static Setting<ByteSizeValue> byteSizeSetting(String key, ByteSizeValue value, Property... properties) { return byteSizeSetting(key, (s) -> value.toString(), properties); } public static Setting<ByteSizeValue> byteSizeSetting(String key, Setting<ByteSizeValue> fallbackSetting, Property... properties) { return new Setting<>(key, fallbackSetting, (s) -> ByteSizeValue.parseBytesSizeValue(s, key), properties); } public static Setting<ByteSizeValue> byteSizeSetting(String key, Function<Settings, String> defaultValue, Property... properties) { return new Setting<>(key, defaultValue, (s) -> ByteSizeValue.parseBytesSizeValue(s, key), properties); } public static Setting<ByteSizeValue> byteSizeSetting(String key, ByteSizeValue defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, Property... properties) { return byteSizeSetting(key, (s) -> defaultValue.toString(), minValue, maxValue, properties); } public static Setting<ByteSizeValue> byteSizeSetting(String key, Function<Settings, String> defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, Property... properties) { return new Setting<>(key, defaultValue, (s) -> parseByteSize(s, minValue, maxValue, key), properties); } public static ByteSizeValue parseByteSize(String s, ByteSizeValue minValue, ByteSizeValue maxValue, String key) { ByteSizeValue value = ByteSizeValue.parseBytesSizeValue(s, key); if (value.getBytes() < minValue.getBytes()) { throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be >= " + minValue); } if (value.getBytes() > maxValue.getBytes()) { throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be <= " + maxValue); } return value; } /** * Creates a setting which specifies a memory size. This can either be * specified as an absolute bytes value or as a percentage of the heap * memory. * * @param key the key for the setting * @param defaultValue the default value for this setting * @param properties properties properties for this setting like scope, filtering... * @return the setting object */ public static Setting<ByteSizeValue> memorySizeSetting(String key, ByteSizeValue defaultValue, Property... properties) { return memorySizeSetting(key, (s) -> defaultValue.toString(), properties); } /** * Creates a setting which specifies a memory size. This can either be * specified as an absolute bytes value or as a percentage of the heap * memory. * * @param key the key for the setting * @param defaultValue a function that supplies the default value for this setting * @param properties properties properties for this setting like scope, filtering... * @return the setting object */ public static Setting<ByteSizeValue> memorySizeSetting(String key, Function<Settings, String> defaultValue, Property... properties) { return new Setting<>(key, defaultValue, (s) -> MemorySizeValue.parseBytesSizeValueOrHeapRatio(s, key), properties); } /** * Creates a setting which specifies a memory size. This can either be * specified as an absolute bytes value or as a percentage of the heap * memory. * * @param key the key for the setting * @param defaultPercentage the default value of this setting as a percentage of the heap memory * @param properties properties properties for this setting like scope, filtering... * @return the setting object */ public static Setting<ByteSizeValue> memorySizeSetting(String key, String defaultPercentage, Property... properties) { return new Setting<>(key, (s) -> defaultPercentage, (s) -> MemorySizeValue.parseBytesSizeValueOrHeapRatio(s, key), properties); } public static <T> Setting<List<T>> listSetting(String key, List<String> defaultStringValue, Function<String, T> singleValueParser, Property... properties) { return listSetting(key, (s) -> defaultStringValue, singleValueParser, properties); } // TODO this one's two argument get is still broken public static <T> Setting<List<T>> listSetting(String key, Setting<List<T>> fallbackSetting, Function<String, T> singleValueParser, Property... properties) { return listSetting(key, (s) -> parseableStringToList(fallbackSetting.getRaw(s)), singleValueParser, properties); } public static <T> Setting<List<T>> listSetting(String key, Function<Settings, List<String>> defaultStringValue, Function<String, T> singleValueParser, Property... properties) { if (defaultStringValue.apply(Settings.EMPTY) == null) { throw new IllegalArgumentException("default value function must not return null"); } Function<String, List<T>> parser = (s) -> parseableStringToList(s).stream().map(singleValueParser).collect(Collectors.toList()); return new Setting<List<T>>(new ListKey(key), (s) -> arrayToParsableString(defaultStringValue.apply(s).toArray(Strings.EMPTY_ARRAY)), parser, properties) { @Override public String getRaw(Settings settings) { String[] array = settings.getAsArray(getKey(), null); return array == null ? defaultValue.apply(settings) : arrayToParsableString(array); } @Override boolean hasComplexMatcher() { return true; } @Override public boolean exists(Settings settings) { boolean exists = super.exists(settings); return exists || settings.get(getKey() + ".0") != null; } @Override public void diff(Settings.Builder builder, Settings source, Settings defaultSettings) { if (exists(source) == false) { String[] asArray = defaultSettings.getAsArray(getKey(), null); if (asArray == null) { builder.putArray(getKey(), defaultStringValue.apply(defaultSettings)); } else { builder.putArray(getKey(), asArray); } } } }; } private static List<String> parseableStringToList(String parsableString) { // EMPTY is safe here because we never call namedObject try (XContentParser xContentParser = XContentType.JSON.xContent().createParser(NamedXContentRegistry.EMPTY, parsableString)) { XContentParser.Token token = xContentParser.nextToken(); if (token != XContentParser.Token.START_ARRAY) { throw new IllegalArgumentException("expected START_ARRAY but got " + token); } ArrayList<String> list = new ArrayList<>(); while ((token = xContentParser.nextToken()) != XContentParser.Token.END_ARRAY) { if (token != XContentParser.Token.VALUE_STRING) { throw new IllegalArgumentException("expected VALUE_STRING but got " + token); } list.add(xContentParser.text()); } return list; } catch (IOException e) { throw new IllegalArgumentException("failed to parse array", e); } } private static String arrayToParsableString(String[] array) { try { XContentBuilder builder = XContentBuilder.builder(XContentType.JSON.xContent()); builder.startArray(); for (String element : array) { builder.value(element); } builder.endArray(); return builder.string(); } catch (IOException ex) { throw new ElasticsearchException(ex); } } public static Setting<Settings> groupSetting(String key, Property... properties) { return groupSetting(key, (s) -> {}, properties); } public static Setting<Settings> groupSetting(String key, Consumer<Settings> validator, Property... properties) { return new Setting<Settings>(new GroupKey(key), (s) -> "", (s) -> null, properties) { @Override public boolean isGroupSetting() { return true; } @Override public String getRaw(Settings settings) { Settings subSettings = get(settings); try { XContentBuilder builder = XContentFactory.jsonBuilder(); builder.startObject(); subSettings.toXContent(builder, EMPTY_PARAMS); builder.endObject(); return builder.string(); } catch (IOException e) { throw new RuntimeException(e); } } @Override public Settings get(Settings settings) { Settings byPrefix = settings.getByPrefix(getKey()); validator.accept(byPrefix); return byPrefix; } @Override public boolean exists(Settings settings) { for (Map.Entry<String, String> entry : settings.getAsMap().entrySet()) { if (entry.getKey().startsWith(key)) { return true; } } return false; } @Override public void diff(Settings.Builder builder, Settings source, Settings defaultSettings) { Map<String, String> leftGroup = get(source).getAsMap(); Settings defaultGroup = get(defaultSettings); for (Map.Entry<String, String> entry : defaultGroup.getAsMap().entrySet()) { if (leftGroup.containsKey(entry.getKey()) == false) { builder.put(getKey() + entry.getKey(), entry.getValue()); } } } @Override public AbstractScopedSettings.SettingUpdater<Settings> newUpdater(Consumer<Settings> consumer, Logger logger, Consumer<Settings> validator) { if (isDynamic() == false) { throw new IllegalStateException("setting [" + getKey() + "] is not dynamic"); } final Setting<?> setting = this; return new AbstractScopedSettings.SettingUpdater<Settings>() { @Override public boolean hasChanged(Settings current, Settings previous) { Settings currentSettings = get(current); Settings previousSettings = get(previous); return currentSettings.equals(previousSettings) == false; } @Override public Settings getValue(Settings current, Settings previous) { Settings currentSettings = get(current); Settings previousSettings = get(previous); try { validator.accept(currentSettings); } catch (Exception | AssertionError e) { throw new IllegalArgumentException("illegal value can't update [" + key + "] from [" + previousSettings.getAsMap() + "] to [" + currentSettings.getAsMap() + "]", e); } return currentSettings; } @Override public void apply(Settings value, Settings current, Settings previous) { if (logger.isInfoEnabled()) { // getRaw can create quite some objects logger.info("updating [{}] from [{}] to [{}]", key, getRaw(previous), getRaw(current)); } consumer.accept(value); } @Override public String toString() { return "Updater for: " + setting.toString(); } }; } }; } public static Setting<TimeValue> timeSetting(String key, Function<Settings, TimeValue> defaultValue, TimeValue minValue, Property... properties) { return new Setting<>(key, (s) -> defaultValue.apply(s).getStringRep(), (s) -> { TimeValue timeValue = TimeValue.parseTimeValue(s, null, key); if (timeValue.millis() < minValue.millis()) { throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be >= " + minValue); } return timeValue; }, properties); } public static Setting<TimeValue> timeSetting(String key, TimeValue defaultValue, TimeValue minValue, Property... properties) { return timeSetting(key, (s) -> defaultValue, minValue, properties); } public static Setting<TimeValue> timeSetting(String key, TimeValue defaultValue, Property... properties) { return new Setting<>(key, (s) -> defaultValue.getStringRep(), (s) -> TimeValue.parseTimeValue(s, key), properties); } public static Setting<TimeValue> timeSetting(String key, Setting<TimeValue> fallbackSetting, Property... properties) { return new Setting<>(key, fallbackSetting, (s) -> TimeValue.parseTimeValue(s, key), properties); } public static Setting<TimeValue> positiveTimeSetting(String key, TimeValue defaultValue, Property... properties) { return timeSetting(key, defaultValue, TimeValue.timeValueMillis(0), properties); } public static Setting<Double> doubleSetting(String key, double defaultValue, double minValue, Property... properties) { return new Setting<>(key, (s) -> Double.toString(defaultValue), (s) -> { final double d = Double.parseDouble(s); if (d < minValue) { throw new IllegalArgumentException("Failed to parse value [" + s + "] for setting [" + key + "] must be >= " + minValue); } return d; }, properties); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Setting<?> setting = (Setting<?>) o; return Objects.equals(key, setting.key); } @Override public int hashCode() { return Objects.hash(key); } /** * This setting type allows to validate settings that have the same type and a common prefix. For instance feature.${type}=[true|false] * can easily be added with this setting. Yet, prefix key settings don't support updaters out of the box unless * {@link #getConcreteSetting(String)} is used to pull the updater. */ public static <T> AffixSetting<T> prefixKeySetting(String prefix, Function<String, Setting<T>> delegateFactory) { return affixKeySetting(new AffixKey(prefix), delegateFactory); } /** * This setting type allows to validate settings that have the same type and a common prefix and suffix. For instance * storage.${backend}.enable=[true|false] can easily be added with this setting. Yet, affix key settings don't support updaters * out of the box unless {@link #getConcreteSetting(String)} is used to pull the updater. */ public static <T> AffixSetting<T> affixKeySetting(String prefix, String suffix, Function<String, Setting<T>> delegateFactory) { return affixKeySetting(new AffixKey(prefix, suffix), delegateFactory); } private static <T> AffixSetting<T> affixKeySetting(AffixKey key, Function<String, Setting<T>> delegateFactory) { Setting<T> delegate = delegateFactory.apply("_na_"); return new AffixSetting<>(key, delegate, delegateFactory); }; public interface Key { boolean match(String key); } public static class SimpleKey implements Key { protected final String key; public SimpleKey(String key) { this.key = key; } @Override public boolean match(String key) { return this.key.equals(key); } @Override public String toString() { return key; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SimpleKey simpleKey = (SimpleKey) o; return Objects.equals(key, simpleKey.key); } @Override public int hashCode() { return Objects.hash(key); } } public static final class GroupKey extends SimpleKey { public GroupKey(String key) { super(key); if (key.endsWith(".") == false) { throw new IllegalArgumentException("key must end with a '.'"); } } @Override public boolean match(String toTest) { return Regex.simpleMatch(key + "*", toTest); } } public static final class ListKey extends SimpleKey { private final Pattern pattern; public ListKey(String key) { super(key); this.pattern = Pattern.compile(Pattern.quote(key) + "(\\.\\d+)?"); } @Override public boolean match(String toTest) { return pattern.matcher(toTest).matches(); } } /** * A key that allows for static pre and suffix. This is used for settings * that have dynamic namespaces like for different accounts etc. */ public static final class AffixKey implements Key { private final Pattern pattern; private final String prefix; private final String suffix; AffixKey(String prefix) { this(prefix, null); } AffixKey(String prefix, String suffix) { assert prefix != null || suffix != null: "Either prefix or suffix must be non-null"; this.prefix = prefix; if (prefix.endsWith(".") == false) { throw new IllegalArgumentException("prefix must end with a '.'"); } this.suffix = suffix; if (suffix == null) { pattern = Pattern.compile("(" + Pattern.quote(prefix) + "((?:[-\\w]+[.])*[-\\w]+$))"); } else { // the last part of this regexp is for lists since they are represented as x.${namespace}.y.1, x.${namespace}.y.2 pattern = Pattern.compile("(" + Pattern.quote(prefix) + "([-\\w]+)\\." + Pattern.quote(suffix) + ")(?:\\.\\d+)?"); } } @Override public boolean match(String key) { return pattern.matcher(key).matches(); } /** * Returns a string representation of the concrete setting key */ String getConcreteString(String key) { Matcher matcher = pattern.matcher(key); if (matcher.matches() == false) { throw new IllegalStateException("can't get concrete string for key " + key + " key doesn't match"); } return matcher.group(1); } /** * Returns a string representation of the concrete setting key */ String getNamespace(String key) { Matcher matcher = pattern.matcher(key); if (matcher.matches() == false) { throw new IllegalStateException("can't get concrete string for key " + key + " key doesn't match"); } return matcher.group(2); } public SimpleKey toConcreteKey(String missingPart) { StringBuilder key = new StringBuilder(); if (prefix != null) { key.append(prefix); } key.append(missingPart); if (suffix != null) { key.append("."); key.append(suffix); } return new SimpleKey(key.toString()); } @Override public String toString() { StringBuilder sb = new StringBuilder(); if (prefix != null) { sb.append(prefix); } if (suffix != null) { sb.append('*'); sb.append('.'); sb.append(suffix); } return sb.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AffixKey that = (AffixKey) o; return Objects.equals(prefix, that.prefix) && Objects.equals(suffix, that.suffix); } @Override public int hashCode() { return Objects.hash(prefix, suffix); } } }
{ "content_hash": "b542c85e585de190201e9d903a9400d2", "timestamp": "", "source": "github", "line_count": 1172, "max_line_length": 140, "avg_line_length": 42.64249146757679, "alnum_prop": 0.6124417231926687, "repo_name": "nilabhsagar/elasticsearch", "id": "bd275fde54c9953ff794c918a7898fb5927c0dd7", "size": "50765", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "core/src/main/java/org/elasticsearch/common/settings/Setting.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "11081" }, { "name": "Batchfile", "bytes": "14100" }, { "name": "Emacs Lisp", "bytes": "3341" }, { "name": "FreeMarker", "bytes": "45" }, { "name": "Groovy", "bytes": "312126" }, { "name": "HTML", "bytes": "3399" }, { "name": "Java", "bytes": "39762598" }, { "name": "Perl", "bytes": "7271" }, { "name": "Python", "bytes": "54851" }, { "name": "Shell", "bytes": "108734" } ], "symlink_target": "" }
var colorConsole = typeof document === 'object' ? require('color-console') : require('../index'); colorConsole.black('you should see black text') colorConsole.red('you should see red text') colorConsole.green('you should see green text') colorConsole.yellow('you should see yellow text') colorConsole.blue('you should see blue text') colorConsole.magenta('you should see magenta text') colorConsole.cyan('you should see cyan text') colorConsole.white('you should see white text') colorConsole.grey('you should see grey text')
{ "content_hash": "4d900e862767a9744d951013002e9014", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 97, "avg_line_length": 47.90909090909091, "alnum_prop": 0.7666034155597723, "repo_name": "RJ15/FixIt", "id": "361e1caf2a409fd07c4e71d4e4db7c80bbed1e92", "size": "527", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "badminton-app/node_modules/color-console/test/color-console.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "31002" }, { "name": "HTML", "bytes": "48875" }, { "name": "JavaScript", "bytes": "351209" }, { "name": "TypeScript", "bytes": "5863" } ], "symlink_target": "" }
app.service('holidayService', function($q) { var getHoliday = function(min, max){ var defer = $q.defer(); var Holiday = Parse.Object.extend("Holiday"); var query = new Parse.Query(Holiday); if(min && max){ query.greaterThanOrEqualTo('startTime', min); query.lessThan('startTime', max); } query.ascending('startTime'); query.find({ success: function(results) { defer.resolve(results); }, error: function(error) { defer.reject(error); alert("Error: " + error.code + " " + error.message); } }); return defer.promise; }; return { getHoliday: getHoliday }; });
{ "content_hash": "146a4ded58d44a23abd3310eca51d801", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 56, "avg_line_length": 18.727272727272727, "alnum_prop": 0.627831715210356, "repo_name": "vynci/deped-tas", "id": "d948bf16e16a4290873c85fbca6e3f6e8747badd", "size": "618", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/scripts/services/holidayService.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "24139" }, { "name": "CSS", "bytes": "11102" }, { "name": "HTML", "bytes": "209983" }, { "name": "JavaScript", "bytes": "310385" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_22) on Thu Nov 11 09:12:14 EST 2010 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> org.mortbay.servlet (Jetty Server Project 6.1.26 API) </TITLE> <META NAME="date" CONTENT="2010-11-11"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../javadoc.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <FONT size="+1" CLASS="FrameTitleFont"> <A HREF="../../../org/mortbay/servlet/package-summary.html" target="classFrame">org.mortbay.servlet</A></FONT> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Classes</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="CGI.html" title="class in org.mortbay.servlet" target="classFrame">CGI</A> <BR> <A HREF="ConcatServlet.html" title="class in org.mortbay.servlet" target="classFrame">ConcatServlet</A> <BR> <A HREF="DoSFilter.html" title="class in org.mortbay.servlet" target="classFrame">DoSFilter</A> <BR> <A HREF="GzipFilter.html" title="class in org.mortbay.servlet" target="classFrame">GzipFilter</A> <BR> <A HREF="GzipFilter.GzipStream.html" title="class in org.mortbay.servlet" target="classFrame">GzipFilter.GzipStream</A> <BR> <A HREF="MultiPartFilter.html" title="class in org.mortbay.servlet" target="classFrame">MultiPartFilter</A> <BR> <A HREF="NoJspServlet.html" title="class in org.mortbay.servlet" target="classFrame">NoJspServlet</A> <BR> <A HREF="ProxyServlet.html" title="class in org.mortbay.servlet" target="classFrame">ProxyServlet</A> <BR> <A HREF="ProxyServlet.Transparent.html" title="class in org.mortbay.servlet" target="classFrame">ProxyServlet.Transparent</A> <BR> <A HREF="PutFilter.html" title="class in org.mortbay.servlet" target="classFrame">PutFilter</A> <BR> <A HREF="QoSFilter.html" title="class in org.mortbay.servlet" target="classFrame">QoSFilter</A> <BR> <A HREF="RestFilter.html" title="class in org.mortbay.servlet" target="classFrame">RestFilter</A> <BR> <A HREF="ThrottlingFilter.html" title="class in org.mortbay.servlet" target="classFrame">ThrottlingFilter</A> <BR> <A HREF="UserAgentFilter.html" title="class in org.mortbay.servlet" target="classFrame">UserAgentFilter</A> <BR> <A HREF="WelcomeFilter.html" title="class in org.mortbay.servlet" target="classFrame">WelcomeFilter</A></FONT></TD> </TR> </TABLE> </BODY> </HTML>
{ "content_hash": "52d6cc754c230493c6d9ead7f0866b2a", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 125, "avg_line_length": 40.704918032786885, "alnum_prop": 0.7257349979863069, "repo_name": "napcs/qedserver", "id": "c6f5258c7ea4f888524755669536159b0202d0aa", "size": "2483", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jetty/javadoc/org/mortbay/servlet/package-frame.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "16295" }, { "name": "CSS", "bytes": "14847" }, { "name": "Groovy", "bytes": "7099" }, { "name": "HTML", "bytes": "14346" }, { "name": "Java", "bytes": "5514807" }, { "name": "JavaScript", "bytes": "34952" }, { "name": "Ruby", "bytes": "53583" }, { "name": "Shell", "bytes": "68984" }, { "name": "XSLT", "bytes": "7153" } ], "symlink_target": "" }