text
stringlengths
2
1.04M
meta
dict
package com.twu.biblioteca.model; public interface Item { boolean hasTitle(String itemName); }
{ "content_hash": "c86f7838aa440bf9469ee2838a28c19f", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 38, "avg_line_length": 20, "alnum_prop": 0.76, "repo_name": "Prasannasaraf/twu-biblioteca-prasanna", "id": "4b4b3f85f5129e056e0f065710c3a2db89c6639a", "size": "100", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/com/twu/biblioteca/model/Item.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "48769" } ], "symlink_target": "" }
/** * * Toyota TV Helpers * */ /** * * Date Format * * Converts UNIX Epoch time to DD.MM.YY * * 1343691442862 -> 31.07.12 * * Usage: {{dateFormat yourDate}} * */ Handlebars.registerHelper('dateFormat', function(context) { var date = new Date(context), day = date.getDate(), month = date.getMonth() + 1, year = String(date.getFullYear()).substr(2,3); return (day < 10 ? '0' : '') + day + '.' + (month < 10 ? '0' : '') + month + '.' + year; }); /** * * Date Format (datetime) * * Converts UNIX Epoch time to YYYY-MM-DD * * 1343691442862 -> 2012-7-31 * * Usage: {{dateFormatTime yourDate}} * */ Handlebars.registerHelper('dateFormatTime', function(context) { var date = new Date(context); return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); }); /** * * Duration Format * * Converts UNIX Epoch time to H.MM.SS * * 127478 -> 2:07 * * Usage: {{durationFormat yourTime}} * */ Handlebars.registerHelper('durationFormat', function(context) { var duration = Math.floor(context / 1000), hours = (duration >= 3600) ? Math.floor(duration / 3600) : null, mins = (hours) ? Math.floor(duration % 3600 / 60) : Math.floor(duration / 60), secs = Math.floor(duration % 60); return (hours ? hours + ':' : '') + (mins < 10 ? '0' : '') + mins + ':' + (secs < 10 ? '0' : '') + secs; }); /** * * Duration Format ISO * * Converts UNIX time to ISO 8601 date format * * 127478 -> PT2M7S * * Usage: {{durationFormatISO yourTime}} * */ Handlebars.registerHelper('durationFormatISO', function(context) { var duration = Math.floor(context / 1000), hours = Math.floor(duration / 3600), mins = (hours) ? Math.floor(duration % 3600 / 60) : Math.floor(duration / 60), secs = Math.floor(duration % 60); return 'PT' + hours + 'H' + mins + 'M' + secs + 'S'; });
{ "content_hash": "0db9e013f07d145c828f666b0f5fb50b", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 108, "avg_line_length": 35.714285714285715, "alnum_prop": 0.5495, "repo_name": "Clouda-team/Cloudajs-examples", "id": "06699a83678524da7ef45e0c2e6212f271f9a4fc", "size": "2000", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CloudaBirdWatching/app/library/handlebars-helps.1.0.0.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "25717" }, { "name": "JavaScript", "bytes": "122546" } ], "symlink_target": "" }
package org.owasp.appsensor.configuration.stax.client; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLResolver; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.owasp.appsensor.core.configuration.client.ClientConfiguration; import org.owasp.appsensor.core.configuration.client.ClientConfigurationReader; import org.owasp.appsensor.core.configuration.client.ServerConnection; import org.owasp.appsensor.core.exceptions.ConfigurationException; import org.owasp.appsensor.core.util.XmlUtils; import org.xml.sax.SAXException; /** * This implementation parses the {@link ClientConfiguration} objects * from the specified XML file via the StAX API. * * @author John Melton (jtmelton@gmail.com) http://www.jtmelton.com/ */ public class StaxClientConfigurationReader implements ClientConfigurationReader { private static final String XSD_NAMESPACE = "https://www.owasp.org/index.php/OWASP_AppSensor_Project/xsd/appsensor_client_config_2.0.xsd"; private Map<String, String> namespaces = new HashMap<String, String>(); public StaxClientConfigurationReader() { /** initialize namespaces **/ namespaces.put(XSD_NAMESPACE, "config"); } /** * {@inheritDoc} */ @Override public ClientConfiguration read() throws ConfigurationException { String defaultXmlLocation = "/appsensor-client-config.xml"; String defaultXsdLocation = "/appsensor_client_config_2.0.xsd"; return read(defaultXmlLocation, defaultXsdLocation); } /** * {@inheritDoc} */ @Override public ClientConfiguration read(String xml, String xsd) throws ConfigurationException { ClientConfiguration configuration = null; InputStream xmlInputStream = null; XMLStreamReader xmlReader = null; try { XMLInputFactory xmlFactory = XMLInputFactory.newInstance(); xmlFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE); xmlFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE); xmlFactory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, Boolean.TRUE); xmlFactory.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE); xmlFactory.setXMLResolver(new XMLResolver() { @Override public Object resolveEntity(String arg0, String arg1, String arg2, String arg3) throws XMLStreamException { return new ByteArrayInputStream(new byte[0]); } }); XmlUtils.validateXMLSchema(xsd, xml); xmlInputStream = getClass().getResourceAsStream(xml); xmlReader = xmlFactory.createXMLStreamReader(xmlInputStream); configuration = readClientConfiguration(xmlReader); } catch(XMLStreamException | IOException | SAXException e) { throw new ConfigurationException(e.getMessage(), e); } finally { if(xmlReader != null) { try { xmlReader.close(); } catch (XMLStreamException xse) { /** give up **/ } } if(xmlInputStream != null) { try { xmlInputStream.close(); } catch (IOException ioe) { /** give up **/ } } } return configuration; } private ClientConfiguration readClientConfiguration(XMLStreamReader xmlReader) throws XMLStreamException { ClientConfiguration configuration = new ClientConfiguration(); boolean finished = false; while(!finished && xmlReader.hasNext()) { int event = xmlReader.next(); String name = XmlUtils.getElementQualifiedName(xmlReader, namespaces); switch(event) { case XMLStreamConstants.START_ELEMENT: if("config:appsensor-client-config".equals(name)) { // } else if("config:server-connection".equals(name)) { configuration.setServerConnection(readServerConnection(xmlReader)); } else { /** unexpected start element **/ } break; case XMLStreamConstants.END_ELEMENT: if("config:appsensor-client-config".equals(name)) { finished = true; } else { /** unexpected end element **/ } break; default: /** unused xml element - nothing to do **/ break; } } return configuration; } private ServerConnection readServerConnection(XMLStreamReader xmlReader) throws XMLStreamException { ServerConnection serverConnection = new ServerConnection(); boolean finished = false; serverConnection.setType(xmlReader.getAttributeValue(null, "type")); while(!finished && xmlReader.hasNext()) { int event = xmlReader.next(); String name = XmlUtils.getElementQualifiedName(xmlReader, namespaces); switch(event) { case XMLStreamConstants.START_ELEMENT: if("config:url".equals(name)) { serverConnection.setUrl(xmlReader.getElementText().trim()); } else if("config:client-application-identification-header-name".equals(name)) { serverConnection.setClientApplicationIdentificationHeaderName(xmlReader.getElementText().trim()); } else if("config:client-application-identification-header-value".equals(name)) { serverConnection.setClientApplicationIdentificationHeaderValue(xmlReader.getElementText().trim()); } else if("config:port".equals(name)) { serverConnection.setPort(Integer.parseInt(xmlReader.getElementText().trim())); } else if("config:socket-timeout-ms".equals(name)) { serverConnection.setSocketTimeout(Integer.parseInt(xmlReader.getElementText().trim())); } else { /** unexpected start element **/ } break; case XMLStreamConstants.END_ELEMENT: if("config:server-connection".equals(name)) { finished = true; } else { /** unexpected end element **/ } break; default: /** unused xml element - nothing to do **/ break; } } return serverConnection; } }
{ "content_hash": "e3eb6013c85792149296d7a66f181562", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 139, "avg_line_length": 32.395604395604394, "alnum_prop": 0.7238805970149254, "repo_name": "sims143/appsensor", "id": "2fc04b9fea07ff94b9304c39305080d230bbdb73", "size": "5896", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "configuration-modes/appsensor-configuration-stax/src/main/java/org/owasp/appsensor/configuration/stax/client/StaxClientConfigurationReader.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "108469" }, { "name": "HTML", "bytes": "116764" }, { "name": "Java", "bytes": "491175" }, { "name": "Thrift", "bytes": "1916" } ], "symlink_target": "" }
pymatgen.analysis.adsorption module =================================== .. automodule:: pymatgen.analysis.adsorption :members: :undoc-members: :show-inheritance:
{ "content_hash": "fbc81a683da7c82fac2f0118097e1ffa", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 44, "avg_line_length": 25, "alnum_prop": 0.5828571428571429, "repo_name": "montoyjh/pymatgen", "id": "b0f0626e718a1469a2274dd9846b7bcfbb02a739", "size": "175", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "docs_rst/pymatgen.analysis.adsorption.rst", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "5100" }, { "name": "CSS", "bytes": "7550" }, { "name": "Common Lisp", "bytes": "3029065" }, { "name": "Dockerfile", "bytes": "275" }, { "name": "HTML", "bytes": "827" }, { "name": "Makefile", "bytes": "5573" }, { "name": "Perl", "bytes": "229104" }, { "name": "Propeller Spin", "bytes": "15152267" }, { "name": "Python", "bytes": "7718850" }, { "name": "Roff", "bytes": "1898220" } ], "symlink_target": "" }
/** * Pragma.Libs.Scrollspy * Plugin para escuchar el scroll en contenidos. * Creado por Stefan Luy 2014. * Publicado bajo la licencia MIT http://pragmaui.com/docs/primeros-pasos/licencia * #--------------- * Html: * #--------------- * data-pragma-scrollspy="#id_del_menú" : define el scrollspy y el menú asociado. * #----------------- * Eventos: * #----------------- * pragma.dropdown.before_init : lanzado al inicializar el plugin. * pragma.dropdown.after_init : lanzado al terminar la configuración inicial del plugin. * * pragma.scrollspy.change :Evento lanzado al cambiar el elemento activo. Suministra la variable event.active con el id del elemento activo. * #----------------- * Dependencias: * #----------------- * js/pragma.js */ $(function (Pragma, $, undefined) { "use strict"; Pragma.Libs.Scrollspy = function (element, options) { var self = this; self.options = options; self.$el = $(element); /** * Método privado. * Añade animaciones al hacer click a un elemento de la navegación. */ function attach_animation() { if (self.options.fx) { //Fix IE FIREFOX var $listener = self.$el.is("body")?$("html,body"):self.$el; self.$nav.find('a[href^="#"]:not(.disabled)').each(function () { $(this).click(function (e) { var href = $(this).attr('href'); if (href.length > 1 && self.$el.find(href).length > 0) { e.preventDefault(); $listener.animate({ 'scrollTop': $(href).offset().top - self.options.offset }, parseInt(self.options.fx_speed), function () { //Prevenimos el salto de página al cambiar el anchor var pos = $(window).scrollTop(); window.location.hash = href; $(window).scrollTop(pos); }); } }); }); } } /** * Método privado. * Establece un ítem de la navegación como activo. */ function setActive(href) { if (self.$nav.length == 0) return false; var $nav = self.$nav.find('a[href="' + href + '"]'); self.$nav.find('a[href^="#"]:not(.disabled)').each(function () { if ($(this).attr('href').length > 1 && self.$el.find($(this).attr('href')).length > 0) { $(this).parent().removeClass("active"); if ($(this).parent().parent().parent().is("li")) { $(this).parent().parent().parent().removeClass("active"); } } }); $nav.parent().addClass("active"); if ($nav.parent().parent().parent().is("li")) { $nav.parent().parent().parent().addClass("active"); } } /** * Método privado. * Escucha el scroll de la página y establece el elemento activo. */ function listen() { var scroll = self.$scroll.scrollTop(); self.$nav.find('a[href^="#"]:not(.disabled)').each(function () { var href = $(this).attr('href'); var nav = $(this); if (href.length > 1 && $(href).length > 0) { //offset agregado if ($(href).position().top <= parseInt(self.options.offset) + self.$scroll.scrollTop()) { setActive(href); self.$el.trigger({ type: "pragma.scrollspy.change", active: href }); } } }); } /** * Método privado. * Inicia la configuración del plugin. */ function configure() { //Al encontrar que no existe menú asociado al scrollspy, detiene la configuración del plugin if (self.options.target.length == 0 || $(self.options.target).length == 0) { return; } self.$scroll = self.$el.is('body') ? $(window) : self.$el; self.$el.trigger("pragma.scrollspy.before_init"); self.$nav = $(self.options.target); self.$el.css("position", "relative"); if (self.options.fx) { attach_animation(); } self.$scroll.scroll(function (event) { listen(); }); listen(); self.$el.trigger("pragma.scrollspy.after_init"); } configure(); } //Versión del plugin Pragma.Libs.Scrollspy.Ver = "1.0.0"; //Opciones de configuración Pragma.Libs.Scrollspy.Defaults = { target: "", //Id de la navegación offset: 15, //Offset fx: true, //Activa o desactiva la animación al hacer click a un elemento de la navegación fx_speed: 200//Milisegundos de la animación } $(function () { //Recorre los elementos con el atributo data-pragma-scroollspy al cargar la página $("[data-pragma-scrollspy]").each(function (e) { //Busca la navegación asociada al scrollspy var $target = Pragma.Utils.get_target($(this), "pragma-scrollspy"); //Si se definió la navegación asociada al scrollspy, inicializamos el plugin if ($target) { $(this).pragma("scrollspy", { target: $(this).attr("data-pragma-scrollspy") }); } }); }); } (window.Pragma = window.Pragma || {}, jQuery));
{ "content_hash": "d61009a9442f0c8b5bff351c6fbd4c93", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 95, "avg_line_length": 27.17241379310345, "alnum_prop": 0.5909475465313029, "repo_name": "sluy/Pragma-UI", "id": "7a8c9257c8e98c5e7301b816e124725445d3ba63", "size": "4754", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/scrollspy.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "132420" }, { "name": "JavaScript", "bytes": "240451" } ], "symlink_target": "" }
package uk.co.cameronhunter.aws.glacier.utils; import com.google.common.base.Joiner; import java.util.function.Function; import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; import static org.apache.commons.lang.StringUtils.EMPTY; public final class CharDelimitedString { private static final Function<Object, Object> NULL_TO_EMPTY_STRING = input -> input == null ? EMPTY : input; public static String tsv(Object... fields) { return Joiner.on('\t').join(asList(fields).stream().map(NULL_TO_EMPTY_STRING).collect(toList())); } private CharDelimitedString() {} }
{ "content_hash": "8e15b22cebe8a00fb5143c95337db9fb", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 112, "avg_line_length": 31.4, "alnum_prop": 0.7404458598726115, "repo_name": "cameronhunter/glacier-cli", "id": "2f73cd3550da6b334e203491579cbab5184be229", "size": "628", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/uk/co/cameronhunter/aws/glacier/utils/CharDelimitedString.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "57020" } ], "symlink_target": "" }
<!-- @file templates/redirect.html @author Marshall Farrier @date 10/06/2012 @description redirection to home page --> <!DOCTYPE html> <html> <head> <title>codeMelon</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <?php redirect_main($target_page); ?> <style type="text/css"> body { margin:16px 10%; max-width:512px; } </style> </head> <body> <h1>Content was moved!</h1> <p><a href="index.php">codeMelon.com</a> has been improved since your last visit. The content you requested has recently been moved. Please update your bookmarks to the new location. </p> <p>We appreciate your understanding and hope that you enjoy the site's new look! </p> <p>In a few seconds your browser should automatically redirect you to the <?php redirect_link($target_page); ?></p> </body> </html>
{ "content_hash": "86955d27a833eb160e7c739745ea0d41", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 93, "avg_line_length": 32.32258064516129, "alnum_prop": 0.5818363273453094, "repo_name": "aisthesis/codemelon2012", "id": "d4743f96ddd1513b8927f0eba3643b011f1e484c", "size": "1002", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/redirect.html", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "48730" }, { "name": "PHP", "bytes": "20715" }, { "name": "Ruby", "bytes": "578" }, { "name": "Shell", "bytes": "26" } ], "symlink_target": "" }
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Example - example-example59-production</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.16/angular.min.js"></script> <script src="script.js"></script> </head> <body ng-app="httpExample"> <div ng-controller="FetchController"> <select ng-model="method"> <option>GET</option> <option>JSONP</option> </select> <input type="text" ng-model="url" size="80"/> <button id="fetchbtn" ng-click="fetch()">fetch</button><br> <button id="samplegetbtn" ng-click="updateModel('GET', 'http-hello.html')">Sample GET</button> <button id="samplejsonpbtn" ng-click="updateModel('JSONP', 'https://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')"> Sample JSONP </button> <button id="invalidjsonpbtn" ng-click="updateModel('JSONP', 'https://angularjs.org/doesntexist&callback=JSON_CALLBACK')"> Invalid JSONP </button> <pre>http status code: {{status}}</pre> <pre>http response data: {{data}}</pre> </div> </body> </html>
{ "content_hash": "41294976be99e5684150bd6aafb70937", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 96, "avg_line_length": 30.52777777777778, "alnum_prop": 0.6578707916287534, "repo_name": "JSoon/EzineMetroUI", "id": "525fd21f3c4203da9232f4d32d33b004eed13e39", "size": "1099", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "frontend/lib/angularjs/1.3.0-beta.17/docs/examples/example-example59/index-production.html", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "223" }, { "name": "ActionScript", "bytes": "146499" }, { "name": "C#", "bytes": "94651" }, { "name": "CSS", "bytes": "1380368" }, { "name": "JavaScript", "bytes": "4275234" }, { "name": "PowerShell", "bytes": "193761" }, { "name": "Shell", "bytes": "274" } ], "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/html; charset=utf-8" /> <title>PyNance chart example code: candlestick.py &mdash; PyNance 0.5.0 documentation</title> <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '0.5.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="top" title="PyNance 0.5.0 documentation" href="index.html" /> <link rel="up" title="Charts (pynance.chart)" href="chart.html" /> <link rel="next" title="PyNance chart example code: sma.py" href="chart.sma.html" /> <link rel="prev" title="Charts (pynance.chart)" href="chart.html" /> </head> <body role="document"> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="chart.sma.html" title="PyNance chart example code: sma.py" accesskey="N">next</a> |</li> <li class="right" > <a href="chart.html" title="Charts (pynance.chart)" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="index.html">PyNance 0.5.0 documentation</a> &raquo;</li> <li class="nav-item nav-item-1"><a href="chart.html" accesskey="U">Charts (<code class="docutils literal"><span class="pre">pynance.chart</span></code>)</a> &raquo;</li> </ul> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h4>Previous topic</h4> <p class="topless"><a href="chart.html" title="previous chapter">Charts (<code class="docutils literal"><span class="pre">pynance.chart</span></code>)</a></p> <h4>Next topic</h4> <p class="topless"><a href="chart.sma.html" title="next chapter">PyNance chart example code: <cite>sma.py</cite></a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/chart.candlestick.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="pynance-chart-example-code-candlestick-py"> <h1>PyNance chart example code: <cite>candlestick.py</cite><a class="headerlink" href="#pynance-chart-example-code-candlestick-py" title="Permalink to this headline">¶</a></h1> <img alt="_images/candlestick.png" class="align-center" src="_images/candlestick.png" /> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># basic candlestick chart</span> <span class="kn">import</span> <span class="nn">pynance</span> <span class="k">as</span> <span class="nn">pn</span> <span class="k">def</span> <span class="nf">run</span><span class="p">():</span> <span class="n">df</span> <span class="o">=</span> <span class="n">pn</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;TSLA&#39;</span><span class="p">,</span> <span class="s1">&#39;2015&#39;</span><span class="p">,</span> <span class="s1">&#39;2016&#39;</span><span class="p">)</span> <span class="n">pn</span><span class="o">.</span><span class="n">chart</span><span class="o">.</span><span class="n">candlestick</span><span class="p">(</span><span class="n">df</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="s1">&#39;TSLA 2015&#39;</span><span class="p">)</span> <span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span> <span class="n">run</span><span class="p">()</span> </pre></div> </div> </div> </div> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="chart.sma.html" title="PyNance chart example code: sma.py" >next</a> |</li> <li class="right" > <a href="chart.html" title="Charts (pynance.chart)" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="index.html">PyNance 0.5.0 documentation</a> &raquo;</li> <li class="nav-item nav-item-1"><a href="chart.html" >Charts (<code class="docutils literal"><span class="pre">pynance.chart</span></code>)</a> &raquo;</li> </ul> </div> <div class="footer" role="contentinfo"> &copy; Copyright 2015-2016, Marshall Farrier. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4. </div> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-60405568-1', 'auto'); ga('send', 'pageview'); </script> </body> </html>
{ "content_hash": "87a805f8f5d25ea82dae11860f3191fb", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 393, "avg_line_length": 49.214285714285715, "alnum_prop": 0.597822931785196, "repo_name": "aisthesis/pynance", "id": "15d4557be243cfe97df7ba9d9987e589c3ca459f", "size": "6891", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "doc/public/html/0.5.0/chart.candlestick.html", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "158731" }, { "name": "Shell", "bytes": "32" } ], "symlink_target": "" }
<?php namespace Scalr\Model\Entity; use Scalr\Model\AbstractEntity; /** * WebhookConfigFarm entity * * @author Vitaliy Demidov <vitaliy@scalr.com> * @since 4.5.2 (11.03.2014) * * @Entity * @Table(name="webhook_config_farms") */ class WebhookConfigFarm extends AbstractEntity { /** * The identifier of the webhook config * * @Id * @Column(type="uuid") * @var string */ public $webhookId; /** * The identifier of the farm (farms.id reference) * * @Id * @Column(type="integer") * @var int */ public $farmId; }
{ "content_hash": "10bb569af57cacc8dea7d20a1ae97430", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 54, "avg_line_length": 17.142857142857142, "alnum_prop": 0.585, "repo_name": "kikov79/scalr", "id": "7811e49b1ac1be54f577ce3beb08bf62fb65dd7a", "size": "600", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/src/Scalr/Model/Entity/WebhookConfigFarm.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "4249" }, { "name": "CSS", "bytes": "86731" }, { "name": "Cucumber", "bytes": "72478" }, { "name": "HTML", "bytes": "2474225" }, { "name": "JavaScript", "bytes": "16934089" }, { "name": "PHP", "bytes": "20637716" }, { "name": "Python", "bytes": "350030" }, { "name": "Ruby", "bytes": "9397" }, { "name": "Shell", "bytes": "17207" }, { "name": "Smarty", "bytes": "2245" }, { "name": "XSLT", "bytes": "29678" } ], "symlink_target": "" }
class BmcBlockStorageClient < BmcClient def initialize @validate = Validator.new @action = 'storage' end require 'opc_client/bmc/helpers' include BmcHelpers::CommandLine include BmcHelpers::OptParsing attr_writer :options, :validate, :instanceparameters # create new storage volumes on the Oracle Next Gen cloud def create instance_details = AttrFinder.new(@instanceparameters) instance_details.options = @options instance_details.validate = @validate instance_details.function = 'volume' BmcAuthenticate.new(@options) instance_details.vcn # This is only here because the SDK can not establish a connection with POST request = OracleBMC::Core::Models::CreateVolumeDetails.new request.availability_domain = instance_details.ad request.compartment_id = instance_details.compartment request.display_name = @instanceparameters['volume']['display_name'] api = OracleBMC::Core::BlockstorageClient.new response = api.create_volume(request) instance_id = response.data.id api.get_volume(instance_id).wait_until(:lifecycle_state, OracleBMC::Core::Models::Volume::LIFECYCLE_STATE_AVAILABLE) end def list attrcheck = { 'compartment' => @options[:compartment] } @validate.validate(@options, attrcheck) opts = {} opts[:availability_domain] = @options[:availability_domain] if @options[:availability_domain] opts[:display_name] = @options[:display_name] if @options[:display_name] BmcAuthenticate.new(@options) request = OracleBMC::Core::BlockstorageClient.new request = request.list_volumes(@options[:compartment], opts) request.data end def delete inst_details = AttrFinder.new(@instanceparameters) inst_details.options = @options inst_details.validate = @validate opts = {} BmcAuthenticate.new(@options) request = OracleBMC::Core::BlockstorageClient.new request.delete_volume(inst_details.volume, opts) end end
{ "content_hash": "67ee3292291368efcef6d454564b8656", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 120, "avg_line_length": 37.67307692307692, "alnum_prop": 0.7309851965288412, "repo_name": "mccoold/oracle_public_cloud_client", "id": "f780afd7bc83efae9edb47bf7bade54bda60077f", "size": "2021", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/opc_client/bmc/bmc_blockstorage_client.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "128367" } ], "symlink_target": "" }
#ifndef DateTimeNumericFieldElement_h #define DateTimeNumericFieldElement_h #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) #include "core/html/shadow/DateTimeFieldElement.h" #include "wtf/Allocator.h" #include "wtf/text/StringBuilder.h" #include "wtf/text/WTFString.h" namespace blink { // DateTimeNumericFieldElement represents numeric field of date time format, // such as: // - hour // - minute // - millisecond // - second // - year class DateTimeNumericFieldElement : public DateTimeFieldElement { WTF_MAKE_NONCOPYABLE(DateTimeNumericFieldElement); public: struct Step { DISALLOW_NEW(); Step(int step = 1, int stepBase = 0) : step(step), stepBase(stepBase) { } int step; int stepBase; }; struct Range { DISALLOW_NEW(); Range(int minimum, int maximum) : minimum(minimum), maximum(maximum) { } int clampValue(int) const; bool isInRange(int) const; bool isSingleton() const { return minimum == maximum; } int minimum; int maximum; }; protected: DateTimeNumericFieldElement(Document&, FieldOwner&, const Range&, const Range& hardLimits, const String& placeholder, const Step& = Step()); int clampValue(int value) const { return m_range.clampValue(value); } virtual int defaultValueForStepDown() const; virtual int defaultValueForStepUp() const; const Range& range() const { return m_range; } // DateTimeFieldElement functions. bool hasValue() const final; void initialize(const AtomicString& pseudo, const String& axHelpText); int maximum() const; void setEmptyValue(EventBehavior = DispatchNoEvent) final; void setValueAsInteger(int, EventBehavior = DispatchNoEvent) override; int valueAsInteger() const final; String visibleValue() const final; private: // DateTimeFieldElement functions. void handleKeyboardEvent(KeyboardEvent*) final; float maximumWidth(const ComputedStyle&) override; void stepDown() final; void stepUp() final; String value() const final; // Node functions. void setFocus(bool) final; String formatValue(int) const; int roundUp(int) const; int roundDown(int) const; int typeAheadValue() const; const String m_placeholder; const Range m_range; const Range m_hardLimits; const Step m_step; int m_value; bool m_hasValue; mutable StringBuilder m_typeAheadBuffer; }; } // namespace blink #endif #endif
{ "content_hash": "93ee05a833fa858cb0f5043ad716fef7", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 144, "avg_line_length": 27.752808988764045, "alnum_prop": 0.694331983805668, "repo_name": "Workday/OpenFrame", "id": "ee57798d568ec27f258e07f38dacb54fc3f69a5d", "size": "3830", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
using System.Windows.Shell; namespace ModernWpf.ViewModels { /// <summary> /// A view-model for reporting progress. This is also suitable for databinding to <see cref="TaskbarItemInfo"/> /// in a wpf window. /// </summary> public class ProgressViewModel : ObservableBase { /// <summary> /// Initializes a new instance of the <see cref="ProgressViewModel"/> class. /// </summary> public ProgressViewModel() { Info = new StatusViewModel(); } /// <summary> /// Updates the progress state. /// </summary> /// <param name="state">The state.</param> public void UpdateState(TaskbarItemProgressState state) { UpdateState(state, 0, null, StatusType.Info); } /// <summary> /// Updates the progress state. /// </summary> /// <param name="state">The state.</param> /// <param name="progressPercent">The progress percent (0 to 1).</param> public void UpdateState(TaskbarItemProgressState state, double progressPercent) { UpdateState(state, progressPercent, null, StatusType.Info); } /// <summary> /// Updates the progress state. /// </summary> /// <param name="state">The state.</param> /// <param name="progressPercent">The progress percent (0 to 1).</param> /// <param name="info">The extra information.</param> public void UpdateState(TaskbarItemProgressState state, double progressPercent, string info) { UpdateState(state, progressPercent, info, StatusType.Info); } /// <summary> /// Updates the progress state. /// </summary> /// <param name="state">The state.</param> /// <param name="progressPercent">The progress percent (0 to 1).</param> /// <param name="info">The extra information.</param> /// <param name="infoType">Type of the information.</param> public void UpdateState(TaskbarItemProgressState state, double progressPercent, string info, StatusType infoType) { Info.Update(info, infoType); State = state; var val = progressPercent * Maximum; if (val < Minimum) { val = Minimum; } else if (val > Maximum) { val = Maximum; } Value = val; RaisePropertyChanged(() => State); RaisePropertyChanged(() => IsIndeterminate); RaisePropertyChanged(() => IsBusy); RaisePropertyChanged(() => Info); RaisePropertyChanged(() => Value); } /// <summary> /// Gets the progress state. /// </summary> /// <value> /// The state. /// </value> public TaskbarItemProgressState State { get; private set; } /// <summary> /// Gets a value indicating whether the <see cref="State"/> is indeterminate. /// </summary> /// <value> /// <c>true</c> if the <see cref="State"/> is indeterminate; otherwise, <c>false</c>. /// </value> public bool IsIndeterminate { get { return State == TaskbarItemProgressState.Indeterminate; } } /// <summary> /// Gets a value indicating whether the <see cref="State"/> is reporting progress. /// </summary> /// <value> /// <c>true</c> if the <see cref="State"/> is reporting progress; otherwise, <c>false</c>. /// </value> public bool IsBusy { get { return State != TaskbarItemProgressState.None; } } /// <summary> /// Gets the extra information. /// </summary> /// <value> /// The information. /// </value> public StatusViewModel Info { get; private set; } /// <summary> /// Gets the maximum for data-binding purposes. /// </summary> /// <value> /// The maximum. /// </value> public static double Maximum { get { return 1; } } /// <summary> /// Gets the minimum for data-binding purposes. /// </summary> /// <value> /// The minimum. /// </value> public static double Minimum { get { return 0; } } /// <summary> /// Gets the current progress value. /// </summary> /// <value> /// The value. /// </value> public double Value { get; private set; } } }
{ "content_hash": "2f937976110d22eb93baef0a0690b3b5", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 121, "avg_line_length": 35.63492063492063, "alnum_prop": 0.5436525612472161, "repo_name": "soukoku/ModernWpf2", "id": "3afb53cd7762b866c23af5f34c862f70d3e92e19", "size": "4492", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/ModernWpf.Core/ViewModels/ProgressViewModel.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "673" }, { "name": "C#", "bytes": "843221" }, { "name": "Smalltalk", "bytes": "1316" } ], "symlink_target": "" }
using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using BEPUphysics.CollisionShapes.ConvexShapes; using System; using BEPUphysics.CollisionShapes; using BEPUphysics.BroadPhaseEntries.MobileCollidables; using ConversionHelper; namespace BEPUphysicsDrawer.Models { /// <summary> /// Helper class that can create shape mesh data. /// </summary> public static class DisplayTriangle { public static void GetShapeMeshData(EntityCollidable collidable, List<VertexPositionNormalTexture> vertices, List<ushort> indices) { var triangleShape = collidable.Shape as TriangleShape; if(triangleShape == null) throw new ArgumentException("Wrong shape type."); Vector3 normal = MathConverter.Convert(triangleShape.GetLocalNormal()); vertices.Add(new VertexPositionNormalTexture(MathConverter.Convert(triangleShape.VertexA), -normal, new Vector2(0, 0))); vertices.Add(new VertexPositionNormalTexture(MathConverter.Convert(triangleShape.VertexB), -normal, new Vector2(0, 1))); vertices.Add(new VertexPositionNormalTexture(MathConverter.Convert(triangleShape.VertexC), -normal, new Vector2(1, 0))); vertices.Add(new VertexPositionNormalTexture(MathConverter.Convert(triangleShape.VertexA), normal, new Vector2(0, 0))); vertices.Add(new VertexPositionNormalTexture(MathConverter.Convert(triangleShape.VertexB), normal, new Vector2(0, 1))); vertices.Add(new VertexPositionNormalTexture(MathConverter.Convert(triangleShape.VertexC), normal, new Vector2(1, 0))); indices.Add(0); indices.Add(1); indices.Add(2); indices.Add(3); indices.Add(5); indices.Add(4); } } }
{ "content_hash": "6889806f06dc3f5438671847731ba975", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 138, "avg_line_length": 43.906976744186046, "alnum_prop": 0.6875, "repo_name": "Anomalous-Software/BEPUPhysics", "id": "74a11b1a1b265b535d0f764854611b8240269348", "size": "1888", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BEPUphysicsDrawer/Models/Display types/Entity types/DisplayTriangle.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "4829018" }, { "name": "FLUX", "bytes": "2216" } ], "symlink_target": "" }
title: WatchKit渲染原理以及SwiftUI桥接 date: 2019-12-10 17:04:16 categories: iOS tags: - iOS - watchOS - SwiftUI - WatchKit --- # WatchKit渲染原理以及SwiftUI桥接 ## 背景 Apple Watch作为苹果智能穿戴设备领域的重头,自从第一代发布已经经历了6次换代产品,操作系统的迭代也已经更新到了watchOS 6。 不同于iPhone的App,watchOS上的大部分App都侧重于健康管理,并且UI交互以直观,快速为基准。在2015年WWDC上,苹果发布的watchOS的同时,面向开发者发布了WatchKit,以用于构建watchOS App。 ![watchkit-app.jpg](https://cdn.macrumors.com/article-new/2019/06/apple-watch-watchos-apps-home-screen.jpg) 这篇主要讲了关于WatchOS上的App的架构介绍,基本概念,并深入分析了WatchKit的UI渲染逻辑,也谈了一些WatchOS和SwiftUI相关的问题。 其实写这个文章的最主要的原因,是在于自己前段时间写库时候,在SwiftUI与watchOS的集成中,遇到了相当多的问题,迫使我对WatchKit进行了一些探索和逆向分析,这里共享出来,主要原因有多个: 1. 能够了解WatchKit的背后实现细节,回答诸如这种问题:“为什么WatchKit使用Interface Object的概念,而不能叫做View“ 2. 能够理解WatchKit的架构设计,作为库开发者提升自己的分层抽象,架构能力,甚至可以自己做一套类似WatchKit的实现(上层封装布局框架或者DSL) 3. 了解到SwiftUI和WatchKit之间的坑点在于什么,在开发时候遇到奇怪问题能够进行分析归因 4. 实在被逼无奈的时候,可以考虑利用渲染机制走UIKit(注意私有API风险) ## WatchKit架构介绍 一个标准WatchKit App,可以分为至少两个部分: + Watch App Target:只有Storyboard和资源,用来提供静态的UI层级,你不允许动态构建View树(可以隐藏和恢复) + Watch Extension:管理所有逻辑代码,Interface Controller转场,更新UI 如果没有接触过WatchKit,推荐参考这篇文章快速概览了解一下:[NSHipster - Watch​Kit](https://nshipster.cn/watchkit/)。只需要知道,我们的核心的UI构造单元,是Interface Object和Interface Controller,类似于UIKit的View和ViewController。 Interface Controller用于管理页面展示元素的生命周期,而Interface Object是管理Storyboard上UI元素的单元,且只能触发更新,无法获取当前的UI状态(setter-only)。 ![](https://trymakedo.files.wordpress.com/2014/11/watch_app_lifecycle_simple_2x.png) 在watchOS 1时代,WatchKit采取的架构是WatchKit Extension代码,运行在iPhone设备上,于Apple Watch使用无线通信来更新UI,并且由于运行在iPhone上,可以直接访问到App的共享沙盒和UserDefaults。这受当时早期的Apple Watch硬件和定位导致的一种局限性。 在watchOS 2时代,为了解决1时候的更新UI延迟问题,WatchKit进行了改造,将Extension代码放到Apple Watch中执行,就在同样的进程当中,避免额外的传输。为了解决和iPhone的存储同步问题,与此同时推出了WatchConnectivity框架,可以与iPhone App进行通信。 ![](https://developer.apple.com/library/archive/documentation/General/Conceptual/AppleWatch2TransitionGuide/Art/architecture_compared_2x.png) ## WatchKit UI布局原理 WatchKit本身设计的是一个完整的客户端-服务端架构,在watchOS 1时代,由于我们的Extension进程在iPhone手机上,而App进程在Apple Watch上,因此通信方式必定是真正的网络传输,苹果采取了WiFi-Direct+私有协议,来传输对应的数据。 watchOS 1时代的App性能表现很糟糕,一旦iPhone和Apple Watch距离较远,整个watchOS App功能基本是无法使用,只能重新连接。 在watchOS 2上,苹果取巧的把Extension进程放到了Apple Watch本身,而上层已有的WatchKit代码不需要大幅改变。但是,Apple并没有因为这个架构改变,而提供真正的UIKit给开发者。类似的,一些贯穿于iOS/macOS/tvOS的基本框架,Apple依旧把它保留为私有,包括: + CoreAnimation + Metal + OpenGL/ES + GLKit 开发者在watchOS上,除了使用WatchKit以外,只能采取SceneKit或者SpriteKit这种高级游戏引擎,来开发你的watchOS App。 虽然苹果这样做,有很多具体的原因,比如说兼容代码,比如性能考量,甚至还有从技术层面上强迫统一UI风格等等。不过随着watchOS 6的发布,watchOS终于有真正的UI框架了。 ### 客户端 WatchKit的客户端,指的是Apple Watch App自带的WatchKit Extension部分。 在watchOS 1上,客户端的进程位于iPhone当中,而不是和Apple Watch在一起。之间的传输需要走网络协议。在watchOS 2中,之间的传输依旧保持了一层抽象,但是实际上最终等价于同进程代码的调用。 由Storyboard创建的WKInterfaceObject,一定会有与之绑定的WKInterfaceController,这些Controller会保留一个viewControllerID,用于向服务端定位具体的UIKit ViewController(后面提到) WKInterfaceObject的**所有**公开API相关属性设置,比如width height,alpha, image等,均会最终转发到一个`_sendValueChanged:forProperty:`方法上。Value是对应的对象(CGFloat会转换为NSNumber,部分属性会使用字典),Property是这些属性对应的名称(如width,height,image,text等)。 根据是否WatchKit 2,会做不同的处理。WatchKit 2会经过Main Queue Dispatch分发,而Watch 1采取的是自定义的一个通信协议,通过和iPhone直连的WiFi和私有协议传输。 简单来说,等价于如下伪代码: ```objectivec @implementation WKInterfaceObject - (void)setWidth:(CGFloat)width { [self _sendValueChanged:@(width) forProperty:@"width"]; } - (void)_sendValueChanged:(id<NSCoding>)value forProperty:(NSString *)property { NSDictionary *message = @{ @"viewController": self.viewControllerID, @"key": "wkInterfaceObject", @"value": value, @"property": property, @"interfaceProperty": self.interfaceProperty }; [[SPExtensionConnection remoteObjectProxy] sendMessage:message]; } @end ``` ### 服务端 这里的提到服务端,在watchOS 1时代其实就是Apple Watch上单独跑的进程,而在watchOS 2上,它和Extension都是在Apple Watch上,也实际上运行在同一个进程中。 对于每个watchOS App,它实际可以当作一个UIKit App。它的main函数入口是一个叫做WKExtensionMain的方法,里面做了一些Extension的初始化以后,就直接调用了 有UIApplicationMain。watchOS App有AppDelegate(类名为[SPApplicationDelegate](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPApplicationDelegate.h)),会有一个全屏的root UIWindow当作key window。 ![watchkit1](http://dreampiggy-image.test.upcdn.net/2019/12/10/watchkit1.jpg) #### UI初始化 在服务端启动后,它会加载Storyboard中的UI。对每一个客户端的Interface Controller,实际上服务端对应会创建一个View Controller,对应UIViewController的生命周期,会转发到客户端,触发对应的Interface Controller的willActivate/didAppear方法。 因此,watchOS创建了一个[SPInterfaceViewController](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPInterfaceViewController.h)子类来统一做这个事情,它继承自[SPViewController](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPViewController.h),父类又继承自UIViewController,使用客户端传来的Interface Controller ID来绑定起来。 对于UI来说,每一种WKInterfaceObject,其实都会有一个原生的继承自UIView的类去做真正的渲染,比如: + WKInterfaceButton: [SPInterfaceButton](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPInterfaceButton.h),继承自`UIControl` + WKInterfaceImage: [SPInterfaceImageView](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPInterfaceImageView.h),继承自`UIImageView` + WKInterfaceGroup: [SPInterfaceGroupView](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPInterfaceGroupView.h),继承自`UIImageView` + WKInterfaceMap: [SPInterfaceMapView](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPInterfaceMapView.h),继承自`MKMapView` + WKInterfaceSwitch: [SPInterfaceSwitch](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPInterfaceSwitch.h),继承自`UIControl` + WKInterfaceTable: [SPInterfaceListView](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPInterfaceListView.h),继承自`UIView` SPInterfaceViewController的主要功能,就是根据Storyboard提供的信息,构造出对应这些UIView的树结构,并且初始化对应的值渲染到UI上(比如说,Image有初始化的Name,Label有初始的Text)。实际上,这些具体的初始化值,都存储在Storyboard中,比如说,这里是一个简单的包含Table,每个TableRow是一个居中的Label,它对应的结构化数据如下: ```json { controllerClass = "InterfaceController"; items = ( { property = interfaceTable; rows = { default = { color = EFF1FB24; controllerClass = "ElementRowController"; items = ( { alignment = center; fontScale = 1; property = elementLabel; text = Label; type = label; verticalAlignment = center; } ); type = group; width = 1; }; }; type = table; } ); title = Catalog; } ``` 这些信息会在运行时用于构建真正的View Tree。 值得注意的是,watchOS由于本身的UI,这些SPInterfaceViewController的rootView,一定是一个容器的View。比如说一般的多种控件平铺的Storyboard会自带`SPInterfaceGroupView`,一个可滚动的Storyboard会自带一个`SPCollectionView`,等等。这里是简单的伪代码: ```objectivec @implementation SPInterfaceViewController - (void)loadView { Class rootViewClass; UIView *rootView = [[rootViewClass alloc] initWithItemDescription:self.rootItemDescription bundle:self.bundle stringsFileName:self.stringsFileName]; self.view = rootView; } @end ``` #### UI更新 UI创建好以后,实际上我们的Extension代码会触发很多Interface object的刷新,比如说更新Label的文案,Image的图片等等,这些会从客户端触发消息,然后在服务端统一由AppDelegate接收到,来根据viewControllerID找到对应先前创建的SPInterfaceViewController。 ```objectivec @interface SPApplicationDelegate : NSObject <SPExtensionConnectionDelegate, UIApplicationDelegate> @end @implementation SPApplicationDelegate - (void)extensionConnection:(SPExtensionConnection *)connection interfaceViewController:(NSString *)viewControllerID setValue:(id)value forKey:(NSString *)key property:(NSString *)key { if ([key isEqualToString:@"wkInterfaceObject"]) { SPInterfaceViewController *vc = [SPInterfaceViewController viewControllerForIdentifier:viewControllerID]; [vc setInterfaceValue:value forKey:key property:property]; } } @end ``` 因此,拿到UIViewController以后,WatchKit会根据前面传来的interfaceProperty来定位,找到一个需要更新的View。然后向对应的UIView对象,发送对应的property和value,以更新UI。 ```objectivec @interface SPInterfaceImageView : UIImageView @end @implementation SPInterfaceImageView - (void)setInterfaceItemValue:(id)value property:(NSString *)property { if ([property isEqualToString:@"width"]) { self.width = value.doubleValue; } if ([property isEqualToString:@"image"]) { self.image = value; } // ... } @end ``` 后续的流程,就完全交给UIKit和CALayer来进行渲染了。 ## 总结流程 ![watchkit2](http://dreampiggy-image.test.upcdn.net/2019/12/10/watchkit2.jpg) 通过这张图,其实完整的流程,我们可以通过调用栈清晰看到,如图各个阶段: 1. 开发者调用WKInterfaceObject的UI方法 2. 客户端的WKInterfaceObject统一封装发送消息 3. 传输层传输消息(watchOS 1走网络,watchOS 2实际上就Dispatch到main queue) 4. 服务端接收到消息,消息分发给对应的ViewController 5. ViewController分发消息给rootView(会递归处理) 6. View解码消息,得到对应的需要设置的UIKit属性和值 7. 调用UIKit的UI更新方法 可以看出来,其实WatchKit这边主要的工作就是抽象了一层Interface Object而不让开发者直接更新UIView。在watchOS 1时代这是一个非常好的设计,因为Extension进程在iPhone中,而App进程在Apple Watch上。但是到了watchOS 2以后,依然保留了这一套设计方案,实际上开发者能自定义的UI很有限。 ## WatchKit与Long-Look Notification watchOS除了本身的App功能外,还有一些其他特性,比如这里提到的Long-Look Notification。这是在Apple Watch收到推送通知时候展示的页面,它实际上类似于iOS上的Notification Extension,可以进行自定义的UI。 ![](https://docs-assets.developer.apple.com/published/2d2f6b930c/52360133-b314-48c5-aa59-f2cb6c5e4e8f.png) 苹果这里面对Notification提供了3种类型,根据能不能动态更新UI/能不能响应用户点击可以分为: + Static Notification(固定UI,点击后关闭) + Dynamic Notification(可以更新UI,点击后关闭) + Dynamic Interactive Notification(可以更新UI,可以响应交互,不默认关闭) 和普通的WatchKit UI一样,Notification依然使用Storyboard构建。并且有单独的Storyboard Entry Point。在代码里面通过WKUserNotificationInterfaceController的方法`didReceive(_:)`,来处理接收到通知后的UI刷新,存储同步等等逻辑。 ![](https://docs-assets.developer.apple.com/published/0599a724ac/8487cfa2-b872-481d-b0ae-409d1aaea6d1.png) 如图所示,整体的生命周期比较简单,可以参考苹果的文档即可:[Customizing Your Long-Look Interface](https://developer.apple.com/documentation/watchkit/enhancing_your_watchos_app_with_notifications/customizing_your_long-look_interface) ### Long-Look Notification原理 按照之前说的,WatchOS的Native App中,使用了SPApplicationDelegate作为它的AppDelegate,也直接实现了UNUserNotificationCenterDelegate相关方法。 当有推送通知出现时,如果watchOS App正处于前台,会触发一系列UserNotification的通知。类似于UIKit的逻辑,就不再赘述。 如果watchOS App未启动,那么会被后台启动(且不触发UserNotification的通知),对应Storyboard中的WKUserNotificationInterfaceController实例会被初始化。加载完成UI后,会调用`willActivate()`方法并自动弹起。 ![watchkit4](http://dreampiggy-image.test.upcdn.net/2019/12/10/watchkit4.jpg) 其实可以看出来,WatchKit主要做的事情,是在于watchOS App未启动时,需要对用户提供的WKUserNotificationInterfaceController,桥接对应的UserNotification接口和生命周期。 1. 当SPApplicationDelegate的`userNotificationCenter:willPresentNotification:withCompletionHandler:`被调用,它会向客户端发送消息,触发WKUserNotificationInterfaceController的`didReceive(_:)`方法 2. 当用户点击了Notification上面的按钮时,SPApplicationDelegate的`userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:`被调用,如果App不支持dynamic interactive notification,它会直接关闭通知,并唤起watchOS App到前台 3. 如果支持dynamic interactive notification(watchOS 5/iOS 12),那么用户点击的Button/Slider之类,会调用WKUserNotificationInterfaceController上绑定的Target-Action,开发者需要手动在交互完毕后调用`performNotificationDefaultAction`,`performDismissAction`关闭通知(系统不再自动关闭通知),另外,系统给通知的最下方提供了一个默认的Dismiss按钮,点击后会强制关闭。 个人见解:之所以watchOS非要封装一层,主要原因是watchOS 1时代,不支持自定义通知;在watchOS 2时代,UserNotification这个框架还不存在,UIKit和AppKit都各自有一套接收Notification的实现,而WatchKit也照猫画虎搞了一套(当时就用的UILocalNotification)。UserNotification这个跨平台的通知库,是伴随着watchOS 3才出现的,但是已经晚了,因此WatchKit继续在已有的这个WKUserNotificationInterfaceController上新增功能。 其实可以看到,WKUserNotificationInterfaceController实际上提供的接口,基本完全等价于UserNotifications + UserNotificationsUI,方法名类似,有兴趣的话自行参考官方文档对比一下[watchOS Custom Notification Tutorial](https://developer.apple.com/documentation/watchkit/enhancing_your_watchos_app_with_notifications) 和 [iOS Custom Notification Tutorial](https://developer.apple.com/documentation/usernotificationsui/customizing_the_appearance_of_notifications) ## WatchKit和SwiftUI 在WWDC 2019上,苹果发布了新的全平台UI框架,SwiftUI。SwiftUI是一个声明式的UI框架,大量使用了Swift语法特性和API接口设计,提倡Single Source of Truth而不是UIKit一直以来的View State Mutation。 为什么专门要讲SwiftUI,因为实际上,SwiftUI才是Apple Watch上真正的完整UI框架,而WatchKit由于设计上的问题,无法实现**Owning Every Pixel**这一点,在我心中它的定位更类似于TVML的级别。 ![swiftui](https://developer.apple.com/assets/elements/icons/swiftui/swiftui-96x96_2x.png) 关于SwiftUI在watchOS上的快速上手,没有什么比Apple官方文档要直观的了,有兴趣参考:[SwiftUI Tutorials - Creating a watchOS App](https://developer.apple.com/tutorials/swiftui/creating-a-watchos-app) 这里不会专门介绍SwiftUI的基础知识,后续我可能也会写一篇SwiftUI原理性介绍的文章。但是这篇文章,主要侧重一些SwiftUI在watchOS的独有特性和注意点,以及一些自己发现的坑。 ### SwiftUI与WatchKit桥接 SwiftUI,允许桥接目前已有的WatchKit的Interface Object,就如在iOS上允许桥接UIKit一样。但是它能做的事情和概念其实完全不一样。 在iOS上,你能通过代码/Storyboard来构建你自己的UIView子类,并且你能构造自己的ViewController管理生命周期事件。这些都能通过SwiftUI的[UIViewRepresentable](https://developer.apple.com/documentation/swiftui/uiviewrepresentable)来桥接而来。与此同时,你还可以在你的UIKit代码中,来引入SwiftUI的View。你可以使用UIHostingController当作Child VC,甚至是对应的UIView(`UIHostingController.view`是一个私有类`_UIHostingView`,继承自UIView),是一种双向的桥接。 但是,正如之前提到,WatchKit设计是严重Storyboard Based,你不允许继承Interface Object。你不能使用SwiftUI来引入Storyboard自己构建好的Interface Object/Controller层级。不过相反的是,你可以使用WKHostingController,在Storyboard中去present或者push一个新的SwiftUI页面,实际是一种单向的桥接。 SwiftUI提供的[WKInterfaceObjectRepresentable](https://developer.apple.com/documentation/swiftui/wkinterfaceobjectrepresentable),实际上它只允许你去绑定一些已有的系统UI到SwiftUI中(因为SwiftUI目前还不支持这些控件,比如InlineMovie,MapKit,不排除以后有原生实现)。这些对应的WatchKit Interface Object,在watchOS 6上面都加入了对应的init初始化方法,允许你代码中动态创建,这里是全部的列表: + WKInterfaceActivityRing + WKInterfaceHMCamera + WKInterfaceInlineMovie + WKInterfaceMap + WKInterfaceMovie + WKInterfaceSCNScene + WKInterfaceSKScene 桥接了Interface Object的View可以像普通的SwiftUI View一样使用,常见的SwiftUI的modifier(比如`.frame`, `.background`)也可以正常work。但是有一些系统UI有着自己提供的最小布局(比如MapKit),超过这个限制会导致渲染异常,建议采取scaleTransform处理。另外,请不要同时调用Interface Object的setWidth等概念等价的布局方法,这会导致更多的问题。 ### 桥接原理 上文提到的所有可动态创建的Interface Object,根据我们之前的探索,它现在是没有绑定任何viewControllerID的,具体SwiftUI是怎么做的呢? 答案是,SwiftUI会对这些init创建的interfaceObject,手动通过UUID构造一个单独的新字符串,然后用这个UUID,创建一个新ViewController到WatchKit App中,插入到对应HostingController的视图栈里面。 它的初始化UI状态,通过一个单独的属性拿到(由每个子类实现,比如MapView,默认的经纬度是0,0)。整体伪代码如下: ```objectivec @implementation WKInterfaceMap - (instancetype)init { NSString *UUID = [NSUUID UUID].UUIDString; NSString *property = [NSString stringWithFormat:@"%@_%@", [self class], UUID]; return [self _initForDynamicCreationWithInterfaceProperty:property]; } - (NSDictionary *)interfaceDescriptionForDynamicCreation { return @{ @"type" : @"map", @"property" : self.interfaceProperty, }; } @end ``` 另外,这种使用init注册的WKInterfaceObject,会保留一个对应UIView的weak引用,可以在运行时通过私有的`_interfaceView`拿到。SwiftUI内部在布局的时候也用到了这个Native UIView来实现。 ![watchkit-swiftui2](http://dreampiggy-image.test.upcdn.net/2019/12/10/watchkit-swiftui2.png) ### SwiftUI与watchOS Native App 通过从Native watchOS App的布局分析上来看,SwiftUI参考iOS上的方案,依旧是用了一个单独的UIHostingView来插入到Native App的视图层级中,也有对应的UIHostingController。 但是不同于iOS的是,SwiftUI会对每一个Push/Present出来的新View(与是否用了上面提到的WKInterfaceObjectRepresentable无关,这样设计的原因见下),额外套了一个叫做[SPHostingViewController](https://github.com/LeoNatan/Apple-Runtime-Headers/blob/master/watchOS/Frameworks/WatchKit.framework/SPHostingViewController.h)的类,它继承自上文提到的SPViewController。 每个UIHostingController套在了SPHostingViewController的Child VC中,对应View通过约束定成一样的frame,可以看作是一个容器的关系。 ![watchkit3](http://dreampiggy-image.test.upcdn.net/2019/12/10/watchkit3.jpg) 当你的SwiftUI View,含有至少一个WatchKit Interface Object之后,这个SPHostingViewController就起到了很大作用。它需要调度和处理上文提到的WatchKit消息。SPHostingViewController内部存储了所有interface的property,Native UIView列表,通过遍历来进行分发,走普通的WatchKit流程。它相当于起到一个转发代理的作用,让这些WatchKit的Interface Object实现不需要修改代码能正常使用。 ![watchkit-swiftui1](http://dreampiggy-image.test.upcdn.net/2019/12/10/watchkit-swiftui1.jpeg) ### SwiftUI与Long-Look Notification 到这里其实事情还算简单,但是还有一种更为复杂的情形。SwiftUI支持创建自定义的watchOS Long-Look UI。它提供了一个对应的WKUserNotificationHostingController(继承自WKUserNotificationInterfaceController),就像WatchOS App一样。 但是,试想一下:既然SwiftUI支持桥接系统Interface Object,如果我在这里的HostingView中,再放一个WatchKit Interface Object,会怎么样呢?答案依然是支持。 SPHostingViewController这个类兼容了这种极端Case,它转发所有收到的Remote/Local Notification,承担了原本WatchKit的WKUserNotificationInterfaceController的一部分责任(因为继承链的关系,它不是WKUserNotificationInterfaceController子类,但是实现了类似的功能)。因此实际上,SPHostingViewController内部除了上面提到的property, Native UIView列表外,还存储了对应Notification Action的列表,用于转发用户点击在通知上的动作来刷新UI。 ## Independent watchOS App 在历史上,所有的watchOS App,都必须Bundle在一个iOS App中,换句话说,就算你的watchOS App是一个简单的计算器,不需要任何iPhone的联动和同步功能,你也必须创建一个能够在iOS上的App Store审核通过的App。因此制作一个watchOS App的前提变得更复杂,它需要一个iOS App。而且以这里的计算器来说,你不可以直接套一个简单空壳的iOS App,引导用户只使用Apple Watch,因为iOS App Store的审核将不会通过。这也是造成watchOS App匮乏的一个问题。 从watchOS 6之后,由于上述的一系列开发工具上和模式上的改动,苹果听取了开发者的意见,能够允许你创造一个独立的watchOS App,它不再不需要任何iOS App,直接从Apple Watch上安装,下载,运行。watchOS App也不再必须和iOS App有所关联。 ### 开发配置 将一个已有的非独立watchOS App转变为独立App比较简单,你只需要在Xcode中选中的watchOS Extension Target,勾选`Supports Running Without iOS App Installation`即可。 注意,独立watchOS App目前并不意味着你不能使用WatchConnectivity来同步iPhone的数据。你依然可以在你的Extension Target中声明你对应的iOS App的Bundle ID。 注意,如果用户没有下载这个watchOS App对应的iOS App,那么WatchConnectivity的`WCSession.companionAppInstalled`的方法会直接返回NO,就算强制调用`sendMessage:`,也会返回不可用的Error,在代码里面需要对此提前判断。 ### App Slicing 独立watchOS App会利用App Slicing,而非独立App不会。Apple Watch从Series 4开始采取了64位的CPU,而与此同时,由于用户的iPhone的CPU架构和Apple Watch的CPU架构是无关的(你可以在iPhone 11上配对一个Apple Watch Series 3,对吧),而watchOS App又是捆绑在ipa中的,这就导致你的ipa包中,始终会含有两份watchOS的二进制(armv7k arm64_32),用户下载完成后,在同步手表时只会用到一份,并且原始ipa中依旧会保留这份二进制。这是一种带宽和存储浪费。 对于独立watchOS App,可以直接从watchOS App Store下载,那么将只下载Slicing之后的部分,节省近一半的带宽/存储。值得注意的是,就算是独立watchOS App,依然可以从iPhone手机上操作,来直接安装到Apple Watch中,因为在Apple Watch小屏幕上的App Store搜索文本和语音输入的体验并不是很好。 ## 总结 通过上面完整的原理分析,可以看到,WatchKit这一个UI框架,通过一种客户端/服务端的方案,由于抽象了连接,即使watchOS 1到watchOS 2产生了如此大的架构变化,对上层的API基本保持了相对不变。这一点对于库开发者值得参考,通过良好的架构设计能够平滑迁移。 不过实际从各个社交渠道的反馈,开发者对于WatchKit的态度并不是那么乐观,由于隐藏了所有真正能够操作屏幕像素的方案(无法使用Metal这种底层接口,也没有UIKit这种上层接口),导致WatchOS App的生态环境实际上并不是那么理想,很多App都是非常简单和玩具级别的项目。虽然这是可以归因于Apple Watch本身硬件性能的限制,但是和WatchKit提供的接口也脱离不了关系。 如果让我来重新设计WatchKit,可能在watchOS 2时代,就会彻底Deprecate目前的WatchKit,而是取而代之采取公开精简的UIKit实现来让开发者最大化利用硬件(类似于目前的UIKit在tvOS上的现状),同时,提供一个新的WatchUIKit来提供所有专为Apple Watch设计的UI和功能,比如Digital Crown,比如Activity Ring。 ![watchkit-twitte](http://dreampiggy-image.test.upcdn.net/2019/12/10/watchkit-twitter.jpg) SwiftUI为watchOS App提供了一个新的出路,它可以说是真正的能够发挥开发者能力来实现精致的App,而不再受限于系统提供的基本控件。而WatchKit,也已经完成了它的使命。相信之后的SwiftUI Native App将会为watchOS创造一片新的生态,Apple Watch也能真正摆脱“iPhone外设”这一个尴尬的局面。 ## 参考资料 + [App Programming Guide for watchOS](https://developer.apple.com/library/archive/documentation/General/Conceptual/WatchKitProgrammingGuide/index.html) + [WatchKit Catalog Example](https://developer.apple.com/library/archive/samplecode/WKInterfaceCatalog/Introduction/Intro.html) + [NSHipster - WatchKit](https://nshipster.com/watchkit/) + [WWDC - SwiftUI on watchOS](https://developer.apple.com/videos/play/wwdc2019/219/) + [SwiftUI Tutorials - Creating a watchOS App](https://developer.apple.com/tutorials/swiftui/creating-a-watchos-app) + [iOS Runtime Headers](http://developer.limneos.net)
{ "content_hash": "17d3938a07c275d9e95b691f6d18dd68", "timestamp": "", "source": "github", "line_count": 388, "max_line_length": 403, "avg_line_length": 49.97422680412371, "alnum_prop": 0.829190304280557, "repo_name": "dreampiggy/hexo-blog", "id": "3e641002ee13f27f39e3d7e750d75f8aec670aac", "size": "29858", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "source/_posts/WatchKit渲染原理以及SwiftUI桥接.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3182" }, { "name": "EJS", "bytes": "11768" }, { "name": "JavaScript", "bytes": "101636" }, { "name": "Stylus", "bytes": "115745" } ], "symlink_target": "" }
@interface PodsDummy_Pods_FLEX : NSObject @end @implementation PodsDummy_Pods_FLEX @end
{ "content_hash": "860b1b87dbcae2b3d7e6cd189a01a73a", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 41, "avg_line_length": 22, "alnum_prop": 0.8068181818181818, "repo_name": "YaleSTC/YalePublic-ios", "id": "c3cfb69ef56dab31849c566d86bee42d2a44b8b6", "size": "122", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "Pods/Target Support Files/Pods-FLEX/Pods-FLEX-dummy.m", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "302" }, { "name": "Objective-C", "bytes": "304661" }, { "name": "Ruby", "bytes": "324" } ], "symlink_target": "" }
<!-- Copyright The Ohio State University Research Foundation, The University of Chicago - Argonne National Laboratory, Emory University, SemanticBits LLC, and Ekagra Software Technologies Ltd. Distributed under the OSI-approved BSD 3-Clause License. See http://ncip.github.com/cagrid-core/LICENSE.txt for details. --> <ns1:CQLQueryResults targetClassname="gov.nih.nci.cacoresdk.domain.inheritance.onechild.Human" xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLResultSet"> <ns1:ObjectResult> <ns2:Human hairColor="Hair_Color1" id="1" diet="DIET1" xmlns:ns2="gme://caCORE.caCORE/4.2/gov.nih.nci.cacoresdk.domain.inheritance.onechild"/> </ns1:ObjectResult> <ns1:ObjectResult> <ns3:Human hairColor="Hair_Color2" id="2" diet="DIET2" xmlns:ns3="gme://caCORE.caCORE/4.2/gov.nih.nci.cacoresdk.domain.inheritance.onechild"/> </ns1:ObjectResult> <ns1:ObjectResult> <ns4:Human hairColor="Hair_Color3" id="3" diet="DIET3" xmlns:ns4="gme://caCORE.caCORE/4.2/gov.nih.nci.cacoresdk.domain.inheritance.onechild"/> </ns1:ObjectResult> <ns1:ObjectResult> <ns5:Human hairColor="Hair_Color4" id="4" diet="DIET4" xmlns:ns5="gme://caCORE.caCORE/4.2/gov.nih.nci.cacoresdk.domain.inheritance.onechild"/> </ns1:ObjectResult> </ns1:CQLQueryResults>
{ "content_hash": "9935218e0f2e182b5e9ff70c9134faa7", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 158, "avg_line_length": 59.61904761904762, "alnum_prop": 0.7587859424920128, "repo_name": "NCIP/cagrid-core", "id": "a38192c3fb445e599e55692dfdb3c5ef8f4f0343", "size": "1252", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "integration-tests/projects/sdk42StyleTests/resources/testGoldResults/goldGroupOfAttributesUsingOr.xml", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "124236" }, { "name": "Java", "bytes": "17856338" }, { "name": "JavaScript", "bytes": "62288" }, { "name": "Perl", "bytes": "100792" }, { "name": "Scala", "bytes": "405" }, { "name": "Shell", "bytes": "3487" }, { "name": "XSLT", "bytes": "6524" } ], "symlink_target": "" }
<?php # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/managedidentities/v1/managed_identities_service.proto namespace Google\Cloud\ManagedIdentities\V1; use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; /** * Request message for * [DetachTrust][google.cloud.managedidentities.v1.DetachTrust] * * Generated from protobuf message <code>google.cloud.managedidentities.v1.DetachTrustRequest</code> */ class DetachTrustRequest extends \Google\Protobuf\Internal\Message { /** * Required. The resource domain name, project name, and location using the form: * `projects/{project_id}/locations/global/domains/{domain_name}` * * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code> */ private $name = ''; /** * Required. The domain trust resource to removed. * * Generated from protobuf field <code>.google.cloud.managedidentities.v1.Trust trust = 2 [(.google.api.field_behavior) = REQUIRED];</code> */ private $trust = null; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $name * Required. The resource domain name, project name, and location using the form: * `projects/{project_id}/locations/global/domains/{domain_name}` * @type \Google\Cloud\ManagedIdentities\V1\Trust $trust * Required. The domain trust resource to removed. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Cloud\Managedidentities\V1\ManagedIdentitiesService::initOnce(); parent::__construct($data); } /** * Required. The resource domain name, project name, and location using the form: * `projects/{project_id}/locations/global/domains/{domain_name}` * * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code> * @return string */ public function getName() { return $this->name; } /** * Required. The resource domain name, project name, and location using the form: * `projects/{project_id}/locations/global/domains/{domain_name}` * * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code> * @param string $var * @return $this */ public function setName($var) { GPBUtil::checkString($var, True); $this->name = $var; return $this; } /** * Required. The domain trust resource to removed. * * Generated from protobuf field <code>.google.cloud.managedidentities.v1.Trust trust = 2 [(.google.api.field_behavior) = REQUIRED];</code> * @return \Google\Cloud\ManagedIdentities\V1\Trust|null */ public function getTrust() { return $this->trust; } public function hasTrust() { return isset($this->trust); } public function clearTrust() { unset($this->trust); } /** * Required. The domain trust resource to removed. * * Generated from protobuf field <code>.google.cloud.managedidentities.v1.Trust trust = 2 [(.google.api.field_behavior) = REQUIRED];</code> * @param \Google\Cloud\ManagedIdentities\V1\Trust $var * @return $this */ public function setTrust($var) { GPBUtil::checkMessage($var, \Google\Cloud\ManagedIdentities\V1\Trust::class); $this->trust = $var; return $this; } }
{ "content_hash": "28c4c2980b5ed4368514a9a8e7f5d3a1", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 144, "avg_line_length": 32.543103448275865, "alnum_prop": 0.6429139072847682, "repo_name": "googleapis/google-cloud-php", "id": "f6f536166fb784195119e3006dc996517afdc786", "size": "3775", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "ManagedIdentities/src/V1/DetachTrustRequest.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "3333" }, { "name": "PHP", "bytes": "47981731" }, { "name": "Python", "bytes": "413107" }, { "name": "Shell", "bytes": "8171" } ], "symlink_target": "" }
@class NSMenu, NSOpenPanel, NSPathCell; @protocol NSPathCellDelegate <NSObject> @optional - (void)pathCell:(NSPathCell *)arg1 willPopUpMenu:(NSMenu *)arg2; - (void)pathCell:(NSPathCell *)arg1 willDisplayOpenPanel:(NSOpenPanel *)arg2; @end
{ "content_hash": "d307cb68e44436d366449cb05345edba", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 77, "avg_line_length": 26.88888888888889, "alnum_prop": 0.7727272727272727, "repo_name": "XVimProject/XVim2", "id": "d948ddeef7f5e8909a63c915d0e95bdc9ad3e54c", "size": "423", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "XVim2/XcodeHeader/IDEKit/NSPathCellDelegate-Protocol.h", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "3672" }, { "name": "C", "bytes": "65096" }, { "name": "C++", "bytes": "10438" }, { "name": "Makefile", "bytes": "2176" }, { "name": "Objective-C", "bytes": "5172541" }, { "name": "Python", "bytes": "1161" }, { "name": "Ruby", "bytes": "1083" }, { "name": "Shell", "bytes": "593" }, { "name": "Swift", "bytes": "24720" } ], "symlink_target": "" }
FROM balenalib/isg-503-ubuntu:bionic-run # remove several traces of debian python RUN apt-get purge -y python.* # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # install python dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/* # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 ENV PYTHON_VERSION 3.9.10 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.3.1 ENV SETUPTOOLS_VERSION 60.5.4 RUN set -x \ && buildDeps=' \ curl \ ' \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-aarch64-libffi3.2.tar.gz" \ && echo "a7d555ce0d5deae26f5696a5717fd975fa65c8d2fca302565bf8ca71bb0a27e3 Python-$PYTHON_VERSION.linux-aarch64-libffi3.2.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.linux-aarch64-libffi3.2.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.linux-aarch64-libffi3.2.tar.gz" \ && ldconfig \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \ && echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -sf pip3 pip \ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ && ln -sf idle3 idle \ && ln -sf pydoc3 pydoc \ && ln -sf python3 python \ && ln -sf python3-config python-config # set PYTHONPATH to point to dist-packages ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Ubuntu bionic \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.9.10, Pip v21.3.1, Setuptools v60.5.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "content_hash": "1b0591f50b5a6b9d8938dd232f6509e3", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 709, "avg_line_length": 51.833333333333336, "alnum_prop": 0.7076428394756369, "repo_name": "resin-io-library/base-images", "id": "f4d53c2c1406c9570e31eefa941f3b8a28976b54", "size": "4064", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/python/isg-503/ubuntu/bionic/3.9.10/run/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "71234697" }, { "name": "JavaScript", "bytes": "13096" }, { "name": "Shell", "bytes": "12051936" }, { "name": "Smarty", "bytes": "59789" } ], "symlink_target": "" }
using System; namespace Oakton.Resources { public class ResourceSetupException : Exception { public ResourceSetupException(IStatefulResource resource, Exception ex) : base( $"Failed to setup resource {resource.Name} of type {resource.Type}", ex) { } public ResourceSetupException(IStatefulResourceSource source, Exception ex) : base( $"Failed to execute resource source {source}", ex) { } } }
{ "content_hash": "53a02a926f5cd0aad803e8dd60f681ea", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 91, "avg_line_length": 25.94736842105263, "alnum_prop": 0.6227180527383367, "repo_name": "JasperFx/oakton", "id": "a198ed6037f2d7d56aa8379f3638f9036e003a8f", "size": "495", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Oakton/Resources/ResourceSetupException.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "68" }, { "name": "C#", "bytes": "309644" }, { "name": "CSS", "bytes": "1107" }, { "name": "HTML", "bytes": "7804" }, { "name": "JavaScript", "bytes": "226" }, { "name": "PowerShell", "bytes": "54" }, { "name": "Shell", "bytes": "92" } ], "symlink_target": "" }
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package edu.buffalo.cse.cse486586.simpledynamo; public final class R { public static final class anim { public static final int abc_fade_in=0x7f040000; public static final int abc_fade_out=0x7f040001; public static final int abc_slide_in_bottom=0x7f040002; public static final int abc_slide_in_top=0x7f040003; public static final int abc_slide_out_bottom=0x7f040004; public static final int abc_slide_out_top=0x7f040005; } public static final class attr { /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarDivider=0x7f010000; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarItemBackground=0x7f010001; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int actionBarSize=0x7f010002; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarSplitStyle=0x7f010003; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarStyle=0x7f010004; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarTabBarStyle=0x7f010005; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarTabStyle=0x7f010006; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarTabTextStyle=0x7f010007; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionBarWidgetTheme=0x7f010008; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionButtonStyle=0x7f010009; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionDropDownStyle=0x7f010062; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionLayout=0x7f010059; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionMenuTextAppearance=0x7f01000a; /** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". */ public static final int actionMenuTextColor=0x7f01000b; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeBackground=0x7f01000c; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeCloseButtonStyle=0x7f01000d; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeCloseDrawable=0x7f01000e; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeCopyDrawable=0x7f01000f; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeCutDrawable=0x7f010010; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeFindDrawable=0x7f010011; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModePasteDrawable=0x7f010012; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModePopupWindowStyle=0x7f010013; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeSelectAllDrawable=0x7f010014; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeShareDrawable=0x7f010015; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeSplitBackground=0x7f010016; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeStyle=0x7f010017; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionModeWebSearchDrawable=0x7f010018; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int actionOverflowButtonStyle=0x7f010019; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int actionProviderClass=0x7f01005b; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int actionViewClass=0x7f01005a; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int activityChooserViewStyle=0x7f01001a; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int background=0x7f010047; /** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". */ public static final int backgroundSplit=0x7f010049; /** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". */ public static final int backgroundStacked=0x7f010048; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int buttonBarButtonStyle=0x7f01001b; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int buttonBarStyle=0x7f01001c; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int customNavigationLayout=0x7f01004a; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int disableChildrenWhenDisabled=0x7f010061; /** <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>useLogo</code></td><td>0x1</td><td></td></tr> <tr><td><code>showHome</code></td><td>0x2</td><td></td></tr> <tr><td><code>homeAsUp</code></td><td>0x4</td><td></td></tr> <tr><td><code>showTitle</code></td><td>0x8</td><td></td></tr> <tr><td><code>showCustom</code></td><td>0x10</td><td></td></tr> <tr><td><code>disableHome</code></td><td>0x20</td><td></td></tr> </table> */ public static final int displayOptions=0x7f010040; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int divider=0x7f010046; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int dividerHorizontal=0x7f01001d; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int dividerPadding=0x7f010057; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int dividerVertical=0x7f01001e; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int dropDownListViewStyle=0x7f01001f; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int dropdownListPreferredItemHeight=0x7f010063; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int expandActivityOverflowButtonDrawable=0x7f010054; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int height=0x7f010020; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int homeAsUpIndicator=0x7f010021; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int homeLayout=0x7f01004b; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int icon=0x7f010044; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int iconifiedByDefault=0x7f01005c; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int indeterminateProgressStyle=0x7f01004d; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int initialActivityCount=0x7f010053; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int isLightTheme=0x7f010022; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int itemPadding=0x7f01004f; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int listChoiceBackgroundIndicator=0x7f010067; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int listPopupWindowStyle=0x7f010023; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemHeight=0x7f010024; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemHeightLarge=0x7f010025; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemHeightSmall=0x7f010026; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemPaddingLeft=0x7f010027; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int listPreferredItemPaddingRight=0x7f010028; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int logo=0x7f010045; /** <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>normal</code></td><td>0</td><td></td></tr> <tr><td><code>listMode</code></td><td>1</td><td></td></tr> <tr><td><code>tabMode</code></td><td>2</td><td></td></tr> </table> */ public static final int navigationMode=0x7f01003f; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int paddingEnd=0x7f010069; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int paddingStart=0x7f010068; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int panelMenuListTheme=0x7f010066; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int panelMenuListWidth=0x7f010065; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int popupMenuStyle=0x7f010064; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int popupPromptView=0x7f010060; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int progressBarPadding=0x7f01004e; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int progressBarStyle=0x7f01004c; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int prompt=0x7f01005e; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int queryHint=0x7f01005d; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchDropdownBackground=0x7f010029; /** <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int searchResultListItemHeight=0x7f01002a; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewAutoCompleteTextView=0x7f01002b; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewCloseIcon=0x7f01002c; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewEditQuery=0x7f01002d; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewEditQueryBackground=0x7f01002e; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewGoIcon=0x7f01002f; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewSearchIcon=0x7f010030; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewTextField=0x7f010031; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewTextFieldRight=0x7f010032; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int searchViewVoiceIcon=0x7f010033; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int selectableItemBackground=0x7f010034; /** <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>never</code></td><td>0</td><td></td></tr> <tr><td><code>ifRoom</code></td><td>1</td><td></td></tr> <tr><td><code>always</code></td><td>2</td><td></td></tr> <tr><td><code>withText</code></td><td>4</td><td></td></tr> <tr><td><code>collapseActionView</code></td><td>8</td><td></td></tr> </table> */ public static final int showAsAction=0x7f010058; /** <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>none</code></td><td>0</td><td></td></tr> <tr><td><code>beginning</code></td><td>1</td><td></td></tr> <tr><td><code>middle</code></td><td>2</td><td></td></tr> <tr><td><code>end</code></td><td>4</td><td></td></tr> </table> */ public static final int showDividers=0x7f010056; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int spinnerDropDownItemStyle=0x7f010035; /** <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>dialog</code></td><td>0</td><td></td></tr> <tr><td><code>dropdown</code></td><td>1</td><td></td></tr> </table> */ public static final int spinnerMode=0x7f01005f; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int spinnerStyle=0x7f010036; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int subtitle=0x7f010041; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int subtitleTextStyle=0x7f010043; /** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a boolean value, either "<code>true</code>" or "<code>false</code>". */ public static final int textAllCaps=0x7f010055; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceLargePopupMenu=0x7f010037; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceListItem=0x7f010038; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceListItemSmall=0x7f010039; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceSearchResultSubtitle=0x7f01003a; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceSearchResultTitle=0x7f01003b; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int textAppearanceSmallPopupMenu=0x7f01003c; /** <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". */ public static final int textColorSearchUrl=0x7f01003d; /** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int title=0x7f01003e; /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". */ public static final int titleTextStyle=0x7f010042; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowActionBar=0x7f010050; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowActionBarOverlay=0x7f010051; /** <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. */ public static final int windowSplitActionBar=0x7f010052; } public static final class bool { public static final int abc_action_bar_embed_tabs_pre_jb=0x7f060000; public static final int abc_action_bar_expanded_action_views_exclusive=0x7f060003; public static final int abc_config_actionMenuItemAllCaps=0x7f060004; public static final int abc_config_allowActionMenuItemTextWithIcon=0x7f060001; public static final int abc_config_showMenuShortcutsWhenKeyboardPresent=0x7f060005; public static final int abc_split_action_bar_is_narrow=0x7f060002; } public static final class color { public static final int abc_search_url_text_holo=0x7f0a0012; public static final int abc_search_url_text_normal=0x7f0a000f; public static final int abc_search_url_text_pressed=0x7f0a0010; public static final int abc_search_url_text_selected=0x7f0a0011; public static final int accent=0x7f0a0000; public static final int background=0x7f0a0001; public static final int disabled=0x7f0a0002; public static final int hint_text=0x7f0a0003; public static final int my_port=0x7f0a0004; public static final int primary=0x7f0a0005; public static final int primary_dark=0x7f0a0006; public static final int remote_port0=0x7f0a0007; public static final int remote_port1=0x7f0a0008; public static final int remote_port2=0x7f0a0009; public static final int remote_port3=0x7f0a000a; public static final int remote_port4=0x7f0a000b; public static final int remote_port5=0x7f0a000c; public static final int text=0x7f0a000d; public static final int white=0x7f0a000e; } public static final class dimen { public static final int abc_action_bar_default_height=0x7f070000; public static final int abc_action_bar_icon_vertical_padding=0x7f070001; public static final int abc_action_bar_progress_bar_size=0x7f070002; public static final int abc_action_bar_stacked_max_height=0x7f07000b; public static final int abc_action_bar_stacked_tab_max_width=0x7f07000c; public static final int abc_action_bar_subtitle_bottom_margin=0x7f070003; public static final int abc_action_bar_subtitle_text_size=0x7f070004; public static final int abc_action_bar_subtitle_top_margin=0x7f070005; public static final int abc_action_bar_title_text_size=0x7f070006; public static final int abc_action_button_min_width=0x7f07000a; public static final int abc_config_prefDialogWidth=0x7f070007; public static final int abc_dropdownitem_icon_width=0x7f07000d; public static final int abc_dropdownitem_text_padding_left=0x7f07000e; public static final int abc_dropdownitem_text_padding_right=0x7f07000f; public static final int abc_panel_menu_list_width=0x7f070010; public static final int abc_search_view_preferred_width=0x7f070011; public static final int abc_search_view_text_min_width=0x7f070008; public static final int activity_horizontal_margin=0x7f070009; public static final int activity_vertical_margin=0x7f070012; } public static final class drawable { public static final int abc_ab_bottom_solid_dark_holo=0x7f020000; public static final int abc_ab_bottom_solid_light_holo=0x7f020001; public static final int abc_ab_bottom_transparent_dark_holo=0x7f020002; public static final int abc_ab_bottom_transparent_light_holo=0x7f020003; public static final int abc_ab_share_pack_holo_dark=0x7f020004; public static final int abc_ab_share_pack_holo_light=0x7f020005; public static final int abc_ab_solid_dark_holo=0x7f020006; public static final int abc_ab_solid_light_holo=0x7f020007; public static final int abc_ab_stacked_solid_dark_holo=0x7f020008; public static final int abc_ab_stacked_solid_light_holo=0x7f020009; public static final int abc_ab_stacked_transparent_dark_holo=0x7f02000a; public static final int abc_ab_stacked_transparent_light_holo=0x7f02000b; public static final int abc_ab_transparent_dark_holo=0x7f02000c; public static final int abc_ab_transparent_light_holo=0x7f02000d; public static final int abc_cab_background_bottom_holo_dark=0x7f02000e; public static final int abc_cab_background_bottom_holo_light=0x7f02000f; public static final int abc_cab_background_top_holo_dark=0x7f020010; public static final int abc_cab_background_top_holo_light=0x7f020011; public static final int abc_ic_ab_back_holo_dark=0x7f020012; public static final int abc_ic_ab_back_holo_light=0x7f020013; public static final int abc_ic_cab_done_holo_dark=0x7f020014; public static final int abc_ic_cab_done_holo_light=0x7f020015; public static final int abc_ic_clear=0x7f020016; public static final int abc_ic_clear_disabled=0x7f020017; public static final int abc_ic_clear_holo_light=0x7f020018; public static final int abc_ic_clear_normal=0x7f020019; public static final int abc_ic_clear_search_api_disabled_holo_light=0x7f02001a; public static final int abc_ic_clear_search_api_holo_light=0x7f02001b; public static final int abc_ic_commit_search_api_holo_dark=0x7f02001c; public static final int abc_ic_commit_search_api_holo_light=0x7f02001d; public static final int abc_ic_go=0x7f02001e; public static final int abc_ic_go_search_api_holo_light=0x7f02001f; public static final int abc_ic_menu_moreoverflow_normal_holo_dark=0x7f020020; public static final int abc_ic_menu_moreoverflow_normal_holo_light=0x7f020021; public static final int abc_ic_menu_share_holo_dark=0x7f020022; public static final int abc_ic_menu_share_holo_light=0x7f020023; public static final int abc_ic_search=0x7f020024; public static final int abc_ic_search_api_holo_light=0x7f020025; public static final int abc_ic_voice_search=0x7f020026; public static final int abc_ic_voice_search_api_holo_light=0x7f020027; public static final int abc_item_background_holo_dark=0x7f020028; public static final int abc_item_background_holo_light=0x7f020029; public static final int abc_list_divider_holo_dark=0x7f02002a; public static final int abc_list_divider_holo_light=0x7f02002b; public static final int abc_list_focused_holo=0x7f02002c; public static final int abc_list_longpressed_holo=0x7f02002d; public static final int abc_list_pressed_holo_dark=0x7f02002e; public static final int abc_list_pressed_holo_light=0x7f02002f; public static final int abc_list_selector_background_transition_holo_dark=0x7f020030; public static final int abc_list_selector_background_transition_holo_light=0x7f020031; public static final int abc_list_selector_disabled_holo_dark=0x7f020032; public static final int abc_list_selector_disabled_holo_light=0x7f020033; public static final int abc_list_selector_holo_dark=0x7f020034; public static final int abc_list_selector_holo_light=0x7f020035; public static final int abc_menu_dropdown_panel_holo_dark=0x7f020036; public static final int abc_menu_dropdown_panel_holo_light=0x7f020037; public static final int abc_menu_hardkey_panel_holo_dark=0x7f020038; public static final int abc_menu_hardkey_panel_holo_light=0x7f020039; public static final int abc_search_dropdown_dark=0x7f02003a; public static final int abc_search_dropdown_light=0x7f02003b; public static final int abc_spinner_ab_default_holo_dark=0x7f02003c; public static final int abc_spinner_ab_default_holo_light=0x7f02003d; public static final int abc_spinner_ab_disabled_holo_dark=0x7f02003e; public static final int abc_spinner_ab_disabled_holo_light=0x7f02003f; public static final int abc_spinner_ab_focused_holo_dark=0x7f020040; public static final int abc_spinner_ab_focused_holo_light=0x7f020041; public static final int abc_spinner_ab_holo_dark=0x7f020042; public static final int abc_spinner_ab_holo_light=0x7f020043; public static final int abc_spinner_ab_pressed_holo_dark=0x7f020044; public static final int abc_spinner_ab_pressed_holo_light=0x7f020045; public static final int abc_tab_indicator_ab_holo=0x7f020046; public static final int abc_tab_selected_focused_holo=0x7f020047; public static final int abc_tab_selected_holo=0x7f020048; public static final int abc_tab_selected_pressed_holo=0x7f020049; public static final int abc_tab_unselected_pressed_holo=0x7f02004a; public static final int abc_textfield_search_default_holo_dark=0x7f02004b; public static final int abc_textfield_search_default_holo_light=0x7f02004c; public static final int abc_textfield_search_right_default_holo_dark=0x7f02004d; public static final int abc_textfield_search_right_default_holo_light=0x7f02004e; public static final int abc_textfield_search_right_selected_holo_dark=0x7f02004f; public static final int abc_textfield_search_right_selected_holo_light=0x7f020050; public static final int abc_textfield_search_selected_holo_dark=0x7f020051; public static final int abc_textfield_search_selected_holo_light=0x7f020052; public static final int abc_textfield_searchview_holo_dark=0x7f020053; public static final int abc_textfield_searchview_holo_light=0x7f020054; public static final int abc_textfield_searchview_right_holo_dark=0x7f020055; public static final int abc_textfield_searchview_right_holo_light=0x7f020056; public static final int border=0x7f020057; public static final int ic_launcher=0x7f020058; } public static final class id { public static final int action_bar=0x7f0b001c; public static final int action_bar_activity_content=0x7f0b0000; public static final int action_bar_container=0x7f0b001b; public static final int action_bar_overlay_layout=0x7f0b001f; public static final int action_bar_root=0x7f0b001a; public static final int action_bar_subtitle=0x7f0b0023; public static final int action_bar_title=0x7f0b0022; public static final int action_context_bar=0x7f0b001d; public static final int action_menu_divider=0x7f0b0001; public static final int action_menu_presenter=0x7f0b0002; public static final int action_mode_close_button=0x7f0b0024; public static final int action_settings=0x7f0b0048; public static final int activity_chooser_view_content=0x7f0b0025; public static final int always=0x7f0b0013; public static final int beginning=0x7f0b000f; public static final int btn_test_insert=0x7f0b003f; public static final int btn_test_query=0x7f0b0040; public static final int button1=0x7f0b003c; public static final int button2=0x7f0b003d; public static final int checkbox=0x7f0b002d; public static final int collapseActionView=0x7f0b0014; public static final int default_activity_button=0x7f0b0028; public static final int dialog=0x7f0b0018; public static final int disableHome=0x7f0b0009; public static final int dropdown=0x7f0b0019; public static final int dynamo_ring=0x7f0b0045; public static final int edit_query=0x7f0b0030; public static final int edit_txt=0x7f0b003e; public static final int end=0x7f0b0010; public static final int expand_activities_button=0x7f0b0026; public static final int expanded_menu=0x7f0b002c; public static final int home=0x7f0b0003; public static final int homeAsUp=0x7f0b000a; public static final int icon=0x7f0b002a; public static final int ifRoom=0x7f0b0015; public static final int image=0x7f0b0027; public static final int listMode=0x7f0b0006; public static final int list_item=0x7f0b0029; public static final int middle=0x7f0b0011; public static final int never=0x7f0b0016; public static final int next_node=0x7f0b0043; public static final int none=0x7f0b0012; public static final int normal=0x7f0b0007; public static final int prev_node=0x7f0b0041; public static final int progress_circular=0x7f0b0004; public static final int progress_horizontal=0x7f0b0005; public static final int radio=0x7f0b002f; public static final int search_badge=0x7f0b0032; public static final int search_bar=0x7f0b0031; public static final int search_button=0x7f0b0033; public static final int search_close_btn=0x7f0b0038; public static final int search_edit_frame=0x7f0b0034; public static final int search_go_btn=0x7f0b003a; public static final int search_mag_icon=0x7f0b0035; public static final int search_plate=0x7f0b0036; public static final int search_src_text=0x7f0b0037; public static final int search_voice_btn=0x7f0b003b; public static final int shortcut=0x7f0b002e; public static final int showCustom=0x7f0b000b; public static final int showHome=0x7f0b000c; public static final int showTitle=0x7f0b000d; public static final int split_action_bar=0x7f0b001e; public static final int submit_area=0x7f0b0039; public static final int tabMode=0x7f0b0008; public static final int textView1=0x7f0b0047; public static final int title=0x7f0b002b; public static final int top_action_bar=0x7f0b0020; public static final int txt_dynamo_ring_nodes=0x7f0b0046; public static final int txt_next_node=0x7f0b0044; public static final int txt_prev_node=0x7f0b0042; public static final int up=0x7f0b0021; public static final int useLogo=0x7f0b000e; public static final int withText=0x7f0b0017; } public static final class integer { public static final int abc_max_action_buttons=0x7f080000; } public static final class layout { public static final int abc_action_bar_decor=0x7f030000; public static final int abc_action_bar_decor_include=0x7f030001; public static final int abc_action_bar_decor_overlay=0x7f030002; public static final int abc_action_bar_home=0x7f030003; public static final int abc_action_bar_tab=0x7f030004; public static final int abc_action_bar_tabbar=0x7f030005; public static final int abc_action_bar_title_item=0x7f030006; public static final int abc_action_bar_view_list_nav_layout=0x7f030007; public static final int abc_action_menu_item_layout=0x7f030008; public static final int abc_action_menu_layout=0x7f030009; public static final int abc_action_mode_bar=0x7f03000a; public static final int abc_action_mode_close_item=0x7f03000b; public static final int abc_activity_chooser_view=0x7f03000c; public static final int abc_activity_chooser_view_include=0x7f03000d; public static final int abc_activity_chooser_view_list_item=0x7f03000e; public static final int abc_expanded_menu_layout=0x7f03000f; public static final int abc_list_menu_item_checkbox=0x7f030010; public static final int abc_list_menu_item_icon=0x7f030011; public static final int abc_list_menu_item_layout=0x7f030012; public static final int abc_list_menu_item_radio=0x7f030013; public static final int abc_popup_menu_item_layout=0x7f030014; public static final int abc_search_dropdown_item_icons_2line=0x7f030015; public static final int abc_search_view=0x7f030016; public static final int activity_simple_dynamo=0x7f030017; public static final int support_simple_spinner_dropdown_item=0x7f030018; } public static final class menu { public static final int simple_dynamo=0x7f0c0000; } public static final class string { public static final int abc_action_bar_home_description=0x7f050000; public static final int abc_action_bar_up_description=0x7f050001; public static final int abc_action_menu_overflow_description=0x7f050002; public static final int abc_action_mode_done=0x7f050003; public static final int abc_activity_chooser_view_see_all=0x7f050004; public static final int abc_activitychooserview_choose_application=0x7f050005; public static final int abc_searchview_description_clear=0x7f050006; public static final int abc_searchview_description_query=0x7f050007; public static final int abc_searchview_description_search=0x7f050008; public static final int abc_searchview_description_submit=0x7f050009; public static final int abc_searchview_description_voice=0x7f05000a; public static final int abc_shareactionprovider_share_with=0x7f05000b; public static final int abc_shareactionprovider_share_with_application=0x7f05000c; public static final int action_settings=0x7f05000d; public static final int app_name=0x7f05000e; public static final int button_delete=0x7f05000f; public static final int button_dump=0x7f050010; public static final int button_test_insert=0x7f050011; public static final int button_test_query=0x7f050012; public static final int txt_dynamo_ring=0x7f050013; public static final int txt_next_node=0x7f050014; public static final int txt_prev_node=0x7f050015; } public static final class style { /** API 11 theme customizations can go here. API 14 theme customizations can go here. Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. */ public static final int AppBaseTheme=0x7f090000; /** All customizations that are NOT specific to a particular API-level can go here. */ public static final int AppTheme=0x7f09003c; public static final int TextAppearance_AppCompat_Base_CompactMenu_Dialog=0x7f09003d; public static final int TextAppearance_AppCompat_Base_SearchResult=0x7f09003e; public static final int TextAppearance_AppCompat_Base_SearchResult_Subtitle=0x7f090007; public static final int TextAppearance_AppCompat_Base_SearchResult_Title=0x7f090008; public static final int TextAppearance_AppCompat_Base_Widget_PopupMenu_Large=0x7f090009; public static final int TextAppearance_AppCompat_Base_Widget_PopupMenu_Small=0x7f09000a; public static final int TextAppearance_AppCompat_Light_Base_SearchResult=0x7f09003f; public static final int TextAppearance_AppCompat_Light_Base_SearchResult_Subtitle=0x7f09000b; public static final int TextAppearance_AppCompat_Light_Base_SearchResult_Title=0x7f09000c; public static final int TextAppearance_AppCompat_Light_Base_Widget_PopupMenu_Large=0x7f09000d; public static final int TextAppearance_AppCompat_Light_Base_Widget_PopupMenu_Small=0x7f09000e; public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle=0x7f090040; public static final int TextAppearance_AppCompat_Light_SearchResult_Title=0x7f090041; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large=0x7f090042; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small=0x7f090043; public static final int TextAppearance_AppCompat_SearchResult_Subtitle=0x7f090044; public static final int TextAppearance_AppCompat_SearchResult_Title=0x7f090045; public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu=0x7f090046; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle=0x7f090047; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse=0x7f090048; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title=0x7f090049; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse=0x7f09004a; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle=0x7f09004b; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse=0x7f09004c; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title=0x7f09004d; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse=0x7f09004e; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Menu=0x7f09000f; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Subtitle=0x7f090010; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Subtitle_Inverse=0x7f090011; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Title=0x7f090012; public static final int TextAppearance_AppCompat_Widget_Base_ActionBar_Title_Inverse=0x7f090013; public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Subtitle=0x7f090014; public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Subtitle_Inverse=0x7f090015; public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Title=0x7f090016; public static final int TextAppearance_AppCompat_Widget_Base_ActionMode_Title_Inverse=0x7f090017; public static final int TextAppearance_AppCompat_Widget_Base_DropDownItem=0x7f09004f; public static final int TextAppearance_AppCompat_Widget_DropDownItem=0x7f090050; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large=0x7f090051; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small=0x7f090052; public static final int TextAppearance_Widget_AppCompat_Base_ExpandedMenu_Item=0x7f090053; public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item=0x7f090054; public static final int Theme_AppCompat=0x7f090055; public static final int Theme_AppCompat_Base_CompactMenu=0x7f090056; public static final int Theme_AppCompat_Base_CompactMenu_Dialog=0x7f090057; public static final int Theme_AppCompat_CompactMenu=0x7f090058; public static final int Theme_AppCompat_CompactMenu_Dialog=0x7f090059; public static final int Theme_AppCompat_Light=0x7f09005a; public static final int Theme_AppCompat_Light_DarkActionBar=0x7f09005b; public static final int Theme_Base=0x7f090001; public static final int Theme_Base_AppCompat=0x7f090018; public static final int Theme_Base_AppCompat_Light=0x7f090019; public static final int Theme_Base_AppCompat_Light_DarkActionBar=0x7f09001a; public static final int Theme_Base_Light=0x7f090002; public static final int Widget_AppCompat_ActionBar=0x7f09005c; public static final int Widget_AppCompat_ActionBar_Solid=0x7f09005d; public static final int Widget_AppCompat_ActionBar_TabBar=0x7f09005e; public static final int Widget_AppCompat_ActionBar_TabText=0x7f09005f; public static final int Widget_AppCompat_ActionBar_TabView=0x7f090060; public static final int Widget_AppCompat_ActionButton=0x7f090061; public static final int Widget_AppCompat_ActionButton_CloseMode=0x7f090062; public static final int Widget_AppCompat_ActionButton_Overflow=0x7f090063; public static final int Widget_AppCompat_ActionMode=0x7f090064; public static final int Widget_AppCompat_ActivityChooserView=0x7f090065; public static final int Widget_AppCompat_AutoCompleteTextView=0x7f090066; public static final int Widget_AppCompat_Base_ActionBar=0x7f09001b; public static final int Widget_AppCompat_Base_ActionBar_Solid=0x7f09001c; public static final int Widget_AppCompat_Base_ActionBar_TabBar=0x7f09001d; public static final int Widget_AppCompat_Base_ActionBar_TabText=0x7f09001e; public static final int Widget_AppCompat_Base_ActionBar_TabView=0x7f09001f; public static final int Widget_AppCompat_Base_ActionButton=0x7f090020; public static final int Widget_AppCompat_Base_ActionButton_CloseMode=0x7f090021; public static final int Widget_AppCompat_Base_ActionButton_Overflow=0x7f090022; public static final int Widget_AppCompat_Base_ActionMode=0x7f090067; public static final int Widget_AppCompat_Base_ActivityChooserView=0x7f090023; public static final int Widget_AppCompat_Base_AutoCompleteTextView=0x7f090003; public static final int Widget_AppCompat_Base_DropDownItem_Spinner=0x7f090024; public static final int Widget_AppCompat_Base_ListPopupWindow=0x7f090025; public static final int Widget_AppCompat_Base_ListView_DropDown=0x7f090026; public static final int Widget_AppCompat_Base_ListView_Menu=0x7f090027; public static final int Widget_AppCompat_Base_PopupMenu=0x7f090028; public static final int Widget_AppCompat_Base_ProgressBar=0x7f090004; public static final int Widget_AppCompat_Base_ProgressBar_Horizontal=0x7f090005; public static final int Widget_AppCompat_Base_Spinner=0x7f090029; public static final int Widget_AppCompat_DropDownItem_Spinner=0x7f090068; public static final int Widget_AppCompat_Light_ActionBar=0x7f090069; public static final int Widget_AppCompat_Light_ActionBar_Solid=0x7f09006a; public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse=0x7f09006b; public static final int Widget_AppCompat_Light_ActionBar_TabBar=0x7f09006c; public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse=0x7f09006d; public static final int Widget_AppCompat_Light_ActionBar_TabText=0x7f09006e; public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse=0x7f09006f; public static final int Widget_AppCompat_Light_ActionBar_TabView=0x7f090070; public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse=0x7f090071; public static final int Widget_AppCompat_Light_ActionButton=0x7f090072; public static final int Widget_AppCompat_Light_ActionButton_CloseMode=0x7f090073; public static final int Widget_AppCompat_Light_ActionButton_Overflow=0x7f090074; public static final int Widget_AppCompat_Light_ActionMode_Inverse=0x7f090075; public static final int Widget_AppCompat_Light_ActivityChooserView=0x7f090076; public static final int Widget_AppCompat_Light_AutoCompleteTextView=0x7f090077; public static final int Widget_AppCompat_Light_Base_ActionBar=0x7f09002a; public static final int Widget_AppCompat_Light_Base_ActionBar_Solid=0x7f09002b; public static final int Widget_AppCompat_Light_Base_ActionBar_Solid_Inverse=0x7f09002c; public static final int Widget_AppCompat_Light_Base_ActionBar_TabBar=0x7f09002d; public static final int Widget_AppCompat_Light_Base_ActionBar_TabBar_Inverse=0x7f09002e; public static final int Widget_AppCompat_Light_Base_ActionBar_TabText=0x7f09002f; public static final int Widget_AppCompat_Light_Base_ActionBar_TabText_Inverse=0x7f090030; public static final int Widget_AppCompat_Light_Base_ActionBar_TabView=0x7f090031; public static final int Widget_AppCompat_Light_Base_ActionBar_TabView_Inverse=0x7f090032; public static final int Widget_AppCompat_Light_Base_ActionButton=0x7f090033; public static final int Widget_AppCompat_Light_Base_ActionButton_CloseMode=0x7f090034; public static final int Widget_AppCompat_Light_Base_ActionButton_Overflow=0x7f090035; public static final int Widget_AppCompat_Light_Base_ActionMode_Inverse=0x7f090036; public static final int Widget_AppCompat_Light_Base_ActivityChooserView=0x7f090078; public static final int Widget_AppCompat_Light_Base_AutoCompleteTextView=0x7f090006; public static final int Widget_AppCompat_Light_Base_DropDownItem_Spinner=0x7f090037; public static final int Widget_AppCompat_Light_Base_ListPopupWindow=0x7f090038; public static final int Widget_AppCompat_Light_Base_ListView_DropDown=0x7f090039; public static final int Widget_AppCompat_Light_Base_PopupMenu=0x7f09003a; public static final int Widget_AppCompat_Light_Base_Spinner=0x7f09003b; public static final int Widget_AppCompat_Light_DropDownItem_Spinner=0x7f090079; public static final int Widget_AppCompat_Light_ListPopupWindow=0x7f09007a; public static final int Widget_AppCompat_Light_ListView_DropDown=0x7f09007b; public static final int Widget_AppCompat_Light_PopupMenu=0x7f09007c; public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar=0x7f09007d; public static final int Widget_AppCompat_ListPopupWindow=0x7f09007e; public static final int Widget_AppCompat_ListView_DropDown=0x7f09007f; public static final int Widget_AppCompat_ListView_Menu=0x7f090080; public static final int Widget_AppCompat_PopupMenu=0x7f090081; public static final int Widget_AppCompat_ProgressBar=0x7f090082; public static final int Widget_AppCompat_ProgressBar_Horizontal=0x7f090083; public static final int Widget_AppCompat_Spinner_DropDown_ActionBar=0x7f090084; } public static final class styleable { /** Attributes that can be used with a ActionBar. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionBar_background edu.buffalo.cse.cse486586.simpledynamo:background}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_backgroundSplit edu.buffalo.cse.cse486586.simpledynamo:backgroundSplit}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_backgroundStacked edu.buffalo.cse.cse486586.simpledynamo:backgroundStacked}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_customNavigationLayout edu.buffalo.cse.cse486586.simpledynamo:customNavigationLayout}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_displayOptions edu.buffalo.cse.cse486586.simpledynamo:displayOptions}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_divider edu.buffalo.cse.cse486586.simpledynamo:divider}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_height edu.buffalo.cse.cse486586.simpledynamo:height}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_homeLayout edu.buffalo.cse.cse486586.simpledynamo:homeLayout}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_icon edu.buffalo.cse.cse486586.simpledynamo:icon}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_indeterminateProgressStyle edu.buffalo.cse.cse486586.simpledynamo:indeterminateProgressStyle}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_itemPadding edu.buffalo.cse.cse486586.simpledynamo:itemPadding}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_logo edu.buffalo.cse.cse486586.simpledynamo:logo}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_navigationMode edu.buffalo.cse.cse486586.simpledynamo:navigationMode}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_progressBarPadding edu.buffalo.cse.cse486586.simpledynamo:progressBarPadding}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_progressBarStyle edu.buffalo.cse.cse486586.simpledynamo:progressBarStyle}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_subtitle edu.buffalo.cse.cse486586.simpledynamo:subtitle}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_subtitleTextStyle edu.buffalo.cse.cse486586.simpledynamo:subtitleTextStyle}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_title edu.buffalo.cse.cse486586.simpledynamo:title}</code></td><td></td></tr> <tr><td><code>{@link #ActionBar_titleTextStyle edu.buffalo.cse.cse486586.simpledynamo:titleTextStyle}</code></td><td></td></tr> </table> @see #ActionBar_background @see #ActionBar_backgroundSplit @see #ActionBar_backgroundStacked @see #ActionBar_customNavigationLayout @see #ActionBar_displayOptions @see #ActionBar_divider @see #ActionBar_height @see #ActionBar_homeLayout @see #ActionBar_icon @see #ActionBar_indeterminateProgressStyle @see #ActionBar_itemPadding @see #ActionBar_logo @see #ActionBar_navigationMode @see #ActionBar_progressBarPadding @see #ActionBar_progressBarStyle @see #ActionBar_subtitle @see #ActionBar_subtitleTextStyle @see #ActionBar_title @see #ActionBar_titleTextStyle */ public static final int[] ActionBar = { 0x7f010020, 0x7f01003e, 0x7f01003f, 0x7f010040, 0x7f010041, 0x7f010042, 0x7f010043, 0x7f010044, 0x7f010045, 0x7f010046, 0x7f010047, 0x7f010048, 0x7f010049, 0x7f01004a, 0x7f01004b, 0x7f01004c, 0x7f01004d, 0x7f01004e, 0x7f01004f }; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#background} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:background */ public static final int ActionBar_background = 10; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#backgroundSplit} attribute's value can be found in the {@link #ActionBar} array. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:backgroundSplit */ public static final int ActionBar_backgroundSplit = 12; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#backgroundStacked} attribute's value can be found in the {@link #ActionBar} array. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:backgroundStacked */ public static final int ActionBar_backgroundStacked = 11; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#customNavigationLayout} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:customNavigationLayout */ public static final int ActionBar_customNavigationLayout = 13; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#displayOptions} attribute's value can be found in the {@link #ActionBar} array. <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>useLogo</code></td><td>0x1</td><td></td></tr> <tr><td><code>showHome</code></td><td>0x2</td><td></td></tr> <tr><td><code>homeAsUp</code></td><td>0x4</td><td></td></tr> <tr><td><code>showTitle</code></td><td>0x8</td><td></td></tr> <tr><td><code>showCustom</code></td><td>0x10</td><td></td></tr> <tr><td><code>disableHome</code></td><td>0x20</td><td></td></tr> </table> @attr name edu.buffalo.cse.cse486586.simpledynamo:displayOptions */ public static final int ActionBar_displayOptions = 3; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#divider} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:divider */ public static final int ActionBar_divider = 9; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#height} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:height */ public static final int ActionBar_height = 0; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#homeLayout} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:homeLayout */ public static final int ActionBar_homeLayout = 14; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#icon} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:icon */ public static final int ActionBar_icon = 7; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#indeterminateProgressStyle} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:indeterminateProgressStyle */ public static final int ActionBar_indeterminateProgressStyle = 16; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#itemPadding} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:itemPadding */ public static final int ActionBar_itemPadding = 18; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#logo} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:logo */ public static final int ActionBar_logo = 8; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#navigationMode} attribute's value can be found in the {@link #ActionBar} array. <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>normal</code></td><td>0</td><td></td></tr> <tr><td><code>listMode</code></td><td>1</td><td></td></tr> <tr><td><code>tabMode</code></td><td>2</td><td></td></tr> </table> @attr name edu.buffalo.cse.cse486586.simpledynamo:navigationMode */ public static final int ActionBar_navigationMode = 2; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#progressBarPadding} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:progressBarPadding */ public static final int ActionBar_progressBarPadding = 17; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#progressBarStyle} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:progressBarStyle */ public static final int ActionBar_progressBarStyle = 15; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#subtitle} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:subtitle */ public static final int ActionBar_subtitle = 4; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#subtitleTextStyle} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:subtitleTextStyle */ public static final int ActionBar_subtitleTextStyle = 6; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#title} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:title */ public static final int ActionBar_title = 1; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#titleTextStyle} attribute's value can be found in the {@link #ActionBar} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:titleTextStyle */ public static final int ActionBar_titleTextStyle = 5; /** Attributes that can be used with a ActionBarLayout. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionBarLayout_android_layout_gravity android:layout_gravity}</code></td><td></td></tr> </table> @see #ActionBarLayout_android_layout_gravity */ public static final int[] ActionBarLayout = { 0x010100b3 }; /** <p>This symbol is the offset where the {@link android.R.attr#layout_gravity} attribute's value can be found in the {@link #ActionBarLayout} array. @attr name android:layout_gravity */ public static final int ActionBarLayout_android_layout_gravity = 0; /** Attributes that can be used with a ActionBarWindow. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionBarWindow_windowActionBar edu.buffalo.cse.cse486586.simpledynamo:windowActionBar}</code></td><td></td></tr> <tr><td><code>{@link #ActionBarWindow_windowActionBarOverlay edu.buffalo.cse.cse486586.simpledynamo:windowActionBarOverlay}</code></td><td></td></tr> <tr><td><code>{@link #ActionBarWindow_windowSplitActionBar edu.buffalo.cse.cse486586.simpledynamo:windowSplitActionBar}</code></td><td></td></tr> </table> @see #ActionBarWindow_windowActionBar @see #ActionBarWindow_windowActionBarOverlay @see #ActionBarWindow_windowSplitActionBar */ public static final int[] ActionBarWindow = { 0x7f010050, 0x7f010051, 0x7f010052 }; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#windowActionBar} attribute's value can be found in the {@link #ActionBarWindow} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:windowActionBar */ public static final int ActionBarWindow_windowActionBar = 0; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#windowActionBarOverlay} attribute's value can be found in the {@link #ActionBarWindow} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:windowActionBarOverlay */ public static final int ActionBarWindow_windowActionBarOverlay = 1; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#windowSplitActionBar} attribute's value can be found in the {@link #ActionBarWindow} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:windowSplitActionBar */ public static final int ActionBarWindow_windowSplitActionBar = 2; /** Attributes that can be used with a ActionMenuItemView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionMenuItemView_android_minWidth android:minWidth}</code></td><td></td></tr> </table> @see #ActionMenuItemView_android_minWidth */ public static final int[] ActionMenuItemView = { 0x0101013f }; /** <p>This symbol is the offset where the {@link android.R.attr#minWidth} attribute's value can be found in the {@link #ActionMenuItemView} array. @attr name android:minWidth */ public static final int ActionMenuItemView_android_minWidth = 0; /** Attributes that can be used with a ActionMenuView. */ public static final int[] ActionMenuView = { }; /** Attributes that can be used with a ActionMode. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActionMode_background edu.buffalo.cse.cse486586.simpledynamo:background}</code></td><td></td></tr> <tr><td><code>{@link #ActionMode_backgroundSplit edu.buffalo.cse.cse486586.simpledynamo:backgroundSplit}</code></td><td></td></tr> <tr><td><code>{@link #ActionMode_height edu.buffalo.cse.cse486586.simpledynamo:height}</code></td><td></td></tr> <tr><td><code>{@link #ActionMode_subtitleTextStyle edu.buffalo.cse.cse486586.simpledynamo:subtitleTextStyle}</code></td><td></td></tr> <tr><td><code>{@link #ActionMode_titleTextStyle edu.buffalo.cse.cse486586.simpledynamo:titleTextStyle}</code></td><td></td></tr> </table> @see #ActionMode_background @see #ActionMode_backgroundSplit @see #ActionMode_height @see #ActionMode_subtitleTextStyle @see #ActionMode_titleTextStyle */ public static final int[] ActionMode = { 0x7f010020, 0x7f010042, 0x7f010043, 0x7f010047, 0x7f010049 }; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#background} attribute's value can be found in the {@link #ActionMode} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:background */ public static final int ActionMode_background = 3; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#backgroundSplit} attribute's value can be found in the {@link #ActionMode} array. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a color value, in the form of "<code>#<i>rgb</i></code>", "<code>#<i>argb</i></code>", "<code>#<i>rrggbb</i></code>", or "<code>#<i>aarrggbb</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:backgroundSplit */ public static final int ActionMode_backgroundSplit = 4; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#height} attribute's value can be found in the {@link #ActionMode} array. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:height */ public static final int ActionMode_height = 0; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#subtitleTextStyle} attribute's value can be found in the {@link #ActionMode} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:subtitleTextStyle */ public static final int ActionMode_subtitleTextStyle = 2; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#titleTextStyle} attribute's value can be found in the {@link #ActionMode} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:titleTextStyle */ public static final int ActionMode_titleTextStyle = 1; /** Attributes that can be used with a ActivityChooserView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #ActivityChooserView_expandActivityOverflowButtonDrawable edu.buffalo.cse.cse486586.simpledynamo:expandActivityOverflowButtonDrawable}</code></td><td></td></tr> <tr><td><code>{@link #ActivityChooserView_initialActivityCount edu.buffalo.cse.cse486586.simpledynamo:initialActivityCount}</code></td><td></td></tr> </table> @see #ActivityChooserView_expandActivityOverflowButtonDrawable @see #ActivityChooserView_initialActivityCount */ public static final int[] ActivityChooserView = { 0x7f010053, 0x7f010054 }; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#expandActivityOverflowButtonDrawable} attribute's value can be found in the {@link #ActivityChooserView} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:expandActivityOverflowButtonDrawable */ public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 1; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#initialActivityCount} attribute's value can be found in the {@link #ActivityChooserView} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:initialActivityCount */ public static final int ActivityChooserView_initialActivityCount = 0; /** Attributes that can be used with a CompatTextView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #CompatTextView_textAllCaps edu.buffalo.cse.cse486586.simpledynamo:textAllCaps}</code></td><td></td></tr> </table> @see #CompatTextView_textAllCaps */ public static final int[] CompatTextView = { 0x7f010055 }; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#textAllCaps} attribute's value can be found in the {@link #CompatTextView} array. <p>May be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". <p>May be a boolean value, either "<code>true</code>" or "<code>false</code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:textAllCaps */ public static final int CompatTextView_textAllCaps = 0; /** Attributes that can be used with a LinearLayoutICS. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #LinearLayoutICS_divider edu.buffalo.cse.cse486586.simpledynamo:divider}</code></td><td></td></tr> <tr><td><code>{@link #LinearLayoutICS_dividerPadding edu.buffalo.cse.cse486586.simpledynamo:dividerPadding}</code></td><td></td></tr> <tr><td><code>{@link #LinearLayoutICS_showDividers edu.buffalo.cse.cse486586.simpledynamo:showDividers}</code></td><td></td></tr> </table> @see #LinearLayoutICS_divider @see #LinearLayoutICS_dividerPadding @see #LinearLayoutICS_showDividers */ public static final int[] LinearLayoutICS = { 0x7f010046, 0x7f010056, 0x7f010057 }; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#divider} attribute's value can be found in the {@link #LinearLayoutICS} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:divider */ public static final int LinearLayoutICS_divider = 0; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#dividerPadding} attribute's value can be found in the {@link #LinearLayoutICS} array. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:dividerPadding */ public static final int LinearLayoutICS_dividerPadding = 2; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#showDividers} attribute's value can be found in the {@link #LinearLayoutICS} array. <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>none</code></td><td>0</td><td></td></tr> <tr><td><code>beginning</code></td><td>1</td><td></td></tr> <tr><td><code>middle</code></td><td>2</td><td></td></tr> <tr><td><code>end</code></td><td>4</td><td></td></tr> </table> @attr name edu.buffalo.cse.cse486586.simpledynamo:showDividers */ public static final int LinearLayoutICS_showDividers = 1; /** Attributes that can be used with a MenuGroup. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #MenuGroup_android_checkableBehavior android:checkableBehavior}</code></td><td></td></tr> <tr><td><code>{@link #MenuGroup_android_enabled android:enabled}</code></td><td></td></tr> <tr><td><code>{@link #MenuGroup_android_id android:id}</code></td><td></td></tr> <tr><td><code>{@link #MenuGroup_android_menuCategory android:menuCategory}</code></td><td></td></tr> <tr><td><code>{@link #MenuGroup_android_orderInCategory android:orderInCategory}</code></td><td></td></tr> <tr><td><code>{@link #MenuGroup_android_visible android:visible}</code></td><td></td></tr> </table> @see #MenuGroup_android_checkableBehavior @see #MenuGroup_android_enabled @see #MenuGroup_android_id @see #MenuGroup_android_menuCategory @see #MenuGroup_android_orderInCategory @see #MenuGroup_android_visible */ public static final int[] MenuGroup = { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 }; /** <p>This symbol is the offset where the {@link android.R.attr#checkableBehavior} attribute's value can be found in the {@link #MenuGroup} array. @attr name android:checkableBehavior */ public static final int MenuGroup_android_checkableBehavior = 5; /** <p>This symbol is the offset where the {@link android.R.attr#enabled} attribute's value can be found in the {@link #MenuGroup} array. @attr name android:enabled */ public static final int MenuGroup_android_enabled = 0; /** <p>This symbol is the offset where the {@link android.R.attr#id} attribute's value can be found in the {@link #MenuGroup} array. @attr name android:id */ public static final int MenuGroup_android_id = 1; /** <p>This symbol is the offset where the {@link android.R.attr#menuCategory} attribute's value can be found in the {@link #MenuGroup} array. @attr name android:menuCategory */ public static final int MenuGroup_android_menuCategory = 3; /** <p>This symbol is the offset where the {@link android.R.attr#orderInCategory} attribute's value can be found in the {@link #MenuGroup} array. @attr name android:orderInCategory */ public static final int MenuGroup_android_orderInCategory = 4; /** <p>This symbol is the offset where the {@link android.R.attr#visible} attribute's value can be found in the {@link #MenuGroup} array. @attr name android:visible */ public static final int MenuGroup_android_visible = 2; /** Attributes that can be used with a MenuItem. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #MenuItem_actionLayout edu.buffalo.cse.cse486586.simpledynamo:actionLayout}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_actionProviderClass edu.buffalo.cse.cse486586.simpledynamo:actionProviderClass}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_actionViewClass edu.buffalo.cse.cse486586.simpledynamo:actionViewClass}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_alphabeticShortcut android:alphabeticShortcut}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_checkable android:checkable}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_checked android:checked}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_enabled android:enabled}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_icon android:icon}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_id android:id}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_menuCategory android:menuCategory}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_numericShortcut android:numericShortcut}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_onClick android:onClick}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_orderInCategory android:orderInCategory}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_title android:title}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_titleCondensed android:titleCondensed}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_android_visible android:visible}</code></td><td></td></tr> <tr><td><code>{@link #MenuItem_showAsAction edu.buffalo.cse.cse486586.simpledynamo:showAsAction}</code></td><td></td></tr> </table> @see #MenuItem_actionLayout @see #MenuItem_actionProviderClass @see #MenuItem_actionViewClass @see #MenuItem_android_alphabeticShortcut @see #MenuItem_android_checkable @see #MenuItem_android_checked @see #MenuItem_android_enabled @see #MenuItem_android_icon @see #MenuItem_android_id @see #MenuItem_android_menuCategory @see #MenuItem_android_numericShortcut @see #MenuItem_android_onClick @see #MenuItem_android_orderInCategory @see #MenuItem_android_title @see #MenuItem_android_titleCondensed @see #MenuItem_android_visible @see #MenuItem_showAsAction */ public static final int[] MenuItem = { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x7f010058, 0x7f010059, 0x7f01005a, 0x7f01005b }; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#actionLayout} attribute's value can be found in the {@link #MenuItem} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:actionLayout */ public static final int MenuItem_actionLayout = 14; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#actionProviderClass} attribute's value can be found in the {@link #MenuItem} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:actionProviderClass */ public static final int MenuItem_actionProviderClass = 16; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#actionViewClass} attribute's value can be found in the {@link #MenuItem} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:actionViewClass */ public static final int MenuItem_actionViewClass = 15; /** <p>This symbol is the offset where the {@link android.R.attr#alphabeticShortcut} attribute's value can be found in the {@link #MenuItem} array. @attr name android:alphabeticShortcut */ public static final int MenuItem_android_alphabeticShortcut = 9; /** <p>This symbol is the offset where the {@link android.R.attr#checkable} attribute's value can be found in the {@link #MenuItem} array. @attr name android:checkable */ public static final int MenuItem_android_checkable = 11; /** <p>This symbol is the offset where the {@link android.R.attr#checked} attribute's value can be found in the {@link #MenuItem} array. @attr name android:checked */ public static final int MenuItem_android_checked = 3; /** <p>This symbol is the offset where the {@link android.R.attr#enabled} attribute's value can be found in the {@link #MenuItem} array. @attr name android:enabled */ public static final int MenuItem_android_enabled = 1; /** <p>This symbol is the offset where the {@link android.R.attr#icon} attribute's value can be found in the {@link #MenuItem} array. @attr name android:icon */ public static final int MenuItem_android_icon = 0; /** <p>This symbol is the offset where the {@link android.R.attr#id} attribute's value can be found in the {@link #MenuItem} array. @attr name android:id */ public static final int MenuItem_android_id = 2; /** <p>This symbol is the offset where the {@link android.R.attr#menuCategory} attribute's value can be found in the {@link #MenuItem} array. @attr name android:menuCategory */ public static final int MenuItem_android_menuCategory = 5; /** <p>This symbol is the offset where the {@link android.R.attr#numericShortcut} attribute's value can be found in the {@link #MenuItem} array. @attr name android:numericShortcut */ public static final int MenuItem_android_numericShortcut = 10; /** <p>This symbol is the offset where the {@link android.R.attr#onClick} attribute's value can be found in the {@link #MenuItem} array. @attr name android:onClick */ public static final int MenuItem_android_onClick = 12; /** <p>This symbol is the offset where the {@link android.R.attr#orderInCategory} attribute's value can be found in the {@link #MenuItem} array. @attr name android:orderInCategory */ public static final int MenuItem_android_orderInCategory = 6; /** <p>This symbol is the offset where the {@link android.R.attr#title} attribute's value can be found in the {@link #MenuItem} array. @attr name android:title */ public static final int MenuItem_android_title = 7; /** <p>This symbol is the offset where the {@link android.R.attr#titleCondensed} attribute's value can be found in the {@link #MenuItem} array. @attr name android:titleCondensed */ public static final int MenuItem_android_titleCondensed = 8; /** <p>This symbol is the offset where the {@link android.R.attr#visible} attribute's value can be found in the {@link #MenuItem} array. @attr name android:visible */ public static final int MenuItem_android_visible = 4; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#showAsAction} attribute's value can be found in the {@link #MenuItem} array. <p>Must be one or more (separated by '|') of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>never</code></td><td>0</td><td></td></tr> <tr><td><code>ifRoom</code></td><td>1</td><td></td></tr> <tr><td><code>always</code></td><td>2</td><td></td></tr> <tr><td><code>withText</code></td><td>4</td><td></td></tr> <tr><td><code>collapseActionView</code></td><td>8</td><td></td></tr> </table> @attr name edu.buffalo.cse.cse486586.simpledynamo:showAsAction */ public static final int MenuItem_showAsAction = 13; /** Attributes that can be used with a MenuView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #MenuView_android_headerBackground android:headerBackground}</code></td><td></td></tr> <tr><td><code>{@link #MenuView_android_horizontalDivider android:horizontalDivider}</code></td><td></td></tr> <tr><td><code>{@link #MenuView_android_itemBackground android:itemBackground}</code></td><td></td></tr> <tr><td><code>{@link #MenuView_android_itemIconDisabledAlpha android:itemIconDisabledAlpha}</code></td><td></td></tr> <tr><td><code>{@link #MenuView_android_itemTextAppearance android:itemTextAppearance}</code></td><td></td></tr> <tr><td><code>{@link #MenuView_android_preserveIconSpacing android:preserveIconSpacing}</code></td><td></td></tr> <tr><td><code>{@link #MenuView_android_verticalDivider android:verticalDivider}</code></td><td></td></tr> <tr><td><code>{@link #MenuView_android_windowAnimationStyle android:windowAnimationStyle}</code></td><td></td></tr> </table> @see #MenuView_android_headerBackground @see #MenuView_android_horizontalDivider @see #MenuView_android_itemBackground @see #MenuView_android_itemIconDisabledAlpha @see #MenuView_android_itemTextAppearance @see #MenuView_android_preserveIconSpacing @see #MenuView_android_verticalDivider @see #MenuView_android_windowAnimationStyle */ public static final int[] MenuView = { 0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e, 0x0101012f, 0x01010130, 0x01010131, 0x01010435 }; /** <p>This symbol is the offset where the {@link android.R.attr#headerBackground} attribute's value can be found in the {@link #MenuView} array. @attr name android:headerBackground */ public static final int MenuView_android_headerBackground = 4; /** <p>This symbol is the offset where the {@link android.R.attr#horizontalDivider} attribute's value can be found in the {@link #MenuView} array. @attr name android:horizontalDivider */ public static final int MenuView_android_horizontalDivider = 2; /** <p>This symbol is the offset where the {@link android.R.attr#itemBackground} attribute's value can be found in the {@link #MenuView} array. @attr name android:itemBackground */ public static final int MenuView_android_itemBackground = 5; /** <p>This symbol is the offset where the {@link android.R.attr#itemIconDisabledAlpha} attribute's value can be found in the {@link #MenuView} array. @attr name android:itemIconDisabledAlpha */ public static final int MenuView_android_itemIconDisabledAlpha = 6; /** <p>This symbol is the offset where the {@link android.R.attr#itemTextAppearance} attribute's value can be found in the {@link #MenuView} array. @attr name android:itemTextAppearance */ public static final int MenuView_android_itemTextAppearance = 1; /** <p>This symbol is the offset where the {@link android.R.attr#preserveIconSpacing} attribute's value can be found in the {@link #MenuView} array. @attr name android:preserveIconSpacing */ public static final int MenuView_android_preserveIconSpacing = 7; /** <p>This symbol is the offset where the {@link android.R.attr#verticalDivider} attribute's value can be found in the {@link #MenuView} array. @attr name android:verticalDivider */ public static final int MenuView_android_verticalDivider = 3; /** <p>This symbol is the offset where the {@link android.R.attr#windowAnimationStyle} attribute's value can be found in the {@link #MenuView} array. @attr name android:windowAnimationStyle */ public static final int MenuView_android_windowAnimationStyle = 0; /** Attributes that can be used with a SearchView. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #SearchView_android_imeOptions android:imeOptions}</code></td><td></td></tr> <tr><td><code>{@link #SearchView_android_inputType android:inputType}</code></td><td></td></tr> <tr><td><code>{@link #SearchView_android_maxWidth android:maxWidth}</code></td><td></td></tr> <tr><td><code>{@link #SearchView_iconifiedByDefault edu.buffalo.cse.cse486586.simpledynamo:iconifiedByDefault}</code></td><td></td></tr> <tr><td><code>{@link #SearchView_queryHint edu.buffalo.cse.cse486586.simpledynamo:queryHint}</code></td><td></td></tr> </table> @see #SearchView_android_imeOptions @see #SearchView_android_inputType @see #SearchView_android_maxWidth @see #SearchView_iconifiedByDefault @see #SearchView_queryHint */ public static final int[] SearchView = { 0x0101011f, 0x01010220, 0x01010264, 0x7f01005c, 0x7f01005d }; /** <p>This symbol is the offset where the {@link android.R.attr#imeOptions} attribute's value can be found in the {@link #SearchView} array. @attr name android:imeOptions */ public static final int SearchView_android_imeOptions = 2; /** <p>This symbol is the offset where the {@link android.R.attr#inputType} attribute's value can be found in the {@link #SearchView} array. @attr name android:inputType */ public static final int SearchView_android_inputType = 1; /** <p>This symbol is the offset where the {@link android.R.attr#maxWidth} attribute's value can be found in the {@link #SearchView} array. @attr name android:maxWidth */ public static final int SearchView_android_maxWidth = 0; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#iconifiedByDefault} attribute's value can be found in the {@link #SearchView} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:iconifiedByDefault */ public static final int SearchView_iconifiedByDefault = 3; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#queryHint} attribute's value can be found in the {@link #SearchView} array. <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:queryHint */ public static final int SearchView_queryHint = 4; /** Attributes that can be used with a Spinner. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #Spinner_android_dropDownHorizontalOffset android:dropDownHorizontalOffset}</code></td><td></td></tr> <tr><td><code>{@link #Spinner_android_dropDownSelector android:dropDownSelector}</code></td><td></td></tr> <tr><td><code>{@link #Spinner_android_dropDownVerticalOffset android:dropDownVerticalOffset}</code></td><td></td></tr> <tr><td><code>{@link #Spinner_android_dropDownWidth android:dropDownWidth}</code></td><td></td></tr> <tr><td><code>{@link #Spinner_android_gravity android:gravity}</code></td><td></td></tr> <tr><td><code>{@link #Spinner_android_popupBackground android:popupBackground}</code></td><td></td></tr> <tr><td><code>{@link #Spinner_disableChildrenWhenDisabled edu.buffalo.cse.cse486586.simpledynamo:disableChildrenWhenDisabled}</code></td><td></td></tr> <tr><td><code>{@link #Spinner_popupPromptView edu.buffalo.cse.cse486586.simpledynamo:popupPromptView}</code></td><td></td></tr> <tr><td><code>{@link #Spinner_prompt edu.buffalo.cse.cse486586.simpledynamo:prompt}</code></td><td></td></tr> <tr><td><code>{@link #Spinner_spinnerMode edu.buffalo.cse.cse486586.simpledynamo:spinnerMode}</code></td><td></td></tr> </table> @see #Spinner_android_dropDownHorizontalOffset @see #Spinner_android_dropDownSelector @see #Spinner_android_dropDownVerticalOffset @see #Spinner_android_dropDownWidth @see #Spinner_android_gravity @see #Spinner_android_popupBackground @see #Spinner_disableChildrenWhenDisabled @see #Spinner_popupPromptView @see #Spinner_prompt @see #Spinner_spinnerMode */ public static final int[] Spinner = { 0x010100af, 0x01010175, 0x01010176, 0x01010262, 0x010102ac, 0x010102ad, 0x7f01005e, 0x7f01005f, 0x7f010060, 0x7f010061 }; /** <p>This symbol is the offset where the {@link android.R.attr#dropDownHorizontalOffset} attribute's value can be found in the {@link #Spinner} array. @attr name android:dropDownHorizontalOffset */ public static final int Spinner_android_dropDownHorizontalOffset = 4; /** <p>This symbol is the offset where the {@link android.R.attr#dropDownSelector} attribute's value can be found in the {@link #Spinner} array. @attr name android:dropDownSelector */ public static final int Spinner_android_dropDownSelector = 1; /** <p>This symbol is the offset where the {@link android.R.attr#dropDownVerticalOffset} attribute's value can be found in the {@link #Spinner} array. @attr name android:dropDownVerticalOffset */ public static final int Spinner_android_dropDownVerticalOffset = 5; /** <p>This symbol is the offset where the {@link android.R.attr#dropDownWidth} attribute's value can be found in the {@link #Spinner} array. @attr name android:dropDownWidth */ public static final int Spinner_android_dropDownWidth = 3; /** <p>This symbol is the offset where the {@link android.R.attr#gravity} attribute's value can be found in the {@link #Spinner} array. @attr name android:gravity */ public static final int Spinner_android_gravity = 0; /** <p>This symbol is the offset where the {@link android.R.attr#popupBackground} attribute's value can be found in the {@link #Spinner} array. @attr name android:popupBackground */ public static final int Spinner_android_popupBackground = 2; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#disableChildrenWhenDisabled} attribute's value can be found in the {@link #Spinner} array. <p>Must be a boolean value, either "<code>true</code>" or "<code>false</code>". <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:disableChildrenWhenDisabled */ public static final int Spinner_disableChildrenWhenDisabled = 9; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#popupPromptView} attribute's value can be found in the {@link #Spinner} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:popupPromptView */ public static final int Spinner_popupPromptView = 8; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#prompt} attribute's value can be found in the {@link #Spinner} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:prompt */ public static final int Spinner_prompt = 6; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#spinnerMode} attribute's value can be found in the {@link #Spinner} array. <p>Must be one of the following constant values.</p> <table> <colgroup align="left" /> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Constant</th><th>Value</th><th>Description</th></tr> <tr><td><code>dialog</code></td><td>0</td><td></td></tr> <tr><td><code>dropdown</code></td><td>1</td><td></td></tr> </table> @attr name edu.buffalo.cse.cse486586.simpledynamo:spinnerMode */ public static final int Spinner_spinnerMode = 7; /** Attributes that can be used with a Theme. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #Theme_actionDropDownStyle edu.buffalo.cse.cse486586.simpledynamo:actionDropDownStyle}</code></td><td></td></tr> <tr><td><code>{@link #Theme_dropdownListPreferredItemHeight edu.buffalo.cse.cse486586.simpledynamo:dropdownListPreferredItemHeight}</code></td><td></td></tr> <tr><td><code>{@link #Theme_listChoiceBackgroundIndicator edu.buffalo.cse.cse486586.simpledynamo:listChoiceBackgroundIndicator}</code></td><td></td></tr> <tr><td><code>{@link #Theme_panelMenuListTheme edu.buffalo.cse.cse486586.simpledynamo:panelMenuListTheme}</code></td><td></td></tr> <tr><td><code>{@link #Theme_panelMenuListWidth edu.buffalo.cse.cse486586.simpledynamo:panelMenuListWidth}</code></td><td></td></tr> <tr><td><code>{@link #Theme_popupMenuStyle edu.buffalo.cse.cse486586.simpledynamo:popupMenuStyle}</code></td><td></td></tr> </table> @see #Theme_actionDropDownStyle @see #Theme_dropdownListPreferredItemHeight @see #Theme_listChoiceBackgroundIndicator @see #Theme_panelMenuListTheme @see #Theme_panelMenuListWidth @see #Theme_popupMenuStyle */ public static final int[] Theme = { 0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065, 0x7f010066, 0x7f010067 }; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#actionDropDownStyle} attribute's value can be found in the {@link #Theme} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:actionDropDownStyle */ public static final int Theme_actionDropDownStyle = 0; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#dropdownListPreferredItemHeight} attribute's value can be found in the {@link #Theme} array. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:dropdownListPreferredItemHeight */ public static final int Theme_dropdownListPreferredItemHeight = 1; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#listChoiceBackgroundIndicator} attribute's value can be found in the {@link #Theme} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:listChoiceBackgroundIndicator */ public static final int Theme_listChoiceBackgroundIndicator = 5; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#panelMenuListTheme} attribute's value can be found in the {@link #Theme} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:panelMenuListTheme */ public static final int Theme_panelMenuListTheme = 4; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#panelMenuListWidth} attribute's value can be found in the {@link #Theme} array. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:panelMenuListWidth */ public static final int Theme_panelMenuListWidth = 3; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#popupMenuStyle} attribute's value can be found in the {@link #Theme} array. <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>" or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>". @attr name edu.buffalo.cse.cse486586.simpledynamo:popupMenuStyle */ public static final int Theme_popupMenuStyle = 2; /** Attributes that can be used with a View. <p>Includes the following attributes:</p> <table> <colgroup align="left" /> <colgroup align="left" /> <tr><th>Attribute</th><th>Description</th></tr> <tr><td><code>{@link #View_android_focusable android:focusable}</code></td><td></td></tr> <tr><td><code>{@link #View_paddingEnd edu.buffalo.cse.cse486586.simpledynamo:paddingEnd}</code></td><td></td></tr> <tr><td><code>{@link #View_paddingStart edu.buffalo.cse.cse486586.simpledynamo:paddingStart}</code></td><td></td></tr> </table> @see #View_android_focusable @see #View_paddingEnd @see #View_paddingStart */ public static final int[] View = { 0x010100da, 0x7f010068, 0x7f010069 }; /** <p>This symbol is the offset where the {@link android.R.attr#focusable} attribute's value can be found in the {@link #View} array. @attr name android:focusable */ public static final int View_android_focusable = 0; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#paddingEnd} attribute's value can be found in the {@link #View} array. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:paddingEnd */ public static final int View_paddingEnd = 2; /** <p>This symbol is the offset where the {@link edu.buffalo.cse.cse486586.simpledynamo.R.attr#paddingStart} attribute's value can be found in the {@link #View} array. <p>Must be a dimension value, which is a floating point number appended with a unit such as "<code>14.5sp</code>". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters). <p>This may also be a reference to a resource (in the form "<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or theme attribute (in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>") containing a value of this type. @attr name edu.buffalo.cse.cse486586.simpledynamo:paddingStart */ public static final int View_paddingStart = 1; }; }
{ "content_hash": "568be5b727d5ce9f7dd6b4f8f1885015", "timestamp": "", "source": "github", "line_count": 2316, "max_line_length": 192, "avg_line_length": 60.25302245250432, "alnum_prop": 0.6527811617674458, "repo_name": "ramanpreet1990/CSE_586_Simplified_Amazon_Dynamo", "id": "97f42695f365b3d514a6af8168139640ecca94f1", "size": "139546", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SimpleDynamo/app/build/generated/source/r/debug/edu/buffalo/cse/cse486586/simpledynamo/R.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "261488" }, { "name": "Python", "bytes": "4135" } ], "symlink_target": "" }
package org.antbear.statemachine.util; public class Invariant { private Invariant() { /* static class */ } public static void argumentNotNull(final String name, final Object obj) { if (obj == null) { throw new IllegalArgumentException(name + " may not be null"); } } }
{ "content_hash": "74765725399b623b667d4d29ba917b54", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 77, "avg_line_length": 26, "alnum_prop": 0.6314102564102564, "repo_name": "bwolf/statem", "id": "8dfa6fdd6b04b007bfd704466b4545132f5cb066", "size": "312", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/antbear/statemachine/util/Invariant.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "2662" }, { "name": "Java", "bytes": "23675" } ], "symlink_target": "" }
/*------------------------------------------------------------------------- Copyright 2008 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. -------------------------------------------------------------------------*/ // .NAME vtkRowQueryToTable - executes an sql query and retrieves results into a table // // .SECTION Description // vtkRowQueryToTable creates a vtkTable with the results of an arbitrary SQL // query. To use this filter, you first need an instance of a vtkSQLDatabase // subclass. You may use the database class to obtain a vtkRowQuery instance. // Set that query on this filter to extract the query as a table. // // .SECTION Thanks // Thanks to Andrew Wilson from Sandia National Laboratories for his work // on the database classes. // // .SECTION See Also // vtkSQLDatabase vtkRowQuery #ifndef __vtkRowQueryToTable_h #define __vtkRowQueryToTable_h #include "vtkTableAlgorithm.h" class vtkRowQuery; class VTK_IO_EXPORT vtkRowQueryToTable : public vtkTableAlgorithm { public: static vtkRowQueryToTable* New(); vtkTypeMacro(vtkRowQueryToTable, vtkTableAlgorithm); void PrintSelf(ostream& os, vtkIndent indent); // Description: // The query to execute. void SetQuery(vtkRowQuery* query); vtkGetObjectMacro(Query, vtkRowQuery); // Description: // Update the modified time based on the query. unsigned long GetMTime(); protected: vtkRowQueryToTable(); ~vtkRowQueryToTable(); vtkRowQuery* Query; int RequestData( vtkInformation*, vtkInformationVector**, vtkInformationVector*); private: vtkRowQueryToTable(const vtkRowQueryToTable&); // Not implemented void operator=(const vtkRowQueryToTable&); // Not implemented }; #endif
{ "content_hash": "b6d0e729ca8437860f030e9a2ff70f5f", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 86, "avg_line_length": 29.306451612903224, "alnum_prop": 0.6912493120528344, "repo_name": "spthaolt/VTK", "id": "eb3971d7c744ebaaa77a98f76fc52a27804fce4f", "size": "2405", "binary": false, "copies": "13", "ref": "refs/heads/5.10.1_vs2013", "path": "IO/vtkRowQueryToTable.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "37780" }, { "name": "C", "bytes": "43108184" }, { "name": "C++", "bytes": "55336287" }, { "name": "CMake", "bytes": "1076323" }, { "name": "CSS", "bytes": "7532" }, { "name": "GLSL", "bytes": "211257" }, { "name": "Groff", "bytes": "65394" }, { "name": "HTML", "bytes": "287138" }, { "name": "Java", "bytes": "97801" }, { "name": "Lex", "bytes": "34703" }, { "name": "Makefile", "bytes": "7856" }, { "name": "Objective-C", "bytes": "14945" }, { "name": "Objective-C++", "bytes": "94949" }, { "name": "Perl", "bytes": "174900" }, { "name": "Prolog", "bytes": "4406" }, { "name": "Python", "bytes": "554641" }, { "name": "QMake", "bytes": "340" }, { "name": "Shell", "bytes": "30381" }, { "name": "Tcl", "bytes": "1497770" }, { "name": "TeX", "bytes": "123478" }, { "name": "Yacc", "bytes": "154162" } ], "symlink_target": "" }
<div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="{% url 'main:index' %}">Shopping Helper</a> <div class="nav-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="{% url 'main:index' %}">Home</a></li> <li id ='history'><a href="{% url 'history:index' %}">History</a></li> <li id = 'statistics'><a href="{% url 'statistics:index' %}">Statistics</a></li> <li id="useradmin"><a href="{% url 'useradmin:index' %}">User Admin</a></li> <li><a href="{% url 'admin:index' %}">Admin UI</a></li> <li><a href="{% url 'logout' %}">Logout</a></li> </ul> </div><!--/.nav-collapse --> </div> </div>
{ "content_hash": "bb4e0335e7914c363e67b4acceb101ec", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 103, "avg_line_length": 53.35, "alnum_prop": 0.5079662605435802, "repo_name": "Alerion/shopping-helper", "id": "cd6f31fc86e361e7f75d62cab5d7eb424ba88937", "size": "1067", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/templates/_menu.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "244353" }, { "name": "Java", "bytes": "65391" }, { "name": "JavaScript", "bytes": "4009060" }, { "name": "PHP", "bytes": "39180" }, { "name": "Python", "bytes": "85496" } ], "symlink_target": "" }
#ifndef TextTrack_h #define TextTrack_h #include "core/events/EventTarget.h" #include "core/html/track/TrackBase.h" #include "platform/heap/Handle.h" #include "wtf/text/WTFString.h" namespace blink { class ExceptionState; class HTMLMediaElement; class TextTrack; class TextTrackCue; class TextTrackCueList; class TextTrackList; class VTTRegion; class VTTRegionList; class TextTrack : public EventTargetWithInlineData, public TrackBase { DEFINE_WRAPPERTYPEINFO(); REFCOUNTED_EVENT_TARGET(TrackBase); WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(TextTrack); public: static PassRefPtrWillBeRawPtr<TextTrack> create(const AtomicString& kind, const AtomicString& label, const AtomicString& language) { return adoptRefWillBeNoop(new TextTrack(kind, label, language, emptyAtom, AddTrack)); } virtual ~TextTrack(); virtual void setTrackList(TextTrackList*); TextTrackList* trackList() { return m_trackList; } virtual void setKind(const AtomicString&) override; static const AtomicString& subtitlesKeyword(); static const AtomicString& captionsKeyword(); static const AtomicString& descriptionsKeyword(); static const AtomicString& chaptersKeyword(); static const AtomicString& metadataKeyword(); static bool isValidKindKeyword(const String&); static const AtomicString& disabledKeyword(); static const AtomicString& hiddenKeyword(); static const AtomicString& showingKeyword(); AtomicString mode() const { return m_mode; } virtual void setMode(const AtomicString&); enum ReadinessState { NotLoaded = 0, Loading = 1, Loaded = 2, FailedToLoad = 3 }; ReadinessState readinessState() const { return m_readinessState; } void setReadinessState(ReadinessState state) { m_readinessState = state; } TextTrackCueList* cues(); TextTrackCueList* activeCues() const; HTMLMediaElement* mediaElement() const; Node* owner() const; void addCue(PassRefPtrWillBeRawPtr<TextTrackCue>); void removeCue(TextTrackCue*, ExceptionState&); VTTRegionList* regions(); void addRegion(PassRefPtrWillBeRawPtr<VTTRegion>); void removeRegion(VTTRegion*, ExceptionState&); void cueWillChange(TextTrackCue*); void cueDidChange(TextTrackCue*); DEFINE_ATTRIBUTE_EVENT_LISTENER(cuechange); enum TextTrackType { TrackElement, AddTrack, InBand }; TextTrackType trackType() const { return m_trackType; } int trackIndex(); void invalidateTrackIndex(); bool isRendered(); int trackIndexRelativeToRenderedTracks(); bool hasBeenConfigured() const { return m_hasBeenConfigured; } void setHasBeenConfigured(bool flag) { m_hasBeenConfigured = flag; } virtual bool isDefault() const { return false; } virtual void setIsDefault(bool) { } void removeAllCues(); // EventTarget methods virtual const AtomicString& interfaceName() const override; virtual ExecutionContext* executionContext() const override; virtual void trace(Visitor*) override; protected: TextTrack(const AtomicString& kind, const AtomicString& label, const AtomicString& language, const AtomicString& id, TextTrackType); virtual bool isValidKind(const AtomicString& kind) const override { return isValidKindKeyword(kind); } virtual AtomicString defaultKind() const override { return subtitlesKeyword(); } RefPtrWillBeMember<TextTrackCueList> m_cues; private: VTTRegionList* ensureVTTRegionList(); RefPtrWillBeMember<VTTRegionList> m_regions; TextTrackCueList* ensureTextTrackCueList(); RawPtrWillBeMember<TextTrackList> m_trackList; AtomicString m_mode; TextTrackType m_trackType; ReadinessState m_readinessState; int m_trackIndex; int m_renderedTrackIndex; bool m_hasBeenConfigured; }; DEFINE_TRACK_TYPE_CASTS(TextTrack, TrackBase::TextTrack); } // namespace blink #endif // TextTrack_h
{ "content_hash": "a6504775952e5dbf59cb4bcd456b0932", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 136, "avg_line_length": 31.387096774193548, "alnum_prop": 0.7461459403905447, "repo_name": "nwjs/blink", "id": "a99c260e4ca7660c7f2a115dd83261c30df007dc", "size": "5310", "binary": false, "copies": "5", "ref": "refs/heads/nw12", "path": "Source/core/html/track/TextTrack.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "1835" }, { "name": "Assembly", "bytes": "14584" }, { "name": "Batchfile", "bytes": "35" }, { "name": "C", "bytes": "105608" }, { "name": "C++", "bytes": "42652662" }, { "name": "CSS", "bytes": "537806" }, { "name": "CoffeeScript", "bytes": "163" }, { "name": "GLSL", "bytes": "11578" }, { "name": "Groff", "bytes": "28067" }, { "name": "HTML", "bytes": "56362733" }, { "name": "Java", "bytes": "108885" }, { "name": "JavaScript", "bytes": "26647564" }, { "name": "Objective-C", "bytes": "47905" }, { "name": "Objective-C++", "bytes": "342893" }, { "name": "PHP", "bytes": "171657" }, { "name": "Perl", "bytes": "583379" }, { "name": "Python", "bytes": "3788510" }, { "name": "Ruby", "bytes": "141818" }, { "name": "Shell", "bytes": "8888" }, { "name": "XSLT", "bytes": "49926" }, { "name": "Yacc", "bytes": "64744" } ], "symlink_target": "" }
using System; namespace PcapDotNet.Packets.IpV6 { /// <summary> /// RFC 6757. /// <pre> /// +-----+----------+------------+ /// | Bit | 0-7 | 8-15 | /// +-----+----------+------------+ /// | 0 | ANI Type | ANI Length | /// +-----+----------+------------+ /// | 16 | Option Data | /// | ... | | /// +-----+-----------------------+ /// </pre> /// </summary> public sealed class IpV6AccessNetworkIdentifierSubOptionUnknown : IpV6AccessNetworkIdentifierSubOption { /// <summary> /// Creates an instance from type and data. /// </summary> /// <param name="type">The type of the option.</param> /// <param name="data">The data of the option.</param> public IpV6AccessNetworkIdentifierSubOptionUnknown(IpV6AccessNetworkIdentifierSubOptionType type, DataSegment data) : base(type) { Data = data; } /// <summary> /// The data of the option. /// </summary> public DataSegment Data { get; private set; } internal override IpV6AccessNetworkIdentifierSubOption CreateInstance(DataSegment data) { throw new InvalidOperationException("IpV6AccessNetworkIdentifierSubOptionUnknown shouldn't be registered."); } internal override int DataLength { get { return Data.Length; } } internal override bool EqualsData(IpV6AccessNetworkIdentifierSubOption other) { return EqualsData(other as IpV6AccessNetworkIdentifierSubOptionUnknown); } internal override int GetDataHashCode() { return Data.GetHashCode(); } internal override void WriteData(byte[] buffer, ref int offset) { buffer.Write(ref offset, Data); } private bool EqualsData(IpV6AccessNetworkIdentifierSubOptionUnknown other) { return other != null && Data.Equals(other.Data); } } }
{ "content_hash": "2b18dcb3abeb1490b0b4f1a89c469029", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 123, "avg_line_length": 32.16417910447761, "alnum_prop": 0.5122969837587007, "repo_name": "suarez-duran-m/pcap-pade", "id": "7c040a70711fa4c657ed118e7717556340376728", "size": "2155", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6AccessNetworkIdentifierSubOptionUnknown.cs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "665" }, { "name": "C#", "bytes": "3676282" }, { "name": "C++", "bytes": "130471" } ], "symlink_target": "" }
MAKEFLAGS = -s TEMPLATES = $(wildcard *.template) GENERATED = $(TEMPLATES:.template=.go) all: touch $(GENERATED) %.go: %.template echo Compiling $< go run ./../../bin/compile-template -o $@ $< touch: touch *.template clean: rm -f $(GENERATED)
{ "content_hash": "b620396b1d4649bce0eaf2fbfa0582e3", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 45, "avg_line_length": 15.75, "alnum_prop": 0.6428571428571429, "repo_name": "pattyshack/abc", "id": "8341cd690d273da01159684f9c0557415a57a6fd", "size": "252", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/template/internal/templated_codegen/Makefile", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "28847" }, { "name": "C", "bytes": "107" }, { "name": "C++", "bytes": "1189186" }, { "name": "Go", "bytes": "128671" }, { "name": "Lex", "bytes": "528" }, { "name": "Makefile", "bytes": "413" }, { "name": "Python", "bytes": "66891" }, { "name": "Scala", "bytes": "292729" }, { "name": "Shell", "bytes": "470" }, { "name": "Yacc", "bytes": "37234" } ], "symlink_target": "" }
/*# sourceMappingURL=animation.css.map */
{ "content_hash": "0d2e34bf9ecd4cee10fc178252b00a8b", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 41, "avg_line_length": 14.666666666666666, "alnum_prop": 0.7045454545454546, "repo_name": "mobileads-com/MADS_PROJECT_PizzaHut_Superpan", "id": "20668a272822d218bab4ec6d8ed65adbd909dc66", "size": "44", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/css/animation.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "160592" }, { "name": "HTML", "bytes": "1374" }, { "name": "JavaScript", "bytes": "2999" } ], "symlink_target": "" }
package com.intellij.internal.statistic.tools; import com.intellij.codeInspection.InspectionEP; import com.intellij.codeInspection.InspectionProfileEntry; import com.intellij.codeInspection.ex.InspectionProfileImpl; import com.intellij.codeInspection.ex.InspectionToolWrapper; import com.intellij.codeInspection.ex.ScopeToolState; import com.intellij.internal.statistic.beans.MetricEvent; import com.intellij.internal.statistic.beans.MetricEventFactoryKt; import com.intellij.internal.statistic.eventLog.EventLogGroup; import com.intellij.internal.statistic.eventLog.FeatureUsageData; import com.intellij.internal.statistic.eventLog.events.*; import com.intellij.internal.statistic.eventLog.validator.ValidationResultType; import com.intellij.internal.statistic.eventLog.validator.rules.EventContext; import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomValidationRule; import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector; import com.intellij.internal.statistic.utils.PluginInfo; import com.intellij.internal.statistic.utils.PluginInfoDetectorKt; import com.intellij.lang.Language; import com.intellij.openapi.extensions.PluginDescriptor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.util.ReflectionUtil; import com.intellij.util.containers.ContainerUtil; import org.jdom.Attribute; import org.jdom.Content; import org.jdom.DataConversionException; import org.jdom.Element; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.*; import java.util.function.Predicate; public class InspectionsUsagesCollector extends ProjectUsagesCollector { private static final Predicate<ScopeToolState> ENABLED = state -> !state.getTool().isEnabledByDefault() && state.isEnabled(); private static final Predicate<ScopeToolState> DISABLED = state -> state.getTool().isEnabledByDefault() && !state.isEnabled(); private static final String OPTION_VALUE = "option_value"; private static final String OPTION_TYPE = "option_type"; private static final String OPTION_NAME = "option_name"; private static final String INSPECTION_ID = "inspection_id"; private static final EventLogGroup GROUP = new EventLogGroup("inspections", 5); private static final EventId3<Boolean, Boolean, Boolean> PROFILE = GROUP.registerEvent("used.profile", EventFields.Boolean("project_level"), EventFields.Boolean("default"), EventFields.Boolean("locked")); @Override public EventLogGroup getGroup() { return GROUP; } @NotNull @Override public Set<MetricEvent> getMetrics(@NotNull final Project project) { final Set<MetricEvent> result = new HashSet<>(); final var profile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile(); result.add(create(profile)); final List<ScopeToolState> tools = profile.getAllTools(); for (ScopeToolState state : tools) { InspectionToolWrapper<?, ?> tool = state.getTool(); PluginInfo pluginInfo = getInfo(tool); if (ENABLED.test(state)) { result.add(create(tool, pluginInfo, true)); } else if (DISABLED.test(state)) { result.add(create(tool, pluginInfo, false)); } result.addAll(getChangedSettingsEvents(tool, pluginInfo, state.isEnabled())); } return result; } private static Collection<MetricEvent> getChangedSettingsEvents(InspectionToolWrapper<?, ?> tool, PluginInfo pluginInfo, boolean inspectionEnabled) { if (!isSafeToReport(pluginInfo)) { return Collections.emptyList(); } InspectionProfileEntry entry = tool.getTool(); Map<String, Attribute> options = getOptions(entry); if (options.isEmpty()) { return Collections.emptyList(); } Set<String> fields = ContainerUtil.map2Set(ReflectionUtil.collectFields(entry.getClass()), f -> f.getName()); Map<String, Attribute> defaultOptions = getOptions(ReflectionUtil.newInstance(entry.getClass())); Collection<MetricEvent> result = new ArrayList<>(); String inspectionId = tool.getID(); for (Map.Entry<String, Attribute> option : options.entrySet()) { String name = option.getKey(); Attribute value = option.getValue(); if (fields.contains(name) && value != null) { Attribute defaultValue = defaultOptions.get(name); if (defaultValue == null || !StringUtil.equals(value.getValue(), defaultValue.getValue())) { FeatureUsageData data = new FeatureUsageData(); data.addData(OPTION_NAME, name); data.addData(INSPECTION_ID, inspectionId); data.addData("inspection_enabled", inspectionEnabled); data.addPluginInfo(pluginInfo); if (addSettingValue(value, data)) { result.add(MetricEventFactoryKt.newMetric("setting.non.default.state", data)); } } } } return result; } private static boolean addSettingValue(Attribute value, FeatureUsageData data) { try { boolean booleanValue = value.getBooleanValue(); data.addData(OPTION_VALUE, booleanValue); data.addData(OPTION_TYPE, "boolean"); return true; } catch (DataConversionException e) { return addIntValue(value, data); } } private static boolean addIntValue(Attribute value, FeatureUsageData data) { try { int intValue = value.getIntValue(); data.addData(OPTION_VALUE, intValue); data.addData(OPTION_TYPE, "integer"); return true; } catch (DataConversionException e) { return false; } } @NotNull private static MetricEvent create(InspectionToolWrapper<?, ?> tool, PluginInfo info, boolean enabled) { final FeatureUsageData data = new FeatureUsageData().addData("enabled", enabled); final String language = tool.getLanguage(); if (StringUtil.isNotEmpty(language)) { data.addLanguage(Language.findLanguageByID(language)); } if (info != null) { data.addPluginInfo(info); } data.addData(INSPECTION_ID, isSafeToReport(info) ? tool.getID() : "third.party"); return MetricEventFactoryKt.newMetric("not.default.state", data); } @NotNull private static MetricEvent create(InspectionProfileImpl profile) { return PROFILE.metric( profile.isProjectLevel(), profile.toString().equals(profile.isProjectLevel() ? "Project Default" : "Default"), profile.isProfileLocked() ); } private static boolean isSafeToReport(PluginInfo info) { return info != null && info.isSafeToReport(); } @Nullable private static PluginInfo getInfo(InspectionToolWrapper<?, ?> tool) { InspectionEP extension = tool.getExtension(); PluginDescriptor pluginDescriptor = extension == null ? null : extension.getPluginDescriptor(); return pluginDescriptor != null ? PluginInfoDetectorKt.getPluginInfoByDescriptor(pluginDescriptor) : null; } private static Map<String, Attribute> getOptions(InspectionProfileEntry entry) { Element element = new Element("options"); try { ScopeToolState.tryWriteSettings(entry, element); List<Content> options = element.getContent(); if (options.isEmpty()) { return Collections.emptyMap(); } return ContainerUtil.map2MapNotNull(options, option -> { if (option instanceof Element) { Attribute nameAttr = ((Element)option).getAttribute("name"); Attribute valueAttr = ((Element)option).getAttribute("value"); if (nameAttr != null && valueAttr != null) { return Pair.create(nameAttr.getValue(), valueAttr); } } return null; }); } catch (Exception e) { return Collections.emptyMap(); } } public static class InspectionToolValidator extends CustomValidationRule { @Override public boolean acceptRuleId(@Nullable String ruleId) { return "tool".equals(ruleId); } @NotNull @Override protected ValidationResultType doValidate(@NotNull String data, @NotNull EventContext context) { if (isThirdPartyValue(data)) return ValidationResultType.ACCEPTED; return acceptWhenReportedByPluginFromPluginRepository(context); } } }
{ "content_hash": "fd193dfa20c8d53b26f7440bb5ef7e3f", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 128, "avg_line_length": 39.34101382488479, "alnum_prop": 0.7090312756237555, "repo_name": "zdary/intellij-community", "id": "4b607e3d75ed7edb03d6dd2f95b498be9c79e576", "size": "8678", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "platform/lang-impl/src/com/intellij/internal/statistic/tools/InspectionsUsagesCollector.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.apache.hadoop.security.authorize; import org.apache.hadoop.conf.Configurable; import org.apache.hadoop.security.UserGroupInformation; public interface ImpersonationProvider extends Configurable { /** * Authorize the superuser which is doing doAs * * @param user ugi of the effective or proxy user which contains a real user * @param remoteAddress the ip address of client * @throws AuthorizationException */ public void authorize(UserGroupInformation user, String remoteAddress) throws AuthorizationException; }
{ "content_hash": "e9dd6bac20adaa1230ad7c8d0f11f23d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 30.944444444444443, "alnum_prop": 0.7755834829443446, "repo_name": "GenisO/hadoop-DWRR", "id": "6e7a39565dfcff9c14beb9eba93533636ef6a0a5", "size": "1363", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/authorize/ImpersonationProvider.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "31146" }, { "name": "C", "bytes": "1132464" }, { "name": "C++", "bytes": "83963" }, { "name": "CSS", "bytes": "43086" }, { "name": "Erlang", "bytes": "232" }, { "name": "Java", "bytes": "42069198" }, { "name": "JavaScript", "bytes": "22405" }, { "name": "Perl", "bytes": "18992" }, { "name": "Python", "bytes": "11309" }, { "name": "Shell", "bytes": "401145" }, { "name": "TeX", "bytes": "19322" }, { "name": "XSLT", "bytes": "34239" } ], "symlink_target": "" }
package com.demon.doubanmovies.utils; import android.text.SpannableString; import android.text.Spanned; import android.text.style.ForegroundColorSpan; import java.util.List; public final class StringUtil { /** * get spannable string by color * * @param str string * @param color color * @return SpannableString */ public static SpannableString getSpannableString(String str, int color) { SpannableString span = new SpannableString(str); span.setSpan(new ForegroundColorSpan( color), 0, span.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); return span; } public static SpannableString getSpannableString1(String str, Object... whats) { SpannableString span = new SpannableString(str); for (Object what : whats) { span.setSpan(what, 0, span.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } return span; } public static <T> T getListString(List<T> list, char s) { StringBuilder str = new StringBuilder(); for (int i = 0, size = list.size(); i < size; i++) { str.append(i == 0 ? "" : s).append(list.get(i)); } return (T) str.toString(); } }
{ "content_hash": "77550f7f18bb56cbe3afb3291e33254a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 84, "avg_line_length": 30.65, "alnum_prop": 0.6280587275693311, "repo_name": "demonyan/douban-movie", "id": "116b00a0a1a47a78876f1c9a71ef259d9b69ae74", "size": "1226", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/demon/doubanmovies/utils/StringUtil.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "163680" } ], "symlink_target": "" }
{% extends "base.html" %} {% load i18n %} {% load pagination_tags %} {% load socialaccount %} {% block title %}{% trans "Project Dashboard" %}{% endblock %} {% block dash-nav-projects %}active{% endblock %} {% block content %} {% url "projects_import" as projects_import_url %} {% url "socialaccount_connections" as social_accounts %} <!-- BEGIN your projects list --> <div class="col-major project-dashboard-right"> {% if project_list %} {% if filter.qs.count > 0 %} <div class="module-header"> <h3>{% trans "Important Versions" %}</h3> </div> <div class="filter"> {% autopaginate filter.qs 15 %} <!-- BEGIN filter list --> <div class="module"> <div class="module-wrapper"> <div class="module-list"> <div class="module-list-wrapper"> <ul> {% include "core/filter_list.html" %} </ul> </div> </div> </div> </div> <!-- END filter list --> {% paginate %} </div> {% endif %} <div class="module"> <div class="module-wrapper"> <div class="module-header"> {% block project_import_button %} <form method="get" action="{{ projects_import_url }}"> <input type="submit" value="{% trans "Import a Project" %}" /> </form> {% endblock %} <h3>{% trans "Projects" %}</h3> </div> <div class="module-list"> <div class="module-list-wrapper"> <ul> {% for project in project_list %} <li class="module-item col-span"> <a href="{% url "projects_manage" project.slug %}"> {% block project-name %} {{ project.name }} {% endblock %} {% with build=project.get_latest_build %} <span class="right quiet"> {% if build %} <time class="build-count" datetime="{{ build.date|date:"c" }}" title="{{ build.date|date:"DATETIME_FORMAT" }}"> <small>{% blocktrans with date=build.date|timesince %}{{ date }} ago{% endblocktrans %}</small> </time> {% if build.success %} <span class="build-state build-state-passing">{% trans "passing" %}</span> {% else %} <span class="build-state build-state-failing">{% trans "failing" %}</span> {% endif %} {% else %} <span>{% trans "No builds yet" %}</span> {% endif %} </span> {% endwith %} </a> </li> {% endfor %} </ul> </div> </div> </div> </div> {% else %} {% include 'projects/onboard_import.html' %} {% endif %} </div> <!-- END your projects list --> <!-- BEGIN project side bar --> <div class="col-minor project-dashboard-right"> <!-- BEGIN search form --> <div class="module search search-dashboard"> <form action="{% url 'search' %}" method="GET"> <div class="text-input-wrapper search search-dashboard"> <input type="text" name="q" class="search" placeholder="{% trans 'Search all docs' %}"> {% if type %} <input type="hidden" name="type" value="{{ type }}"> {% endif %} </div> </form> </div> <!-- END search form --> <!-- BEGIN social account onboard --> {% get_social_accounts request.user as accounts %} {% if not accounts.github.0 %} <div class="module onboard onboard-accounts"> <h3>{% trans "Connect your Accounts" %}</h3> <p> {% blocktrans trimmed %} Have a GitHub account? Connect your account and import your existing projects automatically. {% endblocktrans %} </p> <form method="get" action="{{ social_accounts }}"> <input type="submit" value="{% trans "Connect your Accounts" %}" /> </form> </div> {% endif %} <!-- END social account onboard --> {% block dashboard-onboard-extra %} {% endblock %} <div class="module info info-docs"> <h3>{% trans "Learn More" %}</h3> <p> {% blocktrans trimmed with rtd_docs_url="https://docs.readthedocs.io/" %} Check out the <a href="{{ rtd_docs_url }}">documentation for Read the Docs</a>. It contains lots of information about how to get the most out of RTD. {% endblocktrans %} </p> </div> </div> <!-- END project side bar --> {% endblock %}
{ "content_hash": "23bf29f732708d818b45d929d549ee4f", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 139, "avg_line_length": 32.58169934640523, "alnum_prop": 0.4647943831494483, "repo_name": "rtfd/readthedocs.org", "id": "72679ea34cced253dfa0d4873ccec41168bb4f6a", "size": "4985", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "readthedocs/templates/projects/project_dashboard_base.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4515" }, { "name": "CSS", "bytes": "66552" }, { "name": "Dockerfile", "bytes": "205" }, { "name": "HTML", "bytes": "196998" }, { "name": "JavaScript", "bytes": "431128" }, { "name": "Makefile", "bytes": "4594" }, { "name": "Python", "bytes": "1821332" }, { "name": "Shell", "bytes": "682" } ], "symlink_target": "" }
<div class="navbar navbar-green navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../"><i class="fa fa-cubes"></i> Hangar</a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li> <a href="{{ url_for('logout') }}">Logout ({% if session.name and session.name != 'None' %}{{ session.name }}{% else %}{{ session.username }}{% endif %})</a> </li> </ul> </div> </div> </div>
{ "content_hash": "71203b69089f2fdbe585737cadaca6b5", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 166, "avg_line_length": 37.785714285714285, "alnum_prop": 0.553875236294896, "repo_name": "tzhbami7/Hangar", "id": "6eadf86924eeb5e4a884983ffecd4765eacd3d49", "size": "529", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "templates/includes/nav.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "10877" }, { "name": "HTML", "bytes": "61339" }, { "name": "JavaScript", "bytes": "44967" }, { "name": "Python", "bytes": "59206" }, { "name": "Shell", "bytes": "431" } ], "symlink_target": "" }
Tower Defence multiplayer PVP made in Unity with C# If you have any questions or suggestions, feel free to contact me on: Facebook https://www.facebook.com/TheCalvinKohl or Discord https://discord.gg/RSzefyD
{ "content_hash": "b2c719ceaa304016a0a1441715f517cc", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 69, "avg_line_length": 35.5, "alnum_prop": 0.784037558685446, "repo_name": "TheCalvinK/ProjectDownfall", "id": "38551c5e44caa788561d1bdb2d08ab3452bcda8b", "size": "231", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "295905" }, { "name": "GLSL", "bytes": "326409" } ], "symlink_target": "" }
<?php // Version: 2.1 Beta 2; Who global $scripturl, $context; $txt['who_hidden'] = '<em>Nothing, or nothing you can see...</em>'; $txt['who_admin'] = 'Viewing the admin portal'; $txt['who_moderate'] = 'Viewing the moderator portal'; $txt['who_generic'] = 'Viewing the'; $txt['who_unknown'] = '<em>Unknown Action</em>'; $txt['who_user'] = 'User'; $txt['who_time'] = 'Time'; $txt['who_action'] = 'Action'; $txt['who_show1'] = 'Show '; $txt['who_show_members_only'] = 'Members Only'; $txt['who_show_guests_only'] = 'Guests Only'; $txt['who_show_spiders_only'] = 'Spiders Only'; $txt['who_show_all'] = 'Everyone'; $txt['who_no_online_spiders'] = 'There are currently no spiders online.'; $txt['who_no_online_guests'] = 'There are currently no guests online.'; $txt['who_no_online_members'] = 'There are currently no members online.'; $txt['who_guest_login'] = 'User has been taken to the login page.'; $txt['whospider_login'] = 'Viewing the login page.'; $txt['whospider_register'] = 'Viewing the registration page.'; $txt['whospider_reminder'] = 'Viewing the reminder page.'; $txt['whoall_activate'] = 'Activating their account.'; $txt['whoall_buddy'] = 'Modifying their buddy list.'; $txt['whoall_coppa'] = 'Filling out parent/guardian consent form.'; $txt['whoall_credits'] = 'Viewing credits page.'; $txt['whoall_emailuser'] = 'Sending email to another member.'; $txt['whoall_groups'] = 'Viewing the member groups page.'; $txt['whoall_help'] = 'Viewing the <a href="' . $scripturl . '?action=help">help page</a>.'; $txt['whoall_helpadmin'] = 'Viewing a help popup.'; $txt['whoall_pm'] = 'Viewing their messages.'; $txt['whoall_login'] = 'Logging into the forum.'; $txt['whoall_login2'] = 'Logging into the forum.'; $txt['whoall_logout'] = 'Logging out of the forum.'; $txt['whoall_markasread'] = 'Marking topics read or unread.'; $txt['whoall_news'] = 'Viewing the news.'; $txt['whoall_notify'] = 'Changing their notification settings.'; $txt['whoall_notifyboard'] = 'Changing their notification settings.'; $txt['whoall_quickmod'] = 'Moderating a board.'; $txt['whoall_recent'] = 'Viewing a <a href="' . $scripturl . '?action=recent">list of recent topics</a>.'; $txt['whoall_reminder'] = 'Requesting a password reminder.'; $txt['whoall_reporttm'] = 'Reporting a topic to a moderator.'; $txt['whoall_restoretopic'] = 'Restoring a topic.'; $txt['whoall_signup'] = 'Registering for an account on the forum.'; $txt['whoall_signup2'] = 'Registering for an account on the forum.'; $txt['whoall_spellcheck'] = 'Using the spellchecker'; $txt['whoall_unread'] = 'Viewing unread topics since their last visit.'; $txt['whoall_unreadreplies'] = 'Viewing unread replies since their last visit.'; $txt['whoall_unwatchtopic'] = 'Unwatching a topic.'; $txt['whoall_who'] = 'Viewing <a href="' . $scripturl . '?action=who">Who\'s Online</a>.'; $txt['whoall_collapse_collapse'] = 'Collapsing a category.'; $txt['whoall_collapse_expand'] = 'Expanding a category.'; $txt['whoall_pm_removeall'] = 'Removing all their messages.'; $txt['whoall_pm_send'] = 'Sending a message.'; $txt['whoall_pm_send2'] = 'Sending a message.'; $txt['whotopic_announce'] = 'Announcing the topic &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot;.'; $txt['whotopic_attachapprove'] = 'Approving an attachment.'; $txt['whotopic_dlattach'] = 'Viewing an attachment.'; $txt['whotopic_deletemsg'] = 'Deleting a message.'; $txt['whotopic_editpoll'] = 'Editing the poll in &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot;.'; $txt['whotopic_editpoll2'] = 'Editing the poll in &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot;.'; $txt['whotopic_jsmodify'] = 'Modifying a post in &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot;.'; $txt['whotopic_lock'] = 'Locking the topic &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot;.'; $txt['whotopic_lockvoting'] = 'Locking the poll in &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot;.'; $txt['whotopic_mergetopics'] = 'Merging the topic &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot; with another topic.'; $txt['whotopic_movetopic'] = 'Moving the topic &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot; to another board.'; $txt['whotopic_movetopic2'] = 'Moving the topic &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot; to another board.'; $txt['whotopic_post'] = 'Posting in <a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>.'; $txt['whotopic_post2'] = 'Posting in <a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>.'; $txt['whotopic_printpage'] = 'Printing the topic &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot;.'; $txt['whotopic_quickmod2'] = 'Moderating the topic <a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>.'; $txt['whotopic_removepoll'] = 'Removing the poll in &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot;.'; $txt['whotopic_removetopic2'] = 'Removing the topic <a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>.'; $txt['whotopic_splittopics'] = 'Splitting the topic &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot; into two topics.'; $txt['whotopic_sticky'] = 'Setting the topic &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot; as sticky.'; $txt['whotopic_vote'] = 'Voting in <a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>.'; $txt['whopost_quotefast'] = 'Quoting a post from &quot;<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>&quot;.'; $txt['whoadmin_editagreement'] = 'Editing the registration agreement.'; $txt['whoadmin_featuresettings'] = 'Editing forum features and options.'; $txt['whoadmin_modlog'] = 'Viewing the moderator log.'; $txt['whoadmin_serversettings'] = 'Editing the forum settings.'; $txt['whoadmin_packageget'] = 'Getting packages.'; $txt['whoadmin_packages'] = 'Viewing the package manager.'; $txt['whoadmin_permissions'] = 'Editing the forum permissions.'; $txt['whoadmin_pgdownload'] = 'Downloading a package.'; $txt['whoadmin_theme'] = 'Editing the theme settings.'; $txt['whoadmin_trackip'] = 'Tracking an IP address.'; $txt['whoallow_manageboards'] = 'Editing the board and category settings.'; $txt['whoallow_admin'] = 'Viewing the <a href="' . $scripturl . '?action=admin">administration center</a>.'; $txt['whoallow_ban'] = 'Editing the ban list.'; $txt['whoallow_boardrecount'] = 'Recounting the forum totals.'; $txt['whoallow_calendar'] = 'Viewing the <a href="' . $scripturl . '?action=calendar">calendar</a>.'; $txt['whoallow_editnews'] = 'Editing the news.'; $txt['whoallow_mailing'] = 'Sending a forum email.'; $txt['whoallow_maintain'] = 'Performing routine forum maintenance.'; $txt['whoallow_manageattachments'] = 'Managing the attachments.'; $txt['whoallow_moderate'] = 'Viewing the <a href="' . $scripturl . '?action=moderate">Moderation Center</a>.'; $txt['whoallow_mlist'] = 'Viewing the <a href="' . $scripturl . '?action=mlist">memberlist</a>.'; $txt['whoallow_optimizetables'] = 'Optimizing the database tables.'; $txt['whoallow_repairboards'] = 'Repairing the database tables.'; $txt['whoallow_search'] = '<a href="' . $scripturl . '?action=search">Searching</a> the forum.'; $txt['whoallow_search2'] = 'Viewing the results of a search.'; $txt['whoallow_stats'] = 'Viewing the <a href="' . $scripturl . '?action=stats">forum stats</a>.'; $txt['whoallow_viewErrorLog'] = 'Viewing the error log.'; $txt['whoallow_viewmembers'] = 'Viewing a list of members.'; $txt['who_topic'] = 'Viewing the topic <a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>.'; $txt['who_board'] = 'Viewing the board <a href="' . $scripturl . '?board=%1$d.0">%2$s</a>.'; $txt['who_index'] = 'Viewing the board index of <a href="' . $scripturl . '">' . $context['forum_name_html_safe'] . '</a>.'; $txt['who_viewprofile'] = 'Viewing <a href="' . $scripturl . '?action=profile;u=%1$d">%2$s</a>\'s profile.'; $txt['who_viewownprofile'] = 'Viewing <a href="' . $scripturl . '?action=profile;u=%1$d">their own profile</a>.'; $txt['who_profile'] = 'Editing the profile of <a href="' . $scripturl . '?action=profile;u=%1$d">%2$s</a>.'; $txt['who_post'] = 'Posting a new topic in <a href="' . $scripturl . '?board=%1$d.0">%2$s</a>.'; $txt['who_poll'] = 'Posting a new poll in <a href="' . $scripturl . '?board=%1$d.0">%2$s</a>.'; // Credits text $txt['credits'] = 'Credits'; $txt['credits_intro'] = 'Simple Machines wants to thank everyone who helped make SMF 2.1 what it is today; shaping and directing our project, all through the thick and the thin. It wouldn\'t have been possible without you. This includes our users and especially Charter Members - thanks for installing and using our software as well as providing valuable feedback, bug reports, and opinions.'; $txt['credits_team'] = 'The Team'; $txt['credits_special'] = 'Special Thanks'; $txt['credits_and'] = 'and'; $txt['credits_anyone'] = 'And for anyone we may have missed, thank you!'; $txt['credits_copyright'] = 'Copyright'; $txt['credits_forum'] = 'Forum'; $txt['credits_modifications'] = 'Modifications'; $txt['credits_software_graphics'] = 'Software/Graphics'; $txt['credits_software'] = 'Software'; $txt['credits_graphics'] = 'Graphics'; $txt['credits_fonts'] = 'Fonts'; $txt['credits_groups_pm'] = 'Project Manager'; $txt['credits_groups_dev'] = 'Developers'; $txt['credits_groups_support'] = 'Support Specialists'; $txt['credits_groups_customize'] = 'Customizers'; $txt['credits_groups_docs'] = 'Documentation Writers'; $txt['credits_groups_marketing'] = 'Marketing'; $txt['credits_groups_internationalizers'] = 'Localizers'; $txt['credits_groups_servers'] = 'Servers Administrators'; $txt['credits_groups_site'] = 'Site Administrators'; $txt['credits_license'] = 'License'; $txt['credits_version'] = 'Version'; // Replace "English" with the name of this language pack in the string below. $txt['credits_groups_translation'] = 'English Translation'; $txt['credits_groups_translators'] = 'Language Translators'; $txt['credits_translators_message'] = 'Thank you for your efforts which make it possible for people all around the world to use SMF.'; $txt['credits_groups_consultants'] = 'Consulting Developers'; $txt['credits_groups_beta'] = 'Beta Testers'; $txt['credits_beta_message'] = 'The invaluable few who tirelessly find bugs, provide feedback, and drive the developers crazier.'; $txt['credits_groups_founder'] = 'Founding Father of SMF'; $txt['credits_groups_orignal_pm'] = 'Original Project Managers'; // List of people who have made more than a token contribution to this translation. (blank for English) $txt['translation_credits'] = array(); ?>
{ "content_hash": "4a285e516522fb9874ac6c5096dcd92b", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 393, "avg_line_length": 64.74233128834356, "alnum_prop": 0.6677721974793898, "repo_name": "margarett/SMF2.1", "id": "4b896a65d9492b0f4466668724c7167e3a6f2fe5", "size": "10553", "binary": false, "copies": "1", "ref": "refs/heads/release-2.1", "path": "Themes/default/languages/Who.english.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "279" }, { "name": "CSS", "bytes": "136074" }, { "name": "JavaScript", "bytes": "263202" }, { "name": "PHP", "bytes": "6437149" }, { "name": "PLpgSQL", "bytes": "139665" } ], "symlink_target": "" }
package io.datarouter.gcp.spanner; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.Appender; import org.apache.logging.log4j.core.appender.ConsoleAppender.Target; import io.datarouter.gcp.spanner.ddl.SpannerDatabaseCreator; import io.datarouter.gcp.spanner.ddl.SpannerSingleTableSchemaUpdateService; import io.datarouter.logging.BaseLog4j2Configuration; import io.datarouter.logging.DatarouterLog4j2Configuration; import io.datarouter.logging.Log4j2Configurator; public class DatarouterSpannerLog4j2Configuration extends BaseLog4j2Configuration{ public DatarouterSpannerLog4j2Configuration(){ registerParent(DatarouterLog4j2Configuration.class); Appender schemaUpdateAppender = Log4j2Configurator.createConsoleAppender( "SpannerSchemaUpdate", Target.SYSTEM_OUT, "%msg%n"); addAppender(schemaUpdateAppender); addLoggerConfig(SpannerSingleTableSchemaUpdateService.class.getName(), Level.INFO, false, schemaUpdateAppender); addLoggerConfig(SpannerDatabaseCreator.class.getName(), Level.INFO, false, schemaUpdateAppender); } }
{ "content_hash": "a424a9486d3e3a98f1858136b3fee1d5", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 114, "avg_line_length": 38.642857142857146, "alnum_prop": 0.8410351201478743, "repo_name": "hotpads/datarouter", "id": "61d9a6f4b2a17b400c3d885eafb0b0219145c6c4", "size": "1695", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "datarouter-gcp-spanner/src/main/java/io/datarouter/gcp/spanner/DatarouterSpannerLog4j2Configuration.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "9438" }, { "name": "Java", "bytes": "8616487" }, { "name": "JavaScript", "bytes": "639471" } ], "symlink_target": "" }
<?php namespace Burrow\Consumer; use Burrow\QueueConsumer; use Burrow\Serializer; class SerializingConsumer implements QueueConsumer { /** @var QueueConsumer */ private $consumer; /** @var Serializer */ private $serializer; /** * SerializingConsumer constructor. * * @param QueueConsumer $consumer * @param Serializer $serializer */ public function __construct(QueueConsumer $consumer, Serializer $serializer) { $this->consumer = $consumer; $this->serializer = $serializer; } /** * Consumes a message. * * @param mixed $message * @param string[] $headers * * @return string */ public function consume($message, array $headers = []) { return $this->serializer->serialize( $this->consumer->consume( $this->serializer->deserialize($message), $headers ) ); } }
{ "content_hash": "7eabbeb2f81ff70fee47fb5c12858389", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 80, "avg_line_length": 21.31111111111111, "alnum_prop": 0.5776850886339937, "repo_name": "Evaneos/Burrow", "id": "f6ed69c24c1af1f29bbece92e34b510e2870859a", "size": "959", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Consumer/SerializingConsumer.php", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "3448" }, { "name": "Makefile", "bytes": "1405" }, { "name": "PHP", "bytes": "160726" }, { "name": "Shell", "bytes": "254" } ], "symlink_target": "" }
(function () { 'use strict'; var EmptySearchViewModel = require('../../app/js/viewModels/emptySearch'), chai = require('chai'), searchService = require('../../app/js/services/search'), fakes = require('../fakes'); chai.should(); describe('When user interacts with empty search page', function () { it('Should store details and redirect to complete search page', function () { // Given var actual, setLocationStub, storeStub, sut, mocker = fakes.mocker(); storeStub = mocker.stub(EmptySearchViewModel.prototype, 'storeAdvancedDetails', function () { }); sut = new EmptySearchViewModel(); setLocationStub = mocker.stub(sut.sammy(), 'setLocation', function () { }); mocker.stub(searchService, 'getPathName').returns('/'); // When actual = sut.enterSearch(null, {keyCode: 13}); // Then actual.should.be.equal(false); setLocationStub.calledOnce.should.be.equal(true); storeStub.calledOnce.should.be.equal(true); }); }); })();
{ "content_hash": "c4ab9edc708b6b0244de0e2304428b97", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 109, "avg_line_length": 33.096774193548384, "alnum_prop": 0.6442495126705653, "repo_name": "vba/NBlast", "id": "eae41e3a403b8650621ac8d54948b7d2f9158b25", "size": "1026", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "NBlast.Client/test/viewModels/emptySearchSpec.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "294" }, { "name": "C#", "bytes": "6632" }, { "name": "CSS", "bytes": "5407" }, { "name": "CoffeeScript", "bytes": "3087" }, { "name": "F#", "bytes": "129656" }, { "name": "HTML", "bytes": "24937" }, { "name": "JavaScript", "bytes": "68366" }, { "name": "PowerShell", "bytes": "30" }, { "name": "Shell", "bytes": "1831" } ], "symlink_target": "" }
package main import ( "bufio" "bytes" "fmt" "io" "os" "os/exec" "strings" "unicode" ) // Page returns an io.Writer whose input will be written to the pager program. // The returned channel should be checked for an error using select before the // writer is used. // w, errch := Page("less") // select { // case err := <-errch: // return err // default: // w.Write([]byte("boom")) // } func Page(pager []string) (io.WriteCloser, <-chan error) { errch := make(chan error, 1) if len(pager) == 0 { pager = []string{"less", "-X", "-r"} } pagercmd := pager[0] pagerargs := pager[1:] cmd := exec.Command(pagercmd, pagerargs...) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr stdinr, stdinw, err := os.Pipe() if err != nil { errch <- err return nil, errch } cmd.Stdin = stdinr err = cmd.Start() if err != nil { errch <- err stdinw.Close() stdinr.Close() close(errch) return nil, errch } go func() { // wait for the pager and terminate any color mode the terminal happens // to be in when the program closes. // // BUG platform dependent escape code. err := cmd.Wait() fmt.Print("\033[0m") stdinr.Close() if err != nil { errch <- err } close(errch) }() return stdinw, errch } // BUG: this is not an idiomatic interface. type ShellReader interface { // ReadCommand reads a command from input and returns it. ReadCommand // returns io.EOF there is no command to be processed. ReadCommand returns // a true value when either there was no command to process or the command // was terminated without a newline. If true ReadCommand should not be // called again to avoid reprompting the user. ReadCommand() (cmd []string, eof bool, err error) } const simpleShellReaderDocs = ` Topic syntax describes the simple shell syntax. Lines prefixed with a colon ':' are commands, other lines are shorthand for specific commands. Following is a list of all shell syntax in jqsh. :<cmd> <arg1> <arg2> ... execute cmd with the given arguments :<cmd> ... +<argN> execute cmd with an argument containing spaces (argN) . shorthand for ":write" .. shorthand for ":pop" ?<filter> shorthand for ":peek +<filter>" <filter> shorthand for ":push +<filter>" Note that "." is a valid jq filter but pushing it on the filter stack lacks semantic value. So "." alone on a line is used as a shorthand for ":write". ` type SimpleShellReader struct { r io.Reader br *bufio.Reader out io.Writer prompt string } var _ ShellReader = (*SimpleShellReader)(nil) var _ Documented = (*SimpleShellReader)(nil) func NewShellReader(r io.Reader, prompt string) *SimpleShellReader { if r == nil { r = os.Stdin } br := bufio.NewReader(r) return &SimpleShellReader{r, br, os.Stdout, prompt} } func (s *SimpleShellReader) Documentation() string { return simpleShellReaderDocs } func (s *SimpleShellReader) SetOutput(w io.Writer) { s.out = w } func (s *SimpleShellReader) print(v ...interface{}) { if s.out != nil { fmt.Fprint(s.out, v...) } } func (s *SimpleShellReader) println(v ...interface{}) { if s.out != nil { fmt.Fprintln(s.out, v...) } } func (s *SimpleShellReader) ReadCommand() (cmd []string, eof bool, err error) { s.print(s.prompt) bs, err := s.br.ReadBytes('\n') eof = err == io.EOF if eof { s.println() } if err != nil { if eof && len(bs) > 0 { // this is ok } else { return nil, eof, err } } bs = bytes.TrimFunc(bs, unicode.IsSpace) if len(bs) == 0 { if eof { return nil, eof, nil } return s.ReadCommand() } else if bytes.Equal(bs, []byte("..")) { cmd := []string{"pop"} return cmd, eof, nil } else if bytes.Equal(bs, []byte{'.'}) { cmd := []string{"write"} return cmd, eof, nil } else if bs[0] == '?' { str := string(bs[1:]) cmd := []string{"peek", str} return cmd, eof, nil } else if bs[0] != ':' { str := string(bs) cmd := []string{"push", str} return cmd, eof, nil } bs = bs[1:] plusi := bytes.Index(bs, []byte{'+'}) var last *[]byte if plusi > 0 { lastp := bs[plusi+1:] last = &lastp bs = bs[:plusi] } cmd = strings.Fields(string(bs)) if last != nil { cmd = append(cmd, string(*last)) } return cmd, eof, nil } // An InitShellReader works like a SimpleShellReader but runs an init script // before reading any input. type InitShellReader struct { i int init [][]string r *SimpleShellReader } func NewInitShellReader(r io.Reader, prompt string, initcmds [][]string) *InitShellReader { return &InitShellReader{0, initcmds, NewShellReader(r, prompt)} } func (sh *InitShellReader) Documentation() string { return simpleShellReaderDocs } func (sh *InitShellReader) ReadCommand() ([]string, bool, error) { if sh == nil { panic("nil shell") } if sh.i < len(sh.init) { cmd := sh.init[sh.i] sh.i++ return cmd, false, nil } return sh.r.ReadCommand() }
{ "content_hash": "676228e8342d4cee6d06eda0dee65d59", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 91, "avg_line_length": 23.73076923076923, "alnum_prop": 0.6371555915721232, "repo_name": "bmatsuo/jqsh", "id": "35cce4eac86c3773312fd5c3d6055a87b39dc746", "size": "4992", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "shell.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "47363" }, { "name": "Shell", "bytes": "1289" } ], "symlink_target": "" }
package com.gsposito.gae; /** * Contains the client IDs and scopes for allowed clients consuming your API. * * This is a prototype, you must fill the correct values below and rename de class to Constants */ public class myConstants { public static final String WEB_CLIENT_ID = "replace this with your Android client ID"; public static final String ANDROID_CLIENT_ID = "replace this with your Android client ID"; public static final String IOS_CLIENT_ID = "replace this with your iOS client ID"; public static final String ANDROID_AUDIENCE = WEB_CLIENT_ID; public static final String EMAIL_SCOPE = "https://www.googleapis.com/auth/userinfo.email"; }
{ "content_hash": "97270709664a68a438234c6850e2d7b8", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 95, "avg_line_length": 44.4, "alnum_prop": 0.7567567567567568, "repo_name": "GiulSposito/AcadSys", "id": "e971536ac90cac8ff9123e57fd79cd70edb24192", "size": "666", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/gsposito/gae/myConstants.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "15326" }, { "name": "Java", "bytes": "3813" }, { "name": "JavaScript", "bytes": "59187" }, { "name": "Shell", "bytes": "94" } ], "symlink_target": "" }
package main import ( "bufio" "flag" "fmt" "hash/fnv" "log" "os" "time" "github.com/danieldk/conllx" "github.com/danieldk/dpar/cmd/common" "github.com/danieldk/dpar/features/symbolic" "github.com/danieldk/dpar/ml/svm" "github.com/danieldk/dpar/system" "gopkg.in/danieldk/golinear.v1" ) func init() { flag.Usage = func() { fmt.Fprintf(os.Stderr, "Usage: %s [options] config input.conllx\n\n", os.Args[0]) flag.PrintDefaults() } } func main() { flag.Parse() if flag.NArg() != 2 { flag.Usage() os.Exit(1) } configFile, err := os.Open(flag.Arg(0)) common.ExitIfError(err) defer configFile.Close() config, err := common.ParseConfig(configFile) common.ExitIfError(err) generator, err := common.ReadFeatures(config.Parser.Features) common.ExitIfError(err) transitionSystem, ok := common.TransitionSystems[config.Parser.System] if !ok { log.Fatalf("Unknown transition system: %s", config.Parser.System) } labelNumberer, err := common.ReadTransitions(config.Parser.Transitions, transitionSystem) common.ExitIfError(err) model, err := golinear.LoadModel(config.Parser.Model) common.ExitIfError(err) if config.Parser.HashKernelSize == 0 { log.Fatal("Currently only models using a hash kernel are supported") } else { hashKernelParsing(transitionSystem, generator, model, labelNumberer, config.Parser.HashKernelSize) } } func hashKernelParsing(transitionSystem system.TransitionSystem, generator symbolic.FeatureGenerator, model *golinear.Model, labelNumberer *system.LabelNumberer, hashKernelSize uint) { guide := svm.NewHashingSVMGuide(model, generator, *labelNumberer, fnv.New32, hashKernelSize) parser := system.NewGreedyParser(transitionSystem, guide) start := time.Now() run(parser) elapsed := time.Since(start) log.Printf("Parsing took %s\n", elapsed) } func run(parser system.Parser) { inputFile, err := os.Open(flag.Arg(1)) defer inputFile.Close() if err != nil { panic("Cannot open training data") } inputReader := conllx.NewReader(bufio.NewReader(inputFile)) writer := conllx.NewWriter(os.Stdout) for { s, err := inputReader.ReadSentence() if err != nil { break } deps, err := parser.Parse(s) common.ExitIfError(err) // Clear to ensure that no dependencies in the input leak // (if they were present). for idx := range s { s[idx].SetHead(0) s[idx].SetHeadRel("NULL") } for dep := range deps { s[dep.Dependent-1].SetHead(dep.Head) s[dep.Dependent-1].SetHeadRel(dep.Relation) } writer.WriteSentence(s) } }
{ "content_hash": "cc678a285f13d49e658ffcf40600a0bc", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 90, "avg_line_length": 23.045454545454547, "alnum_prop": 0.714792899408284, "repo_name": "postfix/dpar", "id": "a4a08ab0835468bbd397508c5273aefb42a8640e", "size": "2697", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cmd/dpar-parse/main.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Go", "bytes": "71526" }, { "name": "Ragel in Ruby Host", "bytes": "2874" } ], "symlink_target": "" }
using System; using AutoPoco.Engine; using AutoPoco; namespace AutoPoco.KCL.DataSources { public class IdSameAsParentDataSource<TParent, TId> : DatasourceBase<TId> where TParent : class { public Func<TParent, TId> IdExpression { get; private set; } public IdSameAsParentDataSource(Func<TParent, TId> ex) { IdExpression = ex; } public override TId Next(IGenerationContext session) { TParent parent = FindParent(session.Node); if (parent == null) return default(TId); else return IdExpression(parent); } public TParent FindParent(IGenerationContextNode node) { if (node == null) return null; TypeGenerationContextNode tgNode = node as TypeGenerationContextNode; if (tgNode == null) return FindParent(node.Parent); else { if (tgNode.Target is TParent) return (TParent)tgNode.Target; else return FindParent(node.Parent); } } } }
{ "content_hash": "995260c2fd7776df5a772b34e408ea47", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 81, "avg_line_length": 27.976190476190474, "alnum_prop": 0.548936170212766, "repo_name": "KCL5South/KCLAutoPoco", "id": "7f34b334fd65d80a2dd9303a4a54bd4d332aecac", "size": "1175", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "AutoPoco.KCL/DataSources/IdSameAsParentDataSource.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "458923" }, { "name": "PowerShell", "bytes": "33159" } ], "symlink_target": "" }
var stamplayStripe = require('../lib/stripe') var assert = require('assert') var Stripe = stamplayStripe({ apiKey: 'apiKey', appId: 'appId', version: 'v1' }) assert.equal(typeof Stripe.base, 'undefined') assert.equal(typeof Stripe.deleteCustomer, 'function') assert.equal(typeof Stripe.createSubscription, 'function') assert.equal(typeof Stripe.getSubscriptions, 'function') assert.equal(typeof Stripe.getSubscription, 'function') assert.equal(typeof Stripe.deleteSubscription, 'function') assert.equal(typeof Stripe.updateSubscription, 'function')
{ "content_hash": "c5330796b80389892dc79ac766b9ef69", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 58, "avg_line_length": 34.8125, "alnum_prop": 0.7719928186714542, "repo_name": "Stamplay/stamplay-nodejs-sdk", "id": "e029d1c78c96eb9f8786bae0e06e911221dc0777", "size": "557", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/stripe.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "27994" }, { "name": "Makefile", "bytes": "277" } ], "symlink_target": "" }
(function($) { var methods = { /** * Kind of the constructor, called before any action * @param {Map} user options */ init: function(options) { var form = this; if (!form.data('jqv') || form.data('jqv') == null ) { options = methods._saveOptions(form, options); // bind all formError elements to close on click $(".formError").live("click", function() { $(this).fadeOut(150, function() { // remove prompt once invisible $(this).parent('.formErrorOuter').remove(); $(this).remove(); }); }); } return this; }, /** * Attachs jQuery.validationEngine to form.submit and field.blur events * Takes an optional params: a list of options * ie. jQuery("#formID1").validationEngine('attach', {promptPosition : "centerRight"}); */ attach: function(userOptions) { var form = this; var options; if(userOptions) options = methods._saveOptions(form, userOptions); else options = form.data('jqv'); var validateAttribute = (form.find("[data-validation-engine*=validate]")) ? "data-validation-engine" : "class"; if (!options.binded) { if (options.bindMethod == "bind"){ // bind fields form.find("[class*=validate]").not("[type=checkbox]").not("[type=radio]").not(".datepicker").bind(options.validationEventTrigger, methods._onFieldEvent); form.find("[class*=validate][type=checkbox],[class*=validate][type=radio]").bind("click", methods._onFieldEvent); form.find("[class*=validate][class*=datepicker]").bind(options.validationEventTrigger,{"delay": 300}, methods._onFieldEvent); // bind form.submit form.bind("submit", methods._onSubmitEvent); } else if (options.bindMethod == "live") { // bind fields with LIVE (for persistant state) form.find("[class*=validate]").not("[type=checkbox]").not(".datepicker").live(options.validationEventTrigger, methods._onFieldEvent); form.find("[class*=validate][type=checkbox]").live("click", methods._onFieldEvent); form.find("[class*=validate][class*=datepicker]").live(options.validationEventTrigger,{"delay": 300}, methods._onFieldEvent); // bind form.submit form.live("submit", methods._onSubmitEvent); } options.binded = true; if (options.autoPositionUpdate) { $(window).bind("resize", { "noAnimation": true, "formElem": form }, methods.updatePromptsPosition); } } return this; }, /** * Unregisters any bindings that may point to jQuery.validaitonEngine */ detach: function() { var form = this; var options = form.data('jqv'); if (options.binded) { // unbind fields form.find("[class*=validate]").not("[type=checkbox]").unbind(options.validationEventTrigger, methods._onFieldEvent); form.find("[class*=validate][type=checkbox],[class*=validate][type=radio]").unbind("click", methods._onFieldEvent); // unbind form.submit form.unbind("submit", methods.onAjaxFormComplete); // unbind live fields (kill) form.find("[class*=validate]").not("[type=checkbox]").die(options.validationEventTrigger, methods._onFieldEvent); form.find("[class*=validate][type=checkbox]").die("click", methods._onFieldEvent); // unbind form.submit form.die("submit", methods.onAjaxFormComplete); form.removeData('jqv'); if (options.autoPositionUpdate) { $(window).unbind("resize", methods.updatePromptsPosition) } } return this; }, /** * Validates the form fields, shows prompts accordingly. * Note: There is no ajax form validation with this method, only field ajax validation are evaluated * * @return true if the form validates, false if it fails */ validate: function() { return methods._validateFields(this); }, /** * Validates one field, shows prompt accordingly. * Note: There is no ajax form validation with this method, only field ajax validation are evaluated * * @return true if the form validates, false if it fails */ validateField: function(el) { var options = $(this).data('jqv'); var r = methods._validateField($(el), options); if (options.onSuccess && options.InvalidFields.length == 0) options.onSuccess(); else if (options.onFailure && options.InvalidFields.length > 0) options.onFailure(); return r; }, /** * Validates the form fields, shows prompts accordingly. * Note: this methods performs fields and form ajax validations(if setup) * * @return true if the form validates, false if it fails, undefined if ajax is used for form validation */ validateform: function() { return methods._onSubmitEvent.call(this); }, /** * Redraw prompts position, useful when you change the DOM state when validating */ updatePromptsPosition: function(event) { if (event && this == window) var form = event.data.formElem, noAnimation = event.data.noAnimation; else var form = $(this.closest('form')); var options = form.data('jqv'); // No option, take default one form.find('[class*=validate]').not(':hidden').not(":disabled").each(function(){ var field = $(this); var prompt = methods._getPrompt(field); var promptText = $(prompt).find(".formErrorContent").html(); if(prompt) methods._updatePrompt(field, $(prompt), promptText, undefined, false, options, noAnimation); }) return this; }, /** * Displays a prompt on a element. * Note that the element needs an id! * * @param {String} promptText html text to display type * @param {String} type the type of bubble: 'pass' (green), 'load' (black) anything else (red) * @param {String} possible values topLeft, topRight, bottomLeft, centerRight, bottomRight */ showPrompt: function(promptText, type, promptPosition, showArrow) { var form = this.closest('form'); var options = form.data('jqv'); // No option, take default one if(!options) options = methods._saveOptions(this, options); if(promptPosition) options.promptPosition=promptPosition; options.showArrow = showArrow==true; methods._showPrompt(this, promptText, type, false, options); return this; }, /** * Closes all error prompts on the page */ hidePrompt: function() { var promptClass = "."+ methods._getClassName($(this).attr("id")) + "formError"; $(promptClass).fadeTo("fast", 0.3, function() { $(this).parent('.formErrorOuter').remove(); $(this).remove(); }); return this; }, /** * Closes form error prompts, CAN be invidual */ hide: function() { var closingtag; if($(this).is("form")){ closingtag = "parentForm"+methods._getClassName($(this).attr("id")); }else{ closingtag = methods._getClassName($(this).attr("id")) +"formError"; } $('.'+closingtag).fadeTo("fast", 0.3, function() { $(this).parent('.formErrorOuter').remove(); $(this).remove(); }); return this; }, /** * Closes all error prompts on the page */ hideAll: function() { $('.formError').fadeTo("fast", 0.3, function() { $(this).parent('.formErrorOuter').remove(); $(this).remove(); }); return this; }, /** * Typically called when user exists a field using tab or a mouse click, triggers a field * validation */ _onFieldEvent: function(event) { var field = $(this); var form = field.closest('form'); var options = form.data('jqv'); // validate the current field window.setTimeout(function() { methods._validateField(field, options); if (options.InvalidFields.length == 0 && options.onSuccess) { options.onSuccess(); } else if (options.InvalidFields.length > 0 && options.onFailure) { options.onFailure(); } }, (event.data) ? event.data.delay : 0); }, /** * Called when the form is submited, shows prompts accordingly * * @param {jqObject} * form * @return false if form submission needs to be cancelled */ _onSubmitEvent: function() { var form = $(this); var options = form.data('jqv'); // validate each field (- skip field ajax validation, no necessary since we will perform an ajax form validation) var r=methods._validateFields(form, true); if (r && options.ajaxFormValidation) { methods._validateFormWithAjax(form, options); return false; } if(options.onValidationComplete) { options.onValidationComplete(form, r); return false; } return r; }, /** * Return true if the ajax field validations passed so far * @param {Object} options * @return true, is all ajax validation passed so far (remember ajax is async) */ _checkAjaxStatus: function(options) { var status = true; $.each(options.ajaxValidCache, function(key, value) { if (!value) { status = false; // break the each return false; } }); return status; }, /** * Validates form fields, shows prompts accordingly * * @param {jqObject} * form * @param {skipAjaxFieldValidation} * boolean - when set to true, ajax field validation is skipped, typically used when the submit button is clicked * * @return true if form is valid, false if not, undefined if ajax form validation is done */ _validateFields: function(form, skipAjaxValidation) { var options = form.data('jqv'); // this variable is set to true if an error is found var errorFound = false; // Trigger hook, start validation form.trigger("jqv.form.validating"); // first, evaluate status of non ajax fields var first_err=null; form.find('[class*=validate]').not(':hidden').not(":disabled").each( function() { var field = $(this); errorFound |= methods._validateField(field, options, skipAjaxValidation); field.focus(); if (options.doNotShowAllErrosOnSubmit) return false; if (errorFound && first_err==null) first_err=field; }); // second, check to see if all ajax calls completed ok // errorFound |= !methods._checkAjaxStatus(options); // thrird, check status and scroll the container accordingly form.trigger("jqv.form.result", [errorFound]); if (errorFound) { if (options.scroll) { var destination=first_err.offset().top; var fixleft = first_err.offset().left; //prompt positioning adjustment support. Usage: positionType:Xshift,Yshift (for ex.: bottomLeft:+20 or bottomLeft:-20,+10) var positionType=options.promptPosition; if (typeof(positionType)=='string') { if (positionType.indexOf(":")!=-1) { positionType=positionType.substring(0,positionType.indexOf(":")); } } if (positionType!="bottomRight"&& positionType!="bottomLeft") { var prompt_err= methods._getPrompt(first_err); destination=prompt_err.offset().top; } // get the position of the first error, there should be at least one, no need to check this //var destination = form.find(".formError:not('.greenPopup'):first").offset().top; if (options.isOverflown) { var overflowDIV = $(options.overflownDIV); if(!overflowDIV.length) return false; var scrollContainerScroll = overflowDIV.scrollTop(); var scrollContainerPos = -parseInt(overflowDIV.offset().top); destination += scrollContainerScroll + scrollContainerPos - 5; var scrollContainer = $(options.overflownDIV + ":not(:animated)"); scrollContainer.animate({ scrollTop: destination }, 1100); }else{ $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination, scrollLeft: fixleft }, 1100, function(){ if(options.focusFirstField) first_err.focus(); }); } } else if(options.focusFirstField) first_err.focus(); return false; } return true; }, /** * This method is called to perform an ajax form validation. * During this process all the (field, value) pairs are sent to the server which returns a list of invalid fields or true * * @param {jqObject} form * @param {Map} options */ _validateFormWithAjax: function(form, options) { var data = form.serialize(); var url = (options.ajaxFormValidationURL) ? options.ajaxFormValidationURL : form.attr("action"); $.ajax({ type: "GET", url: url, cache: false, dataType: "json", data: data, form: form, methods: methods, options: options, beforeSend: function() { return options.onBeforeAjaxFormValidation(form, options); }, error: function(data, transport) { methods._ajaxError(data, transport); }, success: function(json) { if (json !== true) { // getting to this case doesn't necessary means that the form is invalid // the server may return green or closing prompt actions // this flag helps figuring it out var errorInForm=false; for (var i = 0; i < json.length; i++) { var value = json[i]; var errorFieldId = value[0]; var errorField = $($("#" + errorFieldId)[0]); // make sure we found the element if (errorField.length == 1) { // promptText or selector var msg = value[2]; // if the field is valid if (value[1] == true) { if (msg == "" || !msg){ // if for some reason, status==true and error="", just close the prompt methods._closePrompt(errorField); } else { // the field is valid, but we are displaying a green prompt if (options.allrules[msg]) { var txt = options.allrules[msg].alertTextOk; if (txt) msg = txt; } methods._showPrompt(errorField, msg, "pass", false, options, true); } } else { // the field is invalid, show the red error prompt errorInForm|=true; if (options.allrules[msg]) { var txt = options.allrules[msg].alertText; if (txt) msg = txt; } methods._showPrompt(errorField, msg, "", false, options, true); } } } options.onAjaxFormComplete(!errorInForm, form, json, options); } else options.onAjaxFormComplete(true, form, "", options); } }); }, /** * Validates field, shows prompts accordingly * * @param {jqObject} * field * @param {Array[String]} * field's validation rules * @param {Map} * user options * @return true if field is valid */ _validateField: function(field, options, skipAjaxValidation) { if (!field.attr("id")) $.error("jQueryValidate: an ID attribute is required for this field: " + field.attr("name") + " class:" + field.attr("class")); var rulesParsing = field.attr('class'); var getRules = /validate\[(.*)\]/.exec(rulesParsing); if (!getRules) return false; var str = getRules[1]; var rules = str.split(/\[|,|\]/); // true if we ran the ajax validation, tells the logic to stop messing with prompts var isAjaxValidator = false; var fieldName = field.attr("name"); var promptText = ""; var required = false; options.isError = false; options.showArrow = true; var form = $(field.closest("form")); for (var i = 0; i < rules.length; i++) { // Fix for adding spaces in the rules rules[i] = rules[i].replace(" ", "") var errorMsg = undefined; switch (rules[i]) { case "required": required = true; errorMsg = methods._required(field, rules, i, options); break; case "custom": errorMsg = methods._customRegex(field, rules, i, options); break; case "groupRequired": // Check is its the first of group, if not, reload validation with first field // AND continue normal validation on present field var classGroup = "[class*=" +rules[i + 1] +"]"; var firstOfGroup = form.find(classGroup).eq(0); if(firstOfGroup[0] != field[0]){ methods._validateField(firstOfGroup, options, skipAjaxValidation) options.showArrow = true; continue; }; errorMsg = methods._groupRequired(field, rules, i, options); if(errorMsg) required = true; options.showArrow = false; break; case "ajax": // ajax has its own prompts handling technique if(!skipAjaxValidation){ methods._ajax(field, rules, i, options); isAjaxValidator = true; } break; case "minSize": errorMsg = methods._minSize(field, rules, i, options); break; case "maxSize": errorMsg = methods._maxSize(field, rules, i, options); break; case "min": errorMsg = methods._min(field, rules, i, options); break; case "max": errorMsg = methods._max(field, rules, i, options); break; case "past": errorMsg = methods._past(field, rules, i, options); break; case "future": errorMsg = methods._future(field, rules, i, options); break; case "dateRange": var classGroup = "[class*=" + rules[i + 1] + "]"; var firstOfGroup = form.find(classGroup).eq(0); var secondOfGroup = form.find(classGroup).eq(1); //if one entry out of the pair has value then proceed to run through validation if (firstOfGroup[0].value || secondOfGroup[0].value) { errorMsg = methods._dateRange(firstOfGroup, secondOfGroup, rules, i, options); } if (errorMsg) required = true; options.showArrow = false; break; case "dateTimeRange": var classGroup = "[class*=" + rules[i + 1] + "]"; var firstOfGroup = form.find(classGroup).eq(0); var secondOfGroup = form.find(classGroup).eq(1); //if one entry out of the pair has value then proceed to run through validation if (firstOfGroup[0].value || secondOfGroup[0].value) { errorMsg = methods._dateTimeRange(firstOfGroup, secondOfGroup, rules, i, options); } if (errorMsg) required = true; options.showArrow = false; break; case "maxCheckbox": errorMsg = methods._maxCheckbox(form, field, rules, i, options); field = $(form.find("input[name='" + fieldName + "']")); break; case "minCheckbox": errorMsg = methods._minCheckbox(form, field, rules, i, options); field = $(form.find("input[name='" + fieldName + "']")); break; case "equals": errorMsg = methods._equals(field, rules, i, options); break; case "funcCall": errorMsg = methods._funcCall(field, rules, i, options); break; case "creditCard": errorMsg = methods._creditCard(field, rules, i, options); break; default: //$.error("jQueryValidator rule not found"+rules[i]); } if (errorMsg !== undefined) { promptText += errorMsg + "<br/>"; options.isError = true; } } // If the rules required is not added, an empty field is not validated if(!required && field.val() == "") options.isError = false; // Hack for radio/checkbox group button, the validation go into the // first radio/checkbox of the group var fieldType = field.prop("type"); if ((fieldType == "radio" || fieldType == "checkbox") && form.find("input[name='" + fieldName + "']").size() > 1) { field = $(form.find("input[name='" + fieldName + "'][type!=hidden]:first")); options.showArrow = false; } if (fieldType == "text" && form.find("input[name='" + fieldName + "']").size() > 1) { field = $(form.find("input[name='" + fieldName + "'][type!=hidden]:first")); options.showArrow = false; } if (options.isError){ methods._showPrompt(field, promptText, "", false, options); }else{ if (!isAjaxValidator) methods._closePrompt(field); } if (!isAjaxValidator) { field.trigger("jqv.field.result", [field, options.isError, promptText]); } /* Record error */ var errindex = $.inArray(field[0], options.InvalidFields); if (errindex == -1) { if (options.isError) options.InvalidFields.push(field[0]); } else if (!options.isError) { options.InvalidFields.splice(errindex, 1); } return options.isError; }, /** * Required validation * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _required: function(field, rules, i, options) { switch (field.prop("type")) { case "text": case "password": case "textarea": case "file": default: if (!field.val()) return options.allrules[rules[i]].alertText; break; case "radio": case "checkbox": var form = field.closest("form"); var name = field.attr("name"); if (form.find("input[name='" + name + "']:checked").size() == 0) { if (form.find("input[name='" + name + "']").size() == 1) return options.allrules[rules[i]].alertTextCheckboxe; else return options.allrules[rules[i]].alertTextCheckboxMultiple; } break; // required for <select> case "select-one": // added by paul@kinetek.net for select boxes, Thank you if (!field.val()) return options.allrules[rules[i]].alertText; break; case "select-multiple": // added by paul@kinetek.net for select boxes, Thank you if (!field.find("option:selected").val()) return options.allrules[rules[i]].alertText; break; } }, /** * Validate that 1 from the group field is required * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _groupRequired: function(field, rules, i, options) { var classGroup = "[class*=" +rules[i + 1] +"]"; var isValid = false; // Check all fields from the group field.closest("form").find(classGroup).each(function(){ if(!methods._required($(this), rules, i, options)){ isValid = true; return false; } }) if(!isValid) return options.allrules[rules[i]].alertText; }, /** * Validate Regex rules * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _customRegex: function(field, rules, i, options) { var customRule = rules[i + 1]; var rule = options.allrules[customRule]; if(!rule) { alert("jqv:custom rule not found "+customRule); return; } var ex=rule.regex; if(!ex) { alert("jqv:custom regex not found "+customRule); return; } var pattern = new RegExp(ex); if (!pattern.test(field.val())) return options.allrules[customRule].alertText; }, /** * Validate custom function outside of the engine scope * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _funcCall: function(field, rules, i, options) { var functionName = rules[i + 1]; var fn = window[functionName] || options.customFunctions[functionName]; if (typeof(fn) == 'function') return fn(field, rules, i, options); }, /** * Field match * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _equals: function(field, rules, i, options) { var equalsField = rules[i + 1]; if (field.val() != $("#" + equalsField).val()) return options.allrules.equals.alertText; }, /** * Check the maximum size (in characters) * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _maxSize: function(field, rules, i, options) { var max = rules[i + 1]; var len = field.val().length; if (len > max) { var rule = options.allrules.maxSize; return rule.alertText + max + rule.alertText2; } }, /** * Check the minimum size (in characters) * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _minSize: function(field, rules, i, options) { var min = rules[i + 1]; var len = field.val().length; if (len < min) { var rule = options.allrules.minSize; return rule.alertText + min + rule.alertText2; } }, /** * Check number minimum value * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _min: function(field, rules, i, options) { var min = parseFloat(rules[i + 1]); var len = parseFloat(field.val()); if (len < min) { var rule = options.allrules.min; if (rule.alertText2) return rule.alertText + min + rule.alertText2; return rule.alertText + min; } }, /** * Check number maximum value * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _max: function(field, rules, i, options) { var max = parseFloat(rules[i + 1]); var len = parseFloat(field.val()); if (len >max ) { var rule = options.allrules.max; if (rule.alertText2) return rule.alertText + max + rule.alertText2; //orefalo: to review, also do the translations return rule.alertText + max; } }, /** * Checks date is in the past * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _past: function(field, rules, i, options) { var p=rules[i + 1]; var pdate = (p.toLowerCase() == "now")? new Date():methods._parseDate(p); var vdate = methods._parseDate(field.val()); if (vdate > pdate ) { var rule = options.allrules.past; if (rule.alertText2) return rule.alertText + methods._dateToString(pdate) + rule.alertText2; return rule.alertText + methods._dateToString(pdate); } }, /** * Checks date is in the future * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _future: function(field, rules, i, options) { var p=rules[i + 1]; var pdate = (p.toLowerCase() == "now")? new Date():methods._parseDate(p); var vdate = methods._parseDate(field.val()); if (vdate < pdate ) { var rule = options.allrules.future; if (rule.alertText2) return rule.alertText + methods._dateToString(pdate) + rule.alertText2; return rule.alertText + methods._dateToString(pdate); } }, /** * Checks if valid date * * @param {string} date string * @return a bool based on determination of valid date */ _isDate: function (value) { var dateRegEx = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/); if (dateRegEx.test(value)) { return true; } return false; }, /** * Checks if valid date time * * @param {string} date string * @return a bool based on determination of valid date time */ _isDateTime: function (value){ var dateTimeRegEx = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1}$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^((1[012]|0?[1-9]){1}\/(0?[1-9]|[12][0-9]|3[01]){1}\/\d{2,4}\s+(1[012]|0?[1-9]){1}:(0?[1-5]|[0-6][0-9]){1}:(0?[0-6]|[0-6][0-9]){1}\s+(am|pm|AM|PM){1})$/); if (dateTimeRegEx.test(value)) { return true; } return false; }, //Checks if the start date is before the end date //returns true if end is later than start _dateCompare: function (start, end) { return (new Date(start.toString()) < new Date(end.toString())); }, /** * Checks date range * * @param {jqObject} first field name * @param {jqObject} second field name * @return an error string if validation failed */ _dateRange: function (first, second, rules, i, options) { //are not both populated if ((!first[0].value && second[0].value) || (first[0].value && !second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } //are not both dates if (!methods._isDate(first[0].value) || !methods._isDate(second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } //are both dates but range is off if (!methods._dateCompare(first[0].value, second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } }, /** * Checks date time range * * @param {jqObject} first field name * @param {jqObject} second field name * @return an error string if validation failed */ _dateTimeRange: function (first, second, rules, i, options) { //are not both populated if ((!first[0].value && second[0].value) || (first[0].value && !second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } //are not both dates if (!methods._isDateTime(first[0].value) || !methods._isDateTime(second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } //are both dates but range is off if (!methods._dateCompare(first[0].value, second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } }, /** * Max number of checkbox selected * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _maxCheckbox: function(form, field, rules, i, options) { var nbCheck = rules[i + 1]; var groupname = field.attr("name"); var groupSize = form.find("input[name='" + groupname + "']:checked").size(); if (groupSize > nbCheck) { options.showArrow = false; if (options.allrules.maxCheckbox.alertText2) return options.allrules.maxCheckbox.alertText + " " + nbCheck + " " + options.allrules.maxCheckbox.alertText2; return options.allrules.maxCheckbox.alertText; } }, /** * Min number of checkbox selected * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _minCheckbox: function(form, field, rules, i, options) { var nbCheck = rules[i + 1]; var groupname = field.attr("name"); var groupSize = form.find("input[name='" + groupname + "']:checked").size(); if (groupSize < nbCheck) { options.showArrow = false; return options.allrules.minCheckbox.alertText + " " + nbCheck + " " + options.allrules.minCheckbox.alertText2; } }, /** * Checks that it is a valid credit card number according to the * Luhn checksum algorithm. * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return an error string if validation failed */ _creditCard: function(field, rules, i, options) { //spaces and dashes may be valid characters, but must be stripped to calculate the checksum. var valid = false, cardNumber = field.val().replace(/ +/g, '').replace(/-+/g, ''); var numDigits = cardNumber.length; if (numDigits >= 14 && numDigits <= 16 && parseInt(cardNumber) > 0) { var sum = 0, i = numDigits - 1, pos = 1, digit, luhn = new String(); do { digit = parseInt(cardNumber.charAt(i)); luhn += (pos++ % 2 == 0) ? digit * 2 : digit; } while (--i >= 0) for (i = 0; i < luhn.length; i++) { sum += parseInt(luhn.charAt(i)); } valid = sum % 10 == 0; } if (!valid) return options.allrules.creditCard.alertText; }, /** * Ajax field validation * * @param {jqObject} field * @param {Array[String]} rules * @param {int} i rules index * @param {Map} * user options * @return nothing! the ajax validator handles the prompts itself */ _ajax: function(field, rules, i, options) { var errorSelector = rules[i + 1]; var rule = options.allrules[errorSelector]; var extraData = rule.extraData; var extraDataDynamic = rule.extraDataDynamic; if (!extraData) extraData = ""; if (extraDataDynamic) { var tmpData = []; var domIds = String(extraDataDynamic).split(","); for (var i = 0; i < domIds.length; i++) { var id = domIds[i]; if ($(id).length) { var inputValue = field.closest("form").find(id).val(); var keyValue = id.replace('#', '') + '=' + escape(inputValue); tmpData.push(keyValue); } } extraDataDynamic = tmpData.join("&"); } else { extraDataDynamic = ""; } if (!options.isError) { $.ajax({ type: "GET", url: rule.url, cache: false, dataType: "json", data: "fieldId=" + field.attr("id") + "&fieldValue=" + field.val() + "&extraData=" + extraData + "&" + extraDataDynamic, field: field, rule: rule, methods: methods, options: options, beforeSend: function() { // build the loading prompt var loadingText = rule.alertTextLoad; if (loadingText) methods._showPrompt(field, loadingText, "load", true, options); }, error: function(data, transport) { methods._ajaxError(data, transport); }, success: function(json) { // asynchronously called on success, data is the json answer from the server var errorFieldId = json[0]; var errorField = $($("#" + errorFieldId)[0]); // make sure we found the element if (errorField.length == 1) { var status = json[1]; // read the optional msg from the server var msg = json[2]; if (!status) { // Houston we got a problem - display an red prompt options.ajaxValidCache[errorFieldId] = false; options.isError = true; // resolve the msg prompt if(msg) { if (options.allrules[msg]) { var txt = options.allrules[msg].alertText; if (txt) msg = txt; } } else msg = rule.alertText; methods._showPrompt(errorField, msg, "", true, options); } else { if (options.ajaxValidCache[errorFieldId] !== undefined) options.ajaxValidCache[errorFieldId] = true; // resolves the msg prompt if(msg) { if (options.allrules[msg]) { var txt = options.allrules[msg].alertTextOk; if (txt) msg = txt; } } else msg = rule.alertTextOk; // see if we should display a green prompt if (msg) methods._showPrompt(errorField, msg, "pass", true, options); else methods._closePrompt(errorField); } } errorField.trigger("jqv.field.result", [errorField, !options.isError, msg]); } }); } }, /** * Common method to handle ajax errors * * @param {Object} data * @param {Object} transport */ _ajaxError: function(data, transport) { if(data.status == 0 && transport == null) alert("The page is not served from a server! ajax call failed"); else if(typeof console != "undefined") console.log("Ajax error: " + data.status + " " + transport); }, /** * date -> string * * @param {Object} date */ _dateToString: function(date) { return date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate(); }, /** * Parses an ISO date * @param {String} d */ _parseDate: function(d) { var dateParts = d.split("-"); if(dateParts==d) dateParts = d.split("/"); return new Date(dateParts[0], (dateParts[1] - 1) ,dateParts[2]); }, /** * Builds or updates a prompt with the given information * * @param {jqObject} field * @param {String} promptText html text to display type * @param {String} type the type of bubble: 'pass' (green), 'load' (black) anything else (red) * @param {boolean} ajaxed - use to mark fields than being validated with ajax * @param {Map} options user options */ _showPrompt: function(field, promptText, type, ajaxed, options, ajaxform) { var prompt = methods._getPrompt(field); // The ajax submit errors are not see has an error in the form, // When the form errors are returned, the engine see 2 bubbles, but those are ebing closed by the engine at the same time // Because no error was found befor submitting if(ajaxform) prompt = false; if (prompt) methods._updatePrompt(field, prompt, promptText, type, ajaxed, options); else methods._buildPrompt(field, promptText, type, ajaxed, options); }, /** * Builds and shades a prompt for the given field. * * @param {jqObject} field * @param {String} promptText html text to display type * @param {String} type the type of bubble: 'pass' (green), 'load' (black) anything else (red) * @param {boolean} ajaxed - use to mark fields than being validated with ajax * @param {Map} options user options */ _buildPrompt: function(field, promptText, type, ajaxed, options) { // create the prompt var prompt = $('<div>'); prompt.addClass(methods._getClassName(field.attr("id")) + "formError"); // add a class name to identify the parent form of the prompt if(field.is(":input")) prompt.addClass("parentForm"+methods._getClassName(field.parents('form').attr("id"))); prompt.addClass("formError"); switch (type) { case "pass": prompt.addClass("greenPopup"); break; case "load": prompt.addClass("blackPopup"); break; default: /* it has error */ options.InvalidCount++; } if (ajaxed) prompt.addClass("ajaxed"); // create the prompt content var promptContent = $('<div>').addClass("formErrorContent").html(promptText).appendTo(prompt); // create the css arrow pointing at the field // note that there is no triangle on max-checkbox and radio if (options.showArrow) { var arrow = $('<div>').addClass("formErrorArrow"); //prompt positioning adjustment support. Usage: positionType:Xshift,Yshift (for ex.: bottomLeft:+20 or bottomLeft:-20,+10) var positionType=field.data("promptPosition") || options.promptPosition; if (typeof(positionType)=='string') { if (positionType.indexOf(":")!=-1) { positionType=positionType.substring(0,positionType.indexOf(":")); }; }; switch (positionType) { case "bottomLeft": case "bottomRight": prompt.find(".formErrorContent").before(arrow); arrow.addClass("formErrorArrowBottom").html('<div class="line1"><!-- --></div><div class="line2"><!-- --></div><div class="line3"><!-- --></div><div class="line4"><!-- --></div><div class="line5"><!-- --></div><div class="line6"><!-- --></div><div class="line7"><!-- --></div><div class="line8"><!-- --></div><div class="line9"><!-- --></div><div class="line10"><!-- --></div>'); break; case "topLeft": case "topRight": arrow.html('<div class="line10"><!-- --></div><div class="line9"><!-- --></div><div class="line8"><!-- --></div><div class="line7"><!-- --></div><div class="line6"><!-- --></div><div class="line5"><!-- --></div><div class="line4"><!-- --></div><div class="line3"><!-- --></div><div class="line2"><!-- --></div><div class="line1"><!-- --></div>'); prompt.append(arrow); break; } } if (options.relative) { // empty relative span does not disturb page layout // prompt positioned absolute to relative span // vertical-align:top so position calculations are the same as isOverflown var outer = $('<span>').css('position','relative').css('vertical-align','top').addClass('formErrorOuter').append(prompt.css('position','absolute')); field.before(outer); } else if (options.isOverflown) { //Cedric: Needed if a container is in position:relative // insert prompt in the form or in the overflown container? field.before(prompt); } else { $("body").append(prompt); } var pos = methods._calculatePosition(field, prompt, options); prompt.css({ "top": pos.callerTopPosition, "left": pos.callerleftPosition, "marginTop": pos.marginTopSize, "opacity": 0 }).data("callerField", field); if (options.autoHidePrompt) { setTimeout(function(){ prompt.animate({ "opacity": 0 },function(){ prompt.closest('.formErrorOuter').remove(); prompt.remove(); }) }, options.autoHideDelay) return prompt.animate({ "opacity": 0.87 }) } else { return prompt.animate({ "opacity": 0.87 }); } }, /** * Updates the prompt text field - the field for which the prompt * @param {jqObject} field * @param {String} promptText html text to display type * @param {String} type the type of bubble: 'pass' (green), 'load' (black) anything else (red) * @param {boolean} ajaxed - use to mark fields than being validated with ajax * @param {Map} options user options */ _updatePrompt: function(field, prompt, promptText, type, ajaxed, options, noAnimation) { if (prompt) { if (typeof type !== "undefined") { if (type == "pass") prompt.addClass("greenPopup"); else prompt.removeClass("greenPopup"); if (type == "load") prompt.addClass("blackPopup"); else prompt.removeClass("blackPopup"); } if (ajaxed) prompt.addClass("ajaxed"); else prompt.removeClass("ajaxed"); prompt.find(".formErrorContent").html(promptText); var pos = methods._calculatePosition(field, prompt, options); css = {"top": pos.callerTopPosition, "left": pos.callerleftPosition, "marginTop": pos.marginTopSize}; if (noAnimation) prompt.css(css); else prompt.animate(css) } }, /** * Closes the prompt associated with the given field * * @param {jqObject} * field */ _closePrompt: function(field) { var prompt = methods._getPrompt(field); if (prompt) prompt.fadeTo("fast", 0, function() { prompt.parent('.formErrorOuter').remove(); prompt.remove(); }); }, closePrompt: function(field) { return methods._closePrompt(field); }, /** * Returns the error prompt matching the field if any * * @param {jqObject} * field * @return undefined or the error prompt (jqObject) */ _getPrompt: function(field) { var className = methods._getClassName(field.attr("id")) + "formError"; var match = $("." + methods._escapeExpression(className))[0]; if (match) return $(match); }, /** * Returns the escapade classname * * @param {selector} * className */ _escapeExpression: function (selector) { return selector.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g, "\\$1"); }, /** * returns true if we are in a RTLed document * * @param {jqObject} field */ isRTL: function(field) { var $document = $(document); var $body = $('body'); var rtl = (field && field.hasClass('rtl')) || (field && (field.attr('dir') || '').toLowerCase()==='rtl') || $document.hasClass('rtl') || ($document.attr('dir') || '').toLowerCase()==='rtl' || $body.hasClass('rtl') || ($body.attr('dir') || '').toLowerCase()==='rtl'; return Boolean(rtl); }, /** * Calculates prompt position * * @param {jqObject} * field * @param {jqObject} * the prompt * @param {Map} * options * @return positions */ _calculatePosition: function (field, promptElmt, options) { var promptTopPosition, promptleftPosition, marginTopSize; var fieldWidth = field.width(); var promptHeight = promptElmt.height(); var overflow = options.isOverflown || options.relative; if (overflow) { // is the form contained in an overflown container? promptTopPosition = promptleftPosition = 0; // compensation for the arrow marginTopSize = -promptHeight; } else { var offset = field.offset(); promptTopPosition = offset.top; promptleftPosition = offset.left; marginTopSize = 0; } //prompt positioning adjustment support //now you can adjust prompt position //usage: positionType:Xshift,Yshift //for example: // bottomLeft:+20 means bottomLeft position shifted by 20 pixels right horizontally // topRight:20, -15 means topRight position shifted by 20 pixels to right and 15 pixels to top //You can use +pixels, - pixels. If no sign is provided than + is default. var positionType=field.data("promptPosition") || options.promptPosition; var shift1=""; var shift2=""; var shiftX=0; var shiftY=0; if (typeof(positionType)=='string') { //do we have any position adjustments ? if (positionType.indexOf(":")!=-1) { shift1=positionType.substring(positionType.indexOf(":")+1); positionType=positionType.substring(0,positionType.indexOf(":")); //if any advanced positioning will be needed (percents or something else) - parser should be added here //for now we use simple parseInt() //do we have second parameter? if (shift1.indexOf(",")!=-1) { shift2=shift1.substring(shift1.indexOf(",")+1); shift1=shift1.substring(0,shift1.indexOf(",")); shiftY=parseInt(shift2); if (isNaN(shiftY)) {shiftY=0;}; }; shiftX=parseInt(shift1); if (isNaN(shift1)) {shift1=0;}; }; }; if(!methods.isRTL(field)) { switch (positionType) { default: case "topRight": if (overflow) // Is the form contained in an overflown container? promptleftPosition += fieldWidth - 30; else { promptleftPosition += fieldWidth - 130; promptTopPosition += -promptHeight -2; } break; case "topLeft": promptTopPosition += -promptHeight - 10; break; case "centerRight": if (overflow) { promptTopPosition=field.outerHeight(); promptleftPosition=field.outerWidth(1)+5; } else { promptleftPosition+=field.outerWidth()+5; } break; case "centerLeft": promptleftPosition -= promptElmt.width() + 2; break; case "bottomLeft": promptTopPosition = promptTopPosition + field.height() + 15; break; case "bottomRight": promptleftPosition += fieldWidth - 30; promptTopPosition += field.height() + 5; } } else { switch (positionType) { default: case "topLeft": if (overflow) // Is the form contained in an overflown container? promptleftPosition -= promptElmt.width() - 30; else { promptleftPosition -= promptElmt.width() - 30; promptTopPosition += -promptHeight -2; } break; case "topRight": if (overflow) // Is the form contained in an overflown container? promptleftPosition += fieldWidth - promptElmt.width(); else { promptleftPosition += fieldWidth - promptElmt.width(); promptTopPosition += -promptHeight -2; } break; case "centerRight": if (overflow) { promptTopPosition=field.outerHeight(); promptleftPosition=field.outerWidth(1)+5; } else { promptleftPosition+=field.outerWidth()+5; } break; case "centerLeft": promptleftPosition -= promptElmt.width() + 2; break; case "bottomLeft": promptleftPosition += -promptElmt.width() + 30; promptTopPosition = promptTopPosition + field.height() + 15; break; case "bottomRight": promptleftPosition += fieldWidth - promptElmt.width(); promptTopPosition += field.height() + 15; } } //apply adjusments if any promptleftPosition += shiftX; promptTopPosition += shiftY; return { "callerTopPosition": promptTopPosition + "px", "callerleftPosition": promptleftPosition + "px", "marginTopSize": marginTopSize + "px" }; }, /** * Saves the user options and variables in the form.data * * @param {jqObject} * form - the form where the user option should be saved * @param {Map} * options - the user options * @return the user options (extended from the defaults) */ _saveOptions: function(form, options) { // is there a language localisation ? if ($.validationEngineLanguage) var allRules = $.validationEngineLanguage.allRules; else $.error("jQuery.validationEngine rules are not loaded, plz add localization files to the page"); // --- Internals DO NOT TOUCH or OVERLOAD --- // validation rules and i18 $.validationEngine.defaults.allrules = allRules; var userOptions = $.extend(true,{},$.validationEngine.defaults,options); jim = userOptions; // Needed to be retro compatible if (userOptions.isOverflown) userOptions.relative = true; if (userOptions.relative) userOptions.isOverflown = true; form.data('jqv', userOptions); return userOptions; }, /** * Removes forbidden characters from class name * @param {String} className */ _getClassName: function(className) { if(className) { return className.replace(/:/g, "_").replace(/\./g, "_"); } } }; /** * Plugin entry point. * You may pass an action as a parameter or a list of options. * if none, the init and attach methods are being called. * Remember: if you pass options, the attached method is NOT called automatically * * @param {String} * method (optional) action */ $.fn.validationEngine = function(method) { var form = $(this); if(!form[0]) return false; // stop here if the form does not exist if (typeof(method) == 'string' && method.charAt(0) != '_' && methods[method]) { // make sure init is called once if(method != "showPrompt" && method != "hidePrompt" && method != "hide" && method != "hideAll") methods.init.apply(form); return methods[method].apply(form, Array.prototype.slice.call(arguments, 1)); } else if (typeof method == 'object' || !method) { // default constructor with or without arguments methods.init.apply(form, arguments); return methods.attach.apply(form); } else { $.error('Method ' + method + ' does not exist in jQuery.validationEngine'); } }; // LEAK GLOBAL OPTIONS $.validationEngine= {defaults:{ // Name of the event triggering field validation validationEventTrigger: "blur", // Automatically scroll viewport to the first error scroll: true, // Focus on the first input focusFirstField:true, // Opening box position, possible locations are: topLeft, // topRight, bottomLeft, centerRight, bottomRight promptPosition: "topRight", bindMethod:"bind", // internal, automatically set to true when it parse a _ajax rule inlineAjax: false, // if set to true, the form data is sent asynchronously via ajax to the form.action url (get) ajaxFormValidation: false, // Ajax form validation callback method: boolean onComplete(form, status, errors, options) // retuns false if the form.submit event needs to be canceled. ajaxFormValidationURL: false, // The url to send the submit ajax validation (default to action) onAjaxFormComplete: $.noop, // called right before the ajax call, may return false to cancel onBeforeAjaxFormValidation: $.noop, // Stops form from submitting and execute function assiciated with it onValidationComplete: false, // better relative positioning relative: false, // Used when the form is displayed within a scrolling DIV isOverflown: false, overflownDIV: "", // Used when you have a form fields too close and the errors messages are on top of other disturbing viewing messages doNotShowAllErrosOnSubmit: false, // true when form and fields are binded binded: false, // set to true, when the prompt arrow needs to be displayed showArrow: true, // did one of the validation fail ? kept global to stop further ajax validations isError: false, // Caches field validation status, typically only bad status are created. // the array is used during ajax form validation to detect issues early and prevent an expensive submit ajaxValidCache: {}, // Auto update prompt position after window resize autoPositionUpdate: false, InvalidFields: [], onSuccess: false, onFailure: false, // Auto-hide prompt autoHidePrompt: false, // Delay before auto-hide autoHideDelay: 10000 }}; $(function(){$.validationEngine.defaults.promptPosition = methods.isRTL()?'topLeft':"topRight"}); })(jQuery);
{ "content_hash": "6b0bfd00e2aa14a618cfb62a4b2c4d31", "timestamp": "", "source": "github", "line_count": 1662, "max_line_length": 483, "avg_line_length": 40.91034897713598, "alnum_prop": 0.4884032179783213, "repo_name": "applelee/dion", "id": "6f6b17fb69ee5c18e4694b6a2d38a662ab973472", "size": "68303", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "app/admin/assets/js/plugins/forms/jquery.validationEngine.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "503116" }, { "name": "HTML", "bytes": "1839" }, { "name": "JavaScript", "bytes": "3929325" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Fahrenheit Cologne for Men by Christian Dior</title> <meta name="description" content="Fahrenheit Cologne at discount price. Fahrenheit by Christian Dior available at FragranceShop.com, Free Shipping on orders over 150. Fahrenheit,Christian Dior,Christian Dior introduced Fahrenheit in 1988. This fine fragrance contains bergamot, lemon, lavender and is accented with violet, cedar and leather. Fahrenheit is perfect for casual and formal use. "/> <meta name="keywords" content="Fahrenheit Cologne,Fahrenheit,Discount Fahrenheit,Fahrenheit by Christian Dior,Fahrenheit Fragrance,Christian Dior Fahrenheit,Fahrenheit Women,Fahrenheit Men,Wholesale Fahrenheit Cologne,Christian Dior Cologne,Discount Christian Dior Cologne,Wholesale Christian Dior Cologne,Man Cologne,Fahrenheit Woman,Christian Dior,Christian Dior Fragrance,Perfume,Christian Dior Women,Discount Cologne,Christian Dior Men"/> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <script type="text/javascript"> //<![CDATA[ var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-1322691-2']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();//]]> </script><script type="text/javascript"> //<![CDATA[ try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:0,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dok3v=1613a3a185/"},atok:"b8385d6828d9f6b93f45c5a5e3675c9a",petok:"d421fbba74b5cf625e7ed3d7d6f6e4b34f109bf8-1499877878-1800",zone:"fragranceshop.com",rocket:"0",apps:{"clky":{"sid":"100528275","uid":null},"ga_key":{"ua":"UA-1322691-2","ga_bs":"1"}}}];!function(a,b){a=document.createElement("script"),b=document.getElementsByTagName("script")[0],a.async=!0,a.src="//ajax.cloudflare.com/cdn-cgi/nexp/dok3v=85b614c0f6/cloudflare.min.js",b.parentNode.insertBefore(a,b)}()}}catch(e){}; //]]> </script> <script type="text/javascript"> <!-- var number_format_dec = '.'; var number_format_th = ''; var number_format_point = '2'; var store_language = 'US'; var xcart_web_dir = ""; var images_dir = "/skin1/images"; var lbl_no_items_have_been_selected = 'No items have been selected'; var current_area = 'C'; --> </script><script src="/skin1/common.js" language="JavaScript" type="text/javascript"></script> <script type="text/javascript"> <!-- var usertype = "C"; var scriptNode = false; scriptNode = document.createElement("script"); scriptNode.type = "text/javascript"; --> </script> <script src="/skin1/browser_identificator.js" language="JavaScript" type="text/javascript"></script> <link rel="shortcut icon" href="/favicon.ico"/> <link rel="stylesheet" href="/skin1/skin1.css"/> <link rel="stylesheet" href="/jq/jquery-ui.min.css" type="text/css"/> <style type="text/css">.tooltip-above{display:inline;position:relative;width:auto;font-family:Arial,Calibri;}.tooltip-above:hover:after{background:#333;background:rgba(0,0,0,.8);top:-53px;color:#fff;content:attr(tooltip);left:0;padding:5px 10px;position:absolute;z-index:98;min-width:250px;min-height:30px;}.tooltip-above:hover:before{border:solid;border-color:#333 transparent;border-width:6px 6px 0px 6px;top:-5px;content:"";left:50%;position:absolute;z-index:99;}</style> <link rel="stylesheet" type="text/css" href="/skin1/modules/Advanced_Customer_Reviews/main.css"/> <script type="text/javascript" src="/skin1/modules/Advanced_Customer_Reviews/jquery-min.js"></script> <script type="text/javascript" src="/skin1/modules/Advanced_Customer_Reviews/func.js"></script> <link rel="stylesheet" href="/nslide/style.css" type="text/css" media="screen"/> <link href="/aslide/fs_scroller.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="/nslide/jquery.js"></script> <script type="text/javascript" src="/nslide/scripts.js"></script> <script type="text/javascript" src="/aslide/jquery.min.js"></script> <script type="text/javascript" src="aslide/fs_scroller.js"></script> <base href="http://www.fragranceshop.com/"/> <link rel="canonical" href="http://www.fragranceshop.com/perfume/fahrenheit"/> </head> <body> <table cellpadding="0" cellspacing="0" width="100%" align="center" border="0" bgcolor="#ffffff"></table> <table border="0" width="100%" id="table1" bgcolor="#ffffff"> <tr> <td width="8%">&nbsp;</td> <td width="30%" align="left"> <span class="fsntx1">&nbsp; </span></td> <td width="54%" align="right"> <a class="fsntx2" href="/" style="text-decoration: none">HOME &nbsp; |</a> &nbsp; <a class="fsntx2" href="/help.php?section=Login" style="text-decoration: none">LOGIN &nbsp; |</a> &nbsp; <a class="fsntx2" href="/help.php?section=Login" style="text-decoration: none">MY ACCOUNT &nbsp; |</a>&nbsp; <a class="fsntx2" href="/help.php?section=Login" style="text-decoration: none">ORDER STATUS &nbsp; |</a>&nbsp; <a class="fsntx2" href="http://www.fragranceshopwholesale.com/pages.php?pageid=13" style="text-decoration: none">WHOLESALE &nbsp; |</a>&nbsp; <a class="fsntx2" href="/help.php" style="text-decoration: none">HELP &nbsp;</a>&nbsp;</td> <td width="8%">&nbsp;</td> </tr> </table> <table cellpadding="0" cellspacing="0" width="960" align="center" border="0"> <tr><td vAlign="top"><table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="30%" rowspan="2"><a href="/"><img src="/skin1/images/fslogo.jpg" height="93" width="208" border="0" alt="Discount Perfume"/></a> </td> <td width="35%"> <p align="right"> &nbsp; </td> <td width="15%"> <form name="sCurrency_form"> <table border="0" cellpadding="0" cellspacing="0"> <td><img src="../images/currency.jpg" border="0"></a></td> <input type="hidden" name="redirect2" value="/perfume/miniatures/"> <td> <select name="s_currency" onChange="javascript: this.form.submit();"> <option value="USD" selected> USD</option> <option value="AUD">AUD</option> <option value="BRL">BRL</option> <option value="CAD">CAD</option> <option value="EUR">EUR</option> <option value="GBP">GBP</option> </select> </table> </td> </form><td width="20%"> <p align="right"> <table> <td> <img height="17" alt="" src="/skin1/images/sb15.jpg" width="14" border="0"></td><td><font color="#963a8b"><font size="1" face="Arial">SHOPPING BAG: <a class="fsml1" href="cart.php"> 0 Items</a> TOTAL <a class="fsml1" href="cart.php">0.00</a></font></td> </table></td> </tr> <tr> <td width="50%" colspan="2"> <table class="prbg1" height="50" cellSpacing="0" cellPadding="1" width="100%" align="left" border="0"> <tr> <td width="87%"> <p align="center"><b><font color="#cc2e76" size=4">35% Off Everything</font> <font color="#008080" size="1"> (use code: </font><font color="#000000">FW35 </font><font color="#008080">)</font> <u><font color="#FF0000" size="1"><i>PLUS</I></font></u><BR> <font color="#008080" size="2">(Free U.S. shipping on orders over $95</font><font color="#008080">)</font> <td width="13%"></td> </tr> </td> </table> </td> <td width="20%" valign="bottom"> <table> <td><form method="get" action="_search.php" name="_search"> <input type="hidden" name="page" value="1" /> <input type="text" name="q" size="20" id="smartSearchSiteQ" value="" class='auto' style="width:150px; height:20px; font-size: 12px; margin-left:0px; padding-left: 0px;" /></td> <td valign="middle" style="padding-left: 5px; padding-right: 20px;"><a href="javascript: document._search.submit();"> <img alt="" src="/skin1/images/searchm2.jpg" border="0"> </a></td> </table> </form> </td> </tr> </table> <table> <tr> <td><img src="/skin1/images/spacer.gif" height="1" width="960" alt="" /></td> </tr> </table> <table cellpadding="0" cellspacing="0" border="0" bgcolor="#963a8b" width="100%"> <tr> <td width="100%"> <div id='cssmenu'> <ul> <li><a href='/perfume/mens-fragrances/'><span>Men's Cologne</span></a></li> <li class='has-sub'><a href='/perfume/womens-fragrances/'><span>Women's Perfume</span></a> </li> <li><a href='/perfume/miniatures/'><span>Miniatures</span></a></li> <li><a href='/perfume/gift-sets/'><span>Gift Sets</span></a></li> <li><a href='/perfume-oils/'><span>Oils</span></a></li> <li><a href='/skin-care/'><span>Skin Care</span></a></li> <li><a href='/hair-care/'><span>Hair Care</span></a></li> <li><a href='/makeup/'><span>Makeup</span></a></li> <li class='last'><a href='/perfume/bath-body/'><span>Bath & Body</span></a></li> </ul> </div> </td> </tr> <tr> <td colspan="2" height="4"></td> </tr> </table> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td> </td> </tr> <tr> <td colspan="2" valign="middle" height="5"> <table cellspacing="0" cellpadding="0" width="100%"> <tr> <td class="HeadTopPad"><img src="/skin1/images/spacer.gif" alt="" /></td> </tr> </table> </table><!-- main area --> <table cellSpacing="0" cellPadding="0"> <tr><td vAlign="top" width="210"> <!-- main area1 --> <!-- main area2 --> <table cellSpacing="0" cellPadding="0" border="0"> <tr> <td class="fsbg3" width="210" height="10"> <span class="fstx1"></span></a><tr> <td class="fsbg2"> <table cellSpacing="0" cellPadding="0" width="200" align="center" border="0"> <tr><td> <ul> <br> <table border="0" width="100%"> <tr> <td bgcolor="#963a8b" height="20"><font color=#ffffff> MEN'S COLOGNE LIST A-Z</font></td> </tr> </table> <table height="25" cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr> <td width="30"><table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#FFFFFF" border="0"> <tr><td align="center"><a title="#&#039;s" class="fshtext" href="/perfume/5-s/">#</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"><a title="A" class="fshtext" href="/perfume/2-a/">A</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="B" class="fshtext" href="/perfume/2-b/"> B</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="C" class="fshtext" href="/perfume/3-c/"> C</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="D" class="fshtext" href="/perfume/3-d/"> D</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="E" class="fshtext" href="/perfume/3-e/"> E</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="F" class="fshtext" href="/perfume/3-f/"> F</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="G" class="fshtext" href="/perfume/3-g/"> G</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="H" class="fshtext" href="/perfume/3-h/"> H</a></td></tr></table></td></tr><tr> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="I" class="fshtext" href="/perfume/3-i/"> I</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="J" class="fshtext" href="/perfume/3-j/"> J</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="K" class="fshtext" href="/perfume/3-k/"> K</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="L" class="fshtext" href="/perfume/3-l/"> L</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="M" class="fshtext" href="/perfume/3-m/"> M</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="N" class="fshtext" href="/perfume/3-n/"> N</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="O" class="fshtext" href="/perfume/3-o/"> O</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="P" class="fshtext" href="/perfume/3-p/"> P</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="Q" class="fshtext" href="/perfume/3-q/"> Q</a></td></tr></table></td></tr><tr> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="R" class="fshtext" href="/perfume/3-r/"> R</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="S" class="fshtext" href="/perfume/6-s/"> S</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="T" class="fshtext" href="/perfume/3-t/"> T</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="U" class="fshtext" href="/perfume/3-u/"> U</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="V" class="fshtext" href="/perfume/3-v/"> V</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="W" class="fshtext" href="/perfume/3-w/"> W</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="X" class="fshtext" href="/perfume/3-x/"> X</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="Y" class="fshtext" href="/perfume/3-y/"> Y</a></td></tr></table></td> <td width="30"> <table class="fshl" height="25" cellSpacing="0" cellPadding="0" width="20" bgColor="#ffffff" border="0"> <tr><td align="center"> <a title="Z" class="fshtext" href="/perfume/3-z/"> Z</a></td></tr></table></table> <br> <br> <table border="0" width="100%"> <tr> <td bgcolor="#963a8b" height="20"><font color=#ffffff> SHOP BY BRAND</font></td> </tr> <tr> <td> <li><a href="http://www.fragranceshop.com/alfred-sung/?sort_direction=1">Alfred Sung Perfume</li></a> <li><a href="http://www.fragranceshop.com/burberry/?sort_direction=1">Burberry</li></a> <li><a href="http://www.fragranceshop.com/bvlgari/?sort_direction=1">Bvlgari</li></a> <li><a href="http://www.fragranceshop.com/calvin-klein/?sort_direction=1">Calvin Klein Perfume</li></a> <li><a href="http://www.fragranceshop.com/carolina-herrera/?sort_direction=1">Carolina Herrera</li></a> <li><a href="http://www.fragranceshop.com/christian-dior/?sort_direction=1">Christian Dior Perfume</li></a> <li><a href="http://www.fragranceshop.com/dolce-gabbana/?sort_direction=1">Dolce &amp; Gabbana</li></a> <li><a href="http://www.fragranceshop.com/donna-karan/?sort_direction=1">Donna Karan</li></a> <li><a href="http://www.fragranceshop.com/ed-hardy/?sort_direction=1">Ed Hardy Cologne</li></a> <li><a href="http://www.fragranceshop.com/estee-lauder/?sort_direction=1">Estee Lauder Cologne</li></a> <li><a href="http://www.fragranceshop.com/giorgio-armani/?sort_direction=1">Giorgio Armani Cologne</li></a> <li><a href="http://www.fragranceshop.com/givenchy/?sort_direction=1">Givenchy</li></a> <li><a href="http://www.fragranceshop.com/gucci/?sort_direction=1">Gucci Cologne</li></a> <li><a href="http://www.fragranceshop.com/jean-paul-gaultier/?sort_direction=1">Jean Paul Gaultier </li></a> <li><a href="http://www.fragranceshop.com/ralph-lauren/?sort_direction=1">Ralph Lauren</li></a> <li><a href="http://www.fragranceshop.com/thierry-mugler/?sort_direction=1">Thierry Mugler</li></a> <li><a href="http://www.fragranceshop.com/versace/?sort_direction=1">Versace Cologne</li></a> <br>&nbsp;</br> <li><a href="manufacturers.php">More Brands...</li></a> </td> </tr> </table> <br> <table border="0" width="100%"> <tr> <td bgcolor="#963a8b" height="20"><font color=#ffffff>BEST SELLING FRAGRANCES </font></td> </tr> <tr> <td> <li><b></b><a title="Acqua Di Gio by Giorgio Armani for Men Eau de Toilette Spray 3.4 oz" href="/discount-perfume/acqua-di-gio-by-giorgio-armani-cologne-for-men-eau-de-toilette-spray-34-oz.html">Acqua Di Gio Cologne</a></li> <li><b></b><a title="Obsession by Calvin Klein for Men Eau de Toilette Spray 6.7 oz" href="/discount-perfume/obsession-by-calvin-klein-cologne-for-men-eau-de-toilette-spray-67-oz.html">Obsession Cologne</a></li> <li><b></b><a title="Versace Bright Crystal by Versace for Women Eau de Toilette Spray 3.0 oz" href="/discount-perfume/versace-bright-crystal-by-versace-for-women-eau-de-toilette-spray-30-oz.html">Versace Bright Crystal Perfume</a></li> <li><b></b><a title="Light Blue by Dolce &amp; Gabbana for Women Eau de Toilette Spray 3.4 oz in Gift Box" href="/light-blue-by-dolce-gabbana-for-women-eau-de-toilette-spray-3.4-oz-in-gift-box.html">Light Blue Perfume</a></li> <li><b></b><a title="Eternity by Calvin Klein for Men Eau de Toilette Spray 6.7 oz" href="/eternity-by-calvin-klein-cologne-for-men-eau-de-toilette-spray-6.7-oz.html">Eternity Cologne</a></li> <li><b></b><a title="Euphoria by Calvin Klein Eau de Parfum Spray 1.0 oz for Women" href="/euphoria-by-calvin-klein-eau-de_parfum-spray-1.0-oz-for-women.html">Euphoria Perfume</a></li> <li><b></b><a title="Viva La Juicy by Juicy Couture TESTER for Women Eau de Parfum Spray 3.4 oz" href="/discount-perfume/viva-la-juicy-by-juicy-couture-tester-for-women-eau-de-parfum-spray-34-oz.html">Viva La Juicy Perfume</a></li> <li><b></b><a title="Burberry Touch by Burberry for Men Eau de Toilette Spray 3.4 oz" href="/discount-perfume/burberry-touch-by-burberry-cologne-for-men-eau-de-toilette-spray-34-oz.html">Burberry Touch Cologne</a></li> <li><b></b><a title="Jimmy Choo by Jimmy Choo for Women Eau de Parfum 0.15 oz MINI" href="/jimmy-choo-by-jimmy-choo-perfume-for-women-eau-de_parfum-0.15-oz-mini.html">Jimmy Choo Perfume</a></li> <li><b></b><a title="Versace Eros by Versace for Men Eau de Toilette 0.16 oz MINI" href="/versace-eros-by-versace-for-men-eau-de-toilette-0.16-oz-mini.html">Versace Eros Cologne</a></li> <li><b></b><a title="Obsession by Calvin Klein for Women Eau de Parfum Spray 3.4 oz" href="/discount-perfume/obsession-by-calvin-klein-for-women-eau-de-parfum-spray-34-oz.html">Obsession Perfume</a></li> <li><b></b><a title="Red Door by Elizabeth Arden TESTER for Women Eau de Toilette Spray 3.4 oz" href="/discount-perfume/red-door-by-elizabeth-arden-tester-for-women-eau-de-toilette-spray-34-oz.html">Red Door Perfume</a></li> <li><b></b><a title="Club de Nuit Intense by Armaf for Men Eau de Toilette Spray 3.6 oz" href="/club-de-nuit-intense-by-armaf-for-men-eau-de-toilette-spray-3.6-oz.html">Club de Nuit Intense Cologne</a></li> <li><b></b><a title="Lancome La Vie Est Belle by Lancome TESTER for Women Eau de Parfum Spray 3.4 oz" href="/lancome-la-vie-est-belle-by-lancome-tester-for-women-eau-de_parfum-spray-3.4-oz.html">Lancome La Vie Est Belle Perfume</a></li> <li><b></b><a title="White Diamonds by Elizabeth Taylor for Women Eau de Parfum Spray 1.7 oz" href="/white-diamonds-by-elizabeth-taylor-for-women-eau-de_parfum-spray-1.7-oz.html">White Diamonds Perfume</a></li> <li><b></b><a title="Invictus by Paco Rabanne for Men Eau de Toilette Spray 1.7 oz" href="/invictus-by_paco-rabanne-for-men-eau-de-toilette-spray-1.7-oz.html">Invictus Cologne</a></li> <li><b></b><a title="Burberry Brit by Burberry TESTER for Women Eau de Toilette Spray 3.4 oz" href="/discount-perfume/burberry-brit-by-burberry-tester-for-women-eau-de-toilette-spray-34-oz.html">Burberry Brit Perfume</a></li> <li><b></b><a title="Polo by Ralph Lauren for Men Eau de Toilette Spray 4.0 oz" href="/discount-perfume/polo-by-ralph-lauren-cologne-for-men-eau-de-toilette-spray-40-oz.html">Polo Cologne</a></li> <li><b></b><a title="Angel by Thierry Mugler TESTER for Women Eau de Parfum Spray 3.4 oz" href="/discount-perfume/angel-by-thierry-mugler-tester-for-women-eau-de-parfum-spray-34-oz.html">Angel Perfume</a></li> <li><b></b><a title="Light Blue by Dolce &amp; Gabbana for Men Eau de Toilette Spray 4.2 oz" href="/discount-perfume/light-blue-by-dolce-gabbana-cologne-for-men-eau-de-toilette-spray-42-oz.html">Light Blue Cologne</a></li> <br> </tr> </td> <br> <br> <table border="0" width="100%" Height="300"> <tr> <td bgcolor="#ffffff" height="20"></td> </tr> </table> <br> </ul></td></tr> </table> <tr> <td> <img height="10" alt="" src="/skin1/images/m20.gif" width="210" border="0"> </td></tr> <tr><td height="4"> </td> </tr> </table> <br /> <br /> <br /> <br /> </td> <td width="4">&nbsp;</td> <td valign="top" width="100%"> <!-- central space --> <p /> <table cellSpacing="0" cellPadding="0" width="90%" border="0"> <tr> <td> <table cellSpacing="0" cellPadding="0" width="100%" border="0"><tr><td width="5"></td><td><img src="./images/P/fahrenheitmen.jpg" align="left"><img height="170" src="./images/P/cleardot.gif" width="10" align="left"><font class="fstx3">Fahrenheit Cologne</font><p><font class="mnml6">Christian Dior introduced Fahrenheit in 1988. This fine fragrance contains bergamot, lemon, lavender and is accented with violet, cedar and leather. Fahrenheit is perfect for casual and formal use. </font></tr></td></table> </tr> </td> </table> <table cellSpacing="0" cellPadding="0" width="100%" border="0"> <tr><td width="5"></td> <td valign="top"> <div class="acr-general-product-rating"> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <meta itemprop="ratingValue" content="5" /> <meta itemprop="bestRating" content="5" /> <meta itemprop="reviewCount" content="5" /> </div> <table class="acr-container"> <tr> <td class="left-indent">&nbsp;</td> <td class="rating-box"> <div style="width: 110px"> <div class="acr-rating-box rating"> <script type="text/javascript" src="/skin1/modules/Advanced_Customer_Reviews/vote_bar.js"></script> <script type="text/javascript"> <!-- var stars_cost = 20; --> </script> <div class="acr-vote-bar vote-bar-cat-4641 acr-allow-add-rate" title=""> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> </div> </div></div> </td> <td class="dropdown-button" title="Click to view detailed information"> <a href="/get_category_ratings.php?categoryid=4641"><img src="/skin1/images/acr_reviews_dropout_down.png" alt="" /></a> </td> <td class="comment" nowrap="nowrap"> (<a href="/perfume/fahrenheit#acr_bottom">5 reviews</a>) </td> <td class="right-indent">&nbsp;</td> </tr> <tr> <td class="left-indent"></td> <td colspan="3"><div class="acr-static-popup-container"></div></td> <td class="right-indent"></td> </tr> </table> </div> <br /> <table cellSpacing="0" cellPadding="1" width="720" border="0"> <tr class="fsHeadLine"> <td class="navblack" noWrap align="left" height="20">&nbsp;</td> <td class="navblack" noWrap align="left">SKU</td> <td class="navblack" noWrap align="left">PICTURE</td> <td class="navblack" noWrap align="left">DESCRIPTION</td> <td class="navblack" noWrap align="left">RETAIL</td> <td class="navblack" noWrap align="left"><font color="#CC0000"><b>SALE PRICE</b></font></td> <td class="navblack" noWrap align="left">ADD TO CART</td> </tr> <tr> <td bgColor="#999999"> <img height="1" hspace="0" src="./images/C/fsp2.gif" width="1" border="0"></td> <td bgColor="#999999"> <img height="1" hspace="0" src="./images/C/fsp2.gif" width="75" border="0"></td> <td bgColor="#999999"> <img height="1" hspace="0" src="./images/C/fsp2.gif" width="87" border="0"></td> <td bgColor="#999999"> <img height="1" hspace="0" src="./images/C/fsp2.gif" width="253" border="0"></td> <td bgColor="#999999"> <img height="1" hspace="0" src="./images/C/fsp2.gif" width="100" border="0"></td> <td bgColor="#999999"> <img height="1" hspace="0" src="./images/C/fsp2.gif" width="100" border="0"></td> <td bgColor="#999999"> <img height="1" hspace="0" src="./images/C/fsp2.gif" width="104" border="0"></td> </tr> <tr> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2">&nbsp;</font></td> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2"> <font class="mnml6"> CMB25332</font> </td> <td> <a title="Fahrenheit by Christian Dior for Men After Shave 3.3 oz" href="/fahrenheit-by-christian-dior-for-men-after-shave-3.3-oz.html"><img src="http://www.fragranceshop.com/images/T/25332.jpg"width="60" height="60" border="0" alt="Fahrenheit by Christian Dior for Men After Shave 3.3 oz" /></a> </td> </td><td><font class="mnml6"> Fahrenheit by Christian Dior for Men After Shave 3.3 oz </td> </font></td> <td><font class="mnml6"> NA</font></td> <td><font size="3"> <br> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;70.95 </span> </STRIKE> </font><br> <font class="mnml6"><STRIKE> </font></STRIKE><br> <br> <font color="#CC0000"><font size="3"><b> &#36;46.12 </font></b><br> <font class="MarketPrice"> <span id="product_alt_price" style="white-space: nowrap;"><b> </span></font> <br> <b> <font size="2" color="#cc0000"><a tooltip="Use coupon code FW35 at checkout to receive this price" title="Use coupon code FW35 at checkout to receive this price" class="tooltip-above"><u><span title="">with coupon*</span></u></a></font></b> <br> </td> <form name="orderform_32057_1381015678" method="post" action="cart.php?mode=add"> <input type="hidden" name="productid" value="32057" /> <input type="hidden" name="cat" value="" /> <input type="hidden" name="page" value="" /> <input type="hidden" name="amount" value="1" /> </td> <td vAlign="middle"> <table cellspacing="0" cellpadding="0" onclick="javascript: document.orderform_32057_1381015678.submit();" class="ButtonTable"> <tr><td><img src="/skin1/images//but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Add to cart</font></td><td><img src="/skin1/images//but2.gif" class="ButtonSide" alt="" /></td></tr> </table> </td> </td> </form> <tr><td colSpan="7"> <img height="1" src="./images/C/fs_p.gif" width="100%"> <tr> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2">&nbsp;</font></td> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2"> <font class="mnml6"> FB42821</font> </td> <td> <a title="Fahrenheit by Christian Dior After Shave Balm 2.3 oz for Men" href="/fahrenheit-by-christian-dior-after-shave-balm-2.3-oz-for-men.html"><img src="http://www.fragranceshop.com/images/T/fb42821-01.jpg"width="60" height="60" border="0" alt="Fahrenheit by Christian Dior After Shave Balm 2.3 oz for Men" /></a> </td> </td><td><font class="mnml6"> Fahrenheit by Christian Dior After Shave Balm 2.3 oz for Men </td> </font></td> <td><font class="mnml6"> NA</font></td> <td><font size="3"> <br> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;72.95 </span> </STRIKE> </font><br> <font class="mnml6"><STRIKE> </font></STRIKE><br> <br> <font color="#CC0000"><font size="3"><b> &#36;47.42 </font></b><br> <font class="MarketPrice"> <span id="product_alt_price" style="white-space: nowrap;"><b> </span></font> <br> <b> <font size="2" color="#cc0000"><a tooltip="Use coupon code FW35 at checkout to receive this price" title="Use coupon code FW35 at checkout to receive this price" class="tooltip-above"><u><span title="">with coupon*</span></u></a></font></b> <br> </td> <form name="orderform_41051_1461982521" method="post" action="cart.php?mode=add"> <input type="hidden" name="productid" value="41051" /> <input type="hidden" name="cat" value="" /> <input type="hidden" name="page" value="" /> <input type="hidden" name="amount" value="1" /> </td> <td vAlign="middle"> <table cellspacing="0" cellpadding="0" onclick="javascript: document.orderform_41051_1461982521.submit();" class="ButtonTable"> <tr><td><img src="/skin1/images//but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Add to cart</font></td><td><img src="/skin1/images//but2.gif" class="ButtonSide" alt="" /></td></tr> </table> </td> </td> </form> <tr><td colSpan="7"> <img height="1" src="./images/C/fs_p.gif" width="100%"> <tr> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2">&nbsp;</font></td> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2"> <font class="mnml6"> FL290</font> </td> <td> <a title="Fahrenheit Type Perfume Oil for Men 1/3 oz Roll-on" href="/fahrenheit-type_perfume-oil-for-men-1-3-oz-roll-on.html"><img src="http://www.fragranceshop.com/images/T/perfume_oil-190.jpg"width="60" height="60" border="0" alt="Fahrenheit Type Perfume Oil for Men 1/3 oz Roll-on" /></a> </td> </td><td><font class="mnml6"> Fahrenheit Type Perfume Oil for Men 1/3 oz Roll-on </td> </font></td> <td><font class="mnml6"> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;25.00 </span> </STRIKE></font></td> <td><font size="3"> <br> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;11.95 </span> </STRIKE> </font><br> <font class="mnml6"><STRIKE> </font></STRIKE><br> <br> <font color="#CC0000"><font size="3"><b> &#36;7.77 </font></b><br> <font class="MarketPrice"> <span id="product_alt_price" style="white-space: nowrap;"><b> </span></font> <br> <b> <font size="2" color="#cc0000"><a tooltip="Use coupon code FW35 at checkout to receive this price" title="Use coupon code FW35 at checkout to receive this price" class="tooltip-above"><u><span title="">with coupon*</span></u></a></font></b> <br> </td> <form name="orderform_31557_1182920261" method="post" action="cart.php?mode=add"> <input type="hidden" name="productid" value="31557" /> <input type="hidden" name="cat" value="" /> <input type="hidden" name="page" value="" /> <input type="hidden" name="amount" value="1" /> </td> <td vAlign="middle"> <table cellspacing="0" cellpadding="0" onclick="javascript: document.orderform_31557_1182920261.submit();" class="ButtonTable"> <tr><td><img src="/skin1/images//but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Add to cart</font></td><td><img src="/skin1/images//but2.gif" class="ButtonSide" alt="" /></td></tr> </table> </td> </td> </form> <tr><td colSpan="7"> <img height="1" src="./images/C/fs_p.gif" width="100%"> <tr> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2">&nbsp;</font></td> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2"> <font class="mnml6"> FS583</font> </td> <td> <a title="Fahrenheit by Christian Dior for Men Eau de Toilette Spray 3.4 oz" href="/discount-perfume/fahrenheit-by-christian-dior-cologne-for-men-eau-de-toilette-spray-34-oz.html"><img src="http://www.fragranceshop.com/images/T/fahrenheitmen.jpg"width="60" height="60" border="0" alt="Fahrenheit by Christian Dior for Men Eau de Toilette Spray 3.4 oz" /></a> </td> </td><td><font class="mnml6"> Fahrenheit by Christian Dior for Men Eau de Toilette Spray 3.4 oz </td> </font></td> <td><font class="mnml6"> NA</font></td> <td><font size="3"> <br> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;98.95 </span> </STRIKE> </font><br> <font class="mnml6"><STRIKE> </font></STRIKE><br> <br> <font color="#CC0000"><font size="3"><b> &#36;64.32 </font></b><br> <font class="MarketPrice"> <span id="product_alt_price" style="white-space: nowrap;"><b> </span></font> <br> <b> <font size="2" color="#cc0000"><a tooltip="Use coupon code FW35 at checkout to receive this price" title="Use coupon code FW35 at checkout to receive this price" class="tooltip-above"><u><span title="">with coupon*</span></u></a></font></b> <br> </td> <form name="orderform_18765_1182920261" method="post" action="cart.php?mode=add"> <input type="hidden" name="productid" value="18765" /> <input type="hidden" name="cat" value="" /> <input type="hidden" name="page" value="" /> <input type="hidden" name="amount" value="1" /> </td> <td vAlign="middle"> <table cellspacing="0" cellpadding="0" onclick="javascript: document.orderform_18765_1182920261.submit();" class="ButtonTable"> <tr><td><img src="/skin1/images//but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Add to cart</font></td><td><img src="/skin1/images//but2.gif" class="ButtonSide" alt="" /></td></tr> </table> </td> </td> </form> <tr><td colSpan="7"> <img height="1" src="./images/C/fs_p.gif" width="100%"> <tr> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2">&nbsp;</font></td> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2"> <font class="mnml6"> FS582</font> </td> <td> <a title="Fahrenheit by Christian Dior for Men Eau de Toilette Spray 1.7 oz" href="/discount-perfume/fahrenheit-by-christian-dior-cologne-for-men-eau-de-toilette-spray-17-oz.html"><img src="http://www.fragranceshop.com/images/T/fahrenheitmen.jpg"width="60" height="60" border="0" alt="Fahrenheit by Christian Dior for Men Eau de Toilette Spray 1.7 oz" /></a> </td> </td><td><font class="mnml6"> Fahrenheit by Christian Dior for Men Eau de Toilette Spray 1.7 oz </td> </font></td> <td><font class="mnml6"> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;75.00 </span> </STRIKE></font></td> <td><font size="3"> <br> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;74.95 </span> </STRIKE> </font><br> <font class="mnml6"><STRIKE> </font></STRIKE><br> <br> <font color="#CC0000"><font size="3"><b> &#36;48.72 </font></b><br> <font class="MarketPrice"> <span id="product_alt_price" style="white-space: nowrap;"><b> </span></font> <br> <b> <font size="2" color="#cc0000"><a tooltip="Use coupon code FW35 at checkout to receive this price" title="Use coupon code FW35 at checkout to receive this price" class="tooltip-above"><u><span title="">with coupon*</span></u></a></font></b> <br> </td> <form name="orderform_18764_1182920261" method="post" action="cart.php?mode=add"> <input type="hidden" name="productid" value="18764" /> <input type="hidden" name="cat" value="" /> <input type="hidden" name="page" value="" /> <input type="hidden" name="amount" value="1" /> </td> <td vAlign="middle"> <table cellspacing="0" cellpadding="0" onclick="javascript: document.orderform_18764_1182920261.submit();" class="ButtonTable"> <tr><td><img src="/skin1/images//but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Add to cart</font></td><td><img src="/skin1/images//but2.gif" class="ButtonSide" alt="" /></td></tr> </table> </td> </td> </form> <tr><td colSpan="7"> <img height="1" src="./images/C/fs_p.gif" width="100%"> <tr> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2">&nbsp;</font></td> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2"> <font class="mnml6"> FL2190</font> </td> <td> <a title="Fahrenheit Type Perfume Oil for Men 1 oz Roll-on" href="/fahrenheit-type_perfume-oil-for-men-1-oz-roll-on.html"><img src="http://www.fragranceshop.com/images/T/perfume_oil_1oz-190.jpg"width="60" height="60" border="0" alt="Fahrenheit Type Perfume Oil for Men 1 oz Roll-on" /></a> </td> </td><td><font class="mnml6"> Fahrenheit Type Perfume Oil for Men 1 oz Roll-on </td> </font></td> <td><font class="mnml6"> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;45.00 </span> </STRIKE></font></td> <td><font size="3"> <br> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;16.95 </span> </STRIKE> </font><br> <font class="mnml6"><STRIKE> </font></STRIKE><br> <br> <font color="#CC0000"><font size="3"><b> &#36;11.02 </font></b><br> <font class="MarketPrice"> <span id="product_alt_price" style="white-space: nowrap;"><b> </span></font> <br> <b> <font size="2" color="#cc0000"><a tooltip="Use coupon code FW35 at checkout to receive this price" title="Use coupon code FW35 at checkout to receive this price" class="tooltip-above"><u><span title="">with coupon*</span></u></a></font></b> <br> </td> <form name="orderform_32426_1182920261" method="post" action="cart.php?mode=add"> <input type="hidden" name="productid" value="32426" /> <input type="hidden" name="cat" value="" /> <input type="hidden" name="page" value="" /> <input type="hidden" name="amount" value="1" /> </td> <td vAlign="middle"> <table cellspacing="0" cellpadding="0" onclick="javascript: document.orderform_32426_1182920261.submit();" class="ButtonTable"> <tr><td><img src="/skin1/images//but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Add to cart</font></td><td><img src="/skin1/images//but2.gif" class="ButtonSide" alt="" /></td></tr> </table> </td> </td> </form> <tr><td colSpan="7"> <img height="1" src="./images/C/fs_p.gif" width="100%"> <tr> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2">&nbsp;</font></td> <td bgColor="#ffffff"><font face="Verdana, Helvetica, Arial" size="2"> <font class="mnml6"> FS7187</font> </td> <td> <a title="Fahrenheit by Christian Dior for Men Eau de Toilette Spray 6.7 oz" href="/discount-perfume/fahrenheit-by-christian-dior-cologne-for-men-eau-de-toilette-spray-67-oz.html"><img src="http://www.fragranceshop.com/images/T/7187.jpg"width="60" height="60" border="0" alt="Fahrenheit by Christian Dior for Men Eau de Toilette Spray 6.7 oz" /></a> </td> </td><td><font class="mnml6"> Fahrenheit by Christian Dior for Men Eau de Toilette Spray 6.7 oz </td> </font></td> <td><font class="mnml6"> NA</font></td> <td><font size="3"> <br> <STRIKE> <span style="WHITE-SPACE: nowrap">&#36;131.95 </span> </STRIKE> </font><br> <font class="mnml6"><STRIKE> </font></STRIKE><br> <br> <font color="#CC0000"><font size="3"><b> &#36;85.77 </font></b><br> <font class="MarketPrice"> <span id="product_alt_price" style="white-space: nowrap;"><b> </span></font> <br> <b> <font size="2" color="#cc0000"><a tooltip="Use coupon code FW35 at checkout to receive this price" title="Use coupon code FW35 at checkout to receive this price" class="tooltip-above"><u><span title="">with coupon*</span></u></a></font></b> <br> </td> <form name="orderform_18980_1182920261" method="post" action="cart.php?mode=add"> <input type="hidden" name="productid" value="18980" /> <input type="hidden" name="cat" value="" /> <input type="hidden" name="page" value="" /> <input type="hidden" name="amount" value="1" /> </td> <td vAlign="middle"> <table cellspacing="0" cellpadding="0" onclick="javascript: document.orderform_18980_1182920261.submit();" class="ButtonTable"> <tr><td><img src="/skin1/images//but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Add to cart</font></td><td><img src="/skin1/images//but2.gif" class="ButtonSide" alt="" /></td></tr> </table> </td> </td> </form> <tr><td colSpan="7"> <img height="1" src="./images/C/fs_p.gif" width="100%"> <br /> <a name="acr_bottom"></a> <table cellspacing="0" width="100%"> <tr> <td class="fstx3">Customer feedback</td> </tr> <tr><td class="DialogBorder"><table cellspacing="1" class="DialogBox"> <tr><td class="DialogBox" valign="top"> <div class="acr-product-tab-summary"> <b>Average customer rating</b>: <div class="acr-general-product-rating"> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <meta itemprop="ratingValue" content="5" /> <meta itemprop="bestRating" content="5" /> <meta itemprop="reviewCount" content="5" /> </div> <table class="acr-container"> <tr> <td class="left-indent">&nbsp;</td> <td class="rating-box"> <div style="width: 110px"> <div class="acr-rating-box rating"> <script type="text/javascript" src="/skin1/modules/Advanced_Customer_Reviews/vote_bar.js"></script> <script type="text/javascript"> <!-- var stars_cost = 20; --> </script> <div class="acr-vote-bar vote-bar-cat-4641 acr-allow-add-rate" title=""> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> </div> </div></div> </td> <td class="dropdown-button" title="Click to view detailed information"> <a href="/get_category_ratings.php?categoryid=4641"><img src="/skin1/images/acr_reviews_dropout_down.png" alt="" /></a> </td> <td class="comment" nowrap="nowrap"> (<a href="reviews.php?categoryid=4641">5 reviews</a>) </td> <td class="right-indent">&nbsp;</td> </tr> <tr> <td class="left-indent"></td> <td colspan="3"><div class="acr-static-popup-container"></div></td> <td class="right-indent"></td> </tr> </table> </div> <div class="clearing"></div><br /> <table cellspacing="0" cellpadding="0" onclick="javascript: self.location='add_review.php?categoryid=4641';" class="ButtonTable"> <tr><td><img src="/skin1/images/but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Add your own review</font></td><td><img src="/skin1/images/but2.gif" class="ButtonSide" alt="" /></td></tr> </table> <br /> <div class="clearing"></div> <br /> <span class="acr-reviews-order"> 5 Most recent customer reviews (<a href="reviews.php?categoryid=4641">see all reviews</a>): </span> </div> <div class="acr-reviews-list"> <div class="acr-review"> <a name="review442"></a> <div class="acr-author"> <b>dmitsar </b> </div> <div class="acr-date">Jul 13, 2014</div> <div class="clearing"></div> <div class="acr-verified"> <img border="0" src="./images/badge_vb.gif" width="84" height="21"> </div> <div class="acr-rating"> <div class="acr-rating-box rating"> <div class="acr-vote-bar" title="5 out of 5"> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> </div> </div> <div class="clearing"></div> </div> <div class="acr-message"> <i><b><font size="1">Comments about :</font></b></i> <br /><br /> Great product </div> </div> <div class="acr-line"></div> <div class="acr-review"> <a name="review737"></a> <div class="acr-author"> <b>secretaru </b> </div> <div class="acr-date">Aug 15, 2014</div> <div class="clearing"></div> <div class="acr-verified"> <img border="0" src="./images/badge_vb.gif" width="84" height="21"> </div> <div class="acr-rating"> <div class="acr-rating-box rating"> <div class="acr-vote-bar" title="5 out of 5"> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> </div> </div> <div class="clearing"></div> </div> <div class="acr-message"> <i><b><font size="1">Comments about :</font></b></i> <br /><br /> just buy it </div> </div> <div class="acr-line"></div> <div class="acr-review"> <a name="review4401"></a> <div class="acr-author"> <b>Bug </b> </div> <div class="acr-date">Oct 16, 2014</div> <div class="clearing"></div> <div class="acr-verified"> <img border="0" src="./images/badge_vb.gif" width="84" height="21"> </div> <div class="acr-rating"> <div class="acr-rating-box rating"> <div class="acr-vote-bar" title="5 out of 5"> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> </div> </div> <div class="clearing"></div> </div> <div class="acr-message"> <i><b><font size="1">Comments about :</font></b></i> <br /><br /> Love the smell of it on my Man! </div> </div> <div class="acr-line"></div> <div class="acr-review"> <a name="review4431"></a> <div class="acr-author"> <b>Alexandr-ice </b> </div> <div class="acr-date">Oct 19, 2014</div> <div class="clearing"></div> <div class="acr-verified"> <img border="0" src="./images/badge_vb.gif" width="84" height="21"> </div> <div class="acr-rating"> <div class="acr-rating-box rating"> <div class="acr-vote-bar" title="5 out of 5"> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> </div> </div> <div class="clearing"></div> </div> <div class="acr-message"> <i><b><font size="1">Comments about :</font></b></i> <br /><br /> That said, a pleasure to do business with you. All the conditions are met perfectly! Aroma wonder! Will definitely have to order your products! Thank you! </div> </div> <div class="acr-line"></div> <div class="acr-review"> <a name="review6164"></a> <div class="acr-author"> <b>Samuel Perez</b> </div> <div class="acr-date">Feb 19, 2016</div> <div class="clearing"></div> <div class="acr-rating"> <div class="acr-rating-box rating"> <div class="acr-vote-bar" title="5 out of 5"> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> <span class="full"> </span> </div> </div> <div class="clearing"></div> </div> <div class="acr-message"> <i><b><font size="1">Comments about :</font></b></i> <br /><br /> Was skeptical to order at first due to some neutral reviews posted online, but I was glad I did. I order Fahrenheit by Dior mens Perfume 6.8 oz and I then compare it to the same cologne and size at retail store which was selling it for much more, and I happy to inform that the Fahrenheit I received from Fragranceshop is 100% legit not a fake or counterfeit. All the Markings on the box and bottle as well as Manufacture Date match perfectly to the original product. This is a great smelling Perfume with hours of longevity and tremendous Projection. I highly recommend buying from Fragranceshop they sell legit 100% Authentic product and ships super quick, I will definite be buying from them again. </div> </div> <div class="acr-line"></div> </div> <table cellspacing="0" cellpadding="0" onclick="javascript: self.location='add_review.php?categoryid=4641';" class="ButtonTable"> <tr><td><img src="/skin1/images/but1.gif" class="ButtonSide" alt="" /></td><td class="Button"><font class="Button">Add your own review</font></td><td><img src="/skin1/images/but2.gif" class="ButtonSide" alt="" /></td></tr> </table> <br /> <div class="clearing"></div> </td></tr> </table></td></tr> </table> <br /> </td></tr></table> </td></tr></table> <br /> <br /> <!-- /central space --> </td> <td width="20">&nbsp;</td> </tr> </table> <hr> <table border="0" width="100%"> <tr> <td width="3%">&nbsp;</td> <td width="30%" valign="top"><p class="fsntx3" align="left"><b>CUSTOMER SERVICE</p></b></td> <td width="3%">&nbsp;</td> <td width="30%" valign="top" colspan="2"><p class="fsntx3" align="left"><b>FEATURED BRANDS</p></b></td> <td width="3%">&nbsp;</td> <td width="31%" valign="top"><p class="fsntx3" align="left"><b>CONNECT WITH US</p></b></td> </tr> <tr> <td width="100%" valign="top" colspan="7"><hr></td> </tr> <tr> <td>&nbsp;</td> <td valign="top"><p class="fsntx4" align="left"> <b></b> <br> <br> <a class="fsnml1" href="/help.php?section=contactus&mode=update"></a> <br> <br> <a class="fsnml1" href="/pages.php?pageid=5#q3">Shipping Rates</a> <br> <a class="fsnml1" href="/help.php?section=Login">Order Status</a> <br> <a class="fsnml1" href="/pages.php?pageid=6#q3">Return Policy</a> <br> <a class="fsnml1" href="/pages.php?pageid=6#q2">Security Guarantee</a> <br> <a class="fsnml1" href="/help.php?section=Login">Privac</a><a class="fsnml1" href="/help.php?section=business">y Policy </a> <br> <a class="fsnml1" href="/about-us.html">About us</a> <br> <a class="fsnml1" href="http://www.fragranceshopwholesale.com/pages.php?pageid=13">Wholesale Information</a> <br> <a class="fsnml1" href="/help.php">FAQ's</a> <br> <a class="fsnml1" href="/affiliate_program.html">Affiliate Program</a> <br> <a class="fsnml1" href="/help.php?section=contactus&mode=update">Contact us</a> </td> <td><img height="250" src="./images/C/fs_p.gif" width="1"></td> <td valign="top"> <a class="fsnml1" href="/alfred-sung/?sort_direction=1">Alfred Sung</a> <br> <a class="fsnml1" href="/burberry/?sort_direction=1">Burberry</a> <br> <a class="fsnml1" href="/bvlgari/?sort_direction=1">Bvlgari</a> <br> <a class="fsnml1" href="/calvin-klein/?sort_direction=1">Calvin Klein </a> <br> <a class="fsnml1" href="/carolina-herrera/?sort_direction=1">Carolina Herrera</a> <br> <a class="fsnml1" href="/christian-dior/?sort_direction=1">Christian Dior</a> <br> <a class="fsnml1" href="/dolce-gabbana/?sort_direction=1">Dolce & Gabbana</a> <br> <a class="fsnml1" href="/donna-karan/?sort_direction=1">Donna Karan</a> <br> <a class="fsnml1" href="/ed-hardy/?sort_direction=1">Ed Hardy</a> <br> <a class="fsnml1" href="/escada/?sort_direction=1">Escada</a> <br> <a class="fsnml1" href="/estee-lauder/?sort_direction=1">Estee Lauder</a> <br> <a class="fsnml1" href="/giorgio-armani/?sort_direction=1">Giorgio Armani</a> <br> <a class="fsnml1" href="/givenchy/?sort_direction=1">Givenchy</a> <br> </td> <td valign="top"> <a class="fsnml1" href="/gucci/?sort_direction=1">Gucci</a> <br> <a class="fsnml1" href="/hugo-boss/?sort_direction=1">Hugo Boss</a> <br> <a class="fsnml1" href="/jean-paul-gaultier/?sort_direction=1">Jean Paul Gaultier</a> <br> <a class="fsnml1" href="/kenzo/?sort_direction=1">Kenzo</a> <br> <a class="fsnml1" href="/lancome/?sort_direction=1">Lancome</a> <br> <a class="fsnml1" href="/liz-claiborne/?sort_direction=1">Liz Claiborne</a> <br> <a class="fsnml1" href="/michael-kors/?sort_direction=1">Michael Kors</a> <br> <a class="fsnml1" href="/nina-ricci/?sort_direction=1">Nina Ricci</a> <br> <a class="fsnml1" href="/oscar-de-la-renta/?sort_direction=1">Oscar de la renta</a> <br> <a class="fsnml1" href="/ralph-lauren/?sort_direction=1">Ralph Lauren</a> <br> <a class="fsnml1" href="/thierry-mugler/?sort_direction=1">Thierry Mugler</a> <br> <a class="fsnml1" href="/versace/?sort_direction=1">Versace</a> <br> <a class="fsnml1" href="/manufacturers.php">More...</a> <br> </td> <td><img height="250" src="./images/C/fs_p.gif" width="1"></td> <td valign="top"> <form action="news.php" name="subscribeform" method="post"> <input type="hidden" name="subscribe_lng" value="US" /> <table> <tr> <td><p class="fsntx4" align="left"> Join our coupon list: <br /> <input type="text" name="newsemail" size="30" /><br /> <table cellspacing="0" class="SimpleButton"><tr><td><a class="VertMenuItems" href="javascript: document.subscribeform.submit();"><font class="VertMenuItems">Subscribe&nbsp;</font></a></td><td><a class="VertMenuItems" href="javascript: document.subscribeform.submit();"><img src="/skin1/images/go_menu.gif" class="GoImage" alt="" /></a></td></tr></table> </td> </tr> </table> </form> <br> <br> <a href="https://www.facebook.com/FragranceShopCom"> <img src="../images/fs_facebook2.gif"></a> <a class="fsnml1" href="https://www.facebook.com/FragranceShopCom">Like us on Facebook</a> <br> <br> <a href="https://twitter.com/FragranceShopNJ"> <img src="../images//fs_twitter2.gif"></a> <a class="fsnml1" href="https://twitter.com/FragranceShopNJ">Follow us on Twitter</a> <br> <br> <a href="https://www.pinterest.com/FragranceShopNJ"> <img src="../images/fs_pinterest2.gif"></a> <a class="fsnml1" href="https://www.pinterest.com/FragranceShopNJ">Follow us on Pinterest</a> <br> <br> <a href="https://plus.google.com/+Fragranceshopcom/posts"> <img src="../images/fs_googlep2.gif"></a> <a class="fsnml1" href="https://plus.google.com/+Fragranceshopcom/posts">Follow us on Google+</a> <br> <br> <a href="https://instagram.com/fragranceshopcom/"> <img src="../images/fs_instagram.jpg"></a> <a class="fsnml1" href="https://instagram.com/fragranceshopcom/">Follow us on Instagram</a> <br> <br> </td> </tr> </table> <hr> <table border="0" width="100%"> <tr> <td width="3%">&nbsp;</td> <td width="50%"> <img src="../images/fscreditcards.jpg" alt="We accept Visa, MasterCard, Discover, American Express, Diners Club and JCB"> </td> <td width="47" align=right> <img src="../images/fsseals.jpg" alt="We accept Visa, MasterCard, Discover, American Express, Diners Club and JCB"> </tr> </td> </table> <hr> <table border="0" width="100%"> <tr> <td width="3%">&nbsp;</td> <td width="97%"> <br \> Copyright &copy; 1998-2017 FragranceShop.com. All rights reserved.</tr> </td> </table> <br> <br> <!-- FSR --> <script type="text/javascript"> var google_tag_params = { ecomm_prodid:"", ecomm_pagetype: "product", ecomm_totalvalue: "" }; </script> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = 1069199960; var google_custom_params = window.google_tag_params; var google_remarketing_only = true; /* ]]> */ </script> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/1069199960/?value=0&amp;guid=ON&amp;script=0"/> </div> </noscript> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-1322691-2', 'auto',{'legacyCookieDomain': 'fragranceshop.com'}); ga('require', 'displayfeatures'); ga('set','dimension1','32057,41051,31557'); ga('set','dimension2','productlist'); ga('set','dimension3','70.95,72.95,11.95'); ga('send', 'pageview'); </script> <script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script> <script type="text/javascript"> window.criteo_q = window.criteo_q || []; var deviceType = /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile/.test(navigator.userAgent) ? "m" : "d"; window.criteo_q.push( { event: "setAccount", account: 19157}, { event: "setSiteType", type: deviceType}, { event: "setHashedEmail", email: [""]}, { event: "viewList", item: ["CMB25332","FB42821","FL290"]}); </script> <script type="text/javascript" src="/jq/jquery-ui.min.js"></script> <script type="text/javascript"> $(function() { //autocomplete $(".auto").autocomplete({ source: "msearch.php", minLength: 3, select: function(event, ui) { if(ui.item){ $(event.target).val(ui.item.value); } //submit the form $(event.target.form).submit(); } }); }); </script> </body> </html>
{ "content_hash": "ce08e80b44a6bd6ab15740cc391db26b", "timestamp": "", "source": "github", "line_count": 1822, "max_line_length": 708, "avg_line_length": 34.6569703622393, "alnum_prop": 0.5901496555546758, "repo_name": "todor-dk/HTML-Renderer", "id": "ff93fc9e5764d86567c23b774e492fa6c2659a66", "size": "63145", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/Testing/HtmlRenderer.ExperimentalApp/Data/Files/fahrenheit/BC903215C475D12740608AB10B7D5C3C.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "690" }, { "name": "Batchfile", "bytes": "7229" }, { "name": "C#", "bytes": "2654781" }, { "name": "HTML", "bytes": "2938670481" }, { "name": "JavaScript", "bytes": "51318" }, { "name": "PowerShell", "bytes": "2715" } ], "symlink_target": "" }
<?php namespace CRUDlex; /** * An interface used by the {@see ServiceProvider} to construct * {@see Data} instances. By implementing this and handing it into * the service provider, the user can control what database (-variation) he * wants to use. */ interface DataFactoryInterface { /** * Creates instances. * * @param EntityDefinition $definition * the definition of the entities managed by the to be created instance * @param FileProcessorInterface $fileProcessor * the file processor managing uploaded files * * @return AbstractData * the newly created instance */ public function createData(EntityDefinition $definition, FileProcessorInterface $fileProcessor); }
{ "content_hash": "183accc2a46bd991e5cb5b6b3dc89678", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 100, "avg_line_length": 26.357142857142858, "alnum_prop": 0.7073170731707317, "repo_name": "thomas-lange-smf/CRUDlex", "id": "add07514613a88a91ff7d23a6bb4b9fc83160704", "size": "971", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/CRUDlex/DataFactoryInterface.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "414" }, { "name": "HTML", "bytes": "53283" }, { "name": "PHP", "bytes": "262801" } ], "symlink_target": "" }
@ECHO OFF SET COMPOSE_FILE_PATH=%CD%\target\classes\docker\docker-compose.yml IF [%M2_HOME%]==[] ( SET MVN_EXEC=mvn ) IF NOT [%M2_HOME%]==[] ( SET MVN_EXEC=%M2_HOME%\bin\mvn ) IF [%1]==[] ( echo "Usage: %0 {build_start|build_start_it_supported|start|stop|purge|tail|build_test|test}" GOTO END ) IF %1==build_start ( CALL :down CALL :build CALL :start CALL :tail GOTO END ) IF %1==build_start_it_supported ( CALL :down CALL :build CALL :prepare_test CALL :start CALL :tail GOTO END ) IF %1==start ( CALL :start CALL :tail GOTO END ) IF %1==stop ( CALL :down GOTO END ) IF %1==purge ( CALL:down CALL:purge GOTO END ) IF %1==tail ( CALL :tail GOTO END ) IF %1==build_test ( CALL :down CALL :build CALL :prepare_test CALL :start CALL :test CALL :tail_all CALL :down GOTO END ) IF %1==test ( CALL :test GOTO END ) echo "Usage: %0 {build_start|start|stop|purge|tail|build_test|test}" :END EXIT /B %ERRORLEVEL% :start docker volume create ${rootArtifactId}-acs-volume docker volume create ${rootArtifactId}-db-volume docker volume create ${rootArtifactId}-ass-volume docker-compose -f "%COMPOSE_FILE_PATH%" up --build -d EXIT /B 0 :down if exist "%COMPOSE_FILE_PATH%" ( docker-compose -f "%COMPOSE_FILE_PATH%" down ) EXIT /B 0 :build call %MVN_EXEC% clean package EXIT /B 0 :tail docker-compose -f "%COMPOSE_FILE_PATH%" logs -f EXIT /B 0 :tail_all docker-compose -f "%COMPOSE_FILE_PATH%" logs --tail="all" EXIT /B 0 :prepare_test call %MVN_EXEC% verify -DskipTests=true EXIT /B 0 :test call %MVN_EXEC% verify EXIT /B 0 :purge docker volume rm -f ${rootArtifactId}-acs-volume docker volume rm -f ${rootArtifactId}-db-volume docker volume rm -f ${rootArtifactId}-ass-volume EXIT /B 0
{ "content_hash": "3731ca31a67698f24867864e45ad233a", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 97, "avg_line_length": 19.98989898989899, "alnum_prop": 0.5977766548762001, "repo_name": "abhinavmishra14/alfresco-sdk", "id": "e735564a31075be537b02a143a696a2a03f4ac76", "size": "2009", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "archetypes/alfresco-platform-jar-archetype/src/main/resources/archetype-resources/run.bat", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "7149" }, { "name": "CSS", "bytes": "364" }, { "name": "Dockerfile", "bytes": "3339" }, { "name": "FreeMarker", "bytes": "2098" }, { "name": "Groovy", "bytes": "360" }, { "name": "HTML", "bytes": "114" }, { "name": "Java", "bytes": "180669" }, { "name": "JavaScript", "bytes": "3222" }, { "name": "Shell", "bytes": "6365" } ], "symlink_target": "" }
import random from Pyro5.api import expose, oneway @expose class GameServer(object): def __init__(self, engine): self.engine = engine def register(self, name, observer): robot = self.engine.signup_robot(name, observer) self._pyroDaemon.register(robot) # make the robot a pyro object return robot @expose class RemoteBot(object): def __init__(self, robot, engine): self.robot = robot self.engine = engine def get_data(self): return self.robot def change_direction(self, direction): self.robot.dx, self.robot.dy = direction def emote(self, text): self.robot.emote(text) def terminate(self): self.engine.remove_robot(self.robot) @expose class LocalGameObserver(object): def __init__(self, name): self.name = name self.robot = None @oneway def world_update(self, iteration, world, robotdata): # change directions randomly if random.random() > 0.8: if random.random() >= 0.5: dx, dy = random.randint(-1, 1), 0 else: dx, dy = 0, random.randint(-1, 1) self.robot.change_direction((dx, dy)) def start(self): self.robot.emote("Here we go!") def victory(self): print("[%s] I WON!!!" % self.name) def death(self, killer): if killer: print("[%s] I DIED (%s did it)" % (self.name, killer.name)) else: print("[%s] I DIED" % self.name) @expose class GameObserver(object): def world_update(self, iteration, world, robotdata): pass def start(self): print("Battle starts!") def victory(self): print("I WON!!!") def death(self, killer): print("I DIED") if killer: print("%s KILLED ME :(" % killer.name)
{ "content_hash": "1a1ed4e37ce55f4ac603d815a2cd6a84", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 72, "avg_line_length": 23.858974358974358, "alnum_prop": 0.5706609349811929, "repo_name": "irmen/Pyro5", "id": "a7cdb4f3b9a81a3b0a0ff0077c71a5a2c78ded6d", "size": "1861", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/robots/remote.py", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "1175" }, { "name": "Python", "bytes": "478515" } ], "symlink_target": "" }
package net.ccfish.talk.admin.jpa; import java.util.ArrayList; import java.util.List; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import org.springframework.data.jpa.domain.Specification; /** * 定义一个查询条件容器 * * @param <T> 对应的实体类型 * @author 袁贵 * @version 1.0 * @since 1.0 */ public class SearchCriteria<T> implements Specification<T> { private List<Criterion> criterions = new ArrayList<Criterion>(); @Override public Predicate toPredicate(Root<T> root, CriteriaQuery<?> query, CriteriaBuilder builder) { if (!criterions.isEmpty()) { List<Predicate> predicates = new ArrayList<Predicate>(); for (Criterion c : criterions) { predicates.add(c.toPredicate(root, query, builder)); } // 将所有条件用 and 联合起来 if (predicates.size() > 0) { return builder.and(predicates.toArray(new Predicate[predicates.size()])); } } return builder.conjunction(); } /** * 增加简单条件表达式 * * @param criterion 条件表达式 */ public void add(Criterion criterion) { if (criterion != null) { criterions.add(criterion); } } }
{ "content_hash": "1d1d910d5d02d13a5cb64155171e9dad", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 97, "avg_line_length": 26.86, "alnum_prop": 0.6306775874906925, "repo_name": "ccfish86/sctalk", "id": "08b9bd1ca867e0012ccec36ad627a84d31f8a280", "size": "1429", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server/admin/talk-admin/src/main/java/net/ccfish/talk/admin/jpa/SearchCriteria.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2184" }, { "name": "C", "bytes": "884129" }, { "name": "C++", "bytes": "5974" }, { "name": "CSS", "bytes": "11442" }, { "name": "HTML", "bytes": "25329" }, { "name": "Java", "bytes": "2610239" }, { "name": "JavaScript", "bytes": "1225847" }, { "name": "MATLAB", "bytes": "2076" }, { "name": "Makefile", "bytes": "58030" }, { "name": "SCSS", "bytes": "9533" }, { "name": "Vue", "bytes": "161061" } ], "symlink_target": "" }
Note that `index.html` and `cache.manifest` are generated by couchapp `/couchapp/app.js` from `/couchapp/templates/`.
{ "content_hash": "2dbd3d41e5707b7ca1a2aaf515dd4914", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 117, "avg_line_length": 59.5, "alnum_prop": 0.7478991596638656, "repo_name": "cgreenhalgh/opensharingtoolkit-mediahub", "id": "4f9792f163de0ddb6c1ec83baa7e376bedd403df", "size": "143", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "offlineapp/templates/README.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "1387" }, { "name": "CSS", "bytes": "853960" }, { "name": "CoffeeScript", "bytes": "271402" }, { "name": "HTML", "bytes": "17890" }, { "name": "JavaScript", "bytes": "401212" }, { "name": "Makefile", "bytes": "8426" }, { "name": "PHP", "bytes": "95316" }, { "name": "Ruby", "bytes": "914" } ], "symlink_target": "" }
import Ember from 'ember'; const { inject: { service } } = Ember; export default Ember.Route.extend({ session: service(), beforeModel: function() { return this.get('session').fetch().then(() => { if(this.get('session.isAuthenticated')) { return this.transitionTo('task-cards'); } }).catch(() => { // TODO: Get the user logs to see how they got here console.log("Could not get session"); }); }, actions: { signInSuccess() { this.get('session').fetch().then(() => { this.transitionTo('task-cards'); }); }, } });
{ "content_hash": "32a3f64edc07958cef819d0e4d24ad10", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 63, "avg_line_length": 25.59259259259259, "alnum_prop": 0.4833574529667149, "repo_name": "rogeliorv/xitomatl", "id": "bbbc74e0edc95189cca59dc816d1e670984a19f7", "size": "691", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/routes/login.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "14477" }, { "name": "HTML", "bytes": "34394" }, { "name": "JavaScript", "bytes": "54136" } ], "symlink_target": "" }
package org.apache.spark.network.buffer; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import com.google.common.base.Objects; import io.netty.buffer.ByteBufInputStream; import io.netty.buffer.Unpooled; /** * A {@link ManagedBuffer} backed by {@link ByteBuffer}. */ public final class NioManagedBuffer extends ManagedBuffer { private final ByteBuffer buf; public NioManagedBuffer(ByteBuffer buf) { this.buf = buf; } @Override public long size() { return buf.remaining(); } @Override public ByteBuffer nioByteBuffer() throws IOException { return buf.duplicate(); } @Override public InputStream createInputStream() throws IOException { return new ByteBufInputStream(Unpooled.wrappedBuffer(buf)); } @Override public ManagedBuffer retain() { return this; } @Override public ManagedBuffer release() { return this; } @Override public Object convertToNetty() throws IOException { return Unpooled.wrappedBuffer(buf); } @Override public String toString() { return Objects.toStringHelper(this) .add("buf", buf) .toString(); } }
{ "content_hash": "0e4e662fa5d6e93804c61ee6a1dee01c", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 63, "avg_line_length": 19.383333333333333, "alnum_prop": 0.711092003439381, "repo_name": "andrewor14/iolap", "id": "f55b884bc45cee4f51bd7c54f4e7a6911bc2a4ff", "size": "1963", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "network/common/src/main/java/org/apache/spark/network/buffer/NioManagedBuffer.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "27246" }, { "name": "C", "bytes": "1493" }, { "name": "CSS", "bytes": "15194" }, { "name": "HTML", "bytes": "2508" }, { "name": "Java", "bytes": "1248286" }, { "name": "JavaScript", "bytes": "64772" }, { "name": "Makefile", "bytes": "7771" }, { "name": "Python", "bytes": "1272669" }, { "name": "R", "bytes": "360680" }, { "name": "Roff", "bytes": "5379" }, { "name": "SQLPL", "bytes": "3603" }, { "name": "Scala", "bytes": "11975802" }, { "name": "Shell", "bytes": "157990" } ], "symlink_target": "" }
package net.lshift.spki; import static net.lshift.spki.sexpform.Create.atom; import static net.lshift.spki.sexpform.Create.list; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import net.lshift.spki.convert.ConvertUtils; import net.lshift.spki.convert.UsesCatalog; import net.lshift.spki.sexpform.Sexp; import org.apache.commons.io.IOUtils; import org.junit.Test; import org.junit.experimental.theories.DataPoints; import org.junit.experimental.theories.Theories; import org.junit.experimental.theories.Theory; import org.junit.runner.RunWith; @RunWith(Theories.class) public class PrettyPrinterTest extends UsesCatalog { private static final boolean WRITE_TEST_OUTPUT = false; private static class TestPair { private final String resourceName; private final Sexp sexp; public TestPair(final String resourceName, final Sexp sexp) { this.resourceName = resourceName; this.sexp = sexp; } public TestPair(final int i, final Sexp sexp) { this(Integer.toString(i) + ".spki", sexp); } public Sexp getSexp() { return sexp; } public String getResourceName() { return resourceName; } public InputStream getResourceAsStream() { return PrettyPrinterTest.class.getResourceAsStream( "_PrettyPrinterTest/" + getResourceName()); } } @DataPoints public static TestPair[] data() { int counter = 1; return new TestPair[] { new TestPair(counter++, atom("foo")), new TestPair(counter++, list("foo")), new TestPair(counter++, list("foo", list("bar", atom("baz")), atom("foof"))), new TestPair(counter++, list("foo", atom("baz"))), new TestPair(counter++, list("fo\"o", atom("baz"))), new TestPair(counter++, list("fo-o", atom("baz"))), new TestPair(counter++, list("foo bar", atom("baz"))), new TestPair(counter++, list("\0x80fsssssssssssssoo bar", atom("baz"))), new TestPair(counter++, atom("foo-bar")), new TestPair(counter++, atom("-")), new TestPair(counter++, atom("includes ~ tilde")), }; } @Theory public void theoryPrettyPrintingIsStable(final TestPair pair) throws IOException { final String prettyPrinted = ConvertUtils.prettyPrint(pair.getSexp()); // The expected output has Unix line endings; our PrettyPrinter will provide whatever // line endings are appropirate for the environment. final String expectedWithLF = IOUtils.toString(pair.getResourceAsStream()); assertThat(prettyPrinted, is(expectedWithLF.replace("\n", System.lineSeparator()))); } @Theory public void theoryCanParsePrettyPrintedData(final TestPair pair) throws IOException, InvalidInputException { final Sexp parsed = ConvertUtils.readAdvanced(getReadInfo(), Sexp.class, pair.getResourceAsStream()); assertThat(parsed, is(pair.getSexp())); } @Test public void handleWriteTestOutput() throws IOException { if (WRITE_TEST_OUTPUT) { for (final TestPair pair : data()) { final String prettyPrinted = ConvertUtils.prettyPrint( pair.getSexp()); final FileOutputStream out = new FileOutputStream("/tmp/out/" + pair.getResourceName()); IOUtils.write(prettyPrinted, out); out.close(); } } assertFalse(WRITE_TEST_OUTPUT); } }
{ "content_hash": "bff458b602c9bb06eb63068319c7bcf5", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 109, "avg_line_length": 37.8, "alnum_prop": 0.6412698412698413, "repo_name": "lshift/bletchley", "id": "307762bcc0acd8cf0480dbda69d0746e7449c764", "size": "3780", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/net/lshift/spki/PrettyPrinterTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "280444" } ], "symlink_target": "" }
NAME = AmplitudeImposer # -------------------------------------------------------------- # Files to build FILES_DSP = \ DistrhoPluginAmplitudeImposer.cpp FILES_UI = \ DistrhoArtworkAmplitudeImposer.cpp \ DistrhoUIAmplitudeImposer.cpp # -------------------------------------------------------------- # Do some magic UI_TYPE = generic FILE_BROWSER_DISABLED = true include ../../dpf/Makefile.plugins.mk # -------------------------------------------------------------- # Enable all possible plugin types TARGETS += clap TARGETS += jack TARGETS += ladspa TARGETS += lv2_sep TARGETS += vst2 TARGETS += vst3 ifeq ($(HAVE_CAIRO_OR_OPENGL),true) ifeq ($(HAVE_LIBLO),true) TARGETS += dssi endif endif all: $(TARGETS) # --------------------------------------------------------------
{ "content_hash": "38bf65b98280a12574c4e90ee799308a", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 64, "avg_line_length": 20.68421052631579, "alnum_prop": 0.48982188295165396, "repo_name": "DISTRHO/ndc-Plugs", "id": "eee2cce221e702f681e381a86ada1bed9ee26271", "size": "994", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "plugins/AmplitudeImposer/Makefile", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "5845" }, { "name": "C++", "bytes": "25029357" }, { "name": "Makefile", "bytes": "3947" } ], "symlink_target": "" }
using System; namespace Kekstoaster.Syntax { /// <summary> /// Ebnf templates for frequently used elements. /// </summary> public static class EbnfTemplates { /// <summary> /// Returnes a single space element. /// </summary> /// <value>A single space element.</value> public static Ebnf Space { get { return new EbnfChar (' '); } } /// <summary> /// Returns a single char range from a to z /// </summary> /// <value>The a to z element.</value> public static Ebnf a_to_z { get { return new EbnfRange ('a', 'z'); } } /// <summary> /// Returns a single char range from A to Z /// </summary> /// <value>The A to Z element.</value> public static Ebnf A_to_Z { get { return new EbnfRange ('A', 'Z'); } } /// <summary> /// Returns a single char range from 0 to 9 /// </summary> /// <value>The 0 to 9 element.</value> public static Ebnf _0_to_9 { get { return new EbnfRange ('0', '9'); } } /// <summary> /// Returns a single char range from a to z or A to Z /// </summary> /// <value>The Ebnf element.</value> public static Ebnf Alpha { get { return new EbnfRange ('a', 'z', ScopeType.Parent) | new EbnfRange ('A', 'Z', ScopeType.Parent); } } /// <summary> /// Returns a single char range from a to z, A to Z or 0 to 9 /// </summary> /// <value>The Ebnf element.</value> public static Ebnf AlphaNum { get { return new EbnfRange ('a', 'z', ScopeType.Parent) | new EbnfRange ('A', 'Z', ScopeType.Parent) | new EbnfRange ('0', '9', ScopeType.Parent); } } /// <summary> /// Returns a single char element that matches any whitespace space ' ', tabulator '\t', carriage return '\r' or linefeed '\n' /// </summary> /// <value>The Ebnf element.</value> public static Ebnf Whitespace { get { EbnfChar space = new EbnfChar (' ', ScopeType.Parent), tab = new EbnfChar ('\t', ScopeType.Parent), carriageReturn = new EbnfChar ('\r', ScopeType.Parent), lineFeed = new EbnfChar ('\n', ScopeType.Parent); return space | tab | carriageReturn | lineFeed; } } /// <summary> /// Returns an element matching a general identifier. /// The identifier starts with any letter or underscore and is followed by an arbitrary count of letter, underscore or digit characters. /// </summary> /// <value>The Ebnf element.</value> public static Ebnf Identifier { get { EbnfRange az = new EbnfRange ('a', 'z', ScopeType.Parent); EbnfRange AZ = new EbnfRange ('A', 'Z', ScopeType.Parent); EbnfRange _09 = new EbnfRange ('0', '9', ScopeType.Parent); EbnfChar _ = new EbnfChar ('_', ScopeType.Parent); Ebnf c1 = az | AZ | _; c1.ScopeType = ScopeType.Parent; Ebnf cn = az | AZ | _09 | _; cn.ScopeType = ScopeType.Parent; Ebnf cnn = ~cn; cnn.ScopeType = ScopeType.Parent; Ebnf c = c1 & cnn; return c; } } /// <summary> /// Returns a seperator matching element. /// This is a negation element; negating letters, digits and underscore /// </summary> /// <value>The seperator.</value> public static Ebnf Seperator { get { return new EbnfExclusion (new EbnfRange ('a', 'z', ScopeType.Parent) | new EbnfRange ('A', 'Z', ScopeType.Parent) | new EbnfRange ('0', '9', ScopeType.Parent) | new EbnfChar ('_', ScopeType.Parent)); } } } }
{ "content_hash": "bd1bbc58739a0c8459da5e5c01a4bafe", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 203, "avg_line_length": 30.036036036036037, "alnum_prop": 0.6157768446310737, "repo_name": "kekstoaster/Syntax", "id": "16add256cc49e1af004bc9daba270978212e98b3", "size": "3334", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Ebnf/EbnfTemplates.cs", "mode": "33261", "license": "mit", "language": [ { "name": "C#", "bytes": "98561" } ], "symlink_target": "" }
Saving Finale **Source** [_saving finale_](advanced/spells/savingFinale#_saving-finale) Add your tier as a bonus on the saving throw reroll.
{ "content_hash": "d849613268364c2df3f4f07781ee9728", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 73, "avg_line_length": 24, "alnum_prop": 0.7569444444444444, "repo_name": "brunokoga/pathfinder-markdown", "id": "96579bb9e94b7b4d12b4fad988c28e100a06b48b", "size": "144", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "prd_markdown/mythicAdventures/mythicSpells/savingFinale.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "58168" }, { "name": "JavaScript", "bytes": "97828" }, { "name": "Ruby", "bytes": "2456" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "90f9100e306f9510071314a10a984b65", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "495dbc3174466c1104fa870970d99a8d995a9421", "size": "197", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Ebenaceae/Diospyros/Diospyros dasypetala/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
CrashedExtensionInfoBarDelegate::CrashedExtensionInfoBarDelegate( TabContents* tab_contents, ExtensionsService* extensions_service, const Extension* extension) : ConfirmInfoBarDelegate(tab_contents), extensions_service_(extensions_service), extension_id_(extension->id()), extension_name_(extension->name()) { DCHECK(extensions_service_); DCHECK(!extension_id_.empty()); } std::wstring CrashedExtensionInfoBarDelegate::GetMessageText() const { return l10n_util::GetStringF(IDS_EXTENSION_CRASHED_INFOBAR_MESSAGE, UTF8ToWide(extension_name_)); } void CrashedExtensionInfoBarDelegate::InfoBarClosed() { delete this; } SkBitmap* CrashedExtensionInfoBarDelegate::GetIcon() const { // TODO(erikkay): Create extension-specific icon. http://crbug.com/14591 return ResourceBundle::GetSharedInstance().GetBitmapNamed( IDR_INFOBAR_PLUGIN_CRASHED); } int CrashedExtensionInfoBarDelegate::GetButtons() const { return BUTTON_OK; } std::wstring CrashedExtensionInfoBarDelegate::GetButtonLabel( ConfirmInfoBarDelegate::InfoBarButton button) const { if (button == BUTTON_OK) return l10n_util::GetString(IDS_EXTENSION_CRASHED_INFOBAR_RESTART_BUTTON); return ConfirmInfoBarDelegate::GetButtonLabel(button); } bool CrashedExtensionInfoBarDelegate::Accept() { extensions_service_->ReloadExtension(extension_id_); return true; }
{ "content_hash": "18a101c8dabcda0999f2e18b70ecf7bd", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 33.07142857142857, "alnum_prop": 0.7652987760979122, "repo_name": "rwatson/chromium-capsicum", "id": "80ab865fb078dc8f739280a9c4808b1bc1c6d226", "size": "1900", "binary": false, "copies": "1", "ref": "refs/heads/chromium-capsicum", "path": "chrome/browser/extensions/crashed_extension_infobar.cc", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
package logger //-------------------- // IMPORTS //-------------------- import ( "log" "log/syslog" ) //-------------------- // SYSLOGGER //-------------------- // SysLogger uses the Go syslog package as logging backend. It does // not work on Windows or Plan9. type SysLogger struct { writer *syslog.Writer } // NewGoLogger returns a logger implementation using the // Go syslog package. func NewSysLogger(tag string) (Logger, error) { writer, err := syslog.New(syslog.LOG_DEBUG|syslog.LOG_LOCAL0, tag) if err != nil { log.Fatalf("cannot init syslog: %v", err) return nil, err } return &SysLogger{writer}, nil } // Debug logs a message at debug level. func (sl *SysLogger) Debug(info, msg string) { sl.writer.Debug(info + " " + msg) } // Info logs a message at info level. func (sl *SysLogger) Info(info, msg string) { sl.writer.Info(info + " " + msg) } // Warning logs a message at warning level. func (sl *SysLogger) Warning(info, msg string) { sl.writer.Warning(info + " " + msg) } // Error logs a message at error level. func (sl *SysLogger) Error(info, msg string) { sl.writer.Err(info + " " + msg) } // Critical logs a message at critical level. func (sl *SysLogger) Critical(info, msg string) { sl.writer.Crit(info + " " + msg) } // EOF
{ "content_hash": "27046db280d42ef74556e2b897e843c6", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 67, "avg_line_length": 21.93103448275862, "alnum_prop": 0.6320754716981132, "repo_name": "simonz05/carry", "id": "fa40fa609e4052db9412be56ac4c192ebbedceb2", "size": "1523", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "Godeps/_workspace/src/github.com/tideland/goas/v2/logger/syslogger.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "31307" } ], "symlink_target": "" }
package com.google.cloud.datacatalog.v1beta1.samples; // [START datacatalog_v1beta1_generated_datacatalogclient_createtagtemplate_stringstringtagtemplate_sync] import com.google.cloud.datacatalog.v1beta1.DataCatalogClient; import com.google.cloud.datacatalog.v1beta1.LocationName; import com.google.cloud.datacatalog.v1beta1.TagTemplate; public class SyncCreateTagTemplateStringStringTagtemplate { public static void main(String[] args) throws Exception { syncCreateTagTemplateStringStringTagtemplate(); } public static void syncCreateTagTemplateStringStringTagtemplate() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); String tagTemplateId = "tagTemplateId-1438776721"; TagTemplate tagTemplate = TagTemplate.newBuilder().build(); TagTemplate response = dataCatalogClient.createTagTemplate(parent, tagTemplateId, tagTemplate); } } } // [END datacatalog_v1beta1_generated_datacatalogclient_createtagtemplate_stringstringtagtemplate_sync]
{ "content_hash": "f9a26b22f8adbd0042c17a409fa15a0a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 105, "avg_line_length": 49.193548387096776, "alnum_prop": 0.7842622950819672, "repo_name": "googleapis/java-datacatalog", "id": "66e16bd65c6ea482745624fa9dbffa3830725e51", "size": "2120", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "samples/snippets/generated/com/google/cloud/datacatalog/v1beta1/datacatalogclient/createtagtemplate/SyncCreateTagTemplateStringStringTagtemplate.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "801" }, { "name": "Java", "bytes": "10281928" }, { "name": "Python", "bytes": "788" }, { "name": "Shell", "bytes": "22865" } ], "symlink_target": "" }
Please raise issues to capture bugs or feature requests - or feel free to contact us directly and discuss things if you have our contact details. ## Contributing Code or Reviewing We really appreciate code or review contributions! Code contributions are made by raising pull requests against the master branch of https://github.com/metoppv/improver/. If you are a new contributor, your pull request must include adding your details to the list of contributors under the [Code Contributors](#code-contributors) part of this page. Reviewers of the pull requests must check this has been done before the pull request is merged into master. We have a checklist for making sure code is ready to merge in: https://improver.readthedocs.io/en/latest/Definition-of-Done.html and guidance for going through the review process: https://improver.readthedocs.io/en/latest/Guidance-for-Reviewing-Code.html ## Code Contributors The following people have contributed to this code under the terms of the Contributor Licence Agreement and Certificate of Origin detailed below: <!-- start-shortlog --> - Paul Abernethy (Met Office, UK) - Benjamin Ayliffe (Met Office, UK) - Mark Baker (Met Office, UK) - Laurence Beard (Met Office, UK) - Anna Booton (Met Office, UK) - Prajwal Borkar - James Canvin (Bureau of Meteorology, Australia) - Shubhendra Singh Chauhan (DeepSource, India) - Neil Crosswaite (Met Office, UK) - Shafiat Dewan (Met Office, UK) - Gavin Evans (Met Office, UK) - Zhiliang Fan (Bureau of Meteorology, Australia) - Ben Fitzpatrick (Met Office, UK) - Tom Gale (Bureau of Meteorology, Australia) - Aaron Hopkinson (Met Office, UK) - Kathryn Howard (Met Office, UK) - Tim Hume (Bureau of Meteorology, Australia) - Katharine Hurst (Met Office, UK) - Simon Jackson (Met Office, UK) - Caroline Jones (Met Office, UK) - Bruno P. Kinoshita (NIWA, NZ) - Lucy Liu (Bureau of Meteorology, Australia) - Daniel Mentiplay (Bureau of Meteorology, Australia) - Stephen Moseley (Met Office, UK) - Meabh NicGuidhir (Met Office, UK) - Benjamin Owen (Bureau of Meteorology, Australia) - Carwyn Pelley (Met Office, UK) - Tim Pillinger (Met Office, UK) - Fiona Rust (Met Office, UK) - Chris Sampson (Met Office, UK) - Caroline Sandford (Met Office, UK) - Anja Schubert (Bureau of Meteorology, Australia) - Victoria Smart (Met Office, UK) - Eleanor Smith (Met Office, UK) - Marcus Spelman (Met Office, UK) - Belinda Trotta (Bureau of Meteorology, Australia) - Tomasz Trzeciak (Met Office, UK) - Mark Worsfold (Met Office, UK) - Ying Zhao (Bureau of Meteorology, Australia) <!-- end-shortlog --> - Martina Friedrich (Met Office, UK, pre-GitHub) (All contributors on GitHub are identifiable with email addresses in the version control logs or otherwise.) ## Contributor Licence Agreement and Certificate of Origin By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it, either on my behalf or on behalf of my employer, under the terms and conditions as described by this file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate licence and I have the right or permission from the copyright owner under that licence to submit that work with modifications, whether created in whole or in part by me, under the terms and conditions as described by this file; or (c) The contribution was provided directly to me by some other person who certified (a) or (b) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including my name and email address) is maintained for the full term of the copyright and may be redistributed consistent with this project or the licence(s) involved. (e) I, or my employer, grant to the UK Met Office and all recipients of this software a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright licence to reproduce, modify, prepare derivative works of, publicly display, publicly perform, sub-licence, and distribute this contribution and such modifications and derivative works consistent with this project or the licence(s) involved or other appropriate open source licence(s) specified by the project and approved by the [Open Source Initiative (OSI)](http://www.opensource.org/). (f) If I become aware of anything that would make any of the above inaccurate, in any way, I will let the UK Met Office know as soon as I become aware. (The IMPROVER Contributor Licence Agreement and Certificate of Origin is derived almost entirely from the Rose version (https://github.com/metomi/rose/), which was inspired by the Certificate of Origin used by Enyo and the Linux Kernel.)
{ "content_hash": "ef5afc8fbf258f7fa9e0d8af492052a4", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 78, "avg_line_length": 40.916666666666664, "alnum_prop": 0.7529531568228106, "repo_name": "fionaRust/improver", "id": "f7a9363561fbaa07c0deae822966c9eabec54bde", "size": "4986", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "CONTRIBUTING.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "5026255" }, { "name": "Shell", "bytes": "9493" } ], "symlink_target": "" }
PyObject* get_open_files(long pid, HANDLE processHandle);
{ "content_hash": "737448ae36281ebc873bc47187043ef0", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 57, "avg_line_length": 58, "alnum_prop": 0.7931034482758621, "repo_name": "Crystalnix/house-of-life-chromium", "id": "bd9d39b8b23965a6f5fefd2fb0da38c63e3c8917", "size": "100", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "third_party/psutil/psutil/arch/mswindows/process_handles.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "3418" }, { "name": "C", "bytes": "88445923" }, { "name": "C#", "bytes": "73756" }, { "name": "C++", "bytes": "77228136" }, { "name": "Emacs Lisp", "bytes": "6648" }, { "name": "F#", "bytes": "381" }, { "name": "Go", "bytes": "3744" }, { "name": "Java", "bytes": "11354" }, { "name": "JavaScript", "bytes": "6191433" }, { "name": "Objective-C", "bytes": "4023654" }, { "name": "PHP", "bytes": "97796" }, { "name": "Perl", "bytes": "92217" }, { "name": "Python", "bytes": "5604932" }, { "name": "Ruby", "bytes": "937" }, { "name": "Shell", "bytes": "1234672" }, { "name": "Tcl", "bytes": "200213" } ], "symlink_target": "" }
import {parse as babylonParser, ItBlock, Expect} from 'jest-editor-support'; import TypeScriptParser from './type_script_parser'; export type ParserReturn = { itBlocks: Array<ItBlock>, expects: Array<Expect>, }; /** * Converts the file into an AST, then passes out a * collection of it and expects. */ function parse(file: string): ParserReturn { if (file.match(/\.tsx?$/)) { return TypeScriptParser.parse(file); } else { return babylonParser(file); } } module.exports = { TypeScriptParser, parse, };
{ "content_hash": "46c34d9cc484d6932073f58d09104749", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 76, "avg_line_length": 20.423076923076923, "alnum_prop": 0.687382297551789, "repo_name": "skovhus/jest", "id": "f8b0e729f237266d1077335408f69ad79b922c88", "size": "848", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/jest-test-typescript-parser/src/index.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "37142" }, { "name": "JavaScript", "bytes": "1559977" }, { "name": "PHP", "bytes": "5682" }, { "name": "TypeScript", "bytes": "831" } ], "symlink_target": "" }
package org.apache.accumulo.core.iterators.aggregation; import org.apache.accumulo.core.data.Value; /** * @deprecated since 1.4, replaced by {@link org.apache.accumulo.core.iterators.user.MinCombiner} with * {@link org.apache.accumulo.core.iterators.LongCombiner.Type#STRING} */ @Deprecated public class StringMin implements Aggregator { long min = Long.MAX_VALUE; public Value aggregate() { return new Value(Long.toString(min).getBytes()); } public void collect(Value value) { long l = Long.parseLong(new String(value.get())); if (l < min) { min = l; } } public void reset() { min = Long.MAX_VALUE; } }
{ "content_hash": "681c27ae3d840964fad0d4a9f35ae95a", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 102, "avg_line_length": 22.233333333333334, "alnum_prop": 0.671664167916042, "repo_name": "phrocker/accumulo", "id": "48855b3595f18c4220fc94c7931b6ab743faa148", "size": "1468", "binary": false, "copies": "1", "ref": "refs/heads/ACCUMULO-3709", "path": "core/src/main/java/org/apache/accumulo/core/iterators/aggregation/StringMin.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "12217" }, { "name": "C++", "bytes": "1297281" }, { "name": "CSS", "bytes": "5889" }, { "name": "HTML", "bytes": "6628" }, { "name": "Java", "bytes": "14131538" }, { "name": "JavaScript", "bytes": "249599" }, { "name": "Makefile", "bytes": "3565" }, { "name": "Perl", "bytes": "28190" }, { "name": "Python", "bytes": "906539" }, { "name": "Ruby", "bytes": "193322" }, { "name": "Shell", "bytes": "194601" }, { "name": "Thrift", "bytes": "46026" } ], "symlink_target": "" }
package org.wildfly.security.util; import static org.junit.Assert.*; import org.junit.Test; import org.wildfly.security.util._private.Arrays2; /** * Tests of org.wildfly.security.util.Arrays2 * * @author <a href="mailto:jkalina@redhat.com">Jan Kalina</a> */ public class Arrays2Test { @Test public void testIndexOf() throws Exception { byte[] array = {0x10, 0x15, (byte) 0x81, 0x00, 0x15, (byte) 0xab}; assertEquals(0, Arrays2.indexOf(array, 0x10)); assertEquals(2, Arrays2.indexOf(array, 0x81)); assertEquals(3, Arrays2.indexOf(array, 0x00)); assertEquals(5, Arrays2.indexOf(array, 0xab)); assertEquals(-1, Arrays2.indexOf(array, 0x16)); assertEquals(1, Arrays2.indexOf(array, 0x15)); assertEquals(1, Arrays2.indexOf(array, 0x15, 0)); assertEquals(4, Arrays2.indexOf(array, 0x15, 2)); assertEquals(4, Arrays2.indexOf(array, 0x15, 4)); assertEquals(-1, Arrays2.indexOf(array, 0x15, 5)); assertEquals(-1, Arrays2.indexOf(array, 0x10, 1)); assertEquals(4, Arrays2.indexOf(array, 0x15, 3, 5)); assertEquals(4, Arrays2.indexOf(array, 0x15, 2, 4)); assertEquals(4, Arrays2.indexOf(array, 0x15, 4, 5)); assertEquals(1, Arrays2.indexOf(array, 0x15, 0, 5)); assertEquals(-1, Arrays2.indexOf(array, 0xff, 1, 4)); } @Test public void testEqualsBytesOffset1BytesOffset2Len() throws Exception { assertTrue(Arrays2.equals(new byte[]{'x','a','b','c','x'}, 1, new byte[]{'y','y','a','b','c','y'}, 2, 3)); assertTrue(Arrays2.equals(new byte[]{'a','b','c'}, 0, new byte[]{'a','b','c'}, 0, 3)); assertTrue(Arrays2.equals(new byte[]{}, 0, new byte[]{'a','b','c'}, 3, 0)); assertFalse(Arrays2.equals(new byte[]{'a','x','c'}, 0, new byte[]{'a','y','c'}, 0, 3)); } @Test public void testEqualsBytesOffset1Bytes() throws Exception { assertTrue(Arrays2.equals(new byte[]{'x','x','a','b','c','x'}, 2, new byte[]{'a','b','c'})); assertTrue(Arrays2.equals(new byte[]{'a','b','c'}, 0, new byte[]{'a','b','c'})); } @Test public void testEqualsCharsOffset1CharsOffset2Len() throws Exception { assertTrue(Arrays2.equals(new char[]{'x','a','b','c','x'}, 1, new char[]{'y','y','a','b','c','y'}, 2, 3)); assertTrue(Arrays2.equals(new char[]{'a','b','c'}, 0, new char[]{'a','b','c'}, 0, 3)); assertTrue(Arrays2.equals(new char[]{}, 0, new char[]{'a','b','c'}, 3, 0)); assertFalse(Arrays2.equals(new char[]{'a','x','c'}, 0, new char[]{'a','y','c'}, 0, 3)); } @Test public void testEqualsCharsOffset1Chars() throws Exception { assertTrue(Arrays2.equals(new char[]{'x','x','a','b','c','x'}, 2, new char[]{'a','b','c'})); assertTrue(Arrays2.equals(new char[]{'a','b','c'}, 0, new char[]{'a','b','c'})); } @Test public void testEqualsCharsOffset1StringOffset2Len() throws Exception { assertTrue(Arrays2.equals(new char[]{'x','a','b','c','x'}, 1, "yyabcy", 2, 3)); assertTrue(Arrays2.equals(new char[]{'a','b','c'}, 0, "abc", 0, 3)); } @Test public void testEqualsCharsOffset1String() throws Exception { assertTrue(Arrays2.equals(new char[]{'x','x','a','b','c','x'}, 2, "abc")); assertTrue(Arrays2.equals(new char[]{'a','b','c'}, 0, "abc")); } @Test public void testEqualsStringOffset1Chars() throws Exception { assertTrue(Arrays2.equals("xxabcx", 2, new char[]{'a','b','c'})); assertTrue(Arrays2.equals("abc", 0, new char[]{'a','b','c'})); } }
{ "content_hash": "58328a4ad641ed079f3d051817bae870", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 114, "avg_line_length": 41.39080459770115, "alnum_prop": 0.5848375451263538, "repo_name": "sguilhen/wildfly-elytron", "id": "4abd93c3bf1efc66743bc55bff62e45adc02cb88", "size": "4307", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "src/test/java/org/wildfly/security/util/Arrays2Test.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "5054222" }, { "name": "Shell", "bytes": "983" } ], "symlink_target": "" }
// ////////////////////////////////////////////////////////////////////////////// // // Copyright 2012 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // ////////////////////////////////////////////////////////////////////////////// // // DESCRIPTION: AcDbXrecord class definition. #ifndef ACDB_XRECORD_H #define ACDB_XRECORD_H #include "AdAChar.h" #include "dbmain.h" #define ACDB_XRECORD_CLASS ACRX_T(/*MSG0*/"AcDbXrecord") #define ACDB_XRECORD_ITERATOR_CLASS ACRX_T(/*MSG0*/"AcDbXrecordClass") #pragma pack(push, 8) class AcDbXrecord: public AcDbObject { public: ACDB_DECLARE_MEMBERS(AcDbXrecord); AcDbXrecord(); virtual ~AcDbXrecord(); // auxDb parameter only useded when working with // non-Database-resident instances. Acad::ErrorStatus rbChain(resbuf** ppRb, AcDbDatabase* auxDb = NULL) const; Acad::ErrorStatus setFromRbChain(const resbuf& pRb, AcDbDatabase* auxDb = NULL); bool isXlateReferences() const; void setXlateReferences(bool translate); // Overridden methods from AcDbObject // virtual Acad::ErrorStatus subClose(); virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer); virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const; virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer); virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const; virtual AcDb::DuplicateRecordCloning mergeStyle() const; virtual void setMergeStyle(AcDb::DuplicateRecordCloning style); protected: virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const; }; class AcDbImpXrecordIterator; class AcDbXrecordIterator: public AcRxObject { public: ACRX_DECLARE_MEMBERS(AcDbXrecordIterator); AcDbXrecordIterator(const AcDbXrecord* pXrecord); virtual ~AcDbXrecordIterator(); void start(); bool done() const; Acad::ErrorStatus next(); int curRestype() const; Acad::ErrorStatus getCurResbuf(resbuf& outItem, AcDbDatabase* db) const; protected: AcDbXrecordIterator() {}; private: friend class AcDbXrecord; friend class AcDbImpXrecord; AcDbImpXrecordIterator* mpImpIter; }; #pragma pack(pop) #endif
{ "content_hash": "46991600014fff907ad03f72c4d9d527", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 82, "avg_line_length": 31.156626506024097, "alnum_prop": 0.6349574632637278, "repo_name": "kevinzhwl/ObjectARXCore", "id": "5bb24641cc4fd5a218fd4798ba28075b5dfb1bc1", "size": "2586", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "2013/inc/dbxrecrd.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "14344996" }, { "name": "C++", "bytes": "77699473" }, { "name": "Objective-C", "bytes": "2136952" } ], "symlink_target": "" }
{{<govuk/startPage}} {{$pageTitle}}Register to vote (armed forces){{/pageTitle}} {{$main}} <ol role="breadcrumbs" class="breadcrumbs"> <li><a href="https://www.gov.uk/">Home</a></li> <li><a href="https://www.gov.uk/browse/citizenship">Citizenship and living in the UK</a></li> <li><strong><a href="https://www.gov.uk/browse/citizenship/voting">Voting</a></strong></li> </ol> <header class="page-header group"> <div> <h1> Register to vote (armed forces) </h1> </div> <a class="skip-to-related" href="#related">Not what you're looking for? ↓</a> </header> <article> <p>Use this service to get on the electoral register or to update your details if you don't have a permanent home address in the UK and you're:</p> <ul> <li>a member of the armed forces</li> <li>the spouse or civil partner of someone in the armed forces</li> </ul> <p>Registering takes around 5 minutes.</p> <p>You'll need your service number and National Insurance number (if you have one).</p> <p id="get-started" class="get-started group"> <a href="{{startUrl}}" class="button">Start now</a> </p> <h2>Before you start</h2> <p>You can <a href="/register-to-vote">apply as a non-service voter</a> if you have a permanent home address in the UK and want it to be on the electoral register.</p> <p>You can also <a href="https://www.gov.uk/government/publications/voter-registration-forms-paper-versions">register by post</a>.</p> <h2>Children of a member of the armed forces</h2> <p>You must <a href="https://www.gov.uk/government/publications/voter-registration-forms-paper-versions">register by post</a> if all the following apply:</p> <ul> <li>you're between 14 and 16 years old</li> <li>the child of a member of the armed forces from Scotland</li> <li>living with your parent or guardian overseas</li> </ul> <p>Send the form to your <a href="https://www.gov.uk/get-on-electoral-register">local Electoral Registration Office</a>.</p> <p>If you're the child of someone from the armed forces and from England, Wales and Northern Ireland, you can <a href="/register-to-vote">register as an overseas adult</a> when you turn 16.</p> <h2>If you're not in the armed forces</h2> <p>There are separate registration services for:</p> <ul> <li><a href="/register-to-vote/crown">Crown servants</a>, for example diplomatic service, overseas civil service</li> <li><a href="/register-to-vote/crown">British Council employees</a></li> </ul> <h2>Northern Ireland</h2> <p>This service is for England, Wales and Scotland only.</p> <p>You'll need to register using a different form if you live in <a href="http://www.eoni.org.uk/Register-To-Vote/Register-to-vote-change-address-change-name">Northern Ireland</a>.</p> </article> {{/main}} {{/govuk/startPage}}
{ "content_hash": "ba7d86c0c1615687022f256e71795ce5", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 195, "avg_line_length": 46.983333333333334, "alnum_prop": 0.6917346576800284, "repo_name": "alphagov/ier-frontend", "id": "406a46bb13e8fa58ee1c88dba930955c8b432886", "size": "2821", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/assets/mustache/govuk/registerToVoteForces.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "165991" }, { "name": "Cycript", "bytes": "42212" }, { "name": "HTML", "bytes": "381180" }, { "name": "JavaScript", "bytes": "307878" }, { "name": "Python", "bytes": "5001" }, { "name": "Ruby", "bytes": "165" }, { "name": "Scala", "bytes": "2716206" }, { "name": "Shell", "bytes": "10318" } ], "symlink_target": "" }
package be.swsb.fiazard.ordering.topping; import be.swsb.fiazard.common.eventsourcing.Event; import be.swsb.fiazard.common.eventsourcing.EventStore; import be.swsb.fiazard.common.mongo.MongoDBRule; import be.swsb.fiazard.common.test.ClientRule; import be.swsb.fiazard.main.FiazardApp; import be.swsb.fiazard.main.FiazardConfig; import com.sun.jersey.api.client.ClientResponse; import io.dropwizard.testing.junit.DropwizardAppRule; import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; import javax.ws.rs.core.MediaType; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; public class ToppingResourceIntegrationTest { public static final String BASE_URL = "http://localhost:8080"; public static final String TOPPING_PATH = "/ordering/topping"; private static final String LOCK_TOPPING_PATH = "/ordering/topping/lock"; private static final String UNLOCK_TOPPING_PATH = "/ordering/topping/unlock"; private static final String EXCLUDE_TOPPING_PATH = "/ordering/topping/exclude"; @ClassRule public static final DropwizardAppRule<FiazardConfig> appRule = new DropwizardAppRule<>(FiazardApp.class, "src/test/resources/test.yml"); @Rule public MongoDBRule mongoDBRule = MongoDBRule.create(); @Rule public ClientRule clientRule = new ClientRule(); private EventStore eventStore; @Before public void setUp() { eventStore = new EventStore(mongoDBRule.getDB()); } @Test public void toppingsAreReturnedAsJSON() throws Exception { mongoDBRule.persist(new Topping(null, "Patrick", 4d, "image", "imageType")); ClientResponse clientResponse = clientRule.getClient() .resource(BASE_URL) .path(TOPPING_PATH) .type(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON_TYPE) .get(ClientResponse.class); assertThat(clientResponse.getEntity(Topping[].class)).isNotEmpty(); } @Test public void lock_ToppingLockedEventIsStored() throws Exception { Topping topping = new Topping("id", "someTopping", 4, "image", "imageType"); ClientResponse clientResponse = clientRule.getClient() .resource(BASE_URL) .path(LOCK_TOPPING_PATH) .type(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON_TYPE) .entity(topping) .post(ClientResponse.class); assertThat(clientResponse.getStatusInfo().getStatusCode()).isEqualTo(ClientResponse.Status.OK.getStatusCode()); List<Event> events = eventStore.findAll(); assertThat(events).hasSize(1); ToppingLockedEvent toppingLockedEvent = (ToppingLockedEvent) events.get(0); assertThat(toppingLockedEvent.getTopping()).isEqualTo(topping); assertThat(toppingLockedEvent.getId()).isNotNull(); assertThat(toppingLockedEvent.getTimestamp()).isNotNull(); } @Test public void unlock_ToppingUnlockedEventIsStored() throws Exception { Topping topping = new Topping("id", "someTopping", 4, "image", "imageType"); ClientResponse clientResponse = clientRule.getClient() .resource(BASE_URL) .path(UNLOCK_TOPPING_PATH) .type(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON_TYPE) .entity(topping) .post(ClientResponse.class); assertThat(clientResponse.getStatusInfo().getStatusCode()).isEqualTo(ClientResponse.Status.OK.getStatusCode()); List<Event> events = eventStore.findAll(); assertThat(events).hasSize(1); ToppingUnlockedEvent toppingUnlockedEvent = (ToppingUnlockedEvent) events.get(0); assertThat(toppingUnlockedEvent.getTopping()).isEqualTo(topping); assertThat(toppingUnlockedEvent.getId()).isNotNull(); assertThat(toppingUnlockedEvent.getTimestamp()).isNotNull(); } @Test public void exclude_ToppingExcludeEventStored() { Topping topping = new Topping("id", "someTopping", 4, "image", "imageType"); ClientResponse clientResponse = clientRule.getClient() .resource(BASE_URL) .path(EXCLUDE_TOPPING_PATH) .type(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON_TYPE) .entity(topping) .post(ClientResponse.class); assertThat(clientResponse.getStatusInfo().getStatusCode()).isEqualTo(ClientResponse.Status.OK.getStatusCode()); List<Event> events = eventStore.findAll(); assertThat(events).hasSize(1); ToppingExcludeEvent event = (ToppingExcludeEvent)events.get(0); assertThat(event.getTopping()).isEqualTo(topping); assertThat(event.getId()).isNotNull(); assertThat(event.getTimestamp()).isNotNull(); } }
{ "content_hash": "9984618122e9247295282a95471c41c2", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 119, "avg_line_length": 39.2265625, "alnum_prop": 0.6779525990838479, "repo_name": "Jooones/Fiazard", "id": "06e728a9de23c26d3dc6e9eebb831ffc875f1a57", "size": "5021", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "src/test/java/be/swsb/fiazard/ordering/topping/ToppingResourceIntegrationTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "121200" }, { "name": "JavaScript", "bytes": "621" } ], "symlink_target": "" }
package com.sun.xml.internal.ws.addressing; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlValue; import javax.xml.namespace.QName; import static com.sun.xml.internal.ws.addressing.W3CAddressingConstants.WSA_NAMESPACE_NAME; /** * @author Arun Gupta */ @XmlRootElement(name="ProblemHeaderQName", namespace= WSA_NAMESPACE_NAME) public class ProblemHeaderQName { @XmlValue private QName value; /** Creates a new instance of ProblemHeaderQName */ public ProblemHeaderQName() { } public ProblemHeaderQName(QName name) { this.value = name; } }
{ "content_hash": "8e015a4101af2da6a7c3526b2c19b98c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 91, "avg_line_length": 23.884615384615383, "alnum_prop": 0.7407407407407407, "repo_name": "rokn/Count_Words_2015", "id": "9fa0af7396751c8ebcaad1f6eccf577a5f58d335", "size": "1833", "binary": false, "copies": "21", "ref": "refs/heads/master", "path": "testing/openjdk2/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/addressing/ProblemHeaderQName.java", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "61802" }, { "name": "Ruby", "bytes": "18888605" } ], "symlink_target": "" }
module GemFresh class Calculator # If a gem is behind by a major version, it's worth more points # than a minor version. POINTS_FOR_MAJOR = 100 POINTS_FOR_MINOR = 10 POINTS_FOR_PATCH = 1 # Point multipliers based on how central the gem is to the application code. MINIMAL_MULTIPLIER = 0.1 LOCAL_MULTIPLIER = 1 SYSTEM_MULTIPLIER = 10 FRAMEWORK_MULTIPLIER = 100 def initialize @freshness_scores = {} end def calculate! @gem_freshness_info = GemFresh::Outdated.new.gem_info calculate_freshness_scores_for_each_gem end def total_score @freshness_scores.values.sum.round(1) end def all_scores @freshness_scores end private def calculate_freshness_scores_for_each_gem calculate_for_gems(['rails'], FRAMEWORK_MULTIPLIER) calculate_for_gems(Config.config.system_wide_gems, SYSTEM_MULTIPLIER) calculate_for_gems(Config.config.local_gems, LOCAL_MULTIPLIER) calculate_for_gems(Config.config.minimal_gems, MINIMAL_MULTIPLIER) end def calculate_for_gems(gems, multiplier) gems.each do |gem_name| @freshness_scores[gem_name] = (calculate_freshness_score_for(gem_name) * multiplier).round(1) end end def calculate_freshness_score_for(gem_name) info = @gem_freshness_info[gem_name] return 0 if info.nil? # no outdated info means it's fresh major_diff = (info[:available_version].major - info[:current_version].major) minor_diff = (info[:available_version].minor - info[:current_version].minor) patch_diff = (info[:available_version].patch - info[:current_version].patch) score = 0 if major_diff > 0 score += major_diff * POINTS_FOR_MAJOR elsif minor_diff > 0 score += minor_diff * POINTS_FOR_MINOR elsif patch_diff > 0 score += patch_diff * POINTS_FOR_PATCH end score end end end
{ "content_hash": "47793f16d54b03fdc5a218fbcaaf2de0", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 82, "avg_line_length": 29.134328358208954, "alnum_prop": 0.65625, "repo_name": "dmcouncil/gem_fresh", "id": "f0a49bbad03d6f3e1e26a99bae19d5545b4ee3d4", "size": "1952", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/gem_fresh/calculator.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "14177" } ], "symlink_target": "" }
package org.apache.cloudstack.api.command.user.loadbalancer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import com.cloud.utils.exception.CloudRuntimeException; import org.apache.log4j.Logger; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.BaseAsyncCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; import org.apache.cloudstack.api.response.FirewallRuleResponse; import org.apache.cloudstack.api.response.SuccessResponse; import org.apache.cloudstack.api.response.UserVmResponse; import org.apache.cloudstack.context.CallContext; import com.cloud.event.EventTypes; import com.cloud.exception.InvalidParameterValueException; import com.cloud.network.rules.LoadBalancer; import com.cloud.user.Account; import com.cloud.utils.StringUtils; import com.cloud.utils.net.NetUtils; import com.cloud.vm.VirtualMachine; @APICommand(name = "assignToLoadBalancerRule", description = "Assigns virtual machine or a list of virtual machines to a load balancer rule.", responseObject = SuccessResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(AssignToLoadBalancerRuleCmd.class.getName()); private static final String s_name = "assigntoloadbalancerruleresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, required = true, description = "the ID of the load balancer rule") private Long id; @Parameter(name = ApiConstants.VIRTUAL_MACHINE_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = UserVmResponse.class, description = "the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)") private List<Long> virtualMachineIds; @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID_IP, type = CommandType.MAP, description = "VM ID and IP map, vmidipmap[0].vmid=1 vmidipmap[0].ip=10.1.1.75", since = "4.4") private Map vmIdIpMap; ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// public Long getLoadBalancerId() { return id; } public List<Long> getVirtualMachineIds() { return virtualMachineIds; } public Map<Long, String> getVmIdIpMap() { return vmIdIpMap; } ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @Override public String getCommandName() { return s_name; } @Override public long getEntityOwnerId() { LoadBalancer lb = _entityMgr.findById(LoadBalancer.class, getLoadBalancerId()); if (lb == null) { return Account.ACCOUNT_ID_SYSTEM; // bad id given, parent this command to SYSTEM so ERROR events are tracked } return lb.getAccountId(); } @Override public String getEventType() { return EventTypes.EVENT_ASSIGN_TO_LOAD_BALANCER_RULE; } @Override public String getEventDescription() { return "applying instances for load balancer: " + getLoadBalancerId() + " (ids: " + StringUtils.join(getVirtualMachineIds(), ",") + ")"; } public Map<Long, List<String>> getVmIdIpListMap() { Map<Long, List<String>> vmIdIpsMap = new HashMap<Long, List<String>>(); if (vmIdIpMap != null && !vmIdIpMap.isEmpty()) { Collection idIpsCollection = vmIdIpMap.values(); Iterator iter = idIpsCollection.iterator(); while (iter.hasNext()) { HashMap<String, String> idIpsMap = (HashMap<String, String>)iter.next(); String vmId = idIpsMap.get("vmid"); String vmIp = idIpsMap.get("vmip"); VirtualMachine lbvm = _entityMgr.findByUuid(VirtualMachine.class, vmId); if (lbvm == null) { throw new InvalidParameterValueException("Unable to find virtual machine ID: " + vmId); } //check wether the given ip is valid ip or not if (vmIp == null || !NetUtils.isValidIp4(vmIp)) { throw new InvalidParameterValueException("Invalid ip address "+ vmIp +" passed in vmidipmap for " + "vmid " + vmId); } Long longVmId = lbvm.getId(); List<String> ipsList = null; if (vmIdIpsMap.containsKey(longVmId)) { ipsList = vmIdIpsMap.get(longVmId); } else { ipsList = new ArrayList<String>(); } ipsList.add(vmIp); vmIdIpsMap.put(longVmId, ipsList); } } return vmIdIpsMap; } @Override public void execute() { CallContext.current().setEventDetails("Load balancer Id: " + getLoadBalancerId() + " VmIds: " + StringUtils.join(getVirtualMachineIds(), ",")); Map<Long, List<String>> vmIdIpsMap = getVmIdIpListMap(); boolean result = false; try { result = _lbService.assignToLoadBalancer(getLoadBalancerId(), virtualMachineIds, vmIdIpsMap); }catch (CloudRuntimeException ex) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign load balancer rule"); } if (result) { SuccessResponse response = new SuccessResponse(getCommandName()); setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign load balancer rule"); } } @Override public String getSyncObjType() { return BaseAsyncCmd.networkSyncObject; } @Override public Long getSyncObjId() { LoadBalancer lb = _lbService.findById(id); if (lb == null) { throw new InvalidParameterValueException("Unable to find load balancer rule: " + id); } return lb.getNetworkId(); } }
{ "content_hash": "93d7b9ca1095eabd552280bf81d3165c", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 151, "avg_line_length": 37.527472527472526, "alnum_prop": 0.6001464128843338, "repo_name": "GabrielBrascher/cloudstack", "id": "1e730370801430930e4952038ebde59089895039", "size": "7631", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "9979" }, { "name": "C#", "bytes": "2356211" }, { "name": "CSS", "bytes": "42504" }, { "name": "Dockerfile", "bytes": "4189" }, { "name": "FreeMarker", "bytes": "4887" }, { "name": "Groovy", "bytes": "146420" }, { "name": "HTML", "bytes": "53626" }, { "name": "Java", "bytes": "38859783" }, { "name": "JavaScript", "bytes": "995137" }, { "name": "Less", "bytes": "28250" }, { "name": "Makefile", "bytes": "871" }, { "name": "Python", "bytes": "12977377" }, { "name": "Ruby", "bytes": "22732" }, { "name": "Shell", "bytes": "744445" }, { "name": "Vue", "bytes": "2012353" }, { "name": "XSLT", "bytes": "57835" } ], "symlink_target": "" }
using System.Collections.Generic; using System.Composition.Hosting; using System.IO; using System.Linq; using System.Reflection; using System.Threading.Tasks; using OmniSharp.Models.V2; using OmniSharp.Roslyn.CSharp.Services; using OmniSharp.Roslyn.CSharp.Services.CodeActions; using OmniSharp.Roslyn.CSharp.Services.Refactoring.V2; using OmniSharp.Services; using OmniSharp.Tests; using Xunit; namespace OmniSharp.Roslyn.CSharp.Tests { /* Test todo list: * Sort Using was removed with NRefactory var source = @"using MyNamespace3; using MyNamespace4; using MyNamespace2; using System; u$sing MyNamespace1;"; var expected = @"using System; using MyNamespace1; using MyNamespace2; using MyNamespace3; using MyNamespace4;"; */ public class CodingActionsV2Facts : IClassFixture<RoslynTestFixture> { private readonly string BufferPath = $"{Path.DirectorySeparatorChar}somepath{Path.DirectorySeparatorChar}buffer.cs"; private OmnisharpWorkspace _omnisharpWorkspace; private CompositionHost _pluginHost; private readonly RoslynTestFixture _fixture; public CodingActionsV2Facts(RoslynTestFixture fixture) { _fixture = fixture; } private CompositionHost PluginHost { get { if (_pluginHost == null) { _pluginHost = TestHelpers.CreatePluginHost( new Assembly[] { typeof(RoslynCodeActionProvider).GetTypeInfo().Assembly, typeof(GetCodeActionsService).GetTypeInfo().Assembly }); } return _pluginHost; } } private async Task<OmnisharpWorkspace> GetOmniSharpWorkspace(OmniSharp.Models.Request request) { if (_omnisharpWorkspace == null) { _omnisharpWorkspace = await TestHelpers.CreateSimpleWorkspace( PluginHost, request.Buffer, BufferPath); } return _omnisharpWorkspace; } [Fact] public async Task Can_get_code_actions_from_roslyn() { var source = @"public class Class1 { public void Whatever() { Gu$id.NewGuid(); } }"; var refactorings = await FindRefactoringNamesAsync(source); Assert.Contains("using System;", refactorings); } [Fact] public async Task Can_remove_unnecessary_usings() { var source = @"using MyNamespace3; using MyNamespace4; using MyNamespace2; using System; u$sing MyNamespace1; public class c {public c() {Guid.NewGuid();}}"; var expected = @"using System; public class c {public c() {Guid.NewGuid();}}"; var response = await RunRefactoring(source, "Remove Unnecessary Usings"); AssertIgnoringIndent(expected, response.Changes.First().Buffer); } [Fact] public async Task Can_get_ranged_code_action() { var source = @"public class Class1 { public void Whatever() { $Console.Write(""should be using System;"");$ } }"; var refactorings = await FindRefactoringNamesAsync(source); Assert.Contains("Extract Method", refactorings); } [Fact] public async Task Can_extract_method() { var source = @"public class Class1 { public void Whatever() { $Console.Write(""should be using System;"");$ } }"; var expected = @"public class Class1 { public void Whatever() { NewMethod(); } private static void NewMethod() { Console.Write(""should be using System;""); } }"; var response = await RunRefactoring(source, "Extract Method"); AssertIgnoringIndent(expected, response.Changes.First().Buffer); } [Fact(Skip = "Test is still broken because the removal of NRefactory.")] public async Task Can_create_a_class_with_a_new_method_in_adjacent_file() { var source = @"namespace MyNamespace public class Class1 { public void Whatever() { MyNew$Class.DoSomething(); } }"; var response = await RunRefactoring(source, "Generate type", true); var change = response.Changes.First(); Assert.Equal($"{Path.DirectorySeparatorChar}somepath{Path.DirectorySeparatorChar}MyNewClass.cs", change.FileName); var expected = @"namespace MyNamespace { internal class MyNewClass { } }"; AssertIgnoringIndent(expected, change.Changes.First().NewText); source = @"namespace MyNamespace public class Class1 { public void Whatever() { MyNewClass.DoS$omething(); } }"; response = await RunRefactoring(source, "Generate method 'MyNewClass.DoSomething'", true); expected = @"internal static void DoSomething() { throw new NotImplementedException(); } "; change = response.Changes.First(); AssertIgnoringIndent(expected, change.Changes.First().NewText); } private void AssertIgnoringIndent(string expected, string actual) { Assert.Equal(TrimLines(expected), TrimLines(actual), false, true, true); } private string TrimLines(string source) { return string.Join("\n", source.Split('\n').Select(s => s.Trim())); } private async Task<RunCodeActionResponse> RunRefactoring( string source, string refactoringName, bool wantsChanges = false) { IEnumerable<OmniSharpCodeAction> refactorings = await FindRefactoringsAsync(source); Assert.Contains(refactoringName, refactorings.Select(a => a.Name)); var identifier = refactorings.First(action => action.Name.Equals(refactoringName)).Identifier; return await RunRefactoringsAsync(source, identifier, wantsChanges); } private async Task<IEnumerable<string>> FindRefactoringNamesAsync(string source) { var codeActions = await FindRefactoringsAsync(source); return codeActions.Select(a => a.Name); } private async Task<IEnumerable<OmniSharpCodeAction>> FindRefactoringsAsync(string source) { var request = CreateGetCodeActionsRequest(source); var workspace = await GetOmniSharpWorkspace(request); var codeActions = CreateCodeActionProviders(); var controller = new GetCodeActionsService(workspace, codeActions, _fixture.FakeLoggerFactory); var response = await controller.Handle(request); return response.CodeActions; } private async Task<RunCodeActionResponse> RunRefactoringsAsync( string source, string identifier, bool wantsChanges = false) { var request = CreateRunCodeActionRequest(source, identifier, wantsChanges); var workspace = await GetOmniSharpWorkspace(request); var codeActions = CreateCodeActionProviders(); var controller = new RunCodeActionService(workspace, codeActions, _fixture.FakeLoggerFactory); var response = await controller.Handle(request); return response; } private GetCodeActionsRequest CreateGetCodeActionsRequest(string source) { var range = TestHelpers.GetRangeFromDollars(source); return new GetCodeActionsRequest { Line = range.Start.Line, Column = range.Start.Column, FileName = BufferPath, Buffer = source.Replace("$", ""), Selection = GetSelection(range) }; } private RunCodeActionRequest CreateRunCodeActionRequest(string source, string identifier, bool wantChanges) { var range = TestHelpers.GetRangeFromDollars(source); var selection = GetSelection(range); return new RunCodeActionRequest { Line = range.Start.Line, Column = range.Start.Column, Selection = selection, FileName = BufferPath, Buffer = source.Replace("$", ""), Identifier = identifier, WantsTextChanges = wantChanges }; } private static Range GetSelection(TestHelpers.Range range) { Range selection = null; if (!range.IsEmpty) { var start = new Point { Line = range.Start.Line, Column = range.Start.Column }; var end = new Point { Line = range.End.Line, Column = range.End.Column }; selection = new Range { Start = start, End = end }; } return selection; } private IEnumerable<ICodeActionProvider> CreateCodeActionProviders() { var loader = _fixture.CreateAssemblyLoader(_fixture.FakeLogger); var hostServicesProvider = new RoslynFeaturesHostServicesProvider(loader); yield return new RoslynCodeActionProvider(hostServicesProvider); } } }
{ "content_hash": "835b040ddebabaada9944baa99ca192a", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 126, "avg_line_length": 33.83647798742138, "alnum_prop": 0.5285315985130111, "repo_name": "nabychan/omnisharp-roslyn", "id": "20d5e644868e0e70209d94d707257beb92cce099", "size": "10760", "binary": false, "copies": "2", "ref": "refs/heads/dev", "path": "tests/OmniSharp.Roslyn.CSharp.Tests/CodeActionsV2Facts.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "720566" }, { "name": "PowerShell", "bytes": "3503" }, { "name": "Shell", "bytes": "2512" } ], "symlink_target": "" }
package edu.brown.cs.systems.pubsub.message; public interface TopicMessage { public byte[] topic(); public byte[] message(); }
{ "content_hash": "f65d341996bfa5b5bfa516cf9fe029c2", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 44, "avg_line_length": 15.444444444444445, "alnum_prop": 0.6906474820143885, "repo_name": "brownsys/tracing-framework", "id": "c74486c6d5fe535c41732d103b4013d30d5296d8", "size": "139", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tracingplane/pubsub/src/main/java/edu/brown/cs/systems/pubsub/message/TopicMessage.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AspectJ", "bytes": "60380" }, { "name": "Batchfile", "bytes": "322" }, { "name": "C", "bytes": "1797" }, { "name": "CSS", "bytes": "14905" }, { "name": "HTML", "bytes": "81192" }, { "name": "Java", "bytes": "1244234" }, { "name": "JavaScript", "bytes": "356400" }, { "name": "Perl", "bytes": "38490" }, { "name": "Ruby", "bytes": "43103" }, { "name": "Scala", "bytes": "24799" }, { "name": "Shell", "bytes": "870" } ], "symlink_target": "" }
/* IPC module for ISH */ /** * IPC - Inter Processor Communication * ----------------------------------- * * IPC is a bi-directional doorbell based message passing interface sans * session and transport layers, between hardware blocks. ISH uses IPC to * communicate with the Host, PMC (Power Management Controller), CSME * (Converged Security and Manageability Engine), Audio, Graphics and ISP. * * Both the initiator and target ends each have a 32-bit doorbell register and * 128-byte message regions. In addition, the following register pairs help in * synchronizing IPC. * * - Peripheral Interrupt Status Register (PISR) * - Peripheral Interrupt Mask Register (PIMR) * - Doorbell Clear Status Register (DB CSR) */ #include "builtin/assert.h" #include "registers.h" #include "console.h" #include "task.h" #include "util.h" #include "ipc_heci.h" #include "ish_fwst.h" #include "queue.h" #include "hooks.h" #include "hwtimer.h" #define CPUTS(outstr) cputs(CC_LPC, outstr) #define CPRINTS(format, args...) cprints(CC_LPC, format, ##args) #define CPRINTF(format, args...) cprintf(CC_LPC, format, ##args) /* * comminucation protocol is defined in Linux Documentation * <kernel_root>/Documentation/hid/intel-ish-hid.txt */ /* MNG commands */ /* The ipc_mng_task manages IPC link. It should be the highest priority */ #define MNG_RX_CMPL_ENABLE 0 #define MNG_RX_CMPL_DISABLE 1 #define MNG_RX_CMPL_INDICATION 2 #define MNG_RESET_NOTIFY 3 #define MNG_RESET_NOTIFY_ACK 4 #define MNG_SYNC_FW_CLOCK 5 #define MNG_ILLEGAL_CMD 0xFF /* Doorbell */ #define IPC_DB_MSG_LENGTH_FIELD 0x3FF #define IPC_DB_MSG_LENGTH_SHIFT 0 #define IPC_DB_MSG_LENGTH_MASK \ (IPC_DB_MSG_LENGTH_FIELD << IPC_DB_MSG_LENGTH_SHIFT) #define IPC_DB_PROTOCOL_FIELD 0x0F #define IPC_DB_PROTOCOL_SHIFT 10 #define IPC_DB_PROTOCOL_MASK (IPC_DB_PROTOCOL_FIELD << IPC_DB_PROTOCOL_SHIFT) #define IPC_DB_CMD_FIELD 0x0F #define IPC_DB_CMD_SHIFT 16 #define IPC_DB_CMD_MASK (IPC_DB_CMD_FIELD << IPC_DB_CMD_SHIFT) #define IPC_DB_BUSY_SHIFT 31 #define IPC_DB_BUSY_MASK BIT(IPC_DB_BUSY_SHIFT) #define IPC_DB_MSG_LENGTH(drbl) \ (((drbl)&IPC_DB_MSG_LENGTH_MASK) >> IPC_DB_MSG_LENGTH_SHIFT) #define IPC_DB_PROTOCOL(drbl) \ (((drbl)&IPC_DB_PROTOCOL_MASK) >> IPC_DB_PROTOCOL_SHIFT) #define IPC_DB_CMD(drbl) (((drbl)&IPC_DB_CMD_MASK) >> IPC_DB_CMD_SHIFT) #define IPC_DB_BUSY(drbl) (!!((drbl)&IPC_DB_BUSY_MASK)) #define IPC_BUILD_DB(length, proto, cmd, busy) \ (((busy) << IPC_DB_BUSY_SHIFT) | ((cmd) << IPC_DB_CMD_SHIFT) | \ ((proto) << IPC_DB_PROTOCOL_SHIFT) | \ ((length) << IPC_DB_MSG_LENGTH_SHIFT)) #define IPC_BUILD_MNG_DB(cmd, length) \ IPC_BUILD_DB(length, IPC_PROTOCOL_MNG, cmd, 1) #define IPC_BUILD_HECI_DB(length) IPC_BUILD_DB(length, IPC_PROTOCOL_HECI, 0, 1) #define IPC_MSG_MAX_SIZE 0x80 #define IPC_HOST_MSG_QUEUE_SIZE 8 #define IPC_PMC_MSG_QUEUE_SIZE 2 #define IPC_HANDLE_PEER_ID_SHIFT 4 #define IPC_HANDLE_PROTOCOL_SHIFT 0 #define IPC_HANDLE_PROTOCOL_MASK 0x0F #define IPC_BUILD_HANDLE(peer_id, protocol) \ ((ipc_handle_t)(((peer_id) << IPC_HANDLE_PEER_ID_SHIFT) | (protocol))) #define IPC_BUILD_MNG_HANDLE(peer_id) \ IPC_BUILD_HANDLE((peer_id), IPC_PROTOCOL_MNG) #define IPC_BUILD_HOST_MNG_HANDLE() IPC_BUILD_MNG_HANDLE(IPC_PEER_ID_HOST) #define IPC_HANDLE_PEER_ID(handle) \ ((uint32_t)(handle) >> IPC_HANDLE_PEER_ID_SHIFT) #define IPC_HANDLE_PROTOCOL(handle) \ ((uint32_t)(handle)&IPC_HANDLE_PROTOCOL_MASK) #define IPC_IS_VALID_HANDLE(handle) \ (IPC_HANDLE_PEER_ID(handle) < IPC_PEERS_COUNT && \ IPC_HANDLE_PROTOCOL(handle) < IPC_PROTOCOL_COUNT) struct ipc_msg { uint32_t drbl; uint32_t *timestamp_of_outgoing_doorbell; uint8_t payload[IPC_MSG_MAX_SIZE]; } __packed; struct ipc_rst_payload { uint16_t reset_id; uint16_t reserved; }; struct ipc_oob_msg { uint32_t address; uint32_t length; }; struct ipc_msg_event { task_id_t task_id; uint32_t event; uint8_t enabled; }; /* * IPC interface context * This is per-IPC context. */ struct ipc_if_ctx { volatile uint8_t *in_msg_reg; volatile uint8_t *out_msg_reg; volatile uint32_t *in_drbl_reg; volatile uint32_t *out_drbl_reg; uint32_t clr_busy_bit; uint32_t pimr_2ish_bit; uint32_t pimr_2host_clearing_bit; uint8_t irq_in; uint8_t irq_clr; uint16_t reset_id; struct ipc_msg_event msg_events[IPC_PROTOCOL_COUNT]; struct mutex lock; struct mutex write_lock; struct queue tx_queue; uint8_t is_tx_ipc_busy; uint8_t initialized; }; /* list of peer contexts */ static struct ipc_if_ctx ipc_peer_ctxs[IPC_PEERS_COUNT] = { [IPC_PEER_ID_HOST] = { .in_msg_reg = IPC_HOST2ISH_MSG_BASE, .out_msg_reg = IPC_ISH2HOST_MSG_BASE, .in_drbl_reg = IPC_HOST2ISH_DOORBELL_ADDR, .out_drbl_reg = IPC_ISH2HOST_DOORBELL_ADDR, .clr_busy_bit = IPC_DB_CLR_STS_ISH2HOST_BIT, .pimr_2ish_bit = IPC_PIMR_HOST2ISH_BIT, .pimr_2host_clearing_bit = IPC_PIMR_ISH2HOST_CLR_BIT, .irq_in = ISH_IPC_HOST2ISH_IRQ, .irq_clr = ISH_IPC_ISH2HOST_CLR_IRQ, .tx_queue = QUEUE_NULL(IPC_HOST_MSG_QUEUE_SIZE, struct ipc_msg), }, /* Other peers (PMC, CSME, etc) to be added when required */ }; static inline struct ipc_if_ctx *ipc_get_if_ctx(const uint32_t peer_id) { return &ipc_peer_ctxs[peer_id]; } static inline struct ipc_if_ctx *ipc_handle_to_if_ctx(const ipc_handle_t handle) { return ipc_get_if_ctx(IPC_HANDLE_PEER_ID(handle)); } static inline void ipc_enable_pimr_db_interrupt(const struct ipc_if_ctx *ctx) { IPC_PIMR |= ctx->pimr_2ish_bit; } static inline void ipc_disable_pimr_db_interrupt(const struct ipc_if_ctx *ctx) { IPC_PIMR &= ~ctx->pimr_2ish_bit; } static inline void ipc_enable_pimr_clearing_interrupt(const struct ipc_if_ctx *ctx) { IPC_PIMR |= ctx->pimr_2host_clearing_bit; } static inline void ipc_disable_pimr_clearing_interrupt(const struct ipc_if_ctx *ctx) { IPC_PIMR &= ~ctx->pimr_2host_clearing_bit; } static void write_payload_and_ring_drbl(const struct ipc_if_ctx *ctx, uint32_t drbl, const uint8_t *payload, size_t payload_size) { memcpy((void *)(ctx->out_msg_reg), payload, payload_size); *(ctx->out_drbl_reg) = drbl; } static int ipc_write_raw_timestamp(struct ipc_if_ctx *ctx, uint32_t drbl, const uint8_t *payload, size_t payload_size, uint32_t *timestamp) { struct queue *q = &ctx->tx_queue; struct ipc_msg *msg; size_t tail, space; int res = 0; mutex_lock(&ctx->write_lock); ipc_disable_pimr_clearing_interrupt(ctx); if (ctx->is_tx_ipc_busy) { space = queue_space(q); if (space) { tail = q->state->tail & (q->buffer_units - 1); msg = (struct ipc_msg *)q->buffer + tail; msg->drbl = drbl; msg->timestamp_of_outgoing_doorbell = timestamp; memcpy(msg->payload, payload, payload_size); queue_advance_tail(q, 1); } else { CPRINTS("tx queue is full"); res = -IPC_ERR_TX_QUEUE_FULL; } ipc_enable_pimr_clearing_interrupt(ctx); goto write_unlock; } ctx->is_tx_ipc_busy = 1; ipc_enable_pimr_clearing_interrupt(ctx); write_payload_and_ring_drbl(ctx, drbl, payload, payload_size); /* We wrote inline, take timestamp now */ if (timestamp) *timestamp = __hw_clock_source_read(); write_unlock: mutex_unlock(&ctx->write_lock); return res; } static int ipc_write_raw(struct ipc_if_ctx *ctx, uint32_t drbl, const uint8_t *payload, size_t payload_size) { return ipc_write_raw_timestamp(ctx, drbl, payload, payload_size, NULL); } static int ipc_send_reset_notify(const ipc_handle_t handle) { struct ipc_rst_payload *ipc_rst; struct ipc_if_ctx *ctx; struct ipc_msg msg; ctx = ipc_handle_to_if_ctx(handle); ctx->reset_id = (uint16_t)ish_fwst_get_reset_id(); ipc_rst = (struct ipc_rst_payload *)msg.payload; ipc_rst->reset_id = ctx->reset_id; msg.drbl = IPC_BUILD_MNG_DB(MNG_RESET_NOTIFY, sizeof(*ipc_rst)); ipc_write_raw(ctx, msg.drbl, msg.payload, IPC_DB_MSG_LENGTH(msg.drbl)); return 0; } static int ipc_send_cmpl_indication(struct ipc_if_ctx *ctx) { struct ipc_msg msg = { 0 }; msg.drbl = IPC_BUILD_MNG_DB(MNG_RX_CMPL_INDICATION, 0); ipc_write_raw(ctx, msg.drbl, msg.payload, IPC_DB_MSG_LENGTH(msg.drbl)); return 0; } static int ipc_get_protocol_data(const struct ipc_if_ctx *ctx, const uint32_t protocol, uint8_t *buf, const size_t buf_size) { int len = 0, payload_size; uint8_t *src = NULL, *dest = NULL; struct ipc_msg *msg; uint32_t drbl_val; drbl_val = *(ctx->in_drbl_reg); payload_size = IPC_DB_MSG_LENGTH(drbl_val); if (payload_size > IPC_MAX_PAYLOAD_SIZE) { CPRINTS("invalid msg : payload is too big"); return -IPC_ERR_INVALID_MSG; } switch (protocol) { case IPC_PROTOCOL_HECI: /* copy only payload which is a heci packet */ len = payload_size; break; case IPC_PROTOCOL_MNG: /* copy including doorbell which forms a ipc packet */ len = payload_size + sizeof(drbl_val); break; default: CPRINTS("protocol %d not supported yet", protocol); break; } if (len > buf_size) { CPRINTS("buffer is smaller than payload"); return -IPC_ERR_TOO_SMALL_BUFFER; } if (IS_ENABLED(IPC_HECI_DEBUG)) CPRINTF("ipc p=%d, db=0x%0x, payload_size=%d\n", protocol, drbl_val, IPC_DB_MSG_LENGTH(drbl_val)); switch (protocol) { case IPC_PROTOCOL_HECI: src = (uint8_t *)ctx->in_msg_reg; dest = buf; break; case IPC_PROTOCOL_MNG: src = (uint8_t *)ctx->in_msg_reg; msg = (struct ipc_msg *)buf; msg->drbl = drbl_val; dest = msg->payload; break; default: break; } if (src && dest) memcpy(dest, src, payload_size); return len; } static void set_pimr_and_send_rx_complete(struct ipc_if_ctx *ctx) { ipc_enable_pimr_db_interrupt(ctx); ipc_send_cmpl_indication(ctx); } static void handle_msg_recv_interrupt(const uint32_t peer_id) { struct ipc_if_ctx *ctx; uint32_t drbl_val, payload_size, protocol, invalid_msg = 0; ctx = ipc_get_if_ctx(peer_id); ipc_disable_pimr_db_interrupt(ctx); drbl_val = *(ctx->in_drbl_reg); protocol = IPC_DB_PROTOCOL(drbl_val); payload_size = IPC_DB_MSG_LENGTH(drbl_val); if (payload_size > IPC_MSG_MAX_SIZE) invalid_msg = 1; if (!ctx->msg_events[protocol].enabled) invalid_msg = 2; if (!invalid_msg) { /* send event to task */ task_set_event(ctx->msg_events[protocol].task_id, ctx->msg_events[protocol].event); } else { CPRINTS("discard msg (%d) : %d", protocol, invalid_msg); *(ctx->in_drbl_reg) = 0; set_pimr_and_send_rx_complete(ctx); } } static void handle_busy_clear_interrupt(const uint32_t peer_id) { struct ipc_if_ctx *ctx; struct ipc_msg *msg; struct queue *q; size_t head; ctx = ipc_get_if_ctx(peer_id); /* * Resetting interrupt status bit should be done * before sending an item in tx_queue. */ IPC_BUSY_CLEAR = ctx->clr_busy_bit; /* * No need to use sync mechanism here since the accesing the queue * happens only when either this IRQ is disabled or * in ISR context(here) of this IRQ. */ if (!queue_is_empty(&ctx->tx_queue)) { q = &ctx->tx_queue; head = q->state->head & (q->buffer_units - 1); msg = (struct ipc_msg *)(q->buffer + head * q->unit_bytes); write_payload_and_ring_drbl(ctx, msg->drbl, msg->payload, IPC_DB_MSG_LENGTH(msg->drbl)); if (msg->timestamp_of_outgoing_doorbell) *msg->timestamp_of_outgoing_doorbell = __hw_clock_source_read(); queue_advance_head(q, 1); } else { ctx->is_tx_ipc_busy = 0; } } /** * IPC interrupts are received by the FW when a) Host SW rings doorbell and * b) when Host SW clears doorbell busy bit [31]. * * Doorbell Register (DB) bits * ----+-------+--------+-----------+--------+------------+-------------------- * 31 | 30 29 | 28-20 |19 18 17 16| 15 14 | 13 12 11 10| 9 8 7 6 5 4 3 2 1 0 * ----+-------+--------+-----------+--------+------------+-------------------- * Busy|Options|Reserved| Command |Reserved| Protocol | Message Length * ----+-------+--------+-----------+--------+------------+-------------------- * * ISH Peripheral Interrupt Status Register: * Bit 0 - If set, indicates interrupt was caused by setting Host2ISH DB * * ISH Peripheral Interrupt Mask Register * Bit 0 - If set, mask interrupt caused by Host2ISH DB * * ISH Peripheral DB Clear Status Register * Bit 0 - If set, indicates interrupt was caused by clearing Host2ISH DB */ static void ipc_host2ish_isr(void) { uint32_t pisr = IPC_PISR; uint32_t pimr = IPC_PIMR; /* * Ensure that the host IPC write power is requested after getting an * interrupt otherwise the resume message will never get delivered (via * host ipc communication). Resume is where we would like to restore all * power settings, but that is too late for this power request. */ if (IS_ENABLED(CHIP_FAMILY_ISH5)) PMU_VNN_REQ = VNN_REQ_IPC_HOST_WRITE & ~PMU_VNN_REQ; if ((pisr & IPC_PISR_HOST2ISH_BIT) && (pimr & IPC_PIMR_HOST2ISH_BIT)) handle_msg_recv_interrupt(IPC_PEER_ID_HOST); } #ifndef CONFIG_ISH_HOST2ISH_COMBINED_ISR DECLARE_IRQ(ISH_IPC_HOST2ISH_IRQ, ipc_host2ish_isr); #endif static void ipc_host2ish_busy_clear_isr(void) { uint32_t busy_clear = IPC_BUSY_CLEAR; uint32_t pimr = IPC_PIMR; if ((busy_clear & IPC_DB_CLR_STS_ISH2HOST_BIT) && (pimr & IPC_PIMR_ISH2HOST_CLR_BIT)) handle_busy_clear_interrupt(IPC_PEER_ID_HOST); } #ifndef CONFIG_ISH_HOST2ISH_COMBINED_ISR DECLARE_IRQ(ISH_IPC_ISH2HOST_CLR_IRQ, ipc_host2ish_busy_clear_isr); #endif static __maybe_unused void ipc_host2ish_combined_isr(void) { ipc_host2ish_isr(); ipc_host2ish_busy_clear_isr(); } #ifdef CONFIG_ISH_HOST2ISH_COMBINED_ISR DECLARE_IRQ(ISH_IPC_HOST2ISH_IRQ, ipc_host2ish_combined_isr); #endif int ipc_write_timestamp(const ipc_handle_t handle, const void *buf, const size_t buf_size, uint32_t *timestamp) { int ret; struct ipc_if_ctx *ctx; uint32_t drbl = 0; const uint8_t *payload = NULL; int payload_size; uint32_t protocol; if (!IPC_IS_VALID_HANDLE(handle)) return -EC_ERROR_INVAL; protocol = IPC_HANDLE_PROTOCOL(handle); ctx = ipc_handle_to_if_ctx(handle); if (ctx->initialized == 0) { CPRINTS("open_ipc() for the peer is never called"); return -EC_ERROR_INVAL; } if (!ctx->msg_events[protocol].enabled) { CPRINTS("call open_ipc() for the protocol first"); return -EC_ERROR_INVAL; } switch (protocol) { case IPC_PROTOCOL_BOOT: break; case IPC_PROTOCOL_HECI: drbl = IPC_BUILD_HECI_DB(buf_size); payload = buf; break; case IPC_PROTOCOL_MCTP: break; case IPC_PROTOCOL_MNG: drbl = ((struct ipc_msg *)buf)->drbl; payload = ((struct ipc_msg *)buf)->payload; break; case IPC_PROTOCOL_ECP: /* TODO : EC protocol */ break; } payload_size = IPC_DB_MSG_LENGTH(drbl); if (payload_size > IPC_MSG_MAX_SIZE) { /* too much input */ return -EC_ERROR_OVERFLOW; } ret = ipc_write_raw_timestamp(ctx, drbl, payload, payload_size, timestamp); if (ret) return ret; return buf_size; } ipc_handle_t ipc_open(const enum ipc_peer_id peer_id, const enum ipc_protocol protocol, const uint32_t event) { struct ipc_if_ctx *ctx; if (protocol >= IPC_PROTOCOL_COUNT || peer_id >= IPC_PEERS_COUNT) return IPC_INVALID_HANDLE; ctx = ipc_get_if_ctx(peer_id); mutex_lock(&ctx->lock); if (ctx->msg_events[protocol].enabled) { mutex_unlock(&ctx->lock); return IPC_INVALID_HANDLE; } ctx->msg_events[protocol].task_id = task_get_current(); ctx->msg_events[protocol].enabled = 1; ctx->msg_events[protocol].event = event; /* For HECI protocol, set HECI UP status when IPC link is ready */ if (peer_id == IPC_PEER_ID_HOST && protocol == IPC_PROTOCOL_HECI && ish_fwst_is_ilup_set()) ish_fwst_set_hup(); if (ctx->initialized == 0) { task_enable_irq(ctx->irq_in); if (!IS_ENABLED(CONFIG_ISH_HOST2ISH_COMBINED_ISR)) task_enable_irq(ctx->irq_clr); ipc_enable_pimr_db_interrupt(ctx); ipc_enable_pimr_clearing_interrupt(ctx); ctx->initialized = 1; } mutex_unlock(&ctx->lock); return IPC_BUILD_HANDLE(peer_id, protocol); } static void handle_mng_commands(const ipc_handle_t handle, const struct ipc_msg *msg) { struct ipc_rst_payload *ipc_rst; struct ipc_if_ctx *ctx; uint32_t peer_id = IPC_HANDLE_PEER_ID(handle); ctx = ipc_handle_to_if_ctx(handle); switch (IPC_DB_CMD(msg->drbl)) { case MNG_RX_CMPL_ENABLE: case MNG_RX_CMPL_DISABLE: case MNG_RX_CMPL_INDICATION: case MNG_RESET_NOTIFY: CPRINTS("msg not handled %d", IPC_DB_CMD(msg->drbl)); break; case MNG_RESET_NOTIFY_ACK: ipc_rst = (struct ipc_rst_payload *)msg->payload; if (peer_id == IPC_PEER_ID_HOST && ipc_rst->reset_id == ctx->reset_id) { ish_fwst_set_ilup(); if (ctx->msg_events[IPC_PROTOCOL_HECI].enabled) ish_fwst_set_hup(); } break; case MNG_SYNC_FW_CLOCK: /* Not supported currently, but kernel sends this about ~20s */ break; } } static int do_ipc_read(struct ipc_if_ctx *ctx, const uint32_t protocol, uint8_t *buf, const size_t buf_size) { int len; len = ipc_get_protocol_data(ctx, protocol, buf, buf_size); *(ctx->in_drbl_reg) = 0; set_pimr_and_send_rx_complete(ctx); return len; } static int ipc_check_read_validity(const struct ipc_if_ctx *ctx, const uint32_t protocol) { if (ctx->initialized == 0) return -EC_ERROR_INVAL; if (!ctx->msg_events[protocol].enabled) return -EC_ERROR_INVAL; /* ipc_read() should be called by the same task called ipc_open() */ if (ctx->msg_events[protocol].task_id != task_get_current()) return -IPC_ERR_INVALID_TASK; return 0; } /* * ipc_read should be called by the same task context which called ipc_open() */ int ipc_read(const ipc_handle_t handle, void *buf, const size_t buf_size, int timeout_us) { struct ipc_if_ctx *ctx; uint32_t events, protocol, drbl_protocol, drbl_val; int ret; if (!IPC_IS_VALID_HANDLE(handle)) return -EC_ERROR_INVAL; protocol = IPC_HANDLE_PROTOCOL(handle); ctx = ipc_handle_to_if_ctx(handle); ret = ipc_check_read_validity(ctx, protocol); if (ret) return ret; if (timeout_us) { events = task_wait_event_mask(ctx->msg_events[protocol].event, timeout_us); if (events & TASK_EVENT_TIMER) return -EC_ERROR_TIMEOUT; if (!(events & ctx->msg_events[protocol].event)) return -EC_ERROR_UNKNOWN; } else { /* check if msg for the protocol is available */ drbl_val = *(ctx->in_drbl_reg); drbl_protocol = IPC_DB_PROTOCOL(drbl_val); if (!(protocol == drbl_protocol) || !IPC_DB_BUSY(drbl_val)) return -IPC_ERR_MSG_NOT_AVAILABLE; } return do_ipc_read(ctx, protocol, buf, buf_size); } /* event flag for MNG msg */ #define EVENT_FLAG_BIT_MNG_MSG TASK_EVENT_CUSTOM_BIT(0) /* * This task handles MNG messages */ void ipc_mng_task(void) { int payload_size; struct ipc_msg msg; ipc_handle_t handle; /* * Ensure that power for host IPC writes is requested and ack'ed */ if (IS_ENABLED(CHIP_FAMILY_ISH5)) { PMU_VNN_REQ = VNN_REQ_IPC_HOST_WRITE & ~PMU_VNN_REQ; while (!(PMU_VNN_REQ_ACK & PMU_VNN_REQ_ACK_STATUS)) continue; } handle = ipc_open(IPC_PEER_ID_HOST, IPC_PROTOCOL_MNG, EVENT_FLAG_BIT_MNG_MSG); ASSERT(handle != IPC_INVALID_HANDLE); ipc_send_reset_notify(handle); while (1) { payload_size = ipc_read(handle, &msg, sizeof(msg), -1); /* allow doorbell with any payload */ if (payload_size < 0) { CPRINTS("ipc_read error. discard msg"); continue; /* TODO: retry several and exit */ } /* handle MNG commands */ handle_mng_commands(handle, &msg); } } void ipc_init(void) { int i; struct ipc_if_ctx *ctx; for (i = 0; i < IPC_PEERS_COUNT; i++) { ctx = ipc_get_if_ctx(i); queue_init(&ctx->tx_queue); } /* inform host firmware is running */ ish_fwst_set_fw_status(FWSTS_FW_IS_RUNNING); } DECLARE_HOOK(HOOK_INIT, ipc_init, HOOK_PRIO_DEFAULT);
{ "content_hash": "90ff239b164ffd4a1b27f92f1a989003", "timestamp": "", "source": "github", "line_count": 735, "max_line_length": 80, "avg_line_length": 26.632653061224488, "alnum_prop": 0.6707535121328225, "repo_name": "coreboot/chrome-ec", "id": "1fd81e3d3f29dc684c70a0edf78f74ed70008a24", "size": "19723", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "chip/ish/ipc_heci.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "153372" }, { "name": "C", "bytes": "25514204" }, { "name": "C++", "bytes": "617015" }, { "name": "CMake", "bytes": "114317" }, { "name": "Emacs Lisp", "bytes": "136" }, { "name": "Go", "bytes": "40545" }, { "name": "HTML", "bytes": "602017" }, { "name": "Makefile", "bytes": "247601" }, { "name": "Pawn", "bytes": "3004" }, { "name": "Python", "bytes": "1006209" }, { "name": "Shell", "bytes": "138354" }, { "name": "SourcePawn", "bytes": "3051" }, { "name": "Tcl", "bytes": "5238" } ], "symlink_target": "" }
""" Utilities for driving sets of parcel model integration strategies. Occasionally, a pathological set of input parameters to the parcel model will really muck up the ODE solver's ability to integrate the model. In that case, it would be nice to quietly adjust some of the numerical parameters for the ODE solver and re-submit the job. This module includes a workhorse function :func:`iterate_runs` which can serve this purpose and can serve as an example for more complex integration strategies. Alternatively, :func:`run_model`is a useful shortcut for building/running a model and snagging its output. """ from numpy import empty, nan from pandas import DataFrame from .activation import mbn2014, arg2000 from .parcel import ParcelModel from pyrcel.util import ParcelModelError def run_model( V, initial_aerosols, T, P, dt, S0=-0.0, max_steps=1000, t_end=500.0, solver="lsoda", output_fmt="smax", terminate=False, solver_kws=None, model_kws=None, ): """ Setup and run the parcel model with given solver configuration. Parameters ---------- V, T, P : float Updraft speed and parcel initial temperature and pressure. S0 : float, optional, default 0.0 Initial supersaturation, as a percent. Defaults to 100% relative humidity. initial_aerosols : array_like of :class:`AerosolSpecies` Set of aerosol populations contained in the parcel. dt : float Solver timestep, in seconds. max_steps : int, optional, default 1000 Maximum number of steps per solver iteration. Defaults to 1000; setting excessively high could produce extremely long computation times. t_end : float, optional, default 500.0 Model time in seconds after which the integration will stop. solver : string, optional, default 'lsoda' Alias of which solver to use; see :class:`Integrator` for all options. output_fmt : string, optional, default 'smax' Alias indicating which output format to use; see :class:`ParcelModel` for all options. solver_kws, model_kws : dicts, optional Additional arguments/configuration to pass to the numerical integrator or model. Returns ------- Smax : (user-defined) Output from parcel model simulation based on user-specified `output_fmt` argument. See :class:`ParcelModel` for details. Raises ------ ParcelModelError If the model fails to initialize or breaks during runtime. """ # Setup kw dicts if model_kws is None: model_kws = {} if solver_kws is None: solver_kws = {} if V <= 0: return 0.0 try: model = ParcelModel(initial_aerosols, V, T, S0, P, **model_kws) Smax = model.run( t_end, dt, max_steps, solver=solver, output_fmt=output_fmt, terminate=terminate, **solver_kws ) except ParcelModelError: return None return Smax def iterate_runs( V, initial_aerosols, T, P, S0=-0.0, dt=0.01, dt_iters=2, t_end=500.0, max_steps=500, output_fmt="smax", fail_easy=True, ): """ Iterate through several different strategies for integrating the parcel model. As long as `fail_easy` is set to `False`, the strategies this method implements are: 1. **CVODE** with a 10 second time limit and 2000 step limit. 2. **LSODA** with up to `dt_iters` iterations, where the timestep `dt` is halved each time. 3. **LSODE** with coarse tolerance and the original timestep. If these strategies all fail, the model will print a statement indicating such and return either -9999 if `output_fmt` was 'smax', or an empty array or DataFrame accordingly. Parameters ---------- V, T, P : float Updraft speed and parcel initial temperature and pressure. S0 : float, optional, default 0.0 Initial supersaturation, as a percent. Defaults to 100% relative humidity. initial_aerosols : array_like of :class:`AerosolSpecies` Set of aerosol populations contained in the parcel. dt : float Solver timestep, in seconds. dt_iters : int, optional, default 2 Number of times to halve `dt` when attempting **LSODA** solver. max_steps : int, optional, default 1000 Maximum number of steps per solver iteration. Defaults to 1000; setting excessively high could produce extremely long computation times. t_end : float, optional, default 500.0 Model time in seconds after which the integration will stop. output : string, optional, default 'smax' Alias indicating which output format to use; see :class:`ParcelModel` for all options. fail_easy : boolean, optional, default `True` If `True`, then stop after the first strategy (**CVODE**) Returns ------- Smax : (user-defined) Output from parcel model simulation based on user-specified `output` argument. See :class:`ParcelModel` for details. """ aerosols = initial_aerosols if V <= 0: return 0.0, 0.0, 0.0 # Check that there are actually aerosols to deal with aerosol_N = [a.distribution.N for a in initial_aerosols] if len(aerosol_N) == 1: if aerosol_N[0] < 0.01: return -9999.0, -9999.0, -9999.0 else: new_aerosols = [] for i in range(len(aerosol_N)): if aerosol_N[i] > 0.01: new_aerosols.append(initial_aerosols[i]) aerosols = new_aerosols[:] S_max_arg, _, _ = arg2000(V, T, P, aerosols) S_max_fn, _, _ = mbn2014(V, T, P, aerosols) dt_orig = dt * 1.0 finished = False S_max = None # Strategy 1: Try CVODE with modest tolerances. print(" Trying CVODE with default tolerance") S_max = run_model( V, aerosols, T, P, dt, S0=S0, max_steps=2000, solver="cvode", t_end=t_end, output_fmt=output_fmt, solver_kws={ "iter": "Newton", "time_limit": 10.0, "linear_solver": "DENSE", }, ) # Strategy 2: Iterate over some increasingly relaxed tolerances for LSODA. if (S_max is None) and not fail_easy: while dt > dt_orig / (2 ** dt_iters): print( " Trying LSODA, dt = %1.3e, max_steps = %d" % (dt, max_steps) ) S_max = run_model( V, aerosols, T, P, dt, S0, max_steps, solver="lsoda", t_end=t_end, ) if not S_max: dt /= 2.0 print(" Retrying...") else: finished = True break # Strategy 3: Last ditch numerical integration with LSODE. This will likely take a # a very long time. if (not finished) and (S_max is None) and (not fail_easy): print(" Trying LSODE") S_max = run_model( V, aerosols, T, P, dt_orig, max_steps=1000, solver="lsode", t_end=t_end, S0=S0, ) # Strategy 4: If all else fails return -9999. if S_max is None: if output_fmt == "smax": S_max = -9999.0 elif output_fmt == "arrays": S_max = empty([0]), empty([0]) elif output_fmt == "dataframes": S_max = ( DataFrame(data={"S": [nan]}), DataFrame(data={"aerosol1": [nan]}), ) else: S_max = nan print(" failed", V, dt) return S_max, S_max_arg, S_max_fn
{ "content_hash": "d5ea8bb6ecee8a210f01140b806324b1", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 94, "avg_line_length": 31.22222222222222, "alnum_prop": 0.5874428063040162, "repo_name": "darothen/parcel_model", "id": "6157074ab645acffa2de2ba44e252838ff7a6015", "size": "7868", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "pyrcel/driver.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "146117" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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=11"/> <meta name="generator" content="Doxygen 1.9.4"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Vulkan Memory Allocator: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr id="projectrow"> <td id="projectalign"> <div id="projectname">Vulkan Memory Allocator </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.9.4 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */ var searchBox = new SearchBox("searchBox", "search",'Search','.html'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */ </script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="headertitle"><div class="title">VmaVirtualAllocationInfo Member List</div></div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="struct_vma_virtual_allocation_info.html">VmaVirtualAllocationInfo</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="struct_vma_virtual_allocation_info.html#accb40a8205f49ccca3de975da7d1a2b5">offset</a></td><td class="entry"><a class="el" href="struct_vma_virtual_allocation_info.html">VmaVirtualAllocationInfo</a></td><td class="entry"></td></tr> <tr class="odd"><td class="entry"><a class="el" href="struct_vma_virtual_allocation_info.html#a41d5cb09357656411653d82fee436f45">pUserData</a></td><td class="entry"><a class="el" href="struct_vma_virtual_allocation_info.html">VmaVirtualAllocationInfo</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="struct_vma_virtual_allocation_info.html#afb6d6bd0a6813869ea0842048d40aa2b">size</a></td><td class="entry"><a class="el" href="struct_vma_virtual_allocation_info.html">VmaVirtualAllocationInfo</a></td><td class="entry"></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </small></address> </body> </html>
{ "content_hash": "73d228d9512630535dd088a012c5ab8b", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 289, "avg_line_length": 49, "alnum_prop": 0.7038265306122449, "repo_name": "turol/smaaDemo", "id": "a691b7f7237a39f3d0abc5ffddf013b4a25e9bcf", "size": "3920", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "foreign/vulkanMemoryAllocator/docs/html/struct_vma_virtual_allocation_info-members.html", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "2388" }, { "name": "Batchfile", "bytes": "30921" }, { "name": "Beef", "bytes": "70886" }, { "name": "C", "bytes": "7091582" }, { "name": "C#", "bytes": "162562" }, { "name": "C++", "bytes": "41661125" }, { "name": "CMake", "bytes": "426103" }, { "name": "CSS", "bytes": "91427" }, { "name": "Clean", "bytes": "11414" }, { "name": "Cuda", "bytes": "1465" }, { "name": "Emacs Lisp", "bytes": "1654" }, { "name": "GDB", "bytes": "555" }, { "name": "GLSL", "bytes": "4672705" }, { "name": "Gnuplot", "bytes": "424" }, { "name": "Go", "bytes": "729085" }, { "name": "HLSL", "bytes": "2178" }, { "name": "HTML", "bytes": "14644599" }, { "name": "JavaScript", "bytes": "2530778" }, { "name": "Jinja", "bytes": "2972" }, { "name": "Kotlin", "bytes": "1513" }, { "name": "Less", "bytes": "200665" }, { "name": "Lua", "bytes": "141119" }, { "name": "M4", "bytes": "177557" }, { "name": "Makefile", "bytes": "296169" }, { "name": "Meson", "bytes": "629" }, { "name": "Objective-C", "bytes": "18282" }, { "name": "Objective-C++", "bytes": "97773" }, { "name": "Python", "bytes": "573275" }, { "name": "Roff", "bytes": "4568" }, { "name": "Ruby", "bytes": "2885" }, { "name": "Shell", "bytes": "137790" }, { "name": "Starlark", "bytes": "39944" }, { "name": "Swift", "bytes": "2743" }, { "name": "Yacc", "bytes": "171933" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8" ?> <resources> <dimen name="padding_body">8dp</dimen> <dimen name="padding_unitbutton">3dp</dimen> <dimen name="padding_unitreverse">5dp</dimen> <dimen name="padding_from_to">5dip</dimen> <dimen name="padding_subtitle">5dp</dimen> <dimen name="padding_history">5dip</dimen> <dimen name="font_subtitle">18sp</dimen> <dimen name="font_unit">15sp</dimen> <dimen name="font_result">18sp</dimen> <dimen name="font_history">15sp</dimen> <dimen name="max_width_edit_text_converter" >30dp</dimen> <dimen name="min_width_edit_text_converter">30dp</dimen> </resources>
{ "content_hash": "3824b9acc092bbc72a5d6948b8c5bc4c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 58, "avg_line_length": 36, "alnum_prop": 0.7075163398692811, "repo_name": "lbdremy/Bar", "id": "b28cd3cdf41a57144b7624a7b61e842f7808cd1e", "size": "612", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "res/values/dimensions.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "54881" } ], "symlink_target": "" }
export declare class AppComponent { getSiteName(): string; }
{ "content_hash": "217f74a5e0f67745bd85ba0e53aa17cb", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 35, "avg_line_length": 21.666666666666668, "alnum_prop": 0.7230769230769231, "repo_name": "rogallic/rogsit", "id": "7e9ccc6d93f8198f4445cd2f83aba4de12794af7", "size": "65", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/app/app.component.d.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "44" }, { "name": "Go", "bytes": "81163" }, { "name": "HTML", "bytes": "2527" }, { "name": "JavaScript", "bytes": "146987" }, { "name": "TypeScript", "bytes": "38993" } ], "symlink_target": "" }
define(['angular', 'Controllers/controllers', 'Directives/directives'], function (angular, controllers, directives) { var initialize = function () { var app = angular.module('demo', []); app.controller(controllers); app.directive(directives); angular.bootstrap(document, ['demo']) } return { initialize: initialize }; });
{ "content_hash": "5149539c92bd7769b01e4f3319703a0d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 117, "avg_line_length": 31.5, "alnum_prop": 0.6216931216931217, "repo_name": "arnolf/jquery-slider", "id": "68a865d23f645d0b8a80643952563e699173d662", "size": "378", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "angular-demo/js/app.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
from filebeat import BaseTest import os import time """ Tests for the multiline log messages """ class Test(BaseTest): def test_java_elasticsearch_log(self): """ Test that multi lines for java logs works. It checks that all lines which do not start with [ are append to the last line starting with [ """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", multiline=True, pattern="^\[", negate="true", match="after" ) os.mkdir(self.working_dir + "/log/") self.copy_files(["logs/elasticsearch-multiline-log.log"], source_dir="../files", target_dir="log") proc = self.start_beat() # wait for the "Skipping file" log message self.wait_until( lambda: self.output_has(lines=20), max_timeout=10) proc.check_kill_and_wait() output = self.read_output() # Check that output file has the same number of lines as the log file assert 20 == len(output) def test_c_style_log(self): """ Test that multi lines for c style log works It checks that all lines following a line with \\ are appended to the previous line """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", multiline=True, pattern="\\\\$", match="before" ) os.mkdir(self.working_dir + "/log/") self.copy_files(["logs/multiline-c-log.log"], source_dir="../files", target_dir="log") proc = self.start_beat() # wait for the "Skipping file" log message self.wait_until( lambda: self.output_has(lines=4), max_timeout=10) proc.check_kill_and_wait() output = self.read_output() # Check that output file has the same number of lines as the log file assert 4 == len(output) def test_rabbitmq_multiline_log(self): """ Test rabbitmq multiline log Special about this log file is that it has empty new lines """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", multiline=True, pattern="^=[A-Z]+", match="after", negate="true", ) logentry = """=ERROR REPORT==== 3-Feb-2016::03:10:32 === connection <0.23893.109>, channel 3 - soft error: {amqp_error,not_found, "no queue 'bucket-1' in vhost '/'", 'queue.declare'} """ os.mkdir(self.working_dir + "/log/") proc = self.start_beat() testfile = self.working_dir + "/log/rabbitmq.log" file = open(testfile, 'w') iterations = 3 for n in range(0, iterations): file.write(logentry) file.close() # wait for the "Skipping file" log message self.wait_until( lambda: self.output_has(lines=3), max_timeout=10) proc.check_kill_and_wait() output = self.read_output() # Check that output file has the same number of lines as the log file assert 3 == len(output) def test_max_lines(self): """ Test the maximum number of lines that is sent by multiline All further lines are discarded """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", multiline=True, pattern="^\[", negate="true", match="after", max_lines=3 ) os.mkdir(self.working_dir + "/log/") self.copy_files(["logs/elasticsearch-multiline-log.log"], source_dir="../files", target_dir="log") proc = self.start_beat() self.wait_until( lambda: self.output_has(lines=20), max_timeout=10) proc.check_kill_and_wait() output = self.read_output() # Checks line 3 is sent assert True == self.log_contains( "MetaDataMappingService.java:388", "output/filebeat") # Checks line 4 is not sent anymore assert False == self.log_contains( "InternalClusterService.java:388", "output/filebeat") # Check that output file has the same number of lines as the log file assert 20 == len(output) def test_timeout(self): """ Test that data is sent after timeout """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", multiline=True, pattern="^\[", negate="true", match="after", ) os.mkdir(self.working_dir + "/log/") testfile = self.working_dir + "/log/test.log" file = open(testfile, 'w', 0) file.write("[2015] hello world") file.write("\n") file.write(" First Line\n") file.write(" Second Line\n") proc = self.start_beat() self.wait_until( lambda: self.output_has(lines=1), max_timeout=10) # Because of the timeout the following two lines should be put together file.write(" This should not be third\n") file.write(" This should not be fourth\n") # This starts a new pattern file.write("[2016] Hello world\n") # This line should be appended file.write(" First line again\n") self.wait_until( lambda: self.output_has(lines=3), max_timeout=10) proc.check_kill_and_wait() output = self.read_output() assert 3 == len(output) def test_max_bytes(self): """ Test the maximum number of bytes that is sent """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", multiline=True, pattern="^\[", negate="true", match="after", max_bytes=60 ) os.mkdir(self.working_dir + "/log/") self.copy_files(["logs/elasticsearch-multiline-log.log"], source_dir="../files", target_dir="log") proc = self.start_beat() self.wait_until( lambda: self.output_has(lines=20), max_timeout=10) proc.check_kill_and_wait() output = self.read_output() # Check that first 60 chars are sent assert True == self.log_contains("cluster.metadata", "output/filebeat") # Checks that chars aferwards are not sent assert False == self.log_contains("Zach", "output/filebeat") # Check that output file has the same number of lines as the log file assert 20 == len(output) def test_close_timeout_with_multiline(self): """ Test if multiline events are split up with close_timeout """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", multiline=True, pattern="^\[", negate="true", match="after", close_timeout="2s", ) os.mkdir(self.working_dir + "/log/") testfile = self.working_dir + "/log/test.log" with open(testfile, 'w', 0) as file: file.write("[2015] hello world") file.write("\n") file.write(" First Line\n") file.write(" Second Line\n") proc = self.start_beat() # Wait until harvester is closed because of timeout # This leads to the partial event above to be sent self.wait_until( lambda: self.log_contains( "Closing harvester because close_timeout was reached"), max_timeout=15) # Because of the timeout the following two lines should be put together with open(testfile, 'a', 0) as file: file.write(" This should not be third\n") file.write(" This should not be fourth\n") # This starts a new pattern file.write("[2016] Hello world\n") # This line should be appended file.write(" First line again\n") self.wait_until( lambda: self.output_has(lines=3), max_timeout=10) proc.check_kill_and_wait() # close_timeout must have closed the reader exactly twice self.wait_until( lambda: self.log_contains_count( "Closing harvester because close_timeout was reached") >= 1, max_timeout=15) output = self.read_output() assert 3 == len(output) def test_consecutive_newline(self): """ Test if consecutive multilines have an affect on multiline """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*", multiline=True, pattern="^\[", negate="true", match="after", close_timeout="2s", ) logentry1 = """[2016-09-02 19:54:23 +0000] Started 2016-09-02 19:54:23 +0000 "GET" for /gaq?path=%2FCA%2FFallbrook%2F1845-Acacia-Ln&referer=http%3A%2F%2Fwww.xxxxx.com%2FAcacia%2BLn%2BFallbrook%2BCA%2Baddresses&search_bucket=none&page_controller=v9%2Faddresses&page_action=show at 23.235.47.31 X-Forwarded-For:72.197.227.93, 23.235.47.31 Processing by GoogleAnalyticsController#index as JSON Parameters: {"path"=>"/CA/Fallbrook/1845-Acacia-Ln", "referer"=>"http://www.xxxx.com/Acacia+Ln+Fallbrook+CA+addresses", "search_bucket"=>"none", "page_controller"=>"v9/addresses", "page_action"=>"show"} Completed 200 OK in 5ms (Views: 1.9ms)""" logentry2 = """[2016-09-02 19:54:23 +0000] Started 2016-09-02 19:54:23 +0000 "GET" for /health_check at xxx.xx.44.181 X-Forwarded-For: SetAdCodeMiddleware.default_ad_code referer SetAdCodeMiddleware.default_ad_code path /health_check SetAdCodeMiddleware.default_ad_code route """ os.mkdir(self.working_dir + "/log/") testfile = self.working_dir + "/log/test.log" with open(testfile, 'w', 0) as file: file.write(logentry1 + "\n") file.write(logentry2 + "\n") proc = self.start_beat() self.wait_until( lambda: self.output_has(lines=2), max_timeout=10) proc.check_kill_and_wait() output = self.read_output_json() output[0]["message"] = logentry1 output[1]["message"] = logentry2 def test_invalid_config(self): """ Test that filebeat errors if pattern is missing config """ self.render_config_template( path=os.path.abspath(self.working_dir + "/log/") + "*", multiline=True, match="after", ) proc = self.start_beat() self.wait_until(lambda: self.log_contains("missing required field accessing") == 1) proc.check_kill_and_wait(exit_code=1)
{ "content_hash": "96fb2cc765d30d8dfab3ba9d5a2c43c7", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 300, "avg_line_length": 31.44632768361582, "alnum_prop": 0.554796981674452, "repo_name": "taitan-org/inflog", "id": "2bf67391f36d2f27e53618ecf725bf24eb38f60f", "size": "11132", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "filebeat/tests/system/test_multiline.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "216" }, { "name": "Go", "bytes": "1171204" }, { "name": "Makefile", "bytes": "23899" }, { "name": "Python", "bytes": "250534" }, { "name": "Shell", "bytes": "1141" } ], "symlink_target": "" }
// posix-threads.cc - interface between libjava and POSIX threads. // TO DO: // * Document signal handling limitations #include <config.h> #include "posix.h" #include "posix-threads.h" // If we're using the Boehm GC, then we need to override some of the // thread primitives. This is fairly gross. #ifdef HAVE_BOEHM_GC #include <gc.h> #endif /* HAVE_BOEHM_GC */ #include <stdlib.h> #include <time.h> #include <signal.h> #include <errno.h> #include <limits.h> #ifdef HAVE_UNISTD_H #include <unistd.h> // To test for _POSIX_THREAD_PRIORITY_SCHEDULING #endif #include <gcj/cni.h> #include <jvm.h> #include <java/lang/Thread.h> #include <java/lang/System.h> #include <java/lang/Long.h> #include <java/lang/OutOfMemoryError.h> #include <java/lang/InternalError.h> // This is used to implement thread startup. struct starter { _Jv_ThreadStartFunc *method; _Jv_Thread_t *data; }; // This is the key used to map from the POSIX thread value back to the // Java object representing the thread. The key is global to all // threads, so it is ok to make it a global here. pthread_key_t _Jv_ThreadKey; // This is the key used to map from the POSIX thread value back to the // _Jv_Thread_t* representing the thread. pthread_key_t _Jv_ThreadDataKey; // We keep a count of all non-daemon threads which are running. When // this reaches zero, _Jv_ThreadWait returns. static pthread_mutex_t daemon_mutex; static pthread_cond_t daemon_cond; static int non_daemon_count; // The signal to use when interrupting a thread. #if defined(LINUX_THREADS) || defined(FREEBSD_THREADS) // LinuxThreads (prior to glibc 2.1) usurps both SIGUSR1 and SIGUSR2. // GC on FreeBSD uses both SIGUSR1 and SIGUSR2. # define INTR SIGHUP #else /* LINUX_THREADS */ # define INTR SIGUSR2 #endif /* LINUX_THREADS */ // // These are the flags that can appear in _Jv_Thread_t. // // Thread started. #define FLAG_START 0x01 // Thread is daemon. #define FLAG_DAEMON 0x02 int _Jv_MutexLock (_Jv_Mutex_t *mu) { pthread_t self = pthread_self (); if (mu->owner == self) { mu->count++; } else { JvSetThreadState holder (_Jv_ThreadCurrent(), JV_BLOCKED); # ifdef LOCK_DEBUG int result = pthread_mutex_lock (&mu->mutex); if (0 != result) { fprintf(stderr, "Pthread_mutex_lock returned %d\n", result); for (;;) {} } # else pthread_mutex_lock (&mu->mutex); # endif mu->count = 1; mu->owner = self; } return 0; } // Wait for the condition variable "CV" to be notified. // Return values: // 0: the condition was notified, or the timeout expired. // _JV_NOT_OWNER: the thread does not own the mutex "MU". // _JV_INTERRUPTED: the thread was interrupted. Its interrupted flag is set. int _Jv_CondWait (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint nanos) { pthread_t self = pthread_self(); if (mu->owner != self) return _JV_NOT_OWNER; struct timespec ts; JvThreadState new_state = JV_WAITING; if (millis > 0 || nanos > 0) { // Calculate the abstime corresponding to the timeout. unsigned long long seconds; unsigned long usec; // For better accuracy, should use pthread_condattr_setclock // and clock_gettime. #ifdef HAVE_GETTIMEOFDAY timeval tv; gettimeofday (&tv, NULL); usec = tv.tv_usec; seconds = tv.tv_sec; #else unsigned long long startTime = java::lang::System::currentTimeMillis(); seconds = startTime / 1000; /* Assume we're about half-way through this millisecond. */ usec = (startTime % 1000) * 1000 + 500; #endif /* These next two statements cannot overflow. */ usec += nanos / 1000; usec += (millis % 1000) * 1000; /* These two statements could overflow only if tv.tv_sec was insanely large. */ seconds += millis / 1000; seconds += usec / 1000000; ts.tv_sec = seconds; if (ts.tv_sec < 0 || (unsigned long long)ts.tv_sec != seconds) { // We treat a timeout that won't fit into a struct timespec // as a wait forever. millis = nanos = 0; } else /* This next statement also cannot overflow. */ ts.tv_nsec = (usec % 1000000) * 1000 + (nanos % 1000); } _Jv_Thread_t *current = _Jv_ThreadCurrentData (); java::lang::Thread *current_obj = _Jv_ThreadCurrent (); pthread_mutex_lock (&current->wait_mutex); // Now that we hold the wait mutex, check if this thread has been // interrupted already. if (current_obj->interrupt_flag) { pthread_mutex_unlock (&current->wait_mutex); return _JV_INTERRUPTED; } // Set the thread's state. JvSetThreadState holder (current_obj, new_state); // Add this thread to the cv's wait set. current->next = NULL; if (cv->first == NULL) cv->first = current; else for (_Jv_Thread_t *t = cv->first;; t = t->next) { if (t->next == NULL) { t->next = current; break; } } // Record the current lock depth, so it can be restored when we re-aquire it. int count = mu->count; // Release the monitor mutex. mu->count = 0; mu->owner = 0; pthread_mutex_unlock (&mu->mutex); int r = 0; bool done_sleeping = false; while (! done_sleeping) { if (millis == 0 && nanos == 0) r = pthread_cond_wait (&current->wait_cond, &current->wait_mutex); else r = pthread_cond_timedwait (&current->wait_cond, &current->wait_mutex, &ts); // In older glibc's (prior to 2.1.3), the cond_wait functions may // spuriously wake up on a signal. Catch that here. if (r != EINTR) done_sleeping = true; } // Check for an interrupt *before* releasing the wait mutex. jboolean interrupted = current_obj->interrupt_flag; pthread_mutex_unlock (&current->wait_mutex); // Reaquire the monitor mutex, and restore the lock count. pthread_mutex_lock (&mu->mutex); mu->owner = self; mu->count = count; // If we were interrupted, or if a timeout occurred, remove ourself from // the cv wait list now. (If we were notified normally, notify() will have // already taken care of this) if (r == ETIMEDOUT || interrupted) { _Jv_Thread_t *prev = NULL; for (_Jv_Thread_t *t = cv->first; t != NULL; t = t->next) { if (t == current) { if (prev != NULL) prev->next = t->next; else cv->first = t->next; t->next = NULL; break; } prev = t; } if (interrupted) return _JV_INTERRUPTED; } return 0; } int _Jv_CondNotify (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu) { if (_Jv_MutexCheckMonitor (mu)) return _JV_NOT_OWNER; _Jv_Thread_t *target; _Jv_Thread_t *prev = NULL; for (target = cv->first; target != NULL; target = target->next) { pthread_mutex_lock (&target->wait_mutex); if (target->thread_obj->interrupt_flag) { // Don't notify a thread that has already been interrupted. pthread_mutex_unlock (&target->wait_mutex); prev = target; continue; } pthread_cond_signal (&target->wait_cond); pthread_mutex_unlock (&target->wait_mutex); // Two concurrent notify() calls must not be delivered to the same // thread, so remove the target thread from the cv wait list now. if (prev == NULL) cv->first = target->next; else prev->next = target->next; target->next = NULL; break; } return 0; } int _Jv_CondNotifyAll (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu) { if (_Jv_MutexCheckMonitor (mu)) return _JV_NOT_OWNER; _Jv_Thread_t *target; _Jv_Thread_t *prev = NULL; for (target = cv->first; target != NULL; target = target->next) { pthread_mutex_lock (&target->wait_mutex); pthread_cond_signal (&target->wait_cond); pthread_mutex_unlock (&target->wait_mutex); if (prev != NULL) prev->next = NULL; prev = target; } if (prev != NULL) prev->next = NULL; cv->first = NULL; return 0; } void _Jv_ThreadInterrupt (_Jv_Thread_t *data) { pthread_mutex_lock (&data->wait_mutex); // Set the thread's interrupted flag *after* aquiring its wait_mutex. This // ensures that there are no races with the interrupt flag being set after // the waiting thread checks it and before pthread_cond_wait is entered. data->thread_obj->interrupt_flag = true; // Interrupt blocking system calls using a signal. pthread_kill (data->thread, INTR); pthread_cond_signal (&data->wait_cond); pthread_mutex_unlock (&data->wait_mutex); } /** * Releases the block on a thread created by _Jv_ThreadPark(). This * method can also be used to terminate a blockage caused by a prior * call to park. This operation is unsafe, as the thread must be * guaranteed to be live. * * @param thread the thread to unblock. */ void ParkHelper::unpark () { using namespace ::java::lang; volatile obj_addr_t *ptr = &permit; /* If this thread is in state RUNNING, give it a permit and return immediately. */ if (compare_and_swap (ptr, Thread::THREAD_PARK_RUNNING, Thread::THREAD_PARK_PERMIT)) return; /* If this thread is parked, put it into state RUNNING and send it a signal. */ if (compare_and_swap (ptr, Thread::THREAD_PARK_PARKED, Thread::THREAD_PARK_RUNNING)) { int result; pthread_mutex_lock (&mutex); result = pthread_cond_signal (&cond); pthread_mutex_unlock (&mutex); JvAssert (result == 0); } } /** * Sets our state to dead. */ void ParkHelper::deactivate () { permit = ::java::lang::Thread::THREAD_PARK_DEAD; } void ParkHelper::init () { pthread_mutex_init (&mutex, NULL); pthread_cond_init (&cond, NULL); permit = ::java::lang::Thread::THREAD_PARK_RUNNING; } /** * Blocks the thread until a matching _Jv_ThreadUnpark() occurs, the * thread is interrupted or the optional timeout expires. If an * unpark call has already occurred, this also counts. A timeout * value of zero is defined as no timeout. When isAbsolute is true, * the timeout is in milliseconds relative to the epoch. Otherwise, * the value is the number of nanoseconds which must occur before * timeout. This call may also return spuriously (i.e. for no * apparent reason). * * @param isAbsolute true if the timeout is specified in milliseconds from * the epoch. * @param time either the number of nanoseconds to wait, or a time in * milliseconds from the epoch to wait for. */ void ParkHelper::park (jboolean isAbsolute, jlong time) { using namespace ::java::lang; volatile obj_addr_t *ptr = &permit; /* If we have a permit, return immediately. */ if (compare_and_swap (ptr, Thread::THREAD_PARK_PERMIT, Thread::THREAD_PARK_RUNNING)) return; struct timespec ts; if (time) { unsigned long long seconds; unsigned long usec; if (isAbsolute) { ts.tv_sec = time / 1000; ts.tv_nsec = (time % 1000) * 1000 * 1000; } else { // Calculate the abstime corresponding to the timeout. jlong nanos = time; jlong millis = 0; // For better accuracy, should use pthread_condattr_setclock // and clock_gettime. #ifdef HAVE_GETTIMEOFDAY timeval tv; gettimeofday (&tv, NULL); usec = tv.tv_usec; seconds = tv.tv_sec; #else unsigned long long startTime = java::lang::System::currentTimeMillis(); seconds = startTime / 1000; /* Assume we're about half-way through this millisecond. */ usec = (startTime % 1000) * 1000 + 500; #endif /* These next two statements cannot overflow. */ usec += nanos / 1000; usec += (millis % 1000) * 1000; /* These two statements could overflow only if tv.tv_sec was insanely large. */ seconds += millis / 1000; seconds += usec / 1000000; ts.tv_sec = seconds; if (ts.tv_sec < 0 || (unsigned long long)ts.tv_sec != seconds) { // We treat a timeout that won't fit into a struct timespec // as a wait forever. millis = nanos = 0; } else /* This next statement also cannot overflow. */ ts.tv_nsec = (usec % 1000000) * 1000 + (nanos % 1000); } } pthread_mutex_lock (&mutex); if (compare_and_swap (ptr, Thread::THREAD_PARK_RUNNING, Thread::THREAD_PARK_PARKED)) { int result = 0; if (! time) result = pthread_cond_wait (&cond, &mutex); else result = pthread_cond_timedwait (&cond, &mutex, &ts); JvAssert (result == 0 || result == ETIMEDOUT); /* If we were unparked by some other thread, this will already be in state THREAD_PARK_RUNNING. If we timed out or were interrupted, we have to do it ourself. */ permit = Thread::THREAD_PARK_RUNNING; } pthread_mutex_unlock (&mutex); } static void handle_intr (int) { // Do nothing. } void _Jv_BlockSigchld() { sigset_t mask; sigemptyset (&mask); sigaddset (&mask, SIGCHLD); int c = pthread_sigmask (SIG_BLOCK, &mask, NULL); if (c != 0) JvFail (strerror (c)); } void _Jv_UnBlockSigchld() { sigset_t mask; sigemptyset (&mask); sigaddset (&mask, SIGCHLD); int c = pthread_sigmask (SIG_UNBLOCK, &mask, NULL); if (c != 0) JvFail (strerror (c)); } void _Jv_InitThreads (void) { pthread_key_create (&_Jv_ThreadKey, NULL); pthread_key_create (&_Jv_ThreadDataKey, NULL); pthread_mutex_init (&daemon_mutex, NULL); pthread_cond_init (&daemon_cond, 0); non_daemon_count = 0; // Arrange for the interrupt signal to interrupt system calls. struct sigaction act; act.sa_handler = handle_intr; sigemptyset (&act.sa_mask); act.sa_flags = 0; sigaction (INTR, &act, NULL); // Block SIGCHLD here to ensure that any non-Java threads inherit the new // signal mask. _Jv_BlockSigchld(); // Check/set the thread stack size. size_t min_ss = 32 * 1024; if (sizeof (void *) == 8) // Bigger default on 64-bit systems. min_ss *= 2; #ifdef PTHREAD_STACK_MIN if (min_ss < PTHREAD_STACK_MIN) min_ss = PTHREAD_STACK_MIN; #endif if (gcj::stack_size > 0 && gcj::stack_size < min_ss) gcj::stack_size = min_ss; } _Jv_Thread_t * _Jv_ThreadInitData (java::lang::Thread *obj) { _Jv_Thread_t *data = (_Jv_Thread_t *) _Jv_Malloc (sizeof (_Jv_Thread_t)); data->flags = 0; data->thread_obj = obj; pthread_mutex_init (&data->wait_mutex, NULL); pthread_cond_init (&data->wait_cond, NULL); return data; } void _Jv_ThreadDestroyData (_Jv_Thread_t *data) { pthread_mutex_destroy (&data->wait_mutex); pthread_cond_destroy (&data->wait_cond); _Jv_Free ((void *)data); } void _Jv_ThreadSetPriority (_Jv_Thread_t *data, jint prio) { #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING if (data->flags & FLAG_START) { struct sched_param param; param.sched_priority = prio; pthread_setschedparam (data->thread, SCHED_OTHER, &param); } #endif } void _Jv_ThreadRegister (_Jv_Thread_t *data) { pthread_setspecific (_Jv_ThreadKey, data->thread_obj); pthread_setspecific (_Jv_ThreadDataKey, data); // glibc 2.1.3 doesn't set the value of `thread' until after start_routine // is called. Since it may need to be accessed from the new thread, work // around the potential race here by explicitly setting it again. data->thread = pthread_self (); # ifdef SLOW_PTHREAD_SELF // Clear all self cache slots that might be needed by this thread. int dummy; int low_index = SC_INDEX(&dummy) + SC_CLEAR_MIN; int high_index = SC_INDEX(&dummy) + SC_CLEAR_MAX; for (int i = low_index; i <= high_index; ++i) { int current_index = i; if (current_index < 0) current_index += SELF_CACHE_SIZE; if (current_index >= SELF_CACHE_SIZE) current_index -= SELF_CACHE_SIZE; _Jv_self_cache[current_index].high_sp_bits = BAD_HIGH_SP_VALUE; } # endif // Block SIGCHLD which is used in natPosixProcess.cc. _Jv_BlockSigchld(); } void _Jv_ThreadUnRegister () { pthread_setspecific (_Jv_ThreadKey, NULL); pthread_setspecific (_Jv_ThreadDataKey, NULL); } // This function is called when a thread is started. We don't arrange // to call the `run' method directly, because this function must // return a value. static void * really_start (void *x) { struct starter *info = (struct starter *) x; _Jv_ThreadRegister (info->data); info->method (info->data->thread_obj); if (! (info->data->flags & FLAG_DAEMON)) { pthread_mutex_lock (&daemon_mutex); --non_daemon_count; if (! non_daemon_count) pthread_cond_signal (&daemon_cond); pthread_mutex_unlock (&daemon_mutex); } return NULL; } void _Jv_ThreadStart (java::lang::Thread *thread, _Jv_Thread_t *data, _Jv_ThreadStartFunc *meth) { struct sched_param param; pthread_attr_t attr; struct starter *info; if (data->flags & FLAG_START) return; data->flags |= FLAG_START; // Block SIGCHLD which is used in natPosixProcess.cc. // The current mask is inherited by the child thread. _Jv_BlockSigchld(); param.sched_priority = thread->getPriority(); pthread_attr_init (&attr); pthread_attr_setschedparam (&attr, &param); pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED); // Set stack size if -Xss option was given. if (gcj::stack_size > 0) { int e = pthread_attr_setstacksize (&attr, gcj::stack_size); if (e != 0) JvFail (strerror (e)); } info = (struct starter *) _Jv_AllocBytes (sizeof (struct starter)); info->method = meth; info->data = data; if (! thread->isDaemon()) { pthread_mutex_lock (&daemon_mutex); ++non_daemon_count; pthread_mutex_unlock (&daemon_mutex); } else data->flags |= FLAG_DAEMON; int r = pthread_create (&data->thread, &attr, really_start, (void *) info); pthread_attr_destroy (&attr); if (r) { const char* msg = "Cannot create additional threads"; throw new java::lang::OutOfMemoryError (JvNewStringUTF (msg)); } } void _Jv_ThreadWait (void) { pthread_mutex_lock (&daemon_mutex); if (non_daemon_count) pthread_cond_wait (&daemon_cond, &daemon_mutex); pthread_mutex_unlock (&daemon_mutex); } #if defined(SLOW_PTHREAD_SELF) #include "sysdep/locks.h" // Support for pthread_self() lookup cache. volatile self_cache_entry _Jv_self_cache[SELF_CACHE_SIZE]; _Jv_ThreadId_t _Jv_ThreadSelf_out_of_line(volatile self_cache_entry *sce, size_t high_sp_bits) { pthread_t self = pthread_self(); sce -> high_sp_bits = high_sp_bits; write_barrier(); sce -> self = self; return self; } #endif /* SLOW_PTHREAD_SELF */
{ "content_hash": "bcecf5b2507e5f3693f16c96acd82a17", "timestamp": "", "source": "github", "line_count": 727, "max_line_length": 79, "avg_line_length": 25.609353507565338, "alnum_prop": 0.6402943388119025, "repo_name": "the-linix-project/linix-kernel-source", "id": "66693abbc9b5fbbf44052ba567b0d16e658c7178", "size": "18870", "binary": false, "copies": "152", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/libjava/posix-threads.cc", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ada", "bytes": "38139979" }, { "name": "Assembly", "bytes": "3723477" }, { "name": "Awk", "bytes": "83739" }, { "name": "C", "bytes": "103607293" }, { "name": "C#", "bytes": "55726" }, { "name": "C++", "bytes": "38577421" }, { "name": "CLIPS", "bytes": "6933" }, { "name": "CSS", "bytes": "32588" }, { "name": "Emacs Lisp", "bytes": "13451" }, { "name": "FORTRAN", "bytes": "4294984" }, { "name": "GAP", "bytes": "13089" }, { "name": "Go", "bytes": "11277335" }, { "name": "Haskell", "bytes": "2415" }, { "name": "Java", "bytes": "45298678" }, { "name": "JavaScript", "bytes": "6265" }, { "name": "Matlab", "bytes": "56" }, { "name": "OCaml", "bytes": "148372" }, { "name": "Objective-C", "bytes": "995127" }, { "name": "Objective-C++", "bytes": "436045" }, { "name": "PHP", "bytes": "12361" }, { "name": "Pascal", "bytes": "40318" }, { "name": "Perl", "bytes": "358808" }, { "name": "Python", "bytes": "60178" }, { "name": "SAS", "bytes": "1711" }, { "name": "Scilab", "bytes": "258457" }, { "name": "Shell", "bytes": "2610907" }, { "name": "Tcl", "bytes": "17983" }, { "name": "TeX", "bytes": "1455571" }, { "name": "XSLT", "bytes": "156419" } ], "symlink_target": "" }
package com.example.toidv.rxexample.ui.home; import com.example.toidv.rxexample.data.pojo.Item; import com.example.toidv.rxexample.ui.base.MvpView; /** * Created by TOIDV on 5/24/2016. */ public interface HomeMvpView extends MvpView { void addUser(Item item); void showProgress(boolean value); void createAlertDialog(); void showAlertDialog(String message); }
{ "content_hash": "da7c06ddeb9a4262c48bc04b653476ff", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 51, "avg_line_length": 20.263157894736842, "alnum_prop": 0.7402597402597403, "repo_name": "toidv/android", "id": "a069d22f184cc9c4e29c4d53b437a0d7c3cce1be", "size": "385", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/example/toidv/rxexample/ui/home/HomeMvpView.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Email Class &mdash; CodeIgniter 3.0.0 documentation</title> <link rel="shortcut icon" href="../_static/ci-icon.ico"/> <link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="top" title="CodeIgniter 3.0.0 documentation" href="../index.html"/> <link rel="up" title="Libraries" href="index.html"/> <link rel="next" title="Encrypt Class" href="encrypt.html"/> <link rel="prev" title="Config Class" href="config.html"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> </head> <body class="wy-body-for-nav" role="document"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-nav-search"> <a href="../index.html" class="fa fa-home"> CodeIgniter</a> <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <ul> <li class="toctree-l1"><a class="reference internal" href="../general/welcome.html">Welcome to CodeIgniter</a><ul class="simple"> </ul> </li> </ul> <ul> <li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation Instructions</a><ul> <li class="toctree-l2"><a class="reference internal" href="../installation/downloads.html">Downloading CodeIgniter</a></li> <li class="toctree-l2"><a class="reference internal" href="../installation/index.html">Installation Instructions</a></li> <li class="toctree-l2"><a class="reference internal" href="../installation/upgrading.html">Upgrading From a Previous Version</a></li> <li class="toctree-l2"><a class="reference internal" href="../installation/troubleshooting.html">Troubleshooting</a></li> </ul> </li> </ul> <ul> <li class="toctree-l1"><a class="reference internal" href="../overview/index.html">CodeIgniter Overview</a><ul> <li class="toctree-l2"><a class="reference internal" href="../overview/getting_started.html">Getting Started</a></li> <li class="toctree-l2"><a class="reference internal" href="../overview/at_a_glance.html">CodeIgniter at a Glance</a></li> <li class="toctree-l2"><a class="reference internal" href="../overview/features.html">Supported Features</a></li> <li class="toctree-l2"><a class="reference internal" href="../overview/appflow.html">Application Flow Chart</a></li> <li class="toctree-l2"><a class="reference internal" href="../overview/mvc.html">Model-View-Controller</a></li> <li class="toctree-l2"><a class="reference internal" href="../overview/goals.html">Architectural Goals</a></li> </ul> </li> </ul> <ul> <li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a><ul> <li class="toctree-l2"><a class="reference internal" href="../tutorial/static_pages.html">Static pages</a></li> <li class="toctree-l2"><a class="reference internal" href="../tutorial/news_section.html">News section</a></li> <li class="toctree-l2"><a class="reference internal" href="../tutorial/create_news_items.html">Create news items</a></li> <li class="toctree-l2"><a class="reference internal" href="../tutorial/conclusion.html">Conclusion</a></li> </ul> </li> </ul> <ul> <li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a><ul> <li class="toctree-l2"><a class="reference internal" href="../general/urls.html">CodeIgniter URLs</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/controllers.html">Controllers</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/reserved_names.html">Reserved Names</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/views.html">Views</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/models.html">Models</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/helpers.html">Helpers</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/libraries.html">Using CodeIgniter Libraries</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/creating_libraries.html">Creating Libraries</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/drivers.html">Using CodeIgniter Drivers</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/creating_drivers.html">Creating Drivers</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/core_classes.html">Creating Core System Classes</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/ancillary_classes.html">Creating Ancillary Classes</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/hooks.html">Hooks - Extending the Framework Core</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/autoloader.html">Auto-loading Resources</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/common_functions.html">Common Functions</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/compatibility_functions.html">Compatibility Functions</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/routing.html">URI Routing</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/errors.html">Error Handling</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/caching.html">Caching</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/profiling.html">Profiling Your Application</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/cli.html">Running via the CLI</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/managing_apps.html">Managing your Applications</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/environments.html">Handling Multiple Environments</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/alternative_php.html">Alternate PHP Syntax for View Files</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/security.html">Security</a></li> <li class="toctree-l2"><a class="reference internal" href="../general/styleguide.html">PHP Style Guide</a></li> </ul> </li> </ul> <ul class="current"> <li class="toctree-l1 current"><a class="reference internal" href="index.html">Libraries</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="benchmark.html">Benchmarking Class</a></li> <li class="toctree-l2"><a class="reference internal" href="caching.html">Caching Driver</a></li> <li class="toctree-l2"><a class="reference internal" href="calendar.html">Calendaring Class</a></li> <li class="toctree-l2"><a class="reference internal" href="cart.html">Shopping Cart Class</a></li> <li class="toctree-l2"><a class="reference internal" href="config.html">Config Class</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="">Email Class</a></li> <li class="toctree-l2"><a class="reference internal" href="encrypt.html">Encrypt Class</a></li> <li class="toctree-l2"><a class="reference internal" href="encryption.html">Encryption Library</a></li> <li class="toctree-l2"><a class="reference internal" href="file_uploading.html">File Uploading Class</a></li> <li class="toctree-l2"><a class="reference internal" href="form_validation.html">Form Validation</a></li> <li class="toctree-l2"><a class="reference internal" href="ftp.html">FTP Class</a></li> <li class="toctree-l2"><a class="reference internal" href="image_lib.html">Image Manipulation Class</a></li> <li class="toctree-l2"><a class="reference internal" href="input.html">Input Class</a></li> <li class="toctree-l2"><a class="reference internal" href="javascript.html">Javascript Class</a></li> <li class="toctree-l2"><a class="reference internal" href="language.html">Language Class</a></li> <li class="toctree-l2"><a class="reference internal" href="loader.html">Loader Class</a></li> <li class="toctree-l2"><a class="reference internal" href="migration.html">Migrations Class</a></li> <li class="toctree-l2"><a class="reference internal" href="output.html">Output Class</a></li> <li class="toctree-l2"><a class="reference internal" href="pagination.html">Pagination Class</a></li> <li class="toctree-l2"><a class="reference internal" href="parser.html">Template Parser Class</a></li> <li class="toctree-l2"><a class="reference internal" href="security.html">Security Class</a></li> <li class="toctree-l2"><a class="reference internal" href="sessions.html">Session Library</a></li> <li class="toctree-l2"><a class="reference internal" href="table.html">HTML Table Class</a></li> <li class="toctree-l2"><a class="reference internal" href="trackback.html">Trackback Class</a></li> <li class="toctree-l2"><a class="reference internal" href="typography.html">Typography Class</a></li> <li class="toctree-l2"><a class="reference internal" href="unit_testing.html">Unit Testing Class</a></li> <li class="toctree-l2"><a class="reference internal" href="uri.html">URI Class</a></li> <li class="toctree-l2"><a class="reference internal" href="user_agent.html">User Agent Class</a></li> <li class="toctree-l2"><a class="reference internal" href="xmlrpc.html">XML-RPC and XML-RPC Server Classes</a></li> <li class="toctree-l2"><a class="reference internal" href="zip.html">Zip Encoding Class</a></li> </ul> </li> </ul> <ul> <li class="toctree-l1"><a class="reference internal" href="../database/index.html">Database Reference</a><ul> <li class="toctree-l2"><a class="reference internal" href="../database/examples.html">Quick Start: Usage Examples</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/configuration.html">Database Configuration</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/connecting.html">Connecting to a Database</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/queries.html">Running Queries</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/results.html">Generating Query Results</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/helpers.html">Query Helper Functions</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/query_builder.html">Query Builder Class</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/transactions.html">Transactions</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/metadata.html">Getting MetaData</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/call_function.html">Custom Function Calls</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/caching.html">Query Caching</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/forge.html">Database Manipulation with Database Forge</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/utilities.html">Database Utilities Class</a></li> <li class="toctree-l2"><a class="reference internal" href="../database/db_driver_reference.html">Database Driver Reference</a></li> </ul> </li> </ul> <ul> <li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a><ul> <li class="toctree-l2"><a class="reference internal" href="../helpers/array_helper.html">Array Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/captcha_helper.html">CAPTCHA Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/cookie_helper.html">Cookie Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/date_helper.html">Date Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/directory_helper.html">Directory Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/download_helper.html">Download Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/email_helper.html">Email Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/file_helper.html">File Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/form_helper.html">Form Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/html_helper.html">HTML Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/inflector_helper.html">Inflector Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/language_helper.html">Language Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/number_helper.html">Number Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/path_helper.html">Path Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/security_helper.html">Security Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/smiley_helper.html">Smiley Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/string_helper.html">String Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/text_helper.html">Text Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/typography_helper.html">Typography Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/url_helper.html">URL Helper</a></li> <li class="toctree-l2"><a class="reference internal" href="../helpers/xml_helper.html">XML Helper</a></li> </ul> </li> </ul> <ul> <li class="toctree-l1"><a class="reference internal" href="../contributing/index.html">Contributing to CodeIgniter</a><ul> <li class="toctree-l2"><a class="reference internal" href="../documentation/index.html">Writing CodeIgniter Documentation</a></li> <li class="toctree-l2"><a class="reference internal" href="../DCO.html">Developer&#8217;s Certificate of Origin 1.1</a></li> </ul> </li> </ul> </div> &nbsp; </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">CodeIgniter</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../index.html">Docs</a> &raquo;</li> <li><a href="index.html">Libraries</a> &raquo;</li> <li>Email Class</li> <li class="wy-breadcrumbs-aside"> </li> </ul> <hr/> </div> <div role="main" class="document"> <div class="section" id="email-class"> <h1>Email Class<a class="headerlink" href="#email-class" title="Permalink to this headline">¶</a></h1> <p>CodeIgniter&#8217;s robust Email Class supports the following features:</p> <ul class="simple"> <li>Multiple Protocols: Mail, Sendmail, and SMTP</li> <li>TLS and SSL Encryption for SMTP</li> <li>Multiple recipients</li> <li>CC and BCCs</li> <li>HTML or Plaintext email</li> <li>Attachments</li> <li>Word wrapping</li> <li>Priorities</li> <li>BCC Batch Mode, enabling large email lists to be broken into small BCC batches.</li> <li>Email Debugging tools</li> </ul> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#using-the-email-library" id="id1">Using the Email Library</a><ul> <li><a class="reference internal" href="#sending-email" id="id2">Sending Email</a></li> <li><a class="reference internal" href="#setting-email-preferences" id="id3">Setting Email Preferences</a><ul> <li><a class="reference internal" href="#setting-email-preferences-in-a-config-file" id="id4">Setting Email Preferences in a Config File</a></li> </ul> </li> <li><a class="reference internal" href="#email-preferences" id="id5">Email Preferences</a></li> <li><a class="reference internal" href="#overriding-word-wrapping" id="id6">Overriding Word Wrapping</a></li> </ul> </li> <li><a class="reference internal" href="#class-reference" id="id7">Class Reference</a></li> </ul> </div> <div class="custom-index container"></div><div class="section" id="using-the-email-library"> <h2><a class="toc-backref" href="#id1">Using the Email Library</a><a class="headerlink" href="#using-the-email-library" title="Permalink to this headline">¶</a></h2> <div class="section" id="sending-email"> <h3><a class="toc-backref" href="#id2">Sending Email</a><a class="headerlink" href="#sending-email" title="Permalink to this headline">¶</a></h3> <p>Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.</p> <p>Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your <a class="reference internal" href="../general/controllers.html"><em>controllers</em></a>.</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">load</span><span class="o">-&gt;</span><span class="na">library</span><span class="p">(</span><span class="s1">&#39;email&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">from</span><span class="p">(</span><span class="s1">&#39;your@example.com&#39;</span><span class="p">,</span> <span class="s1">&#39;Your Name&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">to</span><span class="p">(</span><span class="s1">&#39;someone@example.com&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">cc</span><span class="p">(</span><span class="s1">&#39;another@another-example.com&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">bcc</span><span class="p">(</span><span class="s1">&#39;them@their-example.com&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">subject</span><span class="p">(</span><span class="s1">&#39;Email Test&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">message</span><span class="p">(</span><span class="s1">&#39;Testing the email class.&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">();</span> </pre></div> </div> </div> <div class="section" id="setting-email-preferences"> <h3><a class="toc-backref" href="#id3">Setting Email Preferences</a><a class="headerlink" href="#setting-email-preferences" title="Permalink to this headline">¶</a></h3> <p>There are 21 different preferences available to tailor how your email messages are sent. You can either set them manually as described here, or automatically via preferences stored in your config file, described below:</p> <p>Preferences are set by passing an array of preference values to the email initialize method. Here is an example of how you might set some preferences:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$config</span><span class="p">[</span><span class="s1">&#39;protocol&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;sendmail&#39;</span><span class="p">;</span> <span class="nv">$config</span><span class="p">[</span><span class="s1">&#39;mailpath&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;/usr/sbin/sendmail&#39;</span><span class="p">;</span> <span class="nv">$config</span><span class="p">[</span><span class="s1">&#39;charset&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;iso-8859-1&#39;</span><span class="p">;</span> <span class="nv">$config</span><span class="p">[</span><span class="s1">&#39;wordwrap&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">TRUE</span><span class="p">;</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">initialize</span><span class="p">(</span><span class="nv">$config</span><span class="p">);</span> </pre></div> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Most of the preferences have default values that will be used if you do not set them.</p> </div> <div class="section" id="setting-email-preferences-in-a-config-file"> <h4><a class="toc-backref" href="#id4">Setting Email Preferences in a Config File</a><a class="headerlink" href="#setting-email-preferences-in-a-config-file" title="Permalink to this headline">¶</a></h4> <p>If you prefer not to set preferences using the above method, you can instead put them into a config file. Simply create a new file called the email.php, add the $config array in that file. Then save the file at config/email.php and it will be used automatically. You will NOT need to use the <tt class="docutils literal"><span class="pre">$this-&gt;email-&gt;initialize()</span></tt> method if you save your preferences in a config file.</p> </div> </div> <div class="section" id="email-preferences"> <h3><a class="toc-backref" href="#id5">Email Preferences</a><a class="headerlink" href="#email-preferences" title="Permalink to this headline">¶</a></h3> <p>The following is a list of all the preferences that can be set when sending email.</p> <table border="1" class="docutils"> <colgroup> <col width="14%" /> <col width="16%" /> <col width="20%" /> <col width="51%" /> </colgroup> <thead valign="bottom"> <tr class="row-odd"><th class="head">Preference</th> <th class="head">Default Value</th> <th class="head">Options</th> <th class="head">Description</th> </tr> </thead> <tbody valign="top"> <tr class="row-even"><td><strong>useragent</strong></td> <td>CodeIgniter</td> <td>None</td> <td>The &#8220;user agent&#8221;.</td> </tr> <tr class="row-odd"><td><strong>protocol</strong></td> <td>mail</td> <td>mail, sendmail, or smtp</td> <td>The mail sending protocol.</td> </tr> <tr class="row-even"><td><strong>mailpath</strong></td> <td>/usr/sbin/sendmail</td> <td>None</td> <td>The server path to Sendmail.</td> </tr> <tr class="row-odd"><td><strong>smtp_host</strong></td> <td>No Default</td> <td>None</td> <td>SMTP Server Address.</td> </tr> <tr class="row-even"><td><strong>smtp_user</strong></td> <td>No Default</td> <td>None</td> <td>SMTP Username.</td> </tr> <tr class="row-odd"><td><strong>smtp_pass</strong></td> <td>No Default</td> <td>None</td> <td>SMTP Password.</td> </tr> <tr class="row-even"><td><strong>smtp_port</strong></td> <td>25</td> <td>None</td> <td>SMTP Port.</td> </tr> <tr class="row-odd"><td><strong>smtp_timeout</strong></td> <td>5</td> <td>None</td> <td>SMTP Timeout (in seconds).</td> </tr> <tr class="row-even"><td><strong>smtp_keepalive</strong></td> <td>FALSE</td> <td>TRUE or FALSE (boolean)</td> <td>Enable persistent SMTP connections.</td> </tr> <tr class="row-odd"><td><strong>smtp_crypto</strong></td> <td>No Default</td> <td>tls or ssl</td> <td>SMTP Encryption</td> </tr> <tr class="row-even"><td><strong>wordwrap</strong></td> <td>TRUE</td> <td>TRUE or FALSE (boolean)</td> <td>Enable word-wrap.</td> </tr> <tr class="row-odd"><td><strong>wrapchars</strong></td> <td>76</td> <td>&nbsp;</td> <td>Character count to wrap at.</td> </tr> <tr class="row-even"><td><strong>mailtype</strong></td> <td>text</td> <td>text or html</td> <td>Type of mail. If you send HTML email you must send it as a complete web page. Make sure you don&#8217;t have any relative links or relative image paths otherwise they will not work.</td> </tr> <tr class="row-odd"><td><strong>charset</strong></td> <td><tt class="docutils literal"><span class="pre">$config['charset']</span></tt></td> <td>&nbsp;</td> <td>Character set (utf-8, iso-8859-1, etc.).</td> </tr> <tr class="row-even"><td><strong>validate</strong></td> <td>FALSE</td> <td>TRUE or FALSE (boolean)</td> <td>Whether to validate the email address.</td> </tr> <tr class="row-odd"><td><strong>priority</strong></td> <td>3</td> <td>1, 2, 3, 4, 5</td> <td>Email Priority. 1 = highest. 5 = lowest. 3 = normal.</td> </tr> <tr class="row-even"><td><strong>crlf</strong></td> <td>\n</td> <td>&#8220;\r\n&#8221; or &#8220;\n&#8221; or &#8220;\r&#8221;</td> <td>Newline character. (Use &#8220;\r\n&#8221; to comply with RFC 822).</td> </tr> <tr class="row-odd"><td><strong>newline</strong></td> <td>\n</td> <td>&#8220;\r\n&#8221; or &#8220;\n&#8221; or &#8220;\r&#8221;</td> <td>Newline character. (Use &#8220;\r\n&#8221; to comply with RFC 822).</td> </tr> <tr class="row-even"><td><strong>bcc_batch_mode</strong></td> <td>FALSE</td> <td>TRUE or FALSE (boolean)</td> <td>Enable BCC Batch Mode.</td> </tr> <tr class="row-odd"><td><strong>bcc_batch_size</strong></td> <td>200</td> <td>None</td> <td>Number of emails in each BCC batch.</td> </tr> <tr class="row-even"><td><strong>dsn</strong></td> <td>FALSE</td> <td>TRUE or FALSE (boolean)</td> <td>Enable notify message from server</td> </tr> </tbody> </table> </div> <div class="section" id="overriding-word-wrapping"> <h3><a class="toc-backref" href="#id6">Overriding Word Wrapping</a><a class="headerlink" href="#overriding-word-wrapping" title="Permalink to this headline">¶</a></h3> <p>If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override word wrapping within part of your message like this:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nx">The</span> <span class="nx">text</span> <span class="nx">of</span> <span class="nx">your</span> <span class="nx">email</span> <span class="nx">that</span> <span class="nx">gets</span> <span class="nx">wrapped</span> <span class="nx">normally</span><span class="o">.</span> <span class="p">{</span><span class="nx">unwrap</span><span class="p">}</span><span class="nx">http</span><span class="o">://</span><span class="nx">example</span><span class="o">.</span><span class="nx">com</span><span class="o">/</span><span class="nx">a_long_link_that_should_not_be_wrapped</span><span class="o">.</span><span class="nx">html</span><span class="p">{</span><span class="o">/</span><span class="nx">unwrap</span><span class="p">}</span> <span class="nx">More</span> <span class="nx">text</span> <span class="nx">that</span> <span class="nx">will</span> <span class="nx">be</span> <span class="nx">wrapped</span> <span class="nx">normally</span><span class="o">.</span> </pre></div> </div> <p>Place the item you do not want word-wrapped between: {unwrap} {/unwrap}</p> </div> </div> <div class="section" id="class-reference"> <h2><a class="toc-backref" href="#id7">Class Reference</a><a class="headerlink" href="#class-reference" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="CI_Email"> <em class="property">class </em><tt class="descname">CI_Email</tt><a class="headerlink" href="#CI_Email" title="Permalink to this definition">¶</a></dt> <dd><dl class="method"> <dt id="CI_Email::from"> <tt class="descname">from</tt><big>(</big><em>$from</em><span class="optional">[</span>, <em>$name = ''</em><span class="optional">[</span>, <em>$return_path = NULL</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_Email::from" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$from</strong> (<em>string</em>) &#8211; &#8220;From&#8221; e-mail address</li> <li><strong>$name</strong> (<em>string</em>) &#8211; &#8220;From&#8221; display name</li> <li><strong>$return_path</strong> (<em>string</em>) &#8211; Optional email address to redirect undelivered e-mail to</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Sets the email address and name of the person sending the email:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">from</span><span class="p">(</span><span class="s1">&#39;you@example.com&#39;</span><span class="p">,</span> <span class="s1">&#39;Your Name&#39;</span><span class="p">);</span> </pre></div> </div> <p>You can also set a Return-Path, to help redirect undelivered mail:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">from</span><span class="p">(</span><span class="s1">&#39;you@example.com&#39;</span><span class="p">,</span> <span class="s1">&#39;Your Name&#39;</span><span class="p">,</span> <span class="s1">&#39;returned_emails@example.com&#39;</span><span class="p">);</span> </pre></div> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Return-Path can&#8217;t be used if you&#8217;ve configured &#8216;smtp&#8217; as your protocol.</p> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::reply_to"> <tt class="descname">reply_to</tt><big>(</big><em>$replyto</em><span class="optional">[</span>, <em>$name = ''</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_Email::reply_to" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$replyto</strong> (<em>string</em>) &#8211; E-mail address for replies</li> <li><strong>$name</strong> (<em>string</em>) &#8211; Display name for the reply-to e-mail address</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Sets the reply-to address. If the information is not provided the information in the :meth:from method is used. Example:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">reply_to</span><span class="p">(</span><span class="s1">&#39;you@example.com&#39;</span><span class="p">,</span> <span class="s1">&#39;Your Name&#39;</span><span class="p">);</span> </pre></div> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::to"> <tt class="descname">to</tt><big>(</big><em>$to</em><big>)</big><a class="headerlink" href="#CI_Email::to" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$to</strong> (<em>mixed</em>) &#8211; Comma-delimited string or an array of e-mail addresses</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Sets the email address(s) of the recipient(s). Can be a single e-mail, a comma-delimited list or an array:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">to</span><span class="p">(</span><span class="s1">&#39;someone@example.com&#39;</span><span class="p">);</span> </pre></div> </div> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">to</span><span class="p">(</span><span class="s1">&#39;one@example.com, two@example.com, three@example.com&#39;</span><span class="p">);</span> </pre></div> </div> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">to</span><span class="p">(</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;one@example.com&#39;</span><span class="p">,</span> <span class="s1">&#39;two@example.com&#39;</span><span class="p">,</span> <span class="s1">&#39;three@example.com&#39;</span><span class="p">)</span> <span class="p">);</span> </pre></div> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::cc"> <tt class="descname">cc</tt><big>(</big><em>$cc</em><big>)</big><a class="headerlink" href="#CI_Email::cc" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$cc</strong> (<em>mixed</em>) &#8211; Comma-delimited string or an array of e-mail addresses</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Sets the CC email address(s). Just like the &#8220;to&#8221;, can be a single e-mail, a comma-delimited list or an array.</p> </dd></dl> <dl class="method"> <dt id="CI_Email::bcc"> <tt class="descname">bcc</tt><big>(</big><em>$bcc</em><span class="optional">[</span>, <em>$limit = ''</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_Email::bcc" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$bcc</strong> (<em>mixed</em>) &#8211; Comma-delimited string or an array of e-mail addresses</li> <li><strong>$limit</strong> (<em>int</em>) &#8211; Maximum number of e-mails to send per batch</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Sets the BCC email address(s). Just like the <tt class="docutils literal"><span class="pre">to()</span></tt> method, can be a single e-mail, a comma-delimited list or an array.</p> <p>If <tt class="docutils literal"><span class="pre">$limit</span></tt> is set, &#8220;batch mode&#8221; will be enabled, which will send the emails to batches, with each batch not exceeding the specified <tt class="docutils literal"><span class="pre">$limit</span></tt>.</p> </dd></dl> <dl class="method"> <dt id="CI_Email::subject"> <tt class="descname">subject</tt><big>(</big><em>$subject</em><big>)</big><a class="headerlink" href="#CI_Email::subject" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$subject</strong> (<em>string</em>) &#8211; E-mail subject line</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Sets the email subject:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">subject</span><span class="p">(</span><span class="s1">&#39;This is my subject&#39;</span><span class="p">);</span> </pre></div> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::message"> <tt class="descname">message</tt><big>(</big><em>$body</em><big>)</big><a class="headerlink" href="#CI_Email::message" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$body</strong> (<em>string</em>) &#8211; E-mail message body</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Sets the e-mail message body:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">message</span><span class="p">(</span><span class="s1">&#39;This is my message&#39;</span><span class="p">);</span> </pre></div> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::set_alt_message"> <tt class="descname">set_alt_message</tt><big>(</big><em>$str</em><big>)</big><a class="headerlink" href="#CI_Email::set_alt_message" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$str</strong> (<em>string</em>) &#8211; Alternative e-mail message body</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Sets the alternative e-mail message body:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">set_alt_message</span><span class="p">(</span><span class="s1">&#39;This is the alternative message&#39;</span><span class="p">);</span> </pre></div> </div> <p>This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative message with no HTML formatting which is added to the header string for people who do not accept HTML email. If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.</p> </dd></dl> <dl class="method"> <dt id="CI_Email::set_header"> <tt class="descname">set_header</tt><big>(</big><em>$header</em>, <em>$value</em><big>)</big><a class="headerlink" href="#CI_Email::set_header" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$header</strong> (<em>string</em>) &#8211; Header name</li> <li><strong>$value</strong> (<em>string</em>) &#8211; Header value</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Appends additional headers to the e-mail:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">set_header</span><span class="p">(</span><span class="s1">&#39;Header1&#39;</span><span class="p">,</span> <span class="s1">&#39;Value1&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">set_header</span><span class="p">(</span><span class="s1">&#39;Header2&#39;</span><span class="p">,</span> <span class="s1">&#39;Value2&#39;</span><span class="p">);</span> </pre></div> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::clear"> <tt class="descname">clear</tt><big>(</big><span class="optional">[</span><em>$clear_attachments = FALSE</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_Email::clear" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$clear_attachments</strong> (<em>bool</em>) &#8211; Whether or not to clear attachments</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Initializes all the email variables to an empty state. This method is intended for use if you run the email sending method in a loop, permitting the data to be reset between cycles.</p> <div class="highlight-ci"><div class="highlight"><pre><span class="k">foreach</span> <span class="p">(</span><span class="nv">$list</span> <span class="k">as</span> <span class="nv">$name</span> <span class="o">=&gt;</span> <span class="nv">$address</span><span class="p">)</span> <span class="p">{</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">clear</span><span class="p">();</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">to</span><span class="p">(</span><span class="nv">$address</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">from</span><span class="p">(</span><span class="s1">&#39;your@example.com&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">subject</span><span class="p">(</span><span class="s1">&#39;Here is your info &#39;</span><span class="o">.</span><span class="nv">$name</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">message</span><span class="p">(</span><span class="s1">&#39;Hi &#39;</span><span class="o">.</span><span class="nv">$name</span><span class="o">.</span><span class="s1">&#39; Here is the info you requested.&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">();</span> <span class="p">}</span> </pre></div> </div> <p>If you set the parameter to TRUE any attachments will be cleared as well:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">clear</span><span class="p">(</span><span class="k">TRUE</span><span class="p">);</span> </pre></div> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::send"> <tt class="descname">send</tt><big>(</big><span class="optional">[</span><em>$auto_clear = TRUE</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_Email::send" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$auto_clear</strong> (<em>bool</em>) &#8211; Whether to clear message data automatically</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">TRUE on success, FALSE on failure</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p> </td> </tr> </tbody> </table> <p>The e-mail sending method. Returns boolean TRUE or FALSE based on success or failure, enabling it to be used conditionally:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span> <span class="o">!</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">())</span> <span class="p">{</span> <span class="c1">// Generate error</span> <span class="p">}</span> </pre></div> </div> <p>This method will automatically clear all parameters if the request was successful. To stop this behaviour pass FALSE:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="k">if</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="k">FALSE</span><span class="p">))</span> <span class="p">{</span> <span class="c1">// Parameters won&#39;t be cleared</span> <span class="p">}</span> </pre></div> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">In order to use the <tt class="docutils literal"><span class="pre">print_debugger()</span></tt> method, you need to avoid clearing the email parameters.</p> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::attach"> <tt class="descname">attach</tt><big>(</big><em>$filename</em><span class="optional">[</span>, <em>$disposition = ''</em><span class="optional">[</span>, <em>$newname = NULL</em><span class="optional">[</span>, <em>$mime = ''</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_Email::attach" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$filename</strong> (<em>string</em>) &#8211; File name</li> <li><strong>$disposition</strong> (<em>string</em>) &#8211; &#8216;disposition&#8217; of the attachment. Most email clients make their own decision regardless of the MIME specification used here. <a class="reference external" href="https://www.iana.org/assignments/cont-disp/cont-disp.xhtml">https://www.iana.org/assignments/cont-disp/cont-disp.xhtml</a></li> <li><strong>$newname</strong> (<em>string</em>) &#8211; Custom file name to use in the e-mail</li> <li><strong>$mime</strong> (<em>string</em>) &#8211; MIME type to use (useful for buffered data)</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">CI_Email instance (method chaining)</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">CI_Email</p> </td> </tr> </tbody> </table> <p>Enables you to send an attachment. Put the file path/name in the first parameter. For multiple attachments use the method multiple times. For example:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">attach</span><span class="p">(</span><span class="s1">&#39;/path/to/photo1.jpg&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">attach</span><span class="p">(</span><span class="s1">&#39;/path/to/photo2.jpg&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">attach</span><span class="p">(</span><span class="s1">&#39;/path/to/photo3.jpg&#39;</span><span class="p">);</span> </pre></div> </div> <p>To use the default disposition (attachment), leave the second parameter blank, otherwise use a custom disposition:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">attach</span><span class="p">(</span><span class="s1">&#39;image.jpg&#39;</span><span class="p">,</span> <span class="s1">&#39;inline&#39;</span><span class="p">);</span> </pre></div> </div> <p>You can also use a URL:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">attach</span><span class="p">(</span><span class="s1">&#39;http://example.com/filename.pdf&#39;</span><span class="p">);</span> </pre></div> </div> <p>If you&#8217;d like to use a custom file name, you can use the third paramater:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">attach</span><span class="p">(</span><span class="s1">&#39;filename.pdf&#39;</span><span class="p">,</span> <span class="s1">&#39;attachment&#39;</span><span class="p">,</span> <span class="s1">&#39;report.pdf&#39;</span><span class="p">);</span> </pre></div> </div> <p>If you need to use a buffer string instead of a real - physical - file you can use the first parameter as buffer, the third parameter as file name and the fourth parameter as mime-type:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">attach</span><span class="p">(</span><span class="nv">$buffer</span><span class="p">,</span> <span class="s1">&#39;attachment&#39;</span><span class="p">,</span> <span class="s1">&#39;report.pdf&#39;</span><span class="p">,</span> <span class="s1">&#39;application/pdf&#39;</span><span class="p">);</span> </pre></div> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::attachment_cid"> <tt class="descname">attachment_cid</tt><big>(</big><em>$filename</em><big>)</big><a class="headerlink" href="#CI_Email::attachment_cid" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$filename</strong> (<em>string</em>) &#8211; Existing attachment filename</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Attachment Content-ID or FALSE if not found</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p> </td> </tr> </tbody> </table> <p>Sets and returns an attachment&#8217;s Content-ID, which enables your to embed an inline (picture) attachment into HTML. First parameter must be the already attached file name.</p> <div class="highlight-ci"><div class="highlight"><pre><span class="nv">$filename</span> <span class="o">=</span> <span class="s1">&#39;/img/photo1.jpg&#39;</span><span class="p">;</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">attach</span><span class="p">(</span><span class="nv">$filename</span><span class="p">);</span> <span class="k">foreach</span> <span class="p">(</span><span class="nv">$list</span> <span class="k">as</span> <span class="nv">$address</span><span class="p">)</span> <span class="p">{</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">to</span><span class="p">(</span><span class="nv">$address</span><span class="p">);</span> <span class="nv">$cid</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">attach_cid</span><span class="p">(</span><span class="nv">$filename</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">message</span><span class="p">(</span><span class="s1">&#39;&lt;img src=&#39;</span><span class="nx">cid</span><span class="o">:</span><span class="s2">&quot;. </span><span class="si">$cid</span><span class="s2"> .&quot;</span><span class="s1">&#39; alt=&quot;photo1&quot; /&gt;&#39;</span><span class="p">);</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">();</span> <span class="p">}</span> </pre></div> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Content-ID for each e-mail must be re-created for it to be unique.</p> </div> </dd></dl> <dl class="method"> <dt id="CI_Email::print_debugger"> <tt class="descname">print_debugger</tt><big>(</big><span class="optional">[</span><em>$include = array('headers'</em>, <em>'subject'</em>, <em>'body')</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#CI_Email::print_debugger" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>$include</strong> (<em>array</em>) &#8211; Which parts of the message to print out</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Formatted debug data</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p> </td> </tr> </tbody> </table> <p>Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.</p> <p>You can optionally specify which parts of the message should be printed. Valid options are: <strong>headers</strong>, <strong>subject</strong>, <strong>body</strong>.</p> <p>Example:</p> <div class="highlight-ci"><div class="highlight"><pre><span class="c1">// You need to pass FALSE while sending in order for the email data</span> <span class="c1">// to not be cleared - if that happens, print_debugger() would have</span> <span class="c1">// nothing to output.</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">send</span><span class="p">(</span><span class="k">FALSE</span><span class="p">);</span> <span class="c1">// Will only print the email headers, excluding the message subject and body</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">email</span><span class="o">-&gt;</span><span class="na">print_debugger</span><span class="p">(</span><span class="k">array</span><span class="p">(</span><span class="s1">&#39;headers&#39;</span><span class="p">));</span> </pre></div> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">By default, all of the raw data will be printed.</p> </div> </dd></dl> </dd></dl> </div> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <a href="encrypt.html" class="btn btn-neutral float-right" title="Encrypt Class">Next <span class="fa fa-arrow-circle-right"></span></a> <a href="config.html" class="btn btn-neutral" title="Config Class"><span class="fa fa-arrow-circle-left"></span> Previous</a> </div> <hr/> <div role="contentinfo"> <p> &copy; Copyright 2014 - 2015, British Columbia Institute of Technology. Last updated on Mar 30, 2015. </p> </div> Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer> </div> </div> </section> </div> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT:'../', VERSION:'3.0.0', COLLAPSE_INDEX:false, FILE_SUFFIX:'.html', HAS_SOURCE: false }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/js/theme.js"></script> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.StickyNav.enable(); }); </script> </body> </html>
{ "content_hash": "23ae86a9972f70d0c505281b7619e0b5", "timestamp": "", "source": "github", "line_count": 1046, "max_line_length": 490, "avg_line_length": 59.67782026768642, "alnum_prop": 0.6557839257965814, "repo_name": "DavidJDJ/sacramento", "id": "910de2cac159b8f33323a658dbfc2fc6f032be1c", "size": "62446", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "user_guide/libraries/email.html", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1508" }, { "name": "CSS", "bytes": "185905" }, { "name": "HTML", "bytes": "5496491" }, { "name": "JavaScript", "bytes": "434133" }, { "name": "PHP", "bytes": "1917674" } ], "symlink_target": "" }
<content xml:space="preserve" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <!-- paths --> <item id="iconPath">../icons/{0}</item> <item id="stylePath">../styles/{0}</item> <item id="scriptPath">../scripts/{0}</item> <!-- locale --> <item id="meta_locale">en-us</item> <item id="meta_help20_desktopTechnologyAttribute">kbNetFramewk</item> <item id="meta_help20_netcfTechnologyAttribute">kbNetCompactFramewk</item> <item id="meta_help20_netcfDocSetAttribute">NetCompactFramework</item> <item id="meta_help20_xnaTechnologyAttribute">kbXNA</item> <item id="meta_help20_xnaDocSetAttribute">XNA</item> <!-- header and footer --> <item id="header"><span class="introStyle"></span></item> <item id="footer_text"></item> <!-- freshness date --> <item id="boilerplate_UpdateTitle"><span class="introStyle">Updated: {0}</span></item> <!-- if the TransformComponent of the BuildAssembler config file has the argument: argument key="changeHistoryOptions" value="showDefaultFreshnessDate" the "text_defaultFreshnessDate" item is used as the default freshness date for topics that don't have a Change History table. --> <item id="text_defaultFreshnessDate"/> <!-- topic title --> <item id="boilerplate_pageTitle">{0}</item> <!-- alert titles --> <item id="alert_title_tip"><b>Подсказка:</b></item> <item id="alert_title_caution"><b>Внимание:</b></item> <item id="alert_title_security"><b>Замечание о безопасности:</b></item> <item id="alert_title_note"><b>Замечание:</b></item> <item id="alert_title_important"><b>Важное замечание:</b></item> <item id="alert_title_visualBasic"><b>Visual Basic замечание:</b></item> <item id="alert_title_visualC#"><b>C# замечание:</b></item> <item id="alert_title_visualC++"><b>C++ замечание:</b></item> <item id="alert_title_visualJ#"><b>J# замечание:</b></item> <!-- alert alt text --> <item id="alert_altText_tip">Подсказка</item> <item id="alert_altText_caution">Внимание</item> <item id="alert_altText_security">Замечание о безопасности</item> <item id="alert_altText_note">Замечание</item> <item id="alert_altText_important">Важное замечание</item> <item id="alert_altText_visualBasic">Visual Basic замечание</item> <item id="alert_altText_visualC#">C# замечание</item> <item id="alert_altText_visualC++">C++ замечание</item> <item id="alert_altText_visualJ#">J# замечание</item> <!-- section titles --> <item id="title_remarks">Remarks</item> <item id="title_changeHistory">Change History</item> <item id="title_exceptions">Исключения</item> <item id="title_contracts">Contracts</item> <item id="title_setter">Set</item> <item id="title_getter">Get</item> <item id="title_seeAlso_tasks">Задания</item> <item id="title_seeAlso_reference">Ссылка</item> <item id="title_seeAlso_concepts">Concepts</item> <item id="title_seeAlso_otherResources">Другие ресурсы</item> <!-- dynamic Link Information --> <item id="meta_mshelp_KTable"><MSHelp:ktable keywords='{0}' locHeader='Location' topicHeader = 'Topic' disambiguator='table' indexMoniker='!DefaultDynamicLinkIndex' /></item> <item id="inline_dynamicLink_prefixText">For more information, see </item> <item id="inline_dynamicLink_postfixText">.</item> <item id="inline_dynamicLink_separatorText"> and </item> <!-- devlang --> <item id="devlang_VisualBasic">Visual Basic</item> <item id="devlang_VisualBasicDeclaration">Visual Basic</item> <item id="devlang_VisualBasicUsage">Visual Basic Usage</item> <item id="devlang_VBScript">Visual Basic Script</item> <item id="devlang_CSharp">C#</item> <item id="devlang_visualbasicANDcsharp">Visual Basic and C#</item> <item id="devlang_ManagedCPlusPlus">Visual C++</item> <item id="devlang_JSharp">J#</item> <item id="devlang_JScript">JScript</item> <item id="devlang_xmlLang">XML</item> <item id="devlang_JavaScript">JavaScript</item> <item id="devlang_FSharp">F#</item> <item id="devlang_html">HTML</item> <item id="devlang_XAML">XAML</item> <item id="devlang_AspNet">ASP.NET</item> <item id="devlang_pshell">PowerShell</item> <item id="devlang_sql">SQL</item> <!-- language keywords --> <item id="devlang_nullKeyword">a null reference (<span class="keyword">Nothing</span> in Visual Basic)</item> <item id="devlang_staticKeyword"><span class="keyword">static</span> (<span class="keyword">Shared</span> in Visual Basic)</item> <item id="devlang_virtualKeyword"><span class="keyword">virtual</span> (<span class="keyword">Overridable</span> in Visual Basic)</item> <item id="devlang_trueKeyword"><span class="keyword">true</span> (<span class="keyword">True</span> in Visual Basic)</item> <item id="devlang_falseKeyword"><span class="keyword">false</span> (<span class="keyword">False</span> in Visual Basic)</item> <item id="devlang_abstractKeyword"><span class="keyword">abstract</span> (<span class="keyword">MustInherit</span> in Visual Basic)</item> <!-- transforms insert K Index Technology qualifiers based on a conceptual topic's //metadata/attribute[@name='DocSet'] value />--> <!-- If you add new docset values, the item/@id must = "meta_kIndexTechTag_" + the lower-case DocSet name. --> <item id="meta_kIndexTermWithTechQualifier">{0}<include item="meta_kIndexTechTag_{1}" />{2}</item> <item id="meta_kIndexTechTag_avalon"> [WPF]</item> <item id="meta_kIndexTechTag_wpf"> [WPF]</item> <item id="meta_kIndexTechTag_wcf"> [Windows Communication Foundation]</item> <item id="meta_kIndexTechTag_windowsforms"> [Windows Forms]</item> <item id="top">В начало страницы</item> <!-- Copyright --> <item id="copyright_info"><include item="copyright_text"/></item> <item id="copyright_link"></item> <item id="copyright_text">&#169; 2005 Microsoft Corporation. All rights reserved.</item> <!-- Bibliography --> <item id="bibliographyTitle">Bibliography</item> <!-- Legacy shared content --> <item id="copyrightText"><include item="copyright_text"/></item> <item id="copyCode">--- NA ---</item> </content>
{ "content_hash": "8397ab1f1f4a55c534b2a31a82db16df", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 140, "avg_line_length": 48.24603174603175, "alnum_prop": 0.693535120908044, "repo_name": "Sergey-Dvortsov/StockSharp", "id": "98abecca4b699dcf39e62e99766ed23dbc504f8c", "size": "6328", "binary": false, "copies": "19", "ref": "refs/heads/master", "path": "Documentation/ru/RuLocalization/ru-RU/shared_content.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "4895009" }, { "name": "Lua", "bytes": "2364" } ], "symlink_target": "" }
package cruise.umple.umple; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Anonymous constant Declaration 1</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link cruise.umple.umple.Anonymous_constantDeclaration_1_#isList_1 <em>List 1</em>}</li> * <li>{@link cruise.umple.umple.Anonymous_constantDeclaration_1_#getName_1 <em>Name 1</em>}</li> * <li>{@link cruise.umple.umple.Anonymous_constantDeclaration_1_#getType_1 <em>Type 1</em>}</li> * </ul> * </p> * * @see cruise.umple.umple.UmplePackage#getAnonymous_constantDeclaration_1_() * @model * @generated */ public interface Anonymous_constantDeclaration_1_ extends EObject { /** * Returns the value of the '<em><b>List 1</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>List 1</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>List 1</em>' attribute. * @see #setList_1(boolean) * @see cruise.umple.umple.UmplePackage#getAnonymous_constantDeclaration_1__List_1() * @model * @generated */ boolean isList_1(); /** * Sets the value of the '{@link cruise.umple.umple.Anonymous_constantDeclaration_1_#isList_1 <em>List 1</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>List 1</em>' attribute. * @see #isList_1() * @generated */ void setList_1(boolean value); /** * Returns the value of the '<em><b>Name 1</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Name 1</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Name 1</em>' attribute. * @see #setName_1(String) * @see cruise.umple.umple.UmplePackage#getAnonymous_constantDeclaration_1__Name_1() * @model * @generated */ String getName_1(); /** * Sets the value of the '{@link cruise.umple.umple.Anonymous_constantDeclaration_1_#getName_1 <em>Name 1</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Name 1</em>' attribute. * @see #getName_1() * @generated */ void setName_1(String value); /** * Returns the value of the '<em><b>Type 1</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Type 1</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Type 1</em>' attribute. * @see #setType_1(String) * @see cruise.umple.umple.UmplePackage#getAnonymous_constantDeclaration_1__Type_1() * @model * @generated */ String getType_1(); /** * Sets the value of the '{@link cruise.umple.umple.Anonymous_constantDeclaration_1_#getType_1 <em>Type 1</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Type 1</em>' attribute. * @see #getType_1() * @generated */ void setType_1(String value); } // Anonymous_constantDeclaration_1_
{ "content_hash": "ce9529ddda34ef14ac7b77349ff2e265", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 125, "avg_line_length": 31.96153846153846, "alnum_prop": 0.6176293622141997, "repo_name": "runqingz/umple", "id": "ddf363431f5ba266e4f90f9181baa237d1ad169d", "size": "3365", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "cruise.umple.xtext/src-gen/cruise/umple/umple/Anonymous_constantDeclaration_1_.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "82437" }, { "name": "GAP", "bytes": "1064953" }, { "name": "HTML", "bytes": "2054445" }, { "name": "Java", "bytes": "40692567" }, { "name": "JavaScript", "bytes": "1601380" }, { "name": "Lex", "bytes": "11050" }, { "name": "Matlab", "bytes": "1160" }, { "name": "PHP", "bytes": "455541" }, { "name": "Ruby", "bytes": "365551" }, { "name": "Shell", "bytes": "5247" }, { "name": "Xtend", "bytes": "351" } ], "symlink_target": "" }
#pragma once #include <aws/cloudfront/CloudFront_EXPORTS.h> #include <aws/cloudfront/CloudFrontRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace CloudFront { namespace Model { /* The request to get a distribution configuration. */ class AWS_CLOUDFRONT_API GetDistributionConfig2015_04_17Request : public CloudFrontRequest { public: GetDistributionConfig2015_04_17Request(); Aws::String SerializePayload() const override; /* The distribution's id. */ inline const Aws::String& GetId() const{ return m_id; } /* The distribution's id. */ inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; } /* The distribution's id. */ inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = value; } /* The distribution's id. */ inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); } /* The distribution's id. */ inline GetDistributionConfig2015_04_17Request& WithId(const Aws::String& value) { SetId(value); return *this;} /* The distribution's id. */ inline GetDistributionConfig2015_04_17Request& WithId(Aws::String&& value) { SetId(value); return *this;} /* The distribution's id. */ inline GetDistributionConfig2015_04_17Request& WithId(const char* value) { SetId(value); return *this;} private: Aws::String m_id; bool m_idHasBeenSet; }; } // namespace Model } // namespace CloudFront } // namespace Aws
{ "content_hash": "8cb7c6f6c80156ffaf90f54b270f0ba8", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 114, "avg_line_length": 23.772727272727273, "alnum_prop": 0.662842574888464, "repo_name": "kahkeng/aws-sdk-cpp", "id": "debe28f24e175321439e831173467e769c4e7907", "size": "2140", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "aws-cpp-sdk-cloudfront/include/aws/cloudfront/model/GetDistributionConfig2015_04_17Request.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "7595" }, { "name": "C++", "bytes": "37744404" }, { "name": "CMake", "bytes": "265388" }, { "name": "Java", "bytes": "214644" }, { "name": "Python", "bytes": "46021" } ], "symlink_target": "" }
/* zutil.c -- target dependent utility functions for the compression library * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ #pragma ident "%Z%%M% %I% %E% SMI" #include "zutil.h" #ifndef NO_DUMMY_DECL struct internal_state {int dummy;}; /* for buggy compilers */ #endif const char * const z_errmsg[10] = { "need dictionary", /* Z_NEED_DICT 2 */ "stream end", /* Z_STREAM_END 1 */ "", /* Z_OK 0 */ "file error", /* Z_ERRNO (-1) */ "stream error", /* Z_STREAM_ERROR (-2) */ "data error", /* Z_DATA_ERROR (-3) */ "insufficient memory", /* Z_MEM_ERROR (-4) */ "buffer error", /* Z_BUF_ERROR (-5) */ "incompatible version",/* Z_VERSION_ERROR (-6) */ ""}; const char * ZEXPORT zlibVersion() { return ZLIB_VERSION; } uLong ZEXPORT zlibCompileFlags() { uLong flags; flags = 0; switch (sizeof(uInt)) { case 2: break; case 4: flags += 1; break; case 8: flags += 2; break; default: flags += 3; } switch (sizeof(uLong)) { case 2: break; case 4: flags += 1 << 2; break; case 8: flags += 2 << 2; break; default: flags += 3 << 2; } switch (sizeof(voidpf)) { case 2: break; case 4: flags += 1 << 4; break; case 8: flags += 2 << 4; break; default: flags += 3 << 4; } switch (sizeof(z_off_t)) { case 2: break; case 4: flags += 1 << 6; break; case 8: flags += 2 << 6; break; default: flags += 3 << 6; } #ifdef DEBUG flags += 1 << 8; #endif #if defined(ASMV) || defined(ASMINF) flags += 1 << 9; #endif #ifdef ZLIB_WINAPI flags += 1 << 10; #endif #ifdef BUILDFIXED flags += 1 << 12; #endif #ifdef DYNAMIC_CRC_TABLE flags += 1 << 13; #endif #ifdef NO_GZCOMPRESS flags += 1L << 16; #endif #ifdef NO_GZIP flags += 1L << 17; #endif #ifdef PKZIP_BUG_WORKAROUND flags += 1L << 20; #endif #ifdef FASTEST flags += 1L << 21; #endif #ifdef STDC # ifdef NO_vsnprintf flags += 1L << 25; # ifdef HAS_vsprintf_void flags += 1L << 26; # endif # else # ifdef HAS_vsnprintf_void flags += 1L << 26; # endif # endif #else flags += 1L << 24; # ifdef NO_snprintf flags += 1L << 25; # ifdef HAS_sprintf_void flags += 1L << 26; # endif # else # ifdef HAS_snprintf_void flags += 1L << 26; # endif # endif #endif return flags; } #ifdef DEBUG # ifndef verbose # define verbose 0 # endif int z_verbose = verbose; void z_error (m) char *m; { fprintf(stderr, "%s\n", m); exit(1); } #endif /* exported to allow conversion of error code to string for compress() and * uncompress() */ const char * ZEXPORT zError(err) int err; { return ERR_MSG(err); } #if defined(_WIN32_WCE) /* The Microsoft C Run-Time Library for Windows CE doesn't have * errno. We define it as a global variable to simplify porting. * Its value is always 0 and should not be used. */ int errno = 0; #endif #define HAVE_MEMCPY #ifndef HAVE_MEMCPY void zmemcpy(dest, source, len) Bytef* dest; const Bytef* source; uInt len; { if (len == 0) return; do { *dest++ = *source++; /* ??? to be unrolled */ } while (--len != 0); } int zmemcmp(s1, s2, len) const Bytef* s1; const Bytef* s2; uInt len; { uInt j; for (j = 0; j < len; j++) { if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; } return 0; } void zmemzero(dest, len) Bytef* dest; uInt len; { if (len == 0) return; do { *dest++ = 0; /* ??? to be unrolled */ } while (--len != 0); } #endif #ifdef SYS16BIT #ifdef __TURBOC__ /* Turbo C in 16-bit mode */ # define MY_ZCALLOC /* Turbo C malloc() does not allow dynamic allocation of 64K bytes * and farmalloc(64K) returns a pointer with an offset of 8, so we * must fix the pointer. Warning: the pointer must be put back to its * original form in order to free it, use zcfree(). */ #define MAX_PTR 10 /* 10*64K = 640K */ local int next_ptr = 0; typedef struct ptr_table_s { voidpf org_ptr; voidpf new_ptr; } ptr_table; local ptr_table table[MAX_PTR]; /* This table is used to remember the original form of pointers * to large buffers (64K). Such pointers are normalized with a zero offset. * Since MSDOS is not a preemptive multitasking OS, this table is not * protected from concurrent access. This hack doesn't work anyway on * a protected system like OS/2. Use Microsoft C instead. */ voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) { voidpf buf = opaque; /* just to make some compilers happy */ ulg bsize = (ulg)items*size; /* If we allocate less than 65520 bytes, we assume that farmalloc * will return a usable pointer which doesn't have to be normalized. */ if (bsize < 65520L) { buf = farmalloc(bsize); if (*(ush*)&buf != 0) return buf; } else { buf = farmalloc(bsize + 16L); } if (buf == NULL || next_ptr >= MAX_PTR) return NULL; table[next_ptr].org_ptr = buf; /* Normalize the pointer to seg:0 */ *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; *(ush*)&buf = 0; table[next_ptr++].new_ptr = buf; return buf; } void zcfree (voidpf opaque, voidpf ptr) { int n; if (*(ush*)&ptr != 0) { /* object < 64K */ farfree(ptr); return; } /* Find the original pointer */ for (n = 0; n < next_ptr; n++) { if (ptr != table[n].new_ptr) continue; farfree(table[n].org_ptr); while (++n < next_ptr) { table[n-1] = table[n]; } next_ptr--; return; } ptr = opaque; /* just to make some compilers happy */ Assert(0, "zcfree: ptr not found"); } #endif /* __TURBOC__ */ #ifdef M_I86 /* Microsoft C in 16-bit mode */ # define MY_ZCALLOC #if (!defined(_MSC_VER) || (_MSC_VER <= 600)) # define _halloc halloc # define _hfree hfree #endif voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) { if (opaque) opaque = 0; /* to make compiler happy */ return _halloc((long)items, size); } void zcfree (voidpf opaque, voidpf ptr) { if (opaque) opaque = 0; /* to make compiler happy */ _hfree(ptr); } #endif /* M_I86 */ #endif /* SYS16BIT */ #ifndef MY_ZCALLOC /* Any system without a special alloc function */ #ifndef STDC extern voidp malloc OF((uInt size)); extern voidp calloc OF((uInt items, uInt size)); extern void free OF((voidpf ptr)); #endif voidpf zcalloc (opaque, items, size) voidpf opaque; unsigned items; unsigned size; { if (opaque) items += size - size; /* make compiler happy */ return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : (voidpf)calloc(items, size); } void zcfree (opaque, ptr) voidpf opaque; voidpf ptr; { free(ptr); if (opaque) return; /* make compiler happy */ } #endif /* MY_ZCALLOC */
{ "content_hash": "059add579e2db5d3ae2815b077311e41", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 76, "avg_line_length": 22.358255451713397, "alnum_prop": 0.5663926431656681, "repo_name": "dplbsd/soc2013", "id": "7d46e30b3edf4e0a50795f2ddd9d8568511a73f3", "size": "7282", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "head/sys/cddl/contrib/opensolaris/uts/common/zmod/zutil.c", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "AGS Script", "bytes": "62471" }, { "name": "Assembly", "bytes": "4478661" }, { "name": "Awk", "bytes": "278525" }, { "name": "Batchfile", "bytes": "20417" }, { "name": "C", "bytes": "383420305" }, { "name": "C++", "bytes": "72796771" }, { "name": "CSS", "bytes": "109748" }, { "name": "ChucK", "bytes": "39" }, { "name": "D", "bytes": "3784" }, { "name": "DIGITAL Command Language", "bytes": "10640" }, { "name": "DTrace", "bytes": "2311027" }, { "name": "Emacs Lisp", "bytes": "65902" }, { "name": "EmberScript", "bytes": "286" }, { "name": "Forth", "bytes": "184405" }, { "name": "GAP", "bytes": "72156" }, { "name": "Groff", "bytes": "32248806" }, { "name": "HTML", "bytes": "6749816" }, { "name": "IGOR Pro", "bytes": "6301" }, { "name": "Java", "bytes": "112547" }, { "name": "KRL", "bytes": "4950" }, { "name": "Lex", "bytes": "398817" }, { "name": "Limbo", "bytes": "3583" }, { "name": "Logos", "bytes": "187900" }, { "name": "Makefile", "bytes": "3551839" }, { "name": "Mathematica", "bytes": "9556" }, { "name": "Max", "bytes": "4178" }, { "name": "Module Management System", "bytes": "817" }, { "name": "NSIS", "bytes": "3383" }, { "name": "Objective-C", "bytes": "836351" }, { "name": "PHP", "bytes": "6649" }, { "name": "Perl", "bytes": "5530761" }, { "name": "Perl6", "bytes": "41802" }, { "name": "PostScript", "bytes": "140088" }, { "name": "Prolog", "bytes": "29514" }, { "name": "Protocol Buffer", "bytes": "61933" }, { "name": "Python", "bytes": "299247" }, { "name": "R", "bytes": "764" }, { "name": "Rebol", "bytes": "738" }, { "name": "Ruby", "bytes": "45958" }, { "name": "Scilab", "bytes": "197" }, { "name": "Shell", "bytes": "10501540" }, { "name": "SourcePawn", "bytes": "463194" }, { "name": "SuperCollider", "bytes": "80208" }, { "name": "Tcl", "bytes": "80913" }, { "name": "TeX", "bytes": "719821" }, { "name": "VimL", "bytes": "22201" }, { "name": "XS", "bytes": "25451" }, { "name": "XSLT", "bytes": "31488" }, { "name": "Yacc", "bytes": "1857830" } ], "symlink_target": "" }
package shaft.poker.agent.bettingstrategy; import java.util.List; import shaft.poker.agent.IBettingStrategy; import shaft.poker.agent.IHandEvaluator; import shaft.poker.game.Card; import shaft.poker.game.IAction; import shaft.poker.game.ITable; import shaft.poker.game.ITable.Round; import shaft.poker.game.table.IActionBuilder; import shaft.poker.game.table.IGameEventListener; import shaft.poker.game.table.IPlayerData; /** * * @author Thomas Schaffer <thomas.schaffer@epitech.eu> */ public class SimpleStrategy implements IBettingStrategy, IGameEventListener { private static final double VALUE_2BET = 0.85; private static final double VALUE_1BET = 0.50; private static final double BLINDSTEAL_RATE = 0.35; private static final double PREFLOP_LATE_LIMPS_RATE = 0.6; private static final double CONTINUATION_BET_RATE = 0.3; private static final double FLOP_POT_STEAL_RATE = 0.3; private boolean _preflopBetter; public SimpleStrategy(ITable table) { table.registerEventListener(this); } private IAction doBets(ITable table, IPlayerData plData, IActionBuilder actionBuild, int n) { if (table.numberBets() < n) { //System.out.println("Decision: VALUE BET"); return actionBuild.makeRaise(actionBuild.minRaise()); } else if (plData.moneyInPotForRound() > 0 || plData.betsToCall() <= n) { //System.out.println("Decision: VALUE CALL"); _preflopBetter = false; return actionBuild.makeCall(); } _preflopBetter = false; return actionBuild.makeFold(); } @Override public IAction action(ITable table, List<Card> holeCards, IPlayerData plData, IActionBuilder actionBuild, IHandEvaluator eval) { Card c1 = holeCards.get(0); Card c2 = holeCards.get(1); if (c1.rank().ordinal() < c2.rank().ordinal()) { Card tmp = c1; c1 = c2; c2 = tmp; } // Variable malus [0.0..0.1] for early positions double positionNeg = 0.10 * (((double)table.numberPlayersToAct()) / ((double) table.numberActivePlayers() - 1)); // Value bets if (eval.effectiveHandStrength() - positionNeg >= VALUE_2BET) { if (table.round() == Round.PREFLOP) { _preflopBetter = true; } return doBets(table, plData, actionBuild, 2); } else if (eval.effectiveHandStrength() - positionNeg >= VALUE_1BET) { if (table.round() == Round.PREFLOP) { _preflopBetter = true; } return doBets(table, plData, actionBuild, 1); } if (table.round() == Round.PREFLOP) { _preflopBetter = false; if (plData.position() == table.numberActivePlayers()) { // On the dealer button if (table.numberBets() == 0) { // No action if (Math.random() <= BLINDSTEAL_RATE) { // Try to steal blinds 35% of the time _preflopBetter = true; //System.out.println("Decision: BLIND STEAL"); return actionBuild.makeRaise(actionBuild.minRaise()); } } } if (table.numberPlayersToAct() <= 1 && table.numberCallers() >= 2 && table.numberBets() <= 1) { if (c1.rank() == c2.rank() || (c1.suit() == c2.suit() && c1.rank().ordinal() == c2.rank().ordinal() + 1)) { // Pocket pair or suited connectors if (Math.random() <= PREFLOP_LATE_LIMPS_RATE) { // Limp to try to flop a monster hand 60% of the time //System.out.println("Decision: LATE CHEAP LIMP"); return actionBuild.makeCall(); } } } } else if (table.round() == Round.FLOP) { if (table.numberBets() == 0) { if (_preflopBetter) { // Strong preflop image, no action, try a continuation bet 30% of the time if (Math.random() <= CONTINUATION_BET_RATE) { //System.out.println("Decision: CONTINUATION BET"); return actionBuild.makeRaise(actionBuild.minRaise()); } } if (plData.position() == table.numberActivePlayers()) { // Last position, action checked to us if (table.potSize() >= 5 * actionBuild.minRaise()) { // Decent pot size if (Math.random() <= FLOP_POT_STEAL_RATE) { // Try to steal the pot 30% of the time //System.out.println("Decision: POT STEAL"); return actionBuild.makeRaise(actionBuild.minRaise()); } } } } } // Free check if (plData.amountToCall() == 0) { //System.out.println("Decision: FREE CHECK"); return actionBuild.makeCall(); } // Drawing hands, check pot odds if ((table.round() != Round.RIVER && eval.posPotential() >= plData.potOdds(table.potSize())) || eval.effectiveHandStrength() >= plData.potOdds(table.potSize())) { //System.out.println("Decision: DRAWING HAND / POT ODDS"); return actionBuild.makeCall(); } if (Math.random() <= (((double) plData.totalMoneyInPot()) / ((double) table.potSize())) / 1.5) { // Make the call now and then, depending on the amount already invested in the pot return actionBuild.makeCall(); } // Last resort, fold the hand return actionBuild.makeFold(); } @Override public void roundBegin(ITable table, ITable.Round r) { } @Override public void roundEnd(ITable table, ITable.Round r) { } @Override public void newHand(ITable table) { _preflopBetter = false; } @Override public void newGame(ITable table, int stackSize, int sBlind, int bBlind, List<String> players) { } @Override public void winHand(ITable table, IPlayerData data, int amount) { } }
{ "content_hash": "6e8168a4f7de9a3cdb43a5c0b547ad9c", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 132, "avg_line_length": 37.52, "alnum_prop": 0.535790435577216, "repo_name": "loopfz/Lucki", "id": "43423f6be0541d532ac0cefa044b65e7cd3eb810", "size": "7733", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/shaft/poker/agent/bettingstrategy/SimpleStrategy.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "309796" } ], "symlink_target": "" }
namespace GrizzenServer { public class PointCmd : Cmd { public PointCmd(Client client) : base(client) { } public override void Run() { if (HasAccess) { Clients.TellScene(Scene, "Point", Actor); } } } }
{ "content_hash": "c2ae1b8f468266bbe41ec2e4c1c548dd", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 57, "avg_line_length": 19.933333333333334, "alnum_prop": 0.4782608695652174, "repo_name": "McBits/DungeonR", "id": "d340edbc67c4353015a1e2a85d0dbfe8ed68b601", "size": "299", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "server/src/Commands/All/Point.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "13178" }, { "name": "F#", "bytes": "170619" }, { "name": "GLSL", "bytes": "1967" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "9e656b3b35203e2eb11001d9ca302b5e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "0ba7ae2f286e2641f2536ae6d0f7579eeea8d15e", "size": "177", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Vernonia/Vernonia oligophylla/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#include "trikKit/robotModel/parts/trikObjectSensor.h" using namespace trik::robotModel::parts; using namespace kitBase::robotModel; TrikObjectSensor::TrikObjectSensor(const DeviceInfo &info, const PortInfo &port) : kitBase::robotModel::robotParts::VectorSensor(info, port) { }
{ "content_hash": "0d8eabe7abe95270f27cf3de6d58a1d8", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 80, "avg_line_length": 25.727272727272727, "alnum_prop": 0.7950530035335689, "repo_name": "DenisKogutich/qreal", "id": "ae238ed0cd437fcf46e8a91cda387f7ea6f9daf8", "size": "887", "binary": false, "copies": "12", "ref": "refs/heads/master", "path": "plugins/robots/common/trikKit/src/robotModel/parts/trikObjectSensor.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1181" }, { "name": "C", "bytes": "23858" }, { "name": "C#", "bytes": "18292" }, { "name": "C++", "bytes": "6434440" }, { "name": "CSS", "bytes": "13352" }, { "name": "HTML", "bytes": "302656" }, { "name": "IDL", "bytes": "913" }, { "name": "JavaScript", "bytes": "10863" }, { "name": "Perl", "bytes": "3704" }, { "name": "Perl6", "bytes": "34034" }, { "name": "Prolog", "bytes": "971" }, { "name": "Python", "bytes": "25813" }, { "name": "QMake", "bytes": "300220" }, { "name": "Shell", "bytes": "84443" }, { "name": "Tcl", "bytes": "21071" }, { "name": "Turing", "bytes": "112" } ], "symlink_target": "" }
layout: post title: "Legendary for iOS" date: 2013-01-15 06:40 comments: true categories: [Open Source, Mobile, iOS, Titanium] --- Last night I Open Sourced an iOS application called [Legendary](https://github.com/fusion94/Legendary). Legendary displays catchphrases and memorable quotes from the character Barney Stinson from the hit show _How I Met Your Mother_. This application was originally developed using the [Appcelerator Titanium](http://appcelerator.com) framework and will build for iOS only at the moment but I'd love to see it ported over to Android and other mobile platforms. As an aside this is __only__ the mobile client side of the application. There's a server side component as well that will also be open sourced later this week. <!-- more --> Below is all the data from the README.md on [GitHub](http://github.com) * * * ### Description Legendary displays catchphrases and memorable quotes from the character Barney Stinson. Browse and discover the only collection of Barney Stinson quotes available on the iPhone! Who is Barney Stinson? * He is a womanizer, favors suits, laser tag, and uses the words "awesome" and "legendary" frequently. * Barney is almost always seen wearing a suit and makes great use of his catchphrase, "Suit up!", often modifying it for a particular situation (i.e., "Snowsuit up!" while making an igloo in Central Park, or "Flight suit up!" when he dresses as a "kick a** fighter pilot" for Halloween, or "Slut Up!" when Lily and Robin get ready to go to a high school prom, or when he says "Space suit up Ted, 'cause you're going to the moon," in the episode where Ted may or may not have a threesome). ### What's New in Version 1.2 * All New 5 Suit Rating System * Quotes are broken down by season * All new popular system * Randomize function ### Coming Soon: * Search Functionality * Ability to send to friend * Ability to send to Twitter * Ability to send to Facebook Follow us on Twitter: [@legendaryapp](http://twitter.com/legendaryapp) You can always download a binary in the [iTunes Store](https://itunes.apple.com/us/app/legendary/id317444914?mt=8) ### Screenshots: ![](/images/blog/legendary/screenshots/legendary1.jpg) ![](/images/blog/legendary/screenshots/legendary2.jpg) ![](/images/blog/legendary/screenshots/legendary3.jpg) ![](/images/blog/legendary/screenshots/legendary4.jpg) ![](/images/blog/legendary/screenshots/legendary5.jpg) ### The Details: This application was originally developed using the [Appcelerator Titanium](http://appcelerator.com) framework and will build for iOS only at the moment. ### Contributing: If you care to contribute at all then please see the [CONTRIBUTING File](https://github.com/fusion94/Legendary/blob/master/CONTRIBUTING.md) for more details. ### License: This application is licensed under the Mozilla Public License Version 2.0. Please see the [LICENSE File](https://github.com/fusion94/Legendary/blob/master/LICENSE) for more details.
{ "content_hash": "2eaf8cdc493c09812ea16aee793afd70", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 488, "avg_line_length": 52.767857142857146, "alnum_prop": 0.7681895093062606, "repo_name": "fusion94/fusion94.github.io", "id": "73b2b517911c4b56806ed9a5389180425c663e5b", "size": "2959", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/2013-01-15-legendary-for-ios.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "13953" }, { "name": "HTML", "bytes": "21389" }, { "name": "JavaScript", "bytes": "660" }, { "name": "Ruby", "bytes": "6183" } ], "symlink_target": "" }
package com.twitter.mk_melics.sojobus; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest{ @Test public void addition_isCorrect() throws Exception{ assertEquals(4, 2 + 2); } }
{ "content_hash": "8bef557e2454e914ac832f5b0852958e", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 20.0625, "alnum_prop": 0.6947040498442367, "repo_name": "MeilCli/SojoBus", "id": "7fc7c3dfa8e68bacc7c0bc30d141ee2217c37f31", "size": "321", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/test/java/com/twitter/mk_melics/sojobus/ExampleUnitTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "4155" }, { "name": "Kotlin", "bytes": "34736" } ], "symlink_target": "" }
module.exports = (service) -> options = service.options ## Engine Default engine based on service discovery. The option "engine" is set if a suitable database is found and match a pre-configured provider. Possible values are 'mariadb', 'postgresql' and 'mysql' in this order of preference. For exemple, an "engine" options set to "mariadb" reflect the discovery of an instance of MariaDB and the existance of a usable db object available as the "mariadb" option. if service.deps.mariadb options.engine ?= 'mariadb' else if service.deps.postgresql options.engine ?= 'postgresql' else if service.deps.mysql options.engine ?= 'mysql' else options.engine ?= null ## Providers A provider object contains commons properties and potentially database specific properties. Commons properties are: * `engine` (string) One of the supported engine between "mariadb", "postgresql", "mysql", required. * `admin_username` (string) Administrator username. * `admin_password` (string) Administrator password. * `java.driver` (string) Java driver. * `java.datasource` (string) Java datasource. * `jdbc` (string) JDBC URL. * `fqdns` ([string]) List of database FQDNs. * `host` ([string]) Single database host for customers which doesn't support multi hosts or if a proxy is configured. * `port` (int) Database server port. ### MariaDB # Auto discovered configuration if service.deps.mariadb options.mariadb ?= {} options.mariadb.discovered = true options.mariadb.engine = 'mariadb' options.mariadb.admin_username ?= 'root' options.mariadb.admin_password ?= service.deps.mariadb[0].options.admin_password options.mariadb.fqdns ?= service.deps.mariadb.map (srv) -> srv.node.fqdn options.mariadb.host ?= options.mariadb.fqdns[0] options.mariadb.port ?= service.deps.mariadb[0].options.my_cnf['mysqld']['port'] # Manual configurattion else if options.mariadb throw Error "Required Options: fqdns" unless options.mariadb.fqdns # Default value of auto discovered and manual configurattion if options.mariadb options.mariadb.java ?= {} options.mariadb.java.driver = 'com.mysql.jdbc.Driver' options.mariadb.java.datasource = 'org.mariadb.jdbc.MariaDbDataSource' options.mariadb.port ?= 3306 url = options.mariadb.fqdns.map((fqdn)-> "#{fqdn}:#{options.mariadb.port}").join(',') options.mariadb.jdbc ?= "jdbc:mysql://#{url}" if options.mariadb throw Error 'Required Option: mariadb.admin_username' unless options.mariadb.admin_username? throw Error 'Required Option: mariadb.admin_password' unless options.mariadb.admin_password? ### PostgreSQL # Auto discovered configuration if service.deps.postgresql options.postgresql ?= {} options.postgresql.discovered = true options.postgresql.engine = 'postgresql' options.postgresql.admin_username ?= 'root' options.postgresql.admin_password ?= service.deps.postgresql[0].options.password options.postgresql.fqdns ?= service.deps.postgresql.map (srv) -> srv.node.fqdn options.postgresql.host ?= options.postgresql.fqdns[0] options.postgresql.port ?= service.deps.postgresql[0].options.port url = options.postgresql.fqdns.map((fqdn)-> "#{fqdn}:#{options.postgresql.port}").join(',') options.postgresql.jdbc ?= "jdbc:postgresql://#{url}" # Manual configurattion else if options.postgresql throw Error "Required Options: fqdns" unless options.postgresql.fqdns # Default value of auto discovered and manual configurattion if options.postgresql options.postgresql.java ?= {} options.postgresql.java.datasource = 'org.postgresql.jdbc2.Jdbc2PoolingDataSource' options.postgresql.java.driver = 'org.postgresql.Driver' options.postgresql.port ?= 5432 url = options.postgresql.fqdns.map((fqdn)-> "#{fqdn}:#{options.postgresql.port}").join(',') options.postgresql.jdbc ?= "jdbc:postgresql://#{url}" if options.postgresql throw Error 'Required Option: postgresql.admin_username' unless options.postgresql.admin_username? throw Error 'Required Option: postgresql.admin_password' unless options.postgresql.admin_password? ### Mysql # Auto discovered configuration if service.deps.mysql options.mysql ?= {} options.mysql.discovered = true options.mysql.engine = 'mysql' options.mysql.admin_username ?= 'root' options.mysql.admin_password ?= service.deps.mysql[0].options.admin_password options.mysql.fqdns ?= service.deps.mysql.map (srv) -> srv.node.fqdn options.mysql.host ?= options.mysql.fqdns[0] options.mysql.port ?= service.deps.mysql[0].options.my_cnf['mysqld']['port'] # Manual configurattion else if options.postgresql throw Error "Required Options: fqdns" unless options.postgresql.fqdns # Default value of auto discovered and manual configurattion if options.mysql options.mysql.java ?= {} options.mysql.java.driver = 'com.mysql.jdbc.Driver' options.mysql.java.datasource = 'com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource' options.mysql.port ?= 3306 url = options.mysql.fqdns.map((fqdn)-> "#{fqdn}:#{options.mysql.port}").join(',') options.mysql.jdbc ?= "jdbc:mysql://#{url}" if options.mysql throw Error 'Required Option: mysql.admin_username' unless options.mysql.admin_username? throw Error 'Required Option: mysql.admin_password' unless options.mysql.admin_password? ## Wait options.wait_mariadb = service.deps.mariadb[0].options.wait if service.deps.mariadb options.wait_postgresql = service.deps.postgresql[0].options.wait if service.deps.postgresql options.wait_mysql = service.deps.mysql[0].options.wait if service.deps.mysql options.wait = {} options.wait.tcp = [] if options.mariadb then for fqdn in options.mariadb.fqdns options.wait.tcp.push host: fqdn, port: options.mariadb.port if options.postgresql then for fqdn in options.postgresql.fqdns options.wait.tcp.push host: fqdn, port: options.postgresql.port if options.mysql then for fqdn in options.mysql.fqdns options.wait.tcp.push host: fqdn, port: options.mysql.port
{ "content_hash": "2dc872afc1c043e17dc14c02f89adc54", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 106, "avg_line_length": 45.51748251748252, "alnum_prop": 0.6865878015056076, "repo_name": "ryba-io/ryba", "id": "7033270498eb8b9f9f2955977be7f9199b0c5bc5", "size": "6532", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/tools/db_admin/configure.coffee.md", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1369" }, { "name": "CoffeeScript", "bytes": "3043018" }, { "name": "Dockerfile", "bytes": "9195" }, { "name": "JavaScript", "bytes": "589" }, { "name": "Jinja", "bytes": "1829220" }, { "name": "PHP", "bytes": "61968" }, { "name": "Perl", "bytes": "2767" }, { "name": "Python", "bytes": "16567" }, { "name": "Shell", "bytes": "278026" }, { "name": "XSLT", "bytes": "548" } ], "symlink_target": "" }
package com.hongtu.designpattern.proxy.cglibProxy; /** * Created by hongtu on 16-11-21. */ public interface Hello { void say(String name); }
{ "content_hash": "d3d14d49967fbda99b52378390b23e52", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 50, "avg_line_length": 18.5, "alnum_prop": 0.7027027027027027, "repo_name": "zanghongtu2006/java_utils", "id": "fbb278ee95c0385d2a6537f93ba6fc5c8eb7889b", "size": "148", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "common/src/main/java/com/hongtu/designpattern/proxy/cglibProxy/Hello.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "32337" } ], "symlink_target": "" }
package net.xenqtt.test; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; import java.util.Arrays; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; /** * This client sends data to a TCP echo server using blocking IO. Data is in the following format: * <ul> * <li>First 2 bytes: big endian length of the remaining paylaod</li> * <li>Remaining bytes: payload</li> * </ul> */ public final class BlockingTcpEchoClient { private final CountDownLatch done; private final AtomicInteger totalMessagesReceived = new AtomicInteger(); private final byte[] message; private final String host; private final int port; private final int connectionCount; private final int messagesPerConnection; public static void main(String[] args) throws Exception { if (args.length != 5) { usage(); System.exit(1); } String host = args[0]; int port = Integer.parseInt(args[1]); int connectionCount = Integer.parseInt(args[2]); int messagesPerConnection = Integer.parseInt(args[3]); int messageSize = Integer.parseInt(args[4]); new BlockingTcpEchoClient(host, port, connectionCount, messagesPerConnection, messageSize).run(); } private BlockingTcpEchoClient(String host, int port, int connectionCount, int messagesPerConnection, int messageSize) { this.done = new CountDownLatch(connectionCount); this.host = host; this.port = port; this.connectionCount = connectionCount; this.messagesPerConnection = messagesPerConnection; this.message = new byte[messageSize]; Arrays.fill(message, (byte) 9); } private static void usage() { System.out .println("\nUsage: java -Xms1g -Xmx1g -server -cp:xenqtt.jar net.sf.xenqtt.test.BlockingTcpEchoClient host port connectionCount messagesPerConnection messageSize"); System.out.println("\thost: the host the server is listening on"); System.out.println("\tport: the port the server is listening on"); System.out.println("\tconnectionCount: the number of connections to make to the server"); System.out.println("\tmessagesPerConnection: the number of messages for each connection to send to the server"); System.out.println("\tmessageSize: the size, in bytes, of each message"); System.out.println(); } private void run() throws Exception { System.out.printf("Establishing %d connections to %s:%d...\n", connectionCount, host, port); SocketAddress addr = new InetSocketAddress(host, port); long start = System.currentTimeMillis(); for (int i = 0; i < connectionCount; i++) { SocketChannel channel = SocketChannel.open(addr); BlockingClientConnection connection = new BlockingClientConnection(channel); connection.start(); int count = Math.min(50, messagesPerConnection); connection.messagesSent.set(count); for (int j = 0; j < count; j++) { ByteBuffer buffer = ByteBuffer.allocate(message.length + 2); buffer.putShort((short) message.length); buffer.put(message); buffer.flip(); connection.send(buffer); } } System.out.printf("Waiting for all messages to be sent: %d messages/connection * %d connections = %d messages\n", messagesPerConnection, connectionCount, messagesPerConnection * connectionCount); done.await(); long end = System.currentTimeMillis(); System.out.println("Messages sent/received: " + totalMessagesReceived.get()); System.out.println("Elapsed millis: " + (end - start)); } private final class BlockingClientConnection extends AbstractBlockingConnection { private final AtomicInteger messagesReceived = new AtomicInteger(); private final AtomicInteger messagesSent = new AtomicInteger(); public BlockingClientConnection(SocketChannel channel) { super(channel); } /** * @see net.xenqtt.test.AbstractBlockingConnection#messageSent(java.nio.ByteBuffer) */ @Override void messageSent(ByteBuffer buffer) { if (messagesSent.getAndIncrement() < messagesPerConnection) { buffer.clear(); send(buffer); } } /** * @see net.xenqtt.test.AbstractBlockingConnection#messageReceived(java.nio.ByteBuffer) */ @Override void messageReceived(ByteBuffer buffer) { totalMessagesReceived.incrementAndGet(); int len = buffer.getShort(0) & 0xffff; if (len != buffer.limit() - 2) { System.err.println("Received corrupt packet: " + Arrays.toString(buffer.array())); } if (messagesReceived.incrementAndGet() == messagesPerConnection) { close(); done.countDown(); } } } }
{ "content_hash": "524462292176c6b0d3fcbf92f663551f", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 168, "avg_line_length": 32.070422535211264, "alnum_prop": 0.733201581027668, "repo_name": "codebeautiful/xenqtt", "id": "b2e34d73a2ca98e25aaaca9af4ea67533fb419b7", "size": "5146", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/net/xenqtt/test/BlockingTcpEchoClient.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "5023" }, { "name": "HTML", "bytes": "47576" }, { "name": "Java", "bytes": "1023033" }, { "name": "Shell", "bytes": "2303" } ], "symlink_target": "" }
<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>MOAL.algorithms.sorting.threaded_sort &mdash; MoAL documentation</title> <link rel="stylesheet" href="../../../../_static/css/theme.css" type="text/css" /> <link rel="top" title="MoAL documentation" href="../../../../index.html"/> <link rel="up" title="Module code" href="../../../index.html"/> <script src="../../../../_static/js/modernizr.min.js"></script> </head> <body class="wy-body-for-nav" role="document"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search"> <a href="../../../../index.html" class="icon icon-home"> MoAL </a> <div role="search"> <form id="rtd-search-form" class="wy-form" action="../../../../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <ul> <li class="toctree-l1"><a class="reference internal" href="../../../../MOAL.html">MOAL package</a></li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../../../../index.html">MoAL</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../../../../index.html">Docs</a> &raquo;</li> <li><a href="../../../index.html">Module code</a> &raquo;</li> <li>MOAL.algorithms.sorting.threaded_sort</li> <li class="wy-breadcrumbs-aside"> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <h1>Source code for MOAL.algorithms.sorting.threaded_sort</h1><div class="highlight"><pre> <span class="c"># -*- coding: utf-8 -*-</span> <span class="n">__author__</span> <span class="o">=</span> <span class="s">&quot;&quot;&quot;Chris Tabor (dxdstudio@gmail.com)&quot;&quot;&quot;</span> <span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span> <span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">getcwd</span> <span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">sys</span> <span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">getcwd</span><span class="p">())</span> <span class="kn">from</span> <span class="nn">MOAL.helpers.display</span> <span class="kn">import</span> <span class="n">Section</span> <span class="kn">from</span> <span class="nn">MOAL.helpers.generic</span> <span class="kn">import</span> <span class="n">subdivide_groups</span> <span class="kn">from</span> <span class="nn">MOAL.helpers.generic</span> <span class="kn">import</span> <span class="n">random_number_set</span> <span class="kn">from</span> <span class="nn">MOAL.algorithms.sorting.quick_sort</span> <span class="kn">import</span> <span class="n">quick_sort</span> <span class="kn">from</span> <span class="nn">pprint</span> <span class="kn">import</span> <span class="n">pprint</span> <span class="k">as</span> <span class="n">ppr</span> <span class="kn">from</span> <span class="nn">Queue</span> <span class="kn">import</span> <span class="n">Queue</span> <span class="kn">from</span> <span class="nn">threading</span> <span class="kn">import</span> <span class="n">Lock</span> <span class="kn">from</span> <span class="nn">threading</span> <span class="kn">import</span> <span class="n">Thread</span> <span class="n">SORT_LOCK</span> <span class="o">=</span> <span class="n">Lock</span><span class="p">()</span> <div class="viewcode-block" id="ThreadSort"><a class="viewcode-back" href="../../../../MOAL.algorithms.sorting.html#MOAL.algorithms.sorting.threaded_sort.ThreadSort">[docs]</a><span class="k">class</span> <span class="nc">ThreadSort</span><span class="p">:</span> <span class="sd">&quot;&quot;&quot;An experiment to divide a list of items up into sub-groups</span> <span class="sd"> and then sort them individually on different threads.</span> <span class="sd"> Doesn&#39;t really perform better than the original algorithm,</span> <span class="sd"> though it could be useful for processing individual lists separately.&quot;&quot;&quot;</span> <div class="viewcode-block" id="ThreadSort.__init__"><a class="viewcode-back" href="../../../../MOAL.algorithms.sorting.html#MOAL.algorithms.sorting.threaded_sort.ThreadSort.__init__">[docs]</a> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sorting_func</span><span class="p">,</span> <span class="n">threads</span><span class="o">=</span><span class="mi">2</span><span class="p">):</span> <span class="bp">self</span><span class="o">.</span><span class="n">threads</span> <span class="o">=</span> <span class="n">threads</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorting_func</span> <span class="o">=</span> <span class="n">sorting_func</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorting_queue</span> <span class="o">=</span> <span class="n">Queue</span><span class="p">()</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorted_items</span> <span class="o">=</span> <span class="p">[]</span></div> <div class="viewcode-block" id="ThreadSort._disperse"><a class="viewcode-back" href="../../../../MOAL.algorithms.sorting.html#MOAL.algorithms.sorting.threaded_sort.ThreadSort._disperse">[docs]</a> <span class="k">def</span> <span class="nf">_disperse</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">threads</span><span class="p">):</span> <span class="n">t</span> <span class="o">=</span> <span class="n">Thread</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_worker</span><span class="p">,</span> <span class="n">kwargs</span><span class="o">=</span><span class="p">{</span> <span class="s">&#39;sorted_items&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorted_items</span><span class="p">})</span> <span class="n">t</span><span class="o">.</span><span class="n">daemon</span> <span class="o">=</span> <span class="bp">True</span> <span class="n">t</span><span class="o">.</span><span class="n">start</span><span class="p">()</span> <span class="k">return</span> <span class="bp">self</span></div> <div class="viewcode-block" id="ThreadSort._worker"><a class="viewcode-back" href="../../../../MOAL.algorithms.sorting.html#MOAL.algorithms.sorting.threaded_sort.ThreadSort._worker">[docs]</a> <span class="k">def</span> <span class="nf">_worker</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sorted_items</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span> <span class="k">while</span> <span class="bp">True</span><span class="p">:</span> <span class="n">items</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorting_queue</span><span class="o">.</span><span class="n">get</span><span class="p">()</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorted_items</span> <span class="o">+=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorting_func</span><span class="p">(</span><span class="n">items</span><span class="p">)</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorting_queue</span><span class="o">.</span><span class="n">task_done</span><span class="p">()</span></div> <div class="viewcode-block" id="ThreadSort._enqueue"><a class="viewcode-back" href="../../../../MOAL.algorithms.sorting.html#MOAL.algorithms.sorting.threaded_sort.ThreadSort._enqueue">[docs]</a> <span class="k">def</span> <span class="nf">_enqueue</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">items</span><span class="p">):</span></div> <span class="c"># Get the number of thread groups to run based on length and threads.</span> <span class="n">groups</span> <span class="o">=</span> <span class="n">subdivide_groups</span><span class="p">(</span><span class="n">items</span><span class="p">,</span> <span class="n">divisions</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">threads</span><span class="p">)</span> <span class="c"># For each sub group, sort on a separate thread.</span> <span class="k">for</span> <span class="n">group</span> <span class="ow">in</span> <span class="n">groups</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorting_queue</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">group</span><span class="p">)</span> <span class="k">return</span> <span class="bp">self</span> <div class="viewcode-block" id="ThreadSort.run"><a class="viewcode-back" href="../../../../MOAL.algorithms.sorting.html#MOAL.algorithms.sorting.threaded_sort.ThreadSort.run">[docs]</a> <span class="k">def</span> <span class="nf">run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">items</span><span class="p">):</span></div> <span class="c"># Make sure thread number is never greater than the number of items.</span> <span class="n">num_items</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">items</span><span class="p">)</span> <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">threads</span> <span class="o">&gt;</span> <span class="n">num_items</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">threads</span> <span class="o">-=</span> <span class="mi">1</span> <span class="k">if</span> <span class="n">num_items</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">:</span> <span class="k">return</span> <span class="n">items</span> <span class="c"># Prevent passing in div by zero errors.</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">threads</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">threads</span> <span class="o">=</span> <span class="mi">1</span> <span class="bp">self</span><span class="o">.</span><span class="n">_disperse</span><span class="p">()</span><span class="o">.</span><span class="n">_enqueue</span><span class="p">(</span><span class="n">items</span><span class="p">)</span> <span class="c"># Block until complete.</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorting_queue</span><span class="o">.</span><span class="n">join</span><span class="p">()</span> <span class="c"># Perform the second sort on already sorted sublists.</span> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorting_func</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sorted_items</span><span class="p">)</span></div> <span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span> <span class="k">with</span> <span class="n">Section</span><span class="p">(</span><span class="s">&#39;Threaded Sorts&#39;</span><span class="p">):</span> <span class="n">threaded_quicksort</span> <span class="o">=</span> <span class="n">ThreadSort</span><span class="p">(</span><span class="n">quick_sort</span><span class="p">,</span> <span class="n">threads</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span> <span class="n">rand</span> <span class="o">=</span> <span class="n">random_number_set</span><span class="p">(</span><span class="n">max_range</span><span class="o">=</span><span class="mi">20</span><span class="p">)</span> <span class="n">res</span> <span class="o">=</span> <span class="n">threaded_quicksort</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">rand</span><span class="p">)</span> <span class="k">print</span><span class="p">(</span><span class="s">&#39;Is valid? {}&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">res</span> <span class="o">==</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">rand</span><span class="p">)))</span> <span class="n">ppr</span><span class="p">(</span><span class="n">res</span><span class="p">)</span> </pre></div> </div> </div> <footer> <hr/> <div role="contentinfo"> <p> &copy; Copyright 2015, Chris Tabor. </p> </div> Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer> </div> </div> </section> </div> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT:'../../../../', VERSION:'', COLLAPSE_INDEX:false, FILE_SUFFIX:'.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../../_static/doctools.js"></script> <script type="text/javascript" src="../../../../_static/js/theme.js"></script> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.StickyNav.enable(); }); </script> </body> </html>
{ "content_hash": "462e7a117b90a36ef1d6545668d7285d", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 498, "avg_line_length": 60.049056603773586, "alnum_prop": 0.5981273172877521, "repo_name": "christabor/MoAL", "id": "12886f886408ac5da9ebd532f806a46e1f93479c", "size": "15915", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/_build/html/_modules/MOAL/algorithms/sorting/threaded_sort.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "1102" }, { "name": "Clojure", "bytes": "1089" }, { "name": "Gherkin", "bytes": "793" }, { "name": "HTML", "bytes": "3579" }, { "name": "JavaScript", "bytes": "1647" }, { "name": "Makefile", "bytes": "1436" }, { "name": "PLSQL", "bytes": "415" }, { "name": "Python", "bytes": "692840" }, { "name": "Shell", "bytes": "4420" }, { "name": "TSQL", "bytes": "1090" } ], "symlink_target": "" }
<!DOCTYPE html> <!-- saved from url=(0105)file:///Users/bradleyjupiterbaudot/Desktop/DBC/curriculum/JupiterLikeThePlanet.github.io/blog/indexB.html --> <html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <link type="text/css" rel="stylesheets" href="file:///Users/bradleyjupiterbaudot/Desktop/DBC/curriculum/JupiterLikeThePlanet.github.io/stylsheets/default.css"> <title>Jupiter's Website</title> </head> <body><header><h2>Site Header Here</h2></header> <img src="./Jupiter's Website_files/indexB.html" alt="My Photo"> <nav> <p>Blurb about blog's content and purpose</p> <a href="./Jupiter's Website_files/indexB.html">Contact</a> <a href="./Jupiter's Website_files/indexB.html">About Me</a> <a href="./Jupiter's Website_files/indexB.html">Social Media</a> </nav> <p> Blurb blurb blurb</p> <figure class="row1"> <a href="file:///Users/bradleyjupiterbaudot/Desktop/DBC/curriculum/JupiterLikeThePlanet.github.io/blog/t1-git-blog.html"><img src="./Jupiter's Website_files/indexB.html" alt="Post 1" width="304" height="228"></a> <figcaption>Post 1</figcaption> </figure> <figure class="row1"> <img src="./Jupiter's Website_files/indexB.html" alt="Post 2" width="304" height="228"> <figcaption>Post 2</figcaption> </figure> <figure class="row1"> <img src="./Jupiter's Website_files/indexB.html" alt="Post 3" width="304" height="228"> <figcaption> Post 3</figcaption> </figure> <figure> <img src="./Jupiter's Website_files/indexB.html" alt="Post 4" width="304" height="228"> <figcaption>Post 4</figcaption> </figure> <figure> <img src="./Jupiter's Website_files/indexB.html" alt="Post 5" width="304" height="228"> <figcaption>Post 5</figcaption> </figure> <figure> <img src="./Jupiter's Website_files/indexB.html" alt="Post 6" width="304" height="228"> <figcaption> Post 6</figcaption> </figure> <figure> <img src="./Jupiter's Website_files/indexB.html" alt="Post 7" width="304" height="228"> <figcaption> Post 7</figcaption> </figure> <footer> <h6>Footer Stuff Here</h6> </footer> </body></html>
{ "content_hash": "e108e62be4bd99986a7e80cb45fbff8e", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 216, "avg_line_length": 34.17460317460318, "alnum_prop": 0.6799814212726428, "repo_name": "JupiterLikeThePlanet/phase-0", "id": "9248804ee3a1304166503ed9600d0d8cc8247e48", "size": "2153", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "week-2/imgs/Jupiter's Website.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4735" }, { "name": "HTML", "bytes": "21326" }, { "name": "JavaScript", "bytes": "38399" }, { "name": "Ruby", "bytes": "107977" } ], "symlink_target": "" }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // The module 'vscode' contains the VS Code extensibility API // Import the module and reference it with the alias vscode in your code below const vscode = require("vscode"); function getTabString(editor) { let spacesUsed = editor.options.insertSpaces; if (spacesUsed) { let numOfUsedSpaces = editor.options.tabSize; return ' '.repeat(numOfUsedSpaces); } return '\t'; } // this method is called when your extension is activated function activate(extensionContext) { // The command has been defined in the package.json file // Now provide the implementation of the command with registerCommand // The commandId parameter must match the command field in package.json vscode.commands.registerCommand('extension.htmlTagWrap', () => { // The code you place here will be executed every time your command is executed const editor = vscode.window.activeTextEditor; let tabSizeSpace = getTabString(editor); if (editor == null) { return; } if (extensionContext) { // Prevents tests from breaking const currentUpdate = '0.0.7'; const hasUserSeenCurrentUpdateMessage = extensionContext.globalState.get('lastUpdateSeen') === currentUpdate ? true : false; if (!hasUserSeenCurrentUpdateMessage) { vscode.window.showInformationMessage('htmltagwrap now supports adding attributes on opening tags'); extensionContext.globalState.update('lastUpdateSeen', currentUpdate); console.log('lastUpdateSeen = ', extensionContext.globalState.get('lastUpdateSeen')); } } /* First, temporarily leave tags empty if they start/end on the same line to work around VS Code's default setting `html.autoClosingTags,`. This setting would autocloses these opening tags if they come with element names already inside them. */ let openingTags = '<' + '>'; let closingTags = '</' + '>'; let tagsMissingElements = []; let tag = vscode.workspace.getConfiguration().get("htmltagwrap.tag"); let autoDeselectClosingTag = vscode.workspace.getConfiguration().get("htmltagwrap.autoDeselectClosingTag"); if (!tag) { tag = 'p'; } // Start inserting tags editor.edit((editBuilder) => { const selections = editor.selections; for (const [i, selection] of selections.entries()) { const selectionStart = selection.start; const selectionEnd = selection.end; if (selectionEnd.line !== selectionStart.line) { // ================ // Wrap it as a block // ================ var selectionStart_spaces = editor.document.lineAt(selectionStart.line).text.substring(0, selectionStart.character); // Modify last line of selection editBuilder.insert(new vscode.Position(selectionEnd.line, selectionEnd.character), '\n' + selectionStart_spaces + '</' + tag + '>'); editBuilder.insert(new vscode.Position(selectionEnd.line, 0), tabSizeSpace); for (let lineNumber = selectionEnd.line - 1; lineNumber > selectionStart.line; lineNumber--) { editBuilder.insert(new vscode.Position(lineNumber, 0), tabSizeSpace); } // Modify first line of selection editBuilder.insert(new vscode.Position(selectionStart.line, selectionStart.character), '<' + tag + '>\n' + selectionStart_spaces + tabSizeSpace); } else { // ================ // Wrap it inline // ================ let beginningPosition = new vscode.Position(selectionEnd.line, selectionStart.character); let endingPosition = new vscode.Position(selectionEnd.line, selectionEnd.character); editBuilder.insert(beginningPosition, openingTags); editBuilder.insert(endingPosition, closingTags); tagsMissingElements.push(i); } } }, { undoStopBefore: true, undoStopAfter: false }).then(() => { // Add tag name elements // Need to fetch selections again as they are no longer accurate const selections = editor.selections; return editor.edit((editBuilder) => { let tagsMissingElementsSelections = tagsMissingElements.map(index => { return selections[index]; }); tagsMissingElementsSelections.map(selection => { let tagFirst = selection.start.translate(0, -1); let tagSecond = selection.end.translate(0, -1); if (selection.start.character === selection.end.character) { // Empty selection // When dealing with an empty selection, both the start and end position end up being *after* the closing tag // backtrack to account for that tagFirst = tagFirst.translate(0, -3); } editBuilder.insert(tagFirst, tag); editBuilder.insert(tagSecond, tag); }); }, { undoStopBefore: false, undoStopAfter: true }); }, (err) => { console.log('Element name insertion rejected!'); console.error(err); }).then(() => { console.log('Edit applied!'); const selections = editor.selections; const toSelect = new Array(); return new Promise(resolve => { // Need to fetch selections again as they are no longer accurate for (let selection of selections) { // Careful : the selection starts at the beginning of the text but ends *after* the closing tag if (selection.end.line !== selection.start.line) { // ================ // Block selection // ================ let lineAbove = selection.start.line - 1; let lineBelow = selection.end.line; let startPosition = selection.start.character - tabSizeSpace.length + 1; let endPosition = selection.end.character - 1 - tag.length; toSelect.push(new vscode.Selection(lineAbove, startPosition, lineAbove, startPosition + tag.length)); toSelect.push(new vscode.Selection(lineBelow, endPosition, lineBelow, endPosition + tag.length)); } else { // ================ // Inline selection // ================ // same line, just get to the tag element by navigating backwards let startPosition = selection.start.character - 1 - tag.length; let endPosition = selection.end.character - 1 - tag.length; if (selection.start.character === selection.end.character) { // Empty selection startPosition = startPosition - 3 - tag.length; } toSelect.push(new vscode.Selection(selection.start.line, startPosition, selection.start.line, startPosition + tag.length)); toSelect.push(new vscode.Selection(selection.end.line, endPosition, selection.end.line, endPosition + tag.length)); } resolve(); } }).then(() => { return new Promise(resolve => { editor.selections = toSelect; let windowListener = vscode.window.onDidChangeTextEditorSelection((event) => { resolve('✔ Selections updated'); }); }); }).then(selectionsPromiseFulfilled => { console.log(selectionsPromiseFulfilled); if (!autoDeselectClosingTag) { return; } // Wait for selections to be made, then listen for changes. // Enter a mode to listen for whitespace and remove the second cursor let workspaceListener; let windowListener; let autoDeselectClosingTagAction = new Promise((resolve, reject) => { // Have selections changed? const initialSelections = editor.selections; windowListener = vscode.window.onDidChangeTextEditorSelection((event) => { if (event.kind !== undefined && event.kind !== 1) { // Listen for anything that changes selection but keyboard input // or an undefined event (such as backspace clearing last selected character) resolve('✔ User changed selection. Event type: ' + event.kind); } }); // Did user enter a space workspaceListener = vscode.workspace.onDidChangeTextDocument((event) => { let contentChange = event.contentChanges; if (contentChange[0].text === ' ') { // If the user presses space without typing anything, we need to resolve with a parameter and make sure to add back the tag names that were overwritten with a space const resolution = { spaceInsertedAt: contentChange[1].range, initialSelections: initialSelections }; resolve(resolution); } }); }); return autoDeselectClosingTagAction.then((success) => { //Cleanup memory and processes workspaceListener.dispose(); windowListener.dispose(); let newSelections = new Array(); const spacePressedWithoutTypingNewTag = () => { if (success.spaceInsertedAt) { const initialSelections = success.initialSelections; const spaceInsertedAt = success.spaceInsertedAt; // Selections array is in the order user made selections (arbitrary), whereas the spaceInsertedAt (content-edit array) is in logical order, so we must loop to compare. let returnValue; for (let i = 0; i < initialSelections.length; i++) { if (spaceInsertedAt.isEqual(initialSelections[i])) { returnValue = true; //console.log('Selection[' + i + '] equal??? ' + returnValue); break; } else { returnValue = false; } } return returnValue; } else { return false; } }; editor.edit((editBuilder) => { // Update selections const initialSelections = editor.selections; let newLine = false; let charOffset = 0; const addMissingTag = spacePressedWithoutTypingNewTag(); for (const [index, selection] of initialSelections.entries()) { let tagPosition = selection.start; if (index % 2 !== 0) { // Remove whitespace on closing tag // Since closing tag selection is now length zero and after the whitespace, select a range one character backwards const closingTagWhitespace = selection.with({ start: selection.end.translate(0, -1), end: undefined }); editBuilder.delete(closingTagWhitespace); } else { tagPosition = selection.start.translate(undefined, -1); } if (addMissingTag) { // If the user pressed space and overwrote the default tag with no tag, add the default tag before the space editBuilder.insert(tagPosition, tag); } } ; }, { undoStopBefore: false, undoStopAfter: false }).then(() => { // Update selections const initialSelections = editor.selections; for (const [index, selection] of initialSelections.entries()) { if (index % 2 === 0) { newSelections.push(selection); } } }).then(() => { editor.selections = newSelections; console.log('✔︎ Deselected closing tags'); }); }); }); }, (err) => { console.log('Edit rejected!'); console.error(err); }); }); } exports.activate = activate; //# sourceMappingURL=extension.js.map
{ "content_hash": "9dc4c9c6f5f7acc5790040cea5a1dd14", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 195, "avg_line_length": 55.494163424124515, "alnum_prop": 0.4992287196746599, "repo_name": "ealbertos/dotfiles", "id": "d25f46f67655b5ca8af6aaf5cdcac413c879f2e3", "size": "14270", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vscode.symlink/extensions/bradgashler.htmltagwrap-0.0.7/out/src/extension.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "99972" }, { "name": "EJS", "bytes": "2437" }, { "name": "HTML", "bytes": "47081" }, { "name": "JavaScript", "bytes": "3546995" }, { "name": "Less", "bytes": "183" }, { "name": "Python", "bytes": "134723" }, { "name": "Ruby", "bytes": "127567" }, { "name": "Shell", "bytes": "34790" }, { "name": "TSQL", "bytes": "258" }, { "name": "TypeScript", "bytes": "37162" }, { "name": "Vim Script", "bytes": "60888" }, { "name": "Vim Snippet", "bytes": "11523" } ], "symlink_target": "" }