code
stringlengths
4
991k
repo_name
stringlengths
6
116
path
stringlengths
4
249
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
4
991k
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
/* ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. ** Distributed under the terms of the NewOS License. */ #ifndef _KERNEL_KHASH_H #define _KERNEL_KHASH_H struct hash_iterator { void *ptr; int bucket; }; void *hash_init(unsigned int table_size, int next_ptr_offset, int compare_func(void *a, const void *key), unsigned int hash_func(void *a, const void *key, unsigned int range)); int hash_uninit(void *_hash_table); int hash_insert(void *_hash_table, void *_elem); int hash_remove(void *_hash_table, void *_elem); void *hash_find(void *_hash_table, void *e); void *hash_lookup(void *_hash_table, const void *key); struct hash_iterator *hash_open(void *_hash_table, struct hash_iterator *i); void hash_close(void *_hash_table, struct hash_iterator *i, bool free_iterator); void *hash_next(void *_hash_table, struct hash_iterator *i); void hash_rewind(void *_hash_table, struct hash_iterator *i); void hash_dump(void *_hash_table); /* function ptrs must look like this: // hash function should calculate hash on either e or key, // depending on which one is not NULL unsigned int hash_func(void *e, const void *key, unsigned int range); // compare function should compare the element with // the key, returning 0 if equal, other if not // NOTE: compare func can be null, in which case the hash // code will compare the key pointer with the target int compare_func(void *e, const void *key); */ unsigned int hash_hash_str( const char *str ); #endif
dioptre/newos
include/kernel/khash.h
C
bsd-3-clause
1,481
[ 30522, 1013, 1008, 1008, 1008, 9385, 2541, 1011, 2526, 1010, 10001, 16216, 5562, 20850, 28109, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 5500, 2104, 1996, 3408, 1997, 1996, 2047, 2891, 6105, 1012, 1008, 1013, 1001, 2065, 13629, 2546, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.oryx.core.converter; import com.vaadin.data.util.converter.Converter; import org.apache.log4j.Logger; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.GregorianCalendar; import java.util.Locale; /** * Created by 241180 on 14/03/2017. */ public class XMLGregorianCalendarStringConverter implements Converter<String, XMLGregorianCalendar> { final static Logger logger = Logger.getLogger(XMLGregorianCalendarStringConverter.class); @Override public XMLGregorianCalendar convertToModel(String date, Class<? extends XMLGregorianCalendar> aClass, Locale locale) throws ConversionException { if (date == null) return null; try { return stringToXMLGregorianCalendar(date); } catch (DatatypeConfigurationException e) { //e.printStackTrace(); logger.warn("DatatypeConfigurationException date to XMLGregorianCalendar"); } catch (ParseException e) { logger.warn("ParseException date to XMLGregorianCalendar"); //e.printStackTrace(); } return null; } @Override public String convertToPresentation(XMLGregorianCalendar xmlGregorianCalendar, Class<? extends String> aClass, Locale locale) throws ConversionException { if (xmlGregorianCalendar != null) return xmlGregorianCalendar.toGregorianCalendar().getTime().toString(); else return null; } public Class<XMLGregorianCalendar> getModelType() { return XMLGregorianCalendar.class; } public Class<String> getPresentationType() { return String.class; } public XMLGregorianCalendar stringToXMLGregorianCalendar(String s) throws ParseException, DatatypeConfigurationException { XMLGregorianCalendar result = null; Date date; SimpleDateFormat simpleDateFormat; GregorianCalendar gregorianCalendar; simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); date = simpleDateFormat.parse(s); gregorianCalendar = (GregorianCalendar) GregorianCalendar.getInstance(); gregorianCalendar.setTime(date); result = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar); return result; } }
241180/Oryx
oryx-client/client-core/src/main/java/com/oryx/core/converter/XMLGregorianCalendarStringConverter.java
Java
gpl-3.0
2,519
[ 30522, 7427, 4012, 1012, 2030, 17275, 1012, 4563, 1012, 10463, 2121, 1025, 12324, 4012, 1012, 12436, 17190, 2078, 1012, 2951, 1012, 21183, 4014, 1012, 10463, 2121, 1012, 10463, 2121, 1025, 12324, 8917, 1012, 15895, 1012, 8833, 2549, 3501, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <title>HTTPolice notices</title> <meta charset="utf-8"> <meta content="HTTPolice 0.7.0" name="generator"> <style type="text/css">/**************************************************************** * Common styles ****************************************************************/ body { color: black; font-family: sans-serif; quotes: '“' '”'; } body.report { /* I hate this line with a passion, but so far I can't figure out * how else to make both sans-serif and monospace fonts look reasonable * on a wide range of browsers and platforms. */ font-size: 14px; } @media screen { /* Print margins are OK already. */ body { margin: 2em; } } h1 { font-size: x-large; margin-bottom: 0; } h2, h3 { font-size: inherit; font-weight: inherit; } pre, code { font-family: 'Consolas', monospace; } a[href] { color: inherit; text-decoration: inherit; border-bottom: thin dotted; } cite { font-style: inherit; } q { font-style: italic; } abbr { text-decoration: inherit; border: inherit; } hr { visibility: hidden; clear: both; } button { /* Make it look more like a pseudo-link. */ background: transparent; border-top: none; border-right: none; border-bottom: thin dotted; border-left: none; padding: 0; color: gray; cursor: pointer; } @media print { button { display: none; } } /**************************************************************** * Request and response data ****************************************************************/ body.report { background: whitesmoke; } div.exchange { background: white; margin-top: 3em; } @media screen { div.exchange { /* Bottom padding is smaller * because there is an invisible ``hr`` there. */ padding: 2em 2em 1.5em 2em; border: solid thin darkgray; } } div.message-display { max-width: 55em; } .exchange > section:not(:first-child) div.message-display { /* Spacing between messages within one exchange. */ margin-top: 2em; } p.message-remark { margin: 0 1em 0.5em 0; color: gray; overflow: auto; } .message-display h2 { font-weight: bolder; margin: 0; overflow: auto; padding: 0 0 0.3em 0; white-space: nowrap; } pre.header-entry { margin: 0; white-space: pre-wrap; overflow: auto; padding: 0.2em 0; line-height: 140%; /* Indent all lines after the first one, a la ``obs-fold``. */ padding-left: 2em; text-indent: -2em; } div.body-display, div.trailer { margin-top: 2em; } .body-display h3, .trailer h3 { display: inline-block; border-bottom: thin dashed; padding: 0.3em 0; margin: 0; color: darkgray; } .body-display pre { margin-top: 0.7em; margin-bottom: 0; white-space: pre-wrap; max-height: 20em; overflow: auto; } /**************************************************************** * Notices ****************************************************************/ div.complaints { padding-left: 1em; border-left: thin solid lightgray; } .exchange > section:not(:first-child) div.complaints { margin-top: 2em; } div.notice { max-width: 55em; page-break-inside: avoid; line-height: 135%; } .notice:not(.collapsed) + div.notice { /* More spacing between expanded notices. */ margin-top: 2em; } .debug .severity { color: darkgray; } .error .severity { color: red; } .notice .ident { color: darkgray; } /**************************************************************** * Float notices to the right on wider displays ****************************************************************/ @media (min-width: 55em) { div.message-display { float: left; width: 55%; } div.complaints { float: right; width: 40%; } } /**************************************************************** * Interactive notices ****************************************************************/ .notice button { float: right; margin-left: 1em; font-size: smaller; } @media screen { /* Don't collapse notices in print. */ .notice.collapsed p { display: none; } .notice.debug.collapsed h3 { color: darkgray; } } .highlight { background: navajowhite; } /**************************************************************** * Options ****************************************************************/ div.options { float: right; } @media print { .options { display: none; } } @media screen { .options.collapsed form { display: none; } } .options form { margin-top: 0.3em; padding: 0.1em 1em; background: lavender; border: solid thin darkgray; white-space: nowrap; } form input + label, form label + input { margin-left: 0.5em; } /**************************************************************** * List of all notices ****************************************************************/ @media screen { body.notices-list { max-width: 55em; margin-left: auto; margin-right: auto; } } .notices-list div.notice { margin-top: 4em !important; } .notices-list h3 { font-size: larger; font-weight: bolder; } .notices-list var { font-style: inherit; display: inline-block; background: lavender; border: solid thin gray; padding: 0 0.1em; } </style> <base target="_blank"> </head> <body class="notices-list"> <h1>HTTPolice notices</h1> <p>This is the list of all notices produced by <a href="https://github.com/vfaronov/httpolice" target="_self">HTTPolice</a> version 0.7.0. </p> <p>See also the <a href="index.html" target="_self">HTTPolice manual</a>. </p> <div class="notice error" id="1000"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1000</span> <span>Syntax error in <span data-ref-to="0"><var>place</var></span> header</span> </h3> <p><var>error</var></p> </div> <div class="notice error" id="1001"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1001</span> <span>Final <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span> must be ‘<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.1" title="RFC 7230 § 4.1">chunked</a></span>’</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1">RFC 7230 § 3.3.1</a></cite>: <q>If any transfer coding other than <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.1" title="RFC 7230 § 4.1">chunked</a></span> is applied to a request payload body, the sender MUST apply <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.1" title="RFC 7230 § 4.1">chunked</a></span> as the final transfer coding to ensure that the message is properly framed.</q></p> </div> <div class="notice error" id="1002"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1002</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span> can’t have ‘<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.1" title="RFC 7230 § 4.1">chunked</a></span>’ twice</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1">RFC 7230 § 3.3.1</a></cite>: <q>A sender MUST NOT apply <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.1" title="RFC 7230 § 4.1">chunked</a></span> more than once to a message body (i.e., chunking an already chunked message is not allowed).</q></p> </div> <div class="notice debug" id="1003"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1003</span> <span>Not decoding <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span>: <span data-ref-to="1"><var>coding</var></span></span> </h3> <p>HTTPolice does not know how to decode the <span data-ref-to="2"><var>coding</var></span> transfer coding. (This doesn’t mean that it’s wrong.)</p> </div> <div class="notice error" id="1004"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1004</span> <span>Message is incomplete according to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span></span> </h3> <p>This message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span> header indicates that the body is <span data-ref-to="3"><var>value</var></span> bytes long, but there are fewer bytes remaining on the stream <span data-ref-to="4"><var>name</var></span>.</p> </div> <div class="notice error" id="1005"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1005</span> <span>Malformed <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.1" title="RFC 7230 § 4.1">chunked</a></span></span> </h3> <p><var>error</var></p> </div> <div class="notice error" id="1006"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1006</span> <span>Malformed request heading</span> </h3> <p><var>error</var></p> </div> <div class="notice debug" id="1007"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1007</span> <span>Stop parsing request stream</span> </h3> <p>Due to previous notices, the data beginning at byte <span data-ref-to="5"><var>offset</var></span> on the request stream <span data-ref-to="6"><var>name</var></span> will not be parsed.</p> </div> <div class="notice error" id="1008"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1008</span> <span>Not enough requests</span> </h3> <p>There are unparsed bytes remaining on the response stream <span data-ref-to="7"><var>name</var></span>, but no requests that would correspond to them. HTTPolice will try to parse and analyze the remaining responses on their own.</p> </div> <div class="notice error" id="1009"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1009</span> <span>Malformed response heading</span> </h3> <p><var>error</var></p> </div> <div class="notice debug" id="1010"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1010</span> <span>Stop parsing response stream</span> </h3> <p>Due to previous notices, the data beginning at byte <span data-ref-to="8"><var>offset</var></span> on the response stream <span data-ref-to="9"><var>name</var></span> will not be parsed.</p> </div> <div class="notice debug" id="1011"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1011</span> <span>Switching protocols</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.2" title="Switching Protocols (RFC 7231 § 6.2.2)">101</a></span> status code means that the connection is switching to a different protocol. HTTPolice will not parse the rest of the streams.</p> </div> <div class="notice debug" id="1012"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1012</span> <span>Switching to a tunnel</span> </h3> <p>A <span data-ref-to="10"><var>status</var></span> response to a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.6" title="RFC 7231 § 4.3.6">CONNECT</a></span> request means that the connection is becoming a tunnel. HTTPolice will not parse the remainder of the streams.</p> </div> <div class="notice error" id="1013"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1013</span> <span>Multiple <span data-ref-to="11"><var>header</var></span> headers are forbidden</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.2.2">RFC 7230 § 3.2.2</a></cite>: <q>A sender MUST NOT generate multiple header fields with the same field name in a message unless either the entire field value for that header field is defined as a comma-separated list [i.e., #(values)] or the header field is a well-known exception (as noted below).</q></p> <span data-ref-to="12"></span> </div> <div class="notice comment" id="1014"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1014</span> <span>RWS in <span data-ref-to="13"><var>place</var></span> should be a single space</span> </h3> <p>The syntax of <span data-ref-to="14"><var>place</var></span> includes the rule named RWS. It should be produced as just a single space, but here it was <span data-ref-to="15"><var>num</var></span> characters. See <cite><a href="https://tools.ietf.org/html/rfc7230#section-3.2.3">RFC 7230 § 3.2.3</a></cite>.</p> </div> <div class="notice error" id="1015"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1015</span> <span>Bad whitespace (BWS) in <span data-ref-to="16"><var>place</var></span></span> </h3> <p>The syntax of <span data-ref-to="17"><var>place</var></span> includes the rule named BWS, which is whitespace allowed for historical reasons; it must not be produced by current implementations. See <cite><a href="https://tools.ietf.org/html/rfc7230#section-3.2.3">RFC 7230 § 3.2.3</a></cite>.</p> </div> <div class="notice error" id="1016"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1016</span> <span>Obsolete line folding in headers</span> </h3> <p>This message uses line folding (the “obs-fold” rule) to split one header field over several physical lines, but this is deprecated and prohibited in most cases. See <cite><a href="https://tools.ietf.org/html/rfc7230#section-3.2.4">RFC 7230 § 3.2.4</a></cite>.</p> </div> <div class="notice comment" id="1017"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1017</span> <span>Strange escaping in <span data-ref-to="18"><var>place</var></span></span> </h3> <p>This message uses the “quoted-pair” rule to escape the character <span data-ref-to="19"><var>char</var></span> in a context where this escaping is unnecessary and should not be used. See <cite><a href="https://tools.ietf.org/html/rfc7230#section-3.2.6">RFC 7230 § 3.2.6</a></cite>.</p> <p>If a literal backslash \ was intended here, it must itself be escaped as \\.</p> </div> <div class="notice error" id="1018"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1018</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span> is forbidden in a <span data-ref-to="20"><var>status</var></span> response</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1">RFC 7230 § 3.3.1</a></cite>: <q>A server MUST NOT send a Transfer-Encoding header field in any response with a status code of 1xx (Informational) or 204 (No Content).</q></p> </div> <div class="notice error" id="1019"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1019</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span> is forbidden in a <span data-ref-to="21"><var>status</var></span> response to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.6" title="RFC 7231 § 4.3.6">CONNECT</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1">RFC 7230 § 3.3.1</a></cite>: <q>A server MUST NOT send a Transfer-Encoding header field in any 2xx (Successful) response to a CONNECT request</q></p> </div> <div class="notice error" id="1020"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1020</span> <span>Can’t have both <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span> and <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2">RFC 7230 § 3.3.2</a></cite>: <q>A sender MUST NOT send a Content-Length header field in any message that contains a Transfer-Encoding header field.</q></p> </div> <div class="notice comment" id="1021"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1021</span> <span><span data-ref-to="22"><var>method</var></span> request should have <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2">RFC 7230 § 3.3.2</a></cite>: <q>A user agent SHOULD send a Content-Length in a request message when no <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span> is sent and the request method defines a meaning for an enclosed payload body. For example, a Content-Length header field is normally sent in a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.3" title="RFC 7231 § 4.3.3">POST</a></span> request even when the value is 0 (indicating an empty payload body).</q></p> </div> <div class="notice comment" id="1022"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1022</span> <span>Empty <span data-ref-to="23"><var>method</var></span> request shouldn’t have <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2">RFC 7230 § 3.3.2</a></cite>: <q>A user agent SHOULD NOT send a Content-Length header field when the request message does not contain a payload body and the method semantics do not anticipate such a body.</q></p> </div> <div class="notice error" id="1023"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1023</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span> is forbidden in a <span data-ref-to="24"><var>status</var></span> response</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2">RFC 7230 § 3.3.2</a></cite>: <q>A server MUST NOT send a Content-Length header field in any response with a status code of 1xx (Informational) or 204 (No Content).</q></p> </div> <div class="notice error" id="1024"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1024</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span> is forbidden in a <span data-ref-to="25"><var>status</var></span> response to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.6" title="RFC 7231 § 4.3.6">CONNECT</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2">RFC 7230 § 3.3.2</a></cite>: <q>A server MUST NOT send a Content-Length header field in any 2xx (Successful) response to a CONNECT request (Section 4.3.6 of [RFC7231]).</q></p> </div> <div class="notice comment" id="1025"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1025</span> <span>Response delimited only by closing the connection</span> </h3> <p>This response has no <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span> header and no “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.1" title="RFC 7230 § 4.1">chunked</a></span>” that would delimit its body. Therefore, the body is assumed to consist of everything the server sends until closing the connection. But then the client cannot be sure that it received the entire response (that there were no network failures).</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7230#section-3.3.3">RFC 7230 § 3.3.3</a></cite>.</p> </div> <div class="notice error" id="1026"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1026</span> <span><span data-ref-to="26"><var>entry</var></span> is forbidden in a trailer</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-4.1.2">RFC 7230 § 4.1.2</a></cite>: <q>A sender MUST NOT generate a trailer that contains a field necessary for message framing (e.g., <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span> and <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span>), routing (e.g., <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-5.4" title="RFC 7230 § 5.4">Host</a></span>), request modifiers (e.g., controls and conditionals in Section 5 of [RFC7231]), authentication (e.g., see [RFC7235] and [RFC6265]), response control data (e.g., see Section 7.1 of [RFC7231]), or determining how to process the payload (e.g., <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.2.2" title="RFC 7231 § 3.1.2.2">Content-Encoding</a></span>, <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span>, <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span>, and <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.4" title="RFC 7230 § 4.4">Trailer</a></span>).</q></p> </div> <div class="notice error" id="1027"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1027</span> <span>Could not decode <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span>: <span data-ref-to="27"><var>coding</var></span></span> </h3> <p><var>error</var></p> </div> <div class="notice error" id="1028"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1028</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.3" title="RFC 7230 § 4.3">TE</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.1" title="RFC 7230 § 4.1">chunked</a></span>” is forbidden</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-4.3">RFC 7230 § 4.3</a></cite>: <q>A client MUST NOT send the chunked transfer coding name in TE; chunked is always acceptable for HTTP/1.1 recipients.</q></p> </div> <div class="notice error" id="1029"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1029</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.3" title="RFC 7230 § 4.3">TE</a></span> header requires “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span>: TE”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-4.3">RFC 7230 § 4.3</a></cite>: <q>Since the TE header field only applies to the immediate connection, a sender of TE MUST also send a &quot;TE&quot; connection option within the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span> header field (Section 6.1) in order to prevent the TE field from being forwarded by intermediaries that do not support its semantics.</q></p> </div> <div class="notice comment" id="1030"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1030</span> <span><span data-ref-to="28"><var>header</var></span> was not announced in the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.4" title="RFC 7230 § 4.4">Trailer</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-4.4">RFC 7230 § 4.4</a></cite>: <q>When a message includes a message body encoded with the chunked transfer coding and the sender desires to send metadata in the form of trailer fields at the end of the message, the sender SHOULD generate a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.4" title="RFC 7230 § 4.4">Trailer</a></span> header field before the message body to indicate which fields will be present in the trailers.</q></p> </div> <div class="notice error" id="1031"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1031</span> <span>Missing <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-5.4" title="RFC 7230 § 5.4">Host</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-5.4">RFC 7230 § 5.4</a></cite>: <q>A client MUST send a Host header field in all HTTP/1.1 request messages.</q></p> </div> <div class="notice comment" id="1032"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1032</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-5.4" title="RFC 7230 § 5.4">Host</a></span> should be the first header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-5.4">RFC 7230 § 5.4</a></cite>: <q>Since the Host field-value is critical information for handling a request, a user agent SHOULD generate Host as the first header field following the request-line.</q></p> </div> <div class="notice error" id="1033"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1033</span> <span>Request with a bad <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-5.4" title="RFC 7230 § 5.4">Host</a></span> header must be rejected</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-5.4">RFC 7230 § 5.4</a></cite>: <q>A server MUST respond with a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.1" title="Bad Request (RFC 7231 § 6.5.1)">400</a></span> (Bad Request) status code to any HTTP/1.1 request message that lacks a Host header field and to any request message that contains more than one Host header field or a Host header field with an invalid field-value.</q></p> <span data-ref-to="29"></span> <span data-ref-to="29"></span> <span data-ref-to="30"></span> </div> <div class="notice error" id="1034"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1034</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span>: <span data-ref-to="31"><var>header</var></span>” is forbidden</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-5.4">RFC 7230 § 5.4</a></cite>: <q>A sender MUST NOT send a connection option corresponding to a header field that is intended for all recipients of the payload. For example, <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> is never appropriate as a connection option (Section 5.2 of [RFC7234]).</q></p> </div> <div class="notice comment" id="1035"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1035</span> <span>Deprecated media type <span data-ref-to="32"><var>value</var></span></span> </h3> <p>According to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span>, this message’s body is of type <span data-ref-to="33"><var>value</var></span>, which is listed as “deprecated” or “obsoleted” in the <cite><a href="https://www.iana.org/assignments/media-types/media-types.xml">IANA media types registry</a></cite>.</p> </div> <div class="notice debug" id="1036"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1036</span> <span>Not decoding <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.2.2" title="RFC 7231 § 3.1.2.2">Content-Encoding</a></span>: <span data-ref-to="34"><var>coding</var></span></span> </h3> <p>HTTPolice does not know how to decode the <span data-ref-to="35"><var>coding</var></span> content coding. (This doesn’t mean that it’s wrong.)</p> </div> <div class="notice error" id="1037"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1037</span> <span>Could not decode <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.2.2" title="RFC 7231 § 3.1.2.2">Content-Encoding</a></span>: <span data-ref-to="36"><var>coding</var></span></span> </h3> <p><var>error</var></p> </div> <div class="notice error" id="1038"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1038</span> <span>Bad JSON body</span> </h3> <p>According to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span>, this message’s body is JSON, but HTTPolice tried to parse it as JSON and got the following error:</p> <p><var>error</var></p> <span data-ref-to="37"></span> </div> <div class="notice error" id="1039"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1039</span> <span>Bad XML body</span> </h3> <p>According to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span>, this message’s body is XML, but HTTPolice tried to parse it as XML and got the following error:</p> <p><var>error</var></p> <span data-ref-to="38"></span> </div> <div class="notice error" id="1040"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1040</span> <span>Bad URL-encoded body</span> </h3> <p>According to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span>, this message’s body is URL-encoded. But it doesn’t look like a proper URL-encoded string, as defined by <cite><a href="https://www.w3.org/TR/html5/forms.html#url-encoded-form-data">HTML5</a></cite>, because it contains the character: <span data-ref-to="39"><var>char</var></span>.</p> <p>This often means that the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span> header is wrong.</p> <span data-ref-to="40"></span> </div> <div class="notice comment" id="1041"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1041</span> <span>Body should have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5">RFC 7231 § 3.1.1.5</a></cite>: <q>A sender that generates a message containing a payload body SHOULD generate a Content-Type header field in that message unless the intended media type of the enclosed representation is unknown to the sender.</q></p> <span data-ref-to="41"></span> </div> <div class="notice comment" id="1042"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1042</span> <span>Duplicate ‘<span data-ref-to="42"><var>param</var></span>’ parameter in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6838#section-4.3">RFC 6838 § 4.3</a></cite>: <q>It is an error for a specific parameter to be specified more than once.</q></p> </div> <div class="notice error" id="1045"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1045</span> <span>Syntax error in request target</span> </h3> <p><var>error</var></p> <p>See also <cite><a href="https://tools.ietf.org/html/rfc7230#section-5.3">RFC 7230 § 5.3</a></cite>.</p> <span data-ref-to="43"></span> </div> <div class="notice error" id="1046"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1046</span> <span>Proxied response needs a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-5.7.1" title="RFC 7230 § 5.7.1">Via</a></span> header</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7230#section-5.7.1">RFC 7230 § 5.7.1</a></cite>, a proxy must add a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-5.7.1" title="RFC 7230 § 5.7.1">Via</a></span> header to each response that it forwards.</p> </div> <div class="notice comment" id="1047"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1047</span> <span>Close-delimited response should have “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span>: close”</span> </h3> <p>When a response is delimited only by closing the connection, it should have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span> header with a ‘close’ option. See <cite><a href="https://tools.ietf.org/html/rfc7230#section-6.3">RFC 7230 § 6.3</a></cite> and <cite><a href="https://tools.ietf.org/html/rfc7230#section-6.6">RFC 7230 § 6.6</a></cite>.</p> </div> <div class="notice error" id="1048"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1048</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.2" title="Switching Protocols (RFC 7231 § 6.2.2)">101</a></span> response needs an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-6.7">RFC 7230 § 6.7</a></cite>: <q>A server that sends a 101 (Switching Protocols) response MUST send an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header field to indicate the new protocol(s) to which the connection is being switched</q></p> </div> <div class="notice error" id="1049"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1049</span> <span>Switching to a protocol that was not requested</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-6.7">RFC 7230 § 6.7</a></cite>: <q>A server MUST NOT switch to a protocol that was not indicated by the client in the corresponding request's <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header field.</q></p> <span data-ref-to="44"></span> <span data-ref-to="44"></span> <span data-ref-to="45"></span> </div> <div class="notice error" id="1050"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1050</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header requires “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span>: upgrade”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-6.7">RFC 7230 § 6.7</a></cite>: <q>When <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> is sent, the sender MUST also send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span> header field (Section 6.1) that contains an &quot;upgrade&quot; connection option, in order to prevent Upgrade from being accidentally forwarded by intermediaries that might not implement the listed protocols.</q></p> </div> <div class="notice error" id="1051"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1051</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.2" title="Switching Protocols (RFC 7231 § 6.2.2)">101</a></span> response to an HTTP/1.0 request is forbidden</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-6.7">RFC 7230 § 6.7</a></cite>: <q>A server MUST ignore an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header field that is received in an HTTP/1.0 request.</q></p> <span data-ref-to="46"></span> </div> <div class="notice error" id="1052"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1052</span> <span><span data-ref-to="47"><var>header</var></span> makes no sense in a <span data-ref-to="48"><var>status</var></span> response</span> </h3> <p>The <span data-ref-to="49"><var>header</var></span> header provides representation metadata, but there can be no representation associated with a <span data-ref-to="50"><var>status</var></span> response. The header should probably be removed.</p> </div> <div class="notice comment" id="1053"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1053</span> <span><span data-ref-to="51"><var>header</var></span> makes no sense in an empty request</span> </h3> <p>The <span data-ref-to="52"><var>header</var></span> header provides representation metadata. It would make sense in a request with a body, but this one has no body.</p> <p>See also <cite><a href="https://tools.ietf.org/html/rfc7231#section-3.1">RFC 7231 § 3.1</a></cite>.</p> </div> <div class="notice error" id="1054"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1054</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.4" title="RFC 7230 § 4.4">Trailer</a></span> header makes no sense without a chunked body</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.4" title="RFC 7230 § 4.4">Trailer</a></span> header announces what other headers will be sent in the trailer part of a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.1" title="RFC 7230 § 4.1">chunked</a></span> message. It doesn’t make sense here because this message does not use the chunked transfer coding.</p> <p>See also <cite><a href="https://tools.ietf.org/html/rfc7230#section-4.1.2">RFC 7230 § 4.1.2</a></cite>.</p> <span data-ref-to="53"></span> </div> <div class="notice comment" id="1055"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1055</span> <span>Unnecessary <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.4.2" title="RFC 7231 § 3.1.4.2">Content-Location</a></span></span> </h3> <p>This is a <span data-ref-to="54"><var>status</var></span> response to a <span data-ref-to="55"><var>method</var></span> request. By definition, its body is a representation of the requested resource. But it also has a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.4.2" title="RFC 7231 § 3.1.4.2">Content-Location</a></span> header that points to the same URI as the request URI. In this case, the header provides no additional information.</p> <p>See also <cite><a href="https://tools.ietf.org/html/rfc7231#section-3.1.4.1">RFC 7231 § 3.1.4.1</a></cite>.</p> </div> <div class="notice comment" id="1056"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1056</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1" title="RFC 7231 § 4.3.1">GET</a></span> request with a body may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1">RFC 7231 § 4.3.1</a></cite>: <q>A payload within a GET request message has no defined semantics; sending a payload body on a GET request might cause some existing implementations to reject the request.</q></p> <span data-ref-to="56"></span> </div> <div class="notice comment" id="1057"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1057</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span> request with a body may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2">RFC 7231 § 4.3.2</a></cite>: <q>A payload within a HEAD request message has no defined semantics; sending a payload body on a HEAD request might cause some existing implementations to reject the request.</q></p> </div> <div class="notice error" id="1058"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1058</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.4" title="RFC 7231 § 4.3.4">PUT</a></span> request with <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> must be rejected</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-4.3.4">RFC 7231 § 4.3.4</a></cite>: <q>An origin server that allows PUT on a given target resource MUST send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.1" title="Bad Request (RFC 7231 § 6.5.1)">400</a></span> (Bad Request) response to a PUT request that contains a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> header field (Section 4.2 of [RFC7233]), since the payload is likely to be partial content that has been mistakenly PUT as a full representation.</q></p> <span data-ref-to="57"></span> <span data-ref-to="58"></span> </div> <div class="notice comment" id="1059"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1059</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.5" title="RFC 7231 § 4.3.5">DELETE</a></span> request with a body may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-4.3.5">RFC 7231 § 4.3.5</a></cite>: <q>A payload within a DELETE request message has no defined semantics; sending a payload body on a DELETE request might cause some existing implementations to reject the request.</q></p> <span data-ref-to="59"></span> </div> <div class="notice error" id="1060"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1060</span> <span>Strange <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.4.2" title="RFC 7231 § 3.1.4.2">Content-Location</a></span> in response to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.5" title="RFC 7231 § 4.3.5">DELETE</a></span></span> </h3> <p>This is an ostensibly successful (<span data-ref-to="60"><var>status</var></span>) response to a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.5" title="RFC 7231 § 4.3.5">DELETE</a></span> request. However, according to its <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.4.2" title="RFC 7231 § 3.1.4.2">Content-Location</a></span> header, it carries a representation of the target resource—the one that should have been deleted. Either the Content-Location is wrong, or the request did not actually succeed.</p> </div> <div class="notice comment" id="1061"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1061</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.6" title="RFC 7231 § 4.3.6">CONNECT</a></span> request with a body may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-4.3.6">RFC 7231 § 4.3.6</a></cite>: <q>A payload within a CONNECT request message has no defined semantics; sending a payload body on a CONNECT request might cause some existing implementations to reject the request.</q></p> <span data-ref-to="61"></span> </div> <div class="notice error" id="1062"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1062</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.7" title="RFC 7231 § 4.3.7">OPTIONS</a></span> request with a body needs <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-4.3.7">RFC 7231 § 4.3.7</a></cite>: <q>A client that generates an OPTIONS request containing a payload body MUST send a valid <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span> header field describing the representation media type.</q></p> </div> <div class="notice error" id="1063"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1063</span> <span><span data-ref-to="62"><var>header</var></span> header is for responses</span> </h3> <p>This request has the <span data-ref-to="63"><var>header</var></span> header, which is only defined for responses.</p> </div> <div class="notice error" id="1064"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1064</span> <span><span data-ref-to="64"><var>header</var></span> header is for requests</span> </h3> <p>This response has the <span data-ref-to="65"><var>header</var></span> header, which is only defined for requests.</p> </div> <div class="notice error" id="1066"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1066</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.1.1" title="RFC 7231 § 5.1.1">Expect</a></span>: 100-continue” is forbidden on empty requests</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-5.1.1">RFC 7231 § 5.1.1</a></cite>: <q>A client MUST NOT generate a 100-continue expectation in a request that does not include a message body.</q></p> </div> <div class="notice comment" id="1067"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1067</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.1.2" title="RFC 7231 § 5.1.2">Max-Forwards</a></span> header is undefined for <span data-ref-to="66"><var>method</var></span> requests</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.1.2" title="RFC 7231 § 5.1.2">Max-Forwards</a></span> header is only defined for <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.7" title="RFC 7231 § 4.3.7">OPTIONS</a></span> and <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.8" title="RFC 7231 § 4.3.8">TRACE</a></span> requests. <cite><a href="https://tools.ietf.org/html/rfc7231#section-5.1.2">RFC 7231 § 5.1.2</a></cite>: <q>A recipient MAY ignore a Max-Forwards header field received with any other request methods.</q></p> </div> <div class="notice error" id="1068"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1068</span> <span>Unsecured request must not have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.5.2" title="RFC 7231 § 5.5.2">Referer</a></span> with ‘https:’</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-5.5.2">RFC 7231 § 5.5.2</a></cite>: <q>A user agent MUST NOT send a Referer header field in an unsecured HTTP request if the referring page was received with a secure protocol.</q></p> </div> <div class="notice comment" id="1070"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1070</span> <span>Missing <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.5.3" title="RFC 7231 § 5.5.3">User-Agent</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-5.5.3">RFC 7231 § 5.5.3</a></cite>: <q>A user agent SHOULD send a User-Agent field in each request unless specifically configured not to do so.</q></p> </div> <div class="notice error" id="1071"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1071</span> <span><span data-ref-to="67"><var>status</var></span> response to an HTTP/1.0 request is forbidden</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.2">RFC 7231 § 6.2</a></cite>: <q>Since HTTP/1.0 did not define any 1xx status codes, a server MUST NOT send a 1xx response to an HTTP/1.0 client.</q></p> <span data-ref-to="68"></span> </div> <div class="notice error" id="1072"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1072</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.2" title="Created (RFC 7231 § 6.3.2)">201</a></span> response to <span data-ref-to="69"><var>method</var></span> makes no sense</span> </h3> <p>The <span data-ref-to="70"><var>method</var></span> method is defined as safe (read-only). But the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.2" title="Created (RFC 7231 § 6.3.2)">201</a></span> status code means that a new resource was created.</p> </div> <div class="notice comment" id="1073"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1073</span> <span>Possibly missing <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header</span> </h3> <p>This <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.2" title="Created (RFC 7231 § 6.3.2)">201</a></span> response indicates that a new resource was created. Because there is no <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header in the response, it is assumed that the created resource is the same as the request target (<cite><a href="https://tools.ietf.org/html/rfc7231#section-6.3.2">RFC 7231 § 6.3.2</a></cite>). But <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.3" title="RFC 7231 § 4.3.3">POST</a></span> requests are usually intended to create a sub-resource of the target. It’s likely that this response needs an explicit <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span>.</p> </div> <div class="notice error" id="1074"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1074</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.3" title="Accepted (RFC 7231 § 6.3.3)">202</a></span> response to <span data-ref-to="71"><var>method</var></span> makes no sense</span> </h3> <p>The <span data-ref-to="72"><var>method</var></span> method is defined as safe (read-only). But the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.3" title="Accepted (RFC 7231 § 6.3.3)">202</a></span> status code means that the server started some kind of processing operation.</p> </div> <div class="notice error" id="1076"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1076</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.6" title="Reset Content (RFC 7231 § 6.3.6)">205</a></span> response must not have a body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.3.6">RFC 7231 § 6.3.6</a></cite>: <q>Since the 205 status code implies that no additional content will be provided, a server MUST NOT generate a payload in a 205 response.</q></p> <span data-ref-to="73"></span> </div> <div class="notice comment" id="1077"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1077</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.4.1" title="Multiple Choices (RFC 7231 § 6.4.1)">300</a></span> response should have a body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.4.1">RFC 7231 § 6.4.1</a></cite>: <q>For request methods other than <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span>, the server SHOULD generate a payload in the 300 response containing a list of representation metadata and URI reference(s) from which the user or user agent can choose the one most preferred.</q></p> </div> <div class="notice comment" id="1078"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1078</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.4.2" title="Moved Permanently (RFC 7231 § 6.4.2)">301</a></span> response should have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.4.2">RFC 7231 § 6.4.2</a></cite>: <q>The server SHOULD generate a Location header field in the response containing a preferred URI reference for the new permanent URI.</q></p> </div> <div class="notice comment" id="1079"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1079</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.4.3" title="Found (RFC 7231 § 6.4.3)">302</a></span> response should have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.4.3">RFC 7231 § 6.4.3</a></cite>: <q>The server SHOULD generate a Location header field in the response containing a URI reference for the different URI.</q></p> </div> <div class="notice error" id="1080"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1080</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.4.4" title="See Other (RFC 7231 § 6.4.4)">303</a></span> response needs a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.4.4">RFC 7231 § 6.4.4</a></cite>: <q>The 303 (See Other) status code indicates that the server is redirecting the user agent to a different resource, as indicated by a URI in the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header field, which is intended to provide an indirect response to the original request.</q></p> </div> <div class="notice comment" id="1081"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1081</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.4.4" title="See Other (RFC 7231 § 6.4.4)">303</a></span> response should have a body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.4.4">RFC 7231 § 6.4.4</a></cite>: <q>Except for responses to a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span> request, the representation of a 303 response ought to contain a short hypertext note with a hyperlink to the same URI reference provided in the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header field.</q></p> </div> <div class="notice error" id="1082"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1082</span> <span>Status code <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.4.5" title="Use Proxy (RFC 7231 § 6.4.5)">305</a></span> is deprecated</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.4.5">RFC 7231 § 6.4.5</a></cite>: <q>The 305 (Use Proxy) status code was defined in a previous version of this specification and is now deprecated (Appendix B).</q></p> </div> <div class="notice error" id="1083"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1083</span> <span>Status code <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.4.6" title="(Unused) (RFC 7231 § 6.4.6)">306</a></span> is reserved</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.4.6">RFC 7231 § 6.4.6</a></cite>: <q>The 306 status code was defined in a previous version of this specification, is no longer used, and the code is reserved.</q></p> </div> <div class="notice comment" id="1084"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1084</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.4.7" title="Temporary Redirect (RFC 7231 § 6.4.7)">307</a></span> response should have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.4.7">RFC 7231 § 6.4.7</a></cite>: <q>The server SHOULD generate a Location header field in the response containing a URI reference for the different URI.</q></p> </div> <div class="notice error" id="1085"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1085</span> <span>Redirection to the same URI</span> </h3> <p>This <span data-ref-to="74"><var>status</var></span> response includes a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header that points to the same URI as the request URI. So the resource redirects to itself.</p> <span data-ref-to="75"></span> </div> <div class="notice error" id="1086"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1086</span> <span><span data-ref-to="76"><var>status</var></span> response to server-wide <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.7" title="RFC 7231 § 4.3.7">OPTIONS</a></span> makes no sense</span> </h3> <p>The <span data-ref-to="77"><var>status</var></span> status code means that the target resource can be found at a different URI. But this was an “ <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.7" title="RFC 7231 § 4.3.7">OPTIONS</a></span> * ” request—it targets the entire server, not any particular resource. So the <span data-ref-to="78"><var>status</var></span> status code makes no sense here.</p> <p>Perhaps the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.4.4" title="See Other (RFC 7231 § 6.4.4)">303</a></span> status code would fit better.</p> <span data-ref-to="79"></span> </div> <div class="notice comment" id="1087"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1087</span> <span><span data-ref-to="80"><var>status</var></span> response should include an explanation</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5">RFC 7231 § 6.5</a></cite>: <q>Except when responding to a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span> request, the server SHOULD send a representation containing an explanation of the error situation, and whether it is a temporary or permanent condition.</q></p> </div> <div class="notice error" id="1088"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1088</span> <span>Status code <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.2" title="Payment Required (RFC 7231 § 6.5.2)">402</a></span> is reserved</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5.2">RFC 7231 § 6.5.2</a></cite>: <q>The 402 (Payment Required) status code is reserved for future use.</q></p> </div> <div class="notice error" id="1089"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1089</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.5" title="Method Not Allowed (RFC 7231 § 6.5.5)">405</a></span> response needs an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5.5">RFC 7231 § 6.5.5</a></cite>: <q>The origin server MUST generate an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span> header field in a 405 response containing a list of the target resource's currently supported methods.</q></p> </div> <div class="notice error" id="1090"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1090</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.6" title="Not Acceptable (RFC 7231 § 6.5.6)">406</a></span> response, but request wasn’t negotiating</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.6" title="Not Acceptable (RFC 7231 § 6.5.6)">406</a></span> status code means that the server cannot satisfy the request’s content negotiation headers, such as <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.3.2" title="RFC 7231 § 5.3.2">Accept</a></span>. But this request doesn’t seem to have such headers.</p> <p>See also <cite><a href="https://tools.ietf.org/html/rfc7231#section-5.3">RFC 7231 § 5.3</a></cite>.</p> </div> <div class="notice comment" id="1092"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1092</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.6" title="Not Acceptable (RFC 7231 § 6.5.6)">406</a></span> response should have a body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5.6">RFC 7231 § 6.5.6</a></cite>: <q>The server SHOULD generate a payload containing a list of available representation characteristics and corresponding resource identifiers from which the user or user agent can choose the one most appropriate.</q></p> </div> <div class="notice comment" id="1093"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1093</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.5.3" title="RFC 7231 § 5.5.3">User-Agent</a></span> contains no actual product</span> </h3> <p>This request’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.5.3" title="RFC 7231 § 5.5.3">User-Agent</a></span> header contains only the name of the underlying library, which isn’t very useful for identifying the request. It may be a good idea to include the name of the actual product.</p> <p>For example: “My-Product/1.0 <span data-ref-to="81"><var>library</var></span>”.</p> <p>Or simply “My-Product/1.0” or “My-Product”.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7231#section-5.5.3">RFC 7231 § 5.5.3</a></cite>.</p> </div> <div class="notice comment" id="1094"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1094</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.7" title="Request Timeout (RFC 7231 § 6.5.7)">408</a></span> response should have “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span>: close”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5.7">RFC 7231 § 6.5.7</a></cite>: <q>A server SHOULD send the &quot;close&quot; connection option (Section 6.1 of [RFC7230]) in the response, since 408 implies that the server has decided to close the connection rather than continue waiting.</q></p> </div> <div class="notice error" id="1095"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1095</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.8" title="Conflict (RFC 7231 § 6.5.8)">409</a></span> response to <span data-ref-to="82"><var>method</var></span> makes no sense</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.8" title="Conflict (RFC 7231 § 6.5.8)">409</a></span> status code means that the request conflicted with the current state of the resource. But a <span data-ref-to="83"><var>method</var></span> request is, by definition, safe (read-only): it must not affect the state, so there can be no conflict.</p> </div> <div class="notice comment" id="1096"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1096</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.8" title="Conflict (RFC 7231 § 6.5.8)">409</a></span> response should include an explanation</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5.8">RFC 7231 § 6.5.8</a></cite>: <q>The server SHOULD generate a payload that includes enough information for a user to recognize the source of the conflict.</q></p> </div> <div class="notice error" id="1097"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1097</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.10" title="Length Required (RFC 7231 § 6.5.10)">411</a></span> response, but request did have <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span></span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.10" title="Length Required (RFC 7231 § 6.5.10)">411</a></span> status code means that the server wants to see a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.2" title="RFC 7230 § 3.3.2">Content-Length</a></span> header in the request. But this request did, in fact, include a valid Content-Length of <span data-ref-to="84"><var>value</var></span>.</p> <span data-ref-to="85"></span> </div> <div class="notice error" id="1098"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1098</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.11" title="Payload Too Large (RFC 7231 § 6.5.11)">413</a></span> response, but request had no body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5.11">RFC 7231 § 6.5.11</a></cite>: <q>The 413 (Payload Too Large) status code indicates that the server is refusing to process a request because the request payload is larger than the server is willing or able to process.</q></p> </div> <div class="notice error" id="1099"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1099</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.13" title="Unsupported Media Type (RFC 7231 § 6.5.13)">415</a></span> response, but request had no body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5.13">RFC 7231 § 6.5.13</a></cite>: <q>The 415 (Unsupported Media Type) status code indicates that the origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.</q></p> </div> <div class="notice error" id="1100"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1100</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.14" title="Expectation Failed (RFC 7231 § 6.5.14)">417</a></span> response, but request had no <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.1.1" title="RFC 7231 § 5.1.1">Expect</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5.14">RFC 7231 § 6.5.14</a></cite>: <q>The 417 (Expectation Failed) status code indicates that the expectation given in the request's <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.1.1" title="RFC 7231 § 5.1.1">Expect</a></span> header field (Section 5.1.1) could not be met by at least one of the inbound servers.</q></p> </div> <div class="notice error" id="1101"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1101</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.15" title="Upgrade Required (RFC 7231 § 6.5.15)">426</a></span> response needs an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.5.15">RFC 7231 § 6.5.15</a></cite>: <q>The server MUST send an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header field in a 426 response to indicate the required protocol(s)</q></p> </div> <div class="notice error" id="1102"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1102</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.15" title="Upgrade Required (RFC 7231 § 6.5.15)">426</a></span> response, but client is ready to upgrade</span> </h3> <p>In this response, the server demands that the client upgrade to <span data-ref-to="86"><var>protocol</var></span>. But the client’s request is already offering that same upgrade in its own <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header. The server can just send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.2" title="Switching Protocols (RFC 7231 § 6.2.2)">101</a></span> response and switch to <span data-ref-to="87"><var>protocol</var></span>.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7230#section-6.7">RFC 7230 § 6.7</a></cite>.</p> <span data-ref-to="88"></span> <span data-ref-to="89"></span> </div> <div class="notice error" id="1103"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1103</span> <span>Not proceeding with protocol upgrade</span> </h3> <p>This response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header indicates that the server is ready to upgrade to <span data-ref-to="90"><var>protocol</var></span>. But the client’s request is already offering that same upgrade in its own <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header. If the server actually wants to switch to <span data-ref-to="91"><var>protocol</var></span>, it should go ahead, send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.2" title="Switching Protocols (RFC 7231 § 6.2.2)">101</a></span> response, and switch.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7230#section-6.7">RFC 7230 § 6.7</a></cite>.</p> <span data-ref-to="92"></span> </div> <div class="notice comment" id="1104"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1104</span> <span><span data-ref-to="93"><var>status</var></span> response should include an explanation</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.6">RFC 7231 § 6.6</a></cite>: <q>Except when responding to a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span> request, the server SHOULD send a representation containing an explanation of the error situation, and whether it is a temporary or permanent condition.</q></p> </div> <div class="notice error" id="1105"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1105</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.6.6" title="HTTP Version Not Supported (RFC 7231 § 6.6.6)">505</a></span> response, but request had the same HTTP version</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.6.6" title="HTTP Version Not Supported (RFC 7231 § 6.6.6)">505</a></span> status code means that the server does not support the HTTP version used in the request—which is <span data-ref-to="94"><var>version</var></span>—but the response itself is <span data-ref-to="95"><var>version</var></span>, too.</p> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-2.6">RFC 7230 § 2.6</a></cite>: <q>A server MUST NOT send a version to which it is not conformant.</q></p> </div> <div class="notice comment" id="1106"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1106</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.6.6" title="HTTP Version Not Supported (RFC 7231 § 6.6.6)">505</a></span> response should have a body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.6.6">RFC 7231 § 6.6.6</a></cite>: <q>The server SHOULD generate a representation for the 505 response that describes why that version is not supported and what other protocols are supported by that server.</q></p> </div> <div class="notice error" id="1107"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1107</span> <span>Obsolete date-time format in <span data-ref-to="96"><var>place</var></span></span> </h3> <p>This message’s <span data-ref-to="97"><var>place</var></span> uses an obsolete date-time format. See <cite><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.1">RFC 7231 § 7.1.1.1</a></cite>.</p> </div> <div class="notice error" id="1108"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1108</span> <span>Wrong day of week in <span data-ref-to="98"><var>place</var></span></span> </h3> <p>This message’s <span data-ref-to="99"><var>place</var></span> claims that <span data-ref-to="100"><var>date</var></span> is <span data-ref-to="101"><var>claimed</var></span>, but in reality it’s <span data-ref-to="102"><var>actual</var></span>.</p> </div> <div class="notice error" id="1109"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1109</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> header is in the future</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> header contains the date and time at which the message was originated. But here it seems to be in the future.</p> <p>This might be due to wrong timezone settings.</p> </div> <div class="notice comment" id="1110"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1110</span> <span>Missing <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> header</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2">RFC 7231 § 7.1.1.2</a></cite>, every <span data-ref-to="103"><var>status</var></span> response must have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> header, unless the server has no usable clock.</p> </div> <div class="notice error" id="1111"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1111</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.2" title="Created (RFC 7231 § 6.3.2)">201</a></span> response can’t have <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> with a fragment (#)</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2">RFC 7231 § 7.1.2</a></cite>: <q>There are circumstances in which a fragment identifier in a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> value would not be appropriate. For example, the Location header field in a 201 (Created) response is supposed to provide a URI that is specific to the created resource.</q></p> </div> <div class="notice comment" id="1112"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1112</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header is undefined for <span data-ref-to="104"><var>status</var></span> responses</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2">RFC 7231 § 7.1.2</a></cite> does not define what it means for a <span data-ref-to="105"><var>status</var></span> response to have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header.</p> </div> <div class="notice comment" id="1113"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1113</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.3" title="RFC 7231 § 7.1.3">Retry-After</a></span> is undefined for <span data-ref-to="106"><var>status</var></span> responses</span> </h3> <p>As far as HTTPolice knows, the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.3" title="RFC 7231 § 7.1.3">Retry-After</a></span> header is defined for status codes 3xx, <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.11" title="Payload Too Large (RFC 7231 § 6.5.11)">413</a></span>, <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6585#section-4" title="Too Many Requests (RFC 6585 § 4)">429</a></span>, and <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.6.4" title="Service Unavailable (RFC 7231 § 6.6.4)">503</a></span>, but not for <span data-ref-to="107"><var>status</var></span>.</p> </div> <div class="notice error" id="1114"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1114</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.5" title="Method Not Allowed (RFC 7231 § 6.5.5)">405</a></span> response, but <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span> includes <span data-ref-to="108"><var>method</var></span></span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.5" title="Method Not Allowed (RFC 7231 § 6.5.5)">405</a></span> status code means that the request method (<span data-ref-to="109"><var>method</var></span>) is not allowed for this resource. But the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span> header does include <span data-ref-to="110"><var>method</var></span>.</p> </div> <div class="notice error" id="1115"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1115</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span> does not include <span data-ref-to="111"><var>method</var></span></span> </h3> <p>The <span data-ref-to="112"><var>status</var></span> status code means that this <span data-ref-to="113"><var>method</var></span> request was handled successfully. But the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span> header does not include <span data-ref-to="114"><var>method</var></span>, so it should have been disallowed (status code <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.5" title="Method Not Allowed (RFC 7231 § 6.5.5)">405</a></span>).</p> </div> <div class="notice error" id="1116"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1116</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.3.4" title="RFC 7231 § 5.3.4">Accept-Encoding</a></span>: <span data-ref-to="115"><var>coding</var></span> must not have a quality value</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-5.3.4">RFC 7231 § 5.3.4</a></cite>: <q>Most HTTP/1.0 applications do not recognize or obey qvalues associated with content-codings. This means that qvalues might not work and are not permitted with <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.2.3" title="RFC 7230 § 4.2.3">x-gzip</a></span> or <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.2.1" title="RFC 7230 § 4.2.1">x-compress</a></span>.</q></p> </div> <div class="notice comment" id="1117"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1117</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.3.5" title="RFC 7231 § 5.3.5">Accept-Language</a></span> shouldn’t trigger a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.6" title="Not Acceptable (RFC 7231 § 6.5.6)">406</a></span> response</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.6" title="Not Acceptable (RFC 7231 § 6.5.6)">406</a></span> status code means that the server cannot satisfy the request’s content negotiation headers. The only such header (known to HTTPolice) in this request is <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.3.5" title="RFC 7231 § 5.3.5">Accept-Language</a></span>. However, <cite><a href="https://tools.ietf.org/html/rfc7231#section-5.3.5">RFC 7231 § 5.3.5</a></cite> discourages sending a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.6" title="Not Acceptable (RFC 7231 § 6.5.6)">406</a></span> response in this case: it’s better to send a representation in a different language, because the user may still be able to understand some of it.</p> <span data-ref-to="116"></span> </div> <div class="notice error" id="1118"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1118</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-2.2" title="RFC 7232 § 2.2">Last-Modified</a></span> can’t be later than <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7232#section-2.2.1">RFC 7232 § 2.2.1</a></cite>: <q>An origin server with a clock MUST NOT send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-2.2" title="RFC 7232 § 2.2">Last-Modified</a></span> date that is later than the server's time of message origination (<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span>).</q></p> </div> <div class="notice comment" id="1119"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1119</span> <span>Backslash in <span data-ref-to="117"><var>place</var></span> may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7232#section-2.3">RFC 7232 § 2.3</a></cite>: <q>Previously, opaque-tag was defined to be a quoted-string ([RFC2616], Section 3.11); thus, some recipients might perform backslash unescaping. Servers therefore ought to avoid backslash characters in entity tags.</q></p> </div> <div class="notice error" id="1120"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1120</span> <span>Weak entity tag in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.1" title="RFC 7232 § 3.1">If-Match</a></span> is not supposed to work</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7232#section-3.1">RFC 7232 § 3.1</a></cite>: <q>An origin server MUST use the strong comparison function when comparing entity-tags for <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.1" title="RFC 7232 § 3.1">If-Match</a></span> (Section 2.3.2), since the client intends this precondition to prevent the method from being applied if there have been any changes to the representation data.</q></p> <p>In other words, a conformant server will never consider two weak entity tags as equal for purposes of the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.1" title="RFC 7232 § 3.1">If-Match</a></span> header.</p> </div> <div class="notice error" id="1121"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1121</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.2" title="RFC 7232 § 3.2">If-None-Match</a></span> was ignored</span> </h3> <p>This is a <span data-ref-to="118"><var>status</var></span> response to a <span data-ref-to="119"><var>method</var></span> request, but its <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-2.3" title="RFC 7232 § 2.3">ETag</a></span> header matches the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.2" title="RFC 7232 § 3.2">If-None-Match</a></span> header of the request. The server is supposed to send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.1" title="Not Modified (RFC 7232 § 4.1)">304</a></span> response in this situation.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7232#section-3.2">RFC 7232 § 3.2</a></cite>.</p> <span data-ref-to="120"></span> </div> <div class="notice error" id="1122"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1122</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.3" title="RFC 7232 § 3.3">If-Modified-Since</a></span> in <span data-ref-to="121"><var>method</var></span> requests is not supposed to work</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7232#section-3.3">RFC 7232 § 3.3</a></cite>, an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.3" title="RFC 7232 § 3.3">If-Modified-Since</a></span> header must be ignored in requests that are neither <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1" title="RFC 7231 § 4.3.1">GET</a></span> nor <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span>.</p> </div> <div class="notice comment" id="1123"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1123</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.3" title="RFC 7232 § 3.3">If-Modified-Since</a></span> was ignored</span> </h3> <p>This is a <span data-ref-to="122"><var>status</var></span> response to a <span data-ref-to="123"><var>method</var></span> request, but its <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-2.2" title="RFC 7232 § 2.2">Last-Modified</a></span> date is no later than the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.3" title="RFC 7232 § 3.3">If-Modified-Since</a></span> header of the request. The server should send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.1" title="Not Modified (RFC 7232 § 4.1)">304</a></span> response in this situation.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7232#section-3.3">RFC 7232 § 3.3</a></cite>.</p> <span data-ref-to="124"></span> </div> <div class="notice error" id="1124"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1124</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.1" title="Not Modified (RFC 7232 § 4.1)">304</a></span> response is undefined for <span data-ref-to="125"><var>method</var></span> requests</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.1" title="Not Modified (RFC 7232 § 4.1)">304</a></span> status code is only defined by <cite><a href="https://tools.ietf.org/html/rfc7232#section-4.1">RFC 7232 § 4.1</a></cite> for responses to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1" title="RFC 7231 § 4.3.1">GET</a></span> and <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span>. With other methods, the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.2" title="Precondition Failed (RFC 7232 § 4.2)">412</a></span> status code may be useful.</p> </div> <div class="notice error" id="1125"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1125</span> <span><span data-ref-to="126"><var>status</var></span> response, but request has no preconditions</span> </h3> <p>The <span data-ref-to="127"><var>status</var></span> status code is only used when the request includes a precondition, such as <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.3" title="RFC 7232 § 3.3">If-Modified-Since</a></span>. But this request doesn’t seem to have any preconditions.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a></cite>.</p> </div> <div class="notice comment" id="1127"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1127</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.1" title="Not Modified (RFC 7232 § 4.1)">304</a></span> response should not have <span data-ref-to="128"><var>header</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7232#section-4.1">RFC 7232 § 4.1</a></cite>: <q>Since the goal of a 304 response is to minimize information transfer when the recipient already has one or more cached representations, a sender SHOULD NOT generate representation metadata other than the above listed fields unless said metadata exists for the purpose of guiding cache updates (e.g., <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-2.2" title="RFC 7232 § 2.2">Last-Modified</a></span> might be useful if the response does not have an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-2.3" title="RFC 7232 § 2.3">ETag</a></span> field).</q></p> </div> <div class="notice error" id="1128"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1128</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.3" title="RFC 7232 § 3.3">If-Modified-Since</a></span> on <span data-ref-to="129"><var>method</var></span> must be ignored</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.2" title="Precondition Failed (RFC 7232 § 4.2)">412</a></span> status code means that the server could not satisfy a precondition included in the request. The only such precondition (known to HTTPolice) in this request is <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.3" title="RFC 7232 § 3.3">If-Modified-Since</a></span>. But <cite><a href="https://tools.ietf.org/html/rfc7232#section-3.3">RFC 7232 § 3.3</a></cite> says that an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-3.3" title="RFC 7232 § 3.3">If-Modified-Since</a></span> header in a <span data-ref-to="130"><var>method</var></span> request must be ignored.</p> <span data-ref-to="131"></span> </div> <div class="notice error" id="1129"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1129</span> <span>Preconditions on <span data-ref-to="132"><var>method</var></span> must be ignored</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.2" title="Precondition Failed (RFC 7232 § 4.2)">412</a></span> status code means that the server could not satisfy a precondition included in the request. But, as defined in <cite><a href="https://tools.ietf.org/html/rfc7232#section-5">RFC 7232 § 5</a></cite>, such preconditions must be ignored in a <span data-ref-to="133"><var>method</var></span> request.</p> </div> <div class="notice error" id="1130"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1130</span> <span><span data-ref-to="134"><var>header</var></span> on <span data-ref-to="135"><var>method</var></span> makes no sense</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7232#section-5">RFC 7232 § 5</a></cite>: <q>Likewise, a server MUST ignore the conditional request header fields defined by this specification when received with a request method that does not involve the selection or modification of a selected representation, such as <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.6" title="RFC 7231 § 4.3.6">CONNECT</a></span>, <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.7" title="RFC 7231 § 4.3.7">OPTIONS</a></span>, or <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.8" title="RFC 7231 § 4.3.8">TRACE</a></span>.</q></p> </div> <div class="notice comment" id="1131"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1131</span> <span>Conditional <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span> request is pointless</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7232#section-5">RFC 7232 § 5</a></cite>: <q>Although conditional request header fields are defined as being usable with the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span> method (to keep HEAD's semantics consistent with those of <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1" title="RFC 7231 § 4.3.1">GET</a></span>), there is no point in sending a conditional HEAD because a successful response is around the same size as a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.1" title="Not Modified (RFC 7232 § 4.1)">304</a></span> (Not Modified) response and more useful than a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-4.2" title="Precondition Failed (RFC 7232 § 4.2)">412</a></span> (Precondition Failed) response.</q></p> <span data-ref-to="136"></span> </div> <div class="notice error" id="1132"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1132</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span> header on <span data-ref-to="137"><var>method</var></span> is not supposed to work</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-3.1">RFC 7233 § 3.1</a></cite>: <q>A server MUST ignore a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span> header field received with a request method other than <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1" title="RFC 7231 § 4.3.1">GET</a></span>.</q></p> </div> <div class="notice error" id="1133"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1133</span> <span>Invalid byte range in <span data-ref-to="138"><var>place</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-2.1">RFC 7233 § 2.1</a></cite>: <q>A byte-range-spec is invalid if the last-byte-pos value is present and less than the first-byte-pos.</q></p> </div> <div class="notice error" id="1134"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1134</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.2" title="RFC 7233 § 3.2">If-Range</a></span> requires a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-3.2">RFC 7233 § 3.2</a></cite>: <q>A client MUST NOT generate an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.2" title="RFC 7233 § 3.2">If-Range</a></span> header field in a request that does not contain a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span> header field.</q></p> </div> <div class="notice error" id="1135"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1135</span> <span>Weak entity tags are forbidden in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.2" title="RFC 7233 § 3.2">If-Range</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-3.2">RFC 7233 § 3.2</a></cite>: <q>A client MUST NOT generate an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.2" title="RFC 7233 § 3.2">If-Range</a></span> header field containing an entity-tag that is marked as weak.</q></p> </div> <div class="notice error" id="1136"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1136</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.1" title="Partial Content (RFC 7233 § 4.1)">206</a></span> response, but request had no <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span></span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.1" title="Partial Content (RFC 7233 § 4.1)">206</a></span> status code only makes sense in responses to partial requests—that is, requests with a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span> header. See <cite><a href="https://tools.ietf.org/html/rfc7233#section-4.1">RFC 7233 § 4.1</a></cite>.</p> </div> <div class="notice error" id="1137"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1137</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.1" title="Partial Content (RFC 7233 § 4.1)">206</a></span> response to <span data-ref-to="139"><var>method</var></span> is forbidden</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-3.1">RFC 7233 § 3.1</a></cite>: <q>A server MUST ignore a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span> header field received with a request method other than <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1" title="RFC 7231 § 4.3.1">GET</a></span>.</q></p> <span data-ref-to="140"></span> </div> <div class="notice error" id="1138"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1138</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.1" title="Partial Content (RFC 7233 § 4.1)">206</a></span> response needs range specifiers</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.1" title="Partial Content (RFC 7233 § 4.1)">206</a></span> status code means that the response contains one or more parts of the data. When it contains one part, the response must have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> header. When it contains several parts, the response must have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span> of <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#appendix-A" title="RFC 7233 appendix A">multipart/byteranges</a></span>. But this response has neither.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7233#section-4.1">RFC 7233 § 4.1</a></cite>.</p> </div> <div class="notice error" id="1139"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1139</span> <span>Multipart boundary not declared</span> </h3> <p>According to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span>, this message has a multipart body, but Content-Type does not include the ‘boundary’ parameter that is necessary to parse such a body.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc2046#section-5.1.1">RFC 2046 § 5.1.1</a></cite>.</p> </div> <div class="notice error" id="1140"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1140</span> <span>Multipart boundary not found</span> </h3> <p>The multipart boundary declared in this message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span> was not found in the body.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc2046#section-5.1.1">RFC 2046 § 5.1.1</a></cite>.</p> <span data-ref-to="141"></span> </div> <div class="notice error" id="1141"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1141</span> <span>No <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> in part #<span data-ref-to="142"><var>part_num</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-4.1">RFC 7233 § 4.1</a></cite>: <q>Within the header area of each body part in the multipart payload, the server MUST generate a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> header field corresponding to the range being enclosed in that body part.</q></p> <span data-ref-to="143"></span> <span data-ref-to="143"></span> </div> <div class="notice comment" id="1142"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1142</span> <span>No <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span> in part #<span data-ref-to="144"><var>part_num</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-4.1">RFC 7233 § 4.1</a></cite>: <q>If the selected representation would have had a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span> header field in a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.1" title="OK (RFC 7231 § 6.3.1)">200</a></span> (OK) response, the server SHOULD generate that same Content-Type field in the header area of each body part.</q></p> <span data-ref-to="145"></span> <span data-ref-to="145"></span> </div> <div class="notice error" id="1143"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1143</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> in a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#appendix-A" title="RFC 7233 appendix A">multipart/byteranges</a></span> response is forbidden</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-4.1">RFC 7233 § 4.1</a></cite>: <q>To avoid confusion with single-part responses, a server MUST NOT generate a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> header field in the HTTP header section of a multiple part response (this field will be sent in each part instead).</q></p> <span data-ref-to="146"></span> </div> <div class="notice error" id="1144"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1144</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#appendix-A" title="RFC 7233 appendix A">multipart/byteranges</a></span> response can’t be used for a single <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-4.1">RFC 7233 § 4.1</a></cite>: <q>A server MUST NOT generate a multipart response to a request for a single range, since a client that does not request multiple parts might not support multipart responses.</q></p> <span data-ref-to="147"></span> <span data-ref-to="147"></span> </div> <div class="notice error" id="1145"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1145</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.1" title="Partial Content (RFC 7233 § 4.1)">206</a></span> response, but <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-2.3" title="RFC 7232 § 2.3">ETag</a></span> doesn’t match <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.2" title="RFC 7233 § 3.2">If-Range</a></span></span> </h3> <p>The request’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.2" title="RFC 7233 § 3.2">If-Range</a></span> header means that the server is expected to send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.1" title="Partial Content (RFC 7233 § 4.1)">206</a></span> response only if the representation’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7232#section-2.3" title="RFC 7232 § 2.3">ETag</a></span> matches the one specified in If-Range. In this case, it doesn’t match, so the server is supposed to send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.1" title="OK (RFC 7231 § 6.3.1)">200</a></span> response with the complete data.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7233#section-3.2">RFC 7233 § 3.2</a></cite>.</p> <span data-ref-to="148"></span> </div> <div class="notice comment" id="1146"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1146</span> <span>Unnecessary <span data-ref-to="149"><var>header</var></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-4.1">RFC 7233 § 4.1</a></cite>: <q>If a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.1" title="Partial Content (RFC 7233 § 4.1)">206</a></span> is generated in response to a request with an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.2" title="RFC 7233 § 3.2">If-Range</a></span> header field, the sender SHOULD NOT generate other representation header fields beyond those required above, because the client is understood to already have a prior response containing those header fields.</q></p> <span data-ref-to="150"></span> </div> <div class="notice error" id="1147"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1147</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> is undefined for <span data-ref-to="151"><var>status</var></span> responses</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> header is defined by <cite><a href="https://tools.ietf.org/html/rfc7233#section-4.2">RFC 7233 § 4.2</a></cite> for responses with status codes <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.1" title="Partial Content (RFC 7233 § 4.1)">206</a></span> and <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.4" title="Range Not Satisfiable (RFC 7233 § 4.4)">416</a></span>, but not <span data-ref-to="152"><var>status</var></span>.</p> </div> <div class="notice error" id="1148"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1148</span> <span>Invalid byte range in <span data-ref-to="153"><var>place</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-4.2">RFC 7233 § 4.2</a></cite>: <q>A <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> field value is invalid if it contains a byte-range-resp that has a last-byte-pos value less than its first-byte-pos value, or a complete-length value less than or equal to its last-byte-pos value.</q></p> </div> <div class="notice error" id="1149"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1149</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.4" title="Range Not Satisfiable (RFC 7233 § 4.4)">416</a></span> response to request without <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span> makes no sense</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.4" title="Range Not Satisfiable (RFC 7233 § 4.4)">416</a></span> status code is defined by <cite><a href="https://tools.ietf.org/html/rfc7233#section-4.4">RFC 7233 § 4.4</a></cite> only for responses to requests that have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-3.1" title="RFC 7233 § 3.1">Range</a></span> header.</p> </div> <div class="notice comment" id="1150"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1150</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.4" title="Range Not Satisfiable (RFC 7233 § 4.4)">416</a></span> response should have <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7233#section-4.4">RFC 7233 § 4.4</a></cite>: <q>When this status code is generated in response to a byte-range request, the sender SHOULD generate a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7233#section-4.2" title="RFC 7233 § 4.2">Content-Range</a></span> header field specifying the current length of the selected representation</q></p> <span data-ref-to="154"></span> </div> <div class="notice error" id="1151"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1151</span> <span>Empty list elements in <span data-ref-to="155"><var>place</var></span> are forbidden</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-7">RFC 7230 § 7</a></cite>: <q>In any production that uses the list construct, a sender MUST NOT generate empty list elements.</q></p> </div> <div class="notice error" id="1152"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1152</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to="156"><var>directive</var></span> is for responses</span> </h3> <p>This request’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header includes the <span data-ref-to="157"><var>directive</var></span> directive, which is only defined for responses.</p> </div> <div class="notice error" id="1153"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1153</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to="158"><var>directive</var></span> is for requests</span> </h3> <p>This response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header includes the <span data-ref-to="159"><var>directive</var></span> directive, which is only defined for requests.</p> </div> <div class="notice comment" id="1154"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1154</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to="160"><var>directive</var></span> should be quoted</span> </h3> <p>The specification for the <span data-ref-to="161"><var>directive</var></span> directive recommends wrapping its argument in double quotes. But in this message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header, it is not quoted.</p> </div> <div class="notice comment" id="1155"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1155</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to="162"><var>directive</var></span> should not be quoted</span> </h3> <p>In this message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header, the argument to the <span data-ref-to="163"><var>directive</var></span> directive is wrapped in double quotes. But the specification recommends writing it as a plain token, without quotes.</p> </div> <div class="notice error" id="1156"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1156</span> <span><span data-ref-to="164"><var>entry</var></span>: <span data-ref-to="165"><var>name</var></span> needs an argument</span> </h3> <p>According to the specification, ‘<span data-ref-to="166"><var>name</var></span>’ in <span data-ref-to="167"><var>entry</var></span> must have an argument. But in this message, it doesn’t.</p> </div> <div class="notice error" id="1157"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1157</span> <span><span data-ref-to="168"><var>entry</var></span>: <span data-ref-to="169"><var>name</var></span> can’t have an argument</span> </h3> <p>In this message’s <span data-ref-to="170"><var>entry</var></span> header, ‘<span data-ref-to="171"><var>name</var></span>’ has an argument. But the specification defines no argument for ‘<span data-ref-to="172"><var>name</var></span>’.</p> </div> <div class="notice error" id="1158"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1158</span> <span>Syntax error in <span data-ref-to="173"><var>place</var></span>: <span data-ref-to="174"><var>name</var></span></span> </h3> <p>“<span data-ref-to="175"><var>value</var></span>” is not a correct value for ‘<span data-ref-to="176"><var>name</var></span>’ in <span data-ref-to="177"><var>place</var></span>.</p> <p><var>error</var></p> </div> <div class="notice error" id="1159"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1159</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-cache</a></span> can’t have an argument</span> </h3> <p>In this request’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header, the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-cache</a></span> directive has an argument. But the specification for <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-cache</a></span> only defines an argument when used in responses.</p> </div> <div class="notice comment" id="1160"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1160</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.4" title="RFC 7234 § 5.4">Pragma</a></span> other than ‘no-cache’ is deprecated</span> </h3> <p>This message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.4" title="RFC 7234 § 5.4">Pragma</a></span> header includes ‘<span data-ref-to="178"><var>pragma</var></span>’, but all pragmas other than ‘no-cache’ are deprecated in <cite><a href="https://tools.ietf.org/html/rfc7234#section-5.4">RFC 7234 § 5.4</a></cite>.</p> </div> <div class="notice comment" id="1161"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1161</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: no-cache” should also have “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.4" title="RFC 7234 § 5.4">Pragma</a></span>: no-cache”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-5.4">RFC 7234 § 5.4</a></cite>: <q>When sending a no-cache request, a client ought to include both the pragma and cache-control directives, unless <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-cache</a></span> is purposefully omitted to target other Cache-Control response directives at HTTP/1.1 caches.</q></p> </div> <div class="notice comment" id="1162"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1162</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.4" title="RFC 7234 § 5.4">Pragma</a></span>: no-cache is for requests</span> </h3> <p>This response contains the ‘no-cache’ pragma directive, which is defined by <cite><a href="https://tools.ietf.org/html/rfc7234#section-5.4">RFC 7234 § 5.4</a></cite> only for requests.</p> </div> <div class="notice error" id="1163"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1163</span> <span>Warn code <span data-ref-to="179"><var>code</var></span> not in range 100—299</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-5.5">RFC 7234 § 5.5</a></cite> defines two classes of warn codes: 1xx and 2xx. But this message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> header contains a <span data-ref-to="180"><var>code</var></span> code.</p> </div> <div class="notice error" id="1164"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1164</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> date must match the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> header</span> </h3> <p>This message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> header contains a warning (code <span data-ref-to="181"><var>code</var></span>) with a date that does not match the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> header. This means that the warning was mistakenly kept after cache validation. As explained in <cite><a href="https://tools.ietf.org/html/rfc7234#section-5.5">RFC 7234 § 5.5</a></cite>, such warnings must be removed.</p> </div> <div class="notice error" id="1165"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1165</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span>: <span data-ref-to="182"><var>code</var></span>” is for responses</span> </h3> <p>This request’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> header contains the <span data-ref-to="183"><var>code</var></span> warn code. But, according to <cite><a href="https://tools.ietf.org/html/rfc7234#section-5.5">RFC 7234 § 5.5</a></cite>, 1xx warn codes can only be used on responses.</p> </div> <div class="notice error" id="1166"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1166</span> <span>Response from cache needs an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> header</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7234#section-4">RFC 7234 § 4</a></cite>, a cache must add an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> header to every response that is served without contacting the origin server.</p> </div> <div class="notice error" id="1167"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1167</span> <span>Status code <span data-ref-to="184"><var>status</var></span> not in range 100—599</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7231#section-6">RFC 7231 § 6</a></cite>, HTTP status codes can only range from 100 to 599.</p> </div> <div class="notice debug" id="1168"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1168</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> header implies response from cache</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-5.1">RFC 7234 § 5.1</a></cite>: <q>The presence of an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> header field implies that the response was not generated or validated by the origin server for this request.</q></p> </div> <div class="notice debug" id="1169"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1169</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span>: <span data-ref-to="185"><var>code</var></span>” implies response from cache</span> </h3> <p>This response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> header contains the <span data-ref-to="186"><var>code</var></span> warn code, which implies that it was served from a cache, without contacting the origin server. See <cite><a href="https://tools.ietf.org/html/rfc7234#section-5.5">RFC 7234 § 5.5</a></cite>.</p> </div> <div class="notice comment" id="1170"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1170</span> <span>Response from cache older than <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">max-age</a></span></span> </h3> <p>This response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> of <span data-ref-to="187"><var>value</var></span> is greater than the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">max-age</a></span> of <span data-ref-to="188"><var>max_age</var></span> requested by the client’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header.</p> <span data-ref-to="189"></span> </div> <div class="notice comment" id="1171"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1171</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to="190"><var>directive</var></span> has no effect on <span data-ref-to="191"><var>method</var></span></span> </h3> <p>The <span data-ref-to="192"><var>method</var></span> method is defined as non-cacheable, so the <span data-ref-to="193"><var>directive</var></span> directive in this request’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header makes no difference.</p> </div> <div class="notice error" id="1172"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1172</span> <span>Response to <span data-ref-to="194"><var>method</var></span> can’t be served from cache</span> </h3> <p>The <span data-ref-to="195"><var>method</var></span> method is defined as non-cacheable.</p> </div> <div class="notice error" id="1173"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1173</span> <span>Response to “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-cache</a></span>” can’t be served from cache</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-5.2.1.4">RFC 7234 § 5.2.1.4</a></cite>: <q>The &quot;no-cache&quot; request directive indicates that a cache MUST NOT use a stored response to satisfy the request without successful validation on the origin server.</q></p> <span data-ref-to="196"></span> </div> <div class="notice error" id="1174"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1174</span> <span>Response to “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.4" title="RFC 7234 § 5.4">Pragma</a></span>: no-cache” can’t be served from cache</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-5.4">RFC 7234 § 5.4</a></cite>: <q>When the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header field is not present in a request, caches MUST consider the no-cache request pragma-directive as having the same effect as if &quot;Cache-Control: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-cache</a></span>&quot; were present</q></p> <span data-ref-to="197"></span> </div> <div class="notice error" id="1175"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1175</span> <span>Response with “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-cache</a></span>” can’t be served from cache</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.2">RFC 7234 § 5.2.2.2</a></cite>: <q>The &quot;no-cache&quot; response directive indicates that the response MUST NOT be used to satisfy a subsequent request without successful validation on the origin server.</q></p> </div> <div class="notice error" id="1176"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1176</span> <span>Response with “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-store</a></span>” can’t be served from cache</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7234#section-3">RFC 7234 § 3</a></cite>, a cache cannot store a response that includes the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-store</a></span> directive in its <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header.</p> </div> <div class="notice error" id="1177"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1177</span> <span><span data-ref-to="198"><var>status</var></span> response can’t be served from cache by default</span> </h3> <p>The <span data-ref-to="199"><var>status</var></span> status code is not defined as cacheable by default. According to <cite><a href="https://tools.ietf.org/html/rfc7234#section-3">RFC 7234 § 3</a></cite>, such a response can only be cached if it explicitly allows caching, with headers such as <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.3" title="RFC 7234 § 5.3">Expires</a></span>. But this response has no such headers, so it is not cacheable.</p> </div> <div class="notice debug" id="1178"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1178</span> <span>Heuristic freshness</span> </h3> <p>Because this response has no explicit freshness controls (such as <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.3" title="RFC 7234 § 5.3">Expires</a></span> or <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">max-age</a></span>), HTTPolice will assume that its expiration time was chosen heuristically by the cache. See <cite><a href="https://tools.ietf.org/html/rfc7234#section-4.2.2">RFC 7234 § 4.2.2</a></cite>.</p> </div> <div class="notice debug" id="1179"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1179</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.4" title="Heuristic Expiration (RFC 7234 § 5.5.4)">113</a></span>” implies heuristic freshness</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.4" title="Heuristic Expiration (RFC 7234 § 5.5.4)">113</a></span> warn code in this response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> header means that the expiration time for this response was chosen heuristically by the cache.</p> </div> <div class="notice comment" id="1180"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1180</span> <span>Heuristic freshness should have “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.4" title="Heuristic Expiration (RFC 7234 § 5.5.4)">113</a></span>”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-4.2.2">RFC 7234 § 4.2.2</a></cite>: <q>When a heuristic is used to calculate freshness lifetime, a cache SHOULD generate a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> header field with a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.4" title="Heuristic Expiration (RFC 7234 § 5.5.4)">113</a></span> warn-code (see Section 5.5.4) in the response if its current_age is more than 24 hours and such a warning is not already present.</q></p> <span data-ref-to="200"></span> </div> <div class="notice error" id="1181"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1181</span> <span>Heuristic freshness can’t be used when <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.3" title="RFC 7234 § 5.3">Expires</a></span> is present</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-4.2.2">RFC 7234 § 4.2.2</a></cite>: <q>A cache MUST NOT use heuristics to determine freshness when an explicit expiration time is present in the stored response.</q></p> </div> <div class="notice error" id="1182"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1182</span> <span>Heuristic freshness can’t be used when <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">max-age</a></span> is present</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-4.2.2">RFC 7234 § 4.2.2</a></cite>: <q>A cache MUST NOT use heuristics to determine freshness when an explicit expiration time is present in the stored response.</q></p> <span data-ref-to="201"></span> </div> <div class="notice comment" id="1183"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1183</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span>: <span data-ref-to="202"><var>code</var></span>” implies response is stale</span> </h3> <p>The <span data-ref-to="203"><var>code</var></span> warn code in this response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> header means that the response is stale, as defined by <cite><a href="https://tools.ietf.org/html/rfc7234#section-4.2">RFC 7234 § 4.2</a></cite>.</p> </div> <div class="notice comment" id="1184"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1184</span> <span>Response is stale because <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> &gt; <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">max-age</a></span></span> </h3> <p>This response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> is greater than the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">max-age</a></span> specified in its <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header. This means that the response is stale, as defined by <cite><a href="https://tools.ietf.org/html/rfc7234#section-4.2">RFC 7234 § 4.2</a></cite>.</p> </div> <div class="notice comment" id="1185"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1185</span> <span>Response is stale because <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> &gt; <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.3" title="RFC 7234 § 5.3">Expires</a></span> − <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span></span> </h3> <p>This response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> is greater than the difference between its <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.3" title="RFC 7234 § 5.3">Expires</a></span> date and its <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> header. This means that the response is stale, as defined by <cite><a href="https://tools.ietf.org/html/rfc7234#section-4.2">RFC 7234 § 4.2</a></cite>.</p> </div> <div class="notice comment" id="1186"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1186</span> <span>Stale response should have “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.1" title="Response is Stale (RFC 7234 § 5.5.1)">110</a></span>”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-4.2.4">RFC 7234 § 4.2.4</a></cite>: <q>A cache SHOULD generate a Warning header field with the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.1" title="Response is Stale (RFC 7234 § 5.5.1)">110</a></span> warn-code (see Section 5.5.1) in stale responses.</q></p> </div> <div class="notice error" id="1187"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1187</span> <span>Response with “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.1" title="RFC 7234 § 5.2.2.1">must-revalidate</a></span>” can’t be served stale</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-5.2.2.1">RFC 7234 § 5.2.2.1</a></cite>: <q>The &quot;must-revalidate&quot; response directive indicates that once it has become stale, a cache MUST NOT use the response to satisfy subsequent requests without successful validation on the origin server.</q></p> </div> <div class="notice comment" id="1188"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1188</span> <span>Possibly wrong stale response</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7234#section-4.2.4">RFC 7234 § 4.2.4</a></cite>: <q>A cache MUST NOT send stale responses unless it is disconnected (i.e., it cannot contact the origin server or otherwise find a forward path) or doing so is explicitly allowed (e.g., by the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2.1.2" title="RFC 7234 § 5.2.1.2">max-stale</a></span> request directive; see Section 5.2.1).</q></p> <p>If the cache is disconnected, it should have added a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> header with a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.3" title="Disconnected Operation (RFC 7234 § 5.5.3)">112</a></span> or <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.2" title="Revalidation Failed (RFC 7234 § 5.5.2)">111</a></span> warn code to indicate that.</p> </div> <div class="notice debug" id="1189"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1189</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.6" title="Transformation Applied (RFC 7234 § 5.5.6)">214</a></span>” means transformed by proxy</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.6" title="Transformation Applied (RFC 7234 § 5.5.6)">214</a></span> warn code in this message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span> header means that it was transformed by a proxy.</p> <p>See also <cite><a href="https://tools.ietf.org/html/rfc7230#section-5.7.2">RFC 7230 § 5.7.2</a></cite>.</p> </div> <div class="notice debug" id="1190"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1190</span> <span>Status <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.4" title="Non-Authoritative Information (RFC 7231 § 6.3.4)">203</a></span> means transformed by proxy</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.4" title="Non-Authoritative Information (RFC 7231 § 6.3.4)">203</a></span> status code means that this response was transformed by a proxy.</p> <p>See also <cite><a href="https://tools.ietf.org/html/rfc7230#section-5.7.2">RFC 7230 § 5.7.2</a></cite>.</p> </div> <div class="notice error" id="1191"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1191</span> <span>Transformed message needs “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5" title="RFC 7234 § 5.5">Warning</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.6" title="Transformation Applied (RFC 7234 § 5.5.6)">214</a></span>”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-5.7.2">RFC 7230 § 5.7.2</a></cite>: <q>A proxy that transforms a payload MUST add a Warning header field with the warn-code of <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.5.6" title="Transformation Applied (RFC 7234 § 5.5.6)">214</a></span> (&quot;Transformation Applied&quot;) if one is not already in the message (see Section 5.5 of [RFC7234]).</q></p> </div> <div class="notice error" id="1192"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1192</span> <span>Transformation forbidden by “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-transform</a></span>”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-5.7.2">RFC 7230 § 5.7.2</a></cite>: <q>A proxy MUST NOT transform the payload (Section 3.3 of [RFC7231]) of a message that contains a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-transform</a></span> cache-control directive (Section 5.2 of [RFC7234]).</q></p> </div> <div class="notice error" id="1193"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1193</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to="204"><var>directive1</var></span> contradicts <span data-ref-to="205"><var>directive2</var></span></span> </h3> <p>This message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header includes both the <span data-ref-to="206"><var>directive1</var></span> and the <span data-ref-to="207"><var>directive2</var></span> directives, which contradict each other.</p> </div> <div class="notice error" id="1194"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1194</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-3.1" title="Unauthorized (RFC 7235 § 3.1)">401</a></span> response needs a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.1" title="RFC 7235 § 4.1">WWW-Authenticate</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7235#section-3.1">RFC 7235 § 3.1</a></cite>: <q>The server generating a 401 response MUST send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.1" title="RFC 7235 § 4.1">WWW-Authenticate</a></span> header field (Section 4.1) containing at least one challenge applicable to the target resource.</q></p> </div> <div class="notice error" id="1195"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1195</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-3.2" title="Proxy Authentication Required (RFC 7235 § 3.2)">407</a></span> response needs a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.3" title="RFC 7235 § 4.3">Proxy-Authenticate</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7235#section-3.2">RFC 7235 § 3.2</a></cite>: <q>The proxy MUST send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.3" title="RFC 7235 § 4.3">Proxy-Authenticate</a></span> header field (Section 4.3) containing a challenge applicable to that proxy for the target resource.</q></p> </div> <div class="notice error" id="1196"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1196</span> <span>‘realm’ parameter in <span data-ref-to="208"><var>place</var></span> must be quoted</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7235#section-2.2">RFC 7235 § 2.2</a></cite>, the value of the ‘realm’ parameter must be enclosed in double quotes.</p> </div> <div class="notice comment" id="1197"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1197</span> <span>Deprecated header <span data-ref-to="209"><var>header</var></span></span> </h3> <p>This message has the <span data-ref-to="210"><var>header</var></span> header, which is listed as “obsoleted” or “deprecated” in the <cite><a href="https://www.iana.org/assignments/message-headers/message-headers.xhtml">IANA message headers registry</a></cite>.</p> </div> <div class="notice error" id="1198"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1198</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span>: close” makes no sense in <span data-ref-to="211"><var>status</var></span> response</span> </h3> <p>The <span data-ref-to="212"><var>status</var></span> status code means that this is an interim response, and more responses will follow on the same connection. But the ‘close’ option in this response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span> header means that the server will close the connection after sending this response.</p> </div> <div class="notice error" id="1199"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1199</span> <span>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span>: close” makes no sense in <span data-ref-to="213"><var>status</var></span> response to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.6" title="RFC 7231 § 4.3.6">CONNECT</a></span></span> </h3> <p>A <span data-ref-to="214"><var>status</var></span> response to a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.6" title="RFC 7231 § 4.3.6">CONNECT</a></span> request means that this connection is becoming a tunnel. But the ‘close’ option in this response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span> header means that the server will close the connection after sending this response.</p> </div> <div class="notice comment" id="1200"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1200</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6585#section-3" title="Precondition Required (RFC 6585 § 3)">428</a></span> response, but request has a <span data-ref-to="215"><var>header</var></span> precondition</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6585#section-3" title="Precondition Required (RFC 6585 § 3)">428</a></span> status code means that the server refuses to handle an unconditional request. But this request is conditional, because it has the <span data-ref-to="216"><var>header</var></span> header.</p> </div> <div class="notice comment" id="1201"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1201</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6585#section-3" title="Precondition Required (RFC 6585 § 3)">428</a></span> response should include an explanation</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6585#section-3">RFC 6585 § 3</a></cite>: <q>Responses using this status code SHOULD explain how to resubmit the request successfully.</q></p> </div> <div class="notice error" id="1202"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1202</span> <span><span data-ref-to="217"><var>status</var></span> response can’t be served from cache</span> </h3> <p>According to the specification, the <span data-ref-to="218"><var>status</var></span> status code cannot be served from a cache.</p> </div> <div class="notice comment" id="1203"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1203</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6585#section-4" title="Too Many Requests (RFC 6585 § 4)">429</a></span> response should include an explanation</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6585#section-4">RFC 6585 § 4</a></cite>: <q>The response representations SHOULD include details explaining the condition, and MAY include a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.3" title="RFC 7231 § 7.1.3">Retry-After</a></span> header indicating how long to wait before making a new request.</q></p> </div> <div class="notice comment" id="1204"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1204</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6585#section-6" title="Network Authentication Required (RFC 6585 § 6)">511</a></span> response should have a body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6585#section-6">RFC 6585 § 6</a></cite>: <q>The response representation SHOULD contain a link to a resource that allows the user to submit credentials (e.g., with an HTML form).</q></p> </div> <div class="notice comment" id="1205"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1205</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7538#section-3" title="Permanent Redirect (RFC 7538 § 3)">308</a></span> response should have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7538#section-3">RFC 7538 § 3</a></cite>: <q>The server SHOULD generate a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.2" title="RFC 7231 § 7.1.2">Location</a></span> header field ([RFC7231], Section 7.1.2) in the response containing a preferred URI reference for the new permanent URI.</q></p> </div> <div class="notice error" id="1206"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1206</span> <span><span data-ref-to="219"><var>header</var></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7617" title="RFC 7617">Basic</a></span> must have ‘realm’</span> </h3> <p>The Basic authentication scheme requires a ‘realm’ parameter. See <cite><a href="https://tools.ietf.org/html/rfc7617#section-2">RFC 7617 § 2</a></cite>.</p> </div> <div class="notice error" id="1207"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1207</span> <span><span data-ref-to="220"><var>header</var></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7617" title="RFC 7617">Basic</a></span> can’t have a ‘<span data-ref-to="221"><var>param</var></span>’ parameter</span> </h3> <p>No ‘<span data-ref-to="222"><var>param</var></span>’ parameter is defined for the Basic authentication scheme. See <cite><a href="https://tools.ietf.org/html/rfc7617#section-2">RFC 7617 § 2</a></cite>.</p> </div> <div class="notice error" id="1208"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1208</span> <span><span data-ref-to="223"><var>header</var></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7617" title="RFC 7617">Basic</a></span> can’t have a ‘<span data-ref-to="224"><var>charset</var></span>’ charset</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7617#section-2.1">RFC 7617 § 2.1</a></cite>, the ‘charset’ parameter to the Basic authentication scheme can only have the value “UTF-8”.</p> </div> <div class="notice error" id="1209"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1209</span> <span>Malformed <span data-ref-to="225"><var>header</var></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7617" title="RFC 7617">Basic</a></span></span> </h3> <p>In the Basic authentication scheme, credentials are sent as a single Base64 string. See <cite><a href="https://tools.ietf.org/html/rfc7617#section-2">RFC 7617 § 2</a></cite>.</p> </div> <div class="notice error" id="1210"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1210</span> <span>Malformed <span data-ref-to="226"><var>header</var></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7617" title="RFC 7617">Basic</a></span></span> </h3> <p>In the Basic authentication scheme, the user ID and password are combined with a colon ‘:’ and packed into Base64. In this request’s <span data-ref-to="227"><var>header</var></span> header, HTTPolice tried to decode them from Base64 and got the following error:</p> <p><var>error</var></p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7617#section-2">RFC 7617 § 2</a></cite>.</p> </div> <div class="notice error" id="1211"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1211</span> <span>Malformed <span data-ref-to="228"><var>header</var></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7617" title="RFC 7617">Basic</a></span></span> </h3> <p>In the Basic authentication scheme, the user ID and password are combined with a colon ‘:’ and packed into Base64. But in this request’s <span data-ref-to="229"><var>header</var></span> header, there is no ‘:’ after decoding from Base64. See <cite><a href="https://tools.ietf.org/html/rfc7617#section-2">RFC 7617 § 2</a></cite>.</p> </div> <div class="notice error" id="1212"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1212</span> <span><span data-ref-to="230"><var>header</var></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7617" title="RFC 7617">Basic</a></span> can’t contain character <span data-ref-to="231"><var>char</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7617#section-2">RFC 7617 § 2</a></cite>: <q>The user-id and password MUST NOT contain any control characters (see &quot;CTL&quot; in Appendix B.1 of [RFC5234]).</q></p> </div> <div class="notice comment" id="1213"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1213</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.5" title="RFC 7231 § 3.1.1.5">Content-Type</a></span>: <span data-ref-to="232"><var>value</var></span> is not suitable for <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-2" title="RFC 5789 § 2">PATCH</a></span></span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-2" title="RFC 5789 § 2">PATCH</a></span> method should only be used with media types that define how to apply the patch. <span data-ref-to="233"><var>value</var></span> is not such a media type.</p> <p>See <cite><a href="https://www.rfc-editor.org/errata_search.php?eid=3169">RFC 5789 errata</a></cite>.</p> <p>For example, <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7396" title="RFC 7396">application/merge-patch+json</a></span> would be a suitable patch format for JSON.</p> </div> <div class="notice comment" id="1214"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1214</span> <span><span data-ref-to="234"><var>value</var></span> patch should be rejected</span> </h3> <p><cite><a href="https://www.rfc-editor.org/errata_search.php?eid=3169">RFC 5789 errata</a></cite>: <q>If a server receives a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-2" title="RFC 5789 § 2">PATCH</a></span> request with a media type whose specification does not define semantics specific to PATCH, the server SHOULD reject the request by returning the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.13" title="Unsupported Media Type (RFC 7231 § 6.5.13)">415</a></span> Unsupported Media Type status code, unless a more specific error status code takes priority.</q></p> <span data-ref-to="235"></span> <span data-ref-to="236"></span> </div> <div class="notice comment" id="1215"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1215</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.5.13" title="Unsupported Media Type (RFC 7231 § 6.5.13)">415</a></span> response to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-2" title="RFC 5789 § 2">PATCH</a></span> should have <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-3.1" title="RFC 5789 § 3.1">Accept-Patch</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc5789#section-2.2">RFC 5789 § 2.2</a></cite>: <q>Such a response SHOULD include an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-3.1" title="RFC 5789 § 3.1">Accept-Patch</a></span> response header as described in Section 3.1 to notify the client what patch document media types are supported.</q></p> </div> <div class="notice comment" id="1216"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1216</span> <span>Should send <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-3.1" title="RFC 5789 § 3.1">Accept-Patch</a></span> with “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-2" title="RFC 5789 § 2">PATCH</a></span>”</span> </h3> <p>This <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.7" title="RFC 7231 § 4.3.7">OPTIONS</a></span> response indicates in its <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span> header that the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-2" title="RFC 5789 § 2">PATCH</a></span> method is supported. According to <cite><a href="https://tools.ietf.org/html/rfc5789#section-3.1">RFC 5789 § 3.1</a></cite>, in this case the server should also send an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-3.1" title="RFC 5789 § 3.1">Accept-Patch</a></span> header.</p> </div> <div class="notice error" id="1217"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1217</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-3.1" title="RFC 5789 § 3.1">Accept-Patch</a></span> implies “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-2" title="RFC 5789 § 2">PATCH</a></span>”</span> </h3> <p>This response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-3.1" title="RFC 5789 § 3.1">Accept-Patch</a></span> header means that this resource supports the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-2" title="RFC 5789 § 2">PATCH</a></span> method, but it’s missing from the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span> header.</p> </div> <div class="notice error" id="1218"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1218</span> <span>HSTS needs a ‘<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6797#section-6.1.1" title="RFC 6797 § 6.1.1">max-age</a></span>’ directive</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc6797#section-6.1.1">RFC 6797 § 6.1.1</a></cite>, a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6797#section-6.1" title="RFC 6797 § 6.1">Strict-Transport-Security</a></span> header must have a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6797#section-6.1.1" title="RFC 6797 § 6.1.1">max-age</a></span> directive.</p> </div> <div class="notice comment" id="1219"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1219</span> <span>HSTS: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6797#section-6.1.2" title="RFC 6797 § 6.1.2">includeSubDomains</a></span> has no effect with <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6797#section-6.1.1" title="RFC 6797 § 6.1.1">max-age</a></span>=0</span> </h3> <p>The “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6797#section-6.1.1" title="RFC 6797 § 6.1.1">max-age</a></span>=0” directive in this response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6797#section-6.1" title="RFC 6797 § 6.1">Strict-Transport-Security</a></span> header tells the user agent to delete the HSTS policy for the domain. The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6797#section-6.1.2" title="RFC 6797 § 6.1.2">includeSubDomains</a></span> directive makes no difference in this case.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc6797#section-6.2">RFC 6797 § 6.2</a></cite>.</p> </div> <div class="notice error" id="1220"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1220</span> <span>Duplicate ‘<span data-ref-to="237"><var>directive</var></span>’ directive in HSTS</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6797#section-6.1">RFC 6797 § 6.1</a></cite>: <q>All directives MUST appear only once in an STS header field.</q></p> <span data-ref-to="238"></span> </div> <div class="notice error" id="1221"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1221</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6797#section-6.1" title="RFC 6797 § 6.1">Strict-Transport-Security</a></span> can’t be used without TLS</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6797#section-7.2">RFC 6797 § 7.2</a></cite>: <q>An HSTS Host MUST NOT include the STS header field in HTTP responses conveyed over non-secure transport.</q></p> </div> <div class="notice error" id="1222"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1222</span> <span>Impossible date in <span data-ref-to="239"><var>place</var></span></span> </h3> <p>“<span data-ref-to="240"><var>date</var></span>” is not a valid date.</p> </div> <div class="notice error" id="1223"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1223</span> <span>Impossible time in <span data-ref-to="241"><var>place</var></span></span> </h3> <p>“<span data-ref-to="242"><var>time</var></span>” is not a valid time.</p> </div> <div class="notice error" id="1224"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1224</span> <span>LF without CR in <span data-ref-to="243"><var>place</var></span></span> </h3> <p>Lines in HTTP message framing are terminated by two bytes: a carriage return (CR) followed by a line feed (LF). Some implementations accept a bare LF without CR, like in this message, but this is not reliable.</p> <p>See also <cite><a href="https://tools.ietf.org/html/rfc7230#section-3.5">RFC 7230 § 3.5</a></cite>.</p> </div> <div class="notice error" id="1225"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1225</span> <span>Duplicate ‘<span data-ref-to="244"><var>name</var></span>’ parameter in <span data-ref-to="245"><var>place</var></span></span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc8288#section-3">RFC 8288 § 3</a></cite>, the ‘<span data-ref-to="246"><var>name</var></span>’ parameter must not occur more than once in a single link.</p> </div> <div class="notice comment" id="1226"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1226</span> <span>Deprecated ‘rev’ parameter in <span data-ref-to="247"><var>place</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc8288#section-3.3">RFC 8288 § 3.3</a></cite>: <q>rev is deprecated by this specification because it often confuses authors and readers; in most cases, using a separate relation type is preferable.</q></p> </div> <div class="notice comment" id="1227"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1227</span> <span><span data-ref-to="248"><var>patch_type</var></span> is not suitable for <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-3.1" title="RFC 5789 § 3.1">Accept-Patch</a></span></span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-2" title="RFC 5789 § 2">PATCH</a></span> method should only be used with media types that define how to apply the patch. <span data-ref-to="249"><var>patch_type</var></span> is not such a media type. But this response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc5789#section-3.1" title="RFC 5789 § 3.1">Accept-Patch</a></span> header invites the client to send patches of type <span data-ref-to="250"><var>patch_type</var></span>.</p> <p>See <cite><a href="https://www.rfc-editor.org/errata_search.php?eid=3169">RFC 5789 errata</a></cite>.</p> <p>For example, <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7396" title="RFC 7396">application/merge-patch+json</a></span> would be a suitable patch format for JSON.</p> </div> <div class="notice error" id="1228"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1228</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span>: h2 is wrong</span> </h3> <p>This message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header includes the token ‘h2’, which normally refers to HTTP/2 over TLS. But HTTP/2 over TLS does not use the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> mechanism, and cleartext HTTP/2 uses the ‘h2c’ token instead, so “Upgrade: h2” is wrong.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7540#section-3">RFC 7540 § 3</a></cite>.</p> </div> <div class="notice error" id="1230"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1230</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1" title="RFC 7540 § 3.2.1">HTTP2-Settings</a></span> needs “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span>: http2-settings”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1">RFC 7540 § 3.2.1</a></cite>: <q>Since the upgrade is only intended to apply to the immediate connection, a client sending the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1" title="RFC 7540 § 3.2.1">HTTP2-Settings</a></span> header field MUST also send &quot;HTTP2-Settings&quot; as a connection option in the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.1" title="RFC 7230 § 6.1">Connection</a></span> header field to prevent it from being forwarded</q></p> </div> <div class="notice error" id="1231"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1231</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span>: h2c needs <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1" title="RFC 7540 § 3.2.1">HTTP2-Settings</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1">RFC 7540 § 3.2.1</a></cite>: <q>A request that upgrades from HTTP/1.1 to HTTP/2 MUST include exactly one &quot;HTTP2-Settings&quot; header field.</q></p> </div> <div class="notice error" id="1232"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1232</span> <span>Upgrading to HTTP/2 despite bad <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1" title="RFC 7540 § 3.2.1">HTTP2-Settings</a></span></span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1">RFC 7540 § 3.2.1</a></cite>, the server must not upgrade to HTTP/2 unless the request has exactly one valid <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1" title="RFC 7540 § 3.2.1">HTTP2-Settings</a></span> header.</p> <span data-ref-to="251"></span> <span data-ref-to="252"></span> </div> <div class="notice error" id="1233"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1233</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span>: h2c can’t be used on a TLS connection</span> </h3> <p>An “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span>: h2c” header is used to switch to HTTP/2 from a cleartext HTTP/1.1 connection. But this message was sent on an encrypted (TLS) connection. HTTP/2 over TLS is negotiated by other means.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7540#section-3">RFC 7540 § 3</a></cite>.</p> </div> <div class="notice error" id="1234"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1234</span> <span>Malformed <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1" title="RFC 7540 § 3.2.1">HTTP2-Settings</a></span></span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1">RFC 7540 § 3.2.1</a></cite>, the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-3.2.1" title="RFC 7540 § 3.2.1">HTTP2-Settings</a></span> header must use the URL- and filename-safe Base64 encoding without padding. This means that it can only contain letters, digits, dash (-), and underscore (_).</p> </div> <div class="notice comment" id="1235"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1235</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.4" title="RFC 7231 § 7.1.4">Vary</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-5.4" title="RFC 7230 § 5.4">Host</a></span> is useless</span> </h3> <p>There is no need to include <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-5.4" title="RFC 7230 § 5.4">Host</a></span> in the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.4" title="RFC 7231 § 7.1.4">Vary</a></span> header, because Host is part of the request URI, and therefore, every HTTP response implicitly varies by Host already. “Vary: Host” can only scare caches away from storing the response.</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7231#section-7.1.4">RFC 7231 § 7.1.4</a></cite> and <cite><a href="https://tools.ietf.org/html/rfc7234#section-2">RFC 7234 § 2</a></cite>.</p> </div> <div class="notice debug" id="1236"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1236</span> <span>Absolute URI implies request to proxy</span> </h3> <p>This request’s target is an absolute URI. According to <cite><a href="https://tools.ietf.org/html/rfc7230#section-5.3">RFC 7230 § 5.3</a></cite>, HTTP/1.1 clients only use this “absolute form” when connecting to proxies. Therefore, HTTPolice assumes that this request is to a proxy.</p> <span data-ref-to="253"></span> <span data-ref-to="254"></span> </div> <div class="notice error" id="1237"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1237</span> <span>Response to a direct request can’t be transformed by a proxy</span> </h3> <p>It seems like this response was transformed by a proxy, but the request was not directed to a proxy.</p> </div> <div class="notice comment" id="1238"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1238</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to="255"><var>directive1</var></span> has no effect with <span data-ref-to="256"><var>directive2</var></span></span> </h3> <p>This response’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span> header includes both the <span data-ref-to="257"><var>directive1</var></span> and the <span data-ref-to="258"><var>directive2</var></span> directives. But <span data-ref-to="259"><var>directive1</var></span> makes no difference when <span data-ref-to="260"><var>directive2</var></span> is present.</p> </div> <div class="notice error" id="1239"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1239</span> <span>Response to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span> can’t have a body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2">RFC 7231 § 4.3.2</a></cite>: <q>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.2" title="RFC 7231 § 4.3.2">HEAD</a></span> method is identical to <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1" title="RFC 7231 § 4.3.1">GET</a></span> except that the server MUST NOT send a message body in the response</q></p> <span data-ref-to="261"></span> </div> <div class="notice error" id="1240"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1240</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.5" title="No Content (RFC 7231 § 6.3.5)">204</a></span> response can’t have a body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.3.5">RFC 7231 § 6.3.5</a></cite>: <q>The 204 (No Content) status code indicates that the server has successfully fulfilled the request and that there is no additional content to send in the response payload body.</q></p> <span data-ref-to="262"></span> </div> <div class="notice error" id="1241"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1241</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> + <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> is in the future</span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> header is the date and time when the response was originated. And the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> header is how long the response has been cached since then (or since it was revalidated). But in this response, the sum of <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> + <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> is in the future, so one of them must be wrong.</p> <p>This can happen when a cache mistakenly changes the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.2" title="RFC 7231 § 7.1.1.2">Date</a></span> header, or adds an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.1" title="RFC 7234 § 5.1">Age</a></span> header even though it is not a true HTTP cache (according to <cite><a href="https://tools.ietf.org/html/rfc7234">RFC 7234</a></cite>).</p> <p>Also, this error can be caused by wrong timezone settings.</p> </div> <div class="notice comment" id="1242"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1242</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7725#section-3" title="Unavailable For Legal Reasons (RFC 7725 § 3)">451</a></span> response should include an explanation</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7725#section-3">RFC 7725 § 3</a></cite>: <q>Responses using this status code SHOULD include an explanation, in the response body, of the details of the legal demand: the party making it, the applicable legislation or regulation, and what classes of person and resource it applies to.</q></p> </div> <div class="notice comment" id="1243"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1243</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7725#section-3" title="Unavailable For Legal Reasons (RFC 7725 § 3)">451</a></span> response should have a ‘blocked-by’ link</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7725#section-4">RFC 7725 § 4</a></cite>: <q>When an entity blocks access to a resource and returns status 451, it SHOULD include a &quot;<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc8288#section-3" title="RFC 8288 § 3">Link</a></span>&quot; HTTP header field [RFC5988] whose value is a URI reference [RFC3986] identifying itself. When used for this purpose, the &quot;Link&quot; header field MUST have a &quot;rel&quot; parameter whose value is &quot;blocked-by&quot;.</q></p> </div> <div class="notice error" id="1244"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1244</span> <span><span data-ref-to="263"><var>header</var></span> header can’t be used in HTTP/2</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7540#section-8.1.2.2">RFC 7540 § 8.1.2.2</a></cite>: <q>An endpoint MUST NOT generate an HTTP/2 message containing connection-specific header fields</q></p> <p><cite><a href="https://tools.ietf.org/html/rfc7540#section-8.1.2.2">RFC 7540 § 8.1.2.2</a></cite>: <q>The only exception to this is the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-4.3" title="RFC 7230 § 4.3">TE</a></span> header field, which MAY be present in an HTTP/2 request; when it is, it MUST NOT contain any value other than &quot;trailers&quot;.</q></p> <span data-ref-to="264"></span> </div> <div class="notice error" id="1245"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1245</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> header can’t be used in HTTP/2</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7540#section-8.1.2.2">RFC 7540 § 8.1.2.2</a></cite>: <q>HTTP/2 purposefully does not support upgrade to another protocol.</q></p> <span data-ref-to="265"></span> </div> <div class="notice error" id="1246"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1246</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.2" title="Switching Protocols (RFC 7231 § 6.2.2)">101</a></span> response can’t be used in HTTP/2</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7540#section-8.1.1">RFC 7540 § 8.1.1</a></cite>: <q>HTTP/2 removes support for the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.2" title="Switching Protocols (RFC 7231 § 6.2.2)">101</a></span> (Switching Protocols) informational status code</q></p> <span data-ref-to="266"></span> </div> <div class="notice error" id="1247"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1247</span> <span>Duplicate ‘<span data-ref-to="267"><var>param</var></span>’ parameter in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6266#section-4" title="RFC 6266 § 4">Content-Disposition</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6266#section-4.1">RFC 6266 § 4.1</a></cite>: <q>Content-Disposition header field values with multiple instances of the same parameter name are invalid.</q></p> </div> <div class="notice comment" id="1248"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1248</span> <span>Percent-encoded filename in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6266#section-4" title="RFC 6266 § 4">Content-Disposition</a></span> may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6266#appendix-D">RFC 6266 appendix D</a></cite>: <q>Avoid including the percent character followed by two hexadecimal characters (e.g., %A9) in the filename parameter, since some existing implementations consider it to be an escape character, while others will pass it through unchanged.</q></p> <p>Such a filename can be sent in the special ‘filename*’ parameter instead. See <cite><a href="https://tools.ietf.org/html/rfc6266#section-4.3">RFC 6266 § 4.3</a></cite>.</p> </div> <div class="notice comment" id="1249"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1249</span> <span>Backslash in filename in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6266#section-4" title="RFC 6266 § 4">Content-Disposition</a></span> may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6266#appendix-D">RFC 6266 appendix D</a></cite>: <q>Avoid including the &quot;\&quot; character in the quoted-string form of the filename parameter, as escaping is not implemented by some user agents, and &quot;\&quot; can be considered an illegal path character.</q></p> <p>Such a filename can be sent in the special ‘filename*’ parameter instead. See <cite><a href="https://tools.ietf.org/html/rfc6266#section-4.3">RFC 6266 § 4.3</a></cite>.</p> </div> <div class="notice comment" id="1250"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1250</span> <span>Non-ASCII filename in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6266#section-4" title="RFC 6266 § 4">Content-Disposition</a></span> may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6266#appendix-D">RFC 6266 appendix D</a></cite>: <q>Avoid using non-ASCII characters in the filename parameter. Although most existing implementations will decode them as ISO-8859-1, some will apply heuristics to detect UTF-8, and thus might fail on certain names.</q></p> <p>Such a filename can be sent in the special ‘filename*’ parameter instead. See <cite><a href="https://tools.ietf.org/html/rfc6266#section-4.3">RFC 6266 § 4.3</a></cite>.</p> </div> <div class="notice comment" id="1251"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1251</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6266#section-4" title="RFC 6266 § 4">Content-Disposition</a></span>: ‘filename*’ should also have ‘filename’ as fallback</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6266#appendix-D">RFC 6266 appendix D</a></cite>: <q>When a &quot;filename*&quot; parameter is sent, to also generate a &quot;filename&quot; parameter as a fallback for user agents that do not support the &quot;filename*&quot; form, if possible.</q></p> </div> <div class="notice comment" id="1252"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1252</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6266#section-4" title="RFC 6266 § 4">Content-Disposition</a></span>: ‘filename*’ should come after ‘filename’</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6266#appendix-D">RFC 6266 appendix D</a></cite>: <q>When a &quot;filename&quot; parameter is included as a fallback (as per above), &quot;filename&quot; should occur first, due to parsing problems in some existing implementations.</q></p> </div> <div class="notice error" id="1253"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1253</span> <span>Bad charset ‘<span data-ref-to="268"><var>charset</var></span>’ in <span data-ref-to="269"><var>place</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc8187#section-3.2.1">RFC 8187 § 3.2.1</a></cite>: <q>Producers MUST use the &quot;UTF-8&quot; ([RFC3629]) character encoding. Extension character encodings (mime-charset) are reserved for future use.</q></p> </div> <div class="notice error" id="1254"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1254</span> <span>Bad <span data-ref-to="270"><var>charset</var></span> value in <span data-ref-to="271"><var>place</var></span></span> </h3> <p>This message’s <span data-ref-to="272"><var>place</var></span> contains a <span data-ref-to="273"><var>charset</var></span> encoded value in the form defined by <cite><a href="https://tools.ietf.org/html/rfc8187">RFC 8187</a></cite>. But HTTPolice tried to decode it from <span data-ref-to="274"><var>charset</var></span> and got the following error:</p> <p><var>error</var></p> </div> <div class="notice error" id="1256"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1256</span> <span>Bad encoding of protocol ID in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7838#section-3" title="RFC 7838 § 3">Alt-Svc</a></span></span> </h3> <p>This message’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7838#section-3" title="RFC 7838 § 3">Alt-Svc</a></span> contains a protocol ID encoded as “<span data-ref-to="275"><var>actual</var></span>”. But according to <cite><a href="https://tools.ietf.org/html/rfc7838#section-3">RFC 7838 § 3</a></cite>, it must be encoded as “<span data-ref-to="276"><var>correct</var></span>”.</p> </div> <div class="notice error" id="1257"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1257</span> <span>Malformed authority in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7838#section-3" title="RFC 7838 § 3">Alt-Svc</a></span></span> </h3> <p>“<span data-ref-to="277"><var>authority</var></span>” is not a valid <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7838#section-3" title="RFC 7838 § 3">Alt-Svc</a></span> authority, according to <cite><a href="https://tools.ietf.org/html/rfc7838#section-3">RFC 7838 § 3</a></cite>.</p> <p><var>error</var></p> </div> <div class="notice comment" id="1258"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1258</span> <span>HTTP/2 should use ALTSVC frame instead of <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7838#section-3" title="RFC 7838 § 3">Alt-Svc</a></span> header</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7838#section-3">RFC 7838 § 3</a></cite> recommends using ALTSVC frames instead of the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7838#section-3" title="RFC 7838 § 3">Alt-Svc</a></span> header on HTTP/2 connections.</p> <span data-ref-to="278"></span> </div> <div class="notice error" id="1260"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1260</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-9.1.2" title="Misdirected Request (RFC 7540 § 9.1.2)">421</a></span> response can’t have <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7838#section-3" title="RFC 7838 § 3">Alt-Svc</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7838#section-6">RFC 7838 § 6</a></cite>: <q>An <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7838#section-3" title="RFC 7838 § 3">Alt-Svc</a></span> header field in a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-9.1.2" title="Misdirected Request (RFC 7540 § 9.1.2)">421</a></span> (Misdirected Request) response MUST be ignored.</q></p> </div> <div class="notice error" id="1261"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1261</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.2" title="RFC 7235 § 4.2">Authorization</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6750" title="RFC 6750">Bearer</a></span> requires TLS</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6750#section-5.3">RFC 6750 § 5.3</a></cite>: <q>Clients MUST always use TLS [RFC5246] (https) or equivalent transport security when making requests with bearer tokens. Failing to do so exposes the token to numerous attacks that could give attackers unintended access.</q></p> </div> <div class="notice error" id="1262"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1262</span> <span>Malformed <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.2" title="RFC 7235 § 4.2">Authorization</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6750" title="RFC 6750">Bearer</a></span></span> </h3> <p>In the Bearer authentication scheme, credentials are sent as a single token. See <cite><a href="https://tools.ietf.org/html/rfc6750#section-2.1">RFC 6750 § 2.1</a></cite>.</p> </div> <div class="notice error" id="1263"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1263</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.1" title="RFC 7235 § 4.1">WWW-Authenticate</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6750" title="RFC 6750">Bearer</a></span> requires TLS</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc6750#section-5.3">RFC 6750 § 5.3</a></cite>, bearer tokens must not be used without TLS. Instead of prompting the client to send a token on an insecure connection, perhaps it would be better to redirect to an ‘https:’ URI first.</p> </div> <div class="notice error" id="1264"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1264</span> <span>Malformed <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.1" title="RFC 7235 § 4.1">WWW-Authenticate</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6750" title="RFC 6750">Bearer</a></span></span> </h3> <p>A Bearer authentication challenge must have “key=value” parameters. See <cite><a href="https://tools.ietf.org/html/rfc6750#section-3">RFC 6750 § 3</a></cite>.</p> </div> <div class="notice error" id="1265"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1265</span> <span>Duplicate ‘<span data-ref-to="279"><var>param</var></span>’ parameter in “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.1" title="RFC 7235 § 4.1">WWW-Authenticate</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6750" title="RFC 6750">Bearer</a></span>”</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc6750#section-3">RFC 6750 § 3</a></cite>, the ‘<span data-ref-to="280"><var>param</var></span>’ parameter must not appear more than once.</p> </div> <div class="notice error" id="1266"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1266</span> <span>Malformed ‘<span data-ref-to="281"><var>param</var></span>’ parameter in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.1" title="RFC 7235 § 4.1">WWW-Authenticate</a></span></span> </h3> <p>“<span data-ref-to="282"><var>value</var></span>” is not a correct value for a ‘<span data-ref-to="283"><var>param</var></span>’ parameter in a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6750" title="RFC 6750">Bearer</a></span> challenge. See <cite><a href="https://tools.ietf.org/html/rfc6750#section-3">RFC 6750 § 3</a></cite>.</p> <p><var>error</var></p> </div> <div class="notice comment" id="1267"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1267</span> <span>Declined a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6750" title="RFC 6750">Bearer</a></span> token, but no ‘error’ parameter</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6750#section-3">RFC 6750 § 3</a></cite>: <q>If the protected resource request included an access token and failed authentication, the resource server SHOULD include the &quot;error&quot; attribute to provide the client with the reason why the access request was declined.</q></p> <span data-ref-to="284"></span> <span data-ref-to="285"></span> <span data-ref-to="285"></span> </div> <div class="notice comment" id="1268"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1268</span> <span>Response with “error=<span data-ref-to="286"><var>error_code</var></span>” should be <span data-ref-to="287"><var>expected_status</var></span></span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc6750#section-3.1">RFC 6750 § 3.1</a></cite>, when the server’s <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6750" title="RFC 6750">Bearer</a></span> challenge has “error=<span data-ref-to="288"><var>error_code</var></span>”, the status code should be <span data-ref-to="289"><var>expected_status</var></span>.</p> <span data-ref-to="290"></span> <span data-ref-to="290"></span> </div> <div class="notice comment" id="1269"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1269</span> <span>Unneeded ‘<span data-ref-to="291"><var>param</var></span>’ in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7235#section-4.1" title="RFC 7235 § 4.1">WWW-Authenticate</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc6750#section-3.1">RFC 6750 § 3.1</a></cite>: <q>If the request lacks any authentication information (e.g., the client was unaware that authentication is necessary or attempted using an unsupported authentication method), the resource server SHOULD NOT include an error code or other error information.</q></p> </div> <div class="notice comment" id="1270"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1270</span> <span>Access token in URI is insecure</span> </h3> <p>The query string of this request’s URI contains an ‘access_token’ parameter. It’s probably a bearer token, as defined in <cite><a href="https://tools.ietf.org/html/rfc6750">RFC 6750</a></cite>.</p> <p><cite><a href="https://tools.ietf.org/html/rfc6750#section-5.3">RFC 6750 § 5.3</a></cite>: <q>Bearer tokens SHOULD NOT be passed in page URLs (for example, as query string parameters). Instead, bearer tokens SHOULD be passed in HTTP message headers or message bodies for which confidentiality measures are taken. Browsers, web servers, and other software may not adequately secure URLs in the browser history, web server logs, and other data structures. If bearer tokens are passed in page URLs, attackers might be able to steal them from the history data, logs, or other unsecured locations.</q></p> <span data-ref-to="292"></span> </div> <div class="notice comment" id="1271"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1271</span> <span>Access token may need TLS</span> </h3> <p>This request has an ‘access_token’ parameter. It’s probably a bearer token, as defined in <cite><a href="https://tools.ietf.org/html/rfc6750">RFC 6750</a></cite>.</p> <p><cite><a href="https://tools.ietf.org/html/rfc6750#section-5.3">RFC 6750 § 5.3</a></cite>: <q>Clients MUST always use TLS [RFC5246] (https) or equivalent transport security when making requests with bearer tokens. Failing to do so exposes the token to numerous attacks that could give attackers unintended access.</q></p> <span data-ref-to="293"></span> </div> <div class="notice comment" id="1272"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1272</span> <span>Access token in URI needs “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: no-store”</span> </h3> <p>According to <cite><a href="https://tools.ietf.org/html/rfc6750#section-2.3">RFC 6750 § 2.3</a></cite>, if an access token is sent in the request URI, then the request should at least have a “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: no-store” header. This reduces the risk of caches saving this token.</p> <span data-ref-to="294"></span> </div> <div class="notice error" id="1273"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1273</span> <span>Malformed <span data-ref-to="295"><var>header</var></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7617" title="RFC 7617">Basic</a></span></span> </h3> <p>A Basic authentication challenge must have parameters as “key=value” pairs. See <cite><a href="https://tools.ietf.org/html/rfc7617#section-2">RFC 7617 § 2</a></cite>.</p> </div> <div class="notice error" id="1274"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1274</span> <span><span data-ref-to="296"><var>header</var></span> header without credentials</span> </h3> <p>An <span data-ref-to="297"><var>header</var></span> header usually consists of two parts: the name of the authentication scheme, and the actual credentials. But in this request, it only contains the scheme (“<span data-ref-to="298"><var>item</var></span>”).</p> <p>Was something like “<span data-ref-to="299"><var>header</var></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc6750" title="RFC 6750">Bearer</a></span> <span data-ref-to="300"><var>item</var></span>” intended?</p> <p>See also <cite><a href="https://tools.ietf.org/html/rfc7235#section-2">RFC 7235 § 2</a></cite>.</p> </div> <div class="notice comment" id="1275"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1275</span> <span>Entity declarations in XML may cause problems</span> </h3> <p>This message’s XML content includes entity declarations (&lt;!ENTITY&gt;). Many XML applications do not process such declarations because they can lead to denial-of-service attacks.</p> <span data-ref-to="301"></span> </div> <div class="notice error" id="1276"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1276</span> <span><span data-ref-to="302"><var>header</var></span>: <span data-ref-to="303"><var>wildcard</var></span> is as good as <span data-ref-to="304"><var>value</var></span></span> </h3> <p>The <span data-ref-to="305"><var>header</var></span> header is not an ordered list. Whether <span data-ref-to="306"><var>wildcard</var></span> comes before or after <span data-ref-to="307"><var>value</var></span>, does not affect its priority. Only explicit quality values (q=) count.</p> <p>In other words, this request says that any <span data-ref-to="308"><var>wildcard</var></span> is as acceptable as <span data-ref-to="309"><var>value</var></span>.</p> <p>To make <span data-ref-to="310"><var>wildcard</var></span> a fallback, it should have a lower quality value, for example: <span data-ref-to="311"><var>wildcard</var></span>;q=0.1</p> <p>See <cite><a href="https://tools.ietf.org/html/rfc7231#section-5.3.1">RFC 7231 § 5.3.1</a></cite>.</p> </div> <div class="notice comment" id="1277"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1277</span> <span>Obsolete ‘X-’ prefix in headers</span> </h3> <p>Adding an ‘X-’ prefix to “experimental” headers is an old practice that is now considered obsolete. See <cite><a href="https://tools.ietf.org/html/rfc6648#section-3">RFC 6648 § 3</a></cite>.</p> <p>For custom headers that may be generally useful, it’s best to drop the ‘X-’ prefix (but check the <cite><a href="https://www.iana.org/assignments/message-headers/message-headers.xhtml">IANA message headers registry</a></cite> to avoid collisions with existing names).</p> <p>For private headers not intended to be used by others, ‘X-’ can be replaced with something like the organization’s name.</p> <span data-ref-to="312"></span> </div> <div class="notice comment" id="1278"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1278</span> <span>Missing reverse stream</span> </h3> <p>There is a stream file <span data-ref-to="313"><var>path</var></span>, but there is no corresponding stream file for the reverse direction. HTTPolice will try to process this file on its own.</p> </div> <div class="notice error" id="1279"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1279</span> <span>Unprocessable streams</span> </h3> <p>HTTPolice has found the following stream files:</p> <p>file 1: <span data-ref-to="314"><var>path1</var></span></p> <p>file 2: <span data-ref-to="315"><var>path2</var></span></p> <p>but cannot detect which of them is the inbound stream and which is the outbound.</p> <p>This means that the connection was not HTTP/1.x, or was encrypted, or that the files are somehow malformed. They will not be processed.</p> </div> <div class="notice comment" id="1280"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1280</span> <span>‘charset’ parameter is undefined for <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc8259" title="RFC 8259">application/json</a></span></span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc8259" title="RFC 8259">application/json</a></span> media type does not have a ‘charset’ parameter. <cite><a href="https://tools.ietf.org/html/rfc8259#section-11">RFC 8259 § 11</a></cite>: <q>Adding one really has no effect on compliant recipients.</q></p> <span data-ref-to="316"></span> <p>See also <cite><a href="https://tools.ietf.org/html/rfc8259#section-8.1">RFC 8259 § 8.1</a></cite>.</p> </div> <div class="notice error" id="1281"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1281</span> <span><span data-ref-to="317"><var>guessed_charset</var></span> is a bad encoding for JSON</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc8259#section-8.1">RFC 8259 § 8.1</a></cite>: <q>JSON text exchanged between systems that are not part of a closed ecosystem MUST be encoded using UTF-8</q></p> <span data-ref-to="318"></span> <span data-ref-to="319"></span> </div> <div class="notice error" id="1282"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1282</span> <span>Wrong media type <span data-ref-to="320"><var>bad</var></span> in <span data-ref-to="321"><var>place</var></span></span> </h3> <p>There is no such media type <span data-ref-to="322"><var>bad</var></span>. Probably <span data-ref-to="323"><var>good</var></span> was intended.</p> </div> <div class="notice comment" id="1283"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1283</span> <span>Cacheable <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-9.1.2" title="Misdirected Request (RFC 7540 § 9.1.2)">421</a></span> response may cause problems</span> </h3> <p><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7540#section-9.1.2" title="Misdirected Request (RFC 7540 § 9.1.2)">421</a></span> responses are defined as cacheable by default. However, because of how an HTTP cache works (<cite><a href="https://tools.ietf.org/html/rfc7234#section-2">RFC 7234 § 2</a></cite>), it is harmful to cache a 421 response, as it would be returned on subsequent requests to the same URI, without even trying to connect to the right server.</p> <p>To avoid this, a 421 response to <span data-ref-to="324"><var>method</var></span> should be marked as non-cacheable with a header like “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">no-store</a></span>”.</p> <p>See <cite><a href="https://www.rfc-editor.org/errata_search.php?eid=4666">RFC 7540 errata</a></cite>.</p> </div> <div class="notice comment" id="1284"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1284</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.3.3" title="Accepted (RFC 7231 § 6.3.3)">202</a></span> response should have a body</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-6.3.3">RFC 7231 § 6.3.3</a></cite>: <q>The representation sent with this response ought to describe the request's current status and point to (or embed) a status monitor that can provide the user with an estimate of when the request will be fulfilled.</q></p> </div> <div class="notice comment" id="1285"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1285</span> <span>Duplicate ‘<span data-ref-to="325"><var>name</var></span>’ token in <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-2" title="RFC 7240 § 2">Prefer</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7240#section-2">RFC 7240 § 2</a></cite>: <q>To avoid any possible ambiguity, individual preference tokens SHOULD NOT appear multiple times within a single request.</q></p> </div> <div class="notice error" id="1286"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1286</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-3" title="RFC 7240 § 3">Preference-Applied</a></span>: <span data-ref-to="326"><var>name</var></span><span data-ref-to="326"><var>value</var></span> was not requested</span> </h3> <p>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-3" title="RFC 7240 § 3">Preference-Applied</a></span>: <span data-ref-to="327"><var>name</var></span><span data-ref-to="327"><var>value</var></span>” means that the server honored the client’s preference <span data-ref-to="328"><var>name</var></span><span data-ref-to="328"><var>value</var></span>. But the client did not request <span data-ref-to="329"><var>name</var></span><span data-ref-to="329"><var>value</var></span> in its <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-2" title="RFC 7240 § 2">Prefer</a></span> header.</p> <span data-ref-to="330"></span> </div> <div class="notice error" id="1287"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1287</span> <span><span data-ref-to="331"><var>method</var></span> request cannot <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-2" title="RFC 7240 § 2">Prefer</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-4.1" title="RFC 7240 § 4.1">respond-async</a></span></span> </h3> <p>The whole point of a <span data-ref-to="332"><var>method</var></span> request is to retrieve information from the server. It’s impossible to respond asynchronously to such a request: the response would not contain the requested information.</p> </div> <div class="notice error" id="1288"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1288</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1" title="RFC 7231 § 4.3.1">GET</a></span> request cannot <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-2" title="RFC 7240 § 2">Prefer</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-4.2" title="RFC 7240 § 4.2">return</a></span>=minimal</span> </h3> <p>The whole point of a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.1" title="RFC 7231 § 4.3.1">GET</a></span> request is to retrieve a representation of the resource (as in “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-4.2" title="RFC 7240 § 4.2">return</a></span>=representation”). There is no “minimal” response that could satisfy this request.</p> <p>Instead, the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.3.2" title="RFC 7231 § 5.3.2">Accept</a></span> header could be used to select the desired kind of representation.</p> </div> <div class="notice error" id="1289"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1289</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-2" title="RFC 7240 § 2">Prefer</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-4.2" title="RFC 7240 § 4.2">return</a></span>=minimal contradicts <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-4.2" title="RFC 7240 § 4.2">return</a></span>=representation</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7240#section-4.2">RFC 7240 § 4.2</a></cite>: <q>The &quot;return=minimal&quot; and &quot;return=representation&quot; preferences are mutually exclusive directives.</q></p> </div> <div class="notice error" id="1290"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1290</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-2" title="RFC 7240 § 2">Prefer</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-4.4" title="RFC 7240 § 4.4">handling</a></span>=strict contradicts <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-4.4" title="RFC 7240 § 4.4">handling</a></span>=lenient</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7240#section-4.4">RFC 7240 § 4.4</a></cite>: <q>The &quot;handling=strict&quot; and &quot;handling=lenient&quot; preferences are mutually exclusive directives.</q></p> </div> <div class="notice comment" id="1291"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1291</span> <span>Response with <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-3" title="RFC 7240 § 3">Preference-Applied</a></span> may need “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.4" title="RFC 7231 § 7.1.4">Vary</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-2" title="RFC 7240 § 2">Prefer</a></span>”</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7240#section-2">RFC 7240 § 2</a></cite>: <q>If a server supports the optional application of a preference that might result in a variance to a cache's handling of a response entity, a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.1.4" title="RFC 7231 § 7.1.4">Vary</a></span> header field MUST be included in the response listing the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7240#section-2" title="RFC 7240 § 2">Prefer</a></span> header field</q></p> <span data-ref-to="333"></span> </div> <div class="notice error" id="1292"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1292</span> <span>Invalid method ‘<span data-ref-to="334"><var>method</var></span>’</span> </h3> <p><var>error</var></p> </div> <div class="notice error" id="1293"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1293</span> <span>Invalid field name ‘<span data-ref-to="335"><var>header</var></span>’</span> </h3> <p><var>error</var></p> </div> <div class="notice error" id="1294"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1294</span> <span>Syntax error in reason phrase</span> </h3> <p><var>error</var></p> <span data-ref-to="336"></span> </div> <div class="notice error" id="1295"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1295</span> <span>Method ‘<span data-ref-to="337"><var>method</var></span>’ should probably be ‘<span data-ref-to="338"><var>uppercase</var></span>’</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-4.1">RFC 7231 § 4.1</a></cite>: <q>The method token is case-sensitive</q></p> </div> <div class="notice error" id="1296"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1296</span> <span>Duplicate ‘<span data-ref-to="339"><var>param</var></span>’ parameter in <span data-ref-to="340"><var>entry</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7239#section-4">RFC 7239 § 4</a></cite>: <q>Each parameter MUST NOT occur more than once per field-value.</q></p> </div> <div class="notice comment" id="1297"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1297</span> <span>Possibly bad syntax in <span data-ref-to="341"><var>entry</var></span></span> </h3> <p>The <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7239#section-4" title="RFC 7239 § 4">Forwarded</a></span> header here contains <span data-ref-to="342"><var>n_elements</var></span> elements, describing <span data-ref-to="343"><var>n_elements</var></span> proxy hops, with only one parameter for each proxy — yet all parameters have different names.</p> <p>If this was intended to be <span data-ref-to="344"><var>n_elements</var></span> parameters for a single proxy hop, then the pairs must be separated with semicolons, not commas.</p> </div> <div class="notice debug" id="1298"> <h3> <abbr class="severity" title="debug">D</abbr> <span class="ident">1298</span> <span>Body is too long to be checked</span> </h3> <p>This message’s <span data-ref-to="345"><var>place</var></span> indicates that the body is at least <span data-ref-to="346"><var>size</var></span> bytes long. HTTPolice does not attempt to process bodies longer than <span data-ref-to="347"><var>max_size</var></span> bytes. The rest of the stream will not be processed either.</p> </div> <div class="notice comment" id="1299"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1299</span> <span>Quoted comma in <span data-ref-to="348"><var>entry</var></span> might confuse a naive parser</span> </h3> <p>This message’s <span data-ref-to="349"><var>entry</var></span> header contains a comma inside a quoted string. But experience shows that headers like <span data-ref-to="350"><var>entry</var></span> are often parsed without regard for quoted strings—such a naive parser might interpret this comma as a separator between <span data-ref-to="351"><var>entry</var></span> elements. If possible, avoiding this comma might help interoperability.</p> </div> <div class="notice comment" id="1300"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1300</span> <span>Quoted semicolon in <span data-ref-to="352"><var>entry</var></span> might confuse a naive parser</span> </h3> <p>This message’s <span data-ref-to="353"><var>entry</var></span> header contains a semicolon inside a quoted string. But experience shows that headers like <span data-ref-to="354"><var>entry</var></span> are often parsed without regard for quoted strings—such a naive parser might interpret this semicolon as a separator between <span data-ref-to="355"><var>entry</var></span> parameters. If possible, avoiding this semicolon might help interoperability.</p> </div> <div class="notice comment" id="1301"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1301</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc8246" title="RFC 8246">immutable</a></span> probably needs <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">max-age</a></span></span> </h3> <p>“<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc8246" title="RFC 8246">immutable</a></span>” is typically only useful with a large <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">max-age</a></span> or an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.3" title="RFC 7234 § 5.3">Expires</a></span> far in the future, because immutable applies only for as long as the response is considered fresh. Without explicit max-age or Expires, most caches will consider this response fresh only for a brief period or not at all.</p> </div> <div class="notice comment" id="1302"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1302</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc8246" title="RFC 8246">immutable</a></span> may be ignored without TLS</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc8246">RFC 8246</a></cite>: <q>Clients SHOULD ignore the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc8246" title="RFC 8246">immutable</a></span> extension from resources that are not part of an authenticated context such as HTTPS.</q></p> </div> <div class="notice comment" id="1303"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1303</span> <span><span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7234#section-5.2" title="RFC 7234 § 5.2">Cache-Control</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc8246" title="RFC 8246">immutable</a></span> may be ignored without response length</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc8246">RFC 8246</a></cite>: <q>Clients SHOULD ignore the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc8246" title="RFC 8246">immutable</a></span> extension for resources that do not provide a strong indication that the stored response size is the correct response size such as responses delimited by connection close.</q></p> </div> <div class="notice error" id="1304"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1304</span> <span><span data-ref-to="356"><var>status</var></span> response after <span data-ref-to="357"><var>status</var></span></span> </h3> <p>It appears like this <span data-ref-to="358"><var>status</var></span> response was preceded by a <span data-ref-to="359"><var>status</var></span> response to the same request. But a <span data-ref-to="360"><var>status</var></span> response can only be the final response to a request. See also <cite><a href="https://tools.ietf.org/html/rfc7231#section-6.2">RFC 7231 § 6.2</a></cite>.</p> <p>This is more likely to be a bug in your HTTPolice integration than in the actual HTTP traffic being inspected. For example, responses to different requests may have been mixed up somehow.</p> </div> <div class="notice error" id="1305"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1305</span> <span>Expected <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.1" title="Continue (RFC 7231 § 6.2.1)">100</a></span> (Continue) before switching protocols</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7230#section-6.7">RFC 7230 § 6.7</a></cite>: <q>If a server receives both an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-6.7" title="RFC 7230 § 6.7">Upgrade</a></span> and an <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-5.1.1" title="RFC 7231 § 5.1.1">Expect</a></span> header field with the &quot;100-continue&quot; expectation (Section 5.1.1 of [RFC7231]), the server MUST send a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.1" title="Continue (RFC 7231 § 6.2.1)">100</a></span> (Continue) response before sending a <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-6.2.2" title="Switching Protocols (RFC 7231 § 6.2.2)">101</a></span> (Switching Protocols) response.</q></p> <span data-ref-to="361"></span> </div> <div class="notice error" id="1306"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1306</span> <span>Response to <span data-ref-to="362"><var>version</var></span> can’t have <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7230#section-3.3.1" title="RFC 7230 § 3.3.1">Transfer-Encoding</a></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc7231#section-3.3.1">RFC 7231 § 3.3.1</a></cite>: <q>A server MUST NOT send a response containing Transfer-Encoding unless the corresponding request indicates HTTP/1.1 (or later).</q></p> </div> <div class="notice comment" id="1307"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1307</span> <span>Unquoted ‘title’ parameter in <span data-ref-to="363"><var>place</var></span> may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc8288#section-3">RFC 8288 § 3</a></cite>: <q>Previous definitions of the Link header did not equate the token and quoted-string forms explicitly; the title parameter was always quoted, and the hreflang parameter was always a token. Senders wishing to maximize interoperability will send them in those forms.</q></p> </div> <div class="notice comment" id="1308"> <h3> <abbr class="severity" title="comment">C</abbr> <span class="ident">1308</span> <span>Quoted ‘hreflang’ parameter in <span data-ref-to="364"><var>place</var></span> may cause problems</span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc8288#section-3">RFC 8288 § 3</a></cite>: <q>Previous definitions of the Link header did not equate the token and quoted-string forms explicitly; the title parameter was always quoted, and the hreflang parameter was always a token. Senders wishing to maximize interoperability will send them in those forms.</q></p> </div> <div class="notice error" id="1309"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1309</span> <span>Missing ‘rel’ parameter in <span data-ref-to="365"><var>place</var></span></span> </h3> <p><cite><a href="https://tools.ietf.org/html/rfc8288#section-3.3">RFC 8288 § 3.3</a></cite>: <q>The rel parameter MUST be present</q></p> </div> <div class="notice error" id="1310"> <h3> <abbr class="severity" title="error">E</abbr> <span class="ident">1310</span> <span><span data-ref-to=""><a href="https://www.w3.org/TR/ldp/#header-accept-post" title="W3C Linked Data Platform 1.0">Accept-Post</a></span> implies “<span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span>: <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.3" title="RFC 7231 § 4.3.3">POST</a></span>”</span> </h3> <p>This response’s <span data-ref-to=""><a href="https://www.w3.org/TR/ldp/#header-accept-post" title="W3C Linked Data Platform 1.0">Accept-Post</a></span> header means that this resource supports the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-4.3.3" title="RFC 7231 § 4.3.3">POST</a></span> method, but it’s missing from the <span data-ref-to=""><a href="https://tools.ietf.org/html/rfc7231#section-7.4.1" title="RFC 7231 § 7.4.1">Allow</a></span> header.</p> </div> </body> </html>
decal/werdlists
http-servers/httpolice-notices-list.html
HTML
apache-2.0
242,771
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 2516, 1028, 8299, 23518, 2063, 14444, 1026, 1013, 2516, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module Main where import Control.Monad import System.Exit (exitFailure) import System.Environment import L2.AbsL import L2.ParL import L2.ErrM import Liveness.Liveness main :: IO () main = do args <- getArgs when (length args /= 1) $ do putStrLn "usage: filename" exitFailure ts <- liftM myLexer $ readFile (head args) case pParenListInstruction ts of Bad s -> do putStrLn "\nParse Failed...\n" putStrLn "Tokens:" print ts putStrLn s Ok (PLI is) -> putStrLn . displayLiveArray . liveness $ is
mhuesch/scheme_compiler
src/Liveness/Main.hs
Haskell
bsd-3-clause
585
[ 30522, 11336, 2364, 2073, 12324, 2491, 1012, 13813, 2094, 12324, 2291, 1012, 6164, 1006, 6164, 7011, 4014, 5397, 1007, 12324, 2291, 1012, 4044, 12324, 1048, 2475, 1012, 14689, 2140, 12324, 1048, 2475, 1012, 11968, 2140, 12324, 1048, 2475, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace App\Models; use Fwartner\Katching\Cacheable; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Comment extends Model { use Cacheable, SoftDeletes; protected $table = 'comments'; protected $fillable = [ 'content', 'is_spam', 'user_id', 'thread_id' ]; protected $casts = [ 'is_spam' => 'boolean' ]; public function owner() { return $this->belongsTo(User::class, 'user_id'); } public function forum() { return $this->belongsTo(Forum::class, 'forum_id'); } public function thread() { return $this->belongsTo(Thread::class, 'thread_id'); } }
LaravelHamburg/laravel-hamburg.com
app/Models/Comment.php
PHP
mit
729
[ 30522, 1026, 1029, 25718, 3415, 15327, 10439, 1032, 4275, 1025, 2224, 1042, 18367, 3678, 1032, 10645, 8450, 1032, 17053, 3085, 1025, 2224, 5665, 12717, 12556, 1032, 7809, 1032, 3449, 2080, 15417, 1032, 2944, 1025, 2224, 5665, 12717, 12556, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML> <html> <head> <meta charset=utf-8> <title>CSS Test: localized font-family name and fallbacks</title> <link rel="author" title="Takuya Oikawa" href="mailto:takoratta@gmail.com"/> <link rel="help" href="https://drafts.csswg.org/css-fonts/" /> <link rel="help" href="https://drafts.csswg.org/css-fonts/#font-family-prop"/> <!-- (from the spec) Some font formats allow fonts to carry multiple localizations of the family name. User agents must recognize and correctly match all of these names independent of the underlying platform localization, system API used or document encoding: --> <style type="text/css"> p { color: navy; font-size: 4em; margin: 0.25em; } .a span.test { font-family: "無いフォント", "Times New Roman"; } .a span.control { font-family: "Times New Roman"; } .b span.test { font-family: "無いフォント", "Arial"; } .b span.control { font-family: "Arial"; } .c span.test { font-family: "無いフォント", "Courier New"; } .c span.control { font-family: "Courier New"; } </style> </head> <body> <div>In each of the three lines below, the two words should look identical.</div> <p class="a"> <span class="test">&#x0162;&#x0119;&#x015F;&#x0163;</span> &mdash; <span class="control">&#x0162;&#x0119;&#x015F;&#x0163;</span> </p> <p class="b"> <span class="test">&#x0162;&#x0119;&#x015F;&#x0163;</span> &mdash; <span class="control">&#x0162;&#x0119;&#x015F;&#x0163;</span> </p> <p class="c"> <span class="test">&#x0162;&#x0119;&#x015F;&#x0163;</span> &mdash; <span class="control">&#x0162;&#x0119;&#x015F;&#x0163;</span> </p> </body> </html>
nox/servo
tests/wpt/web-platform-tests/css/work-in-progress/ttwf_tokyo/takuya/font-family-fallback18n-ref.html
HTML
mpl-2.0
1,663
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 21183, 2546, 1011, 1022, 1028, 1026, 2516, 1028, 20116, 2015, 3231, 1024, 22574, 15489, 1011, 2155, 2171, 1998, 2991, 12221, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package commandTests; import static org.junit.Assert.*; import model.Arg; import model.EnvironmentVariables; import model.State; import org.junit.Test; import commands.EvalCommands.Random; public class RandomTest { private Random r; private double exampleRandom; public RandomTest() { r = new Random(new State(new EnvironmentVariables())); } @Test public void testSum() { assertNotNull(r); } @Test public void testGetResult() { r = new Random(new State(new EnvironmentVariables())); r.addArg(new Arg(2)); assertTrue(r.doCommand()<2); r = new Random(new State(new EnvironmentVariables())); r.addArg(new Arg(50)); assertTrue(r.doCommand()<50); r = new Random(new State(new EnvironmentVariables())); r.addArg(new Arg(1)); assertTrue(r.doCommand()<1); } @Test public void testGetArgNum() { assertEquals(1, r.getArgNum()); } }
Jiaran/Slogo
src/commandTests/RandomTest.java
Java
mit
873
[ 30522, 7427, 3094, 22199, 2015, 1025, 12324, 10763, 8917, 1012, 12022, 4183, 1012, 20865, 1012, 1008, 1025, 12324, 2944, 1012, 12098, 30524, 1063, 2797, 6721, 1054, 1025, 2797, 3313, 2742, 13033, 5358, 1025, 2270, 6721, 22199, 1006, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
## Checking the version of Viblast Player that you're using Open the browser console and execute: ```javascript Viblast.version() ``` You should see a message similar to: ``` viblast|5.92.fc98e3ce|Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36 ``` The string before the first `|` is the name of the product. It's always `viblast`. The string between the two `|` is the `version` itself and the string after the second `|` is the browser version. You can read more about Viblast Player versions in our <a href="{% url 'vb-player:doc' article='release-history' %}">Release History</a> page. If you do not see a version, just some hash, for example: ``` viblast|7042ff8d|Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36 ``` Then you are using a legacy version of Viblast Player and should update. To update, use the download link in the e-mail we sent you announcing the release. If you have not received such an e-mail and have downloaded Viblast Player from our website, please [contact us]({% url 'vb-player:index' %}#contact).
kenmazhao/documentation
player/check-viblast-version.md
Markdown
mit
1,157
[ 30522, 1001, 1001, 9361, 1996, 2544, 1997, 6819, 28522, 3367, 2447, 2008, 2017, 1005, 2128, 2478, 2330, 1996, 16602, 10122, 1998, 15389, 1024, 1036, 1036, 1036, 9262, 22483, 6819, 28522, 3367, 1012, 2544, 1006, 1007, 1036, 1036, 1036, 2017,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
body { margin: 0; padding: 0; color: black; font-family: serif; } #specialform { display: inline; } #content { top: 0; margin: 0; padding: 0; } #mw-data-after-content { font-family: Verdana, Arial, sans-serif; color: black; font-size: 8pt; } #powersearch { background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px; } #quickbar { width: 140px; top: 18ex; padding: 2px; visibility: visible; z-index: 99; } #article, #article td, #article th, #article p { font-family: Verdana, Arial, sans-serif; font-size: 10pt; color: black; } #article p { padding-top: 0; padding-bottom: 0; margin-top: 1ex; margin-bottom: 0; } p, pre, .mw-code, td, th, li, dd, dt { line-height: 12pt; } textarea { overflow: auto; width: 100%; display: block; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } #footer { margin-right: 2%; margin-top: 1em; padding: 4px; font-family: verdana, arial, sans-serif; font-size: 10pt; text-align: center; } #footer form { display: inline; } #cb-ca-edit { font-weight: bold; } #pagestats { font-family: Verdana, Arial, sans-serif; color: black; font-size: 9pt; } #quickbar { font-family: Verdana, Arial, sans-serif; font-size: 8pt; font-weight: bold; line-height: 9.5pt; text-decoration: none; color: black; padding: 0; margin-top: 0; } #quickbar a { color: #446688; } /* Hide, but keep accessible for screen-readers */ #mw-navigation h2 { position: absolute; top: -9999px; } #quickbar h3 { font-family: Verdana, Arial, sans-serif; font-size: 10pt; font-weight: bold; line-height: 12pt; text-decoration: none; color: #666666; padding: 0; margin-bottom: 2px; margin-top: 6px; } #quickbar form { padding: 0; margin-top: 0; } #quickbar .portlet ul, #quickbar .portlet li { list-style-type: none; margin: 0; padding: 0; line-height: inherit; } div.after-portlet { display: inline; padding-left: .5em; } h1 { color: #666666; font-family: Verdana, Arial, sans-serif; font-size: 180%; line-height: 21pt; } h1#firstHeading { padding-bottom: 0; margin-bottom: 0; } #article p.subtitle, #article p.subpages, #article p.tagline { color: #666666; font-size: 11pt; font-weight: bold; padding-top: 0; margin-top: 0; padding-bottom: 1ex; } a { color: #223366; } a.external { color: #336644; } a:visited { color: #8D0749; } a.printable { text-decoration: underline; } a.stub, #quickbar a.stub { color: #772233; text-decoration: none; } a.new, #quickbar span.new a, #footer span.new a { color: #CC2200; } h2, h3, h4, h5, h6 { margin-bottom: 0; } small { font-size: 75%; } input.mw-searchInput { width: 106px; } /* Directionality-specific styles */ #quickbar { position: absolute; left: 4px; } #article { margin-left: 148px; margin-right: 4px; } #footer { margin-left: 152px; } #sitetitle, #sitesub, #toplinks, #linkcollection { margin-top: 0; margin-bottom: 0; } #sitetitle, #toplinks { color: white; text-transform: uppercase; height: 32pt; } #sitetitle { padding-left: 8px; font-family: Times, serif; font-weight: normal; font-size: 32pt; line-height: 32pt; background-color: #6688AA; } #sitetitle a, #toplinks a { color: white; text-decoration: none; } /* Bring #sitetitle to top. Otherwise #toplinks is overlaid over it, making the link unclickable. */ #sitetitle a { position: relative; z-index: 10; } #toplinks { font-family: Verdana, Arial, sans-serif; position: absolute; top: 0; right: 8px; width: 100%; font-size: 8pt; } #toplinks a { font-size: 10pt; } #toplinks p { position: absolute; right: 0; margin: 0; width: 100%; text-align: right; } #toplinks #syslinks { bottom: 0; } #toplinks #variantlinks { bottom: 12pt; } #sitesub { float: left; margin-left: 8px; font-family: Verdana, Arial, sans-serif; font-size: 9pt; font-weight: bold; color: black; } #linkcollection { margin-top: 0.5em; font-size: small; margin-right: 8px; text-align: right; padding-left: 140px; } /* Override text justification (user preference), see bug 31990 */ #linkcollection * { text-align: right; }
RicochetSoftware/ricochetsoftware.github.io
wiki/skins/CologneBlue/resources/screen.css
CSS
gpl-2.0
4,123
[ 30522, 2303, 1063, 7785, 1024, 1014, 1025, 11687, 4667, 1024, 1014, 1025, 3609, 1024, 2304, 1025, 15489, 1011, 2155, 1024, 14262, 10128, 1025, 1065, 1001, 2569, 14192, 1063, 4653, 1024, 23881, 1025, 1065, 1001, 4180, 1063, 2327, 1024, 1014,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * wjquery.calendar 0.1.1 * by composite (wonchu.net@gmail.com) * http://www.wonchu.net * This project licensed under a MIT License. 0.1.0 : 최초작성 0.1.1 : 소스정리 */ (function ($) { const WCALENDAR_SV = { ns: "wcalendar", dateFormat: "YYYYMMDD", lang: { ko: { week: ["일", "월", "화", "수", "목", "금", "토"] } } }; $.fn.wcalendar = function (method) { let result, _arguments = arguments; this.each(function (i, element) { const $element = $(element); let $container, _option = {}; if ($element.prop("tagName").toLowerCase() == "input") { if ($element.attr("data-wrap-id")) { $container = $("#" + $element.attr("data-wrap-id")); } else { const _id = "wcalendar_" + new Date().getTime(); $element.after("<div id=\"" + _id + "\" />"); _option.element = $element; $element.attr("data-wrap-id", _id); $container = $("#" + _id); } } else { $container = $element; } const plugin = $container.data(WCALENDAR_SV.ns); if (plugin && typeof method === 'string') { if (plugin[method]) { result = plugin[method].apply(this, Array.prototype.slice.call(_arguments, 1)); } else { alert('Method ' + method + ' does not exist on jQuery.wcalendar'); } } else if (!plugin && (typeof method === 'object' || !method)) { let wcalendar = new WCALENDAR(); $container.data(WCALENDAR_SV.ns, wcalendar); wcalendar.init($container, $.extend(_option, $.fn.wcalendar.defaultSettings, method || {})); } }); return result ? result : $(this); }; $.fn.wcalendar.defaultSettings = { width: "200px", locale: "ko", dateFormat: "YYYY.MM.DD", showPrevNextDays: true, dateIconClass: "wcalendar-dateicon", mdHoliday: { "0101": { ko: "신정" }, "0505": { ko: "어린이날" } }, holiday: { "20210519": { ko: "부처님오신날" } } }; function WCALENDAR() { let $container, options; function init(_container, _options) { $container = _container; options = _options; if (options.selectDate) { options.selectDate = moment(options.selectDate, options.dateFormat); } else { if (options.element && options.element.val() != "") { options.selectDate = moment(options.element.val(), options.dateFormat); } else { options.selectDate = moment(); } } options.targetDate = options.selectDate.clone(); _WCALENDAR.init($container, options); } function draw() { _WCALENDAR.draw($container, options); } function prev() { options.targetDate = options.targetDate.add(-1, "months"); _WCALENDAR.draw($container, options); } function next() { options.targetDate = options.targetDate.add(1, "months"); _WCALENDAR.draw($container, options); } function set(dt) { options.targetDate = moment(dt, options.dateFormat); _WCALENDAR.draw($container, options); } function select() { options.targetDate = moment($(".wcalendar-month .title-year", $container).val() + $.pad($(".wcalendar-month .title-month", $container).val(), 2) + "01", "YYYYMMDD"); _WCALENDAR.draw($container, options); } function click() { const _index = $(".wcalendar-undock").index($container); $(".wcalendar-undock").each(function () { if ($(".wcalendar-undock").index(this) != _index && $(this).is(":visible")) { $(this).hide(); } }); if ($container.is(":visible")) { $container.hide(); } else { if (options.element && options.element.val() != "") { options.selectDate = moment(options.element.val(), options.dateFormat); options.hasVal = "Y"; } else { options.selectDate = moment(); options.hasVal = "N"; } options.targetDate = options.selectDate.clone(); _WCALENDAR.draw($container, options); $container.show(); } } function destory() { if (options.element) { options.element.removeClass("wcalendar-input"); if (options.element.next("." + options.dateIconClass)) { options.element.next("." + options.dateIconClass).remove(); } } $container.remove(); } return { init: init, draw: draw, prev: prev, next: next, set: set, select: select, click: click, destory: destory }; } var _WCALENDAR = { init: function ($container, options) { if (options.element) { options.element.addClass("wcalendar-input"); $container.addClass("wcalendar-undock").css({ "top": options.element.position().top + options.element.outerHeight(), "left": options.element.position().left, "width": options.width }); const $icon = $("<span class=\"" + options.dateIconClass + "\" />"); options.element.after($icon); $icon.click(function () { $container.wcalendar("click"); }); options.element.click(function () { $container.wcalendar("click"); }); $(document).on("click.wcalendar-undock", function (event) { if ($(event.target).closest(".wcalendar-wrap, .wcalendar-input, ." + options.dateIconClass).length === 0) { $container.hide(); } }); } $container.html( "<div class=\"wcalendar-wrap\">" + " <div class=\"wcalendar-month\">" + " <ul>" + " <li class=\"prev\"><a href=\"javascript:;\"><span>&#10094;</span></a></li>" + " <li class=\"next\"><a href=\"javascript:;\"><span>&#10095;</span></a></li>" + " <li><select class=\"title-year\"></select> <select class=\"title-month\"></select></li>" + " </ul>" + " </div>" + " <ul class=\"wcalendar-weekdays\"></ul>" + " <ul class=\"wcalendar-days\"></ul>" + "</div>" ); this.draw($container, options); $(".wcalendar-month li>a", $container).click(function () { $container.wcalendar($(this).parent().attr("class")); }); $container.find(".wcalendar-days").on("click", "a", function () { var $t = $(this); $t.parent().siblings().find("a.active").removeClass("active"); $t.addClass("active"); if (options.callback) { options.callback($(this).attr("data-val")); } else if (options.element) { options.element.val($(this).attr("data-val")); $container.hide(); } }); }, draw: function ($container, options) { const curentDate = moment(), selectDate = options.selectDate, targetDate = options.targetDate, firstDate = targetDate.clone().startOf("month"), lastDate = targetDate.clone().endOf("month"); let _prevDate, _targetDate, _nextDate; this.makeSelectOption($(".wcalendar-month .title-year", $container), targetDate.year() - 10, targetDate.year() + 10, targetDate.year()); this.makeSelectOption($(".wcalendar-month .title-month", $container), 1, 12, options.targetDate.month() + 1); $(".wcalendar-month .title-month, .wcalendar-month .title-year", $container).off("change").on("change", function () { $container.wcalendar("select"); }); let _weekdays = []; for (let n = 0; n < 7; n++) { _weekdays.push("<li>" + WCALENDAR_SV.lang[options.locale].week[n] + "</li>"); } $container.find(".wcalendar-weekdays").empty().append(_weekdays.join("")); let _days = []; for (let i = firstDate.day(); i > 0; i--) { if (options.showPrevNextDays) { _prevDate = firstDate.clone().add(-i, "days"); _days.push(this.makeItem(options, "prev", _prevDate, curentDate, selectDate)); } else { _days.push("<li>&nbsp;</li>"); } } for (let j = 0; j < lastDate.date(); j++) { _targetDate = firstDate.clone().add(j, "days"); _days.push(this.makeItem(options, "target", _targetDate, curentDate, selectDate)); } for (let k = 1; k <= (6 - lastDate.day()); k++) { if (options.showPrevNextDays) { _nextDate = lastDate.clone().add(k, "days"); _days.push(this.makeItem(options, "next", _nextDate, curentDate, selectDate)); } else { _days.push("<li>&nbsp;</li>"); } } $container.find(".wcalendar-days").empty().append(_days.join("")); }, makeItem: function (options, mode, dt, dt2, dt3) { let classNames = [], titles = [], _classNames = "", _titles = ""; const dtf = dt.format(WCALENDAR_SV.dateFormat), dtfmd = dt.format("MMDD"), dtf2 = dt2.format(WCALENDAR_SV.dateFormat), dtf3 = dt3.format(WCALENDAR_SV.dateFormat); classNames.push(mode); if (dtf2 == dtf) { classNames.push("today"); } if (dtf3 == dtf ) { if(options.hasVal && options.hasVal=="N"){ //nothing }else{ classNames.push("active"); } } if (options.mdHoliday && options.mdHoliday[dtfmd]) { classNames.push("md-holiday"); titles.push(options.mdHoliday[dtfmd][options.locale]); } if (options.holiday && options.holiday[dtf]) { classNames.push("holiday"); titles.push(options.holiday[dtf][options.locale]); } if (classNames.length > 0) { _classNames = " class=\"" + (classNames.join(" ")) + "\""; } if (titles.length > 0) { _titles = " title=\"" + (titles.join(" ")) + "\""; } return "<li>" + " <a href=\"javascript:;\" data-val=\"" + dt.format(options.dateFormat) + "\"" + _titles + _classNames + ">" + dt.date() + "</a>" + "</li>"; }, makeSelectOption: function ($t, start, end, v) { let _options = []; for (let i = start; i <= end; i++) { _options.push("<option value=\"" + i + "\"" + (i == v ? " selected=\"selected\"" : "") + ">" + i + "</option>"); } $t.empty().append(_options.join("")); } } })(jQuery);
bibaboo/bibaboo.github.com
js/lib/wjquery/wjquery.calendar.js
JavaScript
mit
12,657
[ 30522, 1013, 1008, 1008, 1059, 3501, 4226, 2854, 1012, 8094, 1014, 1012, 1015, 1012, 1015, 1008, 2011, 12490, 1006, 2180, 20760, 1012, 5658, 1030, 20917, 4014, 1012, 4012, 1007, 1008, 8299, 1024, 1013, 1013, 7479, 1012, 2180, 20760, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>W29155_text</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div style="margin-left: auto; margin-right: auto; width: 800px; overflow: hidden;"> <div style="float: left;"> <a href="page3.html">&laquo;</a> </div> <div style="float: right;"> </div> </div> <hr/> <div style="position: absolute; margin-left: 110px; margin-top: 110px;"> <p class="styleSans730.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">X TO ENERGY, INC. <br/>HANSON i 'IX—12A, HANSON 1 1X—12E, HANSON 'l “(-128 <br/>NW2; Section 12, T144N, RQSW ‘ 5th Principe! Meridian Dunn County, North Dakota <br/>$3.5 MILES-T <br/>KILLDEER. ND <br/>J] PROPOSED INTERSECTION 33'- 'I- <br/>._' i‘IOO' EXISTING <br/>ACCESS R0 AD <br/> <br/>HIGHLANDS ENGINEERING 8: SURVEYING, PLLC <br/>2125 Sims‘ Suite #3 <br/>Dickinson, ND 53601 .. .. ?01.433.2444 office 115%. m: 701.433.2510 fax <br/>. SHEET NAME: DATE: SCALE: PROJ. N0. SHEET N0. <br/> </p> </div> </body> </html>
datamade/elpc_bakken
ocr_extracted/W29155_text/page4.html
HTML
mit
1,277
[ 30522, 1026, 16129, 1028, 30524, 1027, 21183, 2546, 1011, 1022, 1000, 1013, 1028, 1026, 2516, 1028, 1059, 24594, 16068, 2629, 1035, 3793, 1026, 1013, 2516, 1028, 1026, 4957, 2128, 2140, 1027, 1000, 6782, 21030, 2102, 1000, 2828, 1027, 1000,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
@call "%VS110COMNTOOLS%vsvars32.bat" csc.exe /nologo %*
sergeyt/cil.js
test/runcsc.cmd
Batchfile
apache-2.0
55
[ 30522, 1030, 2655, 1000, 1003, 5443, 14526, 2692, 9006, 13663, 27896, 1003, 5443, 10755, 2015, 16703, 1012, 7151, 1000, 20116, 2278, 1012, 4654, 2063, 1013, 2053, 21197, 2080, 1003, 1008, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php return [ 'version' => 'Verzija', 'powered' => 'Powered By Akaunting', 'link' => 'https://akaunting.com', 'software' => 'Slobodan računovodstveni softver', ];
akaunting/akaunting
resources/lang/hr-HR/footer.php
PHP
gpl-3.0
242
[ 30522, 1026, 1029, 25718, 2709, 1031, 1005, 2544, 1005, 1027, 1028, 1005, 2310, 15378, 14713, 1005, 1010, 1005, 6113, 1005, 1027, 1028, 1005, 6113, 2011, 9875, 16671, 2075, 1005, 1010, 1005, 4957, 1005, 1027, 1028, 1005, 16770, 1024, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include <stdio.h> #include <stdlib.h> int main() { int over,chislo,temp,i=0,counter,chisloto_org; char hex[20]; scanf("%d",&chislo); chisloto_org=chislo; do{ chislo=chisloto_org; i=0; while(chislo!=0){ temp=chislo%16; switch(temp){ case 0: hex[i]='0'; break; case 1: hex[i]='1'; break; case 2: hex[i]='2'; break; case 3: hex[i]='3'; break; case 4: hex[i]='4'; break; case 5: hex[i]='5'; break; case 6: hex[i]='6'; break; case 7: hex[i]='7'; break; case 8: hex[i]='8'; break; case 9: hex[i]='9'; break; case 10: hex[i]='A'; break; case 11: hex[i]='B'; break; case 12: hex[i]='C'; break; case 13: hex[i]='D'; break; case 14: hex[i]='E'; break; case 15: hex[i]='F'; break; } chislo/=16; i++;} counter=i-1; for(temp=0;temp<i;temp++){ if(temp>(i/2)) break; else if(hex[temp]==hex[counter]) counter--; else break;} if(counter<=temp) over=1; else chisloto_org++; }while(over==0); i=i-1; while(i>=0) {printf("%c",hex[i]); i--; } }
Ivan-Killer/po-homework
2015-2016/A/05/07/task3.c
C
mit
1,159
[ 30522, 1001, 2421, 1026, 2358, 20617, 1012, 1044, 1028, 1001, 2421, 1026, 2358, 19422, 12322, 1012, 1044, 1028, 20014, 2364, 1006, 1007, 1063, 20014, 2058, 1010, 9610, 14540, 2080, 1010, 8915, 8737, 1010, 1045, 1027, 1014, 1010, 4675, 1010,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package net.minecraft.world.gen.feature; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.world.World; public class WorldGenGlowStone1 extends WorldGenerator { public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { if (!par1World.isAirBlock(par3, par4, par5)) { return false; } else if (par1World.getBlockId(par3, par4 + 1, par5) != Block.netherrack.blockID) { return false; } else { par1World.setBlock(par3, par4, par5, Block.glowStone.blockID, 0, 2); for (int l = 0; l < 1500; ++l) { int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); int j1 = par4 - par2Random.nextInt(12); int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); if (par1World.getBlockId(i1, j1, k1) == 0) { int l1 = 0; for (int i2 = 0; i2 < 6; ++i2) { int j2 = 0; if (i2 == 0) { j2 = par1World.getBlockId(i1 - 1, j1, k1); } if (i2 == 1) { j2 = par1World.getBlockId(i1 + 1, j1, k1); } if (i2 == 2) { j2 = par1World.getBlockId(i1, j1 - 1, k1); } if (i2 == 3) { j2 = par1World.getBlockId(i1, j1 + 1, k1); } if (i2 == 4) { j2 = par1World.getBlockId(i1, j1, k1 - 1); } if (i2 == 5) { j2 = par1World.getBlockId(i1, j1, k1 + 1); } if (j2 == Block.glowStone.blockID) { ++l1; } } if (l1 == 1) { par1World.setBlock(i1, j1, k1, Block.glowStone.blockID, 0, 2); } } } return true; } } }
HATB0T/RuneCraftery
forge/mcp/src/minecraft/net/minecraft/world/gen/feature/WorldGenGlowStone1.java
Java
lgpl-3.0
2,498
[ 30522, 7427, 5658, 1012, 3067, 10419, 1012, 2088, 1012, 8991, 1012, 3444, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 6721, 1025, 12324, 5658, 1012, 3067, 10419, 1012, 3796, 1012, 3796, 1025, 12324, 5658, 1012, 3067, 10419, 1012, 2088, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Colea seychellarum Seem. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Bignoniaceae/Colea/Colea seychellarum/README.md
Markdown
apache-2.0
174
[ 30522, 1001, 5624, 2050, 7367, 17994, 8411, 6824, 4025, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 1001, 1001, 1001, 2405, 1999, 19701, 1001, 1001, 1001, 1001, 2434, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* main.css Benjamin Ghaemmaghami 2014 */ /*General Rules*/ html{ overflow-y: scroll; } body{ margin:0 0 0 0; font-family:'Oxygen', sans-serif; color: #000; background: #F2F2F2; transition-duration: 600ms; } button{ color: #4D4D4D; font-size: .8em; width: 75px; height: 50px; margin: auto; border: 1px solid white; background-color: white; } a{ text-decoration: none; color: #4D4D4D; } p{ font-family: "Georgia","Times New Roman",serif; color: #4d4d4d; font-weight: 200; } h1{ text-align: center; font-size: 1.6em; color: #fff; font-weight: 300; margin: 0 0 0 0; } h2{ font-size: 1.6em; color: #4d4d4d; font-weight: 100; margin: 0 0 0 0; } h3{ font-size: 1.2em; color: #4d4d4d; font-weight: 100; margin: 0 0 0 0; letter-spacing: .02em; } .blogArticleText h3{ font-size: 1.3em; padding-bottom: 4px; border-bottom: 1px solid #aaa; } h4{ font-size: 1.2em; color: #4d4d4d; font-weight: 100; margin: 0 0 0 0; letter-spacing: .02em; } h5{ font-size: .8em; color: #4d4d4d; font-weight: 100; margin: 0 0 0 0; text-align: center; } form{ width: 400px; height: 300px; margin: auto; color: #4D4D4D; font-size: 1.3em; font-weight: 100; padding-top: 25px; } input{ width: 200px; height: 20px; font-size: .7em; font-weight: 100; color: #4D4D4D; -webkit-appearance: none; border: 2px solid #4D4D4D; border-radius: 5px; margin: 5px 0px 5px 0px; padding: 0 0 0 0; display: inline-block; } textarea{ width: 400px; height: 150px; max-width: 400px; min-width: 400px; font-family: sans-serif; border: 2px solid #4D4D4D; border-radius: 5px; margin: 5px 0px 5px 0px; -webkit-appearance: none; } input:focus,textarea:focus{ border: 2px solid #FF5E5E; } article{ } pre{ word-wrap: break-word; font-size: .9em; border: 2px solid #4d4d4d; background: #F5F5F5; } audio{ width: 100%; overflow: visible; height: 35px; } blockquote{ border-left: 10px solid #ddd; margin: 0 0 0 0; padding-left: 25px; } .error404{ width: 92%; text-align: center; font-weight: 200; margin: auto; } .error404 span{ font-size: 6em; color: inherit; } /*Navigation Rules*/ .dropIcon{ background: url(/assets/img/dropd.png); width: 50px; height: 50px; display: block; float: right; } .naviToggle{ width: 100%; background: #000; height: 35px; z-index: 5; color: white; font-size: 1em; line-height: 33px; text-align: right; font-weight: 300; } .naviToggle ul{ display: block; height: 35px; padding-right: 10px; margin: 0 0 0 0; padding: 0 0 0 0; } .naviToggle li{ display: inline; padding-left: 10px; padding-right: 10px; transition-duration: 600ms; } .naviToggle li a{ float: none; padding: 0 0 0 0; margin: 0 0 0 0; } .naviToggle a{ color: white; float: left; padding-left: 10px; transition-duration: 600ms; } .naviToggle a:hover{ color: #4D4D4D; transition-duration: 600ms; } .naviMiddle{ max-width: 1080px; margin: auto; height: 100%; width: 100%; } /*Content Container Rules*/ .mainContain{ width: 100%; max-width: 1080px; margin: 15px auto 15px auto; position: relative; z-index: 10; background: #F2F2F2; overflow: hidden; } .backgroundPassiveColor{ width: 100%; height: auto; background: #000; } .backgroundFiller{ width: 100%; min-height: 120px; margin:0 auto 0 auto; line-height: 120px; } .glamorShot{ background: url(/assets/img/benfull.jpg) no-repeat center; width: 100%; max-width: 2838px; height: 719px; margin: auto; } .glamorTextHold{ width: 100%; max-width: 1080px; margin: auto; } .glamorText{ position: relative; top: 190px; left: 75px; width: 315px; text-align: center; color: #FFF; font-size: 1.4em; background:rgba(0,0,0,0.7); font-weight: 100; padding: 50px 50px 50px 50px; } .pageContent{ width: 100%; max-width: 850px; margin: auto; } .pageContent p{ color: #4D4D4D; font-size: 1.1em; padding: 30px 30px 30px 30px; text-align: left; line-height: 1.8em; } .showcase{ width: 1063px; margin: auto; height: 175px; position: relative; padding-bottom: 20px; padding-top: 25px; padding-left: 0px; padding-right: 0px; } .projectShowcase{ width: 1080px; margin: auto; height: 175px; position: relative; padding-bottom: 20px; padding-top: 25px; padding-left: 0px; padding-right: 0px; } .showcaseImageCenter{ margin: auto; position: relative; width: 100%; height: 100px; } .showcaseMobile{ display: none; } .showcaseItem{ height: auto; width: 175px; float: left; margin:0 19.75px 0 19.75px; text-align: center; cursor: pointer; color: #4d4d4d; display: block; margin-bottom: 20px; } .showcaseItem img{ border: 3px solid #ddd; } .showcaseItem:hover{ color: #000; } .showcaseItem:hover img{ border: 3px solid #4d4d4d; } .showcaseImage{ width: 175px; height: 175px; position: relative; margin: -3px 15.75px -3px 15.75px; float: left; overflow: hidden; border: 3px solid #ddd; /* transition-duration: 550ms;*/ cursor: pointer; } .showcaseImage:hover{ border: 3px solid #4d4d4d; margin: -3px 15.75px -3px 15.75px; /* border-radius: 0 0 25px 25px;*/ /* transition-duration: 550ms;*/ } .showcaseImage img{ top: 0px; left: 0px; position: absolute; } .showcaseColorImage{ z-index: 1 } .showcaseBWImage{ z-index: 2; transition-duration: 550ms; } .showcaseBWImage:hover{ transition-duration: 550ms; opacity: 0; } .showcaseSlider{ width: 1080px; height: 350px; margin: auto; margin-bottom: 0px; overflow: hidden; } .showcasePageHold{ width: 5400px; height: 350px; position: relative; margin: 0 0 0 0; padding: 0 0 0 0; } .showcasePage{ width: 1080px; height: 350px; margin: 0 0 0 0; padding: 0 0 0 0; position: relative; float: left; } .showcasePageImage{ position: relative; top: 0px; left: 0px; height: 350px; user-select:none; z-index: 1; } .showcasePageText{ height: 250px; z-index: 2; color: #4D4D4D; text-align: left; width: 230px; padding: 5px 0 0 0; line-height: 1.2em; float: left; margin: 70px 0px 0px 20px; } .showcasePageText span{ text-align: center; font-size: 1.3em; color: #4d4d4d; font-weight: 300; padding: 5px 0 0 0; margin: 0 0 5px 0; } .showcasePageText p{ margin: 5px 2px 5px 2px; } .showcasePageButton{ width: 225px; height: 75px; margin: 105px auto 0 auto; line-height: 70px; color: #fff; background: #FFBE69; display: block; text-align: center; } .showcasePageButton:hover{ background: #FFB14B; } .showcaseActiveContain{ width: 100%; float: left; clear: both; margin: 10px 0 0 0; } .showcaseActive{ width: 20%; height: 2px; background: #aaa; position: relative; } .headShot{ width: 250px; height: 250px; background: url(/assets/img/benhead.png); float: right; border-bottom: 10px solid #FF5E5E; } /*Blog*/ .blogSidebar{ width: 240px; height: 600px; margin: 0px 0 15px 10px; float: left; position: fixed; border-right: 1px #4D4D4D solid; text-align: right; padding-right: 20px; overflow: scroll-y; } .blogSidebarReserve{ width: 240px; margin: 0px 0 15px 10px; padding-right: 11px; float: left; height: 600px; } .blogSidebarAbsolute{ position: absolute; bottom: 0px; } .blogSidebarTracker{ position: fixed; } .blogSidebar a{ display: inline-block; color: #4D4D4D; text-align: right; background: #61C758; padding: 5px; color: #fff; margin-bottom: 7px; font-size: 1em; font-weight: 300; } .blogSidebar a:hover{ background: #3D9734; } .blogArchive{ float: right; height: 170px; margin: 5px; width: 230px; overflow: hidden; } .blogArchiveSlider{ width: 480px; position: relative; top: 0px; left: 0px; height: 120px; overflow: hidden; } .blogArchivePanel{ width: 240px; position: relative; top: 0px; float: left; clear: none; height: 240px } .blogArchivePanel ul{ width: 150px; margin-right:15px; margin: 0px 5px 5px 15px; padding: 5px 5px 0 0; float: right; } .blogArchivePanel ul li{ display: block; margin-right: 5px; margin-bottom: 5px; float: left; } .blogArchive ul li a{ width: 22px; height: 24px; padding: 5px; margin-bottom: 0px; } .blogArchivePanel span{ font-size: 1.2em; font-weight: 300; float: right; clear: none; } .blogArchiveToggle{ height: 32px; width: 32px; transition-duration: 400ms; line-height: 30px; text-align: center; cursor: pointer; font-weight: 400; font-size: 1.2em; color: #4D4D4D; background: url(/assets/img/arrow.png); float: right; clear: right; padding-right: 5px; } .blogArchiveReturn{ height: 100px; width: 32px; line-height: 70px; text-align: center; cursor: pointer; font-weight: 400; font-size: 1em; color: #4D4D4D; background: url(/assets/img/arrowflip.png) no-repeat center top; float: right; clear: none; } .blogArchiveYearHidden{ } .blogTagList{ float: right; clear:both; position: relative; } .blogTagList ul{ padding-left: 5px; } .blogTagList ul li{ display: block; float: right; margin-right: 5px; } .blogMain{ width: 630px; margin: 0px 0px 50px 30px; float: left; } .blogMain a{ display: inline-block; color: #4D4D4D; text-align: left; background: #61C758; padding: 5px; color: #fff; margin-bottom: 7px; } .blogMain a:hover{ background: #3D9734; } .blogArticle{ /*background: #fff;*/ padding: 0px 10px 0 10px; width: 600px; min-height: 150px; margin: 0px auto 0px auto; color: #4D4D4D; } .blogArticleInfo{ padding-bottom: 5px; padding-top: 16px; height: 150px; position: relative; width: 100%; overflow: hidden; border-bottom: #61C758 solid 2px; } .blogArticleInfoImgWrap{ height: 0px; width: 100%; } .blogArticleInfoImgWrap img{ margin-top: -5px; margin-bottom: -5px; } .blogArticleInfoOverlay{ position: absolute; bottom: 5px; z-index: 10; width: auto; } .blogArticleInfoOverlay h2{ float: left; font-size: 1.5em; } .blogArticleInfoOverlay h3{ float: right; display: block; text-align: right; font-size: 1.1em; } .blogArticleTitle{ padding-top: 0; padding-bottom: 5px; border-bottom: 5px solid #61C758; font-size: 1.5em; text-align: left; } .blogArticleText{ margin-top: 5px; font-size: 1em; line-height: 1.5em; border-bottom: 2px dashed #727272; margin-bottom: 17px; } .blogArticleText a{ display: inline; background: none; color: #3189D6; text-decoration: underline; padding: 0 0 0 0; } .blogArticleText a:hover{ background: none; color: #83C1F7; } .blogArticleText img{ width: 80%; height: auto; outline: solid #aaa 2px; margin: 0 10% -10px 10%; padding: 0 0 0 0; } .blogPreview{ margin-top: 15px; font-size: 1.1em; line-height: 1.2em; margin-bottom: 10px; } .blogPreview img{ width: 90%; height: auto; outline: solid #aaa 5px; margin: 0 5% 0 5%; padding: 0 0 0 0; } .blogPreview span.continue{ margin-left: -.25em; } .blogArticleTags{ text-align: left; margin: 5px 0 5px; padding-bottom: 10px; padding-top: 10px; height: auto; position: relative; display: block; /*border-bottom:dashed rgba(0,0,0,.5) 2px;*/ border-top:dashed #727272 2px; } /*.blogArticleTags a{ display: inline-block; background: #61C758; color: #fff; padding: 5px; }*/ .blogArticleTags a:after{ content: "" } .blogPageSelect{ margin-top: 35px; line-height: 50px; text-align: center; color: #4d4d4d; height: 50px; } .blogPageSelect a{ color: #fff; display: block; width: 100%; height: 50px; background: #4D4D4D; text-align: center; padding: 0 0 0 0; } .blogPageSelect a:hover{ background:#3a3a3a; } .blogPre{ width: 25%; height: 50px; float: left; } .blogCurrent{ width: 50%; height: 50px; float: left; } .blogNext{ width: 25%; height: 50px; float: left; } .blogComments{ margin: 40px auto 0 auto; clear: both; width: 100%; max-width: 580px; position: relative; } .blogComments a{ color: #4D4D4D; background: none; display: inline; font-size: 12px; text-align: center; } .blogComments a:hover{ background: none; color: #000; } /*Project Page*/ .projectText{ width: 780px; margin-right: 20px; font-size: 1.1em; line-height: 1.3em; float: left; overflow: visible; } .projectText a{ display: inline-block; text-align: left; background: #4D4D4D; padding: 5px; color: #fff; margin-bottom: 7px; } .projectText a:hover{ background: #636363; color: #fff; } .projectText p:first-child{ margin-top: 0; } .projectHeader{ width: 100%; float: left; border-bottom: 2px solid #4D4D4D; position: relative; height: auto; margin-bottom: 15px; } .projectSubhead{ min-height: 65px; float: left; clear: none; margin-bottom: 10px; } .projectTitle{ margin-top: .5em; float: left; clear: right; } .projectInfo{ float: left; clear: both; } .projectPageButton{ width: 200px; height: 65px; line-height: 65px; color: #fff; background: #FFBE69; display: block; text-align: center; font-size: 1.2em; float: right; margin-bottom: 10px; } .projectPageButton:hover{ background: #FFB14B; } .projectSidebar{ width: 270px; float: left; height: auto; margin-top: 1.2em; position: relative; } .projectSidebar img{ width: 175px; margin: 0 0 10px 44px; position: relative; border: 3px solid #ddd; display: block; } .projectSidebar img:hover{ border: 3px solid #4d4d4d; cursor: pointer; } /*Modal Rules*/ .modalBlackout{ height: 100%; width: 100%; background-color: #000; position: fixed; z-index: 101; opacity: .6; display: none; } .modalBlackout span{ bottom: 0px; right:5px; position: absolute; font-size: 400%; color: white; text-align: center; opacity: .6; cursor: pointer; } .modalHelper{ height: 100%; width: 100%; position: fixed; z-index: 102; pointer-events:none; display: none; } .modal{ z-index: 102; position: fixed; opacity: 2; display: block; pointer-events:all; } .modalText{ background-color: #F5F5F5; width: 350px; height: 150px; } .modalText h1{ padding-top: 5px; padding-bottom: 5px; font-weight: 400; text-align: center; margin: 0 0 0 0; color: white; } .modalText p{ text-align: center; padding: 15px; margin: 0 0 0 0; background-color: #F2F2F2; height:85px; font-size: 1.1em; } .modalImage{ } .modalImage h1{ margin: 0 0 0 0; padding: 0px 2px 0px 2px; color: white; font-weight: 400; font-size: 1.5em; } .modalImage img{ padding: 0 0 0 0; margin: 0 0 0 0; float: left; } .albumNav{ width: 50px; height: 50px; position: relative; float: left; text-align: center; font-size: 2em; cursor: pointer; color: #BDBDBD; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } /*Footer*/ .footer{ height: 130px; background: #4d4d4d; padding-top: 20px; text-align: center; overflow: hidden; clear: both; width: 100%; z-index: 100; bottom: 0px; position: relative; } .footer img{ cursor: pointer; border-radius: 50px; padding: 0 0 0 0; margin: 0 0 20px 0; clear:both; } .footer img:hover{ background: #666; } .footer ul{ display: block; width: 100%; height: 25px; margin: auto; position: relative; padding: 0 0 0 0; color: #fff; } .footer ul li{ display: inline-block; text-align: center; } .footer ul li a{ color: #fff; } .footer span{ color: #fff; font-size: .8em; margin-top: 15px; } .footer span a{ color: #fff; text-decoration: underline; } .footerButtonHold{ /* width: 765px;*/ width: 420px; height: 60px; margin: 0px auto 10px auto; position: relative; font-size: .9em; } .footerButton{ width: 180px; height: 60px; margin: 0 15px 0 15px; line-height: 60px; color: #fff; background: #636363; display: block; text-align: center; cursor: pointer; font-size: 1.2em; float: left; } .footerButton:hover{ background: #9c9c9c; } .footerButton:active{ margin-top: +3px; margin-bottom: -3px; } .formHold{ height: 400px; width: 400px; overflow: hidden; float: left; } .invisiFooter{ height: 210px; } /*Deprecated Navigation Slider*/ .naviContain{ margin: auto; height: auto; position: fixed; height: 650px; width: 300px; background-color: #F5F5F5; border: solid 2px #8F8F8F; z-index: 101; top: -654px; -webkit-box-shadow: 0px 0px 30px rgba(255, 255, 255, 0.2); -moz-box-shadow: 0px 0px 30px rgba(255, 255, 255, 0.2); box-shadow: 0px 0px 30px rgba(255, 255, 255, 0.2); } .thinCenter{ width: 250px; margin: auto; height: auto; position: relative; z-index: 0; padding-top: 25px; } .thinCenter ul{ margin: 0 0 0 0; padding: 0 0 0 0; } .thinCenter ul li{ width: 250px; height: 100px; margin: 0 0 25px 0; color: white; text-align: center; font-size: 2em; font-family: sans-serif; opacity: .7; line-height: 100px; transition-property: opacity margin padding-top; transition-duration: 600ms; display: block; } .thinCenter ul li:hover{ transition-property: all; transition-duration: 600ms; opacity: 1; margin: -5px -5px 20px -5px; height: 110px; line-height: 110px; width: 260px; cursor: pointer; color: white; } .launchOptionActive{ opacity: 1; margin: -5px -5px 20px -5px; height: 110px; line-height: 110px; width: 260px; cursor: pointer; color: white; } /*Flat CSS Browser Window*/ .cssWindowOutside{ width: 630px; height: 325px; border-radius: 10px 10px 0 0; background:#CFCFCF; overflow: hidden; position: relative; /* border: 2px #E0E0E0 solid;*/ border: 2px #C4C4C4 solid; margin: 25px 0 0 100px; text-align: center; float: left; transition-duration:300ms; } .cssWindowOutside:hover{ height: 345px; margin-top: 5px; transition-duration:300ms; } .cssWindowOutside span{ color: #4D4D4D; margin-left: -75px; font-size: 1em; line-height: 1.5em; display: inline-block; } .cssWindowInside{ width: 100%; height: 100%; background:#fff; overflow: hidden; border-top: 2px #C4C4C4 solid; float: left; /*border-radius: 5px 5px 0 0;*/ } .cssWindowDot{ width: 15px; height: 15px; border-radius: 8px; background: #ddd; margin: 5px 3px 5px 3px; float: left; transition-duration:150ms; } .cssWindowDot:nth-child(1){ margin-left: 15px; /*background: #ED4242; */} .cssWindowDot:nth-child(1):hover{ margin-left: 15px; background: #C70000; transition-duration:150ms; } /*Flat CSS iPhone*/ .cssPhoneOutside{ width: 300px; height: 325px; border-radius: 40px 40px 0 0; background:#CFCFCF; overflow: hidden; position: relative; /* border: 2px #E0E0E0 solid;*/ border-top: 2px #C4C4C4 solid; border-left: 2px #C4C4C4 solid; border-right: 2px #C4C4C4 solid; margin: 25px 0 0 100px; text-align: center; float: left; transition-duration:300ms; } .cssPhoneOutside:hover{ height: 350px; margin-top: 0px; transition-duration:300ms; } .cssPhoneOutside span{ color: #4D4D4D; margin-left: -75px; font-size: 1em; line-height: 1.5em; display: inline-block; } .cssPhoneInside{ width: 100%; height: 100%; background:#fff; overflow: hidden; border-top: 2px #C4C4C4 solid; float: left; /*border-radius: 5px 5px 0 0;*/ } .cssPhoneCamera{ width: 15px; height: 15px; border-radius: 15px; background: #4D4D4D; margin:30px 0px 30px 114.5px; float: left; } .cssPhoneSpeaker{ width: 40px; height: 9px; border-radius: 15px; background: #4D4D4D; margin:30px 0px 30px 10px; float: left; border: 3px #454545 solid; } /*CV Styles*/ .cvSegment{ width: 970px; height: auto; margin: auto; position: relative; border-bottom: 2px solid #aaa; padding-bottom: 10px; overflow: hidden; } .cvSegment:last-child{ border: none; } .cvImage{ width: 175px; height: auto; margin-left: 15px; float: left; } .cvImage img{ width: 100%; } .cvName{ padding-top: 75px; margin-left: 10px; float: left; width: 550px; } .cvContact{ width: 100px; float: left; color: #4D4D4D; } .cvContact ul{ margin: 75px 0 0 0; padding: 0 0 0 0; } .cvContact ul li{ display: block; margin: 0 0 0 0; padding: 0 0 0 0; } .cvSegmentTitle{ padding-top: 10px; padding-left: 20px; width: 250px; height: 100px; float: left; } .cvSegmentContent{ width: 700px; margin-top: 10px; float: left; } .cvSegmentContent p{ margin: 5px 0 0 0; } .cvSegmentContent ul{ display: block; margin: 0 0 0 0; padding: 0 0 0 0; } .cvSegmentContent ul li{ display: block; margin: 10px 0px 0 0; border-bottom: 2px solid #ccc; padding-bottom: 15px; } .cvSegmentContent ul li:first-child{ margin: 0 0 0 0; } .cvSegmentContent ul li:last-child{ border: none; padding-bottom: 5px; } .cvSegmentContent ul li h2{ color: #303030; } /*General Colors*/ .CCblack{ background: #000 ; } .CCgrey{ background: #EDEDED } .CCmutedRed{ background:#FF5E5E ; transition-duration: 600ms; } .CCmutedBlue{ background:#99E4F0 ; transition-duration: 600ms; /*background:#389999 ;*/ } .CCmutedPurple{ background:#F3B6FA ; transition-duration: 600ms; } .CCmutedGreen{ background:#61C758 ; /* background: #4BCC4B;*/ transition-duration: 600ms; } .CCmutedOrange{ background:#FFBE69 ; /*background: #FFA75E;*/ transition-duration: 600ms; } /*effectContain Effect Styles*/ /*effectContain wraps the entire page and allows for effects on the page-wide level without effecting the body element*/ .effectContain{ transition-duration:600ms; z-index: 10; position: relative; height: auto; background: #F2F2F2; } .pageEffect{ /* transform: scale(.95,.95); -ms-transform: scale(.95,.95); -webkit-transform: scale(.95,.95); */ } /*Transform Rotation Classes*/ .rotate90{ transform: rotate(90deg); -ms-transform: rotate(90deg); /* IE 9 */ -webkit-transform: rotate(90deg); /* Safari and Chrome */ transition-duration: 400ms; } .rotate180Ani{ transform: rotate(-180deg); -ms-transform: rotate(-180deg); /* IE 9 */ -webkit-transform: rotate(-180deg); /* Safari and Chrome */ transition-duration: 800ms; } .rotate180Instant{ transform: rotate(-180deg); -ms-transform: rotate(-180deg); /* IE 9 */ -webkit-transform: rotate(-180deg); /* Safari and Chrome */ } /*Utility Classes*/ .bottomSmallMargin{ margin-bottom: 12px; } .topSmallMargin{ margin-top: 12px; } a.hoverUnderline{ display: inline; background: none; padding: 0; margin: 0; } a.hoverUnderline:hover{ text-decoration: underline; color: #4D4D4D; } /*These classes create a cool scrolling effect as resized*/ .slidingImgWrapLoc25{ margin-left: calc(((600px - 100%) *-.25) - 5px); } .slidingImgWrapLoc33{ margin-left: calc(((600px - 100%) *-.33) - 5px); } .slidingImgWrapLoc50{ margin-left: calc(((600px - 100%) *-.50) - 5px); } .slidingImgWrapLoc66{ margin-left: calc(((600px - 100%) *-.66) - 5px); } .slidingImgWrapLoc75{ margin-left: calc(((600px - 100%) *-.75) - 5px); } /*Tag Icon*/ .tagIconSubTriangle{ width: 0px; height: 0px; border-style: solid; border-width: 10px 0 10px 10px; border-color: transparent transparent transparent #bbb; float: left; } .tagIconSubSquare{ width: 15px; height: 20px; background: #bbb; float: left; } .tagIconFull{ width: 25px; height: 27px; padding: 7px 10px 0 0; float: left; } /*Media Query Responsive Classes*/ @media (max-width: 1920px){ .glamorShot{ background: url(/assets/img/benfull_1920.jpg) no-repeat center; } } @media (max-width: 1650px) and (min-width : 1080px){ .glamorShot{ background: url(/assets/img/benfull_1650.jpg) no-repeat center; } } @media (max-width : 1080px){ .glamorShot{ background: url(/assets/img/benfull_1080.jpg) no-repeat center; } .showcase{ width: 100%; height: auto; padding-bottom: 15px; } .showcaseImage{ width: 85px; height: 85px; margin: 0px 31px 0px 31px; } .showcaseImage img{ width: 100%; height: 100% } .showcaseImage:hover{ margin: 0px 31px 0px 31px; } .showcaseSlider{ width: 100%; } .cssWindowOutside{ margin-left: auto; margin-right: auto; float: none; } .cssWindowOutside:hover{ height: 325px; margin-top: 25px; } .showcasePage{ width: 20%; } .showcasePageButton{ margin-left: auto; margin-right:auto; position: relative; } .showcasePageHold{ width: 500%; } .showcaseImageCenter{ width: 768px; } .showcasePageText{ position: absolute; background-color: rgba(255,255,255,.9); width: 100%; height: auto; bottom: 0px; left: 0px; margin-left: 0px; padding: 5px 0 5px 0; text-align: center; } .showcasePageText p{ display: none; } .projectShowcase{ width: 768px; padding-top: 0px; } .showcaseItem{ margin: 20px 40.5px 0 40.5px; position: relative; } .projectText{ width: 80%; margin: 0 10% 0 10%; } .projectHeader{ width: 80%; margin: 0 10% 15px 10%; } .projectSidebar{ width: 80%; margin: 20px 10% 0 10%; } .projectSidebar img{ float: left; } .cvSegment{ width: 90%; margin: 0 5% 0 5%; } .cvSegmentContent{ width: 100%; padding: 10px; margin-bottom: 5px; } .cvSegmentContent ul{ margin: 0 20px 0 0; } .cvSegmentTitle{ width: 100%; height: auto; text-align: left; margin: 5px 0 0 0; padding: 0 0 0 0; } .cvName{ width: 100%; padding-top: 0px; margin: 0; } .cvContact{ width: 100%; clear: both; padding-top: 5px; margin-top: 5px; height: auto; border-top: 2px solid #aaaaaa; } .cvContact ul{ margin: 0 0 0 0; } } @media (max-width: 930px){ .blogSidebar{ display: none; } .blogSidebarReserve{ display: none; } .blogMain{ width: 80%; margin: 0 10% 0 10%; } .blogArticle{ width: 100%; max-width: 600px; padding:0 0 0 0; } } @media (max-width: 850px){ .projectSubhead{ text-align: center; width: 100%; } .projectTitle{ width: 100%; } .projectInfo{ width: 100%; } .projectPageButton{ margin: 0 auto 10px auto; position: relative; float: none; clear: both; } } @media (max-width: 768px){ .projectShowcase{ width: 640px; } .showcaseItem{ margin: 20px 19px 0 19px; position: relative; } /*Removed until CV is added back*/ /* .githubFooterButton{ display: none; }*/ .footerButtonHold{ width: 420px; } } @media (max-width : 640px){ .showcase{ width: 100%; overflow: hidden; overflow-x: scroll; } .showcaseActiveContain{ display: none; } .showcaseMobile{ display: block; } .showcaseDesktop{ display: none; } .projectShowcase{ width: 360px; margin-top: 0px; margin-left: auto; margin-right: auto; position: relative; padding: 0 0 0 0; } .showcaseItem{ margin: 0 0 10px 0; position: relative; float: left; height: 95px; text-align: left; width: 360px; } .showcaseItem img{ width: 90px; float: left; position: relative; } .showcaseProjectText{ display: block; text-align: left; position: relative; width: 270px; margin-left: 110px; padding-top: 2px; } .glamorShot{ background-position: -450px; background-position-top: -50px; height: 325px; background: url(/assets/img/benfull_640.jpg); } .glamorText{ position: relative; width: 100%; left: 0px; top: 150px; padding: 30px 0px 30px 0px; } .showcaseSlider{ display: none; } .footer{ height: auto; width: 100%; padding: 10px 0 20px 0; } .footerButton{ float: none; margin: 7px 0 15px 0; position: relative; } .footerButtonHold{ width: 180px; height: auto; overflow: hidden; } .footer ul{ margin-top: 10px; } .cvSegmentContentul{ margin-left: 0px; } .cvSegmentTitle{ text-align: center; } .modalImage img{ float: right; } .albumNav{ clear: left; } } @media (max-width : 360px){ .projectShowcase{ width: 250px; } .showcaseItem{ margin: 0 0 10px 0; height: 75px; width: 250px; } .showcaseItem img{ width: 70px; float: left; position: relative; } .showcaseProjectText{ width: 180px; margin-left: 80px; padding-top: 2px; } .glamorShot{ background-position: -300px; } .glamorText{ top:130px; } .naviToggle{ height:70px; transition-duration:0ms; } .naviMiddle a{ float: left; clear: right; } .naviMiddle ul{ clear: left; float: left; margin: 0 0 0 0; padding: 0px 0px 0px 0px; } }
benghaem/web-portfolio
source/assets/css/main.css
CSS
gpl-3.0
29,667
[ 30522, 1013, 1008, 2364, 1012, 20116, 2015, 6425, 1043, 25293, 14760, 5603, 10631, 2297, 1008, 1013, 1013, 1008, 2236, 3513, 1008, 1013, 16129, 1063, 2058, 12314, 1011, 1061, 1024, 17186, 1025, 1065, 2303, 1063, 7785, 1024, 1014, 1014, 1014...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php if($_GET["errormessage"]){ $message = $_GET["errormessage"]; echo "<p>$message</p>"; } echo '<table style="width:100%">'; echo '<tr>'; echo '<td width="50%">'; include 'timebank-pages/login.php'; echo '</td>'; echo '<td width="50%">'; include 'timebank-pages/signup.php'; echo '</td>'; echo '</tr>'; echo '</table>'; ?>
chris31389/timebank
timebank-pages/login-signup.php
PHP
mit
399
[ 30522, 1026, 1029, 25718, 2065, 1006, 1002, 1035, 2131, 1031, 1000, 7561, 7834, 3736, 3351, 1000, 1033, 1007, 1063, 1002, 4471, 1027, 1002, 1035, 2131, 1031, 1000, 7561, 7834, 3736, 3351, 1000, 1033, 1025, 9052, 1000, 1026, 1052, 1028, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/env python # encoding: utf-8 import os import geoip2.database from geoip2.errors import AddressNotFoundError from cortexutils.analyzer import Analyzer class MaxMindAnalyzer(Analyzer): def dump_city(self, city): return { 'confidence': city.confidence, 'geoname_id': city.geoname_id, 'name': city.name, 'names': city.names } def dump_continent(self, continent): return { 'code': continent.code, 'geoname_id': continent.geoname_id, 'name': continent.name, 'names': continent.names, } def dump_country(self, country): return { 'confidence': country.confidence, 'geoname_id': country.geoname_id, 'iso_code': country.iso_code, 'name': country.name, 'names': country.names } def dump_location(self, location): return { 'accuracy_radius': location.accuracy_radius, 'latitude': location.latitude, 'longitude': location.longitude, 'metro_code': location.metro_code, 'time_zone': location.time_zone } def dump_traits(self, traits): return { 'autonomous_system_number': traits.autonomous_system_number, 'autonomous_system_organization': traits.autonomous_system_organization, 'domain': traits.domain, 'ip_address': traits.ip_address, 'is_anonymous_proxy': traits.is_anonymous_proxy, 'is_satellite_provider': traits.is_satellite_provider, 'isp': traits.isp, 'organization': traits.organization, 'user_type': traits.user_type } def summary(self, raw): taxonomies = [] level = "info" namespace = "MaxMind" predicate = "Location" if "continent" in raw: value = "{}/{}".format(raw["country"]["name"], raw["continent"]["name"]) taxonomies.append(self.build_taxonomy(level, namespace, predicate, value)) return {"taxonomies": taxonomies} def run(self): Analyzer.run(self) if self.data_type == 'ip': try: data = self.get_data() city = geoip2.database.Reader(os.path.dirname(__file__) + '/GeoLite2-City.mmdb').city(data) self.report({ 'city': self.dump_city(city.city), 'continent': self.dump_continent(city.continent), 'country': self.dump_country(city.country), 'location': self.dump_location(city.location), 'registered_country': self.dump_country(city.registered_country), 'represented_country': self.dump_country(city.represented_country), 'subdivisions': self.dump_country(city.subdivisions.most_specific), 'traits': self.dump_traits(city.traits) }) except ValueError as e: self.error('Invalid IP address') except AddressNotFoundError as e: self.error('Unknown IP address') except Exception as e: self.unexpectedError(type(e)) else: self.notSupported() if __name__ == '__main__': MaxMindAnalyzer().run()
CERT-BDF/Cortex-Analyzers
analyzers/MaxMind/geo.py
Python
agpl-3.0
3,380
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 4372, 2615, 18750, 1001, 17181, 1024, 21183, 2546, 1011, 1022, 12324, 9808, 12324, 20248, 11514, 2475, 1012, 30524, 1012, 17908, 2099, 12324, 17908, 2099, 2465, 4098, 23356, 27953, 2100, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
\makeatletter \def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax% \let\PY@ul=\relax \let\PY@tc=\relax% \let\PY@bc=\relax \let\PY@ff=\relax} \def\PY@tok#1{\csname PY@tok@#1\endcsname} \def\PY@toks#1+{\ifx\relax#1\empty\else% \PY@tok{#1}\expandafter\PY@toks\fi} \def\PY@do#1{\PY@bc{\PY@tc{\PY@ul{% \PY@it{\PY@bf{\PY@ff{#1}}}}}}} \def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}} \expandafter\def\csname PY@tok@vc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@nv\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@nf\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.60,0.00,0.00}{##1}}} \expandafter\def\csname PY@tok@gp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}} \expandafter\def\csname PY@tok@sd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@ni\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}} \expandafter\def\csname PY@tok@gt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.67,0.00,0.00}{##1}}} \expandafter\def\csname PY@tok@sx\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@sb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@ge\endcsname{\let\PY@it=\textit} \expandafter\def\csname PY@tok@il\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@kn\endcsname{\let\PY@bf=\textbf} \expandafter\def\csname PY@tok@cm\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.53}{##1}}} \expandafter\def\csname PY@tok@gu\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.67,0.67,0.67}{##1}}} \expandafter\def\csname PY@tok@mf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@gr\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.67,0.00,0.00}{##1}}} \expandafter\def\csname PY@tok@cpf\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.53}{##1}}} \expandafter\def\csname PY@tok@gd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.00}{##1}}\def\PY@bc##1{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.87,0.87}{\strut ##1}}} \expandafter\def\csname PY@tok@ow\endcsname{\let\PY@bf=\textbf} \expandafter\def\csname PY@tok@err\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.65,0.09,0.09}{##1}}\def\PY@bc##1{\setlength{\fboxsep}{0pt}\colorbox[rgb]{0.89,0.82,0.82}{\strut ##1}}} \expandafter\def\csname PY@tok@ne\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.60,0.00,0.00}{##1}}} \expandafter\def\csname PY@tok@c\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.53}{##1}}} \expandafter\def\csname PY@tok@vi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@kc\endcsname{\let\PY@bf=\textbf} \expandafter\def\csname PY@tok@o\endcsname{\let\PY@bf=\textbf} \expandafter\def\csname PY@tok@k\endcsname{\let\PY@bf=\textbf} \expandafter\def\csname PY@tok@gh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@cs\endcsname{\let\PY@bf=\textbf\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@sc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@gi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.00}{##1}}\def\PY@bc##1{\setlength{\fboxsep}{0pt}\colorbox[rgb]{0.87,1.00,0.87}{\strut ##1}}} \expandafter\def\csname PY@tok@s1\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@mh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@sr\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.50,0.50,0.00}{##1}}} \expandafter\def\csname PY@tok@kd\endcsname{\let\PY@bf=\textbf} \expandafter\def\csname PY@tok@w\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}} \expandafter\def\csname PY@tok@nb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@ch\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.53}{##1}}} \expandafter\def\csname PY@tok@bp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@na\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@cp\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@nn\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}} \expandafter\def\csname PY@tok@nt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} \expandafter\def\csname PY@tok@ss\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@c1\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.53}{##1}}} \expandafter\def\csname PY@tok@go\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}} \expandafter\def\csname PY@tok@mb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@s\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@vg\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@kt\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.27,0.33,0.53}{##1}}} \expandafter\def\csname PY@tok@gs\endcsname{\let\PY@bf=\textbf} \expandafter\def\csname PY@tok@se\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@m\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@nc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.27,0.33,0.53}{##1}}} \expandafter\def\csname PY@tok@s2\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@mi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@mo\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.60,0.60}{##1}}} \expandafter\def\csname PY@tok@kp\endcsname{\let\PY@bf=\textbf} \expandafter\def\csname PY@tok@no\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.50}{##1}}} \expandafter\def\csname PY@tok@sh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@si\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.53,0.27}{##1}}} \expandafter\def\csname PY@tok@kr\endcsname{\let\PY@bf=\textbf} \def\PYZbs{\char`\\} \def\PYZus{\char`\_} \def\PYZob{\char`\{} \def\PYZcb{\char`\}} \def\PYZca{\char`\^} \def\PYZam{\char`\&} \def\PYZlt{\char`\<} \def\PYZgt{\char`\>} \def\PYZsh{\char`\#} \def\PYZpc{\char`\%} \def\PYZdl{\char`\$} \def\PYZhy{\char`\-} \def\PYZsq{\char`\'} \def\PYZdq{\char`\"} \def\PYZti{\char`\~} % for compatibility with earlier versions \def\PYZat{@} \def\PYZlb{[} \def\PYZrb{]} \makeatother
udscbt/FlipperBot-Elaborato
include/style-code-trac.tex
TeX
gpl-3.0
6,854
[ 30522, 1032, 2191, 4017, 27901, 2099, 1032, 13366, 1032, 1052, 2100, 1030, 25141, 1063, 1032, 2292, 1032, 1052, 2100, 1030, 2009, 1027, 1032, 9483, 1032, 2292, 1032, 1052, 2100, 1030, 28939, 1027, 1032, 9483, 1003, 1032, 2292, 1032, 1052, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
%"Èíòåëëåêòóàëüíûå" êðåñòèêè-íîëèêè íà Java Internet Prolog %êîìïüþòåð óìååò èãðàòü è çà êðåñòèêè, è çà 0 % (Ñ) À.À. Òþãàøåâ 2014 %Êëåòêè ïîëÿ çàäàþòñÿ êîîðäèíàòàìè, íàïèìåð, [3,1] - ïðàâûé âåðõíèé óãîë %ñíà÷àëà íîìåð âåðòèêàëè! % 1 2 3 %1 | | %--------------------- %2 | | %--------------------- %3 | | %âñïîìîãàòåëüíûé ïðåäèêàò - îïðåäåëÿåò ïóñòîòó ïîëÿ free(X):-p(-,X). %âñïîìîãàòåëüíûé ïðåäèêàò - îïðåäåëÿåò, ÷åì èãðàåò ñîïåðíèê partner(0,x). partner(x,0). %âñïîìîãàòåëüíûé ïðåäèêàò - äîïîëíåíèå äî çàïîëíåíèÿ ïîëíîãî ñïèñêà êîîðäèíàò [1,2,3] íà ãåíåðàòîðå âñåõ ïåðåñòàíîâîê ýëåìåíòîâ òðîåê %ò.å. äëÿ [1,X,2] äàåò X=3, äëÿ [1,2,X] - X=3, äëÿ [X,2,3] - 1, è òàê äàëåå dop(X):-permutation([1,2,3],X). %÷òî òàêîå "íà îäíîé ëèíèè" same_line(S):-glav_diagonal(L),permutation(S,L). same_line(S):-pob_diagonal(L),permutation(S,L). same_line(S):-vertikal(L),permutation(S,L). same_line(S):-horizontal(L),permutation(S,L). %ãëàâíàÿ è ïîáî÷íàÿ äèàãîíàëè, ãîðèçîíòàëü, âåðòèêàëü glav_diagonal([[1,1],[2,2],[3,3]]). pob_diagonal([[3,1],[2,2],[1,3]]). horizontal([[P,Y],[K,Y],[L,Y]]):-dop([P,K,L]),dop([Y,_,_]). vertikal([[X,P],[X,K],[X,L]]):-dop([P,K,L]),dop([X,_,_]). %========================================================== ÎÑÍÎÂÍÀß ËÎÃÈÊÀ ÈÃÐÛ - ïðåäèêàò hod (×åì,Êóäà) íàïðèìåð Hod(x,[3,1]). %ïîðÿäîê ïðåäèêàòîâ hodl(D,P) èìååò çíà÷åíèå, èñïîëüçóåòñÿ îòñå÷åíèå ! ïîñëå âûáîðà õîäà äëÿ îòáðàñûâàíèÿ íèæåñòîÿùèõ %------------------ Ïåðâûì äåëîì ïûòàåìñÿ âûèãðàòü, çàòåì íå ïðîèãðàòü hod(D,P):-free(P),try_win(D,P),!. %----- íå ïðîèãðàé hod(D,P):-free(P),not_lose(D,P),!. %----- Åñëè óæå åñòü äâà îäèíàêîâûõ íà îäíîé ëèíèè -> äåëàåì õîä, ëèáî çàâåðøàþùèé çàïîëíåíèå ëèíèè, ëèáî ìåøàþùèé, åñëè ñòîÿò çíàêè ïðîòèâíèêà try_win(D,P):-same_line([X,Y,P]),p(D,X),p(D,Y),not(free(X)),!. not_lose(O,P):-same_line([X,Y,P]),p(D,X),p(D,Y),partner(O,D),!. %--------------------------------- Ñëåäóþùèé ïî ïðèîðèòåòíîñòè õîä - ïîñòàâèòü âèëêó -------------------------------------------------------- hod(D,P):-free(P),try_attack(D,P),!. %---------------------------- âèëêà îáðàçóåòñÿ åñëè ñòàíåò ïîñëå õîäà äâà îäèíàêîâûõ çíàêà íà îäíîé ëèíèè, íå áëîêèðîâàíà àòàêà, è åùå ïî îäíîé ëèíèè - òî æå ñàìîå try_attack(D,X):-same_line([X,P,M]),same_line([X,K,L]),p(D,P),p(D,K),free(M),free(L),P\=K,M\=L,!. %Åñëè íè÷åãî âûøå íå ïîäîøëî %------------- âñïîìîãàòåëüíàÿ ëîãèêà äëÿ õîäîâ íà÷àëà èãðû ugol([3,3]). ugol([1,1]). ugol([1,3]). %ñàìûé ñèëüíûé ïåðâûé õîä - â [3,1] hod(_,[3,1]):-free([3,1]),!. %è êðåñòèêàìè, è íîëèêàìè è äîñòóïíîñòü ïîëÿ [3,1] ìîæíî îòäåëüíî íå ïðîâåðÿòü ;-) hod(0,[2,2]):-free([2,2]),!. hod(x,U):-free(U),glav_diagonal([P,L,U]),p(0,L),p(x,P),!. hod(x,U):-free(U),pob_diagonal([P,L,U]),p(0,L),p(x,P),!. hod(x,[2,2] ):-free([2,2] ),p(0,O),not(ugol(O)),!. hod(x,X):-free(X),p(0,O),ugol(O),ugol(X),!. hod(0,[2,1] ):-free([2,1] ),p(0,[2,2] ),!. hod(0,O):-free(O),ugol(O),p(x,[2,2] ),!. %èíà÷å - â ïåðâóþ ïîïàâøóþñÿ ñëó÷àéíóþ êëåòêó hod(D,P):-free(P),!.
petruchcho/Android-JIProlog-XO
Java+Prolog/assets/tyugashov.pl
Perl
mit
3,018
[ 30522, 1003, 1000, 1041, 3695, 6679, 5243, 8780, 10441, 13765, 17922, 2050, 1000, 1041, 29668, 6761, 4402, 2063, 1011, 2462, 4402, 4402, 24264, 9262, 4274, 4013, 21197, 1003, 1041, 28954, 2226, 29670, 10441, 29668, 1051, 2401, 7113, 19413, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// GENERATED CODE -- DO NOT EDIT! // Original file comments: // Copyright 2015, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // 'use strict'; var grpc = require('grpc'); var helloworld_pb = require('./helloworld_pb.js'); function serialize_HelloReply(arg) { if (!(arg instanceof helloworld_pb.HelloReply)) { throw new Error('Expected argument of type HelloReply'); } return new Buffer(arg.serializeBinary()); } function deserialize_HelloReply(buffer_arg) { return helloworld_pb.HelloReply.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_HelloRequest(arg) { if (!(arg instanceof helloworld_pb.HelloRequest)) { throw new Error('Expected argument of type HelloRequest'); } return new Buffer(arg.serializeBinary()); } function deserialize_HelloRequest(buffer_arg) { return helloworld_pb.HelloRequest.deserializeBinary(new Uint8Array(buffer_arg)); } // The greeting service definition. var GreeterService = exports.GreeterService = { // Sends a greeting sayHello: { path: '/helloworld.Greeter/SayHello', requestStream: false, responseStream: false, requestType: helloworld_pb.HelloRequest, responseType: helloworld_pb.HelloReply, requestSerialize: serialize_HelloRequest, requestDeserialize: deserialize_HelloRequest, responseSerialize: serialize_HelloReply, responseDeserialize: deserialize_HelloReply, }, }; exports.GreeterClient = grpc.makeGenericClientConstructor(GreeterService);
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/grpc/examples/node/static_codegen/helloworld_grpc_pb.js
JavaScript
gpl-3.0
2,966
[ 30522, 1013, 1013, 7013, 3642, 1011, 1011, 2079, 2025, 10086, 999, 1013, 1013, 2434, 5371, 7928, 1024, 1013, 1013, 9385, 2325, 1010, 8224, 4297, 1012, 1013, 1013, 2035, 2916, 9235, 1012, 1013, 1013, 1013, 1013, 25707, 1998, 2224, 1999, 31...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en-gb" dir="ltr"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Cover component - UIkit documentation</title> <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon"> <link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon.png"> <link id="data-uikit-theme" rel="stylesheet" href="css/uikit.docs.min.css"> <link rel="stylesheet" href="css/docs.css"> <link rel="stylesheet" href="../vendor/highlight/highlight.css"> <script src="../vendor/jquery.js"></script> <script src="js/uikit.min.js"></script> <script src="../vendor/highlight/highlight.js"></script> <script src="js/docs.js"></script> </head> <body class="tm-background"> <nav class="tm-navbar uk-navbar uk-navbar-attached"> <div class="uk-container uk-container-center"> <a class="uk-navbar-brand uk-hidden-small" href="../index.html"><img class="uk-margin uk-margin-remove" src="images/logo_uikit.svg" width="90" height="30" title="UIkit" alt="UIkit"></a> <ul class="uk-navbar-nav uk-hidden-small"> <li><a href="documentation_get-started.html">Get Started</a></li> <li class="uk-active"><a href="core.html">Core</a></li> <li><a href="components.html">Components</a></li> <li><a href="customizer.html">Customizer</a></li> <li><a href="../showcase/index.html">Showcase</a></li> </ul> <a href="#tm-offcanvas" class="uk-navbar-toggle uk-visible-small" data-uk-offcanvas></a> <div class="uk-navbar-brand uk-navbar-center uk-visible-small"><img src="images/logo_uikit.svg" width="90" height="30" title="UIkit" alt="UIkit"></div> </div> </nav> <div class="tm-middle"> <div class="uk-container uk-container-center"> <div class="uk-grid" data-uk-grid-margin> <div class="tm-sidebar uk-width-medium-1-4 uk-hidden-small"> <ul class="tm-nav uk-nav" data-uk-nav> <li class="uk-nav-header">Defaults</li> <li><a href="base.html">Base</a></li> <li><a href="print.html">Print</a></li> <li class="uk-nav-header">Layout</li> <li><a href="grid.html">Grid</a></li> <li><a href="panel.html">Panel</a></li> <li><a href="article.html">Article</a></li> <li><a href="comment.html">Comment</a></li> <li><a href="utility.html">Utility</a></li> <li><a href="flex.html">Flex</a></li> <li class="uk-active"><a href="cover.html">Cover</a></li> <li class="uk-nav-header">Navigations</li> <li><a href="nav.html">Nav</a></li> <li><a href="navbar.html">Navbar</a></li> <li><a href="subnav.html">Subnav</a></li> <li><a href="breadcrumb.html">Breadcrumb</a></li> <li><a href="pagination.html">Pagination</a></li> <li><a href="tab.html">Tab</a></li> <li><a href="thumbnav.html">Thumbnav</a></li> <li class="uk-nav-header">Elements</li> <li><a href="list.html">List</a></li> <li><a href="description-list.html">Description list</a></li> <li><a href="table.html">Table</a></li> <li><a href="form.html">Form</a></li> <li class="uk-nav-header">Common</li> <li><a href="button.html">Button</a></li> <li><a href="icon.html">Icon</a></li> <li><a href="close.html">Close</a></li> <li><a href="badge.html">Badge</a></li> <li><a href="alert.html">Alert</a></li> <li><a href="thumbnail.html">Thumbnail</a></li> <li><a href="overlay.html">Overlay</a></li> <li><a href="text.html">Text</a></li> <li><a href="animation.html">Animation</a></li> <li class="uk-nav-header">JavaScript</li> <li><a href="dropdown.html">Dropdown</a></li> <li><a href="modal.html">Modal</a></li> <li><a href="offcanvas.html">Off-canvas</a></li> <li><a href="switcher.html">Switcher</a></li> <li><a href="toggle.html">Toggle</a></li> <li><a href="scrollspy.html">Scrollspy</a></li> <li><a href="smooth-scroll.html">Smooth scroll</a></li> </ul> </div> <div class="tm-main uk-width-medium-3-4"> <article class="uk-article"> <h1>Cover</h1> <p class="uk-article-lead">Expand images or videos to cover their entire container.</p> <p>This component allows you to create fullscreen teasers using images, objects or even iframes. Regardless what kind of element, it will always be centered vertically and horizontally and cover its container without losing its proportions. You can also place additional content, like text or an image, on top of the image or video.</p> <hr class="uk-article-divider"> <h2 id="usage"><a href="#usage" class="uk-link-reset">Usage</a></h2> <p>The Cover component is applied differently, depending on whether you are using a background image, an object or an iframe. The simplest way is to add the <code>.uk-cover-background</code> class to a <code>&lt;div&gt;</code> element with a background image.</p> <h3 class="tm-article-subtitle">Example</h3> <div class="uk-cover-background" style="height: 300px; background-image: url(images/placeholder_600x400.svg);"></div> <h3 class="tm-article-subtitle">Markup</h3> <pre><code>&lt;div class="uk-cover-background"&gt;...&lt;/div&gt;</code></pre> <hr class="uk-article-divider"> <h2>Video</h2> <p>To create a video that covers its parent container, add the <code>.uk-cover-object</code> class to a video. Wrap a container element around the video and add the <code>.uk-cover</code> class to clip the content.</p> <h3 class="tm-article-subtitle">Example</h3> <div class="uk-cover" style="height: 300px;"> <video class="uk-cover-object" width="600" height="400" autoplay loop muted controls> <source src="http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4?test1" type="video/mp4"> <source src="http://www.quirksmode.org/html5/videos/big_buck_bunny.ogv?test1" type="video/ogg"> </video> </div> <h3 class="tm-article-subtitle">Markup</h3> <pre><code>&lt;div class="uk-cover"&gt; &lt;video class="uk-cover-object" width="" height=""&gt; &lt;source src="" type=""&gt; &lt;/video&gt; &lt;/div&gt;</code></pre> <hr class="uk-article-divider"> <h2>Iframe</h2> <p>To apply the Cover component to an iframe, you first need to include the <code>cover.js</code> file in your document. Afterwards, add the <code>data-uk-cover</code> attribute to the iframe. Now you only need to add the <code>.uk-cover</code> class to a container element around the iframe to clip the content.</p> <h3 class="tm-article-subtitle">Example</h3> <div class="uk-cover" style="height: 300px;"> <iframe data-uk-cover src="http://www.youtube.com/embed/YE7VzlLtp-4?autoplay=1&amp;controls=0&amp;showinfo=0&amp;rel=0&amp;loop=1&amp;modestbranding=1&amp;wmode=transparent" width="560" height="315" frameborder="0" allowfullscreen=""></iframe> </div> <h3 class="tm-article-subtitle">Markup</h3> <pre><code>&lt;div class="uk-cover"&gt; &lt;iframe data-uk-cover src="" width="" height="" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; &lt;/div&gt;</code></pre> <hr class="uk-article-divider"> <h2>Responsive</h2> <p>To add responsive behavior to your cover image, you need to add the <code>.uk-invisible</code> class to an <code>&lt;img&gt;</code> element and place it inside your cover element. That way it will adapt the responsive behavior of the image.</p> <p><span class="uk-badge">NOTE</span> Adding the <code>.uk-height-viewport</code> class from the <a href="utility.html">Utility component</a> will stretch the height of the parent element to fill the whole viewport.</p> <h3 class="tm-article-subtitle">Example</h3> <div class="uk-cover-background" style="background-image: url(images/placeholder_600x400.svg);"> <img class="uk-invisible" src="images/placeholder_600x400.svg" width="600" height="400" alt="Placeholder"> </div> <h3 class="tm-article-subtitle">Markup</h3> <pre><code>&lt;div class="uk-cover-background"&gt; &lt;img class="uk-invisible" src="" width="" height="" alt=""&gt; &lt;/div&gt;</code></pre> <hr class="uk-article-divider"> <h3>Video</h3> <p>To add the same behavior to a video, you also need to add the <code>.uk-position-relative</code> class to the cover container and the <code>.uk-position-absolute</code> class to the cover object. The same applies to iframes.</p> <h4 class="tm-article-subtitle">Example</h4> <div class="uk-cover uk-position-relative"> <img class="uk-invisible" src="images/placeholder_600x400.svg" width="600" height="400" alt=""> <video class="uk-cover-object uk-position-absolute" width="600" height="400" autoplay loop muted controls> <source src="http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4?test2" type="video/mp4"> <source src="http://www.quirksmode.org/html5/videos/big_buck_bunny.ogv?test2" type="video/ogg"> </video> </div> <h4 class="tm-article-subtitle">Markup</h4> <pre><code>&lt;div class="uk-cover uk-position-relative"&gt; &lt;img class="uk-invisible" src="" width="" height="" alt=""&gt; &lt;video class="uk-cover-object uk-position-absolute" width="" height=""&gt; &lt;source src="" type=""&gt; &lt;/video&gt; &lt;/div&gt;</code></pre> <hr class="uk-article-divider"> <h2>Position content</h2> <p>You can also position content absolutely on top of the covering element. To do so, just add the <code>.uk-position-cover</code> class from the <a href="utility.html">Utility component</a> to a container element after your image or video. If you want to center the content vertically and horizontally, just use the <a href="flex.html">Flex component</a>.</p> <h3 class="tm-article-subtitle">Example</h3> <div class="uk-cover-background uk-position-relative" style="height: 300px; background-image: url(images/placeholder_600x400.svg);"> <img class="uk-invisible" src="images/placeholder_600x400.svg" width="600" height="400" alt=""> <div class="uk-position-cover uk-flex uk-flex-center uk-flex-middle"> <div style="background: rgba(42, 142, 183, 0.8); font-size: 50px; line-height: 75px; color: #fff;">Bazinga!</div> </div> </div> <h3 class="tm-article-subtitle">Markup</h3> <pre><code>&lt;div class="uk-cover-background uk-position-relative"&gt; &lt;img class="uk-invisible" src="" width="" height="" alt=""&gt; &lt;div class="uk-position-cover uk-flex-center uk-flex-middle"&gt;...&lt;/div&gt; &lt;/div&gt;</code></pre> </article> </div> </div> </div> </div> <div class="tm-footer"> <div class="uk-container uk-container-center uk-text-center"> <ul class="uk-subnav uk-subnav-line uk-flex-center"> <li><a href="http://github.com/uikit/uikit">GitHub</a></li> <li><a href="http://github.com/uikit/uikit/issues">Issues</a></li> <li><a href="http://github.com/uikit/uikit/blob/master/CHANGELOG.md">Changelog</a></li> <li><a href="https://twitter.com/getuikit">Twitter</a></li> </ul> <div class="uk-panel"> <p>Made by <a href="http://www.yootheme.com">YOOtheme</a> with love and caffeine.<br>Licensed under <a href="http://opensource.org/licenses/MIT">MIT license</a>.</p> <a href="../index.html"><img src="images/logo_uikit.svg" width="90" height="30" title="UIkit" alt="UIkit"></a> </div> </div> </div> <div id="tm-offcanvas" class="uk-offcanvas"> <div class="uk-offcanvas-bar"> <ul class="uk-nav uk-nav-offcanvas uk-nav-parent-icon" data-uk-nav="{multiple:true}"> <li class="uk-parent"><a href="#">Documentation</a> <ul class="uk-nav-sub"> <li><a href="documentation_get-started.html">Get started</a></li> <li><a href="documentation_how-to-customize.html">How to customize</a></li> <li><a href="documentation_layouts.html">Layout examples</a></li> <li><a href="core.html">Core</a></li> <li><a href="components.html">Components</a></li> <li><a href="documentation_project-structure.html">Project structure</a></li> <li><a href="documentation_less-sass.html">Less &amp; Sass files</a></li> <li><a href="documentation_create-a-theme.html">Create a theme</a></li> <li><a href="documentation_create-a-style.html">Create a style</a></li> <li><a href="documentation_customizer-json.html">Customizer.json</a></li> <li><a href="documentation_javascript.html">JavaScript</a></li> <li><a href="documentation_custom-prefix.html">Custom prefix</a></li> </ul> </li> <li class="uk-nav-header">Core</li> <li class="uk-parent"><a href="#"><i class="uk-icon-wrench"></i> Defaults</a> <ul class="uk-nav-sub"> <li><a href="base.html">Base</a></li> <li><a href="print.html">Print</a></li> </ul> </li> <li class="uk-parent uk-active"><a href="#"><i class="uk-icon-th-large"></i> Layout</a> <ul class="uk-nav-sub"> <li><a href="grid.html">Grid</a></li> <li><a href="panel.html">Panel</a></li> <li><a href="article.html">Article</a></li> <li><a href="comment.html">Comment</a></li> <li><a href="utility.html">Utility</a></li> <li><a href="flex.html">Flex</a></li> <li><a href="cover.html">Cover</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-bars"></i> Navigations</a> <ul class="uk-nav-sub"> <li><a href="nav.html">Nav</a></li> <li><a href="navbar.html">Navbar</a></li> <li><a href="subnav.html">Subnav</a></li> <li><a href="breadcrumb.html">Breadcrumb</a></li> <li><a href="pagination.html">Pagination</a></li> <li><a href="tab.html">Tab</a></li> <li><a href="thumbnav.html">Thumbnav</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-check"></i> Elements</a> <ul class="uk-nav-sub"> <li><a href="list.html">List</a></li> <li><a href="description-list.html">Description list</a></li> <li><a href="table.html">Table</a></li> <li><a href="form.html">Form</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-folder-open"></i> Common</a> <ul class="uk-nav-sub"> <li><a href="button.html">Button</a></li> <li><a href="icon.html">Icon</a></li> <li><a href="close.html">Close</a></li> <li><a href="badge.html">Badge</a></li> <li><a href="alert.html">Alert</a></li> <li><a href="thumbnail.html">Thumbnail</a></li> <li><a href="overlay.html">Overlay</a></li> <li><a href="text.html">Text</a></li> <li><a href="animation.html">Animation</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-magic"></i> JavaScript</a> <ul class="uk-nav-sub"> <li><a href="dropdown.html">Dropdown</a></li> <li><a href="modal.html">Modal</a></li> <li><a href="offcanvas.html">Off-canvas</a></li> <li><a href="switcher.html">Switcher</a></li> <li><a href="toggle.html">Toggle</a></li> <li><a href="scrollspy.html">Scrollspy</a></li> <li><a href="smooth-scroll.html">Smooth scroll</a></li> </ul> </li> <li class="uk-nav-header">Components</li> <li class="uk-parent"><a href="#"><i class="uk-icon-th-large"></i> Layout</a> <ul class="uk-nav-sub"> <li><a href="grid-js.html">Dynamic Grid</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-bars"></i> Navigations</a> <ul class="uk-nav-sub"> <li><a href="dotnav.html">Dotnav</a></li> <li><a href="slidenav.html">Slidenav</a></li> <li><a href="pagination-js.html">Dynamic Pagination</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-folder-open"></i> Common</a> <ul class="uk-nav-sub"> <li><a href="form-advanced.html">Form advanced</a></li> <li><a href="form-file.html">Form file</a></li> <li><a href="form-password.html">Form password</a></li> <li><a href="form-select.html">Form select</a></li> <li><a href="placeholder.html">Placeholder</a></li> <li><a href="progress.html">Progress</a></li> </ul> </li> <li class="uk-parent"><a href="#"><i class="uk-icon-magic"></i> JavaScript</a> <ul class="uk-nav-sub"> <li><a href="lightbox.html">Lightbox</a></li> <li><a href="autocomplete.html">Autocomplete</a></li> <li><a href="datepicker.html">Datepicker</a></li> <li><a href="htmleditor.html">HTML editor</a></li> <li><a href="slideshow.html">Slideshow</a></li> <li><a href="accordion.html">Accordion</a></li> <li><a href="notify.html">Notify</a></li> <li><a href="search.html">Search</a></li> <li><a href="nestable.html">Nestable</a></li> <li><a href="sortable.html">Sortable</a></li> <li><a href="sticky.html">Sticky</a></li> <li><a href="timepicker.html">Timepicker</a></li> <li><a href="tooltip.html">Tooltip</a></li> <li><a href="upload.html">Upload</a></li> </ul> </li> <li class="uk-nav-divider"></li> <li><a href="../showcase/index.html">Showcase</a></li> </ul> </div> </div> </body> </html>
chinakids/uikit
docs/cover.html
HTML
mit
22,745
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1011, 16351, 1000, 16101, 1027, 1000, 8318, 2099, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef StylePendingImage_h #define StylePendingImage_h #include "CSSCursorImageValue.h" #include "CSSImageGeneratorValue.h" #include "CSSImageValue.h" #include "StyleImage.h" #if ENABLE(CSS_IMAGE_SET) #include "CSSImageSetValue.h" #endif namespace WebCore { // StylePendingImage is a placeholder StyleImage that is entered into the RenderStyle during // style resolution, in order to avoid loading images that are not referenced by the final style. // They should never exist in a RenderStyle after it has been returned from the style selector. class StylePendingImage final : public StyleImage { public: static Ref<StylePendingImage> create(CSSValue* value) { return adoptRef(*new StylePendingImage(value)); } CSSImageValue* cssImageValue() const { return is<CSSImageValue>(m_value) ? downcast<CSSImageValue>(m_value) : nullptr; } CSSImageGeneratorValue* cssImageGeneratorValue() const { return is<CSSImageGeneratorValue>(m_value) ? static_cast<CSSImageGeneratorValue*>(m_value) : nullptr; } CSSCursorImageValue* cssCursorImageValue() const { return is<CSSCursorImageValue>(m_value) ? downcast<CSSCursorImageValue>(m_value) : nullptr; } #if ENABLE(CSS_IMAGE_SET) CSSImageSetValue* cssImageSetValue() const { return is<CSSImageSetValue>(m_value) ? downcast<CSSImageSetValue>(m_value) : nullptr; } #endif void detachFromCSSValue() { m_value = nullptr; } private: virtual WrappedImagePtr data() const override { return const_cast<StylePendingImage*>(this); } virtual PassRefPtr<CSSValue> cssValue() const override { return m_value; } virtual FloatSize imageSize(const RenderElement*, float /*multiplier*/) const override { return FloatSize(); } virtual bool imageHasRelativeWidth() const override { return false; } virtual bool imageHasRelativeHeight() const override { return false; } virtual void computeIntrinsicDimensions(const RenderElement*, Length& /* intrinsicWidth */ , Length& /* intrinsicHeight */, FloatSize& /* intrinsicRatio */) override { } virtual bool usesImageContainerSize() const override { return false; } virtual void setContainerSizeForRenderer(const RenderElement*, const FloatSize&, float) override { } virtual void addClient(RenderElement*) override { } virtual void removeClient(RenderElement*) override { } virtual RefPtr<Image> image(RenderElement*, const FloatSize&) const override { ASSERT_NOT_REACHED(); return nullptr; } virtual bool knownToBeOpaque(const RenderElement*) const override { return false; } StylePendingImage(CSSValue* value) : m_value(value) { m_isPendingImage = true; } CSSValue* m_value; // Not retained; it owns us. }; } // namespace WebCore SPECIALIZE_TYPE_TRAITS_STYLE_IMAGE(StylePendingImage, isPendingImage) #endif // StylePendingImage_h
qtproject/qtwebkit
Source/WebCore/rendering/style/StylePendingImage.h
C
gpl-2.0
4,179
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2230, 6207, 4297, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 25707, 1998, 2224, 1999, 3120, 1998, 30524, 2015, 1997, 3120, 3642, 2442, 9279, 1996, 2682, 9385, 1008, 5060, 1010, 2023, 2862, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* main.c - Application main entry point */ /* * Copyright (c) 2015 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdint.h> #include <stdbool.h> #include <stddef.h> #include <string.h> #include <misc/printk.h> #include <net/buf.h> #include <net/net_ip.h> #if defined(CONFIG_NET_BUF_DEBUG) #define DBG(fmt, ...) printk(fmt, ##__VA_ARGS__) #else #define DBG(fmt, ...) #endif #define TEST_TIMEOUT SECONDS(1) struct bt_data { void *hci_sync; union { uint16_t hci_opcode; uint16_t acl_handle; }; uint8_t type; }; struct ipv6_hdr { uint8_t vtc; uint8_t tcflow; uint16_t flow; uint8_t len[2]; uint8_t nexthdr; uint8_t hop_limit; struct in6_addr src; struct in6_addr dst; } __attribute__((__packed__)); struct udp_hdr { uint16_t src_port; uint16_t dst_port; uint16_t len; uint16_t chksum; } __attribute__((__packed__)); static int destroy_called; static int frag_destroy_called; static struct nano_fifo bufs_fifo; static struct nano_fifo no_data_buf_fifo; static struct nano_fifo frags_fifo; static struct nano_fifo big_frags_fifo; static void buf_destroy(struct net_buf *buf) { destroy_called++; if (buf->free != &bufs_fifo) { printk("Invalid free pointer in buffer!\n"); } DBG("destroying %p\n", buf); nano_fifo_put(buf->free, buf); } static void frag_destroy(struct net_buf *buf) { frag_destroy_called++; if (buf->free != &frags_fifo) { printk("Invalid free frag pointer in buffer!\n"); } else { nano_fifo_put(buf->free, buf); } } static void frag_destroy_big(struct net_buf *buf) { frag_destroy_called++; if (buf->free != &big_frags_fifo) { printk("Invalid free big frag pointer in buffer!\n"); } else { nano_fifo_put(buf->free, buf); } } static NET_BUF_POOL(bufs_pool, 22, 74, &bufs_fifo, buf_destroy, sizeof(struct bt_data)); static NET_BUF_POOL(no_data_buf_pool, 1, 0, &no_data_buf_fifo, NULL, sizeof(struct bt_data)); static NET_BUF_POOL(frags_pool, 13, 128, &frags_fifo, frag_destroy, 0); static NET_BUF_POOL(big_pool, 1, 1280, &big_frags_fifo, frag_destroy_big, 0); static const char example_data[] = "0123456789" "abcdefghijklmnopqrstuvxyz" "!#¤%&/()=?"; static bool net_buf_test_1(void) { struct net_buf *bufs[ARRAY_SIZE(bufs_pool)]; struct net_buf *buf; int i; for (i = 0; i < ARRAY_SIZE(bufs_pool); i++) { buf = net_buf_get_timeout(&bufs_fifo, 0, TICKS_NONE); if (!buf) { printk("Failed to get buffer!\n"); return false; } bufs[i] = buf; } for (i = 0; i < ARRAY_SIZE(bufs_pool); i++) { net_buf_unref(bufs[i]); } if (destroy_called != ARRAY_SIZE(bufs_pool)) { printk("Incorrect destroy callback count: %d\n", destroy_called); return false; } return true; } static bool net_buf_test_2(void) { struct net_buf *frag, *head; struct nano_fifo fifo; int i; head = net_buf_get_timeout(&bufs_fifo, 0, TICKS_NONE); if (!head) { printk("Failed to get fragment list head!\n"); return false; } DBG("Fragment list head %p\n", head); frag = head; for (i = 0; i < ARRAY_SIZE(bufs_pool) - 1; i++) { frag->frags = net_buf_get_timeout(&bufs_fifo, 0, TICKS_NONE); if (!frag->frags) { printk("Failed to get fragment!\n"); return false; } DBG("%p -> %p\n", frag, frag->frags); frag = frag->frags; } DBG("%p -> %p\n", frag, frag->frags); nano_fifo_init(&fifo); net_buf_put(&fifo, head); head = net_buf_get_timeout(&fifo, 0, TICKS_NONE); destroy_called = 0; net_buf_unref(head); if (destroy_called != ARRAY_SIZE(bufs_pool)) { printk("Incorrect fragment destroy callback count: %d\n", destroy_called); return false; } return true; } static void test_3_fiber(int arg1, int arg2) { struct nano_fifo *fifo = (struct nano_fifo *)arg1; struct nano_sem *sema = (struct nano_sem *)arg2; struct net_buf *buf; nano_sem_give(sema); buf = net_buf_get_timeout(fifo, 0, TEST_TIMEOUT); if (!buf) { printk("test_3_fiber: Unable to get initial buffer\n"); return; } DBG("Got buffer %p from FIFO\n", buf); destroy_called = 0; net_buf_unref(buf); if (destroy_called != ARRAY_SIZE(bufs_pool)) { printk("Incorrect fragment destroy callback count: %d " "should be %d\n", destroy_called, ARRAY_SIZE(bufs_pool)); return; } nano_sem_give(sema); } static bool net_buf_test_3(void) { static char __stack test_3_fiber_stack[1024]; struct net_buf *frag, *head; struct nano_fifo fifo; struct nano_sem sema; int i; head = net_buf_get_timeout(&bufs_fifo, 0, TICKS_NONE); if (!head) { printk("Failed to get fragment list head!\n"); return false; } DBG("Fragment list head %p\n", head); frag = head; for (i = 0; i < ARRAY_SIZE(bufs_pool) - 1; i++) { frag->frags = net_buf_get_timeout(&bufs_fifo, 0, TICKS_NONE); if (!frag->frags) { printk("Failed to get fragment!\n"); return false; } DBG("%p -> %p\n", frag, frag->frags); frag = frag->frags; } DBG("%p -> %p\n", frag, frag->frags); nano_fifo_init(&fifo); nano_sem_init(&sema); fiber_start(test_3_fiber_stack, sizeof(test_3_fiber_stack), test_3_fiber, (int)&fifo, (int)&sema, 7, 0); if (!nano_sem_take(&sema, TEST_TIMEOUT)) { printk("Timeout 1 while waiting for semaphore\n"); return false; } DBG("calling net_buf_put\n"); net_buf_put(&fifo, head); if (!nano_sem_take(&sema, TEST_TIMEOUT)) { printk("Timeout 2 while waiting for semaphore\n"); return false; } return true; } static bool net_buf_test_4(void) { struct net_buf *frags[ARRAY_SIZE(frags_pool)]; struct net_buf *buf, *frag; int i, removed; DBG("sizeof(struct net_buf) = %u\n", sizeof(struct net_buf)); DBG("sizeof(frags_pool) = %u\n", sizeof(frags_pool)); net_buf_pool_init(no_data_buf_pool); net_buf_pool_init(frags_pool); /* Create a buf that does not have any data to store, it just * contains link to fragments. */ buf = net_buf_get(&no_data_buf_fifo, 0); if (buf->size != 0) { DBG("Invalid buf size %d\n", buf->size); return false; } /* Test the fragments by appending after last fragment */ for (i = 0; i < ARRAY_SIZE(frags_pool) - 1; i++) { frag = net_buf_get(&frags_fifo, 0); net_buf_frag_add(buf, frag); frags[i] = frag; } /* And one as a first fragment */ frag = net_buf_get(&frags_fifo, 0); net_buf_frag_insert(buf, frag); frags[i] = frag; frag = buf->frags; if (frag->user_data_size != 0) { DBG("Invalid user data size %d\n", frag->user_data_size); return false; } i = 0; while (frag) { frag = frag->frags; i++; } if (i != ARRAY_SIZE(frags_pool)) { DBG("Incorrect fragment count: %d vs %d\n", i, ARRAY_SIZE(frags_pool)); return false; } /* Remove about half of the fragments and verify count */ i = removed = 0; frag = buf->frags; while (frag) { struct net_buf *next = frag->frags; if ((i % 2) && next) { net_buf_frag_del(frag, next); net_buf_unref(next); removed++; } else { frag = next; } i++; } i = 0; frag = buf->frags; while (frag) { frag = frag->frags; i++; } if ((i + removed) != ARRAY_SIZE(frags_pool)) { DBG("Incorrect removed fragment count: %d vs %d\n", i + removed, ARRAY_SIZE(frags_pool)); return false; } removed = 0; while (buf->frags) { struct net_buf *frag = buf->frags; net_buf_frag_del(buf, frag); net_buf_unref(frag); removed++; } if (removed != i) { DBG("Not all fragments were removed: %d vs %d\n", i, removed); return false; } if (frag_destroy_called != ARRAY_SIZE(frags_pool)) { DBG("Incorrect frag destroy callback count: %d vs %d\n", frag_destroy_called, ARRAY_SIZE(frags_pool)); return false; } /* Add the fragments back and verify that they are properly unref * by freeing the top buf. */ for (i = 0; i < ARRAY_SIZE(frags_pool) - 3; i++) { net_buf_frag_add(buf, net_buf_get(&frags_fifo, 0)); } /* Create a fragment list and add it to frags list after first * element */ frag = net_buf_get(&frags_fifo, 0); net_buf_frag_add(frag, net_buf_get(&frags_fifo, 0)); net_buf_frag_insert(frag, net_buf_get(&frags_fifo, 0)); net_buf_frag_insert(buf->frags->frags, frag); i = 0; frag = buf->frags; while (frag) { frag = frag->frags; i++; } if (i != ARRAY_SIZE(frags_pool)) { DBG("Incorrect fragment count: %d vs %d\n", i, ARRAY_SIZE(frags_pool)); return false; } frag_destroy_called = 0; net_buf_unref(buf); if (frag_destroy_called != 0) { DBG("Wrong frag destroy callback count\n"); return false; } for (i = 0; i < ARRAY_SIZE(frags_pool); i++) { net_buf_unref(frags[i]); } if (frag_destroy_called != ARRAY_SIZE(frags_pool)) { DBG("Incorrect frag destroy count: %d vs %d\n", frag_destroy_called, ARRAY_SIZE(frags_pool)); return false; } return true; } static bool net_buf_test_big_buf(void) { struct net_buf *big_frags[ARRAY_SIZE(big_pool)]; struct net_buf *buf, *frag; struct ipv6_hdr *ipv6; struct udp_hdr *udp; int i, len; DBG("sizeof(big_pool) = %u\n", sizeof(big_pool)); net_buf_pool_init(big_pool); frag_destroy_called = 0; /* Example of one big fragment that can hold full IPv6 packet */ buf = net_buf_get(&no_data_buf_fifo, 0); /* We reserve some space in front of the buffer for protocol * headers (IPv6 + UDP). Link layer headers are ignored in * this example. */ #define PROTO_HEADERS (sizeof(struct ipv6_hdr) + sizeof(struct udp_hdr)) frag = net_buf_get(&big_frags_fifo, PROTO_HEADERS); big_frags[0] = frag; DBG("There is %d bytes available for user data.\n", net_buf_tailroom(frag)); /* First add some application data */ len = strlen(example_data); for (i = 0; i < 2; i++) { DBG("Adding data: %s\n", example_data); if (net_buf_tailroom(frag) < len) { printk("No enough space in the buffer\n"); return -1; } memcpy(net_buf_add(frag, len), example_data, len); } DBG("Full data (len %d): %s\n", frag->len, frag->data); ipv6 = (struct ipv6_hdr *)(frag->data - net_buf_headroom(frag)); udp = (struct udp_hdr *)((void *)ipv6 + sizeof(*ipv6)); DBG("IPv6 hdr starts %p, UDP hdr starts %p, user data %p\n", ipv6, udp, frag->data); net_buf_frag_add(buf, frag); net_buf_unref(buf); if (frag_destroy_called != 0) { printk("Wrong big frag destroy callback count\n"); return false; } for (i = 0; i < ARRAY_SIZE(big_pool); i++) { net_buf_unref(big_frags[i]); } if (frag_destroy_called != ARRAY_SIZE(big_pool)) { printk("Incorrect big frag destroy count: %d vs %d\n", frag_destroy_called, ARRAY_SIZE(big_pool)); return false; } return true; } static bool net_buf_test_multi_frags(void) { struct net_buf *frags[ARRAY_SIZE(frags_pool)]; struct net_buf *buf; struct ipv6_hdr *ipv6; struct udp_hdr *udp; int i, len, avail = 0, occupied = 0; frag_destroy_called = 0; /* Example of multi fragment scenario with IPv6 */ buf = net_buf_get(&no_data_buf_fifo, 0); /* We reserve some space in front of the buffer for link layer headers. * In this example, we use min MTU (81 bytes) defined in rfc 4944 ch. 4 * * Note that with IEEE 802.15.4 we typically cannot have zero-copy * in sending side because of the IPv6 header compression. */ #define LL_HEADERS (127 - 81) for (i = 0; i < ARRAY_SIZE(frags_pool) - 1; i++) { frags[i] = net_buf_get(&frags_fifo, LL_HEADERS); avail += net_buf_tailroom(frags[i]); net_buf_frag_add(buf, frags[i]); } /* Place the IP + UDP header in the first fragment */ frags[i] = net_buf_get(&frags_fifo, LL_HEADERS + (sizeof(struct ipv6_hdr) + sizeof(struct udp_hdr))); avail += net_buf_tailroom(frags[i]); net_buf_frag_insert(buf, frags[i]); DBG("There is %d bytes available for user data in %d buffers.\n", avail, i); /* First add some application data */ len = strlen(example_data); for (i = 0; i < ARRAY_SIZE(frags_pool) - 1; i++) { DBG("Adding data: %s\n", example_data); if (net_buf_tailroom(frags[i]) < len) { printk("No enough space in the buffer\n"); return false; } memcpy(net_buf_add(frags[i], len), example_data, len); occupied += frags[i]->len; } DBG("Full data len %d\n", occupied); ipv6 = (struct ipv6_hdr *)(frags[i]->data - net_buf_headroom(frags[i])); udp = (struct udp_hdr *)((void *)ipv6 + sizeof(*ipv6)); DBG("Frag %p IPv6 hdr starts %p, UDP hdr starts %p\n", frags[i], ipv6, udp); for (i = 0; i < ARRAY_SIZE(frags_pool); i++) { DBG("[%d] frag %p user data (%d) at %p\n", i, frags[i], frags[i]->len, frags[i]->data); } net_buf_unref(buf); if (frag_destroy_called != 0) { printk("Wrong big frag destroy callback count\n"); return false; } for (i = 0; i < ARRAY_SIZE(frags_pool); i++) { net_buf_unref(frags[i]); } if (frag_destroy_called != ARRAY_SIZE(frags_pool)) { printk("Incorrect big frag destroy count: %d vs %d\n", frag_destroy_called, ARRAY_SIZE(frags_pool)); return false; } return true; } static const struct { const char *name; bool (*func)(void); } tests[] = { { "Test 1", net_buf_test_1, }, { "Test 2", net_buf_test_2, }, { "Test 3", net_buf_test_3, }, { "Test 4", net_buf_test_4, }, { "Test 5 big buf", net_buf_test_big_buf, }, { "Test 6 multi frag", net_buf_test_multi_frags, }, }; void main(void) { int count, pass; printk("sizeof(struct net_buf) = %u\n", sizeof(struct net_buf)); printk("sizeof(bufs_pool) = %u\n", sizeof(bufs_pool)); net_buf_pool_init(bufs_pool); for (count = 0, pass = 0; count < ARRAY_SIZE(tests); count++) { printk("Running %s... ", tests[count].name); if (!tests[count].func()) { printk("failed!\n"); } else { printk("passed!\n"); pass++; } } printk("%d / %d tests passed\n", pass, count); }
mirzak/zephyr-os
tests/net/buf/src/main.c
C
apache-2.0
14,141
[ 30522, 1013, 1008, 2364, 1012, 1039, 1011, 4646, 2364, 4443, 2391, 1008, 1013, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2325, 13420, 3840, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.jsmpp.session.state; import java.io.IOException; import org.jsmpp.bean.Command; import org.jsmpp.session.ResponseHandler; import org.jsmpp.session.SMPPSessionContext; /** * This class provides the interface to response to every incoming SMPP Command. * How the response behavior is, depends on its state, or the * implementation of this class. * * @author uudashr * @version 1.0 * @since 2.0 */ public interface SMPPSessionState extends GenericSMPPSessionState { SMPPSessionState OPEN = new SMPPSessionOpen(); SMPPSessionState BOUND_RX = new SMPPSessionBoundRX(); SMPPSessionState BOUND_TX = new SMPPSessionBoundTX(); SMPPSessionState BOUND_TRX = new SMPPSessionBoundTRX(); SMPPSessionState UNBOUND = new SMPPSessionUnbound(); SMPPSessionState CLOSED = new SMPPSessionClosed(); /** * Process the bind response command. * * @param sessionContext the session context. * @param pduHeader is the PDU header. * @param pdu is the complete PDU. * @param responseHandler is the session handler. * @throws IOException if an input or output error occurred. */ void processBindResp(SMPPSessionContext sessionContext, Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; /** * Process the submit short message response command. * * @param pduHeader is the PDU header. * @param pdu is the complete PDU. * @param responseHandler is the response handler. * @throws IOException if there is an I/O error found. */ void processSubmitSmResp(Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; /** * Process a submit multiple message response. * * @param pduHeader is the PDU header. * @param pdu is the complete PDU. * @param responseHandler is the response handler. * @throws IOException if there is an I/O error found. */ void processSubmitMultiResp(Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; /** * Process the query short message response command. * * @param pduHeader is the PDU header. * @param pdu is the complete PDU. * @param responseHandler is the session handler. * @throws IOException throw if there is an IO error occur. */ void processQuerySmResp(Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; /** * Process the deliver short message request command. * * @param pduHeader is the PDU header. * @param pdu is the complete PDU. * @param responseHandler is the session handler. * @throws IOException throw if there is an IO error occur. */ void processDeliverSm(Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; /** * Process the cancel short message request command. * * @param pduHeader is the PDU header. * @param pdu is the complete PDU. * @param responseHandler is the session handler. * @throws IOException throw if there is an IO error occur. */ void processCancelSmResp(Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; /** * Process the replace short message request command. * * @param pduHeader is the PDU header. * @param pdu is the complete PDU. * @param responseHandler is the session handler. * @throws IOException throw if there is an IO error occur. */ void processReplaceSmResp(Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; /** * Process the alert notification request command. * * @param pduHeader is the PDU header. * @param pdu is the complete PDU. * @param responseHandler is the session handler. */ void processAlertNotification(Command pduHeader, byte[] pdu, ResponseHandler responseHandler); /** * Process the broadcast short message response command. * * @param pduHeader is the PDU header. * @param pdu is the complete broadcast_sm PDU. * @param responseHandler is the session handler. * @throws IOException throw if there is an IO error occur. */ void processBroadcastSmResp(Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; /** * Process the cancel broadcast short message response command. * * @param pduHeader is the PDU header. * @param pdu is the complete cancel_broadcast_sm PDU. * @param responseHandler is the session handler. * @throws IOException throw if there is an IO error occur. */ void processCancelBroadcastSmResp(Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; /** * Process the query broadcast short message response command. * * @param pduHeader is the PDU header. * @param pdu is the complete query_broadcast_sm PDU. * @param responseHandler is the session handler. * @throws IOException throw if there is an IO error occur. */ void processQueryBroadcastSmResp(Command pduHeader, byte[] pdu, ResponseHandler responseHandler) throws IOException; }
opentelecoms-org/jsmpp
jsmpp/src/main/java/org/jsmpp/session/state/SMPPSessionState.java
Java
apache-2.0
6,024
[ 30522, 1013, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, 2007, 1996, 6105, 1012, 1008, 2017, 2089, 6855, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.cowthan.pattern1.builder; import java.util.ArrayList; public class BMWBuilder extends CarBuilder{ private BMW bmw = new BMW(); @Override public void setSequence(ArrayList<String> sequence) { this.bmw.setSequence(sequence); } @Override public ICar getCar() { return this.bmw; } public ICar getCar(ArrayList<String> sequence){ BMW bmw = new BMW(); bmw.setSequence(sequence); return bmw; } }
cowthan/JavaAyo
src/com/cowthan/pattern1/builder/BMWBuilder.java
Java
apache-2.0
425
[ 30522, 7427, 4012, 1012, 11190, 21604, 1012, 5418, 2487, 1012, 12508, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 9140, 9863, 1025, 2270, 2465, 13154, 8569, 23891, 2099, 8908, 2482, 8569, 23891, 2099, 1063, 2797, 13154, 13154, 1027, 2047, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>18 --> 19</title> <link href="./../../assets/style.css" rel="stylesheet"> </head> <body> <h2>You have to be fast</h2> <a href="./e2fc2799ecf8f3028bc41e8e38dba329c98b86605a09e2bd4e69b671b60cdd16.html">Teleport</a> <hr> <a href="./../../about.md">About</a> (Spoilers! ) <script src="./../../assets/md5.js"></script> <script> window.currentLevel = 7; </script> <script src="./../../assets/script.js"></script> </body> </html>
simonmysun/praxis
TAIHAO2019/pub/SmallGame/AsFastAsYouCan2/abb99cb9d54f622026e042180f75aa6275c3da5a99ca98b03e8ea83e6073f4c7.html
HTML
mit
550
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 2516, 1028, 2324, 1011, 1011, 1028, 2539, 1026...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_ #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_ #include <string> #include "base/strings/string16.h" #include "base/time/time.h" #include "components/autofill/core/browser/form_group.h" namespace autofill { class AutofillType; // This class is an interface for the primary data models that back Autofill. // The information in objects of this class is managed by the // PersonalDataManager. class AutofillDataModel : public FormGroup { public: AutofillDataModel(const std::string& guid, const std::string& origin); ~AutofillDataModel() override; // Returns true if the data in this model was entered directly by the user, // rather than automatically aggregated. bool IsVerified() const; // Called to update |use_count_| and |use_date_| when this data model is // the subject of user interaction (usually, when it's used to fill a form). void RecordUse(); std::string guid() const { return guid_; } void set_guid(const std::string& guid) { guid_ = guid; } std::string origin() const { return origin_; } void set_origin(const std::string& origin) { origin_ = origin; } size_t use_count() const { return use_count_; } void set_use_count(size_t count) { use_count_ = count; } const base::Time& use_date() const { return use_date_; } void set_use_date(const base::Time& time) { use_date_ = time; } const base::Time& modification_date() const { return modification_date_; } // This should only be called from database code. void set_modification_date(const base::Time& time) { modification_date_ = time; } private: // A globally unique ID for this object. std::string guid_; // The origin of this data. This should be // (a) a web URL for the domain of the form from which the data was // automatically aggregated, e.g. https://www.example.com/register, // (b) some other non-empty string, which cannot be interpreted as a web // URL, identifying the origin for non-aggregated data, or // (c) an empty string, indicating that the origin for this data is unknown. std::string origin_; // The number of times this model has been used. size_t use_count_; // The last time the model was used. base::Time use_date_; // The last time data in the model was modified. base::Time modification_date_; }; } // namespace autofill #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_
Chilledheart/chromium
components/autofill/core/browser/autofill_data_model.h
C
bsd-3-clause
2,641
[ 30522, 1013, 1013, 9385, 2286, 1996, 10381, 21716, 5007, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1013, 1013, 2179, 1999, 1996, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Copyright (c) 2015 Red Hat, Inc. * * This software is licensed to you under the GNU General Public License, * version 2 (GPLv2). There is NO WARRANTY for this software, express or * implied, including the implied warranties of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 * along with this software; if not, see * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. * * Red Hat trademarks are not licensed under GPLv2. No permission is * granted to use or replicate Red Hat trademarks that are incorporated * in this software or its documentation. */ package com.redhat.rhn.frontend.action.groups; import com.redhat.rhn.domain.rhnset.RhnSet; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.dto.SystemGroupOverview; import com.redhat.rhn.frontend.struts.RequestContext; import com.redhat.rhn.frontend.struts.RhnAction; import com.redhat.rhn.frontend.struts.RhnHelper; import com.redhat.rhn.frontend.taglibs.list.ListTagHelper; import com.redhat.rhn.manager.rhnset.RhnSetDecl; import com.redhat.rhn.manager.rhnset.RhnSetManager; import com.redhat.rhn.manager.system.SystemManager; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.DynaActionForm; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * SSMGroupManageAction * @version $Rev$ */ public class SSMGroupManageAction extends RhnAction { public static final Long ADD = 1L; public static final Long REMOVE = 0L; /** * {@inheritDoc} */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { RequestContext rctx = new RequestContext(request); User user = rctx.getCurrentUser(); DynaActionForm daForm = (DynaActionForm)form; request.setAttribute(ListTagHelper.PARENT_URL, request.getRequestURI()); List<SystemGroupOverview> groups = SystemManager.groupList(user, null); // If submitted, save the user's choices for the confirm page if (isSubmitted(daForm)) { processList(user, request); return mapping.findForward("confirm"); } request.setAttribute(RequestContext.PAGE_LIST, groups); return mapping.findForward(RhnHelper.DEFAULT_FORWARD); } private int processList(User user, HttpServletRequest request) { List<Long> addList = new ArrayList<Long>(); List<Long> removeList = new ArrayList<Long>(); Enumeration<String> names = request.getParameterNames(); while (names.hasMoreElements()) { String aName = names.nextElement(); String aValue = request.getParameter(aName); Long aId = null; try { aId = Long.parseLong(aName); } catch (NumberFormatException e) { // not a param we care about; skip continue; } if ("add".equals(aValue)) { addList.add(aId); } else if ("remove".equals(aValue)) { removeList.add(aId); } } if (addList.size() + removeList.size() > 0) { RhnSet cset = RhnSetDecl.SSM_GROUP_LIST.get(user); cset.clear(); for (Long id : addList) { cset.addElement(id, ADD); } for (Long id : removeList) { cset.addElement(id, REMOVE); } RhnSetManager.store(cset); } return addList.size() + removeList.size(); } }
wraiden/spacewalk
java/code/src/com/redhat/rhn/frontend/action/groups/SSMGroupManageAction.java
Java
gpl-2.0
3,899
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2325, 2417, 6045, 1010, 4297, 1012, 1008, 1008, 2023, 4007, 2003, 7000, 2000, 2017, 2104, 1996, 27004, 2236, 2270, 6105, 1010, 1008, 2544, 1016, 1006, 14246, 2140, 2615, 2475, 1007, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php App::uses('AppController', 'Controller'); App::uses('Folder', 'Utility'); App::uses('File', 'Utility'); /** * Attributes Controller * * @property Attribute $Attribute */ class AttributesController extends AppController { public $components = array('Security', 'RequestHandler', 'Cidr'); public $paginate = array( 'limit' => 60, 'maxLimit' => 9999, // LATER we will bump here on a problem once we have more than 9999 events ); public $helpers = array('Js' => array('Jquery')); public function beforeFilter() { parent::beforeFilter(); $this->Auth->allow('restSearch'); $this->Auth->allow('returnAttributes'); $this->Auth->allow('downloadAttachment'); $this->Auth->allow('text'); // permit reuse of CSRF tokens on the search page. if ('search' == $this->request->params['action']) { $this->Security->csrfUseOnce = false; } $this->Security->validatePost = true; // convert uuid to id if present in the url, and overwrite id field if (isset($this->params->query['uuid'])) { $params = array( 'conditions' => array('Attribute.uuid' => $this->params->query['uuid']), 'recursive' => 0, 'fields' => 'Attribute.id' ); $result = $this->Attribute->find('first', $params); if (isset($result['Attribute']) && isset($result['Attribute']['id'])) { $id = $result['Attribute']['id']; $this->params->addParams(array('pass' => array($id))); // FIXME find better way to change id variable if uuid is found. params->url and params->here is not modified accordingly now } } // do not show private to other orgs // if not admin or own org, check private as well.. if (!$this->_isSiteAdmin()) { $this->paginate = Set::merge($this->paginate,array( 'conditions' => array('OR' => array( 'Event.org =' => $this->Auth->user('org'), 'AND' => array( 'Attribute.distribution >' => 0, 'Event.distribution >' => 0, ))))); } /* We want to show this outside now as discussed with Christophe. Still not pushable, but anything should be pullable that's visible // do not show cluster outside server if ($this->_isRest()) { $this->paginate = Set::merge($this->paginate,array( 'conditions' => array("AND" => array('Event.cluster !=' => true),array('Attribute.cluster !=' => true)), //array("AND" => array(array('Event.private !=' => 2))), )); } */ } /** * index method * * @return void * */ public function index() { $this->Attribute->recursive = 0; $this->Attribute->contain = array('Event.id', 'Event.orgc', 'Event.org', 'Event.info'); $this->set('isSearch', 0); $this->set('attributes', $this->paginate()); $this->set('attrDescriptions', $this->Attribute->fieldDescriptions); $this->set('typeDefinitions', $this->Attribute->typeDefinitions); $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); } /** * add method * * @return void * * @throws NotFoundException // TODO Exception */ public function add($eventId = null) { if (!$this->userRole['perm_add']) { throw new MethodNotAllowedException('You don\'t have permissions to create attributes'); } if ($this->request->is('ajax')) { $this->set('ajax', true); $this->layout = 'ajax'; } else $this->set('ajax', false); if ($this->request->is('post')) { if ($this->request->is('ajax')) $this->autoRender = false; $this->loadModel('Event'); $date = new DateTime(); // Give error if someone tried to submit a attribute with attachment or malware-sample type. // TODO change behavior attachment options - this is bad ... it should rather by a messagebox or should be filtered out on the view level if (isset($this->request->data['Attribute']['type']) && $this->Attribute->typeIsAttachment($this->request->data['Attribute']['type'])) { $this->Session->setFlash(__('Attribute has not been added: attachments are added by "Add attachment" button', true), 'default', array(), 'error'); $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); } // remove the published flag from the event $this->Event->recursive = -1; $this->Event->read(null, $this->request->data['Attribute']['event_id']); if (!$this->_isSiteAdmin() && ($this->Event->data['Event']['orgc'] != $this->_checkOrg() || !$this->userRole['perm_modify'])) { throw new UnauthorizedException('You do not have permission to do that.'); } $this->Event->set('timestamp', $date->getTimestamp()); $this->Event->set('published', 0); $this->Event->save($this->Event->data, array('fieldList' => array('published', 'timestamp', 'info'))); // // multiple attributes in batch import // if ((isset($this->request->data['Attribute']['batch_import']) && $this->request->data['Attribute']['batch_import'] == 1)) { // make array from value field $attributes = explode("\n", $this->request->data['Attribute']['value']); $fails = ""; // will be used to keep a list of the lines that failed or succeeded $successes = ""; $failCount = 0; $successCount = 0; // TODO loop-holes, // the value null value thing foreach ($attributes as $key => $attribute) { $attribute = trim($attribute); if (strlen($attribute) == 0) continue; // don't do anything for empty lines $this->Attribute->create(); $this->request->data['Attribute']['value'] = $attribute; // set the value as the content of the single line // TODO loop-holes, // there seems to be a loop-hole in misp here // be it an create and not an update $this->Attribute->id = null; if ($this->Attribute->save($this->request->data)) { $successes .= " " . ($key + 1); $successCount++; } else { $fails .= " " . ($key + 1); $failCount++; } } if ($this->request->is('ajax')) { $this->autoRender = false; if ($fails) { $error_message = 'The lines' . $fails . ' could not be saved. Please, try again.'; return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'errors' => $error_message)), 'status' => 200)); } else { return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => $successCount . ' Attributes added')), 'status' => 200)); } } else { // we added all the attributes, if ($fails) { // list the ones that failed if (!CakeSession::read('Message.flash')) { $this->Session->setFlash(__('The lines' . $fails . ' could not be saved. Please, try again.', true), 'default', array(), 'error'); } else { $existingFlash = CakeSession::read('Message.flash'); $this->Session->setFlash(__('The lines' . $fails . ' could not be saved. ' . $existingFlash['message'], true), 'default', array(), 'error'); } } if ($successes) { // list the ones that succeeded $this->Session->setFlash(__('The lines' . $successes . ' have been saved', true)); } $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); } } else { if (isset($this->request->data['Attribute']['uuid'])) { // TODO here we should start RESTful dialog // check if the uuid already exists and also save the existing attribute for further checks $existingAttribute = null; $existingAttribute = $this->Attribute->find('first', array('conditions' => array('Attribute.uuid' => $this->request->data['Attribute']['uuid']))); //$existingAttributeCount = $this->Attribute->find('count', array('conditions' => array('Attribute.uuid' => $this->request->data['Attribute']['uuid']))); if ($existingAttribute) { // TODO RESTfull, set responce location header..so client can find right URL to edit $this->response->header('Location', Configure::read('MISP.baseurl') . '/attributes/' . $existingAttribute['Attribute']['id']); $this->response->send(); $this->view($this->Attribute->getId()); $this->render('view'); return false; } else { // if the attribute doesn't exist yet, check whether it has a timestamp - if yes, it's from a push, keep the timestamp we had, if no create a timestamp if (!isset($this->request->data['Attribute']['timestamp'])) { $this->request->data['Attribute']['timestamp'] = $date->getTimestamp(); } } } else { if (!isset($this->request->data['Attribute']['timestamp'])) { $this->request->data['Attribute']['timestamp'] = $date->getTimestamp(); } } // // single attribute // // create the attribute $this->Attribute->create(); $savedId = $this->Attribute->getId(); if ($this->Attribute->save($this->request->data)) { if ($this->_isRest()) { // REST users want to see the newly created attribute $this->view($this->Attribute->getId()); $this->render('view'); } elseif ($this->request->is('ajax')) { $this->autoRender = false; return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => 'Attribute added.')),'status'=>200)); } else { // inform the user and redirect $this->Session->setFlash(__('The attribute has been saved')); $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); } } else { if ($this->_isRest()) { // TODO return error if REST // REST users want to see the failed attribute $this->view($savedId); $this->render('view'); } elseif ($this->request->is('ajax')) { $this->autoRender = false; return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => $this->Attribute->validationErrors)),'status'=>200)); } else { if (!CakeSession::read('Message.flash')) { $this->Session->setFlash(__('The attribute could not be saved. Please, try again.')); } } } } } else { // set the event_id in the form $this->request->data['Attribute']['event_id'] = $eventId; } // combobox for types $types = array_keys($this->Attribute->typeDefinitions); $types = $this->_arrayToValuesIndexArray($types); $this->set('types', $types); // combobos for categories $categories = $this->Attribute->validate['category']['rule'][1]; array_pop($categories); $categories = $this->_arrayToValuesIndexArray($categories); $this->set('categories', compact('categories')); $this->loadModel('Event'); $events = $this->Event->findById($eventId); $this->set('event_id', $events['Event']['id']); // combobox for distribution $this->set('distributionLevels', $this->Attribute->distributionLevels); $this->set('currentDist', $events['Event']['distribution']); // TODO default distribution // tooltip for distribution $this->set('distributionDescriptions', $this->Attribute->distributionDescriptions); $this->set('attrDescriptions', $this->Attribute->fieldDescriptions); $this->set('typeDefinitions', $this->Attribute->typeDefinitions); $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); $this->set('published', $events['Event']['published']); } public function download($id = null) { $this->Attribute->id = $id; if (!$this->Attribute->exists()) { throw new NotFoundException(__('Invalid attribute')); } $this->Attribute->read(); if (!$this->_isSiteAdmin() && $this->Auth->user('org') != $this->Attribute->data['Event']['org'] && ($this->Attribute->data['Event']['distribution'] == 0 || $this->Attribute->data['Attribute']['distribution'] == 0 )) { throw new UnauthorizedException('You do not have the permission to view this event.'); } $this->__downloadAttachment($this->Attribute->data['Attribute']); } private function __downloadAttachment($attribute) { $path = "files" . DS . $attribute['event_id'] . DS; $file = $attribute['id']; $filename = ''; if ('attachment' == $attribute['type']) { $filename = $attribute['value']; $fileExt = pathinfo($filename, PATHINFO_EXTENSION); $filename = substr($filename, 0, strlen($filename) - strlen($fileExt) - 1); } elseif ('malware-sample' == $attribute['type']) { $filenameHash = explode('|', $attribute['value']); $filename = $filenameHash[0]; $filename = substr($filenameHash[0], strrpos($filenameHash[0], '\\')); $fileExt = "zip"; } else { throw new NotFoundException(__('Attribute not an attachment or malware-sample')); } $this->autoRender = false; $this->response->type($fileExt); $this->response->file($path . $file, array('download' => true, 'name' => $filename . '.' . $fileExt)); } /** * add_attachment method * * @return void * @throws InternalErrorException */ public function add_attachment($eventId = null) { $sha256 = null; $sha1 = null; //$ssdeep = null; if ($this->request->is('post')) { $this->loadModel('Event'); $this->Event->id = $this->request->data['Attribute']['event_id']; $this->Event->recursive = -1; $this->Event->read(); if (!$this->_isSiteAdmin() && ($this->Event->data['Event']['orgc'] != $this->_checkOrg() || !$this->userRole['perm_modify'])) { throw new UnauthorizedException('You do not have permission to do that.'); } // Check if there were problems with the file upload // only keep the last part of the filename, this should prevent directory attacks $filename = basename($this->request->data['Attribute']['value']['name']); $tmpfile = new File($this->request->data['Attribute']['value']['tmp_name']); if ((isset($this->request->data['Attribute']['value']['error']) && $this->request->data['Attribute']['value']['error'] == 0) || (!empty( $this->request->data['Attribute']['value']['tmp_name']) && $this->request->data['Attribute']['value']['tmp_name'] != 'none') ) { if (!is_uploaded_file($tmpfile->path)) throw new InternalErrorException('PHP says file was not uploaded. Are you attacking me?'); } else { $this->Session->setFlash(__('There was a problem to upload the file.', true), 'default', array(), 'error'); $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); } // save the file-info in the database $this->Attribute->create(); if ($this->request->data['Attribute']['malware']) { $this->request->data['Attribute']['type'] = "malware-sample"; // Validate filename if (!preg_match('@^[\w\-. ]+$@', $filename)) throw new Exception ('Filename not allowed'); $this->request->data['Attribute']['value'] = $filename . '|' . hash_file('md5', $tmpfile->path); // TODO gives problems with bigger files $sha256 = (hash_file('sha256', $tmpfile->path)); $sha1 = (hash_file('sha1', $tmpfile->path)); $this->request->data['Attribute']['to_ids'] = 1; // LATER let user choose to send this to IDS } else { $this->request->data['Attribute']['type'] = "attachment"; // Validate filename if (!preg_match('@^[\w\-. ]+$@', $filename)) throw new Exception ('Filename not allowed'); $this->request->data['Attribute']['value'] = $filename; $this->request->data['Attribute']['to_ids'] = 0; } $this->request->data['Attribute']['uuid'] = String::uuid(); $this->request->data['Attribute']['batch_import'] = 0; if ($this->Attribute->save($this->request->data)) { // attribute saved correctly in the db // remove the published flag from the event $this->Event->id = $this->request->data['Attribute']['event_id']; $this->Event->saveField('published', 0); } else { $this->Session->setFlash(__('The attribute could not be saved. Did you already upload this file?')); $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); } // no errors in file upload, entry already in db, now move the file where needed and zip it if required. // no sanitization is required on the filename, path or type as we save // create directory structure if (PHP_OS == 'WINNT') { $rootDir = APP . "files" . DS . $this->request->data['Attribute']['event_id']; } else { $rootDir = APP . DS . "files" . DS . $this->request->data['Attribute']['event_id']; } $dir = new Folder($rootDir, true); // move the file to the correct location $destpath = $rootDir . DS . $this->Attribute->id; // id of the new attribute in the database $file = new File ($destpath); $zipfile = new File ($destpath . '.zip'); $fileInZip = new File($rootDir . DS . $filename); // FIXME do sanitization of the filename if ($file->exists() || $zipfile->exists() || $fileInZip->exists()) { // this should never happen as the attribute id should be unique $this->Session->setFlash(__('Attachment with this name already exist in this event.', true), 'default', array(), 'error'); // remove the entry from the database $this->Attribute->delete(); $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); } if (!move_uploaded_file($tmpfile->path, $file->path)) { $this->Session->setFlash(__('Problem with uploading attachment. Cannot move it to its final location.', true), 'default', array(), 'error'); // remove the entry from the database $this->Attribute->delete(); $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); } // zip and password protect the malware files if ($this->request->data['Attribute']['malware']) { // TODO check if CakePHP has no easy/safe wrapper to execute commands $execRetval = ''; $execOutput = array(); rename($file->path, $fileInZip->path); // TODO check if no workaround exists for the current filtering mechanisms if (PHP_OS == 'WINNT') { exec("zip -j -P infected " . $zipfile->path . ' "' . $fileInZip->path . '"', $execOutput, $execRetval); } else { exec("zip -j -P infected " . $zipfile->path . ' "' . addslashes($fileInZip->path) . '"', $execOutput, $execRetval); } if ($execRetval != 0) { // not EXIT_SUCCESS $this->Session->setFlash(__('Problem with zipping the attachment. Please report to administrator. ' . $execOutput, true), 'default', array(), 'error'); // remove the entry from the database $this->Attribute->delete(); $fileInZip->delete(); $file->delete(); $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); }; $fileInZip->delete(); // delete the original not-zipped-file rename($zipfile->path, $file->path); // rename the .zip to .nothing } if ($this->request->data['Attribute']['malware']) { $temp = $this->request->data; $this->Attribute->create(); $temp['Attribute']['type'] = 'filename|sha256'; $temp['Attribute']['value'] = $filename . '|' .$sha256; $temp['Attribute']['uuid'] = String::uuid(); $this->Attribute->save($temp, array('fieldlist' => array('value', 'type', 'category', 'event_id', 'distribution', 'to_ids', 'comment'))); $this->Attribute->create(); $temp['Attribute']['type'] = 'filename|sha1'; $temp['Attribute']['value'] = $filename . '|' .$sha1; $temp['Attribute']['uuid'] = String::uuid(); $this->Attribute->save($temp, array('fieldlist' => array('value', 'type', 'category', 'event_id', 'distribution', 'to_ids', 'comment'))); } // everything is done, now redirect to event view $this->Session->setFlash(__('The attachment has been uploaded')); $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); } else { // set the event_id in the form $this->request->data['Attribute']['event_id'] = $eventId; } // combobos for categories $categories = $this->Attribute->validate['category']['rule'][1]; // just get them with attachments.. $selectedCategories = array(); foreach ($categories as $category) { if (isset($this->Attribute->categoryDefinitions[$category])) { $types = $this->Attribute->categoryDefinitions[$category]['types']; $alreadySet = false; foreach ($types as $type) { if ($this->Attribute->typeIsAttachment($type) && !$alreadySet) { // add to the whole.. $selectedCategories[] = $category; $alreadySet = true; continue; } } } }; $categories = $this->_arrayToValuesIndexArray($selectedCategories); $this->set('categories',$categories); $this->set('attrDescriptions', $this->Attribute->fieldDescriptions); $this->set('typeDefinitions', $this->Attribute->typeDefinitions); $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); $this->set('zippedDefinitions', $this->Attribute->zippedDefinitions); $this->set('uploadDefinitions', $this->Attribute->uploadDefinitions); // combobox for distribution $this->loadModel('Event'); $this->set('distributionDescriptions', $this->Attribute->distributionDescriptions); $this->set('distributionLevels', $this->Event->distributionLevels); $events = $this->Event->findById($eventId); $this->set('currentDist', $events['Event']['distribution']); $this->set('published', $events['Event']['published']); } /** * Imports the CSV threatConnect file to multiple attributes * @param int $id The id of the event */ public function add_threatconnect($eventId = null) { if ($this->request->is('post')) { $this->loadModel('Event'); $this->Event->id = $eventId; $this->Event->recursive = -1; $this->Event->read(); if (!$this->_isSiteAdmin() && ($this->Event->data['Event']['orgc'] != $this->_checkOrg() || !$this->userRole['perm_modify'])) { throw new UnauthorizedException('You do not have permission to do that.'); } // // File upload // // Check if there were problems with the file upload $tmpfile = new File($this->request->data['Attribute']['value']['tmp_name']); if ((isset($this->request->data['Attribute']['value']['error']) && $this->request->data['Attribute']['value']['error'] == 0) || (!empty( $this->request->data['Attribute']['value']['tmp_name']) && $this->request->data['Attribute']['value']['tmp_name'] != 'none') ) { if (!is_uploaded_file($tmpfile->path)) throw new InternalErrorException('PHP says file was not uploaded. Are you attacking me?'); } else { $this->Session->setFlash(__('There was a problem to upload the file.', true), 'default', array(), 'error'); $this->redirect(array('controller' => 'attributes', 'action' => 'add_threatconnect', $this->request->data['Attribute']['event_id'])); } // verify mime type $file_info = $tmpfile->info(); if ($file_info['mime'] != 'text/plain') { $this->Session->setFlash('File not in CSV format.', 'default', array(), 'error'); $this->redirect(array('controller' => 'attributes', 'action' => 'add_threatconnect', $this->request->data['Attribute']['event_id'])); } // parse uploaded csv file $filename = $tmpfile->path; $header = NULL; $entries = array(); if (($handle = fopen($filename, 'r')) !== FALSE) { while (($row = fgetcsv($handle, 0, ',', '"')) !== FALSE) { if(!$header) $header = $row; else $entries[] = array_combine($header, $row); } fclose($handle); } // verify header of the file (first row) $required_headers = array('Type', 'Value', 'Confidence', 'Description', 'Source'); if (count(array_intersect($header, $required_headers)) != count($required_headers)) { $this->Session->setFlash('Incorrect ThreatConnect headers. The minimum required headers are: '.implode(',', $required_headers), 'default', array(), 'error'); $this->redirect(array('controller' => 'attributes', 'action' => 'add_threatconnect', $this->request->data['Attribute']['event_id'])); } // // import attributes // $attributes = array(); // array with all the attributes we're going to save foreach($entries as $entry) { $attribute = array(); $attribute['event_id'] = $this->request->data['Attribute']['event_id']; $attribute['value'] = $entry['Value']; $attribute['to_ids'] = ($entry['Confidence'] > 51) ? 1 : 0; // To IDS if high confidence $attribute['comment'] = 'ThreatConnect: ' . $entry['Description']; $attribute['distribution'] = '3'; // 'All communities' if (Configure::read('MISP.default_attribute_distribution') != null) { if (Configure::read('MISP.default_attribute_distribution') === 'event') { $attribute['distribution'] = $this->Event->data['Event']['distribution']; } else { $attribute['distribution'] = Configure::read('MISP.default_attribute_distribution'); } } switch($entry['Type']) { case 'Address': $attribute['category'] = 'Network activity'; $attribute['type'] = 'ip-dst'; break; case 'Host': $attribute['category'] = 'Network activity'; $attribute['type'] = 'domain'; break; case 'EmailAddress': $attribute['category'] = 'Payload delivery'; $attribute['type'] = 'email-src'; break; case 'File': $attribute['category'] = 'Artifacts dropped'; $attribute['value'] = strtolower($attribute['value']); if (preg_match("#^[0-9a-f]{32}$#", $attribute['value'])) $attribute['type'] = 'md5'; else if (preg_match("#^[0-9a-f]{40}$#", $attribute['value'])) $attribute['type'] = 'sha1'; else if (preg_match("#^[0-9a-f]{64}$#", $attribute['value'])) $attribute['type'] = 'sha256'; else // do not keep attributes that do not have a match $attribute=NULL; break; case 'URL': $attribute['category'] = 'Network activity'; $attribute['type'] = 'url'; break; default: // do not keep attributes that do not have a match $attribute=NULL; } // add attribute to the array that will be saved if ($attribute) $attributes[] = $attribute; } // // import source info: // // 1/ iterate over all the sources, unique // 2/ add uniques as 'Internal reference' // 3/ if url format -> 'link' // else 'comment' $references = array(); foreach($entries as $entry) { $references[$entry['Source']] = true; } $references = array_keys($references); // generate the Attributes foreach($references as $reference) { $attribute = array(); $attribute['event_id'] = $this->request->data['Attribute']['event_id']; $attribute['category'] = 'Internal reference'; if (preg_match('#^(http|ftp)(s)?\:\/\/((([a-z|0-9|\-]{1,25})(\.)?){2,7})($|/.*$)#i', $reference)) $attribute['type'] = 'link'; else $attribute['type'] = 'comment'; $attribute['value'] = $reference; $attribute['distribution'] = 3; // 'All communities' // add attribute to the array that will be saved $attributes[] = $attribute; } // // finally save all the attributes at once, and continue if there are validation errors // $this->Attribute->saveMany($attributes, array('validate' => true)); // data imported (with or without errors) // remove the published flag from the event $this->loadModel('Event'); $this->Event->id = $this->request->data['Attribute']['event_id']; $this->Event->saveField('published', 0); // everything is done, now redirect to event view $this->Session->setFlash(__('The ThreatConnect data has been imported')); $this->redirect(array('controller' => 'events', 'action' => 'view', $this->request->data['Attribute']['event_id'])); } else { // set the event_id in the form $this->request->data['Attribute']['event_id'] = $eventId; } // form not submitted, show page $this->loadModel('Event'); $events = $this->Event->findById($eventId); $this->set('published', $events['Event']['published']); } /** * edit method * * @param string $id * @return void * @throws NotFoundException */ public function edit($id = null) { $this->Attribute->id = $id; $date = new DateTime(); if (!$this->Attribute->exists()) { throw new NotFoundException(__('Invalid attribute')); } $this->Attribute->read(); //set stuff to fix undefined index: uuid if (!$this->_isRest()) { $uuid = $this->Attribute->data['Attribute']['uuid']; } if (!$this->_isSiteAdmin()) { // if ($this->Attribute->data['Event']['orgc'] == $this->Auth->user('org') && (($this->userRole['perm_modify'] && $this->Attribute->data['Event']['user_id'] != $this->Auth->user('id')) || $this->userRole['perm_modify_org'])) { // Allow the edit } else { $this->Session->setFlash(__('Invalid attribute.')); $this->redirect(array('controller' => 'events', 'action' => 'index')); } } $eventId = $this->Attribute->data['Attribute']['event_id']; if ('attachment' == $this->Attribute->data['Attribute']['type'] || 'malware-sample' == $this->Attribute->data['Attribute']['type'] ) { $this->set('attachment', true); // TODO we should ensure 'value' cannot be changed here and not only on a view level (because of the associated file) // $this->Session->setFlash(__('You cannot edit attachment attributes.', true), 'default', array(), 'error'); // $this->redirect(array('controller' => 'events', 'action' => 'view', $old_attribute['Event']['id'])); } else { $this->set('attachment', false); } if ($this->request->is('post') || $this->request->is('put')) { // reposition to get the attribute.id with given uuid // Notice (8): Undefined index: uuid [APP/Controller/AttributesController.php, line 502] // Fixed - uuid was not passed back from the form since it's not a field. Set the uuid in a variable for non rest users, rest should have uuid. // Generally all of this should be _isRest() only, but that's something for later to think about if ($this->_isRest()) { $existingAttribute = $this->Attribute->findByUuid($this->request->data['Attribute']['uuid']); } else { $existingAttribute = $this->Attribute->findByUuid($uuid); } if (count($existingAttribute)) { $this->request->data['Attribute']['id'] = $existingAttribute['Attribute']['id']; } // check if the attribute has a timestamp already set (from a previous instance that is trying to edit via synchronisation) if (isset($this->request->data['Attribute']['timestamp'])) { // check which attribute is newer if ($this->request->data['Attribute']['timestamp'] > $existingAttribute['Attribute']['timestamp']) { // carry on with adding this attribute - Don't forget! if orgc!=user org, create shadow attribute, not attribute! } else { // the old one is newer or the same, replace the request's attribute with the old one $this->request->data['Attribute'] = $existingAttribute['Attribute']; } } else { $this->request->data['Attribute']['timestamp'] = $date->getTimestamp(); } $fieldList = array('category', 'type', 'value1', 'value2', 'to_ids', 'distribution', 'value', 'timestamp', 'comment'); $this->loadModel('Event'); $this->Event->id = $eventId; // enabling / disabling the distribution field in the edit view based on whether user's org == orgc in the event $this->Event->read(); if ($this->Attribute->save($this->request->data)) { $this->Session->setFlash(__('The attribute has been saved')); // remove the published flag from the event $this->Event->set('timestamp', $date->getTimestamp()); $this->Event->set('published', 0); $this->Event->save($this->Event->data, array('fieldList' => array('published', 'timestamp', 'info'))); if ($this->_isRest()) { // REST users want to see the newly created event $this->view($this->Attribute->getId()); $this->render('view'); } else { $this->redirect(array('controller' => 'events', 'action' => 'view', $eventId)); } } else { if (!CakeSession::read('Message.flash')) { $this->Session->setFlash(__('The attribute could not be saved. Please, try again.')); } else { $this->request->data = $this->Attribute->read(null, $id); } } } else { $this->request->data = $this->Attribute->read(null, $id); } $this->set('attribute', $this->request->data); // enabling / disabling the distribution field in the edit view based on whether user's org == orgc in the event $this->loadModel('Event'); $this->Event->id = $eventId; $this->Event->read(); $this->set('published', $this->Event->data['Event']['published']); // needed for RBAC // combobox for types $types = array_keys($this->Attribute->typeDefinitions); $types = $this->_arrayToValuesIndexArray($types); $this->set('types', $types); // combobox for categories $categories = $this->Attribute->validate['category']['rule'][1]; array_pop($categories); // remove that last empty/space option $categories = $this->_arrayToValuesIndexArray($categories); $this->set('categories', $categories); $this->set('currentDist', $this->Event->data['Event']['distribution']); // combobox for distribution $this->set('distributionLevels', $this->Attribute->distributionLevels); // tooltip for distribution $this->set('distributionDescriptions', $this->Attribute->distributionDescriptions); $this->set('attrDescriptions', $this->Attribute->fieldDescriptions); $this->set('typeDefinitions', $this->Attribute->typeDefinitions); $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); } // ajax edit - post a single edited field and this method will attempt to save it and return a json with the validation errors if they occur. public function editField($id) { if ((!$this->request->is('post') && !$this->request->is('put')) || !$this->request->is('ajax')) throw new MethodNotAllowedException(); $this->Attribute->id = $id; if (!$this->Attribute->exists()) { return new CakeResponse(array('body'=> json_encode(array('fail' => false, 'errors' => 'Invalid attribute')),'status'=>200)); } $this->Attribute->recursive = -1; $this->Attribute->contain('Event'); $attribute = $this->Attribute->read(); if (!$this->_isSiteAdmin()) { // if ($this->Attribute->data['Event']['orgc'] == $this->Auth->user('org') && (($this->userRole['perm_modify'] && $this->Attribute->data['Event']['user_id'] != $this->Auth->user('id')) || $this->userRole['perm_modify_org'])) { // Allow the edit } else { return new CakeResponse(array('body'=> json_encode(array('fail' => false, 'errors' => 'Invalid attribute')),'status'=>200)); } } foreach ($this->request->data['Attribute'] as $changedKey => $changedField) { if ($attribute['Attribute'][$changedKey] == $changedField) { $this->autoRender = false; return new CakeResponse(array('body'=> json_encode('nochange'),'status'=>200)); } $attribute['Attribute'][$changedKey] = $changedField; } $date = new DateTime(); $attribute['Attribute']['timestamp'] = $date->getTimestamp(); if ($this->Attribute->save($attribute)) { $event = $this->Attribute->Event->find('first', array( 'recursive' => -1, 'fields' => array('id', 'published', 'timestamp', 'info'), 'conditions' => array( 'id' => $attribute['Attribute']['event_id'], ))); $event['Event']['timestamp'] = $date->getTimestamp(); $event['Event']['published'] = 0; $this->Attribute->Event->save($event, array('fieldList' => array('published', 'timestamp', 'info'))); $this->autoRender = false; return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => 'Field updated.')),'status'=>200)); } else { $this->autoRender = false; return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => $this->Attribute->validationErrors)),'status'=>200)); } } public function view($id, $hasChildren = 0) { $this->Attribute->id = $id; if (!$this->Attribute->exists()) { throw new NotFoundException('Invalid attribute'); } $this->Attribute->recursive = -1; $this->Attribute->contain('Event'); $attribute = $this->Attribute->read(); if (!$this->_isSiteAdmin()) { // if ($this->Attribute->data['Event']['org'] == $this->Auth->user('org') || (($this->Attribute->data['Event']['distribution'] > 0) && $this->Attribute->data['Attribute']['distribution'] > 0)) { throw new MethodNotAllowed('Invalid attribute'); } } $eventRelations = $this->Attribute->Event->getRelatedAttributes($this->Auth->user(), $this->_isSiteAdmin(), $attribute['Attribute']['event_id']); $attribute['Attribute']['relations'] = array(); if (isset($eventRelations[$id])) { foreach ($eventRelations[$id] as $relations) { $attribute['Attribute']['relations'][] = array($relations['id'], $relations['info'], $relations['org']); } } $object = $attribute['Attribute']; $object['objectType'] = 0; $object['hasChildren'] = $hasChildren; $this->set('object', $object); $this->set('distributionLevels', $this->Attribute->Event->distributionLevels); /* $this->autoRender = false; $responseObject = array(); return new CakeResponse(array('body'=> json_encode($attribute['Attribute']),'status'=>200)); */ } /** * delete method * * @param string $id * @return void * @throws MethodNotAllowedException * @throws NotFoundException * * and is able to delete w/o question */ public function delete($id = null) { if ($this->request->is('ajax')) { if ($this->request->is('post')) { if ($this->__delete($id)) { return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => 'Attribute deleted.')),'status'=>200)); } else { return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => 'Attribute was not deleted.')),'status'=>200)); } } else { $this->set('id', $id); $attribute = $this->Attribute->find('first', array( 'conditions' => array('id' => $id), 'recursive' => -1, 'fields' => array('id', 'event_id'), )); $this->set('event_id', $attribute['Attribute']['event_id']); $this->render('ajax/attributeConfirmationForm'); } } else { if (!$this->request->is('post') && !$this->_isRest()) { throw new MethodNotAllowedException(); } if ($this->__delete($id)) { $this->Session->setFlash(__('Attribute deleted')); } else { $this->Session->setFlash(__('Attribute was not deleted')); } if (!$this->_isRest()) $this->redirect($this->referer()); // TODO check else $this->redirect(array('action' => 'index')); } } /** * unification of the actual delete for the multi-select * * @param unknown $id * @throws NotFoundException * @throws MethodNotAllowedException * @return boolean * * returns true/false based on success */ private function __delete($id) { $this->Attribute->id = $id; if (!$this->Attribute->exists()) { return false; } $result = $this->Attribute->find('first', array( 'conditions' => array('Attribute.id' => $id), 'fields' => array('Attribute.id, Attribute.event_id', 'Attribute.uuid'), 'contain' => array('Event' => array( 'fields' => array('Event.id', 'Event.orgc', 'Event.org', 'Event.locked') )), )); // find the uuid $uuid = $result['Attribute']['uuid']; // check for permissions if (!$this->_isSiteAdmin()) { if ($result['Event']['locked']) { if ($this->_checkOrg() != $result['Event']['org'] || !$this->userRole['perm_sync']) { throw new MethodNotAllowedException(); } } else { if ($this->_checkOrg() != $result['Event']['orgc']) { throw new MethodNotAllowedException(); } } } // attachment will be deleted with the beforeDelete() function in the Model if ($this->Attribute->delete()) { // delete the attribute from remote servers //$this->__deleteAttributeFromServers($uuid); // We have just deleted the attribute, let's also check if there are any shadow attributes that were attached to it and delete them $this->loadModel('ShadowAttribute'); $this->ShadowAttribute->deleteAll(array('ShadowAttribute.old_id' => $id), false); return true; } else { return false; } } public function deleteSelected($id) { if (!$this->request->is('post') && !$this->request->is('ajax')) { //if (!$this->request->is('post')) { throw new MethodNotAllowedException(); } // get a json object with a list of attribute IDs to be deleted // check each of them and return a json object with the successful deletes and the failed ones. $ids = json_decode($this->request->data['Attribute']['ids']); if (!$this->_isSiteAdmin()) { $event = $this->Attribute->Event->find('first', array( 'conditions' => array('id' => $id), 'recursive' => -1, 'fields' => array('id', 'orgc', 'user_id') )); if ($event['Event']['orgc'] != $this->Auth->user('org') || (!$this->userRole['perm_modify_org'] && !($this->userRole['perm_modify'] && $event['Event']['user_id'] == $this->Auth->user('id')))) { throw new MethodNotAllowedException('Invalid Event.'); } } // find all attributes from the ID list that also match the provided event ID. $attributes = $this->Attribute->find('all', array( 'recursive' => -1, 'conditions' => array('id' => $ids, 'event_id' => $id), 'fields' => array('id', 'event_id') )); $successes = array(); foreach ($attributes as $a) { if ($this->__delete($a['Attribute']['id'])) $successes[] = $a['Attribute']['id']; } $fails = array_diff($ids, $successes); $this->autoRender = false; if (count($fails) == 0 && count($successes) > 0) { return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => count($successes) . ' attribute' . (count($successes) != 1 ? 's' : '') . ' deleted.')),'status'=>200)); } else { return new CakeResponse(array('body'=> json_encode(array('saved' => false, 'errors' => count($successes) . ' attribute' . (count($successes) != 1 ? 's' : '') . ' deleted, but ' . count($fails) . ' attribute' . (count($fails) != 1 ? 's' : '') . ' could not be deleted.')),'status'=>200)); } } public function editSelected($id) { if (!$this->request->is('ajax')) throw new MethodNotAllowedException('This method can only be accessed via AJAX.'); if ($this->request->is('post')) { $event = $this->Attribute->Event->find('first', array( 'conditions' => array('id' => $id), 'recursive' => -1, 'fields' => array('id', 'orgc', 'user_id') )); if (!$this->_isSiteAdmin()) { if ($event['Event']['orgc'] != $this->Auth->user('org') || (!$this->userRole['perm_modify_org'] && !($this->userRole['perm_modify'] && $event['user_id'] == $this->Auth->user('id')))) { throw new MethodNotAllowedException('You are not authorized to edit this event.'); } } $attribute_ids = json_decode($this->request->data['Attribute']['attribute_ids']); $attributes = $this->Attribute->find('all', array( 'conditions' => array( 'id' => $attribute_ids, 'event_id' => $id, ), //to_ids = true/false, distribution = [0,1,2,3] //'fields' => array('id', 'event_id', 'comment', 'to_ids', 'timestamp', 'distribution'), 'recursive' => -1, )); if ($this->request->data['Attribute']['to_ids'] == 2 && $this->request->data['Attribute']['distribution'] == 4 && $this->request->data['Attribute']['comment'] == null) { $this->autoRender = false; return new CakeResponse(array('body'=> json_encode(array('saved' => true)),'status' => 200)); } if ($this->request->data['Attribute']['to_ids'] != 2) { foreach ($attributes as &$attribute) $attribute['Attribute']['to_ids'] = ($this->request->data['Attribute']['to_ids'] == 0 ? false : true); } if ($this->request->data['Attribute']['distribution'] != 4) { foreach ($attributes as &$attribute) $attribute['Attribute']['distribution'] = $this->request->data['Attribute']['distribution']; } if ($this->request->data['Attribute']['comment'] != null) { foreach ($attributes as &$attribute) $attribute['Attribute']['comment'] = $this->request->data['Attribute']['comment']; } $date = new DateTime(); $timestamp = $date->getTimestamp(); foreach ($attributes as &$attribute) $attribute['Attribute']['timestamp'] = $timestamp; if($this->Attribute->saveMany($attributes)) { $this->autoRender = false; return new CakeResponse(array('body'=> json_encode(array('saved' => true)),'status' => 200)); } else { $this->autoRender = false; return new CakeResponse(array('body'=> json_encode(array('saved' => false)),'status' => 200)); } } else { if (!isset($id)) throw new MethodNotAllowedException('No event ID provided.'); $this->layout = 'ajax'; $this->set('id', $id); $this->set('distributionLevels', $this->Attribute->distributionLevels); $this->set('distributionDescriptions', $this->Attribute->distributionDescriptions); $this->set('attrDescriptions', $this->Attribute->fieldDescriptions); $this->render('ajax/attributeEditMassForm'); } } /** * Deletes this specific attribute from all remote servers * TODO move this to a component(?) */ private function __deleteAttributeFromServers($uuid) { // get a list of the servers with push active $this->loadModel('Server'); $servers = $this->Server->find('all', array('conditions' => array('push' => 1))); // iterate over the servers and upload the attribute if (empty($servers)) return; App::uses('SyncTool', 'Tools'); foreach ($servers as &$server) { $syncTool = new SyncTool(); $HttpSocket = $syncTool->setupHttpSocket($server); $this->Attribute->deleteAttributeFromServer($uuid, $server, $HttpSocket); } } public function search() { $fullAddress = '/attributes/search'; if ($this->request->here == $fullAddress) { $this->set('attrDescriptions', $this->Attribute->fieldDescriptions); $this->set('typeDefinitions', $this->Attribute->typeDefinitions); $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); // reset the paginate_conditions $this->Session->write('paginate_conditions',array()); if ($this->request->is('post') && ($this->request->here == $fullAddress)) { $keyword = $this->request->data['Attribute']['keyword']; $keyword2 = $this->request->data['Attribute']['keyword2']; $tags = $this->request->data['Attribute']['tags']; $org = $this->request->data['Attribute']['org']; $type = $this->request->data['Attribute']['type']; $ioc = $this->request->data['Attribute']['ioc']; $this->set('ioc', $ioc); $category = $this->request->data['Attribute']['category']; $this->set('keywordSearch', $keyword); $this->set('tags', $tags); $keyWordText = null; $keyWordText2 = null; $keyWordText3 = null; $this->set('typeSearch', $type); $this->set('isSearch', 1); $this->set('categorySearch', $category); // search the db $conditions = array(); if ($ioc) { $conditions['AND'][] = array('Attribute.to_ids =' => 1); $conditions['AND'][] = array('Event.published =' => 1); } // search on the value field if (isset($keyword)) { $keywordArray = explode("\n", $keyword); $this->set('keywordArray', $keywordArray); $i = 1; $temp = array(); $temp2 = array(); foreach ($keywordArray as $keywordArrayElement) { $saveWord = trim(strtolower($keywordArrayElement)); if ($saveWord != '') { $toInclude = true; if ($saveWord[0] == '!') { $toInclude = false; $saveWord = substr($saveWord, 1); } if (preg_match('@^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(\d|[1-2]\d|3[0-2]))$@', $saveWord)) { $cidrresults = $this->Cidr->CIDR($saveWord); foreach ($cidrresults as $result) { $result = strtolower($result); if (strpos($result, '|')) { $resultParts = explode('|', $result); if (!toInclude) { $temp2[] = array( 'AND' => array( 'LOWER(Attribute.value1) NOT LIKE' => $resultParts[0], 'LOWER(Attribute.value2) NOT LIKE' => $resultParts[1], )); } else { $temp[] = array( 'AND' => array( 'LOWER(Attribute.value1)' => $resultParts[0], 'LOWER(Attribute.value2)' => $resultParts[1], )); } } else { if (!$toInclude) { array_push($temp2, array('LOWER(Attribute.value1) NOT LIKE' => $result)); array_push($temp2, array('LOWER(Attribute.value2) NOT LIKE' => $result)); } else { array_push($temp, array('LOWER(Attribute.value1) LIKE' => $result)); array_push($temp, array('LOWER(Attribute.value2) LIKE' => $result)); } } } } else { if (strpos($saveWord, '|')) { $resultParts = explode('|', $saveWord); if (!$toInclude) { $temp2[] = array( 'AND' => array( 'LOWER(Attribute.value1) NOT LIKE' => '%' . $resultParts[0], 'LOWER(Attribute.value2) NOT LIKE' => $resultParts[1] . '%', )); } else { $temp2[] = array( 'AND' => array( 'LOWER(Attribute.value1)' => '%' . $resultParts[0], 'LOWER(Attribute.value2)' => $resultParts[1] . '%', )); } } else { if (!$toInclude) { array_push($temp2, array('LOWER(Attribute.value1) NOT LIKE' => '%' . $saveWord . '%')); array_push($temp2, array('LOWER(Attribute.value2) NOT LIKE' => '%' . $saveWord . '%')); } else { array_push($temp, array('LOWER(Attribute.value1) LIKE' => '%' . $saveWord . '%')); array_push($temp, array('LOWER(Attribute.value2) LIKE' => '%' . $saveWord . '%')); } } } if ($toInclude) { array_push($temp, array('LOWER(Attribute.comment) LIKE' => '%' . $saveWord . '%')); } else { array_push($temp2, array('LOWER(Attribute.comment) NOT LIKE' => '%' . $saveWord . '%')); } } if ($i == 1 && $saveWord != '') $keyWordText = $saveWord; else if (($i > 1 && $i < 10) && $saveWord != '') $keyWordText = $keyWordText . ', ' . $saveWord; else if ($i == 10 && $saveWord != '') $keyWordText = $keyWordText . ' and several other keywords'; $i++; } $this->set('keywordSearch', $keyWordText); if (!empty($temp)) { $conditions['AND']['OR'] = $temp; } if (!empty($temp2)) { $conditions['AND'][] = $temp2; } } // event IDs to be excluded if (isset($keyword2)) { $keywordArray2 = explode("\n", $keyword2); $i = 1; $temp = array(); foreach ($keywordArray2 as $keywordArrayElement) { $saveWord = trim($keywordArrayElement); if (empty($saveWord)) continue; if ($saveWord[0] == '!') { $temp[] = array('Attribute.event_id !=' => substr($saveWord, 1)); } else { $temp['OR'][] = array('Attribute.event_id =' => $saveWord); } if ($i == 1 && $saveWord != '') $keyWordText2 = $saveWord; else if (($i > 1 && $i < 10) && $saveWord != '') $keyWordText2 = $keyWordText2 . ', ' . $saveWord; else if ($i == 10 && $saveWord != '') $keyWordText2 = $keyWordText2 . ' and several other events'; $i++; } $this->set('keywordSearch2', $keyWordText2); if (!empty($temp)) { $conditions['AND'][] = $temp; } } if (!empty($tags)) { $include = array(); $exclude = array(); $keywordArray = explode("\n", $tags); foreach ($keywordArray as $tagname) { $tagname = trim($tagname); if (substr($tagname, 0, 1) === '!') $exclude[] = substr($tagname, 1); else $include[] = $tagname; } $this->loadModel('Tag'); if (!empty($include)) $conditions['AND'][] = array('OR' => array('Attribute.event_id' => $this->Tag->findTags($include))); if (!empty($exclude)) $conditions['AND'][] = array('Attribute.event_id !=' => $this->Tag->findTags($exclude)); } if ($type != 'ALL') { $conditions['Attribute.type ='] = $type; } if ($category != 'ALL') { $conditions['Attribute.category ='] = $category; } // organisation search field $i = 1; $temp = array(); if (isset($org)) { $orgArray = explode("\n", $org); foreach ($orgArray as $orgArrayElement) { $saveWord = trim($orgArrayElement); if (empty($saveWord)) continue; if ($saveWord[0] == '!') { $temp[] = array('Event.orgc NOT LIKE ' => '%' . substr($saveWord, 1) . '%'); } else { $temp['OR'][] = array('Event.orgc LIKE ' => '%' . $saveWord . '%'); } } if ($i == 1 && $saveWord != '') $keyWordText3 = $saveWord; else if (($i > 1 && $i < 10) && $saveWord != '') $keyWordText3 = $keyWordText3 . ', ' . $saveWord; else if ($i == 10 && $saveWord != '') $keyWordText3 = $keyWordText3 . ' and several other organisations'; $i++; $this->set('orgSearch', $keyWordText3); if (!empty($temp)) { $conditions['AND'][] = $temp; } } if ($this->request->data['Attribute']['alternate']) { $events = $this->searchAlternate($conditions); $this->set('events', $events); $this->render('alternate_search_result'); } else { $this->Attribute->recursive = 0; $this->paginate = array( 'limit' => 60, 'maxLimit' => 9999, // LATER we will bump here on a problem once we have more than 9999 attributes? 'conditions' => $conditions, 'contain' => array('Event.orgc', 'Event.id', 'Event.org', 'Event.user_id', 'Event.info') ); if (!$this->_isSiteAdmin()) { // merge in private conditions $this->paginate = Set::merge($this->paginate, array( 'conditions' => array("OR" => array( array('Event.org =' => $this->Auth->user('org')), array("AND" => array('Event.org !=' => $this->Auth->user('org')), array('Event.distribution !=' => 0), array('Attribute.distribution !=' => 0)))), ) ); } $idList = array(); $attributeIdList = array(); $attributes = $this->paginate(); // if we searched for IOCs only, apply the whitelist to the search result! if ($ioc) { $this->loadModel('Whitelist'); $attributes = $this->Whitelist->removeWhitelistedFromArray($attributes, true); } foreach ($attributes as &$attribute) { $attributeIdList[] = $attribute['Attribute']['id']; if (!in_array($attribute['Attribute']['event_id'], $idList)) { $idList[] = $attribute['Attribute']['event_id']; } } $this->set('attributes', $attributes); // and store into session $this->Session->write('paginate_conditions', $this->paginate); $this->Session->write('paginate_conditions_keyword', $keyword); $this->Session->write('paginate_conditions_keyword2', $keyword2); $this->Session->write('paginate_conditions_org', $org); $this->Session->write('paginate_conditions_type', $type); $this->Session->write('paginate_conditions_ioc', $ioc); $this->Session->write('paginate_conditions_tags', $tags); $this->Session->write('paginate_conditions_category', $category); $this->Session->write('search_find_idlist', $idList); $this->Session->write('search_find_attributeidlist', $attributeIdList); // set the same view as the index page $this->render('index'); } } else { // no search keyword is given, show the search form // adding filtering by category and type // combobox for types $types = array('' => array('ALL' => 'ALL'), 'types' => array()); $types['types'] = array_merge($types['types'], $this->_arrayToValuesIndexArray(array_keys($this->Attribute->typeDefinitions))); $this->set('types', $types); // combobox for categories $categories = array('' => array('ALL' => 'ALL', '' => ''), 'categories' => array()); array_pop($this->Attribute->validate['category']['rule'][1]); // remove that last 'empty' item $categories['categories'] = array_merge($categories['categories'], $this->_arrayToValuesIndexArray($this->Attribute->validate['category']['rule'][1])); $this->set('categories', $categories); } } else { $this->set('attrDescriptions', $this->Attribute->fieldDescriptions); $this->set('typeDefinitions', $this->Attribute->typeDefinitions); $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); // get from Session $keyword = $this->Session->read('paginate_conditions_keyword'); $keyword2 = $this->Session->read('paginate_conditions_keyword2'); $org = $this->Session->read('paginate_conditions_org'); $type = $this->Session->read('paginate_conditions_type'); $category = $this->Session->read('paginate_conditions_category'); $tags = $this->Session->read('paginate_conditions_tags'); $this->set('keywordSearch', $keyword); $this->set('keywordSearch2', $keyword2); $this->set('orgSearch', $org); $this->set('typeSearch', $type); $this->set('tags', $tags); $this->set('isSearch', 1); $this->set('categorySearch', $category); // re-get pagination $this->Attribute->recursive = 0; $this->paginate = $this->Session->read('paginate_conditions'); $this->set('attributes', $this->paginate()); // set the same view as the index page $this->render('index'); } } // If the checkbox for the alternate search is ticked, then this method is called to return the data to be represented // This alternate view will show a list of events with matching search results and the percentage of those matched attributes being marked as to_ids // events are sorted based on relevance (as in the percentage of matches being flagged as indicators for IDS) public function searchAlternate($data) { $data['AND'][] = array( "OR" => array( array('Event.org =' => $this->Auth->user('org')), array("AND" => array('Event.org !=' => $this->Auth->user('org')), array('Event.distribution !=' => 0), array('Attribute.distribution !=' => 0)))); $attributes = $this->Attribute->find('all', array( 'conditions' => $data, 'fields' => array( 'Attribute.id', 'Attribute.event_id', 'Attribute.type', 'Attribute.category', 'Attribute.to_ids', 'Attribute.value', 'Attribute.distribution', 'Event.id', 'Event.org', 'Event.orgc', 'Event.info', 'Event.distribution', 'Event.attribute_count' ))); $events = array(); foreach ($attributes as $attribute) { if (isset($events[$attribute['Event']['id']])) { if ($attribute['Attribute']['to_ids']) { $events[$attribute['Event']['id']]['to_ids']++; } else { $events[$attribute['Event']['id']]['no_ids']++; } } else { $events[$attribute['Event']['id']]['Event'] = $attribute['Event']; $events[$attribute['Event']['id']]['to_ids'] = 0; $events[$attribute['Event']['id']]['no_ids'] = 0; if ($attribute['Attribute']['to_ids']) { $events[$attribute['Event']['id']]['to_ids']++; } else { $events[$attribute['Event']['id']]['no_ids']++; } } } foreach ($events as &$event) { $event['relevance'] = 100 * $event['to_ids'] / ($event['no_ids'] + $event['to_ids']); } if (!empty($events)) $events = $this->__subval_sort($events, 'relevance'); return $events; } // Sort the array of arrays based on a value of a sub-array private function __subval_sort($a,$subkey) { foreach($a as $k=>$v) { $b[$k] = strtolower($v[$subkey]); } arsort($b); foreach($b as $key=>$val) { $c[] = $a[$key]; } return $c; } public function downloadAttributes() { $idList = $this->Session->read('search_find_idlist'); $this->response->type('xml'); // set the content type $this->header('Content-Disposition: download; filename="misp.attribute.search.xml"'); $this->layout = 'xml/default'; $this->loadModel('Attribute'); if (!isset($idList)) { print "No results found to export\n"; } else { foreach ($idList as $listElement) { $put['OR'][] = array('Attribute.id' => $listElement); } $conditions['AND'][] = $put; // restricting to non-private or same org if the user is not a site-admin. if (!$this->_isSiteAdmin()) { $temp = array(); array_push($temp, array('Attribute.distribution >' => 0)); array_push($temp, array('OR' => $distribution)); array_push($temp, array('(SELECT events.org FROM events WHERE events.id = Attribute.event_id) LIKE' => $this->_checkOrg())); $put2['OR'][] = $temp; $conditions['AND'][] = $put2; } $params = array( 'conditions' => $conditions, //array of conditions 'recursive' => 0, //int 'fields' => array('Attribute.id', 'Attribute.value'), //array of field names 'order' => array('Attribute.id'), //string or array defining order ); $attributes = $this->Attribute->find('all', $params); $this->set('results', $attributes); } $this->render('xml'); } public function checkComposites() { if (!self::_isAdmin()) throw new NotFoundException(); $this->set('fails', $this->Attribute->checkComposites()); } // Use the rest interface to search for attributes. Usage: // MISP-base-url/attributes/restSearch/[api-key]/[value]/[type]/[category]/[orgc] // value, type, category, orgc are optional // the last 4 fields accept the following operators: // && - you can use && between two search values to put a logical OR between them. for value, 1.1.1.1&&2.2.2.2 would find attributes with the value being either of the two. // ! - you can negate a search term. For example: google.com&&!mail would search for all attributes with value google.com but not ones that include mail. www.google.com would get returned, mail.google.com wouldn't. public function restSearch($key='download', $value=null, $type=null, $category=null, $org=null, $tags=null) { if ($tags) $tags = str_replace(';', ':', $tags); if ($tags === 'null') $tags = null; if ($value === 'null') $value = null; if ($type === 'null') $type = null; if ($category === 'null') $category = null; if ($org === 'null') $org = null; if ($key!=null && $key!='download') { $user = $this->checkAuthUser($key); } else { if (!$this->Auth->user()) throw new UnauthorizedException('You are not authorized. Please send the Authorization header with your auth key along with an Accept header for application/xml.'); $user = $this->checkAuthUser($this->Auth->user('authkey')); } if (!$user) { throw new UnauthorizedException('This authentication key is not authorized to be used for exports. Contact your administrator.'); } $value = str_replace('|', '/', $value); // request handler for POSTed queries. If the request is a post, the parameters (apart from the key) will be ignored and replaced by the terms defined in the posted json or xml object. // The correct format for both is a "request" root element, as shown by the examples below: // For Json: {"request":{"value": "7.7.7.7&&1.1.1.1","type":"ip-src"}} // For XML: <request><value>7.7.7.7&amp;&amp;1.1.1.1</value><type>ip-src</type></request> // the response type is used to determine the parsing method (xml/json) if ($this->request->is('post')) { if ($this->response->type() === 'application/json') { $data = $this->request->input('json_decode', true); } elseif ($this->response->type() === 'application/xml' && !empty($this->request->data)) { $data = $this->request->data; } else { throw new BadRequestException('Either specify the search terms in the url, or POST a json array / xml (with the root element being "request" and specify the correct accept and content type headers.'); } $paramArray = array('value', 'type', 'category', 'org', 'tags'); foreach ($paramArray as $p) { if (isset($data['request'][$p])) ${$p} = $data['request'][$p]; else ${$p} = null; } } if (!isset($this->request->params['ext']) || $this->request->params['ext'] !== 'json') { $this->response->type('xml'); // set the content type $this->layout = 'xml/default'; $this->header('Content-Disposition: download; filename="misp.search.attribute.results.xml"'); } else { $this->response->type('json'); // set the content type $this->layout = 'json/default'; $this->header('Content-Disposition: download; filename="misp.search.attribute.results.json"'); } $conditions['AND'] = array(); $subcondition = array(); $this->loadModel('Attribute'); // add the values as specified in the 2nd parameter to the conditions $values = explode('&&', $value); $parameters = array('value', 'type', 'category', 'org'); foreach ($parameters as $k => $param) { if (isset(${$parameters[$k]}) && ${$parameters[$k]}!=='null') { $elements = explode('&&', ${$parameters[$k]}); foreach($elements as $v) { if (substr($v, 0, 1) == '!') { if ($parameters[$k] === 'value' && preg_match('@^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(\d|[1-2]\d|3[0-2]))$@', substr($v, 1))) { $cidrresults = $this->Cidr->CIDR(substr($v, 1)); foreach ($cidrresults as $result) { $subcondition['AND'][] = array('Attribute.value NOT LIKE' => $result); } } else { if ($parameters[$k] === 'org') { $subcondition['AND'][] = array('Event.' . $parameters[$k] . ' NOT LIKE' => '%'.substr($v, 1).'%'); } else { $subcondition['AND'][] = array('Attribute.' . $parameters[$k] . ' NOT LIKE' => '%'.substr($v, 1).'%'); } } } else { if ($parameters[$k] === 'value' && preg_match('@^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(\d|[1-2]\d|3[0-2]))$@', substr($v, 1))) { $cidrresults = $this->Cidr->CIDR($v); foreach ($cidrresults as $result) { $subcondition['OR'][] = array('Attribute.value LIKE' => $result); } } else { if ($parameters[$k] === 'org') { $subcondition['OR'][] = array('Event.' . $parameters[$k] . ' LIKE' => '%'.$v.'%'); } else { $subcondition['OR'][] = array('Attribute.' . $parameters[$k] . ' LIKE' => '%'.$v.'%'); } } } } array_push ($conditions['AND'], $subcondition); $subcondition = array(); } } // If we are looking for an attribute, we want to retrieve some extra data about the event to be able to check for the permissions. if (!$user['User']['siteAdmin']) { $temp = array(); $temp['AND'] = array('Event.distribution >' => 0, 'Attribute.distribution >' => 0); $subcondition['OR'][] = $temp; $subcondition['OR'][] = array('Event.org' => $user['User']['org']); array_push($conditions['AND'], $subcondition); } // If we sent any tags along, load the associated tag names for each attribute if ($tags) { $args = $this->Attribute->dissectArgs($tags); $this->loadModel('Tag'); $tagArray = $this->Tag->fetchEventTagIds($args[0], $args[1]); $temp = array(); foreach ($tagArray[0] as $accepted) { $temp['OR'][] = array('Event.id' => $accepted); } $conditions['AND'][] = $temp; $temp = array(); foreach ($tagArray[1] as $rejected) { $temp['AND'][] = array('Event.id !=' => $rejected); } $conditions['AND'][] = $temp; } // change the fields here for the attribute export!!!! Don't forget to check for the permissions, since you are not going through fetchevent. Maybe create fetchattribute? $params = array( 'conditions' => $conditions, 'fields' => array('Attribute.*', 'Event.org', 'Event.distribution'), 'contain' => array('Event' => array()) ); $results = $this->Attribute->find('all', $params); $this->loadModel('Whitelist'); $results = $this->Whitelist->removeWhitelistedFromArray($results, true); if (empty($results)) throw new NotFoundException('No matches.'); $this->set('results', $results); } // returns an XML with attributes that belong to an event. The type of attributes to be returned can be restricted by type using the 3rd parameter. // Similar to the restSearch, this parameter can be chained with '&&' and negations are accepted too. For example filename&&!filename|md5 would return all filenames that don't have an md5 // The usage of returnAttributes is the following: [MISP-url]/attributes/returnAttributes/<API-key>/<type>/<signature flag> // The signature flag is off by default, enabling it will only return attribugtes that have the to_ids flag set to true. public function returnAttributes($key='download', $id, $type = null, $sigOnly = false) { $user = $this->checkAuthUser($key); // if the user is authorised to use the api key then user will be populated with the user's account // in addition we also set a flag indicating whether the user is a site admin or not. if ($key!=null && $key!='download') { $user = $this->checkAuthUser($key); } else { if (!$this->Auth->user()) throw new UnauthorizedException('You are not authorized. Please send the Authorization header with your auth key along with an Accept header for application/xml.'); $user = $this->checkAuthUser($this->Auth->user('authkey')); } if (!$user) { throw new UnauthorizedException('This authentication key is not authorized to be used for exports. Contact your administrator.'); } if ($this->request->is('post')) { if ($this->response->type() === 'application/json') { $data = $this->request->input('json_decode', true); } elseif ($this->response->type() === 'application/xml' && !empty($this->request->data)) { $data = $this->request->data; } else { throw new BadRequestException('Either specify the search terms in the url, or POST a json array / xml (with the root element being "request" and specify the correct accept and content type headers.'); } $paramArray = array('type', 'sigOnly'); foreach ($paramArray as $p) { if (isset($data['request'][$p])) ${$p} = $data['request'][$p]; else ${$p} = null; } } $this->loadModel('Event'); $this->Event->read(null, $id); $myEventOrAdmin = false; if ($user['User']['siteAdmin'] || $this->Event->data['Event']['org'] == $user['User']['org']) { $myEventOrAdmin = true; } if (!$myEventOrAdmin) { if ($this->Event->data['Event']['distribution'] == 0) { throw new UnauthorizedException('You don\'t have access to that event.'); } } $this->response->type('xml'); // set the content type $this->layout = 'xml/default'; $this->header('Content-Disposition: download; filename="misp.search.attribute.results.xml"'); // check if user can see the event! $conditions['AND'] = array(); $include = array(); $exclude = array(); $attributes = array(); // If there is a type set, create the include and exclude arrays from it if (isset($type)) { $elements = explode('&&', $type); foreach($elements as $v) { if (substr($v, 0, 1) == '!') { $exclude[] = substr($v, 1); } else { $include[] = $v; } } } // check each attribute foreach($this->Event->data['Attribute'] as $k => $attribute) { $contained = false; // If the include list is empty, then we just then the first check should always set contained to true (basically we chose type = all - exclusions, or simply all) if (empty($include)) { $contained = true; } else { // If we have elements in $include we should check if the attribute's type should be included foreach ($include as $inc) { if (strpos($attribute['type'], $inc) !== false) { $contained = true; } } } // If we have either everything included or the attribute passed the include check, we should check if there is a reason to exclude the attribute // For example, filename may be included, but md5 may be excluded, meaning that filename|md5 should be removed if ($contained) { foreach ($exclude as $exc) { if (strpos($attribute['type'], $exc) !== false) { $contained = false; continue 2; } } } // If we still didn't throw the attribute away, let's check if the user requesting the attributes is of the owning organisation of the event // and if not, whether the distribution of the attribute allows the user to see it if ($contained && !$myEventOrAdmin && $attribute['distribution'] == 0) { $contained = false; } // If we have set the sigOnly parameter and the attribute has to_ids set to false, discard it! if ($contained && $sigOnly === 'true' && !$attribute['to_ids']) { $contained = false; } // If after all of this $contained is still true, let's add the attribute to the array if ($contained) $attributes[] = $attribute; } if (empty($attributes)) throw new NotFoundException('No matches.'); $this->set('results', $attributes); } public function downloadAttachment($key='download', $id) { if ($key!=null && $key!='download') { $user = $this->checkAuthUser($key); } else { if (!$this->Auth->user()) throw new UnauthorizedException('You are not authorized. Please send the Authorization header with your auth key along with an Accept header for application/xml.'); $user = $this->checkAuthUser($this->Auth->user('authkey')); } // if the user is authorised to use the api key then user will be populated with the user's account // in addition we also set a flag indicating whether the user is a site admin or not. if (!$user) { throw new UnauthorizedException('This authentication key is not authorized to be used for exports. Contact your administrator.'); } $this->Attribute->id = $id; if(!$this->Attribute->exists()) { throw new NotFoundException('Invalid attribute or no authorisation to view it.'); } $this->Attribute->read(null, $id); if (!$user['User']['siteAdmin'] && $user['User']['org'] != $this->Attribute->data['Event']['org'] && ($this->Attribute->data['Event']['distribution'] == 0 || $this->Attribute->data['Attribute']['distribution'] == 0 )) { throw new NotFoundException('Invalid attribute or no authorisation to view it.'); } $this->__downloadAttachment($this->Attribute->data['Attribute']); } public function text($key='download', $type='all', $tags=false, $eventId=false, $allowNonIDS=false) { if ($eventId === 'null' || $eventId == '0' || $eventId === 'false') $eventId = false; if ($allowNonIDS === 'null' || $allowNonIDS === '0' || $allowNonIDS === 'false') $allowNonIDS = false; if ($type === 'null' || $type === '0' || $type === 'false') $type = 'all'; if ($tags === 'null' || $tags === '0' || $tags === 'false') $tags = false; if ($key != 'download') { // check if the key is valid -> search for users based on key $user = $this->checkAuthUser($key); if (!$user) { throw new UnauthorizedException('This authentication key is not authorized to be used for exports. Contact your administrator.'); } } else { if (!$this->Auth->user('id')) { throw new UnauthorizedException('You have to be logged in to do that.'); } } $this->response->type('txt'); // set the content type $this->header('Content-Disposition: download; filename="misp.' . $type . '.txt"'); $this->layout = 'text/default'; $attributes = $this->Attribute->text($this->_checkOrg(), $this->_isSiteAdmin(), $type, $tags, $eventId, $allowNonIDS); $this->loadModel('Whitelist'); $attributes = $this->Whitelist->removeWhitelistedFromArray($attributes, true); $this->set('attributes', $attributes); } public function reportValidationIssuesAttributes() { // TODO improve performance of this function by eliminating the additional SQL query per attribute // search for validation problems in the attributes if (!self::_isSiteAdmin()) throw new NotFoundException(); $this->set('result', $this->Attribute->reportValidationIssuesAttributes()); } public function generateCorrelation() { if (!self::_isSiteAdmin()) throw new NotFoundException(); if (!Configure::read('MISP.background_jobs')) { $k = $this->Attribute->generateCorrelation(); $this->Session->setFlash(__('All done. ' . $k . ' attributes processed.')); $this->redirect(array('controller' => 'pages', 'action' => 'display', 'administration')); } else { $job = ClassRegistry::init('Job'); $job->create(); $data = array( 'worker' => 'default', 'job_type' => 'generate correlation', 'job_input' => 'All attributes', 'status' => 0, 'retries' => 0, 'org' => 'ADMIN', 'message' => 'Job created.', ); $job->save($data); $jobId = $job->id; $process_id = CakeResque::enqueue( 'default', 'AdminShell', array('jobGenerateCorrelation', $jobId) ); $job->saveField('process_id', $process_id); $this->Session->setFlash(__('Job queued. You can view the progress if you navigate to the active jobs view (administration -> jobs).')); $this->redirect(array('controller' => 'pages', 'action' => 'display', 'administration')); } } public function fetchViewValue($id, $field = null) { $validFields = array('value', 'comment', 'type', 'category', 'to_ids', 'distribution', 'timestamp'); if (!isset($field) || !in_array($field, $validFields)) throw new MethodNotAllowedException('Invalid field requested.'); //if (!$this->request->is('ajax')) throw new MethodNotAllowedException('This function can only be accessed via AJAX.'); $this->Attribute->id = $id; if (!$this->Attribute->exists()) { throw new NotFoundException(__('Invalid attribute')); } $attribute = $this->Attribute->find('first', array( 'recursive' => -1, 'conditions' => array('Attribute.id' => $id), 'fields' => array('id', 'distribution', 'event_id', $field), 'contain' => array( 'Event' => array( 'fields' => array('distribution', 'id', 'org'), ) ) )); if (!$this->_isSiteAdmin()) { // if (!($attribute['Event']['org'] == $this->Auth->user('org') || ($attribute['Event']['distribution'] > 0 && $attribute['Attribute']['distribution'] > 0))) { throw new NotFoundException(__('Invalid attribute')); } } $result = $attribute['Attribute'][$field]; if ($field == 'distribution') $result=$this->Attribute->distributionLevels[$result]; if ($field == 'to_ids') $result = ($result == 0 ? 'No' : 'Yes'); if ($field == 'timestamp') { if (isset($result)) $result = date('Y-m-d', $result); else echo '&nbsp'; } $this->set('value', $result); $this->layout = 'ajax'; $this->render('ajax/attributeViewFieldForm'); } public function fetchEditForm($id, $field = null) { $validFields = array('value', 'comment', 'type', 'category', 'to_ids', 'distribution'); if (!isset($field) || !in_array($field, $validFields)) throw new MethodNotAllowedException('Invalid field requested.'); if (!$this->request->is('ajax')) throw new MethodNotAllowedException('This function can only be accessed via AJAX.'); $this->Attribute->id = $id; if (!$this->Attribute->exists()) { throw new NotFoundException(__('Invalid attribute')); } $fields = array('id', 'distribution', 'event_id'); $additionalFieldsToLoad = $field; if ($field == 'category' || $field == 'type') { $fields[] = 'type'; $fields[] = 'category'; } else { $fields[] = $field; } $attribute = $this->Attribute->find('first', array( 'recursive' => -1, 'conditions' => array('Attribute.id' => $id), 'fields' => $fields, 'contain' => array( 'Event' => array( 'fields' => array('distribution', 'id', 'user_id', 'orgc'), ) ) )); if (!$this->_isSiteAdmin()) { // if ($attribute['Event']['orgc'] == $this->Auth->user('org') && (($this->userRole['perm_modify'] && $attribute['Event']['user_id'] != $this->Auth->user('id')) || $this->userRole['perm_modify_org'])) { // Allow the edit } else { throw new NotFoundException(__('Invalid attribute')); } } $this->layout = 'ajax'; if ($field == 'distribution') $this->set('distributionLevels', $this->Attribute->distributionLevels); if ($field == 'category') { $typeCategory = array(); foreach ($this->Attribute->categoryDefinitions as $k => $category) { foreach ($category['types'] as $type) { $typeCategory[$type][] = $k; } } $this->set('typeCategory', $typeCategory); } if ($field == 'type') { $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); } $this->set('object', $attribute['Attribute']); $fieldURL = ucfirst($field); $this->render('ajax/attributeEdit' . $fieldURL . 'Form'); } public function attributeReplace($id) { if (!$this->userRole['perm_add']) { throw new MethodNotAllowedException('Event not found or you don\'t have permissions to create attributes'); } $event = $this->Attribute->Event->find('first', array( 'conditions' => array('Event.id' => $id), 'fields' => array('id', 'orgc', 'distribution'), 'recursive' => -1 )); if (empty($event) || (!$this->_isSiteAdmin() && ($event['Event']['orgc'] != $this->Auth->user('org') || !$this->userRole['perm_add']))) throw new MethodNotAllowedException('Event not found or you don\'t have permissions to create attributes'); $this->set('event_id', $id); if ($this->request->is('get')) { $this->layout = 'ajax'; $this->request->data['Attribute']['event_id'] = $id; // combobox for types $types = array_keys($this->Attribute->typeDefinitions); $types = $this->_arrayToValuesIndexArray($types); $this->set('types', $types); // combobos for categories $categories = $this->Attribute->validate['category']['rule'][1]; array_pop($categories); $categories = $this->_arrayToValuesIndexArray($categories); $this->set('categories', compact('categories')); $this->set('attrDescriptions', $this->Attribute->fieldDescriptions); $this->set('typeDefinitions', $this->Attribute->typeDefinitions); $this->set('categoryDefinitions', $this->Attribute->categoryDefinitions); } if ($this->request->is('post')) { if (!$this->request->is('ajax')) throw new MethodNotAllowedException('This action can only be accessed via AJAX.'); $newValues = explode(PHP_EOL, $this->request->data['Attribute']['value']); $category = $this->request->data['Attribute']['category']; $type = $this->request->data['Attribute']['type']; $to_ids = $this->request->data['Attribute']['to_ids']; if (!$this->_isSiteAdmin() && $this->Auth->user('org') != $event['Event']['orgc'] && !$this->userRole['perm_add']) throw new MethodNotAllowedException('You are not authorised to do that.'); $oldAttributes = $this->Attribute->find('all', array( 'conditions' => array( 'event_id' => $id, 'category' => $category, 'type' => $type, ), 'fields' => array('id', 'event_id', 'category', 'type', 'value'), 'recursive' => -1, )); $results = array('untouched' => count($oldAttributes), 'created' => 0, 'deleted' => 0, 'createdFail' => 0, 'deletedFail' => 0); foreach ($newValues as &$value) { $value = trim($value); $found = false; foreach ($oldAttributes as &$old) { if ($value == $old['Attribute']['value']) { $found = true; } } if (!$found) { $attribute = array( 'value' => $value, 'event_id' => $id, 'category' => $category, 'type' => $type, 'distribution' => $event['Event']['distribution'], 'to_ids' => $to_ids, ); $this->Attribute->create(); if ($this->Attribute->save(array('Attribute' => $attribute))) { $results['created']++; } else { $results['createdFail']++; } } } foreach ($oldAttributes as &$old) { if (!in_array($old['Attribute']['value'], $newValues)) { if ($this->Attribute->delete($old['Attribute']['id'])) { $results['deleted']++; $results['untouched']--; } else { $results['deletedFail']++; } } } $message = ''; $success = true; if (($results['created'] > 0 || $results['deleted'] > 0) && $results['createdFail'] == 0 && $results['deletedFail'] == 0) { $message .= 'Update completed without any issues.'; $event = $this->Attribute->Event->find('first', array( 'conditions' => array('Event.id' => $id), 'recursive' => -1 )); $event['Event']['published'] = 0; $date = new DateTime(); $event['Event']['timestamp'] = $date->getTimestamp(); $this->Attribute->Event->save($event); } else { $message .= 'Update completed with some errors.'; $success = false; } if ($results['created']) $message .= $results['created'] . ' attribute' . $this->__checkCountForOne($results['created']) . ' created. '; if ($results['createdFail']) $message .= $results['createdFail'] . ' attribute' . $this->__checkCountForOne($results['createdFail']) . ' could not be created. '; if ($results['deleted']) $message .= $results['deleted'] . ' attribute' . $this->__checkCountForOne($results['deleted']) . ' deleted.'; if ($results['deletedFail']) $message .= $results['deletedFail'] . ' attribute' . $this->__checkCountForOne($results['deletedFail']) . ' could not be deleted. '; $message .= $results['untouched'] . ' attributes left untouched. '; $this->autoRender = false; $this->layout = 'ajax'; if ($success) return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'success' => $message)),'status'=>200)); else return new CakeResponse(array('body'=> json_encode(array('saved' => true, 'errors' => $message)),'status'=>200)); } } private function __checkCountForOne($number) { if ($number != 1) return 's'; return ''; } }
0x0mar/MISP
app/Controller/AttributesController.php
PHP
agpl-3.0
85,681
[ 30522, 1026, 1029, 25718, 10439, 1024, 1024, 3594, 1006, 1005, 10439, 8663, 13181, 10820, 1005, 1010, 1005, 11486, 1005, 1007, 1025, 10439, 1024, 1024, 3594, 1006, 1005, 19622, 1005, 1010, 1005, 30524, 1002, 17961, 1008, 1013, 2465, 12332, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/**************************************************************************** * Copyright (C) 2010 * by Dimok * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any * damages arising from the use of this software. * * Permission is granted to anyone to use this software for any * purpose, including commercial applications, and to alter it and * redistribute it freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you * must not claim that you wrote the original software. If you use * this software in a product, an acknowledgment in the product * documentation would be appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and * must not be misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source * distribution. * * for WiiXplorer 2010 ***************************************************************************/ #ifndef MENU_FTP_SERVER_H_ #define MENU_FTP_SERVER_H_ #include "GUI/gui.h" #include "Controls/GXConsole.hpp" class FTPServerMenu : public GuiFrame, public sigslot::has_slots<> { public: FTPServerMenu(); virtual ~FTPServerMenu(); protected: void OnButtonClick(GuiButton *sender, int pointer, const POINT &p); GuiSound * btnSoundClick; GuiSound * btnSoundOver; GuiImageData * btnOutline; GuiImageData * btnOutlineOver; GuiImageData * network_icon; GuiImageData * bgImgData; GuiImage * bgImg; GuiImage * backBtnImg; GuiImage * MainFTPBtnImg; GuiImage * networkImg; GuiText * IPText; GuiText * backBtnTxt; GuiText * MainFTPBtnTxt; GuiButton * backBtn; GuiButton * MainFTPBtn; SimpleGuiTrigger * trigA; GuiTrigger * trigB; GXConsole * Console; }; #endif
SuperrSonic/WiiXplorer-SS
source/FTPOperations/FTPServerMenu.h
C
gpl-3.0
1,882
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2016-2021 hyStrath \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of hyStrath, a derivative work of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class Foam::energyScalingFunction Description SourceFiles energyScalingFunction.C newEnergyScalingFunction.C \*---------------------------------------------------------------------------*/ #ifndef energyScalingFunction_H #define energyScalingFunction_H #include "IOdictionary.H" #include "typeInfo.H" #include "runTimeSelectionTables.H" #include "autoPtr.H" #include "pairPotentialModel.H" #include "reducedUnits.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class energyScalingFunction Declaration \*---------------------------------------------------------------------------*/ class energyScalingFunction { protected: // Protected data word name_; dictionary energyScalingFunctionProperties_; const pairPotentialModel& pairPot_; const reducedUnits& rU_; // Private Member Functions //- Disallow copy construct energyScalingFunction(const energyScalingFunction&); //- Disallow default bitwise assignment void operator=(const energyScalingFunction&); public: //- Runtime type information TypeName("energyScalingFunction"); // Declare run-time constructor selection table declareRunTimeSelectionTable ( autoPtr, energyScalingFunction, dictionary, ( const word& name, const dictionary& energyScalingFunctionProperties, const pairPotentialModel& pairPot, const reducedUnits& rU ), (name, energyScalingFunctionProperties, pairPot, rU) ); // Selectors //- Return a reference to the selected viscosity model static autoPtr<energyScalingFunction> New ( const word& name, const dictionary& energyScalingFunctionProperties, const pairPotentialModel& pairPot, const reducedUnits& rU ); // Constructors //- Construct from components energyScalingFunction ( const word& name, const dictionary& energyScalingFunctionProperties, const pairPotentialModel& pairPot, const reducedUnits& rU ); // Destructor virtual ~energyScalingFunction() {} // Member Functions virtual void scaleEnergy(scalar& e, const scalar r) const = 0; const dictionary& energyScalingFunctionProperties() const { return energyScalingFunctionProperties_; } //- Read energyScalingFunction dictionary virtual bool read ( const dictionary& energyScalingFunctionProperties ) = 0; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //
vincentcasseau/hyStrath
src/lagrangian/molecularDynamics/polyCloud/potentials/energyScalingFunction/basic/energyScalingFunction.H
C++
gpl-3.0
4,236
[ 30522, 1013, 1008, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * This file is part of the coreboot project. * * Copyright 2017 Google Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <intelblocks/sd.h> #include "chip.h" int sd_fill_soc_gpio_info(struct acpi_gpio* gpio, struct device *dev) { config_t *config = dev->chip_info; if (!config->sdcard_cd_gpio) return -1; gpio->type = ACPI_GPIO_TYPE_INTERRUPT; gpio->pull = ACPI_GPIO_PULL_NONE; gpio->irq.mode = ACPI_IRQ_EDGE_TRIGGERED; gpio->irq.polarity = ACPI_IRQ_ACTIVE_BOTH; gpio->irq.shared = ACPI_IRQ_SHARED; gpio->irq.wake = ACPI_IRQ_WAKE; gpio->interrupt_debounce_timeout = 10000; /* 100ms */ gpio->pin_count = 1; gpio->pins[0] = config->sdcard_cd_gpio; return 0; }
MattDevo/coreboot
src/soc/intel/cannonlake/sd.c
C
gpl-2.0
1,106
[ 30522, 1013, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 1996, 4563, 27927, 2622, 1012, 1008, 1008, 9385, 2418, 8224, 4297, 1012, 1008, 1008, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 30524, 1008, 1996, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
CREATE TABLE IF NOT EXISTS Doctors( name VARCHAR(50), hospital VARCHAR(50), speciality VARCHAR(50), availability VARCHAR(50), charge INTEGER(10) ); insert into Doctors values ('thomas collins', 'grand oak community hospital', 'surgery', '9.00 a.m - 11.00 a.m', 7000); insert into Doctors values ('henry parker', 'grand oak community hospital', 'ent', '9.00 a.m - 11.00 a.m', 4500); insert into Doctors values ('abner jones', 'grand oak community hospital', 'gynaecology', '8.00 a.m - 10.00 a.m', 11000); insert into Doctors values ('abner jones', 'grand oak community hospital', 'ent', '8.00 a.m - 10.00 a.m', 6750); insert into Doctors values ('anne clement', 'clemency medical center', 'surgery', '8.00 a.m - 10.00 a.m', 12000); insert into Doctors values ('thomas kirk', 'clemency medical center', 'gynaecology', '9.00 a.m - 11.00 a.m', 8000); insert into Doctors values ('cailen cooper', 'clemency medical center', 'paediatric', '9.00 a.m - 11.00 a.m', 5500); insert into Doctors values ('seth mears', 'pine valley community hospital', 'surgery', '3.00 p.m - 5.00 p.m', 8000); insert into Doctors values ('emeline fulton', 'pine valley community hospital', 'cardiology', '8.00 a.m - 10.00 a.m', 4000); insert into Doctors values ('jared morris', 'willow gardens general hospital', 'cardiology', '9.00 a.m - 11.00 a.m', 10000); insert into Doctors values ('henry foster', 'willow gardens general hospital', 'paediatric', '8.00 a.m - 10.00 a.m', 10000);
milindaperera/product-ei
samples/data-services/sql/h2/Doctors.sql
SQL
apache-2.0
1,479
[ 30522, 3443, 2795, 2065, 2025, 6526, 7435, 1006, 2171, 13075, 7507, 2099, 1006, 2753, 1007, 1010, 2902, 13075, 7507, 2099, 1006, 2753, 1007, 1010, 2569, 3012, 13075, 7507, 2099, 1006, 2753, 1007, 1010, 11343, 13075, 7507, 2099, 1006, 2753, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<? session_start(); session_destroy(); header("Location: ../index.html"); ?>
EverywhereHouseControl/ServerBackEnd
LoginPro/php/salir.php
PHP
gpl-2.0
82
[ 30522, 1026, 1029, 5219, 1035, 2707, 1006, 1007, 1025, 5219, 1035, 6033, 1006, 1007, 1025, 20346, 1006, 1000, 3295, 1024, 1012, 1012, 1013, 5950, 1012, 16129, 1000, 1007, 1025, 1029, 1028, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package server.thread.systemSettingsThread; import java.io.IOException; import java.io.ObjectInputStream; import java.net.Socket; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import server.serverMain.serverMain; import server.thread.systemMessageThread.sendSystemMessageThread; import common.message.mainInfo; import common.message.node_public; import common.message.systemSettings; /** * 2011年10月 * * 山东科技大学信息学院 版权所有 * * 联系邮箱:415939252@qq.com * * Copyright © 1999-2012, sdust, All Rights Reserved * * @author 王昌帅 * */ public class setting_dealingThread extends Thread { Socket client; systemSettings settings; Statement state1; public setting_dealingThread(Socket s_client) throws IOException, SQLException { this.state1 = serverMain.con1.createStatement(); this.client = s_client; // start(); } public void run() { try { ObjectInputStream oin = new ObjectInputStream(client.getInputStream()); settings = (systemSettings) oin.readObject(); String sql_update = "update whetherCanAdd set can = " + settings.whetherCanAdd + " where qq = '" + settings.qq + "';"; state1.execute(sql_update); state1.close(); String text = new String("您的设置已生效"); sendSystemMessageThread sender = new sendSystemMessageThread(settings.qq, text); client.close(); } catch (Exception e) { e.printStackTrace(); } } }
wangchangshuai/fei_Q
server/src/server/thread/systemSettingsThread/setting_dealingThread.java
Java
gpl-2.0
1,584
[ 30522, 7427, 8241, 1012, 11689, 1012, 3001, 18319, 3070, 3367, 28362, 4215, 1025, 12324, 9262, 1012, 22834, 1012, 22834, 10288, 24422, 1025, 12324, 9262, 1012, 22834, 1012, 4874, 2378, 18780, 21422, 1025, 12324, 9262, 1012, 5658, 1012, 22278,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'spec_helper' module Sendgrid module API module Entities describe Stats do subject { described_class.new } it { should respond_to(:delivered) } it { should respond_to(:request) } it { should respond_to(:unique_open) } it { should respond_to(:unique_click) } it { should respond_to(:processed) } it { should respond_to(:date) } it { should respond_to(:open) } it { should respond_to(:click) } it { should respond_to(:blocked) } it { should respond_to(:spamreport) } it { should respond_to(:drop) } it { should respond_to(:bounce) } it { should respond_to(:deferred) } end end end end
renatosnrg/sendgrid-api
spec/sendgrid/api/entities/stats_spec.rb
Ruby
mit
728
[ 30522, 5478, 1005, 28699, 1035, 2393, 2121, 1005, 11336, 4604, 16523, 3593, 11336, 17928, 11336, 11422, 6235, 26319, 2079, 3395, 1063, 2649, 1035, 2465, 1012, 2047, 1065, 2009, 1063, 2323, 6869, 1035, 2000, 1006, 1024, 5359, 1007, 1065, 200...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/bin/bash #download cirros from the internet and update it to teh database
Deepankar01/openstack_scripts
glance/download.sh
Shell
apache-2.0
78
[ 30522, 1001, 999, 1013, 8026, 1013, 24234, 1001, 8816, 25022, 18933, 2015, 2013, 1996, 4274, 1998, 10651, 2009, 2000, 8915, 2232, 7809, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /************************************************************ * This plugin was modified by Revmakx * * Copyright (c) 2012 Revmakx * * www.revmakx.com * * * ************************************************************/ /************************************************************* * * installer.class.php * * Upgrade WordPress * * * Copyright (c) 2011 Prelovac Media * www.prelovac.com **************************************************************/ if(basename($_SERVER['SCRIPT_FILENAME']) == "installer.class.php"): exit; endif; class IWP_MMB_Installer extends IWP_MMB_Core { function __construct() { @set_time_limit(600); parent::__construct(); @include_once(ABSPATH . 'wp-admin/includes/file.php'); @include_once(ABSPATH . 'wp-admin/includes/plugin.php'); @include_once(ABSPATH . 'wp-includes/plugin.php'); @include_once(ABSPATH . 'wp-admin/includes/theme.php'); @include_once(ABSPATH . 'wp-admin/includes/misc.php'); @include_once(ABSPATH . 'wp-admin/includes/template.php'); @include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'); global $wp_filesystem; if (!$wp_filesystem) WP_Filesystem(); } function iwp_mmb_maintenance_mode($enable = false, $maintenance_message = '') { global $wp_filesystem; $maintenance_message .= '<?php $upgrading = ' . time() . '; ?>'; $file = $wp_filesystem->abspath() . '.maintenance'; if ($enable) { $wp_filesystem->delete($file); $wp_filesystem->put_contents($file, $maintenance_message, FS_CHMOD_FILE); } else { $wp_filesystem->delete($file); } } function bypass_url_validation($r,$url){ // $username = parse_url($url, PHP_URL_USER); // $password = parse_url($url, PHP_URL_PASS); // $r['headers'] = array('Authorization'=>'Basic'. base64_encode( $username . ':' . $password ) ); $r['reject_unsafe_urls'] = false; return $r; } function install_remote_file($params) { global $wp_filesystem; extract($params); if (!isset($package) || empty($package)) return array( 'error' => '<p>No files received. Internal error.</p>', 'error_code' => 'no_files_receive_internal_error' ); if (!$this->is_server_writable()) { return array( 'error' => 'Failed, please add FTP details', 'error_code' => 'failed_please_add_ftp_install_remote_file' ); } if (defined('WP_INSTALLING') && file_exists(ABSPATH . '.maintenance')) return array( 'error' => '<p>Site under maintanace.</p>','error_code' => 'site_under_maintanace' ); if (!class_exists('WP_Upgrader')) include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'); $upgrader_skin = new WP_Upgrader_Skin(); $upgrader_skin->done_header = true; $upgrader = new WP_Upgrader($upgrader_skin); $destination = $type == 'themes' ? WP_CONTENT_DIR . '/themes' : WP_PLUGIN_DIR; $clear_destination = isset($clear_destination) ? $clear_destination : false; add_filter( 'http_request_args',array( $this, 'bypass_url_validation' ), 10, 2 ); foreach ($package as $package_url) { $key = basename($package_url); $install_info[$key] = @$upgrader->run(array( 'package' => $package_url, 'destination' => $destination, 'clear_destination' => $clear_destination, //Do not overwrite files. 'clear_working' => true, 'hook_extra' => array() )); } if ($activate) { if ($type == 'plugins') { include_once(ABSPATH . 'wp-admin/includes/plugin.php'); wp_cache_delete( 'plugins', 'plugins' ); $all_plugins = get_plugins(); foreach ($all_plugins as $plugin_slug => $plugin) { $plugin_dir = preg_split('/\//', $plugin_slug); foreach ($install_info as $key => $install) { if (!$install || is_wp_error($install)) continue; if ($install['destination_name'] == $plugin_dir[0]) { $install_info[$key]['activated'] = activate_plugin($plugin_slug, '', false); } } } } else if (count($install_info) == 1) { global $wp_themes; include_once(ABSPATH . 'wp-includes/theme.php'); $wp_themes = null; unset($wp_themes); //prevent theme data caching if(function_exists('wp_get_themes')){ $all_themes = wp_get_themes(); foreach ($all_themes as $theme_name => $theme_data) { foreach ($install_info as $key => $install) { if (!$install || is_wp_error($install)) continue; if ($theme_data->Template == $install['destination_name']) { $install_info[$key]['activated'] = switch_theme($theme_data->Template, $theme_data->Stylesheet); } } } }else{ $all_themes = get_themes(); foreach ($all_themes as $theme_name => $theme_data) { foreach ($install_info as $key => $install) { if (!$install || is_wp_error($install)) continue; if ($theme_data['Template'] == $install['destination_name']) { $install_info[$key]['activated'] = switch_theme($theme_data['Template'], $theme_data['Stylesheet']); } } } } } } ob_clean(); $this->iwp_mmb_maintenance_mode(false); return $install_info; } function do_upgrade($params = null) { global $iwp_mmb_activities_log; if ($params == null || empty($params)) return array( 'error' => 'No upgrades passed.', 'error_code' => 'no_upgrades_passed' ); if (!$this->is_server_writable()) { return array( 'error' => 'Failed, please add FTP details', 'error_code' => 'failed_please_add_ftp_do_upgrade' ); } $params = isset($params['upgrades_all']) ? $params['upgrades_all'] : $params; $core_upgrade = isset($params['wp_upgrade']) ? $params['wp_upgrade'] : array(); $upgrade_plugins = isset($params['upgrade_plugins']) ? $params['upgrade_plugins'] : array(); $upgrade_themes = isset($params['upgrade_themes']) ? $params['upgrade_themes'] : array(); $upgrade_translations = isset($params['upgrade_translations']) ? $params['upgrade_translations'] : array(); $upgrades = array(); $premium_upgrades = array(); $user = get_user_by( 'login', $params['username'] ); $userid = $user->data->ID; if (!empty($core_upgrade) || !empty($upgrade_plugins) || !empty($upgrade_themes) || !empty($upgrade_translations)) { $iwp_mmb_activities_log->iwp_mmb_do_remove_upgrader_process_complete_action(); $iwp_mmb_activities_log->iwp_mmb_do_remove_theme_filters(); $iwp_mmb_activities_log->iwp_mmb_do_remove_upgrader_post_install_filter(); } if (!empty($core_upgrade) || !empty($upgrade_plugins) || !empty($upgrade_themes)) { $GLOBALS['iwp_client_plugin_ptc_updates'] = 1; } if (!empty($core_upgrade)) { $iwp_mmb_activities_log->iwp_mmb_do_remove_core_updated_successfully(); $upgrades['core'] = $this->upgrade_core($core_upgrade,$userid); } if (!empty($upgrade_plugins)) { $plugin_files = $plugin_details = $premium_plugin_details = array(); foreach ($upgrade_plugins as $plugin) { if (isset($plugin->file)) { $plugin_details[] = $plugin; $plugin_files[$plugin->file] = $plugin->old_version; } else { $premium_plugin_details[] = $plugin; $premium_upgrades[md5($plugin->name)] = $plugin; } } if (!empty($plugin_files)) { $upgrades['plugins'] = $this->upgrade_plugins($plugin_files,$plugin_details,$userid); } } if (!empty($upgrade_themes)) { $theme_temps = $theme_details = $premium_theme_details = array(); foreach ($upgrade_themes as $theme) { if (isset($theme['theme_tmp'])) { $theme_details[] = $theme; $theme_temps[] = $theme['theme_tmp']; } else { $premium_theme_details[] = $theme; $premium_upgrades[md5($theme['name'])] = $theme; } } if (!empty($theme_temps)) $upgrades['themes'] = $this->upgrade_themes($theme_temps,$theme_details,$userid); } if (!empty($premium_upgrades)) { $premium_upgrades = $this->upgrade_premium($premium_upgrades,$premium_plugin_details,$premium_theme_details,$userid); if (!empty($premium_upgrades)) { if (!empty($upgrades)) { foreach ($upgrades as $key => $val) { if (isset($premium_upgrades[$key])) { $upgrades[$key] = array_merge_recursive($upgrades[$key], $premium_upgrades[$key]); } } } else { $upgrades = $premium_upgrades; } } } if (!empty($upgrade_translations)) { $upgrades['translations'] = $this->upgrade_translations($upgrade_translations,$userid); } ob_clean(); $this->iwp_mmb_maintenance_mode(false); return $upgrades; } /** * Upgrades WordPress locally * */ function upgrade_translations($current,$userid){ global $iwp_activities_log_post_type, $iwp_mmb_activities_log; $GLOBALS['iwp_client_plugin_translations'] = 1; include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'); $upgrader = new Language_Pack_Upgrader( new Language_Pack_Upgrader_Skin( compact( 'url', 'nonce', 'title', 'context' ) ) ); $result = $upgrader->bulk_upgrade(); $upgradeFailed = false; if (!empty($result)) { foreach ($result as $translate_tmp => $translate_info) { if (is_wp_error($translate_info) || empty($translate_info)) { $upgradeFailed = true; $return = array('error' => $this->iwp_mmb_get_error($translate_info), 'error_code' => 'upgrade_translations_wp_error'); break; } } if(!$upgradeFailed){ $details = array(); $iwp_mmb_activities_log->iwp_mmb_save_iwp_activities('translations', 'update', $iwp_activities_log_post_type, (object)$details, $userid); $return = 'updated'; } return array('upgraded' => $return); } else { return array( 'error' => 'Upgrade failed.', 'error_code' => 'unable_to_update_translations_files' ); } } function upgrade_core($current,$userid) { global $iwp_activities_log_post_type, $iwp_mmb_activities_log; ob_start(); if (!function_exists('wp_version_check') || !function_exists('get_core_checksums')) include_once(ABSPATH . '/wp-admin/includes/update.php'); @wp_version_check(); $current_update = false; ob_end_flush(); ob_end_clean(); $core = $this->iwp_mmb_get_transient('update_core'); if (isset($core->updates) && !empty($core->updates)) { $updates = $core->updates[0]; $updated = $core->updates[0]; if (!isset($updated->response) || $updated->response == 'latest') return array( 'upgraded' => 'updated' ); if ($updated->response == "development" && $current->response == "upgrade") { return array( 'error' => '<font color="#900">Unexpected error. Please upgrade manually.</font>', 'error_code' => 'unexpected_error_please_upgrade_manually' ); } else if ($updated->response == $current->response || ($updated->response == "upgrade" && $current->response == "development")) { if ($updated->locale != $current->locale) { foreach ($updates as $update) { if ($update->locale == $current->locale) { $current_update = $update; break; } } if ($current_update == false) return array( 'error' => ' Localization mismatch. Try again.', 'error_code' => 'localization_mismatch' ); } else { $current_update = $updated; } } else return array( 'error' => ' Transient mismatch. Try again.', 'error_code' => 'transient_mismatch' ); } else return array( 'error' => ' Refresh transient failed. Try again.', 'error_code' => 'refresh_transient_failed' ); if ($current_update != false) { global $iwp_mmb_wp_version, $wp_filesystem, $wp_version; if (version_compare($wp_version, '3.1.9', '>')) { if (!class_exists('Core_Upgrader')) include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'); $core = new Core_Upgrader(); $result = $core->upgrade($current_update); $this->iwp_mmb_maintenance_mode(false); if (is_wp_error($result)) { return array( 'error' => $this->iwp_mmb_get_error($result), 'error_code' => 'maintenance_mode_upgrade_core' ); } else { $iwp_mmb_activities_log->iwp_mmb_save_iwp_activities('core', 'update', $iwp_activities_log_post_type, $current, $userid); return array( 'upgraded' => 'updated' ); } } else { if (!class_exists('WP_Upgrader')) { include_once(ABSPATH . 'wp-admin/includes/update.php'); if (function_exists('wp_update_core')) { $result = wp_update_core($current_update); if (is_wp_error($result)) { return array( 'error' => $this->iwp_mmb_get_error($result), 'error_code' => 'wp_update_core_upgrade_core' ); } else { $iwp_mmb_activities_log->iwp_mmb_save_iwp_activities('core', 'update', $iwp_activities_log_post_type, $current, $userid); return array( 'upgraded' => 'updated' ); } } } if (class_exists('WP_Upgrader')) { $upgrader_skin = new WP_Upgrader_Skin(); $upgrader_skin->done_header = true; $upgrader = new WP_Upgrader($upgrader_skin); // Is an update available? if (!isset($current_update->response) || $current_update->response == 'latest') return array( 'upgraded' => 'updated' ); $res = $upgrader->fs_connect(array( ABSPATH, WP_CONTENT_DIR )); if (is_wp_error($res)) return array( 'error' => $this->iwp_mmb_get_error($res), 'error_code' => 'upgrade_core_wp_error_res' ); $wp_dir = trailingslashit($wp_filesystem->abspath()); $core_package = false; if (isset($current_update->package) && !empty($current_update->package)) $core_package = $current_update->package; elseif (isset($current_update->packages->full) && !empty($current_update->packages->full)) $core_package = $current_update->packages->full; $download = $upgrader->download_package($core_package); if (is_wp_error($download)) return array( 'error' => $this->iwp_mmb_get_error($download), 'error_code' => 'download_upgrade_core' ); $working_dir = $upgrader->unpack_package($download); if (is_wp_error($working_dir)) return array( 'error' => $this->iwp_mmb_get_error($working_dir), 'error_code' => 'working_dir_upgrade_core' ); if (!$wp_filesystem->copy($working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true)) { $wp_filesystem->delete($working_dir, true); return array( 'error' => 'Unable to move update files.', 'error_code' => 'unable_to_move_update_files' ); } $wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE); require(ABSPATH . 'wp-admin/includes/update-core.php'); $update_core = update_core($working_dir, $wp_dir); ob_end_clean(); $this->iwp_mmb_maintenance_mode(false); if (is_wp_error($update_core)) return array( 'error' => $this->iwp_mmb_get_error($update_core), 'error_code' => 'upgrade_core_wp_error' ); ob_end_flush(); $iwp_mmb_activities_log->iwp_mmb_save_iwp_activities('core', 'update', $iwp_activities_log_post_type, $current, $userid); return array( 'upgraded' => 'updated' ); } else { return array( 'error' => 'failed', 'error_code' => 'failed_WP_Upgrader_class_not_exists' ); } } } else { return array( 'error' => 'failed', 'error_code' => 'failed_current_update_false' ); } } function upgrade_plugins($plugins = false,$plugin_details = false,$userid) { global $iwp_activities_log_post_type, $iwp_mmb_activities_log; if (!$plugins || empty($plugins)) return array( 'error' => 'No plugin files for upgrade.', 'error_code' => 'no_plugin_files_for_upgrade' ); $current = $this->iwp_mmb_get_transient('update_plugins'); $versions = array(); if(!empty($current)){ foreach($plugins as $plugin => $data){ if(isset($current->checked[$plugin])){ $versions[$current->checked[$plugin]] = $plugin; } } } $return = array(); if (class_exists('Plugin_Upgrader') && class_exists('Bulk_Plugin_Upgrader_Skin')) { $upgrader = new Plugin_Upgrader(new Bulk_Plugin_Upgrader_Skin(compact('nonce', 'url'))); $result = $upgrader->bulk_upgrade(array_keys($plugins)); if (!function_exists('wp_update_plugins')) include_once(ABSPATH . 'wp-includes/update.php'); @wp_update_plugins(); $current = $this->iwp_mmb_get_transient('update_plugins'); if (!empty($result)) { foreach ($result as $plugin_slug => $plugin_info) { if (!$plugin_info || is_wp_error($plugin_info)) { $return[$plugin_slug] = array('error' => $this->iwp_mmb_get_error($plugin_info), 'error_code' => 'upgrade_plugins_wp_error'); } else { if( !empty($result[$plugin_slug]) || ( isset($current->checked[$plugin_slug]) && version_compare(array_search($plugin_slug, $versions), $current->checked[$plugin_slug], '<') == true ) ){ foreach($plugin_details as $key=>$plugin_detail) { /* the following "if" is used to detect premium plugin properties.*/ if(is_array($plugin_detail)) { $plugin_detail = (object) $plugin_detail; } /* the above "if" is used to detect premium plugin properties.*/ if( ( isset($plugin_detail->plugin) && $plugin_slug==$plugin_detail->plugin ) || ( // This condition is used to detect premium plugin properties. isset($plugin_detail->slug) && $plugin_slug==$plugin_detail->slug ) ) { $current_plugin = array(); $current_plugin['name'] = isset($plugin_detail->name)?$plugin_detail->name:''; if(isset($plugin_detail->textdomain)) { // this "if" is used to detect premium plugin properties. $current_plugin['slug'] = $plugin_detail->textdomain; } else if(isset($plugin_detail->slug)) { $current_plugin['slug'] = $plugin_detail->slug; } else { $current_plugin['slug'] = ''; } if(isset($plugin_detail->old_version)) { $current_plugin['old_version'] = $plugin_detail->old_version; } else if(isset($plugin_detail->version)) { $current_plugin['old_version'] = $plugin_detail->version; } else { $current_plugin['old_version'] = ''; } $current_plugin['updated_version'] = isset($plugin_detail->new_version) ? $plugin_detail->new_version : ''; $iwp_mmb_activities_log->iwp_mmb_save_iwp_activities('plugins', 'update', $iwp_activities_log_post_type, (object)$current_plugin, $userid); unset($current_plugin); break; } } $return[$plugin_slug] = 1; } else { update_option('iwp_client_forcerefresh', true); $return[$plugin_slug] = array('error' => 'Could not refresh upgrade transients, please reload website data', 'error_code' => 'upgrade_plugins_could_not_refresh_upgrade_transients_please_reload_website_data'); } } } ob_end_clean(); return array( 'upgraded' => $return ); } else return array( 'error' => 'Upgrade failed.', 'error_code' => 'upgrade_failed_upgrade_plugins' ); } else { ob_end_clean(); return array( 'error' => 'WordPress update required first.', 'error_code' => 'upgrade_plugins_wordPress_update_required_first' ); } } function upgrade_themes($themes = false,$theme_details = false,$userid) { global $iwp_activities_log_post_type, $iwp_mmb_activities_log; if (!$themes || empty($themes)) return array( 'error' => 'No theme files for upgrade.', 'error_code' => 'no_theme_files_for_upgrade' ); $current = $this->iwp_mmb_get_transient('update_themes'); $versions = array(); if(!empty($current)){ foreach($themes as $theme){ if(isset($current->checked[$theme])){ $versions[$current->checked[$theme]] = $theme; } } } if (class_exists('Theme_Upgrader') && class_exists('Bulk_Theme_Upgrader_Skin')) { $upgrader = new Theme_Upgrader(new Bulk_Theme_Upgrader_Skin(compact('title', 'nonce', 'url', 'theme'))); $result = $upgrader->bulk_upgrade($themes); if (!function_exists('wp_update_themes')) include_once(ABSPATH . 'wp-includes/update.php'); @wp_update_themes(); $current = $this->iwp_mmb_get_transient('update_themes'); $return = array(); if (!empty($result)) { foreach ($result as $theme_tmp => $theme_info) { if (is_wp_error($theme_info) || empty($theme_info)) { $return[$theme_tmp] = array('error' => $this->iwp_mmb_get_error($theme_info), 'error_code' => 'upgrade_themes_wp_error'); } else { if(!empty($result[$theme_tmp]) || (isset($current->checked[$theme_tmp]) && version_compare(array_search($theme_tmp, $versions), $current->checked[$theme_tmp], '<') == true)){ foreach($theme_details as $key=>$theme_detail) { if($theme_tmp==$theme_detail['theme_tmp']) { $current_theme = array(); $current_theme['name'] = $current_theme['slug'] = $theme_detail['name']; // slug is used to get short description. Here theme name as slug. $current_theme['old_version'] = $theme_detail['old_version']; $current_theme['updated_version'] = $theme_detail['new_version']; $iwp_mmb_activities_log->iwp_mmb_save_iwp_activities('themes', 'update', $iwp_activities_log_post_type, (object)$current_theme, $userid); unset($current_theme); break; } } $return[$theme_tmp] = 1; } else { update_option('iwp_client_forcerefresh', true); $return[$theme_tmp] = array('error' => 'Could not refresh upgrade transients, please reload website data', 'error_code' => 'upgrade_themes_could_not_refresh_upgrade_transients_reload_website'); } } } return array( 'upgraded' => $return ); } else return array( 'error' => 'Upgrade failed.', 'error_code' => 'upgrade_failed_upgrade_themes' ); } else { ob_end_clean(); return array( 'error' => 'WordPress update required first', 'error_code' => 'wordPress_update_required_first_upgrade_themes' ); } } function upgrade_premium($premium = false,$premium_plugin_details = false,$premium_theme_details = false,$userid) { global $iwp_mmb_plugin_url; if (!class_exists('WP_Upgrader')) include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'); if (!$premium || empty($premium)) return array( 'error' => 'No premium files for upgrade.', 'error_code' => 'no_premium_files_for_upgrade' ); $upgrader = false; $pr_update = array(); $themes = array(); $plugins = array(); $result = array(); $premium_update = array(); $premium_update = apply_filters('mwp_premium_perform_update', $premium_update); if (!empty($premium_update)) { foreach ($premium as $pr) { foreach ($premium_update as $key => $update) { $update = array_change_key_case($update, CASE_LOWER); if ($update['name'] == $pr['name']) { // prepare bulk updates for premiums that use WordPress upgrader if(isset($update['type'])){ if($update['type'] == 'plugin'){ if(isset($update['slug']) && !empty($update['slug'])) $plugins[$update['slug']] = $update; } if($update['type'] == 'theme'){ if(isset($update['template']) && !empty($update['template'])) $themes[$update['template']] = $update; } } } else { unset($premium_update[$key]); } } } // try default wordpress upgrader if(!empty($plugins)){ $updateplugins = $this->upgrade_plugins($plugins,$premium_plugin_details,$userid); if(!empty($updateplugins) && isset($updateplugins['upgraded'])){ foreach ($premium_update as $key => $update) { $update = array_change_key_case($update, CASE_LOWER); foreach($updateplugins['upgraded'] as $slug => $upgrade){ if( isset($update['slug']) && $update['slug'] == $slug){ if( $upgrade == 1 ) unset($premium_update[$key]); $pr_update['plugins']['upgraded'][md5($update['name'])] = $upgrade; } } } } } if(!empty($themes)){ $updatethemes = $this->upgrade_themes(array_keys($themes),$premium_theme_details,$userid); if(!empty($updatethemes) && isset($updatethemes['upgraded'])){ foreach ($premium_update as $key => $update) { $update = array_change_key_case($update, CASE_LOWER); foreach($updatethemes['upgraded'] as $template => $upgrade){ if( isset($update['template']) && $update['template'] == $template) { if( $upgrade == 1 ) unset($premium_update[$key]); $pr_update['themes']['upgraded'][md5($update['name'])] = $upgrade; } } } } } //try direct install with overwrite if (!empty($premium_update)) { foreach ($premium_update as $update) { $update = array_change_key_case($update, CASE_LOWER); $update_result = false; if (isset($update['url'])) { if (defined('WP_INSTALLING') && file_exists(ABSPATH . '.maintenance')) $pr_update[$update['type'] . 's']['upgraded'][md5($update['name'])] = 'Site under maintanace.'; $upgrader_skin = new WP_Upgrader_Skin(); $upgrader_skin->done_header = true; $upgrader = new WP_Upgrader(); @$update_result = $upgrader->run(array( 'package' => $update['url'], 'destination' => isset($update['type']) && $update['type'] == 'theme' ? WP_CONTENT_DIR . '/themes' : WP_PLUGIN_DIR, 'clear_destination' => true, 'clear_working' => true, 'is_multi' => true, 'hook_extra' => array() )); $update_result = !$update_result || is_wp_error($update_result) ? $this->iwp_mmb_get_error($update_result) : 1; } else if (isset($update['callback'])) { if (is_array($update['callback'])) { $update_result = call_user_func(array( $update['callback'][0], $update['callback'][1] )); } else if (is_string($update['callback'])) { $update_result = call_user_func($update['callback']); } else { $update_result = array('error' => 'Upgrade function "' . $update['callback'] . '" does not exists.', 'error_code' => 'upgrade_func_callback_does_not_exists'); } $update_result = $update_result !== true ? array('error' => $this->iwp_mmb_get_error($update_result), 'error_code' => 'upgrade_premium_wp_error') : 1; } else $update_result = array('error' => 'Bad update params.', 'error_code' => 'bad_update_params'); $pr_update[$update['type'] . 's']['upgraded'][md5($update['name'])] = $update_result; } } return $pr_update; } else { foreach ($premium as $pr) { $result[$pr['type'] . 's']['upgraded'][md5($pr['name'])] = array('error' => 'This premium plugin/theme update is not registered with the InfiniteWP update mechanism. Please contact the plugin/theme developer to get this issue fixed.', 'error_code' => 'premium_update_not_registered'); } return $result; } } function get_upgradable_plugins( $filter = array() ) { $current = $this->iwp_mmb_get_transient('update_plugins'); $upgradable_plugins = array(); if (!empty($current->response)) { if (!function_exists('get_plugin_data')) include_once ABSPATH . 'wp-admin/includes/plugin.php'; foreach ($current->response as $plugin_path => $plugin_data) { if ($plugin_path == 'iwp-client/init.php') continue; $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_path); if(isset($data['Name']) && in_array($data['Name'], $filter)) continue; if (strlen($data['Name']) > 0 && strlen($data['Version']) > 0) { $current->response[$plugin_path]->name = $data['Name']; $current->response[$plugin_path]->old_version = $data['Version']; $current->response[$plugin_path]->file = $plugin_path; unset($current->response[$plugin_path]->upgrade_notice); $upgradable_plugins[] = $current->response[$plugin_path]; } } return $upgradable_plugins; } else return array(); } function get_upgradable_translations() { if (!function_exists('wp_get_translation_updates')){ include_once(ABSPATH . 'wp-includes/update.php'); } if (function_exists('wp_get_translation_updates')) { $translations_object = wp_get_translation_updates(); $translations_object = array_filter($translations_object); } if (isset($translations_object) && !empty($translations_object)){ return true; } else{ return false; } } function get_upgradable_themes($filter = array()) { if (function_exists('wp_get_themes')) { $all_themes = wp_get_themes(); $upgrade_themes = array(); $current = $this->iwp_mmb_get_transient('update_themes'); if (!empty($current->response)) { foreach ((array) $all_themes as $theme_template => $theme_data) { if (isset($theme_data->{'Parent Theme'}) && !empty($theme_data->{'Parent Theme'})) { continue; } if (isset($theme_data->Name) && in_array($theme_data->Name, $filter)) { continue; } if (method_exists($theme_data,'parent') && !$theme_data->parent()) { foreach ($current->response as $current_themes => $theme) { if ($theme_data->Template == $current_themes) { if (strlen($theme_data->Name) > 0 && strlen($theme_data->Version) > 0) { $current->response[$current_themes]['name'] = $theme_data->Name; $current->response[$current_themes]['old_version'] = $theme_data->Version; $current->response[$current_themes]['theme_tmp'] = $theme_data->Template; $upgrade_themes[] = $current->response[$current_themes]; } } } } } } } else { $all_themes = get_themes(); $upgrade_themes = array(); $current = $this->iwp_mmb_get_transient('update_themes'); if (!empty($current->response)) { foreach ((array) $all_themes as $theme_template => $theme_data) { if (isset($theme_data['Parent Theme']) && !empty($theme_data['Parent Theme'])) { continue; } if (isset($theme_data['Name']) && in_array($theme_data['Name'], $filter)) { continue; } if (method_exists($theme_data,'parent') && !$theme_data->parent()) { foreach ($current->response as $current_themes => $theme) { if ($theme_data['Template'] == $current_themes) { if (strlen($theme_data['Name']) > 0 && strlen($theme_data['Version']) > 0) { $current->response[$current_themes]['name'] = $theme_data['Name']; $current->response[$current_themes]['old_version'] = $theme_data['Version']; $current->response[$current_themes]['theme_tmp'] = $theme_data['Template']; $upgrade_themes[] = $current->response[$current_themes]; } } } } } } } return $upgrade_themes; } function get($args) { if (empty($args)) return false; //Args: $items('plugins,'themes'), $type (active || inactive), $search(name string) $return = array(); if (is_array($args['items']) && in_array('plugins', $args['items'])) { $return['plugins'] = $this->get_plugins($args); } if (is_array($args['items']) && in_array('themes', $args['items'])) { $return['themes'] = $this->get_themes($args); } return $return; } function get_plugins($args) { if (empty($args)) return false; extract($args); if (!function_exists('get_plugins')) { include_once(ABSPATH . 'wp-admin/includes/plugin.php'); } $all_plugins = get_plugins(); $plugins = array( 'active' => array(), 'inactive' => array() ); if (is_array($all_plugins) && !empty($all_plugins)) { $activated_plugins = get_option('active_plugins'); if (!$activated_plugins) $activated_plugins = array(); $br_a = 0; $br_i = 0; foreach ($all_plugins as $path => $plugin) { if ($plugin['Name'] != 'InfiniteWP - Client') { if (in_array($path, $activated_plugins)) { $plugins['active'][$br_a]['path'] = $path; $plugins['active'][$br_a]['name'] = strip_tags($plugin['Name']); $plugins['active'][$br_a]['version'] = $plugin['Version']; $br_a++; } if (!in_array($path, $activated_plugins)) { $plugins['inactive'][$br_i]['path'] = $path; $plugins['inactive'][$br_i]['name'] = strip_tags($plugin['Name']); $plugins['inactive'][$br_i]['version'] = $plugin['Version']; $br_i++; } } if ($search) { foreach ($plugins['active'] as $k => $plugin) { if (!stristr($plugin['name'], $search)) { unset($plugins['active'][$k]); } } foreach ($plugins['inactive'] as $k => $plugin) { if (!stristr($plugin['name'], $search)) { unset($plugins['inactive'][$k]); } } } } } return $plugins; } function get_themes($args) { if (empty($args)) return false; extract($args); if (!function_exists('wp_get_themes')) { include_once(ABSPATH . WPINC . '/theme.php'); } if(function_exists('wp_get_themes')){ $all_themes = wp_get_themes(); $themes = array( 'active' => array(), 'inactive' => array() ); if (is_array($all_themes) && !empty($all_themes)) { $current_theme = wp_get_theme(); $br_a = 0; $br_i = 0; foreach ($all_themes as $theme_name => $theme) { if ($current_theme == strip_tags($theme->Name)) { $themes['active'][$br_a]['path'] = $theme->Template; $themes['active'][$br_a]['name'] = strip_tags($theme->Name); $themes['active'][$br_a]['version'] = $theme->Version; $themes['active'][$br_a]['stylesheet'] = $theme->Stylesheet; $br_a++; } if ($current_theme != strip_tags($theme->Name)) { $themes['inactive'][$br_i]['path'] = $theme->Template; $themes['inactive'][$br_i]['name'] = strip_tags($theme->Name); $themes['inactive'][$br_i]['version'] = $theme->Version; $themes['inactive'][$br_i]['stylesheet'] = $theme->Stylesheet; $br_i++; } } if ($search) { foreach ($themes['active'] as $k => $theme) { if (!stristr($theme['name'], $search)) { unset($themes['active'][$k]); } } foreach ($themes['inactive'] as $k => $theme) { if (!stristr($theme['name'], $search)) { unset($themes['inactive'][$k]); } } } } }else{ $all_themes = get_themes(); $themes = array( 'active' => array(), 'inactive' => array() ); if (is_array($all_themes) && !empty($all_themes)) { $current_theme = get_current_theme(); $br_a = 0; $br_i = 0; foreach ($all_themes as $theme_name => $theme) { if ($current_theme == $theme_name) { $themes['active'][$br_a]['path'] = $theme['Template']; $themes['active'][$br_a]['name'] = strip_tags($theme['Name']); $themes['active'][$br_a]['version'] = $theme['Version']; $themes['active'][$br_a]['stylesheet'] = $theme['Stylesheet']; $br_a++; } if ($current_theme != $theme_name) { $themes['inactive'][$br_i]['path'] = $theme['Template']; $themes['inactive'][$br_i]['name'] = strip_tags($theme['Name']); $themes['inactive'][$br_i]['version'] = $theme['Version']; $themes['inactive'][$br_i]['stylesheet'] = $theme['Stylesheet']; $br_i++; } } if ($search) { foreach ($themes['active'] as $k => $theme) { if (!stristr($theme['name'], $search)) { unset($themes['active'][$k]); } } foreach ($themes['inactive'] as $k => $theme) { if (!stristr($theme['name'], $search)) { unset($themes['inactive'][$k]); } } } } } return $themes; } function edit($args) { extract($args); $return = array(); if ($type == 'plugins') { $return['plugins'] = $this->edit_plugins($args); } elseif ($type == 'themes') { $return['themes'] = $this->edit_themes($args); } return $return; } function edit_plugins($args) { extract($args); $return = array(); foreach ($items as $item) { switch ($item['action']) {//switch ($items_edit_action) => switch ($item['action']) case 'activate': $result = activate_plugin($item['path']); break; case 'deactivate': $result = deactivate_plugins(array( $item['path'] )); break; case 'delete': $result = delete_plugins(array( $item['path'] )); break; default: break; } if (is_wp_error($result)) { $result = array( 'error' => $result->get_error_message(), 'error_code' => 'wp_error_edit_plugins' ); } elseif ($result === false) { $result = array( 'error' => "Failed to perform action.", 'error_code' => 'failed_to_perform_action_edit_plugins' ); } else { $result = "OK"; } $return[$item['name']] = $result; } return $return; } function edit_themes($args) { extract($args); $return = array(); foreach ($items as $item) { switch ($item['action']) {//switch ($items_edit_action) => switch ($item['action']) case 'activate': switch_theme($item['path'], $item['stylesheet']); break; case 'delete': $result = delete_theme($item['path']); break; default: break; } if (is_wp_error($result)) { $result = array( 'error' => $result->get_error_message(), 'error_code' => 'wp_error_edit_themes' ); } elseif ($result === false) { $result = array( 'error' => "Failed to perform action.", 'error_code' => 'failed_to_perform_action_edit_themes' ); } else { $result = "OK"; } $return[$item['name']] = $result; } return $return; } } ?>
SayenkoDesign/ividf
wp-content/plugins/iwp-client/installer.class.php
PHP
gpl-2.0
47,019
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// // SAButton.h // CoolSnail // // Created by quqi on 15/10/10. // Copyright © 2015年 牵着蜗牛走的我. All rights reserved. // #import <UIKit/UIKit.h> @interface SAButton : UIButton @end
xiaopeng000728/CoolSnail
CoolSnail/SAButton.h
C
mit
203
[ 30522, 1013, 1013, 1013, 1013, 7842, 8569, 15474, 1012, 1044, 1013, 1013, 4658, 2015, 25464, 1013, 1013, 1013, 1013, 2580, 2011, 24209, 14702, 2006, 2321, 1013, 2184, 1013, 2184, 1012, 1013, 1013, 9385, 1075, 2325, 1840, 100, 100, 100, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/bin/sh if [ -n "@AUTOTOOLS_AS_COMPILER@" ] then export AS="@AUTOTOOLS_AS_COMPILER@" fi export CC="@AUTOTOOLS_C_COMPILER@" export CXX="@AUTOTOOLS_CXX_COMPILER@" export OBJC="@AUTOTOOLS_OBJC_COMPILER@" export LD="@AUTOTOOLS_LINKER@" export AR="@AUTOTOOLS_AR@" export RANLIB="@AUTOTOOLS_RANLIB@" export STRIP="@AUTOTOOLS_STRIP@" export NM="@AUTOTOOLS_NM@" export ASFLAGS="@ep_asflags@" export CPPFLAGS="@ep_cppflags@" export CFLAGS="@ep_cflags@" export CXXFLAGS="@ep_cxxflags@" export OBJCFLAGS="@ep_objcflags@" export LDFLAGS="@ep_ldflags@" export PKG_CONFIG="@LINPHONE_BUILDER_PKG_CONFIG@" export PKG_CONFIG_PATH="@LINPHONE_BUILDER_PKG_CONFIG_PATH@" export PKG_CONFIG_LIBDIR="@LINPHONE_BUILDER_PKG_CONFIG_LIBDIR@" cd "@ep_build@" make V=@AUTOTOOLS_VERBOSE_MAKEFILE@ @ep_make_options@ @ep_redirect_to_file@
zhuolinho/linphone
submodules/cmake-builder/cmake/build.sh.cmake
CMake
gpl-2.0
813
[ 30522, 1001, 999, 1013, 8026, 1013, 14021, 2065, 1031, 1011, 1050, 1000, 1030, 8285, 3406, 27896, 1035, 2004, 1035, 21624, 1030, 1000, 1033, 2059, 9167, 2004, 1027, 1000, 1030, 8285, 3406, 27896, 1035, 2004, 1035, 21624, 1030, 1000, 10882, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Aphelion * Copyright (c) 2013 Joris van der Wel * * This file is part of Aphelion * * Aphelion is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3 of the License. * * Aphelion is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Aphelion. If not, see <http://www.gnu.org/licenses/>. * * In addition, the following supplemental terms apply, based on section 7 of * the GNU Affero General Public License (version 3): * a) Preservation of all legal notices and author attributions * b) Prohibition of misrepresentation of the origin of this material, and * modified versions are required to be marked in reasonable ways as * different from the original version (for example by appending a copyright notice). * * Linking this library statically or dynamically with other modules is making a * combined work based on this library. Thus, the terms and conditions of the * GNU Affero General Public License cover the whole combination. * * As a special exception, the copyright holders of this library give you * permission to link this library with independent modules to produce an * executable, regardless of the license terms of these independent modules, * and to copy and distribute the resulting executable under terms of your * choice, provided that you also meet, for each linked independent module, * the terms and conditions of the license of that module. An independent * module is a module which is not derived from or based on this library. */ package aphelion.shared.event.promise; /** * * @author Joris */ public interface PromiseRejected { void rejected(PromiseException error); }
Periapsis/aphelion
src/main/java/aphelion/shared/event/promise/PromiseRejected.java
Java
agpl-3.0
2,044
[ 30522, 1013, 1008, 1008, 9706, 16001, 3258, 1008, 9385, 1006, 1039, 1007, 2286, 8183, 6935, 3158, 4315, 2057, 2140, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 9706, 16001, 3258, 1008, 1008, 9706, 16001, 3258, 2003, 2489, 4007, 1024, 2017, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*******************************************************/ /* "C" Language Integrated Production System */ /* */ /* CLIPS Version 6.24 06/02/06 */ /* */ /* DEFFUNCTION MODULE */ /*******************************************************/ /*************************************************************/ /* Purpose: */ /* */ /* Principal Programmer(s): */ /* Brian L. Dantes */ /* */ /* Contributing Programmer(s): */ /* Gary D. Riley */ /* */ /* Revision History: */ /* 6.23: Correction for FalseSymbol/TrueSymbol. DR0859 */ /* */ /* Corrected compilation errors for files */ /* generated by constructs-to-c. DR0861 */ /* */ /* Changed name of variable log to logName */ /* because of Unix compiler warnings of shadowed */ /* definitions. */ /* */ /* 6.24: Renamed BOOLEAN macro type to intBool. */ /* */ /* Corrected code to remove run-time program */ /* compiler warning. */ /* */ /*************************************************************/ /* ========================================= ***************************************** EXTERNAL DEFINITIONS ========================================= ***************************************** */ #include "setup.h" #if DEFFUNCTION_CONSTRUCT #if (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE) #include "bload.h" #include "dffnxbin.h" #endif #if CONSTRUCT_COMPILER && (! RUN_TIME) #include "dffnxcmp.h" #endif #if (! BLOAD_ONLY) && (! RUN_TIME) #include "constrct.h" #include "cstrcpsr.h" #include "dffnxpsr.h" #include "modulpsr.h" #endif #include "envrnmnt.h" #if (! RUN_TIME) #include "extnfunc.h" #endif #include "dffnxexe.h" #if DEBUGGING_FUNCTIONS #include "watch.h" #endif #include "argacces.h" #include "memalloc.h" #include "cstrccom.h" #include "router.h" #define _DFFNXFUN_SOURCE_ #include "dffnxfun.h" /* ========================================= ***************************************** INTERNALLY VISIBLE FUNCTION HEADERS ========================================= ***************************************** */ static void PrintDeffunctionCall(void *,char *,void *); static intBool EvaluateDeffunctionCall(void *,void *,DATA_OBJECT *); static void DecrementDeffunctionBusyCount(void *,void *); static void IncrementDeffunctionBusyCount(void *,void *); static void DeallocateDeffunctionData(void *); #if ! RUN_TIME static void DestroyDeffunctionAction(void *,struct constructHeader *,void *); static void *AllocateModule(void *); static void ReturnModule(void *,void *); static intBool ClearDeffunctionsReady(void *); #endif #if (! BLOAD_ONLY) && (! RUN_TIME) static intBool RemoveAllDeffunctions(void *); static void DeffunctionDeleteError(void *,char *); static void SaveDeffunctionHeaders(void *,void *,char *); static void SaveDeffunctionHeader(void *,struct constructHeader *,void *); static void SaveDeffunctions(void *,void *,char *); #endif #if DEBUGGING_FUNCTIONS static unsigned DeffunctionWatchAccess(void *,int,unsigned,EXPRESSION *); static unsigned DeffunctionWatchPrint(void *,char *,int,EXPRESSION *); #endif /* ========================================= ***************************************** EXTERNALLY VISIBLE FUNCTIONS ========================================= ***************************************** */ /*************************************************** NAME : SetupDeffunctions DESCRIPTION : Initializes parsers and access functions for deffunctions INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Deffunction environment initialized NOTES : None ***************************************************/ globle void SetupDeffunctions( void *theEnv) { ENTITY_RECORD deffunctionEntityRecord = { "PCALL", PCALL,0,0,1, PrintDeffunctionCall,PrintDeffunctionCall, NULL,EvaluateDeffunctionCall,NULL, DecrementDeffunctionBusyCount,IncrementDeffunctionBusyCount, NULL,NULL,NULL,NULL,NULL }; AllocateEnvironmentData(theEnv,DEFFUNCTION_DATA,sizeof(struct deffunctionData),DeallocateDeffunctionData); memcpy(&DeffunctionData(theEnv)->DeffunctionEntityRecord,&deffunctionEntityRecord,sizeof(struct entityRecord)); InstallPrimitive(theEnv,&DeffunctionData(theEnv)->DeffunctionEntityRecord,PCALL); DeffunctionData(theEnv)->DeffunctionModuleIndex = RegisterModuleItem(theEnv,"deffunction", #if (! RUN_TIME) AllocateModule,ReturnModule, #else NULL,NULL, #endif #if BLOAD_AND_BSAVE || BLOAD || BLOAD_ONLY BloadDeffunctionModuleReference, #else NULL, #endif #if CONSTRUCT_COMPILER && (! RUN_TIME) DeffunctionCModuleReference, #else NULL, #endif EnvFindDeffunction); DeffunctionData(theEnv)->DeffunctionConstruct = AddConstruct(theEnv,"deffunction","deffunctions", #if (! BLOAD_ONLY) && (! RUN_TIME) ParseDeffunction, #else NULL, #endif EnvFindDeffunction, GetConstructNamePointer,GetConstructPPForm, GetConstructModuleItem,EnvGetNextDeffunction, SetNextConstruct,EnvIsDeffunctionDeletable, EnvUndeffunction, #if (! BLOAD_ONLY) && (! RUN_TIME) RemoveDeffunction #else NULL #endif ); #if ! RUN_TIME AddClearReadyFunction(theEnv,"deffunction",ClearDeffunctionsReady,0); #if ! BLOAD_ONLY #if DEFMODULE_CONSTRUCT AddPortConstructItem(theEnv,"deffunction",SYMBOL); #endif AddSaveFunction(theEnv,"deffunction-headers",SaveDeffunctionHeaders,1000); AddSaveFunction(theEnv,"deffunctions",SaveDeffunctions,0); EnvDefineFunction2(theEnv,"undeffunction",'v',PTIEF UndeffunctionCommand,"UndeffunctionCommand","11w"); #endif #if DEBUGGING_FUNCTIONS EnvDefineFunction2(theEnv,"list-deffunctions",'v',PTIEF ListDeffunctionsCommand,"ListDeffunctionsCommand","01"); EnvDefineFunction2(theEnv,"ppdeffunction",'v',PTIEF PPDeffunctionCommand,"PPDeffunctionCommand","11w"); #endif EnvDefineFunction2(theEnv,"get-deffunction-list",'m',PTIEF GetDeffunctionListFunction, "GetDeffunctionListFunction","01"); EnvDefineFunction2(theEnv,"deffunction-module",'w',PTIEF GetDeffunctionModuleCommand, "GetDeffunctionModuleCommand","11w"); #if BLOAD_AND_BSAVE || BLOAD || BLOAD_ONLY SetupDeffunctionsBload(theEnv); #endif #if CONSTRUCT_COMPILER SetupDeffunctionCompiler(theEnv); #endif #endif #if DEBUGGING_FUNCTIONS AddWatchItem(theEnv,"deffunctions",0,&DeffunctionData(theEnv)->WatchDeffunctions,32, DeffunctionWatchAccess,DeffunctionWatchPrint); #endif } /******************************************************/ /* DeallocateDeffunctionData: Deallocates environment */ /* data for the deffunction construct. */ /******************************************************/ static void DeallocateDeffunctionData( void *theEnv) { #if ! RUN_TIME struct deffunctionModule *theModuleItem; void *theModule; #if BLOAD || BLOAD_AND_BSAVE if (Bloaded(theEnv)) return; #endif DoForAllConstructs(theEnv,DestroyDeffunctionAction,DeffunctionData(theEnv)->DeffunctionModuleIndex,FALSE,NULL); for (theModule = EnvGetNextDefmodule(theEnv,NULL); theModule != NULL; theModule = EnvGetNextDefmodule(theEnv,theModule)) { theModuleItem = (struct deffunctionModule *) GetModuleItem(theEnv,(struct defmodule *) theModule, DeffunctionData(theEnv)->DeffunctionModuleIndex); rtn_struct(theEnv,deffunctionModule,theModuleItem); } #else #endif } #if ! RUN_TIME /*****************************************************/ /* DestroyDeffunctionAction: Action used to remove */ /* deffunctions as a result of DestroyEnvironment. */ /*****************************************************/ static void DestroyDeffunctionAction( void *theEnv, struct constructHeader *theConstruct, void *buffer) { #if (! BLOAD_ONLY) && (! RUN_TIME) struct deffunctionStruct *theDeffunction = (struct deffunctionStruct *) theConstruct; if (theDeffunction == NULL) return; ReturnPackedExpression(theEnv,theDeffunction->code); DestroyConstructHeader(theEnv,&theDeffunction->header); rtn_struct(theEnv,deffunctionStruct,theDeffunction); #else #endif } #endif /*************************************************** NAME : EnvFindDeffunction DESCRIPTION : Searches for a deffunction INPUTS : The name of the deffunction (possibly including a module name) RETURNS : Pointer to the deffunction if found, otherwise NULL SIDE EFFECTS : None NOTES : None ***************************************************/ globle void *EnvFindDeffunction( void *theEnv, char *dfnxModuleAndName) { return(FindNamedConstruct(theEnv,dfnxModuleAndName,DeffunctionData(theEnv)->DeffunctionConstruct)); } /*************************************************** NAME : LookupDeffunctionByMdlOrScope DESCRIPTION : Finds a deffunction anywhere (if module is specified) or in current or imported modules INPUTS : The deffunction name RETURNS : The deffunction (NULL if not found) SIDE EFFECTS : Error message printed on ambiguous references NOTES : None ***************************************************/ globle DEFFUNCTION *LookupDeffunctionByMdlOrScope( void *theEnv, char *deffunctionName) { return((DEFFUNCTION *) LookupConstruct(theEnv,DeffunctionData(theEnv)->DeffunctionConstruct,deffunctionName,TRUE)); } /*************************************************** NAME : LookupDeffunctionInScope DESCRIPTION : Finds a deffunction in current or imported modules (module specifier is not allowed) INPUTS : The deffunction name RETURNS : The deffunction (NULL if not found) SIDE EFFECTS : Error message printed on ambiguous references NOTES : None ***************************************************/ globle DEFFUNCTION *LookupDeffunctionInScope( void *theEnv, char *deffunctionName) { return((DEFFUNCTION *) LookupConstruct(theEnv,DeffunctionData(theEnv)->DeffunctionConstruct,deffunctionName,FALSE)); } /*************************************************** NAME : EnvUndeffunction DESCRIPTION : External interface routine for removing a deffunction INPUTS : Deffunction pointer RETURNS : FALSE if unsuccessful, TRUE otherwise SIDE EFFECTS : Deffunction deleted, if possible NOTES : None ***************************************************/ globle intBool EnvUndeffunction( void *theEnv, void *vptr) { #if BLOAD_ONLY || RUN_TIME return(FALSE); #else #if BLOAD || BLOAD_AND_BSAVE if (Bloaded(theEnv) == TRUE) return(FALSE); #endif if (vptr == NULL) return(RemoveAllDeffunctions(theEnv)); if (EnvIsDeffunctionDeletable(theEnv,vptr) == FALSE) return(FALSE); RemoveConstructFromModule(theEnv,(struct constructHeader *) vptr); RemoveDeffunction(theEnv,vptr); return(TRUE); #endif } /**************************************************** NAME : EnvGetNextDeffunction DESCRIPTION : Accesses list of deffunctions INPUTS : Deffunction pointer RETURNS : The next deffunction, or the first deffunction (if input is NULL) SIDE EFFECTS : None NOTES : None ****************************************************/ globle void *EnvGetNextDeffunction( void *theEnv, void *ptr) { return((void *) GetNextConstructItem(theEnv,(struct constructHeader *) ptr,DeffunctionData(theEnv)->DeffunctionModuleIndex)); } /*************************************************** NAME : EnvIsDeffunctionDeletable DESCRIPTION : Determines if a deffunction is executing or referenced by another expression INPUTS : Deffunction pointer RETURNS : TRUE if the deffunction can be deleted, FALSE otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ globle int EnvIsDeffunctionDeletable( void *theEnv, void *ptr) { DEFFUNCTION *dptr; if (! ConstructsDeletable(theEnv)) { return FALSE; } dptr = (DEFFUNCTION *) ptr; return(((dptr->busy == 0) && (dptr->executing == 0)) ? TRUE : FALSE); } #if (! BLOAD_ONLY) && (! RUN_TIME) /*************************************************** NAME : RemoveDeffunction DESCRIPTION : Removes a deffunction INPUTS : Deffunction pointer RETURNS : Nothing useful SIDE EFFECTS : Deffunction deallocated NOTES : Assumes deffunction is not in use!! ***************************************************/ globle void RemoveDeffunction( void *theEnv, void *vdptr) { DEFFUNCTION *dptr = (DEFFUNCTION *) vdptr; if (dptr == NULL) return; DecrementSymbolCount(theEnv,GetDeffunctionNamePointer((void *) dptr)); ExpressionDeinstall(theEnv,dptr->code); ReturnPackedExpression(theEnv,dptr->code); SetDeffunctionPPForm((void *) dptr,NULL); ClearUserDataList(theEnv,dptr->header.usrData); rtn_struct(theEnv,deffunctionStruct,dptr); } #endif /******************************************************** NAME : UndeffunctionCommand DESCRIPTION : Deletes the named deffunction(s) INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Deffunction(s) removed NOTES : H/L Syntax: (undeffunction <name> | *) ********************************************************/ globle void UndeffunctionCommand( void *theEnv) { UndefconstructCommand(theEnv,"undeffunction",DeffunctionData(theEnv)->DeffunctionConstruct); } /**************************************************************** NAME : GetDeffunctionModuleCommand DESCRIPTION : Determines to which module a deffunction belongs INPUTS : None RETURNS : The symbolic name of the module SIDE EFFECTS : None NOTES : H/L Syntax: (deffunction-module <dfnx-name>) ****************************************************************/ globle void *GetDeffunctionModuleCommand( void *theEnv) { return(GetConstructModuleCommand(theEnv,"deffunction-module",DeffunctionData(theEnv)->DeffunctionConstruct)); } #if DEBUGGING_FUNCTIONS /**************************************************** NAME : PPDeffunctionCommand DESCRIPTION : Displays the pretty-print form of a deffunction INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Pretty-print form displayed to WDISPLAY logical name NOTES : H/L Syntax: (ppdeffunction <name>) ****************************************************/ globle void PPDeffunctionCommand( void *theEnv) { PPConstructCommand(theEnv,"ppdeffunction",DeffunctionData(theEnv)->DeffunctionConstruct); } /*************************************************** NAME : ListDeffunctionsCommand DESCRIPTION : Displays all deffunction names INPUTS : None RETURNS : Nothing useful SIDE EFFECTS : Deffunction name sprinted NOTES : H/L Interface ***************************************************/ globle void ListDeffunctionsCommand( void *theEnv) { ListConstructCommand(theEnv,"list-deffunctions",DeffunctionData(theEnv)->DeffunctionConstruct); } /*************************************************** NAME : EnvListDeffunctions DESCRIPTION : Displays all deffunction names INPUTS : 1) The logical name of the output 2) The module RETURNS : Nothing useful SIDE EFFECTS : Deffunction name sprinted NOTES : C Interface ***************************************************/ globle void EnvListDeffunctions( void *theEnv, char *logicalName, struct defmodule *theModule) { ListConstruct(theEnv,DeffunctionData(theEnv)->DeffunctionConstruct,logicalName,theModule); } #endif /*************************************************************** NAME : GetDeffunctionListFunction DESCRIPTION : Groups all deffunction names into a multifield list INPUTS : A data object buffer to hold the multifield result RETURNS : Nothing useful SIDE EFFECTS : Multifield allocated and filled NOTES : H/L Syntax: (get-deffunction-list [<module>]) ***************************************************************/ globle void GetDeffunctionListFunction( void *theEnv, DATA_OBJECT *returnValue) { GetConstructListFunction(theEnv,"get-deffunction-list",returnValue,DeffunctionData(theEnv)->DeffunctionConstruct); } /*************************************************************** NAME : EnvGetDeffunctionList DESCRIPTION : Groups all deffunction names into a multifield list INPUTS : 1) A data object buffer to hold the multifield result 2) The module from which to obtain deffunctions RETURNS : Nothing useful SIDE EFFECTS : Multifield allocated and filled NOTES : External C access ***************************************************************/ globle void EnvGetDeffunctionList( void *theEnv, DATA_OBJECT *returnValue, struct defmodule *theModule) { GetConstructList(theEnv,returnValue,DeffunctionData(theEnv)->DeffunctionConstruct,theModule); } /******************************************************* NAME : CheckDeffunctionCall DESCRIPTION : Checks the number of arguments passed to a deffunction INPUTS : 1) Deffunction pointer 2) The number of arguments RETURNS : TRUE if OK, FALSE otherwise SIDE EFFECTS : Message printed on errors NOTES : None *******************************************************/ globle int CheckDeffunctionCall( void *theEnv, void *vdptr, int args) { DEFFUNCTION *dptr; if (vdptr == NULL) return(FALSE); dptr = (DEFFUNCTION *) vdptr; if (args < dptr->minNumberOfParameters) { if (dptr->maxNumberOfParameters == -1) ExpectedCountError(theEnv,EnvGetDeffunctionName(theEnv,(void *) dptr), AT_LEAST,dptr->minNumberOfParameters); else ExpectedCountError(theEnv,EnvGetDeffunctionName(theEnv,(void *) dptr), EXACTLY,dptr->minNumberOfParameters); return(FALSE); } else if ((args > dptr->minNumberOfParameters) && (dptr->maxNumberOfParameters != -1)) { ExpectedCountError(theEnv,EnvGetDeffunctionName(theEnv,(void *) dptr), EXACTLY,dptr->minNumberOfParameters); return(FALSE); } return(TRUE); } /* ========================================= ***************************************** INTERNALLY VISIBLE FUNCTIONS ========================================= ***************************************** */ /*************************************************** NAME : PrintDeffunctionCall DESCRIPTION : PrintExpression() support function for deffunction calls INPUTS : 1) The output logical name 2) The deffunction RETURNS : Nothing useful SIDE EFFECTS : Call expression printed NOTES : None ***************************************************/ static void PrintDeffunctionCall( void *theEnv, char *logName, void *value) { #if DEVELOPER EnvPrintRouter(theEnv,logName,"("); EnvPrintRouter(theEnv,logName,EnvGetDeffunctionName(theEnv,value)); if (GetFirstArgument() != NULL) { EnvPrintRouter(theEnv,logName," "); PrintExpression(theEnv,logName,GetFirstArgument()); } EnvPrintRouter(theEnv,logName,")"); #else #endif } /******************************************************* NAME : EvaluateDeffunctionCall DESCRIPTION : Primitive support function for calling a deffunction INPUTS : 1) The deffunction 2) A data object buffer to hold the evaluation result RETURNS : FALSE if the deffunction returns the symbol FALSE, TRUE otherwise SIDE EFFECTS : Data obejct buffer set and any side-effects of calling the deffunction NOTES : None *******************************************************/ static intBool EvaluateDeffunctionCall( void *theEnv, void *value, DATA_OBJECT *result) { CallDeffunction(theEnv,(DEFFUNCTION *) value,GetFirstArgument(),result); if ((GetpType(result) == SYMBOL) && (GetpValue(result) == EnvFalseSymbol(theEnv))) return(FALSE); return(TRUE); } /*************************************************** NAME : DecrementDeffunctionBusyCount DESCRIPTION : Lowers the busy count of a deffunction construct INPUTS : The deffunction RETURNS : Nothing useful SIDE EFFECTS : Busy count decremented if a clear is not in progress (see comment) NOTES : None ***************************************************/ static void DecrementDeffunctionBusyCount( void *theEnv, void *value) { /* ============================================== The deffunctions to which expressions in other constructs may refer may already have been deleted - thus, it is important not to modify the busy flag during a clear. ============================================== */ if (! ConstructData(theEnv)->ClearInProgress) ((DEFFUNCTION *) value)->busy--; } /*************************************************** NAME : IncrementDeffunctionBusyCount DESCRIPTION : Raises the busy count of a deffunction construct INPUTS : The deffunction RETURNS : Nothing useful SIDE EFFECTS : Busy count incremented NOTES : None ***************************************************/ static void IncrementDeffunctionBusyCount( void *theEnv, void *value) { ((DEFFUNCTION *) value)->busy++; } #if ! RUN_TIME /***************************************************** NAME : AllocateModule DESCRIPTION : Creates and initializes a list of deffunctions for a new module INPUTS : None RETURNS : The new deffunction module SIDE EFFECTS : Deffunction module created NOTES : None *****************************************************/ static void *AllocateModule( void *theEnv) { return((void *) get_struct(theEnv,deffunctionModule)); } /*************************************************** NAME : ReturnModule DESCRIPTION : Removes a deffunction module and all associated deffunctions INPUTS : The deffunction module RETURNS : Nothing useful SIDE EFFECTS : Module and deffunctions deleted NOTES : None ***************************************************/ static void ReturnModule( void *theEnv, void *theItem) { #if (! BLOAD_ONLY) FreeConstructHeaderModule(theEnv,(struct defmoduleItemHeader *) theItem,DeffunctionData(theEnv)->DeffunctionConstruct); #endif rtn_struct(theEnv,deffunctionModule,theItem); } /*************************************************** NAME : ClearDeffunctionsReady DESCRIPTION : Determines if it is safe to remove all deffunctions Assumes *all* constructs will be deleted - only checks to see if any deffunctions are currently executing INPUTS : None RETURNS : TRUE if no deffunctions are executing, FALSE otherwise SIDE EFFECTS : None NOTES : Used by (clear) and (bload) ***************************************************/ static intBool ClearDeffunctionsReady( void *theEnv) { return((DeffunctionData(theEnv)->ExecutingDeffunction != NULL) ? FALSE : TRUE); } #endif #if (! BLOAD_ONLY) && (! RUN_TIME) /*************************************************** NAME : RemoveAllDeffunctions DESCRIPTION : Removes all deffunctions INPUTS : None RETURNS : TRUE if all deffunctions removed, FALSE otherwise SIDE EFFECTS : Deffunctions removed NOTES : None ***************************************************/ static intBool RemoveAllDeffunctions( void *theEnv) { DEFFUNCTION *dptr,*dtmp; unsigned oldbusy; intBool success = TRUE; #if BLOAD || BLOAD_AND_BSAVE if (Bloaded(theEnv) == TRUE) return(FALSE); #endif dptr = (DEFFUNCTION *) EnvGetNextDeffunction(theEnv,NULL); while (dptr != NULL) { if (dptr->executing > 0) { DeffunctionDeleteError(theEnv,EnvGetDeffunctionName(theEnv,(void *) dptr)); success = FALSE; } else { oldbusy = dptr->busy; ExpressionDeinstall(theEnv,dptr->code); dptr->busy = oldbusy; ReturnPackedExpression(theEnv,dptr->code); dptr->code = NULL; } dptr = (DEFFUNCTION *) EnvGetNextDeffunction(theEnv,(void *) dptr); } dptr = (DEFFUNCTION *) EnvGetNextDeffunction(theEnv,NULL); while (dptr != NULL) { dtmp = dptr; dptr = (DEFFUNCTION *) EnvGetNextDeffunction(theEnv,(void *) dptr); if (dtmp->executing == 0) { if (dtmp->busy > 0) { PrintWarningID(theEnv,"DFFNXFUN",1,FALSE); EnvPrintRouter(theEnv,WWARNING,"Deffunction "); EnvPrintRouter(theEnv,WWARNING,EnvGetDeffunctionName(theEnv,(void *) dtmp)); EnvPrintRouter(theEnv,WWARNING," only partially deleted due to usage by other constructs.\n"); SetDeffunctionPPForm((void *) dtmp,NULL); success = FALSE; } else { RemoveConstructFromModule(theEnv,(struct constructHeader *) dtmp); RemoveDeffunction(theEnv,dtmp); } } } return(success); } /**************************************************** NAME : DeffunctionDeleteError DESCRIPTION : Prints out an error message when a deffunction deletion attempt fails INPUTS : The deffunction name RETURNS : Nothing useful SIDE EFFECTS : Error message printed NOTES : None ****************************************************/ static void DeffunctionDeleteError( void *theEnv, char *dfnxName) { CantDeleteItemErrorMessage(theEnv,"deffunction",dfnxName); } /*************************************************** NAME : SaveDeffunctionHeaders DESCRIPTION : Writes out deffunction forward declarations for (save) command INPUTS : The logical output name RETURNS : Nothing useful SIDE EFFECTS : Writes out deffunctions with no body of actions NOTES : Used for deffunctions which are mutually recursive with other constructs ***************************************************/ static void SaveDeffunctionHeaders( void *theEnv, void *theModule, char *logicalName) { DoForAllConstructsInModule(theEnv,theModule,SaveDeffunctionHeader, DeffunctionData(theEnv)->DeffunctionModuleIndex, FALSE,(void *) logicalName); } /*************************************************** NAME : SaveDeffunctionHeader DESCRIPTION : Writes a deffunction forward declaration to the save file INPUTS : 1) The deffunction 2) The logical name of the output RETURNS : Nothing useful SIDE EFFECTS : Defffunction header written NOTES : None ***************************************************/ static void SaveDeffunctionHeader( void *theEnv, struct constructHeader *theDeffunction, void *userBuffer) { DEFFUNCTION *dfnxPtr = (DEFFUNCTION *) theDeffunction; char *logicalName = (char *) userBuffer; register int i; if (EnvGetDeffunctionPPForm(theEnv,(void *) dfnxPtr) != NULL) { EnvPrintRouter(theEnv,logicalName,"(deffunction "); EnvPrintRouter(theEnv,logicalName,EnvDeffunctionModule(theEnv,(void *) dfnxPtr)); EnvPrintRouter(theEnv,logicalName,"::"); EnvPrintRouter(theEnv,logicalName,EnvGetDeffunctionName(theEnv,(void *) dfnxPtr)); EnvPrintRouter(theEnv,logicalName," ("); for (i = 0 ; i < dfnxPtr->minNumberOfParameters ; i++) { EnvPrintRouter(theEnv,logicalName,"?p"); PrintLongInteger(theEnv,logicalName,(long long) i); if (i != dfnxPtr->minNumberOfParameters-1) EnvPrintRouter(theEnv,logicalName," "); } if (dfnxPtr->maxNumberOfParameters == -1) { if (dfnxPtr->minNumberOfParameters != 0) EnvPrintRouter(theEnv,logicalName," "); EnvPrintRouter(theEnv,logicalName,"$?wildargs))\n\n"); } else EnvPrintRouter(theEnv,logicalName,"))\n\n"); } } /*************************************************** NAME : SaveDeffunctions DESCRIPTION : Writes out deffunctions for (save) command INPUTS : The logical output name RETURNS : Nothing useful SIDE EFFECTS : Writes out deffunctions NOTES : None ***************************************************/ static void SaveDeffunctions( void *theEnv, void *theModule, char *logicalName) { SaveConstruct(theEnv,theModule,logicalName,DeffunctionData(theEnv)->DeffunctionConstruct); } #endif #if DEBUGGING_FUNCTIONS /****************************************************************** NAME : DeffunctionWatchAccess DESCRIPTION : Parses a list of deffunction names passed by AddWatchItem() and sets the traces accordingly INPUTS : 1) A code indicating which trace flag is to be set Ignored 2) The value to which to set the trace flags 3) A list of expressions containing the names of the deffunctions for which to set traces RETURNS : TRUE if all OK, FALSE otherwise SIDE EFFECTS : Watch flags set in specified deffunctions NOTES : Accessory function for AddWatchItem() ******************************************************************/ static unsigned DeffunctionWatchAccess( void *theEnv, int code, unsigned newState, EXPRESSION *argExprs) { return(ConstructSetWatchAccess(theEnv,DeffunctionData(theEnv)->DeffunctionConstruct,newState,argExprs, EnvGetDeffunctionWatch,EnvSetDeffunctionWatch)); } /*********************************************************************** NAME : DeffunctionWatchPrint DESCRIPTION : Parses a list of deffunction names passed by AddWatchItem() and displays the traces accordingly INPUTS : 1) The logical name of the output 2) A code indicating which trace flag is to be examined Ignored 3) A list of expressions containing the names of the deffunctions for which to examine traces RETURNS : TRUE if all OK, FALSE otherwise SIDE EFFECTS : Watch flags displayed for specified deffunctions NOTES : Accessory function for AddWatchItem() ***********************************************************************/ static unsigned DeffunctionWatchPrint( void *theEnv, char *logName, int code, EXPRESSION *argExprs) { return(ConstructPrintWatchAccess(theEnv,DeffunctionData(theEnv)->DeffunctionConstruct,logName,argExprs, EnvGetDeffunctionWatch,EnvSetDeffunctionWatch)); } /********************************************************* NAME : EnvSetDeffunctionWatch DESCRIPTION : Sets the trace to ON/OFF for the deffunction INPUTS : 1) TRUE to set the trace on, FALSE to set it off 2) A pointer to the deffunction RETURNS : Nothing useful SIDE EFFECTS : Watch flag for the deffunction set NOTES : None *********************************************************/ globle void EnvSetDeffunctionWatch( void *theEnv, unsigned newState, void *dptr) { ((DEFFUNCTION *) dptr)->trace = (unsigned short) newState; } /********************************************************* NAME : EnvGetDeffunctionWatch DESCRIPTION : Determines if trace messages are gnerated when executing deffunction INPUTS : A pointer to the deffunction RETURNS : TRUE if a trace is active, FALSE otherwise SIDE EFFECTS : None NOTES : None *********************************************************/ globle unsigned EnvGetDeffunctionWatch( void *theEnv, void *dptr) { return(((DEFFUNCTION *) dptr)->trace); } #endif #endif
DrItanium/electron
dffnxfun.c
C
bsd-2-clause
34,758
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_NET_PRECONNECT_H_ #define CHROME_BROWSER_NET_PRECONNECT_H_ #include "chrome/browser/net/url_info.h" class GURL; namespace net { class URLRequestContextGetter; } namespace chrome_browser_net { void PreconnectOnUIThread(const GURL& url, const GURL& first_party_for_cookies, UrlInfo::ResolutionMotivation motivation, int count, net::URLRequestContextGetter* getter); void PreconnectOnIOThread(const GURL& url, const GURL& first_party_for_cookies, UrlInfo::ResolutionMotivation motivation, int count, net::URLRequestContextGetter* getter); } #endif
qtekfun/htcDesire820Kernel
external/chromium_org/chrome/browser/net/preconnect.h
C
gpl-2.0
959
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2262, 1996, 10381, 21716, 5007, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1013, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import React, { MouseEvent, PureComponent, ReactElement } from 'react'; import { IProject } from 'Projects'; import Tile from '../Tile'; export default class List extends PureComponent<{ projects: IProject[], olderCommercial: boolean, olderNoncommercial: boolean, onToggleOlderCommercial: (event: MouseEvent<HTMLButtonElement>) => void, onToggleOlderNoncommercial: (event: MouseEvent<HTMLButtonElement>) => void, onOpen: (projectId: string) => void, }, {}> { constructor(props) { super(props); } public render(): ReactElement<{}> { const commercialTiles = this.props.projects .filter((project) => project.type === 'commercial' && (!project.archived || this.props.olderCommercial)) .map(this.tileRender.bind(this)); const noncommercialTiles = this.props.projects .filter((project) => project.type === 'noncommercial' && (!project.archived || this.props.olderNoncommercial)) .map(this.tileRender.bind(this)); const olderCommercialLabel = this.props.olderCommercial ? 'Hide older' : 'Show older'; const olderNoncommercialLabel = this.props.olderNoncommercial ? 'Hide older' : 'Show older'; return ( <div className="list"> <h2>Commercial experience</h2> {commercialTiles} <div className="controls aligned-center"> <button className="button button-clear" onClick={this.props.onToggleOlderCommercial} >{olderCommercialLabel}</button> </div> <h2>Non-commercial / Open-source</h2> {noncommercialTiles} <div className="controls aligned-center"> <button className="button button-clear" onClick={this.props.onToggleOlderNoncommercial} >{olderNoncommercialLabel}</button> </div> </div> ); } private tileRender(project, index) { const classes = ['item', (project.size || 'is-half')]; const handleOpening = this.openProject.bind(this, project.id); return ( <div key={index} className={classes.join(' ')}> <Tile id={project.id} title={project.title} color={project.color} description={project.description} period={project.period} skills={project.skills} photos={project.photos} onOpen={handleOpening} > {project.content} </Tile> </div> ); } private openProject(projectId: string) { this.props.onOpen(projectId); } }
durasj/website
src/List/List.tsx
TypeScript
mit
2,957
[ 30522, 12324, 10509, 1010, 1063, 8000, 18697, 3372, 1010, 5760, 9006, 29513, 3372, 1010, 10509, 12260, 3672, 1065, 2013, 1005, 10509, 1005, 1025, 12324, 1063, 12997, 3217, 20614, 1065, 2013, 1005, 3934, 1005, 1025, 12324, 14090, 2013, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Release History ## 3.0.0 (2016-08-19) - update `fkooman/rest` and `fkooman/http` dependencies ## 2.0.0 (2015-11-19) - major API update for new `fkooman/rest-plugin-authentication` ## 1.0.1 (2015-09-07) - remove `fkooman/cert-parser` dependency ## 1.0.0 - update `fkooman/rest` and use `fkooman/rest-plugin-authentication` ## 0.1.2 - update `fkooman/cert-parser` ## 0.1.1 - also support `REDIRECT_SSL_CLIENT_CERT` header ## 0.1.0 - initial release
fkooman/php-lib-rest-plugin-authentication-tls
CHANGES.md
Markdown
apache-2.0
457
[ 30522, 1001, 2713, 2381, 1001, 1001, 1017, 1012, 1014, 1012, 1014, 1006, 2355, 1011, 5511, 1011, 2539, 1007, 1011, 10651, 1036, 14352, 17650, 2319, 1013, 2717, 1036, 1998, 1036, 14352, 17650, 2319, 1013, 8299, 1036, 12530, 15266, 1001, 1001...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>V8 API Reference Guide for node.js v7.2.1: v8::Maybe&lt; T &gt; Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="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> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for node.js v7.2.1 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </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 id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1Maybe.html">Maybe</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> &#124; <a href="#friends">Friends</a> &#124; <a href="classv8_1_1Maybe-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">v8::Maybe&lt; T &gt; Class Template Reference</div> </div> </div><!--header--> <div class="contents"> <p><code>#include &lt;<a class="el" href="v8_8h_source.html">v8.h</a>&gt;</code></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a486b608c21c8038d5019bd7d75866345"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a486b608c21c8038d5019bd7d75866345"></a> V8_INLINE bool&#160;</td><td class="memItemRight" valign="bottom"><b>IsNothing</b> () const </td></tr> <tr class="separator:a486b608c21c8038d5019bd7d75866345"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:adc82dc945891060d312fb6fbf8fb56ae"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc82dc945891060d312fb6fbf8fb56ae"></a> V8_INLINE bool&#160;</td><td class="memItemRight" valign="bottom"><b>IsJust</b> () const </td></tr> <tr class="separator:adc82dc945891060d312fb6fbf8fb56ae"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a4959bad473c4549048c1d2271a1a73e0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4959bad473c4549048c1d2271a1a73e0"></a> V8_INLINE T&#160;</td><td class="memItemRight" valign="bottom"><b>ToChecked</b> () const </td></tr> <tr class="separator:a4959bad473c4549048c1d2271a1a73e0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ae2e1c6d0bd1ab5ff8de22a312c4dbb37"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae2e1c6d0bd1ab5ff8de22a312c4dbb37"></a> V8_WARN_UNUSED_RESULT V8_INLINE bool&#160;</td><td class="memItemRight" valign="bottom"><b>To</b> (T *out) const </td></tr> <tr class="separator:ae2e1c6d0bd1ab5ff8de22a312c4dbb37"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a02b19d7fcb7744d8dba3530ef8e14c8c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02b19d7fcb7744d8dba3530ef8e14c8c"></a> V8_INLINE T&#160;</td><td class="memItemRight" valign="bottom"><b>FromJust</b> () const </td></tr> <tr class="separator:a02b19d7fcb7744d8dba3530ef8e14c8c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a0bcb5fb0d0e92a3f0cc546f11068a8df"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0bcb5fb0d0e92a3f0cc546f11068a8df"></a> V8_INLINE T&#160;</td><td class="memItemRight" valign="bottom"><b>FromMaybe</b> (const T &amp;default_value) const </td></tr> <tr class="separator:a0bcb5fb0d0e92a3f0cc546f11068a8df"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:adf61111c2da44e10ba5ab546a9a525ce"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adf61111c2da44e10ba5ab546a9a525ce"></a> V8_INLINE bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator==</b> (const <a class="el" href="classv8_1_1Maybe.html">Maybe</a> &amp;other) const </td></tr> <tr class="separator:adf61111c2da44e10ba5ab546a9a525ce"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:a5bbacc606422d7ab327c2683462342ec"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5bbacc606422d7ab327c2683462342ec"></a> V8_INLINE bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator!=</b> (const <a class="el" href="classv8_1_1Maybe.html">Maybe</a> &amp;other) const </td></tr> <tr class="separator:a5bbacc606422d7ab327c2683462342ec"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a> Friends</h2></td></tr> <tr class="memitem:aeb9593e125b42d748acbd69b72c89f37"><td class="memTemplParams" colspan="2"><a class="anchor" id="aeb9593e125b42d748acbd69b72c89f37"></a> template&lt;class U &gt; </td></tr> <tr class="memitem:aeb9593e125b42d748acbd69b72c89f37"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classv8_1_1Maybe.html">Maybe</a>&lt; U &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><b>Nothing</b> ()</td></tr> <tr class="separator:aeb9593e125b42d748acbd69b72c89f37"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:aeff0e7fedd63cfebe9a5286e2cd8552d"><td class="memTemplParams" colspan="2"><a class="anchor" id="aeff0e7fedd63cfebe9a5286e2cd8552d"></a> template&lt;class U &gt; </td></tr> <tr class="memitem:aeff0e7fedd63cfebe9a5286e2cd8552d"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classv8_1_1Maybe.html">Maybe</a>&lt; U &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><b>Just</b> (const U &amp;u)</td></tr> <tr class="separator:aeff0e7fedd63cfebe9a5286e2cd8552d"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template&lt;class T&gt;<br /> class v8::Maybe&lt; T &gt;</h3> <p>A simple <a class="el" href="classv8_1_1Maybe.html">Maybe</a> type, representing an object which may or may not have a value, see <a href="https://hackage.haskell.org/package/base/docs/Data-Maybe.html">https://hackage.haskell.org/package/base/docs/Data-Maybe.html</a>.</p> <p>If an API method returns a Maybe&lt;&gt;, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a TerminateExecution exception was thrown. In that case, a "Nothing" value is returned. </p> </div><hr/>The documentation for this class was generated from the following file:<ul> <li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.11 </small></address> </body> </html>
v8-dox/v8-dox.github.io
03b1c31/html/classv8_1_1Maybe.html
HTML
mit
10,130
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 1060, 11039, 19968, 1015, 1012, 1014, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package guestUserInterface.personalWordBook; import java.awt.*; import java.awt.event.*; import javax.swing.*; import libraryManager.*; import libraryInterface.*; public class PersonalWordDialog extends JDialog implements WindowListener { private PersonalWordPanel wordPanel; public PersonalWordDialog(int index) { wordPanel=new PersonalWordPanel(index, this); PersonalLibrary libP=PersonalLibraryManager.getLibraryAccountor().get(index); if(libP!=null) { this.setTitle(libP.getName()); } getContentPane().add(wordPanel); setSize(520,400); this.addWindowListener(this); setVisible(true); } public void windowActivated(WindowEvent e) { // TODO Auto-generated method stub } public void windowClosed(WindowEvent e) { // TODO Auto-generated method stub } public void windowClosing(WindowEvent e) { PersonalLibraryManager.getLibraryAccountor().writeCurrentPersonalLibraries(); } public void windowDeactivated(WindowEvent e) { // TODO Auto-generated method stub } public void windowDeiconified(WindowEvent e) { // TODO Auto-generated method stub } public void windowIconified(WindowEvent e) { // TODO Auto-generated method stub } public void windowOpened(WindowEvent e) { // TODO Auto-generated method stub } }
accelazh/ProspectDict
guestUserInterface/personalWordBook/PersonalWordDialog.java
Java
mit
1,371
[ 30522, 7427, 4113, 20330, 18447, 2121, 12172, 1012, 3167, 18351, 8654, 1025, 12324, 9262, 1012, 22091, 2102, 1012, 1008, 1025, 12324, 9262, 1012, 22091, 2102, 1012, 2724, 1012, 1008, 1025, 12324, 9262, 2595, 1012, 7370, 1012, 1008, 1025, 12...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Android Basics Nanodegree This repository contains the projects required to complete the [Android Basics Nanodegree](https://in.udacity.com/course/android-basics-nanodegree-by-google--nd803/) offered by [Udacity](https://in.udacity.com/). ## List of courses It consisted of the following five courses: * [Android Basics: User Interface](https://www.udacity.com/course/android-development-for-beginners--ud837) * [Android Basics: User Input](https://www.udacity.com/course/android-basics-user-input--ud836) * [Android Basics: Multi-screen Apps](https://www.udacity.com/course/android-basics-multi-screen-apps--ud839) * [Android Basics: Networking](https://www.udacity.com/course/android-basics-networking--ud843) * [Android Basics: Data Storage](https://www.udacity.com/course/android-basics-data-storage--ud845) The projects were based on the content covered in these courses. ## List of projects 1. A Single Screen App 2. Score Keeper App 3. Quiz App 4. Music Structure App 5. Repord Card 6. Tour Guide App 7. Book Listing App 8. News App 9. Habit Tracker App 10. Inventory App ## Certificate ![certificate](./android-basics-certificate.jpg)
rahulptel/Android-Basics-Nanodegree
README.md
Markdown
mit
1,154
[ 30522, 1001, 11924, 24078, 28991, 3207, 28637, 2023, 22409, 3397, 1996, 3934, 3223, 2000, 3143, 1996, 1031, 11924, 24078, 28991, 3207, 28637, 1033, 1006, 16770, 1024, 1013, 1013, 1999, 1012, 20904, 6305, 3012, 1012, 4012, 1013, 2607, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//>>built define({invalidMessage:"Angivet v\u00e4rde \u00e4r inte giltigt.",missingMessage:"V\u00e4rdet kr\u00e4vs.",rangeMessage:"V\u00e4rdet ligger utanf\u00f6r intervallet."});
ycabon/presentations
2020-devsummit/arcgis-js-api-road-ahead/js-api/dijit/form/nls/sv/validate.js
JavaScript
mit
179
[ 30522, 1013, 1013, 1028, 1028, 2328, 9375, 1006, 1063, 19528, 7834, 3736, 3351, 1024, 1000, 17076, 3512, 2102, 1058, 1032, 1057, 8889, 2063, 2549, 25547, 1032, 1057, 8889, 2063, 2549, 2099, 20014, 2063, 13097, 3775, 13512, 1012, 1000, 1010,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"> <meta name="format-detection" content="telephone=no"> <meta name="description" content="PyCon Colombia 2018 será la segunda conferencia nacional para usuarios y desarrolladores del lenguaje de programación Python."> <meta property="og:site_name" content="PyCon Colombia"/> <meta property="og:title" content="PyCon Colombia | Febrero 9, 10 y 11 de 2018 | Medellín, Colombia"/> <meta property="og:description" content="PyCon Colombia 2018 será la segunda conferencia nacional para usuarios y desarrolladores del lenguaje de programación Python."/> <meta property="og:image" content="https://www.pycon.co/static/images/opimage.png"> <meta property="og:url" content="https://www.pycon.co/"> <meta property="og:type" content="website"/> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:site" content="@pyconcolombia"> <meta name="twitter:title" content="PyCon Colombia | Febrero 9, 10 y 11 de 2018 | Medellín, Colombia"> <meta name="twitter:description" content="PyCon Colombia 2018 será la segunda conferencia nacional para usuarios y desarrolladores del lenguaje de programación Python."> <meta name="twitter:image" content="https://www.pycon.co/static/images/opimage.png"> <meta name="google-site-verification" content="Lb8Bugu2ORvYa3ZIYPfPDWFEntukt1Yztc4I8SDgJ6g" /> <title>PyCon Colombia | Febrero 9, 10 y 11 de 2018 | Medellín, Colombia</title> <link rel="apple-touch-icon" sizes="57x57" href="/static/favicon/apple-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/static/favicon/apple-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/static/favicon/apple-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/static/favicon/apple-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/static/favicon/apple-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/static/favicon/apple-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/static/favicon/apple-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/static/favicon/apple-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-icon-180x180.png"> <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon/favicon-16x16.png"> <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="96x96" href="/static/favicon/favicon-96x96.png"> <link rel="icon" type="image/png" sizes="192x192" href="/static/favicon/android-icon-192x192.png"> <link rel="manifest" href="/static/favicon/manifest.json"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileImage" content="/static/favicon/ms-icon-144x144.png"> <meta name="theme-color" content="#ffffff"> <!-- CSS --> <link rel="stylesheet" href="/static/gen/styles.css?h=4621eb6d"> </head> <body> <div class="body-wrapper"> <button class="js-gitter-toggle-chat-button gitter-custom-button">Abrir Chat</button> <div class="container-fluid header-content"> <div class="container nav-container"> <nav class="navbar navbar-expand-md navbar-dark"> <a class="navbar-brand" href="/es/">PyCon Colombia</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav mr-auto"> <li class="nav-item"> <a class="nav-link" href="/es/lugar/">Lugar</a> </li> <li class="nav-item active"> <a class="nav-link" href="/es/ponentes/">Ponentes</a> </li> <li class="nav-item"> <a class="nav-link" href="/es/ponencias/">Ponencias</a> </li> <li class="nav-item"> <a class="nav-link" href="/es/patrocinadores/">Patrocinadores</a> </li> <li class="nav-item"> <a class="nav-link" href="/es/voluntarios/">Voluntarios</a> </li> <li class="nav-item"> <a class="nav-link" href="/es/equipo/">Organizadores</a> </li> </ul> <ul class="navbar-nav ml-auto"> <li class="dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">v.2018</a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="http://2020.pycon.co">v.2020</a> <a class="dropdown-item" href="http://2019.pycon.co">v.2019</a> <a class="dropdown-item" href="http://2017.pycon.co">v.2017</a> </div> </li> </ul> <ul class="navbar-nav ml-auto"> <li><a href="/speakers/cesar-augusto-herdenez/">English</a></li> </ul> </div> </nav> </div> </div> <div class="container-fluid light-section"> <div class="section-container"> <div class="container"> <div class="col-lg-10 col-md-10 col-sm-10 col-xs-12 mx-auto"> <div class="row"> <div class="speaker-details"> <h1>Cesar Augusto Herdenez</h1> <div class="speaker-job"> <h2>Auxiliar Comercial&nbsp;en&nbsp;Banco de Occidente</h2> </div> <h3 class="speaker-country">Colombia</h3> <br> </div> <div class="col-sm-12 col-md-5 align-self-center"> <div class="speaker"> <a href="/es/ponentes/cesar-augusto-herdenez/" title="Cesar Augusto Herdenez""> <img class="speaker-image" id="speaker-image-link-1" alt="Cesar Augusto Herdenez" src= "/speakers/cesar-augusto-herdenez/cesar-augusto-herdenez.jpg"/> </a> </div> <div id="link-1" class="speaker-social"> <a id="link-1" class="social-hover" href="https://www.twitter.com/cesarau0619" target="blank"><div class="social-icon icon-twitter"></div></a> <a id="link-1" class="social-hover" href="https://www.github.com/cesar0510" target="blank"><div class="social-icon icon-github"></div></a> </div> </div> <div class="col-sm-12 col-md-7 align-self-center"> <div class="speaker-info"> <p>Ingeniero de Sistemas de la Fundación Universitario San Martín, desarrollador backend y freelance.</p> </ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul> </ul></ul></ul></ul><h3>Talleres</h3><ul><li><a href="/es/ponencias/disena-tu-propia-cli-con-python/">Diseña tu propia CLI con Python <small><i>(Español)</i></small></a></li></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul> </div> </div> </div> </div> </div> </div> </div> <!-- Footer Section --> <footer> <div class="container-fluid black-section"> <div class="row"> <div class="col-md-12"> <div class="social-icons-container"> <p>Hecho con <i class="fa fa-heart"></i> en Colombia, usando <a href="https://www.python.org/" title="Python" target="blank">Python</a> y <a href="https://getlektor.com/" title="Lektor" target="blank">Lektor</a> </p> <p>Derechos de Autor, Python Colombia 2018. Todos los derechos reservados. | <a href="/es/codigo-de-conducta/">Código de conducta</a> | <a href="mailto:hello@pycon.co">hello@pycon.co</a></p> <br> <a href="https://www.twitter.com/pyconcolombia" title="Twitter" target="blank"><div class="social-icon icon-twitter"></div></a> <a href="https://www.facebook.com/pyconcolombia" title="Facebook" target="blank"><div class="social-icon icon-facebook"></div></a> <a href="https://www.medium.com/@pyconcolombia" title="Medium" target="blank"><div class="social-icon icon-medium"></div></a> <a href="https://www.gitter.im/pyconcolombia/lobby" title="Gitter" target="blank"><div class="social-icon icon-gitter"></div></a> </div> </div> </div> </div> </footer> <img hidden src="/static/images/opimage.jpg" /> </div> <!-- Include project main library --> <script src="/static/gen/app.js?h=4dac91d8"></script> <!-- Google analytics --> <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','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-105321720-1', 'auto'); ga('send', 'pageview'); </script> <script> ((window.gitter = {}).chat = {}).options = { room: 'PyConColombia/Lobby', activationElement: '.gitter-button', }; </script> <script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script> </body> </html>
PyConColombia/landing-page-2018
es/ponentes/cesar-augusto-herdenez/index.html
HTML
unlicense
10,006
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 8299, 1011, 1041, 15549, 2615, 1027, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package main import "testing" //totally trivial, I know func TestOperationList(t *testing.T) { var operations []Operation = operationList() if operationLength := len(operations); operationLength != 3 { t.Error("Expected 2 operations in list but got ", operationLength) } }
canifest/core
core_test.go
GO
mit
280
[ 30522, 7427, 2364, 12324, 1000, 5604, 1000, 1013, 1013, 6135, 20610, 1010, 1045, 2113, 4569, 2278, 3231, 25918, 3370, 9863, 1006, 1056, 1008, 5604, 1012, 1056, 1007, 1063, 13075, 3136, 1031, 1033, 3169, 1027, 3169, 9863, 1006, 1007, 2065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.otherobjects.cms.controllers; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONArray; import org.json.JSONObject; import org.otherobjects.cms.dao.DaoService; import org.otherobjects.cms.jcr.UniversalJcrDao; import org.otherobjects.cms.model.BaseNode; import org.otherobjects.cms.model.Template; import org.otherobjects.cms.model.TemplateBlockReference; import org.otherobjects.cms.model.TemplateLayout; import org.otherobjects.cms.model.TemplateRegion; import org.otherobjects.cms.util.RequestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; /** * Controller that manages template design. * * @author rich */ @Controller public class DesignerController { private final Logger logger = LoggerFactory.getLogger(DesignerController.class); @Resource private DaoService daoService; /** * Saves arrangmement of blocks on a template. */ @RequestMapping("/designer/saveArrangement/**") public ModelAndView saveArrangement(HttpServletRequest request, HttpServletResponse response) throws Exception { UniversalJcrDao dao = (UniversalJcrDao) daoService.getDao(BaseNode.class); String templateId = request.getParameter("templateId"); String arrangement = request.getParameter("arrangement"); logger.info("Arrangement: " + arrangement); JSONArray regions = new JSONArray(arrangement); // Load existing template Template template = (Template) dao.get(templateId); Map<String, TemplateBlockReference> blockRefs = new HashMap<String, TemplateBlockReference>(); // Gather all existing blockRefs for (TemplateRegion tr : template.getRegions()) { for (TemplateBlockReference trb : tr.getBlocks()) { blockRefs.put(trb.getId(), trb); } tr.setBlocks(new ArrayList<TemplateBlockReference>()); } // Re-insert blockRefs according to arrangement for (int i = 0; i < regions.length(); i++) { JSONObject region = (JSONObject) regions.get(i); TemplateRegion tr = template.getRegion((String) region.get("name")); JSONArray blockIds = (JSONArray) region.get("blockIds"); for (int j = 0; j < blockIds.length(); j++) { String blockId = (String) blockIds.get(j); tr.getBlocks().add(blockRefs.get(blockId)); blockRefs.remove(blockId); } } dao.save(template, false); // Delete removed blocks // FIXME Need to remove deleted blocks from live for (TemplateBlockReference ref : blockRefs.values()) { dao.remove(ref.getId()); } return null; } /** * Saves arrangmement of blocks on a template. */ @RequestMapping("/designer/publishTemplate/**") public ModelAndView publishTemplate(HttpServletRequest request, HttpServletResponse response) throws Exception { UniversalJcrDao dao = (UniversalJcrDao) daoService.getDao(BaseNode.class); String templateId = RequestUtils.getId(request); // Load existing template Template template = (Template) dao.get(templateId); Map<String, TemplateBlockReference> blockRefs = new HashMap<String, TemplateBlockReference>(); // Gather all existing blockRefs for (TemplateRegion tr : template.getRegions()) { for (TemplateBlockReference trb : tr.getBlocks()) { blockRefs.put(trb.getId(), trb); } } // Check all blocks are published for (TemplateBlockReference ref : blockRefs.values()) { if (!ref.isPublished()) dao.publish(ref, null); if (ref.getBlockData() != null && !ref.getBlockData().isPublished()) dao.publish(ref.getBlockData(), null); } // Publish template dao.publish(template, null); return null; } /** * Creates a new template for specified type. */ @RequestMapping("/designer/createTemplate/**") public ModelAndView createTemplate(HttpServletRequest request, HttpServletResponse response) throws Exception { UniversalJcrDao dao = (UniversalJcrDao) daoService.getDao(BaseNode.class); String resourceObjectId = RequestUtils.getId(request); BaseNode resourceObject = dao.get(resourceObjectId); String templateCode = request.getParameter("code"); String layoutId = request.getParameter("layout"); Template template = new Template(); template.setPath("/designer/templates/"); template.setCode(templateCode); template.setLabel(resourceObject.getTypeDef().getLabel() + " Template"); TemplateLayout layout = (TemplateLayout) dao.get(layoutId); template.setLayout(layout); dao.save(template, false); // FIXME Need to wrap linkPath response.sendRedirect(resourceObject.getOoUrlPath()); return null; } /** * Changes layout for specified template. */ @RequestMapping("/designer/changeLayout/**") public ModelAndView changeLayout(HttpServletRequest request, HttpServletResponse response) throws Exception { return null; } }
0x006EA1E5/oo6
src/main/java/org/otherobjects/cms/controllers/DesignerController.java
Java
gpl-3.0
5,683
[ 30522, 7427, 8917, 1012, 2060, 16429, 20614, 2015, 1012, 4642, 2015, 1012, 21257, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 9140, 9863, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 23325, 2863, 2361, 1025, 12324, 9262, 1012, 21183, 4014, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc on Fri Nov 26 15:38:56 EST 2010 --> <TITLE> Xerces Native Interface: Package org.apache.xerces.xni </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <FONT size="+1" CLASS="FrameTitleFont"> <A HREF="../../../../org/apache/xerces/xni/package-summary.html" TARGET="classFrame">org.apache.xerces.xni</A></FONT> <TABLE BORDER="0" WIDTH="100%"> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Interfaces</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="Augmentations.html" TARGET="classFrame"><I>Augmentations</I></A> <BR> <A HREF="NamespaceContext.html" TARGET="classFrame"><I>NamespaceContext</I></A> <BR> <A HREF="XMLAttributes.html" TARGET="classFrame"><I>XMLAttributes</I></A> <BR> <A HREF="XMLDocumentFragmentHandler.html" TARGET="classFrame"><I>XMLDocumentFragmentHandler</I></A> <BR> <A HREF="XMLDocumentHandler.html" TARGET="classFrame"><I>XMLDocumentHandler</I></A> <BR> <A HREF="XMLDTDContentModelHandler.html" TARGET="classFrame"><I>XMLDTDContentModelHandler</I></A> <BR> <A HREF="XMLDTDHandler.html" TARGET="classFrame"><I>XMLDTDHandler</I></A> <BR> <A HREF="XMLLocator.html" TARGET="classFrame"><I>XMLLocator</I></A> <BR> <A HREF="XMLResourceIdentifier.html" TARGET="classFrame"><I>XMLResourceIdentifier</I></A></FONT></TD> </TR> </TABLE> <TABLE BORDER="0" WIDTH="100%"> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Classes</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="QName.html" TARGET="classFrame">QName</A> <BR> <A HREF="XMLString.html" TARGET="classFrame">XMLString</A></FONT></TD> </TR> </TABLE> <TABLE BORDER="0" WIDTH="100%"> <TR> <TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> Exceptions</FONT>&nbsp; <FONT CLASS="FrameItemFont"> <BR> <A HREF="XNIException.html" TARGET="classFrame">XNIException</A></FONT></TD> </TR> </TABLE> </BODY> </HTML>
jsalla/jatintest
lib/xerces-2_11_0/docs/javadocs/xni/org/apache/xerces/xni/package-frame.html
HTML
mit
2,115
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 1014, 11048, 3388, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# SSClusterViewer/app This folder contains the javascript files for the application. # SSClusterViewer/resources This folder contains static resources (typically an `"images"` folder as well). # SSClusterViewer/overrides This folder contains override classes. All overrides in this folder will be automatically included in application builds if the target class of the override is loaded. # SSClusterViewer/sass/etc This folder contains misc. support code for sass builds (global functions, mixins, etc.) # SSClusterViewer/sass/src This folder contains sass files defining css rules corresponding to classes included in the application's javascript code build. By default, files in this folder are mapped to the application's root namespace, 'SSClusterViewer'. The namespace to which files in this directory are matched is controlled by the app.sass.namespace property in SSClusterViewer/.sencha/app/sencha.cfg. # SSClusterViewer/sass/var This folder contains sass files defining sass variables corresponding to classes included in the application's javascript code build. By default, files in this folder are mapped to the application's root namespace, 'SSClusterViewer'. The namespace to which files in this directory are matched is controlled by the app.sass.namespace property in SSClusterViewer/.sencha/app/sencha.cfg.
marcos-garcia/smartsantanderdataanalysis
sswebpage/SSClusterViewer/Readme.md
Markdown
gpl-2.0
1,343
[ 30522, 1001, 7020, 20464, 19966, 2121, 8584, 2121, 1013, 10439, 2023, 19622, 3397, 1996, 9262, 22483, 6764, 2005, 1996, 4646, 1012, 1001, 7020, 20464, 19966, 2121, 8584, 2121, 1013, 4219, 2023, 19622, 3397, 10763, 4219, 1006, 4050, 2019, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
echo off if "%1" == "h" goto begin mshta vbscript:createobject("wscript.shell").run("%~nx0 h %1",0)(window.close)&&exit :begin "C:\Program Files\Adobe\Adobe Photoshop CC 2018\Photoshop.exe" %2 cls
sansna/windows.bat
ps.bat
Batchfile
lgpl-3.0
198
[ 30522, 9052, 2125, 2065, 1000, 1003, 1015, 1000, 1027, 1027, 1000, 1044, 1000, 2288, 2080, 4088, 5796, 22893, 1058, 5910, 23235, 1024, 3443, 16429, 20614, 1006, 1000, 1059, 22483, 1012, 5806, 1000, 1007, 1012, 2448, 1006, 1000, 1003, 1066, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** Copyright (C) 2013 Alexander Mariel This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * Autor: Alexander Mariel * Modified by: Asier Mujika * Trabajo para la asignatura TAIA * Practica individual con agentes en la plataforma JADE */ package utils; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip; import javax.sound.sampled.DataLine; import javax.sound.sampled.LineUnavailableException; import javax.sound.sampled.UnsupportedAudioFileException; /** * This class plays/stops/pauses an audio clip loaded from the file system * * @author Alex * */ public class AudioPlayer { private Clip sound; private AudioInputStream ais; /** * Constructor, loads the audio clip with the given name * @param pFileName audio clip name */ public AudioPlayer(String pFileName) { try { //Open file File f = new File(pFileName); //Read data sound = AudioSystem.getClip(); ais = AudioSystem.getAudioInputStream(f); //Get file format AudioFormat format = ais.getFormat(); DataLine.Info info = new DataLine.Info(Clip.class, format); sound = (Clip)AudioSystem.getLine(info); sound.open(ais); } catch (LineUnavailableException | IOException | UnsupportedAudioFileException e) { e.printStackTrace(); } } /** * Plays a sound from the beginning */ public void startSound() { sound.setFramePosition(0); playSound(); sound.loop(10); } /** * Plays a sound from the point where it was stopped */ public void playSound() { sound.start(); } /** * Stops a sound */ public void pauseSound() { sound.stop(); } }
amujika/TAIA-AgentParty
src/utils/AudioPlayer.java
Java
mit
2,452
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2286, 3656, 5032, 2140, 2023, 2565, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 2009, 2104, 1996, 3408, 1997, 1996, 27004, 2236, 2270, 6...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
FactoryGirl.define do factory :content, class: Spree::Content do association :page, factory: :page sequence(:title) { |n| "Page Content ##{n}" } body { FFaker::Lorem.paragraphs.join '\n\n' } hide_title false link "" link_text "" context "" attachment nil end end
FineLineAutomation/spree_essential_content
spec/factories/content.rb
Ruby
bsd-3-clause
299
[ 30522, 4713, 15239, 1012, 9375, 2079, 4713, 1024, 4180, 1010, 2465, 1024, 11867, 9910, 1024, 1024, 4180, 2079, 2523, 1024, 3931, 1010, 4713, 1024, 1024, 3931, 5537, 1006, 1024, 2516, 1007, 1063, 1064, 1050, 1064, 1000, 3931, 4180, 1001, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBEACTIONREQUEST_P_H #define QTAWS_DESCRIBEACTIONREQUEST_P_H #include "sagemakerrequest_p.h" #include "describeactionrequest.h" namespace QtAws { namespace SageMaker { class DescribeActionRequest; class DescribeActionRequestPrivate : public SageMakerRequestPrivate { public: DescribeActionRequestPrivate(const SageMakerRequest::Action action, DescribeActionRequest * const q); DescribeActionRequestPrivate(const DescribeActionRequestPrivate &other, DescribeActionRequest * const q); private: Q_DECLARE_PUBLIC(DescribeActionRequest) }; } // namespace SageMaker } // namespace QtAws #endif
pcolby/libqtaws
src/sagemaker/describeactionrequest_p.h
C
lgpl-3.0
1,430
[ 30522, 1013, 1008, 9385, 2286, 1011, 25682, 2703, 18650, 2023, 5371, 2003, 2112, 1997, 1053, 2696, 9333, 1012, 1053, 2696, 9333, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 2009, 2104, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package e2e import ( "fmt" "strings" "time" "k8s.io/kubernetes/pkg/api" client "k8s.io/kubernetes/pkg/client/unversioned" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/sets" "k8s.io/kubernetes/pkg/util/wait" "k8s.io/kubernetes/test/e2e/framework" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) const ( // Interval to framework.Poll /runningpods on a node pollInterval = 1 * time.Second // Interval to framework.Poll /stats/container on a node containerStatsPollingInterval = 5 * time.Second // Maximum number of nodes that we constraint to maxNodesToCheck = 10 ) // getPodMatches returns a set of pod names on the given node that matches the // podNamePrefix and namespace. func getPodMatches(c *client.Client, nodeName string, podNamePrefix string, namespace string) sets.String { matches := sets.NewString() framework.Logf("Checking pods on node %v via /runningpods endpoint", nodeName) runningPods, err := framework.GetKubeletPods(c, nodeName) if err != nil { framework.Logf("Error checking running pods on %v: %v", nodeName, err) return matches } for _, pod := range runningPods.Items { if pod.Namespace == namespace && strings.HasPrefix(pod.Name, podNamePrefix) { matches.Insert(pod.Name) } } return matches } // waitTillNPodsRunningOnNodes polls the /runningpods endpoint on kubelet until // it finds targetNumPods pods that match the given criteria (namespace and // podNamePrefix). Note that we usually use label selector to filter pods that // belong to the same RC. However, we use podNamePrefix with namespace here // because pods returned from /runningpods do not contain the original label // information; they are reconstructed by examining the container runtime. In // the scope of this test, we do not expect pod naming conflicts so // podNamePrefix should be sufficient to identify the pods. func waitTillNPodsRunningOnNodes(c *client.Client, nodeNames sets.String, podNamePrefix string, namespace string, targetNumPods int, timeout time.Duration) error { return wait.Poll(pollInterval, timeout, func() (bool, error) { matchCh := make(chan sets.String, len(nodeNames)) for _, item := range nodeNames.List() { // Launch a goroutine per node to check the pods running on the nodes. nodeName := item go func() { matchCh <- getPodMatches(c, nodeName, podNamePrefix, namespace) }() } seen := sets.NewString() for i := 0; i < len(nodeNames.List()); i++ { seen = seen.Union(<-matchCh) } if seen.Len() == targetNumPods { return true, nil } framework.Logf("Waiting for %d pods to be running on the node; %d are currently running;", targetNumPods, seen.Len()) return false, nil }) } // updates labels of nodes given by nodeNames. // In case a given label already exists, it overwrites it. If label to remove doesn't exist // it silently ignores it. func updateNodeLabels(c *client.Client, nodeNames sets.String, toAdd, toRemove map[string]string) { const maxRetries = 5 for nodeName := range nodeNames { var node *api.Node var err error for i := 0; i < maxRetries; i++ { node, err = c.Nodes().Get(nodeName) if err != nil { framework.Logf("Error getting node %s: %v", nodeName, err) continue } if toAdd != nil { for k, v := range toAdd { node.ObjectMeta.Labels[k] = v } } if toRemove != nil { for k := range toRemove { delete(node.ObjectMeta.Labels, k) } } _, err = c.Nodes().Update(node) if err != nil { framework.Logf("Error updating node %s: %v", nodeName, err) } else { break } } Expect(err).NotTo(HaveOccurred()) } } var _ = framework.KubeDescribe("kubelet", func() { var c *client.Client var numNodes int var nodeNames sets.String var nodeLabels map[string]string f := framework.NewDefaultFramework("kubelet") var resourceMonitor *framework.ResourceMonitor BeforeEach(func() { c = f.Client nodes := framework.GetReadySchedulableNodesOrDie(f.Client) numNodes = len(nodes.Items) nodeNames = sets.NewString() // If there are a lot of nodes, we don't want to use all of them // (if there are 1000 nodes in the cluster, starting 10 pods/node // will take ~10 minutes today). And there is also deletion phase. // // Instead, we choose at most 10 nodes and will constraint pods // that we are creating to be scheduled only on that nodes. if numNodes > maxNodesToCheck { numNodes = maxNodesToCheck nodeLabels = make(map[string]string) nodeLabels["kubelet_cleanup"] = "true" } for i := 0; i < numNodes; i++ { nodeNames.Insert(nodes.Items[i].Name) } updateNodeLabels(c, nodeNames, nodeLabels, nil) // Start resourceMonitor only in small clusters. if len(nodes.Items) <= maxNodesToCheck { resourceMonitor = framework.NewResourceMonitor(f.Client, framework.TargetContainers(), containerStatsPollingInterval) resourceMonitor.Start() } }) AfterEach(func() { if resourceMonitor != nil { resourceMonitor.Stop() } // If we added labels to nodes in this test, remove them now. updateNodeLabels(c, nodeNames, nil, nodeLabels) }) framework.KubeDescribe("Clean up pods on node", func() { type DeleteTest struct { podsPerNode int timeout time.Duration } deleteTests := []DeleteTest{ {podsPerNode: 10, timeout: 1 * time.Minute}, } for _, itArg := range deleteTests { name := fmt.Sprintf( "kubelet should be able to delete %d pods per node in %v.", itArg.podsPerNode, itArg.timeout) It(name, func() { totalPods := itArg.podsPerNode * numNodes By(fmt.Sprintf("Creating a RC of %d pods and wait until all pods of this RC are running", totalPods)) rcName := fmt.Sprintf("cleanup%d-%s", totalPods, string(util.NewUUID())) Expect(framework.RunRC(framework.RCConfig{ Client: f.Client, Name: rcName, Namespace: f.Namespace.Name, Image: framework.GetPauseImageName(f.Client), Replicas: totalPods, NodeSelector: nodeLabels, })).NotTo(HaveOccurred()) // Perform a sanity check so that we know all desired pods are // running on the nodes according to kubelet. The timeout is set to // only 30 seconds here because framework.RunRC already waited for all pods to // transition to the running status. Expect(waitTillNPodsRunningOnNodes(f.Client, nodeNames, rcName, f.Namespace.Name, totalPods, time.Second*30)).NotTo(HaveOccurred()) if resourceMonitor != nil { resourceMonitor.LogLatest() } By("Deleting the RC") framework.DeleteRC(f.Client, f.Namespace.Name, rcName) // Check that the pods really are gone by querying /runningpods on the // node. The /runningpods handler checks the container runtime (or its // cache) and returns a list of running pods. Some possible causes of // failures are: // - kubelet deadlock // - a bug in graceful termination (if it is enabled) // - docker slow to delete pods (or resource problems causing slowness) start := time.Now() Expect(waitTillNPodsRunningOnNodes(f.Client, nodeNames, rcName, f.Namespace.Name, 0, itArg.timeout)).NotTo(HaveOccurred()) framework.Logf("Deleting %d pods on %d nodes completed in %v after the RC was deleted", totalPods, len(nodeNames), time.Since(start)) if resourceMonitor != nil { resourceMonitor.LogCPUSummary() } }) } }) })
anguslees/kubernetes
test/e2e/kubelet.go
GO
apache-2.0
7,953
[ 30522, 1013, 1008, 9385, 2325, 1996, 13970, 5677, 7159, 2229, 6048, 1012, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, 2007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Member List</title> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="1">&nbsp;&nbsp;</td> <td class="postheader" valign="center"> <a href="index.html"> <font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"> <font color="#004faf">All Classes</font></a>&nbsp;&middot; <a href="namespaces.html"> <font color="#004faf">All Namespaces</font></a>&nbsp;&middot; <a href="modules.html"> <font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"> <font color="#004faf">Functions</font></a>&nbsp;&middot; <a href="files.html"> <font color="#004faf">Files</font></a> </td> </tr> </table> <!-- Generated by Doxygen 1.7.5 --> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="a00655.html">Tp</a> </li> <li class="navelem"><a class="el" href="a00659.html">Client</a> </li> <li class="navelem"><a class="el" href="a00121.html">ClientHandlerInterface</a> </li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">Tp::Client::ClientHandlerInterface Member List</div> </div> </div> <div class="contents"> This is the complete list of members for <a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a>, including all inherited members.<table> <tr class="memlist"><td><a class="el" href="a00033.html#ae73665dbe1abf1c50a8ab98221274dbe">AbstractInterface</a>(DBusProxy *proxy, const QLatin1String &amp;interface)</td><td><a class="el" href="a00033.html">Tp::AbstractInterface</a></td><td><code> [protected]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00033.html#a454ff620101be4299892b3e47fead4d2">AbstractInterface</a>(const QString &amp;busName, const QString &amp;path, const QLatin1String &amp;interface, const QDBusConnection &amp;connection, QObject *parent)</td><td><a class="el" href="a00033.html">Tp::AbstractInterface</a></td><td><code> [protected]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#asyncCall">asyncCall</a>(const QString &amp;method, const QVariant &amp;arg1, const QVariant &amp;arg2, const QVariant &amp;arg3, const QVariant &amp;arg4, const QVariant &amp;arg5, const QVariant &amp;arg6, const QVariant &amp;arg7, const QVariant &amp;arg8)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#asyncCallWithArgumentList">asyncCallWithArgumentList</a>(const QString &amp;method, const QList&lt; QVariant &gt; &amp;args)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#blockSignals">blockSignals</a>(bool block)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#call">call</a>(const QString &amp;method, const QVariant &amp;arg1, const QVariant &amp;arg2, const QVariant &amp;arg3, const QVariant &amp;arg4, const QVariant &amp;arg5, const QVariant &amp;arg6, const QVariant &amp;arg7, const QVariant &amp;arg8)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#call-2">call</a>(QDBus::CallMode mode, const QString &amp;method, const QVariant &amp;arg1, const QVariant &amp;arg2, const QVariant &amp;arg3, const QVariant &amp;arg4, const QVariant &amp;arg5, const QVariant &amp;arg6, const QVariant &amp;arg7, const QVariant &amp;arg8)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#callWithArgumentList">callWithArgumentList</a>(QDBus::CallMode mode, const QString &amp;method, const QList&lt; QVariant &gt; &amp;args)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#callWithCallback">callWithCallback</a>(const QString &amp;method, const QList&lt; QVariant &gt; &amp;args, QObject *receiver, const char *returnMethod, const char *errorMethod)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#callWithCallback-2">callWithCallback</a>(const QString &amp;method, const QList&lt; QVariant &gt; &amp;args, QObject *receiver, const char *slot)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#checkConnectArgs">checkConnectArgs</a>(const char *signal, const QObject *object, const char *method)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#child">child</a>(const char *objName, const char *inheritsClass, bool recursiveSearch) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#childEvent">childEvent</a>(QChildEvent *event)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected, virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#children">children</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#className">className</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a65c0d05c01eacbc939576e978c536e35">ClientHandlerInterface</a>(const QString &amp;busName, const QString &amp;objectPath, QObject *parent=0)</td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a3ddc3654d064c13942ba4ffb1bb53ee8">ClientHandlerInterface</a>(const QDBusConnection &amp;connection, const QString &amp;busName, const QString &amp;objectPath, QObject *parent=0)</td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a656ec0dc35846ed8de6360c45a7de376">ClientHandlerInterface</a>(Tp::DBusProxy *proxy)</td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#af8fc0be64052bb9a1a206dcb77d7f0e1">ClientHandlerInterface</a>(const Tp::Client::ClientInterface &amp;mainInterface)</td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td><code> [explicit]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#adcd41c3fdba1b62b007ae9c11049bb35">ClientHandlerInterface</a>(const Tp::Client::ClientInterface &amp;mainInterface, QObject *parent)</td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#connect">connect</a>(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [static]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#connect-2">connect</a>(const QObject *sender, const QMetaMethod &amp;signal, const QObject *receiver, const QMetaMethod &amp;method, Qt::ConnectionType type)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [static]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#connect-3">connect</a>(const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#connection">connection</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#connectNotify">connectNotify</a>(const char *signal)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected, virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#customEvent">customEvent</a>(QEvent *event)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected, virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#deleteLater">deleteLater</a>()</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#destroyed">destroyed</a>(QObject *obj)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#disconnect">disconnect</a>(const QObject *sender, const char *signal, const QObject *receiver, const char *method)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [static]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#disconnect-2">disconnect</a>(const QObject *sender, const QMetaMethod &amp;signal, const QObject *receiver, const QMetaMethod &amp;method)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [static]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#disconnect-3">disconnect</a>(const char *signal, const QObject *receiver, const char *method)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#disconnect-4">disconnect</a>(const QObject *receiver, const char *method)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#disconnectNotify">disconnectNotify</a>(const char *signal)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected, virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#dumpObjectInfo">dumpObjectInfo</a>()</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#dumpObjectTree">dumpObjectTree</a>()</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#dynamicPropertyNames">dynamicPropertyNames</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#event">event</a>(QEvent *e)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#eventFilter">eventFilter</a>(QObject *watched, QEvent *event)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#findChild">findChild</a>(const QString &amp;name) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#findChildren">findChildren</a>(const QString &amp;name) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#findChildren-2">findChildren</a>(const QRegExp &amp;regExp) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a8a5614e91a82ede4761b6ba3e13724a1">HandleChannels</a>(const QDBusObjectPath &amp;account, const QDBusObjectPath &amp;connection, const Tp::ChannelDetailsList &amp;channels, const Tp::ObjectPathList &amp;requestsSatisfied, qulonglong userActionTime, const QVariantMap &amp;handlerInfo, int timeout=-1)</td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td><code> [inline, slot]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#inherits">inherits</a>(const char *className) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#insertChild">insertChild</a>(QObject *object)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#installEventFilter">installEventFilter</a>(QObject *filterObj)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#interface">interface</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00033.html#a0fe684d0ef843a3e36f2ecee24defed6">internalRequestAllProperties</a>() const </td><td><a class="el" href="a00033.html">Tp::AbstractInterface</a></td><td><code> [protected]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00033.html#ad97c6346a1c2bbfd893943d60da27b89">internalRequestProperty</a>(const QString &amp;name) const </td><td><a class="el" href="a00033.html">Tp::AbstractInterface</a></td><td><code> [protected]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00033.html#a735ab438b3675c6938cd534722c47b4e">internalSetProperty</a>(const QString &amp;name, const QVariant &amp;newValue)</td><td><a class="el" href="a00033.html">Tp::AbstractInterface</a></td><td><code> [protected]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a4e8818b257c63a8c3a0c1d000243376a">invalidate</a>(Tp::DBusProxy *, const QString &amp;, const QString &amp;)</td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td><code> [protected, virtual]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00033.html#a96caf6bfea37a71d4849b4470728ceb4">invalidationMessage</a>() const </td><td><a class="el" href="a00033.html">Tp::AbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00033.html#a8bf99ab34d551325914c08500acadc94">invalidationReason</a>() const </td><td><a class="el" href="a00033.html">Tp::AbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#isA">isA</a>(const char *className) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00033.html#a6ffad807cd688510af39c9ddd808d5b5">isValid</a>() const </td><td><a class="el" href="a00033.html">Tp::AbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#isWidgetType">isWidgetType</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#killTimer">killTimer</a>(int id)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#lastError">lastError</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#metaObject">metaObject</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#moveToThread">moveToThread</a>(QThread *targetThread)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#name">name</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#name-2">name</a>(const char *defaultName) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#normalizeSignalSlot">normalizeSignalSlot</a>(const char *signalSlot)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected, static]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#objectName-prop">objectName</a></td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#objectName-prop">objectName</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#parent">parent</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#path">path</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#property">property</a>(const char *name) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#QObject">QObject</a>(QObject *parent)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#QObject-3">QObject</a>(QObject *parent, const char *name)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#receivers">receivers</a>(const char *signal) const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#removeChild">removeChild</a>(QObject *object)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#removeEventFilter">removeEventFilter</a>(QObject *obj)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#ad43f4d74deb16f76650eddd25d78dca7">requestAllProperties</a>() const </td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a9f3c6921da0449f0622784667e5b7df1">requestPropertyBypassApproval</a>() const </td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a192b9fbe2cfc112eb4ad642d49be1aff">requestPropertyCapabilities</a>() const </td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a90849d477c548974f68940c5a552655c">requestPropertyHandledChannels</a>() const </td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a03b88e295fd2eda13a74ca563ef3a612">requestPropertyHandlerChannelFilter</a>() const </td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td><code> [inline]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#sender">sender</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#senderSignalIndex">senderSignalIndex</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#service">service</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject-qt3.html#setName">setName</a>(const char *name)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#objectName-prop">setObjectName</a>(const QString &amp;name)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#setParent">setParent</a>(QObject *parent)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#setProperty">setProperty</a>(const char *name, const QVariant &amp;value)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#setTimeout">setTimeout</a>(int timeout)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#signalsBlocked">signalsBlocked</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#startTimer">startTimer</a>(int interval)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="el" href="a00121.html#a345475f10315ae8f525907d655283874">staticInterfaceName</a>()</td><td><a class="el" href="a00121.html">Tp::Client::ClientHandlerInterface</a></td><td><code> [inline, static]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#thread">thread</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#timeout">timeout</a>() const</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#timerEvent">timerEvent</a>(QTimerEvent *event)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [protected, virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#tr">tr</a>(const char *sourceText, const char *disambiguation, int n)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [static]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#trUtf8">trUtf8</a>(const char *sourceText, const char *disambiguation, int n)</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [static]</code></td></tr> <tr class="memlist"><td><a class="el" href="a00033.html#ad82f1079204bca0dcfd1f6eeda3b0bcf">~AbstractInterface</a>()</td><td><a class="el" href="a00033.html">Tp::AbstractInterface</a></td><td><code> [virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html#dtor.QDBusAbstractInterface">~QDBusAbstractInterface</a>()</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qdbusabstractinterface.html">QDBusAbstractInterface</a></td><td><code> [virtual]</code></td></tr> <tr class="memlist"><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html#dtor.QObject">~QObject</a>()</td><td><a class="elRef" doxygen="qt.tags:/you/forgot/to/run/installdox" href="/you/forgot/to/run/installdox/qobject.html">QObject</a></td><td><code> [virtual]</code></td></tr> </table></div> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="30%">Copyright &copy; 2008-2011 Collabora Ltd. and Nokia Corporation</td> <td width="30%" align="right"><div align="right">Telepathy-Qt4 0.8.0</div></td> </tr></table></div></address> </body> </html>
Telekinesis/Telepathy-qt4-0.8.0
doc/html/a00948.html
HTML
lgpl-2.1
36,033
[ 30522, 1026, 1029, 20950, 2544, 1027, 1000, 1015, 1012, 1014, 1000, 17181, 1027, 1000, 11163, 1011, 6070, 28154, 1011, 1015, 1000, 1029, 1028, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Synaptics DSX touchscreen driver * * Copyright (C) 2012 Synaptics Incorporated * * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com> * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef _SYNAPTICS_RMI4_H_ #define _SYNAPTICS_RMI4_H_ #define DISABLE_IRQ_WHEN_ENTER_DEEPSLEEP #define SYNAPTICS_RMI4_DRIVER_VERSION "DS5 1.0" #include <linux/device.h> #include <linux/i2c/synaptics_rmi.h> #include <linux/regulator/consumer.h> #ifdef CONFIG_HAS_EARLYSUSPEND #include <linux/earlysuspend.h> #endif /* To support suface touch, firmware should support data * which is required related app ex) MT_ANGLE, MT_PALM ... * Synpatics IC report those data through F51's edge swipe * fucntionality. */ /* feature default mode */ #define DEFAULT_ENABLE 1 #define DEFAULT_DISABLE 0 /* feature define */ //#define TSP_BOOSTER /* DVFS feature : TOUCH BOOSTER */ #define USE_OPEN_CLOSE /* Use when CONFIG_HAS_EARLYSUSPEND is disabled */ #define REPORT_2D_W #define REDUCE_I2C_DATA_LENGTH #define USE_SENSOR_SLEEP #if defined(CONFIG_SEC_MONDRIAN_PROJECT) #define TOUCHKEY_ENABLE #define USE_RECENT_TOUCHKEY #define PROXIMITY #define EDGE_SWIPE #define TKEY_BOOSTER #define SYNAPTICS_DEVICE_NAME "T320" #define USE_PALM_REJECTION_KERNEL #elif defined(CONFIG_SEC_K_PROJECT) #define PROXIMITY #define EDGE_SWIPE #define SIDE_TOUCH #define USE_HOVER_REZERO #define GLOVE_MODE #define USE_SHUTDOWN_CB #define CHECK_BASE_FIRMWARE #define USE_ACTIVE_REPORT_RATE #define USE_F51_OFFSET_CALCULATE #define SYNAPTICS_DEVICE_NAME "G900F" #define USE_STYLUS #define USE_DETECTION_FLAG2 #define USE_EDGE_EXCLUSION #elif defined(CONFIG_SEC_KACTIVE_PROJECT) #define PROXIMITY #define EDGE_SWIPE #define SIDE_TOUCH #define USE_HOVER_REZERO #define GLOVE_MODE #define USE_SHUTDOWN_CB #define CHECK_BASE_FIRMWARE #define USE_ACTIVE_REPORT_RATE #define USE_F51_OFFSET_CALCULATE #define SYNAPTICS_DEVICE_NAME "G870" #define USE_STYLUS #define USE_DETECTION_FLAG2 #define USE_EDGE_EXCLUSION #elif defined(CONFIG_SEC_H_PROJECT) #define PROXIMITY #define EDGE_SWIPE #define USE_HOVER_REZERO #define GLOVE_MODE #define READ_LCD_ID #define REPORT_ANGLE #define SYNAPTICS_DEVICE_NAME "N9005" #define USE_PALM_REJECTION_KERNEL #define USE_EDGE_EXCLUSION #define USE_EDGE_SWIPE_WIDTH_MAJOR #elif defined(CONFIG_SEC_F_PROJECT) #define PROXIMITY #define EDGE_SWIPE #define USE_HOVER_REZERO #define GLOVE_MODE #define TOUCHKEY_ENABLE #define EDGE_SWIPE_SCALE #define TOUCHKEY_LED_GPIO #define USE_PALM_REJECTION_KERNEL #define USE_EDGE_EXCLUSION #define USE_EDGE_SWIPE_WIDTH_MAJOR #else /* default undefine all */ #undef PROXIMITY /* Use F51 - edge_swipe, hover, side_touch, stylus, hand_grip */ #undef EDGE_SWIPE /* Screen Caputure, and Palm pause */ #undef EDGE_SWIPE_SCALE /* Recalculate edge_swipe data */ #undef REPORT_ANGLE /* Report angle data when surface touch */ #undef USE_PALM_REJECTION_KERNEL /* Fix Firmware bug.(Finger_status, PALM flag) */ #undef SIDE_TOUCH /* Side Touch */ #undef USE_HOVER_REZERO /* Use hover rezero */ #undef USE_EDGE_EXCLUSION /* Disable edge hover when grip the phone */ #undef GLOVE_MODE /* Glove Mode */ #undef HAND_GRIP_MODE /* Hand Grip mode */ #undef USE_EDGE_SWIPE_WIDTH_MAJOR /* Upgrade model use it. KK new model use SUMSIZE */ #undef USE_STYLUS /* Use Stylus */ #undef USE_DETECTION_FLAG2 /* Use Detection Flag2 Register: Edge_swipe, Side_touch */ #undef TSP_TURNOFF_AFTER_PROBE /* Turn off touch IC after probe success, will be turned by InputRedaer */ #undef USE_SHUTDOWN_CB /* Use shutdown callback function */ #undef READ_LCD_ID /* Need to separate f/w according to LCD ID */ #undef CHECK_BASE_FIRMWARE /* Check base fw version. base fw version is PR number */ #undef TOUCHKEY_ENABLE /* TSP/Tkey in one chip */ #undef TKEY_BOOSTER /* Tkey booster for performance */ #undef TOUCHKEY_LED_GPIO /* Tkey led use gpio pin rather than pmic regulator */ #endif #ifndef SYNAPTICS_DEVICE_NAME #define SYNAPTICS_DEVICE_NAME "SEC_XX_XX" #endif #if defined(CONFIG_LEDS_CLASS) && defined(TOUCHKEY_ENABLE) #include <linux/leds.h> #define TOUCHKEY_BACKLIGHT "button-backlight" #endif #if defined(TSP_BOOSTER) || defined(TKEY_BOOSTER) #define DVFS_STAGE_NINTH 9 #define DVFS_STAGE_PENTA 5 #define DVFS_STAGE_TRIPLE 3 #define DVFS_STAGE_DUAL 2 #define DVFS_STAGE_SINGLE 1 #define DVFS_STAGE_NONE 0 #include <linux/cpufreq.h> #define TOUCH_BOOSTER_OFF_TIME 500 #define TOUCH_BOOSTER_CHG_TIME 130 #define TOUCH_BOOSTER_HIGH_OFF_TIME 1000 #define TOUCH_BOOSTER_HIGH_CHG_TIME 500 #endif /* TA_CON mode @ H mode */ #define TA_CON_REVISION 0xFF #ifdef GLOVE_MODE #define GLOVE_MODE_EN (1 << 0) #define CLOSED_COVER_EN (1 << 1) #define FAST_DETECT_EN (1 << 2) #endif #define SYNAPTICS_HW_RESET_TIME 100 #define SYNAPTICS_POWER_MARGIN_TIME 150 #define SYNAPTICS_PRODUCT_ID_NONE 0 #define SYNAPTICS_PRODUCT_ID_S5000 1 #define SYNAPTICS_PRODUCT_ID_S5050 2 #define SYNAPTICS_PRODUCT_ID_S5100 3 #define SYNAPTICS_PRODUCT_ID_S5700 4 #define SYNAPTICS_PRODUCT_ID_S5707 5 #define SYNAPTICS_PRODUCT_ID_S5708 6 #define SYNAPTICS_IC_REVISION_NONE 0x00 #define SYNAPTICS_IC_REVISION_A0 0xA0 #define SYNAPTICS_IC_REVISION_A1 0xA1 #define SYNAPTICS_IC_REVISION_A2 0xA2 #define SYNAPTICS_IC_REVISION_A3 0xA3 #define SYNAPTICS_IC_REVISION_B0 0xB0 #define SYNAPTICS_IC_REVISION_B1 0xB1 #define SYNAPTICS_IC_REVISION_B2 0xB2 #define SYNAPTICS_IC_REVISION_AF 0xAF #define SYNAPTICS_IC_REVISION_BF 0xBF /* old bootloader(V606) do not supply Guest Thread image. * new bootloader(V646) supply Guest Thread image. */ #define SYNAPTICS_IC_OLD_BOOTLOADER "06" #define SYNAPTICS_IC_NEW_BOOTLOADER "46" #define FW_IMAGE_NAME_NONE NULL #define FW_IMAGE_NAME_S5050_H "tsp_synaptics/synaptics_s5050_h.fw" #define FW_IMAGE_NAME_S5100_K_A2_FHD "tsp_synaptics/synaptics_s5100_k_a2_fhd.fw" #define FW_IMAGE_NAME_S5100_K_A3 "tsp_synaptics/synaptics_s5100_k_a3.fw" #define FW_IMAGE_NAME_S5707 "tsp_synaptics/synaptics_s5707.fw" #define FW_IMAGE_NAME_S5708 "tsp_synaptics/synaptics_s5708.fw" #define FW_IMAGE_NAME_S5050 "tsp_synaptics/synaptics_s5050.fw" #define FW_IMAGE_NAME_S5050_F "tsp_synaptics/synaptics_s5050_f.fw" #define SYNAPTICS_FACTORY_TEST_PASS 2 #define SYNAPTICS_FACTORY_TEST_FAIL 1 #define SYNAPTICS_FACTORY_TEST_NONE 0 #define SYNAPTICS_MAX_FW_PATH 64 #define SYNAPTICS_DEFAULT_UMS_FW "/sdcard/synaptics.fw" #define DATE_OF_FIRMWARE_BIN_OFFSET 0xEF00 #define IC_REVISION_BIN_OFFSET 0xEF02 #define FW_VERSION_BIN_OFFSET 0xEF03 #define DATE_OF_FIRMWARE_BIN_OFFSET_S5050 0x016D00 #define IC_REVISION_BIN_OFFSET_S5050 0x016D02 #define FW_VERSION_BIN_OFFSET_S5050 0x016D03 #define DATE_OF_FIRMWARE_BIN_OFFSET_S5100_A2 0x00B0 #define IC_REVISION_BIN_OFFSET_S5100_A2 0x00B2 #define FW_VERSION_BIN_OFFSET_S5100_A2 0x00B3 #define PDT_PROPS (0X00EF) #define PDT_START (0x00E9) #define PDT_END (0x000A) #define PDT_ENTRY_SIZE (0x0006) #define PAGES_TO_SERVICE (10) #define PAGE_SELECT_LEN (2) #define SYNAPTICS_RMI4_F01 (0x01) #define SYNAPTICS_RMI4_F11 (0x11) #define SYNAPTICS_RMI4_F12 (0x12) #define SYNAPTICS_RMI4_F1A (0x1a) #define SYNAPTICS_RMI4_F34 (0x34) #define SYNAPTICS_RMI4_F51 (0x51) #define SYNAPTICS_RMI4_F54 (0x54) #define SYNAPTICS_RMI4_F55 (0x55) #define SYNAPTICS_RMI4_F60 (0x60) #define SYNAPTICS_RMI4_FDB (0xdb) #define SYNAPTICS_RMI4_PRODUCT_INFO_SIZE 2 #define SYNAPTICS_RMI4_DATE_CODE_SIZE 3 #define SYNAPTICS_RMI4_PRODUCT_ID_SIZE 10 #define SYNAPTICS_RMI4_BUILD_ID_SIZE 3 #define SYNAPTICS_RMI4_PRODUCT_ID_LENGTH 10 #define SYNAPTICS_RMI4_PACKAGE_ID_SIZE 4 #define MAX_NUMBER_OF_BUTTONS 4 #define MAX_INTR_REGISTERS 4 #define MAX_NUMBER_OF_FINGERS 12 #define F12_FINGERS_TO_SUPPORT 10 #define MASK_16BIT 0xFFFF #define MASK_8BIT 0xFF #define MASK_7BIT 0x7F #define MASK_6BIT 0x3F #define MASK_5BIT 0x1F #define MASK_4BIT 0x0F #define MASK_3BIT 0x07 #define MASK_2BIT 0x03 #define MASK_1BIT 0x01 #define F12_FINGERS_TO_SUPPORT 10 #define INVALID_X 65535 #define INVALID_Y 65535 #define RPT_TYPE (1 << 0) #define RPT_X_LSB (1 << 1) #define RPT_X_MSB (1 << 2) #define RPT_Y_LSB (1 << 3) #define RPT_Y_MSB (1 << 4) #define RPT_Z (1 << 5) #define RPT_WX (1 << 6) #define RPT_WY (1 << 7) #define RPT_DEFAULT (RPT_TYPE | RPT_X_LSB | RPT_X_MSB | RPT_Y_LSB | RPT_Y_MSB) #ifdef PROXIMITY #define F51_FINGER_TIMEOUT 50 /* ms */ #define HOVER_Z_MAX (255) #define EDGE_SWIPE_DEGREES_MAX (90) #define EDGE_SWIPE_DEGREES_MIN (-89) #define EDGE_SWIPE_WIDTH_SCALING_FACTOR (9) #define EDGE_SWIPE_SUMSIZE_OFFSET 5 #define F51_PROXIMITY_ENABLES_OFFSET (0) #define F51_SIDE_BUTTON_THRESHOLD_OFFSET (47) #define F51_SIDE_BUTTON_PARTIAL_ENABLE_OFFSET (44) #define F51_GPIP_EDGE_EXCLUSION_RX_OFFSET (32) #define FINGER_HOVER_DIS (0 << 0) #define FINGER_HOVER_EN (1 << 0) #define AIR_SWIPE_EN (1 << 1) #define LARGE_OBJ_EN (1 << 2) #define HOVER_PINCH_EN (1 << 3) /* This command is reserved.. #define NO_PROXIMITY_ON_TOUCH_EN (1 << 5) #define CONTINUOUS_LOAD_REPORT_EN (1 << 6) */ #define ENABLE_HANDGRIP_RECOG (1 << 6) #define SLEEP_PROXIMITY (1 << 7) #define F51_GENERAL_CONTROL_OFFSET (1) #define F51_GENERAL_CONTROL2_OFFSET (2) #define JIG_TEST_EN (1 << 0) #define JIG_COMMAND_EN (1 << 1) #define NO_PROXIMITY_ON_TOUCH (1 << 2) #define CONTINUOUS_LOAD_REPORT (1 << 3) #define HOST_REZERO_COMMAND (1 << 4) #define EDGE_SWIPE_EN (1 << 5) #define HSYNC_STATUS (1 << 6) #define F51_GENERAL_CONTROL (NO_PROXIMITY_ON_TOUCH | HOST_REZERO_COMMAND | EDGE_SWIPE_EN) #define F51_GENERAL_CONTROL_NO_HOST_REZERO (NO_PROXIMITY_ON_TOUCH | EDGE_SWIPE_EN) /* f51_query feature(proximity_controls) */ #define HAS_FINGER_HOVER (1 << 0) #define HAS_AIR_SWIPE (1 << 1) #define HAS_LARGE_OBJ (1 << 2) #define HAS_HOVER_PINCH (1 << 3) #define HAS_EDGE_SWIPE (1 << 4) #define HAS_SINGLE_FINGER (1 << 5) #define HAS_GRIP_SUPPRESSION (1 << 6) #define HAS_PALM_REJECTION (1 << 7) /* f51_query feature-2(proximity_controls_2) */ #define HAS_PROFILE_HANDEDNESS (1 << 0) #define HAS_LOWG (1 << 1) #define HAS_FACE_DETECTION (1 << 2) #define HAS_SIDE_BUTTONS (1 << 3) #define HAS_CAMERA_GRIP_DETECTION (1 << 4) /* Reserved 5~7 */ /* Use Detection Flag for F51 feature */ #define HOVER_UN_DETECTED (0 << 0) #define HOVER_DETECTED (1 << 0) #define AIR_SWIPE_DETECTED (1 << 1) #define LARGE_OBJECT_DETECTED (1 << 2) #define HOVER_PINCH_DETECTED (1 << 3) #define LOWG_DETECTED (1 << 4) #define PROFILE_HANDEDNESS_DETECTED ((1 << 5) | (1 << 6)) #define FACE_DETECTED (1 << 7) #define CAMERA_GRIP_DETECTED (1 << 0) #define EDGE_SWIPE_DETECTED (1 << 0) #define SIDE_BUTTON_DETECTED (1 << 1) /* F51 General Control enable */ /* F51 General Control2 enable */ #define FACE_DETECTED_ENABLE (1 << 0) #define SIDE_BUTTONS_ENABLE (1 << 1) #define SIDE_BUTTONS_PRODUCTION_TEST (1 << 2) #define SIDE_TOUCH_ONLY_ACTIVE (1 << 3) #ifdef EDGE_SWIPE #if defined(CONFIG_SEC_MONDRIAN_PROJECT) #define EDGE_SWIPE_DATA_OFFSET 3 #else #define EDGE_SWIPE_DATA_OFFSET 9 #endif #define EDGE_SWIPE_WIDTH_MAX 255 #define EDGE_SWIPE_ANGLE_MIN (-90) #define EDGE_SWIPE_ANGLE_MAX 90 #define EDGE_SWIPE_PALM_MAX 1 #endif #define F51_DATA_RESERVED_SIZE (1) #define F51_DATA_1_SIZE (4) /* FINGER HOVER */ #define F51_DATA_2_SIZE (1) /* HOVER PINCH */ #define F51_DATA_3_SIZE (1) /* AIR_SWIPE | LARGE_OBJ */ #define F51_DATA_4_SIZE (2) /* SIDE_BUTTON */ #define F51_DATA_5_SIZE (1) /* CAMERA GRIP DETECTION */ #define F51_DATA_6_SIZE (2) /* DETECTION FLAG2 */ /* * DATA_5, DATA_6, RESERVED * 5: 1 byte RESERVED + CAM GRIP DETECT * 6: 1 byte RESERVED + SIDE BUTTON DETECT + HAND EDGE SWIPE DETECT * R: 1 byte RESERVED */ #endif #define SYN_I2C_RETRY_TIMES 10 #define MAX_F11_TOUCH_WIDTH 15 #define CHECK_STATUS_TIMEOUT_MS 100 #define F01_STD_QUERY_LEN 21 #define F01_BUID_ID_OFFSET 18 #define F01_PACKAGE_ID_LEN 4 #define F11_STD_QUERY_LEN 9 #define F11_STD_CTRL_LEN 10 #define F11_STD_DATA_LEN 12 #define STATUS_NO_ERROR 0x00 #define STATUS_RESET_OCCURRED 0x01 #define STATUS_INVALID_CONFIG 0x02 #define STATUS_DEVICE_FAILURE 0x03 #define STATUS_CONFIG_CRC_FAILURE 0x04 #define STATUS_FIRMWARE_CRC_FAILURE 0x05 #define STATUS_CRC_IN_PROGRESS 0x06 #define NORMAL_OPERATION (0 << 0) #define SENSOR_SLEEP (1 << 0) #define NO_SLEEP_OFF (0 << 2) #define NO_SLEEP_ON (1 << 2) #define CHARGER_CONNECTED (1 << 5) #define CHARGER_DISCONNECTED 0xDF #define CONFIGURED (1 << 7) #define TSP_NEEDTO_REBOOT (-ECONNREFUSED) #define MAX_TSP_REBOOT 3 /* * Each 3-bit finger status field represents the following: * 000 = finger not present * 001 = finger present and data accurate * 010 = stylus pen (passive pen) * 011 = palm touch * 100 = not used * 101 = hover * 110 = glove touch */ #define FINGER_NOT_PRESENT 0x0 #define FINGER_PRESSED 0x1 #define STYLUS_PRESSED 0x2 #define PALM_PRESSED 0x3 #define HOVER_PRESSED 0x5 #define GLOVE_PRESSED 0x6 /* * synaptics_rmi4_set_custom_ctrl_register() * mode TRUE : read, mode FALSE : write */ #define REGISTER_READ 1 #define REGISTER_WRITE 0 /* * synaptics absolute register address * if changed register address, fix below address value */ #ifdef USE_ACTIVE_REPORT_RATE #define REGISTER_ADDR_CHANGE_REPORT_RATE 0x012A #define REGISTER_ADDR_FORCE_CALIBRATION 0x0138 #define REPORT_RATE_90HZ 0x04 #define REPORT_RATE_60HZ 0x16 #define REPORT_RATE_30HZ 0x50 #define REPORT_RATE_FORCE_UPDATE 0x04 #endif #ifdef SIDE_TOUCH #define F51_CUSTOM_CTRL78_OFFSET 47 #endif #ifdef USE_STYLUS #define F51_CUSTOM_CTRL87_OFFSET 61 #endif extern unsigned int system_rev; struct synaptics_rmi4_f01_device_status { union { struct { unsigned char status_code:4; unsigned char reserved:2; unsigned char flash_prog:1; unsigned char unconfigured:1; } __packed; unsigned char data[1]; }; }; struct synaptics_rmi4_f12_query_5 { union { struct { unsigned char size_of_query6; struct { unsigned char ctrl0_is_present:1; unsigned char ctrl1_is_present:1; unsigned char ctrl2_is_present:1; unsigned char ctrl3_is_present:1; unsigned char ctrl4_is_present:1; unsigned char ctrl5_is_present:1; unsigned char ctrl6_is_present:1; unsigned char ctrl7_is_present:1; } __packed; struct { unsigned char ctrl8_is_present:1; unsigned char ctrl9_is_present:1; unsigned char ctrl10_is_present:1; unsigned char ctrl11_is_present:1; unsigned char ctrl12_is_present:1; unsigned char ctrl13_is_present:1; unsigned char ctrl14_is_present:1; unsigned char ctrl15_is_present:1; } __packed; struct { unsigned char ctrl16_is_present:1; unsigned char ctrl17_is_present:1; unsigned char ctrl18_is_present:1; unsigned char ctrl19_is_present:1; unsigned char ctrl20_is_present:1; unsigned char ctrl21_is_present:1; unsigned char ctrl22_is_present:1; unsigned char ctrl23_is_present:1; } __packed; struct { unsigned char ctrl24_is_present:1; unsigned char ctrl25_is_present:1; unsigned char ctrl26_is_present:1; unsigned char ctrl27_is_present:1; unsigned char ctrl28_is_present:1; unsigned char ctrl29_is_present:1; unsigned char ctrl30_is_present:1; unsigned char ctrl31_is_present:1; } __packed; }; unsigned char data[5]; }; }; struct synaptics_rmi4_f12_query_8 { union { struct { unsigned char size_of_query9; struct { unsigned char data0_is_present:1; unsigned char data1_is_present:1; unsigned char data2_is_present:1; unsigned char data3_is_present:1; unsigned char data4_is_present:1; unsigned char data5_is_present:1; unsigned char data6_is_present:1; unsigned char data7_is_present:1; } __packed; struct { unsigned char data8_is_present:1; unsigned char data9_is_present:1; unsigned char data10_is_present:1; unsigned char data11_is_present:1; unsigned char data12_is_present:1; unsigned char data13_is_present:1; unsigned char data14_is_present:1; unsigned char data15_is_present:1; } __packed; }; unsigned char data[3]; }; }; struct synaptics_rmi4_f12_query_10 { union { struct { unsigned char f12_query10_b0__4:5; unsigned char glove_mode_feature:1; unsigned char f12_query10_b6__7:2; } __packed; unsigned char data[1]; }; }; struct synaptics_rmi4_f12_ctrl_8 { union { struct { unsigned char max_x_coord_lsb; unsigned char max_x_coord_msb; unsigned char max_y_coord_lsb; unsigned char max_y_coord_msb; unsigned char rx_pitch_lsb; unsigned char rx_pitch_msb; unsigned char tx_pitch_lsb; unsigned char tx_pitch_msb; unsigned char low_rx_clip; unsigned char high_rx_clip; unsigned char low_tx_clip; unsigned char high_tx_clip; unsigned char num_of_rx; unsigned char num_of_tx; }; unsigned char data[14]; }; }; struct synaptics_rmi4_f12_ctrl_9 { union { struct { unsigned char touch_threshold; unsigned char lift_hysteresis; unsigned char small_z_scale_factor_lsb; unsigned char small_z_scale_factor_msb; unsigned char large_z_scale_factor_lsb; unsigned char large_z_scale_factor_msb; unsigned char small_large_boundary; unsigned char wx_scale; unsigned char wx_offset; unsigned char wy_scale; unsigned char wy_offset; unsigned char x_size_lsb; unsigned char x_size_msb; unsigned char y_size_lsb; unsigned char y_size_msb; unsigned char gloved_finger; }; unsigned char data[16]; }; }; struct synaptics_rmi4_f12_ctrl_11 { union { struct { unsigned char small_corner; unsigned char large_corner; unsigned char jitter_filter_strength; unsigned char x_minimum_z; unsigned char y_minimum_z; unsigned char x_maximum_z; unsigned char y_maximum_z; unsigned char x_amplitude; unsigned char y_amplitude; unsigned char gloved_finger_jitter_filter_strength; }; unsigned char data[10]; }; }; struct synaptics_rmi4_f12_ctrl_23 { union { struct { unsigned char obj_type_enable; unsigned char max_reported_objects; }; unsigned char data[2]; }; }; struct synaptics_rmi4_f12_finger_data { unsigned char object_type_and_status; unsigned char x_lsb; unsigned char x_msb; unsigned char y_lsb; unsigned char y_msb; #ifdef REPORT_2D_Z unsigned char z; #endif #ifdef REPORT_2D_W unsigned char wx; unsigned char wy; #endif }; struct synaptics_rmi4_f1a_query { union { struct { unsigned char max_button_count:3; unsigned char reserved:5; unsigned char has_general_control:1; unsigned char has_interrupt_enable:1; unsigned char has_multibutton_select:1; unsigned char has_tx_rx_map:1; unsigned char has_perbutton_threshold:1; unsigned char has_release_threshold:1; unsigned char has_strongestbtn_hysteresis:1; unsigned char has_filter_strength:1; } __packed; unsigned char data[2]; }; }; struct synaptics_rmi4_f1a_control_0 { union { struct { unsigned char multibutton_report:2; unsigned char filter_mode:2; unsigned char reserved:4; } __packed; unsigned char data[1]; }; }; struct synaptics_rmi4_f1a_control { struct synaptics_rmi4_f1a_control_0 general_control; unsigned char button_int_enable; unsigned char multi_button; unsigned char *txrx_map; unsigned char *button_threshold; unsigned char button_release_threshold; unsigned char strongest_button_hysteresis; unsigned char filter_strength; }; struct synaptics_rmi4_f1a_handle { int button_bitmask_size; unsigned char max_count; unsigned char valid_button_count; unsigned char *button_data_buffer; unsigned char *button_map; struct synaptics_rmi4_f1a_query button_query; struct synaptics_rmi4_f1a_control button_control; }; struct synaptics_rmi4_f34_ctrl_3 { union { struct { unsigned char fw_release_month; unsigned char fw_release_date; unsigned char fw_release_revision; unsigned char fw_release_version; }; unsigned char data[4]; }; }; struct synaptics_rmi4_f34_handle { unsigned char status; unsigned char cmd; unsigned short bootloaderid; unsigned short blocksize; unsigned short imageblockcount; unsigned short configblockcount; unsigned short blocknum; unsigned short query_base_addr; unsigned short control_base_addr; unsigned short data_base_addr; bool inflashprogmode; unsigned char intr_mask; struct mutex attn_mutex; struct synaptics_rmi4_f34_fn_ptr *fn_ptr; }; #ifdef PROXIMITY struct synaptics_rmi4_f51_query { union { struct { unsigned char query_register_count; unsigned char data_register_count; unsigned char control_register_count; unsigned char command_register_count; unsigned char features; unsigned char side_touch_feature; }; unsigned char data[6]; }; }; struct synaptics_rmi4_f51_data { union { struct { unsigned char finger_hover_det:1; unsigned char air_swipe_det:1; unsigned char large_obj_det:1; unsigned char f1a_data0_b3:1; unsigned char hover_pinch_det:1; unsigned char profile_handedness_status:2; unsigned char f1a_data0_b5__7:1; unsigned char hover_finger_x_4__11; unsigned char hover_finger_y_4__11; unsigned char hover_finger_xy_0__3; unsigned char hover_finger_z; unsigned char f1a_data2_b0__6:7; unsigned char hover_pinch_dir:1; unsigned char air_swipe_dir_0:1; unsigned char air_swipe_dir_1:1; unsigned char f1a_data3_b2__4:3; unsigned char object_present:1; unsigned char large_obj_act:2; } __packed; unsigned char proximity_data[7]; }; #ifdef EDGE_SWIPE union { struct { unsigned char edge_swipe_x_lsb; unsigned char edge_swipe_x_msb; unsigned char edge_swipe_y_lsb; unsigned char edge_swipe_y_msb; unsigned char edge_swipe_z; unsigned char edge_swipe_wx; unsigned char edge_swipe_wy; unsigned char edge_swipe_mm; signed char edge_swipe_dg; } __packed; unsigned char edge_swipe_data[9]; }; #endif #ifdef SIDE_TOUCH union { struct { unsigned char side_button_leading; unsigned char side_button_trailing; unsigned char side_button_cam_det; } __packed; unsigned char side_button_data[3]; }; #endif }; #ifdef EDGE_SWIPE struct synaptics_rmi4_surface { int sumsize; int palm; int angle; int wx; int wy; }; #endif struct synaptics_rmi4_f51_handle { unsigned char edge_swipe_data_offset; unsigned char side_button_data_offset; unsigned char proximity_enables; unsigned char general_control; unsigned short proximity_enables_addr; unsigned short general_control_addr; unsigned short general_control2_addr; unsigned short edge_swipe_data_addr; unsigned short side_button_data_addr; unsigned short detection_flag2_addr; unsigned short sidekey_threshold_addr; unsigned short stylus_enable_addr; struct synaptics_rmi4_surface surface_data; }; #endif /* * struct synaptics_rmi4_fn_desc - function descriptor fields in PDT * @query_base_addr: base address for query registers * @cmd_base_addr: base address for command registers * @ctrl_base_addr: base address for control registers * @data_base_addr: base address for data registers * @intr_src_count: number of interrupt sources * @fn_number: function number */ struct synaptics_rmi4_fn_desc { unsigned char query_base_addr; unsigned char cmd_base_addr; unsigned char ctrl_base_addr; unsigned char data_base_addr; unsigned char intr_src_count; unsigned char fn_number; }; /* * synaptics_rmi4_fn_full_addr - full 16-bit base addresses * @query_base: 16-bit base address for query registers * @cmd_base: 16-bit base address for data registers * @ctrl_base: 16-bit base address for command registers * @data_base: 16-bit base address for control registers */ struct synaptics_rmi4_fn_full_addr { unsigned short query_base; unsigned short cmd_base; unsigned short ctrl_base; unsigned short data_base; }; struct synaptics_rmi4_f12_extra_data { unsigned char data1_offset; unsigned char data15_offset; unsigned char data15_size; unsigned char data15_data[(F12_FINGERS_TO_SUPPORT + 7) / 8]; }; /* * struct synaptics_rmi4_fn - function handler data structure * @fn_number: function number * @num_of_data_sources: number of data sources * @num_of_data_points: maximum number of fingers supported * @size_of_data_register_block: data register block size * @data1_offset: offset to data1 register from data base address * @intr_reg_num: index to associated interrupt register * @intr_mask: interrupt mask * @full_addr: full 16-bit base addresses of function registers * @link: linked list for function handlers * @data_size: size of private data * @data: pointer to private data */ struct synaptics_rmi4_fn { unsigned char fn_number; unsigned char num_of_data_sources; unsigned char num_of_data_points; unsigned char size_of_data_register_block; unsigned char intr_reg_num; unsigned char intr_mask; struct synaptics_rmi4_fn_full_addr full_addr; struct list_head link; int data_size; void *data; void *extra; }; /* * struct synaptics_rmi4_device_info - device information * @version_major: rmi protocol major version number * @version_minor: rmi protocol minor version number * @manufacturer_id: manufacturer id * @product_props: product properties information * @product_info: product info array * @date_code: device manufacture date * @tester_id: tester id array * @serial_number: device serial number * @product_id_string: device product id * @support_fn_list: linked list for function handlers */ struct synaptics_rmi4_device_info { unsigned int version_major; unsigned int version_minor; unsigned char manufacturer_id; unsigned char product_props; unsigned char product_info[SYNAPTICS_RMI4_PRODUCT_INFO_SIZE]; unsigned char date_code[SYNAPTICS_RMI4_DATE_CODE_SIZE]; unsigned short tester_id; unsigned short serial_number; unsigned char product_id_string[SYNAPTICS_RMI4_PRODUCT_ID_SIZE + 1]; unsigned char build_id[SYNAPTICS_RMI4_BUILD_ID_SIZE]; unsigned int package_id; unsigned int package_rev; unsigned int pr_number; struct list_head support_fn_list; }; /** * struct synaptics_finger - Represents fingers. * @ state: finger status. * @ mcount: moving counter for debug. */ struct synaptics_finger { unsigned char state; unsigned short mcount; }; /** * synaptics_rmi_f1a_button_map * @ nbuttons : number of buttons * @ map : key map */ struct synaptics_rmi_f1a_button_map { unsigned char nbuttons; u32 map[4]; }; /** * struct synaptics_device_tree_data - power supply information * @ coords : horizontal, vertical max width and max hight * @ external_ldo : sensor power supply : 3.3V, enbled by GPIO * @ sub_pmic : sensor power supply : 3.3V, enabled by subp_mic MAX77826 * @ irq_gpio : interrupt GPIO PIN defined device tree files(dtsi) * @ project : project name string for Firmware name */ struct synaptics_rmi4_device_tree_data { int coords[2]; int extra_config[4]; int external_ldo; int tkey_led_en; int scl_gpio; int sda_gpio; int irq_gpio; int reset_gpio; int id_gpio; char swap_axes; char x_flip; char y_flip; struct synaptics_rmi_f1a_button_map *f1a_button_map; const char *project; int num_of_supply; const char **name_of_supply; }; /* * struct synaptics_rmi4_data - rmi4 device instance data * @i2c_client: pointer to associated i2c client * @input_dev: pointer to associated input device * @board: constant pointer to platform data * @rmi4_mod_info: device information * @regulator: pointer to associated regulator * @rmi4_io_ctrl_mutex: mutex for i2c i/o control * @early_suspend: instance to support early suspend power management * @current_page: current page in sensor to acess * @button_0d_enabled: flag for 0d button support * @full_pm_cycle: flag for full power management cycle in early suspend stage * @num_of_intr_regs: number of interrupt registers * @f01_query_base_addr: query base address for f01 * @f01_cmd_base_addr: command base address for f01 * @f01_ctrl_base_addr: control base address for f01 * @f01_data_base_addr: data base address for f01 * @irq: attention interrupt * @sensor_max_x: sensor maximum x value * @sensor_max_y: sensor maximum y value * @irq_enabled: flag for indicating interrupt enable status * @touch_stopped: flag to stop interrupt thread processing * @fingers_on_2d: flag to indicate presence of fingers in 2d area * @sensor_sleep: flag to indicate sleep state of sensor * @wait: wait queue for touch data polling in interrupt thread * @i2c_read: pointer to i2c read function * @i2c_write: pointer to i2c write function * @irq_enable: pointer to irq enable function */ struct synaptics_rmi4_data { struct i2c_client *i2c_client; struct input_dev *input_dev; struct regulator *vcc_en; struct regulator *sub_pmic; struct synaptics_rmi4_device_tree_data *dt_data; struct synaptics_rmi4_device_info rmi4_mod_info; struct regulator_bulk_data *supplies; #ifdef PROXIMITY struct synaptics_rmi4_f51_handle *f51_handle; #endif struct mutex rmi4_device_mutex; struct mutex rmi4_reset_mutex; struct mutex rmi4_io_ctrl_mutex; struct mutex rmi4_reflash_mutex; struct timer_list f51_finger_timer; #ifdef CONFIG_HAS_EARLYSUSPEND struct early_suspend early_suspend; #endif const char *firmware_name; struct completion init_done; struct synaptics_finger finger[MAX_NUMBER_OF_FINGERS]; unsigned char current_page; unsigned char button_0d_enabled; unsigned char full_pm_cycle; unsigned char num_of_rx; unsigned char num_of_tx; unsigned int num_of_node; unsigned char num_of_fingers; unsigned char max_touch_width; unsigned char feature_enable; unsigned char report_enable; unsigned char no_sleep_setting; unsigned char intr_mask[MAX_INTR_REGISTERS]; unsigned char *button_txrx_mapping; unsigned char bootloader_id[4]; unsigned short num_of_intr_regs; unsigned short f01_query_base_addr; unsigned short f01_cmd_base_addr; unsigned short f01_ctrl_base_addr; unsigned short f01_data_base_addr; unsigned short f12_ctrl11_addr; /* for setting jitter level*/ unsigned short f12_ctrl15_addr; /* for getting finger amplitude threshold */ unsigned short f12_ctrl26_addr; unsigned short f12_ctrl28_addr; unsigned short f34_ctrl_base_addr; unsigned short f51_ctrl_base_addr; int irq; int sensor_max_x; int sensor_max_y; int touch_threshold; int gloved_sensitivity; int ta_status; bool flash_prog_mode; bool irq_enabled; bool touch_stopped; bool fingers_on_2d; bool f51_finger; bool f51_finger_is_hover; bool hand_edge_down; bool has_edge_swipe; bool has_glove_mode; bool has_side_buttons; bool sensor_sleep; bool stay_awake; bool staying_awake; bool tsp_probe; bool firmware_cracked; bool ta_con_mode; /* ta_con_mode ? I2C(RMI) : INT(GPIO) */ bool hover_status_in_normal_mode; bool fast_glove_state; bool touchkey_glove_mode_status; bool created_sec_class; bool use_deepsleep; #ifdef USE_STYLUS bool use_stylus; #endif int ic_version; /* define S5000, S5050, S5700, S5707, S5708 */ int ic_revision_of_ic; int ic_revision_of_bin; /* revision of reading from binary */ int fw_version_of_ic; /* firmware version of IC */ int fw_version_of_bin; /* firmware version of binary */ int fw_release_date_of_ic; /* Config release data from IC */ int lcd_id; int debug_log; /* Test log : 1[F51/edge_swipe] 2[F12/abs_report] */ unsigned int fw_pr_number; bool doing_reflash; int rebootcount; #if defined(CONFIG_LEDS_CLASS) && defined(TOUCHKEY_ENABLE) struct led_classdev leds; #endif #ifdef TOUCHKEY_ENABLE int touchkey_menu; int touchkey_back; bool touchkey_led; bool created_sec_tkey_class; #endif #ifdef CONFIG_SEC_TSP_FACTORY int bootmode; #endif #ifdef TSP_BOOSTER struct delayed_work work_dvfs_off; struct delayed_work work_dvfs_chg; struct mutex dvfs_lock; bool dvfs_lock_status; int dvfs_old_stauts; int dvfs_boost_mode; int dvfs_freq; #endif #ifdef TKEY_BOOSTER struct delayed_work work_tkey_dvfs_off; struct delayed_work work_tkey_dvfs_chg; struct mutex tkey_dvfs_lock; bool tkey_dvfs_lock_status; int tkey_dvfs_old_stauts; int tkey_dvfs_boost_mode; int tkey_dvfs_freq; #endif #ifdef USE_HOVER_REZERO struct delayed_work rezero_work; #endif #ifdef HAND_GRIP_MODE unsigned int hand_grip_mode; unsigned int hand_grip; unsigned int old_hand_grip; unsigned int old_code; #endif #ifdef SIDE_TOUCH bool sidekey_enables; unsigned char sidekey_data; bool sidekey_test; bool sidekey_only_enable; #endif #ifdef SYNAPTICS_RMI_INFORM_CHARGER void (*register_cb)(struct synaptics_rmi_callbacks *); struct synaptics_rmi_callbacks callbacks; #endif int (*i2c_read)(struct synaptics_rmi4_data *pdata, unsigned short addr, unsigned char *data, unsigned short length); int (*i2c_write)(struct synaptics_rmi4_data *pdata, unsigned short addr, unsigned char *data, unsigned short length); int (*irq_enable)(struct synaptics_rmi4_data *rmi4_data, bool enable); int (*reset_device)(struct synaptics_rmi4_data *rmi4_data); int (*stop_device)(struct synaptics_rmi4_data *rmi4_data); int (*start_device)(struct synaptics_rmi4_data *rmi4_data); }; enum exp_fn { RMI_DEV = 0, RMI_F54, RMI_FW_UPDATER, RMI_DB, RMI_GUEST, RMI_LAST, }; struct synaptics_rmi4_exp_fn { enum exp_fn fn_type; bool initialized; int (*func_init)(struct synaptics_rmi4_data *rmi4_data); void (*func_remove)(struct synaptics_rmi4_data *rmi4_data); void (*func_attn)(struct synaptics_rmi4_data *rmi4_data, unsigned char intr_mask); struct list_head link; }; struct synaptics_rmi4_exp_fn_ptr { int (*read)(struct synaptics_rmi4_data *rmi4_data, unsigned short addr, unsigned char *data, unsigned short length); int (*write)(struct synaptics_rmi4_data *rmi4_data, unsigned short addr, unsigned char *data, unsigned short length); int (*enable)(struct synaptics_rmi4_data *rmi4_data, bool enable); }; int synaptics_rmi4_new_function(enum exp_fn fn_type, int (*func_init)(struct synaptics_rmi4_data *rmi4_data), void (*func_remove)(struct synaptics_rmi4_data *rmi4_data), void (*func_attn)(struct synaptics_rmi4_data *rmi4_data, unsigned char intr_mask)); int rmidev_module_register(void); int rmi4_f54_module_register(void); int rmi4_fw_update_module_register(void); int rmidb_module_register(void); int rmi_guest_module_register(void); int synaptics_rmi4_f54_set_control(struct synaptics_rmi4_data *rmi4_data); int synaptics_fw_updater(unsigned char *fw_data); int synaptics_rmi4_fw_update_on_probe(struct synaptics_rmi4_data *rmi4_data); int synaptics_rmi4_proximity_enables(struct synaptics_rmi4_data *rmi4_data, unsigned char enables); int synaptics_proximity_no_sleep_set(struct synaptics_rmi4_data *rmi4_data, bool enables); int synaptics_rmi4_f12_set_feature(struct synaptics_rmi4_data *rmi4_data); int synaptics_rmi4_set_tsp_test_result_in_config(int pass_fail); int synaptics_rmi4_tsp_read_test_result(struct synaptics_rmi4_data *rmi4_data); #ifdef USE_EDGE_EXCLUSION int synaptics_rmi4_f51_grip_edge_exclusion_rx(struct synaptics_rmi4_data *rmi4_data, bool enables); #endif int synaptics_rmi4_f12_ctrl11_set (struct synaptics_rmi4_data *rmi4_data, unsigned char data); int synaptics_rmi4_set_custom_ctrl_register(struct synaptics_rmi4_data *rmi4_data, bool mode, unsigned short address, int length, unsigned char *value); void synaptics_rmi4_free_sidekeys(struct synaptics_rmi4_data *rmi4_data); int synaptics_rmi4_free_fingers(struct synaptics_rmi4_data *rmi4_data); int synaptics_rmi4_irq_enable(struct synaptics_rmi4_data *rmi4_data, bool enable); #ifdef TOUCHKEY_ENABLE int synaptics_tkey_led_vdd_on(struct synaptics_rmi4_data *rmi4_data, bool onoff); #endif extern struct class *sec_class; #define SEC_CLASS_DEVT_TSP 10 #define SEC_CLASS_DEVT_TKEY 11 #ifdef CONFIG_SAMSUNG_LPM_MODE extern int poweroff_charging; #endif static inline ssize_t synaptics_rmi4_show_error(struct device *dev, struct device_attribute *attr, char *buf) { dev_warn(dev, "%s Attempted to read from write-only attribute %s\n", __func__, attr->attr.name); return -EPERM; } static inline ssize_t synaptics_rmi4_store_error(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { dev_warn(dev, "%s Attempted to write to read-only attribute %s\n", __func__, attr->attr.name); return -EPERM; } static inline void batohs(unsigned short *dest, unsigned char *src) { *dest = src[1] * 0x100 + src[0]; } static inline void hstoba(unsigned char *dest, unsigned short src) { dest[0] = src % 0x100; dest[1] = src / 0x100; } #endif
GuneetAtwal/kernel_g900f
drivers/input/touchscreen/synaptics/synaptics_i2c_rmi.h
C
gpl-2.0
36,800
[ 30522, 1013, 1008, 1008, 19962, 9331, 14606, 16233, 2595, 3543, 18182, 4062, 1008, 1008, 9385, 1006, 1039, 1007, 2262, 19962, 9331, 14606, 5100, 1008, 1008, 9385, 1006, 1039, 1007, 2262, 10481, 5413, 1026, 10481, 1012, 5413, 1030, 1056, 286...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/****************************************************************************** CRYSTALPALACE - Episode specific code *******************************************************************************/ #include "g_local.h" #include "voice_punk.h" #include "voice_bitch.h" void ProcessKingpin (edict_t *self, edict_t *other); void misc_cp_afraid_think (edict_t *self); qboolean EP_CrystalPalace_CastSight ( edict_t *self, edict_t *other, cast_memory_t *mem ) { return false; } qboolean EP_CrystalPalace_CastUse (edict_t *self, edict_t *other, edict_t *activator) { return false; } qboolean EP_CrystalPalace_EventSpeech (edict_t *self, edict_t *other, int saywhat) { cast_memory_t *mem; mem = level.global_cast_memory[ self->character_index ][ other->character_index ]; switch (saywhat) { case say_neutral: if (self->name_index == NAME_KINGPIN && other->client) { if (!(other->episode_flags & EP_CP_KINGPIN_FIRSTSIGHT)) { gi.dprintf ("there he is lets go!\n"); EP_Skidrow_Register_EPFLAG (other, EP_CP_KINGPIN_FIRSTSIGHT); { // need to make blunt and kingpin leave through the elevator ProcessKingpin (self, other); } } return true; } return false; break; case say_hostile: if (self->name_index == NAME_KINGPIN) { if (!(other->episode_flags & EP_CP_KINGPIN_FIRSTSIGHT)) { gi.dprintf ("there he is lets go!\n"); EP_Skidrow_Register_EPFLAG (other, EP_CP_KINGPIN_FIRSTSIGHT); { // need to make blunt and kingpin leave through the elevator ProcessKingpin (self, other); } } return true; } return false; break; } return false; } void EP_CrystalPalace_ItemPickup ( edict_t *self, edict_t *other ) { } void EP_CrystalPalace_Script( edict_t *ent, char *scriptname ) { } int EP_CrystalPalace_HiredGuysFlags (edict_t *player, edict_t *self) { if (self->gender == GENDER_MALE) Voice_Random (self, player, &hiredguy_ask[10], 4); else Voice_Random (self, player, &hiredgal_specific[12], 4); return (0); } void EP_CrystalPalaceFlags (edict_t *self) { } qboolean EP_CrystalPalace_DoKey (edict_t *self, edict_t *other) { return false; } void EP_CrystalPalace_Check_DoKey (edict_t *self, edict_t *ent) { } void EP_CrystalPalace_ReachedDoKey (edict_t *self) { } void EP_CrystalPalace_EndDoKey (edict_t *self) { } qboolean EP_CrystalPalace_UnlockDoorFlag (edict_t *ent) { return false; } void EP_CrystalPalace_HiredGuysRegisterFlags (edict_t *ent, edict_t *other) { } void ProcessKingpin (edict_t *self, edict_t *other) { edict_t *Blunt; edict_t *ent = NULL; Blunt = EP_GetCharacter (NAME_BLUNT); if (Blunt) { ent = G_Find (ent, FOFS(classname), "misc_cp_afraid"); if (ent) { self->goal_ent = ent; ent->cast_info.aiflags |= AI_GOAL_RUN; ent->think = misc_cp_afraid_think; ent->nextthink = level.time + 0.1; self->cast_info.aiflags &= ~AI_TALK; } else gi.dprintf ("Kingpin missing misc_cp_afraid marker\n"); } // todo // the doors to the escape elevator need to open } /*QUAKED misc_cp_afraid (.5 .5 1) (-16 -16 -24) (16 16 48) used as the location mo will run to before larry and curly attack him */ void misc_cp_afraid_think (edict_t *self) { edict_t *Kingpin; edict_t *Blunt; vec3_t vec; float dist; Kingpin = EP_GetCharacter (NAME_KINGPIN); Blunt = EP_GetCharacter (NAME_BLUNT); if (Kingpin) { VectorSubtract (Kingpin->s.origin, self->s.origin, vec); dist = VectorLength (vec); // gi.dprintf ("dist: %5.3f\n", dist); if (dist < 128) { } else self->nextthink = level.time + 0.1; } } void SP_misc_cp_afraid (edict_t *self) { if (deathmatch->value) { G_FreeEdict(self); return; } self->movetype = MOVETYPE_NONE; self->solid = SOLID_NOT; VectorSet (self->mins, -16, -16, -24); VectorSet (self->maxs, 16, 16, 48); self->cast_info.aiflags |= AI_RUN_LIKE_HELL; AI_Ent_droptofloor( self ); gi.linkentity (self); }
amokmen/q2ctc
Catch the Chicken for Kingpin v1.1/ctc_source_v1-1_kingpin/ep_crystalpalace.c
C
gpl-2.0
3,949
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * ***************************************************************************** * Copyright 2013 Kevin Hester * * See LICENSE.txt for license details. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * **************************************************************************** */ package com.geeksville.aws import com.amazonaws.auth.AWSCredentials import com.typesafe.config.ConfigFactory import grizzled.slf4j.Logging /** * Provides AWS credentials from a Typesafe style config db * * @param baseKey - we look for AWS keys underneed this root entry */ class ConfigCredentials(baseKey: String) extends AWSCredentials with Logging { private lazy val conf = ConfigFactory.load() private def prefix = if (baseKey.isEmpty) baseKey else baseKey + "." def getAWSAccessKeyId() = { val r = conf.getString(prefix + "aws.accessKey") //debug(s"Using AWS access key $r") r } def getAWSSecretKey() = { val r = conf.getString(prefix + "aws.secretKey") //debug(s"Using AWS secret key $r") r } }
dronekit/dronekit-server
src/main/scala/com/geeksville/aws/ConfigCredentials.scala
Scala
gpl-3.0
1,310
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
let mongoose = require('mongoose') let userSchema = mongoose.Schema({ // userModel properties here... local: { email: { type: String, required: true }, password: { type: String, required: true } }, facebook: { id: String, token: String, email: String, name: String } }) userSchema.methods.generateHash = async function(password) { return await bcrypt.promise.hash(password, 8) } userSchema.methods.validatePassword = async function(password) { return await bcrypt.promise.compare(password, this.password) } userSchema.methods.linkAccount = function(type, values) { // linkAccount('facebook', ...) => linkFacebookAccount(values) return this['link' + _.capitalize(type) + 'Account'](values) } userSchema.methods.linkLocalAccount = function({ email, password }) { throw new Error('Not Implemented.') } userSchema.methods.linkFacebookAccount = function({ account, token }) { throw new Error('Not Implemented.') } userSchema.methods.linkTwitterAccount = function({ account, token }) { throw new Error('Not Implemented.') } userSchema.methods.linkGoogleAccount = function({ account, token }) { throw new Error('Not Implemented.') } userSchema.methods.linkLinkedinAccount = function({ account, token }) { throw new Error('Not Implemented.') } userSchema.methods.unlinkAccount = function(type) { throw new Error('Not Implemented.') } module.exports = mongoose.model('User', userSchema)
linghuaj/node-social-auth
app/models/user.js
JavaScript
mit
1,581
[ 30522, 2292, 12256, 3995, 9232, 1027, 5478, 1006, 1005, 12256, 3995, 9232, 1005, 1007, 2292, 5198, 5403, 2863, 1027, 12256, 3995, 9232, 1012, 8040, 28433, 1006, 1063, 1013, 1013, 5310, 5302, 9247, 5144, 2182, 1012, 1012, 1012, 2334, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php namespace app\models; use Yii; /** * This is the model class for table "content". * * @property integer $id * @property string $title * @property integer $moderation * @property integer $listsql_id * @property integer $parent_id * @property integer $grade_id * @property string $comment_TutorAboutPupil1 * @property integer $mark_TutorAboutPupil1 * @property string $date_TutorAboutPupil1 * @property string $comment_Pupil1AboutTutor * @property integer $mark_Pupil1AboutTutor * @property string $date_Pupil1AboutTutor * @property string $commentMaximum_TutorAboutPupil1 * @property integer $markMaximum_TutorAboutPupil1 * @property string $dateMaximum_TutorAboutPupil1 * @property string $commentMaximum_Pupil1AboutTutor * @property integer $markMaximum_Pupil1AboutTutor * @property string $dateMaximum_Pupil1AboutTutor * @property string $comment_Pupil1AboutPupil1 * @property integer $mark_Pupil1AboutPupil1 * @property string $date_Pupil1AboutPupil1 * @property string $commentMaximum_Pupil1AboutPupil1 * @property integer $markMaximum_Pupil1AboutPupil1 * @property string $dateMaximum_Pupil1AboutPupil1 */ class Content extends \yii\db\ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'content'; } /** * @inheritdoc */ public function rules() { return [ [['title', 'moderation', 'listsql_id', 'parent_id', 'comment_TutorAboutPupil1', 'mark_TutorAboutPupil1', 'date_TutorAboutPupil1', 'comment_Pupil1AboutTutor', 'mark_Pupil1AboutTutor', 'date_Pupil1AboutTutor', 'commentMaximum_TutorAboutPupil1', 'markMaximum_TutorAboutPupil1', 'dateMaximum_TutorAboutPupil1', 'commentMaximum_Pupil1AboutTutor', 'markMaximum_Pupil1AboutTutor', 'dateMaximum_Pupil1AboutTutor', 'comment_Pupil1AboutPupil1', 'mark_Pupil1AboutPupil1', 'date_Pupil1AboutPupil1', 'commentMaximum_Pupil1AboutPupil1', 'markMaximum_Pupil1AboutPupil1', 'dateMaximum_Pupil1AboutPupil1'], 'required'], [['moderation', 'listsql_id', 'parent_id', 'grade_id', 'mark_TutorAboutPupil1', 'mark_Pupil1AboutTutor', 'markMaximum_TutorAboutPupil1', 'markMaximum_Pupil1AboutTutor', 'mark_Pupil1AboutPupil1', 'markMaximum_Pupil1AboutPupil1'], 'integer'], [['comment_TutorAboutPupil1', 'comment_Pupil1AboutTutor', 'commentMaximum_TutorAboutPupil1', 'commentMaximum_Pupil1AboutTutor', 'comment_Pupil1AboutPupil1', 'commentMaximum_Pupil1AboutPupil1'], 'string'], [['date_TutorAboutPupil1', 'date_Pupil1AboutTutor', 'dateMaximum_TutorAboutPupil1', 'dateMaximum_Pupil1AboutTutor', 'date_Pupil1AboutPupil1', 'dateMaximum_Pupil1AboutPupil1'], 'safe'], [['title'], 'string', 'max' => 500], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'title' => 'Title', 'moderation' => 'Moderation', 'listsql_id' => 'Listsql ID', 'parent_id' => 'Parent ID', 'grade_id' => 'Grade ID', 'comment_TutorAboutPupil1' => 'Comment Tutor About Pupil1', 'mark_TutorAboutPupil1' => 'Mark Tutor About Pupil1', 'date_TutorAboutPupil1' => 'Date Tutor About Pupil1', 'comment_Pupil1AboutTutor' => 'Comment Pupil1 About Tutor', 'mark_Pupil1AboutTutor' => 'Mark Pupil1 About Tutor', 'date_Pupil1AboutTutor' => 'Date Pupil1 About Tutor', 'commentMaximum_TutorAboutPupil1' => 'Comment Maximum Tutor About Pupil1', 'markMaximum_TutorAboutPupil1' => 'Mark Maximum Tutor About Pupil1', 'dateMaximum_TutorAboutPupil1' => 'Date Maximum Tutor About Pupil1', 'commentMaximum_Pupil1AboutTutor' => 'Comment Maximum Pupil1 About Tutor', 'markMaximum_Pupil1AboutTutor' => 'Mark Maximum Pupil1 About Tutor', 'dateMaximum_Pupil1AboutTutor' => 'Date Maximum Pupil1 About Tutor', 'comment_Pupil1AboutPupil1' => 'Comment Pupil1 About Pupil1', 'mark_Pupil1AboutPupil1' => 'Mark Pupil1 About Pupil1', 'date_Pupil1AboutPupil1' => 'Date Pupil1 About Pupil1', 'commentMaximum_Pupil1AboutPupil1' => 'Comment Maximum Pupil1 About Pupil1', 'markMaximum_Pupil1AboutPupil1' => 'Mark Maximum Pupil1 About Pupil1', 'dateMaximum_Pupil1AboutPupil1' => 'Date Maximum Pupil1 About Pupil1', ]; } }
halva202/halva202.by
backend/models/160501/Content.php
PHP
bsd-3-clause
4,464
[ 30522, 1026, 1029, 25718, 3415, 15327, 10439, 1032, 4275, 1025, 2224, 12316, 2072, 1025, 1013, 1008, 1008, 1008, 2023, 2003, 1996, 2944, 2465, 2005, 2795, 1000, 4180, 1000, 1012, 1008, 1008, 1030, 3200, 16109, 1002, 8909, 1008, 1030, 3200, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright © 2010, Denys Vuika * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System.Windows.Data; namespace System.Windows.Controls.WpfPropertyGrid.Design { /// <summary> /// Defines a content presenter control for a Category editor. /// </summary> public class CategoryEditorContentPresenter : ContentPresenter { /// <summary> /// Initializes a new instance of the <see cref="CategoryEditorContentPresenter"/> class. /// </summary> public CategoryEditorContentPresenter() { var contentBinding = new Binding { RelativeSource = RelativeSource.Self, Path = new PropertyPath("(0).(1)", new[] { GridEntryContainer.ParentContainerProperty, GridEntryContainer.EntryProperty }) }; var contentTemplateBinding = new Binding { RelativeSource = RelativeSource.Self, Path = new PropertyPath("(0).EditorTemplate", new[] { GridEntryContainer.ParentContainerProperty }) }; SetBinding(ContentProperty, contentBinding); SetBinding(ContentTemplateProperty, contentTemplateBinding); } } }
Nixxis/ncs-client
WpfPropertyGrid/Design/CategoryEditorContentPresenter.cs
C#
mit
1,623
[ 30522, 1013, 1008, 1008, 9385, 1075, 2230, 1010, 9772, 2015, 24728, 7556, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jenkins_plugins_ssh_key 'sam' do type 'rsa' key <<-KEY -----BEGIN RSA PRIVATE KEY----- MIIJKQIBAAKCAgEAv39xGNZys5hEU6UBvunu8nFDBrNgOmi8jmGnsZ+LPtjoekf/ rXkWfEZe2BZCEd4GAK3OqCXJasM1fri9IG+6E9PscJZLy49PuwDAiDebKYHOEOBt /nvgiBvXddr9EGI/cu7ydiOEFQQwxSz+4gGQdrqBhF6t7sxswbzyNi9w9Lgi5lfd kBy/GV1qXlZw4JtbwF1xE5HsFc7gM54hdiZQ5ojxdA6Ylb6cUPQc9vgsVHR9DYHw xN+TFRe/WlABmUq5DyKzCHvK7OiUwyt1wdO2pqO6cLSIlhdB73EHOuwFg2P0foI2 Lq0RUv8o9j9irNTawiDMa/uYUMTy6ZHjrqoMKNwfjCGbX6BOLDC5dOMBz5/haYYR -----END RSA PRIVATE KEY----- KEY action :add end jenkins_plugins_ssh_key 'sam' do type 'rsa' key <<-KEY -----BEGIN RSA PRIVATE KEY----- MIIJKQIBAAKCAgEAv39xGNZys5hEU6UBvunu8nFDBrNgOmi8jmGnsZ+LPtjoekf/ rXkWfEZe2BZCEd4GAK3OqCXJasM1fri9IG+6E9PscJZLy49PuwDAiDebKYHOEOBt /nvgiBvXddr9EGI/cu7ydiOEFQQwxSz+4gGQdrqBhF6t7sxswbzyNi9w9Lgi5lfd kBy/GV1qXlZw4JtbwF1xE5HsFc7gM54hdiZQ5ojxdA6Ylb6cUPQc9vgsVHR9DYHw xN+TFRe/WlABmUq5DyKzCHvK7OiUwyt1wdO2pqO6cLSIlhdB73EHOuwFg2P0foI2 Lq0RUv8o9j9irNTawiDMa/uYUMTy6ZHjrqoMKNwfjCGbX6BOLDC5dOMBz5/haYYR -----END RSA PRIVATE KEY----- KEY action :remove end
monkeylittleinc/jenkins_plugins
test/fixtures/cookbooks/jenkins_plugins_ssh_key/recipes/remove.rb
Ruby
mit
1,106
[ 30522, 11098, 1035, 13354, 7076, 1035, 7020, 2232, 1035, 3145, 1005, 3520, 1005, 2079, 2828, 1005, 12667, 2050, 1005, 3145, 1026, 1026, 1011, 3145, 1011, 1011, 1011, 1011, 1011, 4088, 12667, 2050, 2797, 3145, 1011, 1011, 1011, 1011, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.personal.allutil; import com.orhanobut.logger.LogLevel; import com.orhanobut.logger.Logger; import android.app.Application; import android.content.Context; /** * Created by zzz on 8/18/2016. */ public class ZApplication extends Application { private static final String TAG = "ZApp"; private static ZApplication instance; private static Context context; /** * Called when the application is starting, before any activity, service, * or receiver objects (excluding content providers) have been created. * Implementations should be as quick as possible (for example using * lazy initialization of state) since the time spent in this function * directly impacts the performance of starting the first activity, * service, or receiver in a process. * If you override this method, be sure to call super.onCreate(). */ @Override public void onCreate() { super.onCreate(); instance = this; context = getApplicationContext(); Logger.init(TAG); } public static ZApplication getInstance() { return instance; } public static Context getContext() { return context; } }
portguas/androidsc
Demons/allutil/src/main/java/com/personal/allutil/ZApplication.java
Java
gpl-3.0
1,215
[ 30522, 7427, 4012, 1012, 3167, 1012, 2035, 21823, 2140, 1025, 12324, 4012, 1012, 2030, 4819, 16429, 4904, 1012, 8833, 4590, 1012, 8833, 20414, 2884, 1025, 12324, 4012, 1012, 2030, 4819, 16429, 4904, 1012, 8833, 4590, 1012, 8833, 4590, 1025,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var RxOld = require("rx"); var RxNew = require("../../../../index"); module.exports = function (suite) { var oldFlatMapWithCurrentThreadScheduler = RxOld.Observable.range(0, 25, RxOld.Scheduler.currentThread).flatMap(RxOld.Observable.return(0, RxOld.Scheduler.currentThread)); var newFlatMapWithCurrentThreadScheduler = RxNew.Observable.range(0, 25, RxNew.Scheduler.immediate).flatMapTo(RxNew.Observable.return(0, RxNew.Scheduler.immediate)); return suite .add('old flatMap (scalar Observable) with current thread scheduler', function () { oldFlatMapWithCurrentThreadScheduler.subscribe(_next, _error, _complete); }) .add('new flatMap (scalar Observable) with current thread scheduler', function () { newFlatMapWithCurrentThreadScheduler.subscribe(_next, _error, _complete); }); function _next(x) { } function _error(e){ } function _complete(){ } };
smaye81/RxJS
perf/micro/current-thread-scheduler/operators/flat-map-observable-scalar.js
JavaScript
apache-2.0
932
[ 30522, 13075, 1054, 2595, 11614, 1027, 5478, 1006, 1000, 1054, 2595, 1000, 1007, 1025, 13075, 1054, 2595, 2638, 2860, 1027, 5478, 1006, 1000, 1012, 1012, 1013, 1012, 1012, 1013, 1012, 1012, 1013, 1012, 1012, 1013, 5950, 1000, 1007, 1025, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright 2011 - 2013 NTB University of Applied Sciences in Technology * Buchs, Switzerland, http://www.ntb.ch/inf * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.deepjava.runtime.mpc555.test; import java.io.PrintStream; import org.deepjava.runtime.mpc555.IntbMpc555HB; import org.deepjava.runtime.mpc555.driver.SCI; import org.deepjava.runtime.mpc555.driver.ffs.AM29LV160; import org.deepjava.unsafe.US; /*changes: * 2.5.11 NTB/GRAU creation */ public class FlashTest1 implements IntbMpc555HB { static final int flashAddr = extFlashBase + 0x20008; static { SCI sci = SCI.getInstance(SCI.pSCI2); sci.start(9600, SCI.NO_PARITY, (short)8); System.out = new PrintStream(sci.out); System.out.println("flash test"); System.out.printHexln(US.GET4(flashAddr)); // AM29LV160.programShort(flashAddr, (short)0xaaaa); // AM29LV160.programShort(flashAddr+2, (short)0x8888); AM29LV160.eraseSector(flashAddr); System.out.printHexln(US.GET4(flashAddr)); } }
deepjava/runtime-library
src/org/deepjava/runtime/mpc555/test/FlashTest1.java
Java
apache-2.0
1,559
[ 30522, 1013, 1008, 1008, 9385, 2249, 1011, 2286, 23961, 2497, 2118, 1997, 4162, 4163, 1999, 2974, 1008, 20934, 18069, 1010, 5288, 1010, 8299, 1024, 1013, 1013, 7479, 1012, 23961, 2497, 1012, 10381, 1013, 1999, 2546, 1008, 1008, 7000, 2104, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
.root { display: inline-block; position: relative; z-index: 1; cursor: var(--cursor-pointer); height: var(--navbar-height); line-height: var(--navbar-height); border: none; padding: var(--navbar-dropdown-padding); font-size: var(--font-size-large); } .root:not(:last-child) { margin-right: var(--navbar-item-space); } .root::after { position: absolute; icon-font: url('../../i-icon.vue/assets/arrow-down.svg'); font-size: var(--navbar-dropdown-popper-font-size); right: 10px; top: 0; line-height: var(--navbar-height); } .popper { background: white; font-size: var(--navbar-dropdown-popper-font-size); width: 100%; line-height: var(--navbar-dropdown-popper-line-height); } .root[disabled] { cursor: var(--cursor-not-allowed); color: var(--navbar-dropdown-color-disabled); }
vusion/proto-ui
src/components/u-navbar.vue/dropdown.vue/module.css
CSS
mit
866
[ 30522, 1012, 7117, 1063, 4653, 1024, 23881, 1011, 3796, 1025, 2597, 1024, 5816, 1025, 1062, 1011, 5950, 1024, 1015, 1025, 12731, 25301, 2099, 1024, 13075, 1006, 1011, 1011, 12731, 25301, 2099, 1011, 20884, 1007, 1025, 4578, 1024, 13075, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php // This file is part of mod_checkmark for Moodle - http://moodle.org/ // // It is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // It is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * backup/moodle2/backup_checkmark_stepslib.php Define all the backup steps that will be used by the backup_checkmark_activity_task * * @package mod_checkmark * @author Philipp Hager * @copyright 2014 Academic Moodle Cooperation {@link http://www.academic-moodle-cooperation.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; /** * Define the complete checkmark structure for backup, with file and id annotations * * @package mod_checkmark * @author Philipp Hager * @copyright 2014 Academic Moodle Cooperation {@link http://www.academic-moodle-cooperation.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class backup_checkmark_activity_structure_step extends backup_activity_structure_step { /** * Define backup structure * * @return object standard activity structure */ protected function define_structure() { // Are we including userinfo? $userinfo = $this->get_setting_value('userinfo'); // Define each element separated! $checkmark = new backup_nested_element('checkmark', array('id'), array( 'name', 'intro', 'introformat', 'alwaysshowdescription', 'resubmit', 'cutoffdate', 'emailteachers', 'timedue', 'timeavailable', 'exampleprefix', 'grade', 'trackattendance', 'attendancegradelink', 'presentationgrading', 'presentationgrade', 'presentationgradebook', 'timemodified')); $submissions = new backup_nested_element('submissions'); $submission = new backup_nested_element('submission', array('id'), array( 'userid', 'timecreated', 'timemodified')); $feedbacks = new backup_nested_element('feedbacks'); $feedback = new backup_nested_element('feedback', array('id'), array( 'userid', 'grade', 'feedback', 'format', 'attendance', 'presentationgrade', 'presentationfeedback', 'presentationformat', 'graderid', 'mailed', 'timecreated', 'timemodified')); $examples = new backup_nested_element('examples'); $example = new backup_nested_element('example', array('id'), array('checkmarkid', 'name', 'grade')); $checks = new backup_nested_element('checks'); $check = new backup_nested_element('check', array('id'), array('checkmarkid', 'submissionid', 'exampleid', 'state')); // Now build the tree! $checkmark->add_child($examples); $examples->add_child($example); $checkmark->add_child($submissions); $submissions->add_child($submission); $checkmark->add_child($feedbacks); $feedbacks->add_child($feedback); // Second level. $submission->add_child($checks); $checks->add_child($check); // Define sources! $checkmark->set_source_table('checkmark', array('id' => backup::VAR_ACTIVITYID)); $example->set_source_table('checkmark_examples', array('checkmarkid' => backup::VAR_PARENTID)); // All the rest of elements only happen if we are including user info! if ($userinfo) { $submission->set_source_table('checkmark_submissions', array('checkmarkid' => backup::VAR_PARENTID)); $feedback->set_source_table('checkmark_feedbacks', array('checkmarkid' => backup::VAR_PARENTID)); $check->set_source_table('checkmark_checks', array('submissionid' => backup::VAR_PARENTID)); } // Define id annotations! $checkmark->annotate_ids('scale', 'grade'); $checkmark->annotate_ids('scale', 'presentationgrade'); $submission->annotate_ids('user', 'userid'); $feedback->annotate_ids('user', 'userid'); $feedback->annotate_ids('user', 'graderid'); $check->annotate_ids('checkmark_example', 'exampleid'); // Define file annotations! $checkmark->annotate_files('mod_checkmark', 'intro', null); // This file area has no itemid! // Return the root element (checkmark), wrapped into standard activity structure! return $this->prepare_activity_structure($checkmark); } }
nitro2010/moodle
mod/checkmark/backup/moodle2/backup_checkmark_stepslib.php
PHP
gpl-3.0
4,986
[ 30522, 1026, 1029, 25718, 1013, 1013, 2023, 5371, 2003, 2112, 1997, 16913, 1035, 4638, 10665, 2005, 6888, 2571, 1011, 8299, 1024, 1013, 1013, 6888, 2571, 1012, 8917, 1013, 1013, 1013, 1013, 1013, 2009, 2003, 2489, 4007, 1024, 2017, 2064, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package run import ( "errors" "fmt" "os" "os/user" "path/filepath" "reflect" "strconv" "strings" "time" "github.com/influxdata/kapacitor/services/alerta" "github.com/influxdata/kapacitor/services/deadman" "github.com/influxdata/kapacitor/services/hipchat" "github.com/influxdata/kapacitor/services/httpd" "github.com/influxdata/kapacitor/services/influxdb" "github.com/influxdata/kapacitor/services/logging" "github.com/influxdata/kapacitor/services/opsgenie" "github.com/influxdata/kapacitor/services/pagerduty" "github.com/influxdata/kapacitor/services/replay" "github.com/influxdata/kapacitor/services/reporting" "github.com/influxdata/kapacitor/services/sensu" "github.com/influxdata/kapacitor/services/slack" "github.com/influxdata/kapacitor/services/smtp" "github.com/influxdata/kapacitor/services/stats" "github.com/influxdata/kapacitor/services/talk" "github.com/influxdata/kapacitor/services/task_store" "github.com/influxdata/kapacitor/services/udf" "github.com/influxdata/kapacitor/services/udp" "github.com/influxdata/kapacitor/services/victorops" "github.com/influxdata/influxdb/services/collectd" "github.com/influxdata/influxdb/services/graphite" "github.com/influxdata/influxdb/services/opentsdb" ) // Config represents the configuration format for the kapacitord binary. type Config struct { HTTP httpd.Config `toml:"http"` Replay replay.Config `toml:"replay"` Task task_store.Config `toml:"task"` InfluxDB []influxdb.Config `toml:"influxdb"` Logging logging.Config `toml:"logging"` Graphites []graphite.Config `toml:"graphite"` Collectd collectd.Config `toml:"collectd"` OpenTSDB opentsdb.Config `toml:"opentsdb"` UDPs []udp.Config `toml:"udp"` SMTP smtp.Config `toml:"smtp"` OpsGenie opsgenie.Config `toml:"opsgenie"` VictorOps victorops.Config `toml:"victorops"` PagerDuty pagerduty.Config `toml:"pagerduty"` Sensu sensu.Config `toml:"sensu"` Slack slack.Config `toml:"slack"` HipChat hipchat.Config `toml:"hipchat"` Alerta alerta.Config `toml:"alerta"` Reporting reporting.Config `toml:"reporting"` Stats stats.Config `toml:"stats"` UDF udf.Config `toml:"udf"` Deadman deadman.Config `toml:"deadman"` Talk talk.Config `toml:"talk"` Hostname string `toml:"hostname"` DataDir string `toml:"data_dir"` // The index of the default InfluxDB config defaultInfluxDB int } // NewConfig returns an instance of Config with reasonable defaults. func NewConfig() *Config { c := &Config{ Hostname: "localhost", } c.HTTP = httpd.NewConfig() c.Replay = replay.NewConfig() c.Task = task_store.NewConfig() c.Logging = logging.NewConfig() c.Collectd = collectd.NewConfig() c.OpenTSDB = opentsdb.NewConfig() c.SMTP = smtp.NewConfig() c.OpsGenie = opsgenie.NewConfig() c.VictorOps = victorops.NewConfig() c.PagerDuty = pagerduty.NewConfig() c.Sensu = sensu.NewConfig() c.Slack = slack.NewConfig() c.HipChat = hipchat.NewConfig() c.Alerta = alerta.NewConfig() c.Reporting = reporting.NewConfig() c.Stats = stats.NewConfig() c.UDF = udf.NewConfig() c.Deadman = deadman.NewConfig() c.Talk = talk.NewConfig() return c } // Once the config has been created and decoded, you can call this method // to initialize ARRAY attributes. // All ARRAY attributes have to be init after toml decode // See: https://github.com/BurntSushi/toml/pull/68 func (c *Config) PostInit() { if len(c.InfluxDB) == 0 { i := influxdb.NewConfig() c.InfluxDB = []influxdb.Config{i} c.InfluxDB[0].Name = "default" c.InfluxDB[0].URLs = []string{"http://localhost:8086"} } else if len(c.InfluxDB) == 1 && c.InfluxDB[0].Name == "" { c.InfluxDB[0].Name = "default" } } // NewDemoConfig returns the config that runs when no config is specified. func NewDemoConfig() (*Config, error) { c := NewConfig() c.PostInit() var homeDir string // By default, store meta and data files in current users home directory u, err := user.Current() if err == nil { homeDir = u.HomeDir } else if os.Getenv("HOME") != "" { homeDir = os.Getenv("HOME") } else { return nil, fmt.Errorf("failed to determine current user for storage") } c.Replay.Dir = filepath.Join(homeDir, ".kapacitor", c.Replay.Dir) c.Task.Dir = filepath.Join(homeDir, ".kapacitor", c.Task.Dir) c.DataDir = filepath.Join(homeDir, ".kapacitor", c.DataDir) return c, nil } // Validate returns an error if the config is invalid. func (c *Config) Validate() error { if c.Hostname == "" { return fmt.Errorf("must configure valid hostname") } if c.DataDir == "" { return fmt.Errorf("must configure valid data dir") } err := c.Replay.Validate() if err != nil { return err } err = c.Task.Validate() if err != nil { return err } c.defaultInfluxDB = -1 names := make(map[string]bool, len(c.InfluxDB)) for i := 0; i < len(c.InfluxDB); i++ { config := c.InfluxDB[i] if !config.Enabled { c.InfluxDB = append(c.InfluxDB[0:i], c.InfluxDB[i+1:]...) i-- continue } if names[config.Name] { return fmt.Errorf("duplicate name %q for influxdb configs", config.Name) } names[config.Name] = true err = config.Validate() if err != nil { return err } if config.Default { if c.defaultInfluxDB != -1 { return fmt.Errorf("More than one InfluxDB default was specified: %s %s", config.Name, c.InfluxDB[c.defaultInfluxDB].Name) } c.defaultInfluxDB = i } } // Set default if it is the only one if len(c.InfluxDB) == 1 { c.defaultInfluxDB = 0 } if len(c.InfluxDB) > 0 && c.defaultInfluxDB == -1 { return errors.New("at least one InfluxDB cluster must be marked as default.") } err = c.UDF.Validate() if err != nil { return err } err = c.Sensu.Validate() if err != nil { return err } err = c.Talk.Validate() if err != nil { return err } for _, g := range c.Graphites { if err := g.Validate(); err != nil { return fmt.Errorf("invalid graphite config: %v", err) } } return nil } func (c *Config) ApplyEnvOverrides() error { return c.applyEnvOverrides("KAPACITOR", "", reflect.ValueOf(c)) } func (c *Config) applyEnvOverrides(prefix string, fieldDesc string, spec reflect.Value) error { // If we have a pointer, dereference it s := spec if spec.Kind() == reflect.Ptr { s = spec.Elem() } var value string if s.Kind() != reflect.Struct { value = os.Getenv(prefix) // Skip any fields we don't have a value to set if value == "" { return nil } if fieldDesc != "" { fieldDesc = " to " + fieldDesc } } switch s.Kind() { case reflect.String: s.SetString(value) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: var intValue int64 // Handle toml.Duration if s.Type().Name() == "Duration" { dur, err := time.ParseDuration(value) if err != nil { return fmt.Errorf("failed to apply %v%v using type %v and value '%v'", prefix, fieldDesc, s.Type().String(), value) } intValue = dur.Nanoseconds() } else { var err error intValue, err = strconv.ParseInt(value, 0, s.Type().Bits()) if err != nil { return fmt.Errorf("failed to apply %v%v using type %v and value '%v'", prefix, fieldDesc, s.Type().String(), value) } } s.SetInt(intValue) case reflect.Bool: boolValue, err := strconv.ParseBool(value) if err != nil { return fmt.Errorf("failed to apply %v%v using type %v and value '%v'", prefix, fieldDesc, s.Type().String(), value) } s.SetBool(boolValue) case reflect.Float32, reflect.Float64: floatValue, err := strconv.ParseFloat(value, s.Type().Bits()) if err != nil { return fmt.Errorf("failed to apply %v%v using type %v and value '%v'", prefix, fieldDesc, s.Type().String(), value) } s.SetFloat(floatValue) case reflect.Struct: c.applyEnvOverridesToStruct(prefix, s) } return nil } func (c *Config) applyEnvOverridesToStruct(prefix string, s reflect.Value) error { typeOfSpec := s.Type() for i := 0; i < s.NumField(); i++ { f := s.Field(i) // Get the toml tag to determine what env var name to use configName := typeOfSpec.Field(i).Tag.Get("toml") // Replace hyphens with underscores to avoid issues with shells configName = strings.Replace(configName, "-", "_", -1) fieldName := typeOfSpec.Field(i).Name // Skip any fields that we cannot set if f.CanSet() || f.Kind() == reflect.Slice { // Use the upper-case prefix and toml name for the env var key := strings.ToUpper(configName) if prefix != "" { key = strings.ToUpper(fmt.Sprintf("%s_%s", prefix, configName)) } // If the type is s slice, apply to each using the index as a suffix // e.g. GRAPHITE_0 if f.Kind() == reflect.Slice || f.Kind() == reflect.Array { for i := 0; i < f.Len(); i++ { if err := c.applyEnvOverrides(fmt.Sprintf("%s_%d", key, i), fieldName, f.Index(i)); err != nil { return err } } } else if err := c.applyEnvOverrides(key, fieldName, f); err != nil { return err } } } return nil }
alerta/kapacitor
cmd/kapacitord/run/config.go
GO
mit
9,009
[ 30522, 7427, 2448, 12324, 1006, 1000, 10697, 1000, 1000, 4718, 2102, 1000, 1000, 9808, 1000, 1000, 9808, 1013, 5310, 1000, 1000, 4130, 1013, 5371, 15069, 1000, 1000, 8339, 1000, 1000, 2358, 29566, 2078, 2615, 1000, 1000, 7817, 1000, 1000, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Data_pemesanan extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model(array( 'model_pemesanan' => 'pemesanan', )); // if ($this->session->userdata('level') != 1) // { // redirect('pelanggan/before_login'); // } } public function index() { $data['pemesanan'] = $this->pemesanan->get_all()->result(); // echo "<pre>"; // return var_dump($data); // echo "</pre"; $this->template->admin('data_pemesanan','script_admin',$data); } public function tersedia($id_pemesanan) { $this->load->library('email'); // configure email setting $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.gmail.com'; $config['smtp_port'] = '465'; $config['smtp_user'] = 'ahmaddjunaedi92@gmail.com'; //bangzafran445@gmail.com $config['smtp_pass'] = 'junjunned!92'; //bastol1234567 // $config['protocol'] = 'mail'; $config['mailpath'] = '/usr/sbin/sendmail'; $config['mailtype'] = 'html'; $config['charset'] = 'iso-8859-1'; $config['wordwrap'] = TRUE; $config['newline'] = "\r\n"; //use double quotes $this->email->initialize($config); $to_email = $this->input->post('email'); $nama = $this->input->post('nama'); $kode_pemesanan = $this->input->post('kode_pemesanan'); $nama_wisata = $this->input->post('nama_wisata'); $tgl_mulai = date_create($this->input->post('tgl_mulai')); $tgl_mulai = date_format($tgl_mulai,'d-m-y'); $tgl_akhir = date_create($this->input->post('tgl_akhir')); $tgl_akhir = date_format($tgl_akhir, 'd-m-Y'); $harga_pemesanan = number_format($Harga = $this->input->post('harga_pemesanan'),0,'.','.'); $norek = $this->input->post('norek_perusahaan'); $subject = "Pemesanan Paket Wisata"; $message = "Hai $nama <br/> Selamat pesanan paket wisata kamu telah siap. Mohon untuk segera melakukan pembayaran untuk detail pesanan kamu dibawah ini:<br/> Nama Pemesan : $nama <br/> Nomor Pemesanan : $kode_pemesanan <br/><br/> Nama Paket Wisata : $nama_wisata<br> Tanggal : $tgl_mulai s/d $tgl_akhir<br/> Harga Paket Wisata : $harga_pemesanan IDR<br/><br/> Pembayaran dapat dilakukan melalui rekening dibawah ini:<br/> Nomor Rekening : $norek<br/> Nama Bank : BCA<br/> Atas Nama : PT. Persada Duta Beliton<br/><br/> Apabila Saudara telah melakukan pembayaran, mohon untuk segera mengkonfirmasi pembayaran anda melalui fitur <b>Konfirmasi Pembayaran</b> untuk proses lebih lanjut.<br/> Atas perhatiannya kami ucapkan terima kasih <br/><br/><br/> PT. Persada Duta Beliton"; // send email $this->email->from('ahmaddjunaedi92@gmail.com','Ahmad Djunaedi'); $this->email->to($to_email); $this->email->subject($subject); $this->email->message($message); if($this->email->send()) { $data = array( 'status' => 'Segera Dibayar' ); $this->pemesanan->update($id_pemesanan, $data); $this->session->set_flashdata('update', 'Status pemesanan berhasil diperbaharui'); redirect('admin/data_pemesanan'); } else { print_r($this->email->print_debugger()); } } public function tidak_tersedia($id_pemesanan) { $this->load->library('email'); // configure email setting $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.gmail.com'; $config['smtp_port'] = '465'; $config['smtp_user'] = 'ahmaddjunaedi92@gmail.com'; //bangzafran445@gmail.com $config['smtp_pass'] = 'junjunned!92'; //bastol1234567 // $config['protocol'] = 'mail'; $config['mailpath'] = '/usr/sbin/sendmail'; $config['mailtype'] = 'html'; $config['charset'] = 'iso-8859-1'; $config['wordwrap'] = TRUE; $config['newline'] = "\r\n"; //use double quotes $this->email->initialize($config); $to_email = $this->input->post('email'); $nama = $this->input->post('nama'); $kode_pemesanan = $this->input->post('kode_pemesanan'); $nama_wisata = $this->input->post('nama_wisata'); $subject = "Pemesanan"; $message = "Hai $nama <br/><br/> Detail Pesanan : <br/> Nama Pemesan : $nama<br/> Nama Paket Wisata : $nama_wisata<br/> Nomor Pemesanan : $kode_pemesanan<br/><br/> Mohon maaf pesanan paket wisata anda kami BATALKAN dikarenakan untuk saat ini paket wisata yang anda pesan tidak tersedia atau pembayaran anda gagal kami verifikasi.<br/> Mohon untuk konfirmasi ulang pembayaran anda, pastikan detail pembayaran yang anda isi telah benar.<br/> Apabila ada informasi yang belum jelas, bisa anda hubungi admin secara langsung melalui fitur “Chat” yang ada dalam web resmi kami.<br/><br/> Salam Hormat kami,<br/><br/> PT. Persada Duta Beliton "; // send email $this->email->from('ahmaddjunaedi92@gmail.com','Ahmad Djunaedi'); $this->email->to($to_email); $this->email->subject($subject); $this->email->message($message); if($this->email->send()) { $data = array( 'status' => 'Dibatalkan' ); $this->pemesanan->update($id_pemesanan, $data); $this->session->set_flashdata('update', 'Status pemesanan berhasil diperbaharui'); redirect('admin/data_pemesanan'); } else { print_r($this->email->print_debugger()); } } public function delete($id_pemesanan) { $this->pemesanan->delete($id_pemesanan); $this->session->set_flashdata('delete', 'Data pemesanan berhasil dihapus'); redirect('admin/data_pemesanan'); } } /* End of file Data_pemesanan.php */ /* Location: ./application/modules/admin/controllers/Data_pemesanan.php */
djuned92/i-crm
application/modules/admin/controllers/Data_pemesanan.php
PHP
mit
5,926
[ 30522, 1026, 1029, 25718, 4225, 1006, 1005, 2918, 15069, 1005, 1007, 2030, 6164, 1006, 1005, 2053, 3622, 5896, 3229, 3039, 1005, 1007, 1025, 2465, 2951, 1035, 21877, 7834, 5162, 2078, 8908, 25022, 1035, 11486, 1063, 2270, 3853, 1035, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (C) 2011, Mysema Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.mysema.scalagen import java.util.ArrayList import UnitTransformer._ import japa.parser.ast.expr._ object Primitives extends Primitives /** * Primitives modifies primitive type related constants and method calls */ class Primitives extends UnitTransformerBase { private val TRUE = new BooleanLiteral(true) private val FALSE = new BooleanLiteral(false) private val primitives = Set("Boolean","Byte","Char","Double","Float","Integer","Long","Short") def transform(cu: CompilationUnit): CompilationUnit = { cu.accept(this, cu).asInstanceOf[CompilationUnit] } override def visit(n: FieldAccess, arg: CompilationUnit): Node = n match { case FieldAccess(str("Boolean"), "TRUE") => TRUE case FieldAccess(str("Boolean"), "FALSE") => FALSE case _ => super.visit(n, arg) } // override def visit(n: MethodCall, arg: CompilationUnit): Node = n match { // case MethodCall(str(scope), "valueOf", a :: Nil) => a.accept(this, arg) // case _ => super.visit(n, arg) // } }
davidchang168/scalagen
scalagen/src/main/scala/com/mysema/scalagen/Primitives.scala
Scala
apache-2.0
1,604
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2249, 1010, 2026, 3366, 2863, 5183, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 53...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package dhg.util import scala.collection.generic.CanBuildFrom object Pattern { object UInt { val IntRE = """^(-?\d+)$""".r def unapply(v: String): Option[Int] = v match { case IntRE(s) => Some(s.toInt) case _ => None } } // implicit def int2unapplyInt(objA: Int.type) = UInt object UDouble { val DoubleRE = """^(-?\d+\.?\d*|-?\d*\.?\d+)$""".r def unapply(v: String): Option[Double] = v match { case DoubleRE(s) => Some(s.toDouble) case _ => None } } // implicit def double2unapplyDouble(objA: Double.type) = UDouble object UBoolean { val booleanRE = """([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])""".r def unapply(v: String): Option[Boolean] = v match { case booleanRE(s) => Some(s.toBoolean) case _ => None } } object UMap { def unapplySeq[A, B](m: Map[A, B]): Option[Seq[(A, B)]] = Some(m.toIndexedSeq) } object USet { def unapplySeq[A](s: Set[A]): Option[Seq[A]] = Some(s.toIndexedSeq) } object -> { def unapply[A, B](pair: (A, B)): Option[(A, B)] = { Some(pair) } } object Range { val RangeRE = """^(\d+)-(\d+)$""".r def unapply(s: String): Option[Seq[Int]] = Some( s.replaceAll("\\s+", "").split(",").flatMap { case UInt(i) => i to i case RangeRE(UInt(b), UInt(e)) if b <= e => b to e }) } class Range(max: Int) { val OpenRangeRE = """^(\d+)-$""".r def unapply(s: String): Option[Seq[Int]] = Some( s.replaceAll("\\s+", "").split(",").flatMap { case OpenRangeRE(UInt(b)) => b to max case Range(r) => r }) } def makeRangeString(seq: Seq[Int]): String = { assert(seq.nonEmpty, "cannot make empty sequence into a range string") assert(seq.exists(_ >= 0), s"negative numbers are not permitted: $seq") (-2 +: seq).sliding(2).foldLeft(Vector[Vector[Int]]()) { case ((z :+ c), Seq(a, b)) => if (a != b - 1) (z :+ c) :+ Vector(b) else (z :+ (c :+ b)) case (z, Seq(a, b)) => z :+ Vector(b) } .map { case Seq(x) => x.toString case s => s.head + "-" + s.last }.mkString(",") } object Iterable { def unapplySeq[T](s: Iterable[T]): Option[Seq[T]] = Some(s.toIndexedSeq) } }
dhgarrette/low-resource-pos-tagging-2013
src/main/scala/dhg/util/Pattern.scala
Scala
apache-2.0
2,296
[ 30522, 7427, 28144, 2290, 1012, 21183, 4014, 12324, 26743, 1012, 3074, 1012, 12391, 1012, 2064, 8569, 4014, 20952, 21716, 4874, 5418, 1063, 4874, 21318, 3372, 1063, 11748, 20014, 2890, 1027, 1000, 1000, 1000, 1034, 1006, 1011, 1029, 1032, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright (c) 2016 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package storage import ( "flag" "fmt" "golang.org/x/net/context" "github.com/vmware/govmomi/govc/cli" "github.com/vmware/govmomi/govc/flags" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) type mark struct { *flags.HostSystemFlag ssd *bool local *bool } func init() { cli.Register("host.storage.mark", &mark{}) } func (cmd *mark) Register(ctx context.Context, f *flag.FlagSet) { cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) f.Var(flags.NewOptionalBool(&cmd.ssd), "ssd", "Mark as SSD") f.Var(flags.NewOptionalBool(&cmd.local), "local", "Mark as local") } func (cmd *mark) Process(ctx context.Context) error { if err := cmd.HostSystemFlag.Process(ctx); err != nil { return err } return nil } func (cmd *mark) Usage() string { return "DEVICE_PATH" } func (cmd *mark) Description() string { return `Mark device at DEVICE_PATH.` } func (cmd *mark) Mark(ctx context.Context, ss *object.HostStorageSystem, uuid string) error { var err error var task *object.Task if cmd.ssd != nil { if *cmd.ssd { task, err = ss.MarkAsSsd(ctx, uuid) } else { task, err = ss.MarkAsNonSsd(ctx, uuid) } if err != nil { return err } err = task.Wait(ctx) if err != nil { return err } } if cmd.local != nil { if *cmd.local { task, err = ss.MarkAsLocal(ctx, uuid) } else { task, err = ss.MarkAsNonLocal(ctx, uuid) } if err != nil { return err } err = task.Wait(ctx) if err != nil { return err } } return nil } func (cmd *mark) Run(ctx context.Context, f *flag.FlagSet) error { if f.NArg() != 1 { return fmt.Errorf("specify device path") } path := f.Args()[0] host, err := cmd.HostSystem() if err != nil { return err } ss, err := host.ConfigManager().StorageSystem(ctx) if err != nil { return err } var hss mo.HostStorageSystem err = ss.Properties(ctx, ss.Reference(), nil, &hss) if err != nil { return nil } for _, e := range hss.StorageDeviceInfo.ScsiLun { disk, ok := e.(*types.HostScsiDisk) if !ok { continue } if disk.DevicePath == path { return cmd.Mark(ctx, ss, disk.Uuid) } } return fmt.Errorf("%s not found", path) }
austinlparker/govmomi
govc/host/storage/mark.go
GO
apache-2.0
2,846
[ 30522, 1013, 1008, 9385, 1006, 1039, 1007, 2355, 1058, 2213, 8059, 1010, 4297, 1012, 2035, 2916, 9235, 1012, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package cn.nukkit.command.defaults; import cn.nukkit.Player; import cn.nukkit.command.CommandSender; import cn.nukkit.command.ConsoleCommandSender; import cn.nukkit.utils.TextFormat; public class MuteCommand extends VanillaCommand { public MuteCommand(String name) { super(name, "自分をミュート状態にします。", "/mute"); this.setPermission("nukkit.command.mute"); this.commandParameters.clear(); } @Override public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!this.testPermission(sender)) { return true; } if(sender instanceof ConsoleCommandSender){ sender.sendMessage(TextFormat.RED + "コンソールはミュートできません。"); return true; } Player p = (Player)sender; if(p.mute){ p.setMute(false); p.sendImportantMessage(TextFormat.GREEN + "ミュートを解除しました。"); return true; }else{ p.setMute(true); p.sendImportantMessage(TextFormat.RED + "ミュートを有効にしました。"); return true; } } }
JupiterDevelopmentTeam/JupiterDevelopmentTeam
src/main/java/cn/nukkit/command/defaults/MuteCommand.java
Java
gpl-3.0
1,185
[ 30522, 7427, 27166, 1012, 16371, 24103, 2102, 1012, 3094, 1012, 12398, 2015, 1025, 12324, 27166, 1012, 16371, 24103, 2102, 1012, 2447, 1025, 12324, 27166, 1012, 16371, 24103, 2102, 1012, 3094, 1012, 10954, 10497, 2121, 1025, 12324, 27166, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
from __future__ import division, absolute_import, print_function import sys if sys.version_info[0] >= 3: from io import StringIO else: from io import StringIO import compiler import inspect import textwrap import tokenize from .compiler_unparse import unparse class Comment(object): """ A comment block. """ is_comment = True def __init__(self, start_lineno, end_lineno, text): # int : The first line number in the block. 1-indexed. self.start_lineno = start_lineno # int : The last line number. Inclusive! self.end_lineno = end_lineno # str : The text block including '#' character but not any leading spaces. self.text = text def add(self, string, start, end, line): """ Add a new comment line. """ self.start_lineno = min(self.start_lineno, start[0]) self.end_lineno = max(self.end_lineno, end[0]) self.text += string def __repr__(self): return '%s(%r, %r, %r)' % (self.__class__.__name__, self.start_lineno, self.end_lineno, self.text) class NonComment(object): """ A non-comment block of code. """ is_comment = False def __init__(self, start_lineno, end_lineno): self.start_lineno = start_lineno self.end_lineno = end_lineno def add(self, string, start, end, line): """ Add lines to the block. """ if string.strip(): # Only add if not entirely whitespace. self.start_lineno = min(self.start_lineno, start[0]) self.end_lineno = max(self.end_lineno, end[0]) def __repr__(self): return '%s(%r, %r)' % (self.__class__.__name__, self.start_lineno, self.end_lineno) class CommentBlocker(object): """ Pull out contiguous comment blocks. """ def __init__(self): # Start with a dummy. self.current_block = NonComment(0, 0) # All of the blocks seen so far. self.blocks = [] # The index mapping lines of code to their associated comment blocks. self.index = {} def process_file(self, file): """ Process a file object. """ if sys.version_info[0] >= 3: nxt = file.__next__ else: nxt = file.next for token in tokenize.generate_tokens(nxt): self.process_token(*token) self.make_index() def process_token(self, kind, string, start, end, line): """ Process a single token. """ if self.current_block.is_comment: if kind == tokenize.COMMENT: self.current_block.add(string, start, end, line) else: self.new_noncomment(start[0], end[0]) else: if kind == tokenize.COMMENT: self.new_comment(string, start, end, line) else: self.current_block.add(string, start, end, line) def new_noncomment(self, start_lineno, end_lineno): """ We are transitioning from a noncomment to a comment. """ block = NonComment(start_lineno, end_lineno) self.blocks.append(block) self.current_block = block def new_comment(self, string, start, end, line): """ Possibly add a new comment. Only adds a new comment if this comment is the only thing on the line. Otherwise, it extends the noncomment block. """ prefix = line[:start[1]] if prefix.strip(): # Oops! Trailing comment, not a comment block. self.current_block.add(string, start, end, line) else: # A comment block. block = Comment(start[0], end[0], string) self.blocks.append(block) self.current_block = block def make_index(self): """ Make the index mapping lines of actual code to their associated prefix comments. """ for prev, block in zip(self.blocks[:-1], self.blocks[1:]): if not block.is_comment: self.index[block.start_lineno] = prev def search_for_comment(self, lineno, default=None): """ Find the comment block just before the given line number. Returns None (or the specified default) if there is no such block. """ if not self.index: self.make_index() block = self.index.get(lineno, None) text = getattr(block, 'text', default) return text def strip_comment_marker(text): """ Strip # markers at the front of a block of comment text. """ lines = [] for line in text.splitlines(): lines.append(line.lstrip('#')) text = textwrap.dedent('\n'.join(lines)) return text def get_class_traits(klass): """ Yield all of the documentation for trait definitions on a class object. """ # FIXME: gracefully handle errors here or in the caller? source = inspect.getsource(klass) cb = CommentBlocker() cb.process_file(StringIO(source)) mod_ast = compiler.parse(source) class_ast = mod_ast.node.nodes[0] for node in class_ast.code.nodes: # FIXME: handle other kinds of assignments? if isinstance(node, compiler.ast.Assign): name = node.nodes[0].name rhs = unparse(node.expr).strip() doc = strip_comment_marker(cb.search_for_comment(node.lineno, default='')) yield name, rhs, doc
nguy/artview
docs/sphinxext/numpydoc/comment_eater.py
Python
bsd-3-clause
5,425
[ 30522, 2013, 1035, 1035, 2925, 1035, 1035, 12324, 2407, 1010, 7619, 1035, 12324, 1010, 6140, 1035, 3853, 12324, 25353, 2015, 2065, 25353, 2015, 1012, 2544, 1035, 18558, 1031, 1014, 1033, 1028, 1027, 1017, 1024, 2013, 22834, 12324, 5164, 369...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/////////////////////////////////////////////////////////////////////////////// // moment.hpp // // Copyright 2005 Eric Niebler. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_ACCUMULATORS_STATISTICS_MOMENT_HPP_EAN_15_11_2005 #define BOOST_ACCUMULATORS_STATISTICS_MOMENT_HPP_EAN_15_11_2005 #include <boost/config/no_tr1/cmath.hpp> #include <boost/mpl/int.hpp> #include <boost/mpl/assert.hpp> #include <boost/mpl/placeholders.hpp> #include <boost/accumulators/framework/accumulator_base.hpp> #include <boost/accumulators/framework/extractor.hpp> #include <boost/accumulators/numeric/functional.hpp> #include <boost/accumulators/framework/parameters/sample.hpp> #include <boost/accumulators/framework/depends_on.hpp> #include <boost/accumulators/statistics_fwd.hpp> #include <boost/accumulators/statistics/count.hpp> namespace boost { namespace numeric { /// INTERNAL ONLY /// template<typename T> T const &pow(T const &x, mpl::int_<1>) { return x; } /// INTERNAL ONLY /// template<typename T, int N> T pow(T const &x, mpl::int_<N>) { using namespace operators; T y = numeric::pow(x, mpl::int_<N/2>()); T z = y * y; return (N % 2) ? (z * x) : z; } }} namespace boost { namespace accumulators { namespace impl { /////////////////////////////////////////////////////////////////////////////// // moment_impl template<typename N, typename Sample> struct moment_impl : accumulator_base // TODO: also depends_on sum of powers { BOOST_MPL_ASSERT_RELATION(N::value, >, 0); // for boost::result_of typedef typename numeric::functional::fdiv<Sample, std::size_t>::result_type result_type; template<typename Args> moment_impl(Args const &args) : sum(args[sample | Sample()]) { } template<typename Args> void operator ()(Args const &args) { this->sum += numeric::pow(args[sample], N()); } template<typename Args> result_type result(Args const &args) const { return numeric::fdiv(this->sum, count(args)); } // make this accumulator serializeable template<class Archive> void serialize(Archive & ar, const unsigned int file_version) { ar & sum; } private: Sample sum; }; } // namespace impl /////////////////////////////////////////////////////////////////////////////// // tag::moment // namespace tag { template<int N> struct moment : depends_on<count> { /// INTERNAL ONLY /// typedef accumulators::impl::moment_impl<mpl::int_<N>, mpl::_1> impl; }; } /////////////////////////////////////////////////////////////////////////////// // extract::moment // namespace extract { BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, moment, (int)) } using extract::moment; // So that moment<N> can be automatically substituted with // weighted_moment<N> when the weight parameter is non-void template<int N> struct as_weighted_feature<tag::moment<N> > { typedef tag::weighted_moment<N> type; }; template<int N> struct feature_of<tag::weighted_moment<N> > : feature_of<tag::moment<N> > { }; }} // namespace boost::accumulators #endif
kumakoko/KumaGL
third_lib/boost/1.75.0/boost/accumulators/statistics/moment.hpp
C++
mit
3,436
[ 30522, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1013, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "db/log_writer.h" #include <stdint.h> #include "leveldb/env.h" #include "util/coding.h" #include "util/crc32c.h" namespace leveldb { namespace log { Writer::Writer(WritableFile* dest) : dest_(dest), block_offset_(0) { for (int i = 0; i <= kMaxRecordType; i++) { char t = static_cast<char>(i); type_crc_[i] = crc32c::Value(&t, 1); } } Writer::~Writer() { } Status Writer::AddRecord(const Slice& slice) { const char* ptr = slice.data(); size_t left = slice.size(); // Fragment the record if necessary and emit it. Note that if slice // is empty, we still want to iterate once to emit a single // zero-length record Status s; bool begin = true; do { const int leftover = kBlockSize - block_offset_; assert(leftover >= 0); if (leftover < kHeaderSize) { // Switch to a new block if (leftover > 0) { // Fill the trailer (literal below relies on kHeaderSize being 7) assert(kHeaderSize == 7); dest_->Append(Slice("\x00\x00\x00\x00\x00\x00", leftover)); } block_offset_ = 0; } // Invariant: we never leave < kHeaderSize bytes in a block. assert(kBlockSize - block_offset_ - kHeaderSize >= 0); const size_t avail = kBlockSize - block_offset_ - kHeaderSize; const size_t fragment_length = (left < avail) ? left : avail; RecordType type; const bool end = (left == fragment_length); if (begin && end) { type = kFullType; } else if (begin) { type = kFirstType; } else if (end) { type = kLastType; } else { type = kMiddleType; } s = EmitPhysicalRecord(type, ptr, fragment_length); ptr += fragment_length; left -= fragment_length; begin = false; } while (s.ok() && left > 0); return s; } Status Writer::EmitPhysicalRecord(RecordType t, const char* ptr, size_t n) { assert(n <= 0xffff); // Must fit in two bytes assert(block_offset_ + kHeaderSize + n <= kBlockSize); // Format the header char buf[kHeaderSize]; buf[4] = static_cast<char>(n & 0xff); buf[5] = static_cast<char>(n >> 8); buf[6] = static_cast<char>(t); // Compute the crc of the record type and the payload. uint32_t crc = crc32c::Extend(type_crc_[t], ptr, n); crc = crc32c::Mask(crc); // Adjust for storage EncodeFixed32(buf, crc); // Write the header and the payload Status s = dest_->Append(Slice(buf, kHeaderSize)); if (s.ok()) { s = dest_->Append(Slice(ptr, n)); if (s.ok()) { s = dest_->Flush(); } } block_offset_ += kHeaderSize + n; return s; } } // namespace log } // namespace leveldb
february29/Learning
web/vue/AccountBook-Express/node_modules/.staging/leveldown-d5bd0bf6/deps/leveldb/leveldb-1.18.0/db/log_writer.cc
C++
mit
2,844
[ 30522, 1013, 1013, 9385, 1006, 1039, 1007, 2249, 1996, 2504, 18939, 6048, 1012, 2035, 2916, 9235, 1012, 1013, 1013, 2224, 1997, 2023, 3120, 3642, 2003, 9950, 2011, 1037, 18667, 2094, 1011, 2806, 6105, 2008, 2064, 2022, 1013, 1013, 2179, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Linux Time Machine ------------------ Rsync incremental backups with hard links. Save time and space. And your data. Macs have automatic incremental backups built in through [Time Machine](http://en.wikipedia.org/wiki/Time_Machine_%28Mac_OS%29) ![Apple TimeMachine](http://ekenberg.github.io/linux-timemachine/images/mac-timemachine.png) Linux has rsync, bash and cron. Rsync can use [hard links](http://en.wikipedia.org/wiki/Hard_link) for unchanged files: only files changed since the previous backup are copied. This saves a lot of time and storage space. A few entries from my personal backup. As you can see, each day gets its own directory. Inside is a complete backup with every file from my workstation. Still, each day takes very little extra space, since only modified files are copied. The rest are hard links. (Don't mind the modification times - they are set by rsync to the last modification time of / on my workstation): ![Linux TimeMachine](http://ekenberg.github.io/linux-timemachine/images/linux-timemachine.png) ### Prerequisites * Backup to a filesystem which supports hard and soft links. No problem except for FAT or NTFS (Microsoft). * Mount the backup filesystem locally (NFS, USB-cable etc). I use a QNAP NAS which is mounted to /mnt/backup over NFS ### How To * Mount your backup target * Set configuration in backup.conf * Set exclude paths in backup_exclude.conf * Test with some small directory and -v: `sudo do_incremental_rsync.sh -v /some/test-directory` * Do a full system backup: `sudo do_incremental_rsync.sh`. If /home is on a separate partition: `sudo do_incremental_rsync.sh /home /`. The first full backup will take a long time since all files must be copied. * Finally, set up to run nightly, as root, through cron. I recommend doing a full run early morning or just after midnight, see [Notes](#notes) below. ### Check hard links To verify that hard linking actually works, use the `stat` command on a file in the latest backup which you know has not been changed for some time. `stat` shows a field `Links: #` which tells how many hard links a file has. My /etc/fstab hasn't changed for a long time: ![Stat output](http://ekenberg.github.io/linux-timemachine/images/stat-verify-hard-links.jpg) <a name='notes'/> ### Notes * _Important:_ For hard links to work, the first backup each day must be a full system backup. Why? Because the script updates the current-link when it is run. If the first backup of the day is for /home/user/some/directory, and the current-link is updated. When a full backup is run, it will look for the last backup through the current-link and not find any files except /home/user/some/directory, and it must make a new copy of everything. This will waste a lot of space! Make sure to do a full backup every night just after midnight and you should be fine. * I do backups nightly, and the script stores them with the current date in the directory name. So any additional backups during the day will end up overwriting the current date's backup. That's fine for me, but if you want to keep more frequent copies, you should look at the `$TODAY` variable in the script. Maybe add hour or hour-minute to the format. Please understand that the first backup to every new date/time should be a full backup, as explained above. * rsync is run with --one-file-system. If you have several filesystems to backup, you must supply them all as arguments to the script. Example: If /home is mounted on a separate partition you would make a system backup like this: `do_incremental_rsync.sh /home /`
ekenberg/linux-timemachine
README.md
Markdown
mit
3,565
[ 30522, 11603, 2051, 3698, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 12667, 6038, 2278, 4297, 28578, 21050, 10200, 2015, 2007, 2524, 6971, 1012, 3828, 2051, 1998, 2686, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*** Copyright (c) 2008-2012 CommonsWare, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. From _The Busy Coder's Guide to Android Development_ http://commonsware.com/Android */ package com.commonsware.android.fakeplayer; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; public class FakePlayer extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void startPlayer(View v) { Intent i=new Intent(this, PlayerService.class); i.putExtra(PlayerService.EXTRA_PLAYLIST, "main"); i.putExtra(PlayerService.EXTRA_SHUFFLE, true); startService(i); } public void stopPlayer(View v) { stopService(new Intent(this, PlayerService.class)); } }
atishagrawal/cw-android
Service/FakePlayer/src/com/commonsware/android/fakeplayer/FakePlayer.java
Java
apache-2.0
1,352
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2263, 1011, 2262, 7674, 8059, 1010, 11775, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, 2023, 5371, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var textDivTopIndex = -1; /** * Creates a div that contains a textfiled, a plus and a minus button * @param {String | undefined} textContent string to be added to the given new textField as value * @returns new div */ function createTextDiv( textContent ) { textDivTopIndex++; var newTextDiv = document.createElement("DIV"); newTextDiv.className = "inputTextDiv form-group row"; newTextDiv.id = "uriArray"+textDivTopIndex; newTextDiv.setAttribute("index", textDivTopIndex); //newTextDiv.innerHTML = "hasznaltauto.hu url:"; //textfield that asks for a car uri and its align-responsible container var textField = document.createElement("INPUT"); textField.id = uriInputFieldIdPrefix + textDivTopIndex; textField.type = "url"; textField.name = "carUri"+textDivTopIndex; textField.className = "form-control"; textField.placeholder = "hasznaltauto.hu url"; textField.value = (textContent === undefined) ? "" : textContent; //all textfield has it, but there is to be 10 at maximum so the logic overhead would be greater(always the last one should have it) than this efficiency decrease addEvent( textField, "focus", addOnFocus); var textFieldAlignerDiv = document.createElement("DIV"); textFieldAlignerDiv.className = "col-xs-10 col-sm-10 col-sm-10"; textFieldAlignerDiv.appendChild(textField); //add a new input field, or remove current var inputButtonMinus = document.createElement("BUTTON"); inputButtonMinus.className = "btn btn-default btn-sm col-xs-1 col-sm-1 col-md-1 form-control-static"; inputButtonMinus.type = "button"; //avoid submit, which is default for buttons on forms inputButtonMinus.innerHTML = "-"; inputButtonMinus.id = "inputButtonMinus" + textDivTopIndex; newTextDiv.appendChild(textFieldAlignerDiv); newTextDiv.appendChild(inputButtonMinus); currentInputUriCount++; return newTextDiv } function addOnFocus(event) { if ( isLastField(event.target) && currentInputUriCount < 10 ) { var addedTextDiv = createTextDiv(); formElement.insertBefore(addedTextDiv, sendButtonDiv); event.stopPropagation(); } } function isLastField(field) { textDivTopIndex = 0; $(".inputTextDiv").each(function(index) { textDivTopIndex = ( $(this).attr("index") > textDivTopIndex ) ? $(this).attr("index") : textDivTopIndex; }); return textDivTopIndex == field.parentElement.parentElement.getAttribute("index") || currentInputUriCount === 1; }
amdor/skyscraper_fes
DOMBuilder/InputElementBuilder.js
JavaScript
mit
2,501
[ 30522, 13075, 3793, 4305, 2615, 14399, 22254, 10288, 1027, 1011, 1015, 1025, 1013, 1008, 1008, 1008, 9005, 1037, 4487, 2615, 2008, 3397, 1037, 3793, 8873, 3709, 1010, 1037, 4606, 1998, 1037, 15718, 6462, 1008, 1030, 11498, 2213, 1063, 5164,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php //add NID attribute to button $nid = $form['nid']['#value']; $node = $form['#entity']; $form['actions']['custom-submit-'.$nid]['#attributes']['data-nid'] = $nid; $form['actions']['custom-submit-'.$nid]['#attributes']['class'][] = 'save-form-btn'; //add CHOSEN placeholder to lesson plan field $form['field_lesson_plan_reference']['und']['#attributes']['data-placeholder'] = 'Select lesson plan(s) ...'; //tags field - add CHOSEN placeholder and select class $form['field_all_vocabularies_reference']['und']['#attributes']['data-placeholder'] = 'Select descriptive tag(s) ...'; $form['field_all_vocabularies_reference']['und']['#attributes']['class'] = array ( 'custom-all-tags-select', ); //get rid of HTML special characters in dropdowns $dropdown_keys = array( 'field_topic_reference', 'field_series_reference', 'field_content_provider_reference', 'field_lesson_plan_reference', ); foreach ($dropdown_keys as $dropdown_key) { $options = $form[$dropdown_key]['und']['#options']; foreach ($options as $key => $name) { $form[$dropdown_key]['und']['#options'][$key] = htmlspecialchars_decode($name, ENT_QUOTES); } } //get image to work with $field_image = $form['field_image']['und'][0]['#default_value']; $use_img = (isset($field_image['uri']) && $field_image['uri']) ? $field_image['uri'] : false; $img_thumbnail = false; if (isset($form['field_video']) && count($form['field_video']['und'])) { $field_video = $form['field_video']['und'][0]['#default_value']; if (((isset($field_image['is_default']) && $field_image['is_default']) || $field_image['fid']==0) && isset($field_video['thumbnailfile']->uri)) { $use_img = $field_video['thumbnailfile']->uri; } } if ($use_img) { $img_thumbnail = theme_image_style(array( 'style_name' => 'management_edit_content_thumbnail', 'path' => $use_img, )); } //change labels $form['title']['#title'] = 'Title <span class="publish-required">(Required)</span>'; $form['body']['und'][0]['value']['#title'] = 'Description <span class="publish-required">(Required)</span>'; $form['field_topic_reference']['und']['#title'] = 'Category <span class="publish-required">(Required)</span>'; $form['field_series_reference']['und']['#title'] = 'Series'; $form['field_lesson_plan_reference']['und']['#title'] = 'Lesson Plans'; $form['field_lesson_plan_reference']['und']['#description'] = 'You may attach this content to one or more lesson plans.'; $form['field_topic_reference']['und']['#title'] = 'Category <span class="publish-required">(Required)</span>'; $form['field_content_provider_reference']['und']['#title'] = 'Content Provider <span class="publish-required">(Required)</span>'; $form['language']['#title'] = 'Language <span class="publish-required">(Required)</span>'; //get player HTML $template_path_row = drupal_get_path('theme', 'uportal_backend_theme').'/templates/edit-forms/player-node-form-'.$node->type.'.tpl.php'; $content_player_html = _uportal_backend_load_view($template_path_row, array('form'=>$form)); //get allowed file types $file_field_settings = _uportal_default_filefield_settings(); $allowed_mime_types = $file_field_settings[$node->type]['mime-types']; $allowed_file_types = implode(',', $allowed_mime_types); //get allowed file types for thumbnail $thumbnail_file_field_settings = _uportal_field_settings_given_field_and_type('field_image', $node->type); $thumbnail_allowed_mime_types = implode(',', $thumbnail_file_field_settings['mime-types']); $thumbnail_file_field_info = array(); foreach ($thumbnail_file_field_settings['extensions'] as $ext) { $thumbnail_file_field_info[$ext] = array ( 'type' => 'image', 'max_file_size' => $thumbnail_file_field_settings['max-file-size'], ); } //any user accessing this form has the EDIT CONTENT permission and they should be able to PUBLISH/UNPUBLISH even if they do not have the ADMINISTER NODES permission $form['options']['status']['#access'] = true; ?> <div class="node-edit-form-wrapper clearfix"> <div class="node-edit-col-1"> <?php print $content_player_html; ?> <div class="thumbnail"> <label>Thumbnail</label> <div class="thumbnail-images clearfix"> <div class="current-thumbnail"> <div class="img"> <?php print $img_thumbnail; ?> </div> <div class="thumbnail-upload-progress wrapper-upload-progress"> <div class="loader-indicator"></div> <div class="progress-bar"><div></div></div> <div class="error-msg"></div> </div> </div> <div class="upload-thumbnail">Upload a thumbnail</div> </div> <div class="original-thumbnail-field"> <?php print drupal_render($form['field_image']); ?> </div> </div> <?php print drupal_render($form['field_all_vocabularies_reference']); ?> </div> <div class="node-edit-col-2"> <?php print drupal_render($form['title']); ?> <?php print drupal_render($form['body']); ?> <div class="clearfix category-series-wrapper"> <?php print drupal_render($form['field_topic_reference']); ?> <?php print drupal_render($form['field_series_reference']); ?> </div> <div class="category-series-desc">You must select a Category before selecting a Series.</div> <?php print drupal_render($form['field_content_provider_reference']); ?> <?php print drupal_render($form['language']); ?> <?php print drupal_render($form['field_lesson_plan_reference']); ?> <?php print drupal_render($form['options']['status']); ?> </div> </div> <div class="node-actions element-invisible"> <input type="hidden" id="form-nid-value" value="<?php print $nid ?>"> <?php print drupal_render($form['actions']); ?> <?php print drupal_render_children($form); ?> </div> <div class="temporary-data element-invisible"> <input type="hidden" id="custom-node-status" name="custom_node_status" value="-1"> <div class="thumbnail-info"> <input type="hidden" name="new_thumbnail_fid" value="0" class="new-thumbnail-fid"> <input type="file" name="new_thumbnail_upload" class="new-thumbnail" accept="<?php print $thumbnail_allowed_mime_types ?>" data-ays-ignore="true" data-file-upload-settings='<?php print json_encode($thumbnail_file_field_info) ?>' > </div> <div class="<?php print $node->type ?>-info content-file-info"> <input type="hidden" name="new_content_file_fid" value="0" class="new-content-file-fid"> <input type="file" name="new_content_file_upload" class="new-content-file" accept="<?php print $allowed_file_types ?>" data-ays-ignore="true"> </div> <div class="series-ordered-info"> <input type="hidden" name="series_ordered_nid" value="" class="series-ordered-nid"> <input type="hidden" name="series_ordered_order" value="" class="series-ordered-order"> </div> </div> <div class="saving-form-data"> <div class="loader"></div> <div class="loader-text">Saving Form Data. Please wait ...</div> </div>
unicef/uPortal
sites/all/themes/uportal_backend_theme/templates/edit-forms/content-node-form.tpl.php
PHP
gpl-2.0
6,946
[ 30522, 1026, 1029, 25718, 1013, 1013, 5587, 9152, 2094, 17961, 2000, 6462, 1002, 9152, 2094, 1027, 1002, 2433, 1031, 1005, 9152, 2094, 1005, 1033, 1031, 1005, 1001, 3643, 1005, 1033, 1025, 1002, 13045, 1027, 1002, 2433, 1031, 1005, 1001, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2015 Evolveum * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.evolveum.midpoint.model.impl.expr; import com.evolveum.midpoint.model.common.expression.ExpressionEvaluationContext; import com.evolveum.midpoint.model.common.expression.ExpressionEvaluator; import com.evolveum.midpoint.model.common.expression.ExpressionUtil; import com.evolveum.midpoint.model.impl.lens.LensContext; import com.evolveum.midpoint.prism.Item; import com.evolveum.midpoint.prism.ItemDefinition; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.PrismProperty; import com.evolveum.midpoint.prism.PrismPropertyValue; import com.evolveum.midpoint.prism.PrismValue; import com.evolveum.midpoint.prism.crypto.Protector; import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.prism.delta.PrismValueDeltaSetTriple; import com.evolveum.midpoint.repo.api.RepositoryService; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.util.exception.ExpressionEvaluationException; import com.evolveum.midpoint.util.exception.ObjectNotFoundException; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType; import com.evolveum.midpoint.xml.ns._public.common.common_3.SequentialValueExpressionEvaluatorType; /** * @author semancik * */ public class SequentialValueExpressionEvaluator<V extends PrismValue, D extends ItemDefinition> implements ExpressionEvaluator<V,D> { private SequentialValueExpressionEvaluatorType sequentialValueEvaluatorType; private D outputDefinition; private Protector protector; RepositoryService repositoryService; private PrismContext prismContext; SequentialValueExpressionEvaluator(SequentialValueExpressionEvaluatorType sequentialValueEvaluatorType, D outputDefinition, Protector protector, RepositoryService repositoryService, PrismContext prismContext) { this.sequentialValueEvaluatorType = sequentialValueEvaluatorType; this.outputDefinition = outputDefinition; this.protector = protector; this.repositoryService = repositoryService; this.prismContext = prismContext; } @Override public PrismValueDeltaSetTriple<V> evaluate(ExpressionEvaluationContext params) throws SchemaException, ExpressionEvaluationException, ObjectNotFoundException { long counter = getSequenceCounter(sequentialValueEvaluatorType.getSequenceRef().getOid(), repositoryService, params.getResult()); Object value = ExpressionUtil.convertToOutputValue(counter, outputDefinition, protector); Item<V,D> output = outputDefinition.instantiate(); if (output instanceof PrismProperty) { PrismPropertyValue<Object> pValue = new PrismPropertyValue<Object>(value); ((PrismProperty<Object>)output).add(pValue); } else { throw new UnsupportedOperationException("Can only generate values of property, not "+output.getClass()); } return ItemDelta.toDeltaSetTriple(output, null); } public static long getSequenceCounter(String sequenceOid, RepositoryService repositoryService, OperationResult result) throws ObjectNotFoundException, SchemaException { LensContext<? extends FocusType> ctx = ModelExpressionThreadLocalHolder.getLensContext(); if (ctx == null) { throw new IllegalStateException("No lens context"); } Long counter = ctx.getSequenceCounter(sequenceOid); if (counter == null) { counter = repositoryService.advanceSequence(sequenceOid, result); ctx.setSequenceCounter(sequenceOid, counter); } return counter; } /* (non-Javadoc) * @see com.evolveum.midpoint.common.expression.ExpressionEvaluator#shortDebugDump() */ @Override public String shortDebugDump() { return "squentialValue: "+sequentialValueEvaluatorType.getSequenceRef().getOid(); } }
rpudil/midpoint
model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/SequentialValueExpressionEvaluator.java
Java
apache-2.0
4,390
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2325, 19852, 2819, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1008, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- layout: post title: ESLint v1.7.0 released tags: - release - minor --- # ESLint v1.7.0 released We just pushed ESLint v1.7.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release. ## Highlights Here are some highlights of changes in this release. ### New Rules * [`no-empty-pattern`](http://eslint.org/docs/rules/no-empty-pattern) * [`no-magic-numbers`](http://eslint.org/docs/rules/no-magic-numbers) ### Extending JavaScript configs You've always been able to use npm packages in the `extends` field of your configuration file. Now, you can directly link to JavaScript files in `extends`, allowing you to reference JavaScript configuration files directly even when they are not part of an npm package. ## Features * New: Create eslint-config-eslint (fixes [#3525](https://github.com/eslint/eslint/issues/3525)) (Nicholas C. Zakas) * New: add "consistent" option to the "curly" rule (fixes [#2390](https://github.com/eslint/eslint/issues/2390)) (Benoît Zugmeyer) * New: no-empty-pattern rule (fixes [#3668](https://github.com/eslint/eslint/issues/3668)) (alberto) * New: no-magic-numbers rule (fixes [#4027](https://github.com/eslint/eslint/issues/4027)) (Vincent Lemeunier) ## Enhancements * Update: Support .js files for config (fixes [#3102](https://github.com/eslint/eslint/issues/3102)) (Gyandeep Singh) * Update: RuleTester allows string errors in invalid cases (fixes [#4117](https://github.com/eslint/eslint/issues/4117)) (Kevin Partington) * Update: added exceptions to `lines-around-comment` rule. (fixes [#2965](https://github.com/eslint/eslint/issues/2965)) (Mathieu M-Gosselin) * Update: Add `matchDescription` option to `valid-jsdoc` (fixes [#2449](https://github.com/eslint/eslint/issues/2449)) (Gyandeep Singh) * Update: Add `allow` option for `no-underscore-dangle` rule (fixes [#2135](https://github.com/eslint/eslint/issues/2135)) (Gyandeep Singh) * Update: `allowArrowFunctions` option for `func-style` rule (fixes [#1897](https://github.com/eslint/eslint/issues/1897)) (Gyandeep Singh) * Update: Ignore end of function in newline-after-var (fixes [#3682](https://github.com/eslint/eslint/issues/3682)) (alberto) * Update: Option to ignore for loops in init-declarations (fixes [#3641](https://github.com/eslint/eslint/issues/3641)) (alberto) * Update: Add webextensions environment (fixes [#4051](https://github.com/eslint/eslint/issues/4051)) (Blake Winton) ## Bug Fixes * Fix: array-bracket-spacing for empty array (fixes [#4141](https://github.com/eslint/eslint/issues/4141)) (alberto) * Fix: `indent` arrow function check fix (fixes [#4142](https://github.com/eslint/eslint/issues/4142)) (Gyandeep Singh) * Fix: Make eslint-config-eslint work (fixes [#4145](https://github.com/eslint/eslint/issues/4145)) (Nicholas C. Zakas) * Fix: `prefer-arrow-callback` had been wrong at arguments (fixes [#4095](https://github.com/eslint/eslint/issues/4095)) (Toru Nagashima) * Fix: check for objects or arrays in array-bracket-spacing (fixes [#4083](https://github.com/eslint/eslint/issues/4083)) (alberto) * Fix: message templates fail when no parameters are passed (fixes [#4080](https://github.com/eslint/eslint/issues/4080)) (Ilya Volodin) * Fix: `indent` multi-line function call (fixes [#4073](https://github.com/eslint/eslint/issues/4073), fixes [#4075](https://github.com/eslint/eslint/issues/4075)) (Gyandeep Singh) * Fix: no-mixed-tabs-and-spaces fails with some comments (fixes [#4086](https://github.com/eslint/eslint/issues/4086)) (alberto) * Fix: `semi` to check for do-while loops (fixes [#4090](https://github.com/eslint/eslint/issues/4090)) (Gyandeep Singh) * Fix: `no-unused-vars` had been missing some parameters (fixes [#4047](https://github.com/eslint/eslint/issues/4047)) (Toru Nagashima) * Fix: no-mixed-spaces-and-tabs with comments and templates (fixes [#4077](https://github.com/eslint/eslint/issues/4077)) (alberto) * Fix: Ignore template literals in no-mixed-tabs-and-spaces (fixes [#4054](https://github.com/eslint/eslint/issues/4054)) (Nicholas C. Zakas) * Fix: `no-cond-assign` had needed double parens in `for` (fixes [#4023](https://github.com/eslint/eslint/issues/4023)) (Toru Nagashima) * Fix: id-match bug incorrectly errors on `NewExpression` (fixes [#4042](https://github.com/eslint/eslint/issues/4042)) (Burak Yigit Kaya) * Fix: `no-trailing-spaces` autofix to handle linebreaks (fixes [#4050](https://github.com/eslint/eslint/issues/4050)) (Gyandeep Singh) * Fix: renamed no-magic-number to no-magic-numbers (fixes [#4053](https://github.com/eslint/eslint/issues/4053)) (Vincent Lemeunier) * Fix: no-cond-assign should report assignment location (fixes [#4040](https://github.com/eslint/eslint/issues/4040)) (alberto) * Fix: `no-redeclare` and `no-sahadow` for builtin globals (fixes [#3971](https://github.com/eslint/eslint/issues/3971)) (Toru Nagashima) ## Documentation * Docs: Update various rules docs (Nicholas C. Zakas) * Docs: Reference no-unexpected-multiline in semi (fixes [#4114](https://github.com/eslint/eslint/issues/4114)) (alberto) * Docs: Alphabetize Rules lists (Kenneth Chung) * Docs: Improve comma-dangle documentation (Gilad Peleg) * Docs: Re-tag JSX code fences (fixes [#4020](https://github.com/eslint/eslint/issues/4020)) (Brandon Mills) * Docs: Remove list of users from README (fixes [#3881](https://github.com/eslint/eslint/issues/3881)) (Brandon Mills) ## Dependency Upgrades * Upgrade: Upgrade globals to 8.11.0 (fixes [#3599](https://github.com/eslint/eslint/issues/3599)) (Burak Yigit Kaya) ## Build Related * Build: Fix path related failures on Windows in tests (fixes [#4061](https://github.com/eslint/eslint/issues/4061)) (Burak Yigit Kaya) * Build: Enable CodeClimate (fixes [#4068](https://github.com/eslint/eslint/issues/4068)) (Nicholas C. Zakas) * Build: Performance perf to not ignore jshint file (refs [#3765](https://github.com/eslint/eslint/issues/3765)) (Gyandeep Singh) * Build: Add `.eslintignore` file for the project (fixes [#3765](https://github.com/eslint/eslint/issues/3765)) (Gyandeep Singh)
mockee/eslint.github.io
_posts/2015-10-16-eslint-v1.7.0-released.md
Markdown
mit
6,130
[ 30522, 1011, 1011, 1011, 9621, 1024, 2695, 2516, 1024, 9686, 4115, 2102, 1058, 2487, 1012, 1021, 1012, 1014, 2207, 22073, 1024, 1011, 2713, 1011, 3576, 1011, 1011, 1011, 1001, 9686, 4115, 2102, 1058, 2487, 1012, 1021, 1012, 1014, 2207, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.github.douglasorr.shared; import java.util.Set; /** * A set that supports shared updates in place of mutable ones. * Apart from this, it behaves as a normal Java immutable Set. * <p>Instead of using <code>Set.add</code>, use {@link #with(Object)}, and * instead of using <code>Set.remove</code>, use {@link #without(Object)}.</p> */ public interface SharedSet<T> extends Set<T> { /** * Return a new set, with the given value present. * @param value the value to add * @return a new set with the value present (the original set is unchanged), * so <code>set.contains(key) == true</code>. */ SharedSet<T> with(T value); /** * Return a new set, without the given value. * @param value the value to remove * @return a new set without the given value (the original set is unchanged), * so <code>set.contains(key) == false</code>. */ SharedSet<T> without(T value); }
DouglasOrr/SharedCollections
src/main/java/com/github/douglasorr/shared/SharedSet.java
Java
mit
947
[ 30522, 7427, 4012, 1012, 21025, 2705, 12083, 1012, 5203, 2953, 2099, 1012, 4207, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 2275, 1025, 1013, 1008, 1008, 1008, 1037, 2275, 2008, 6753, 4207, 14409, 1999, 2173, 1997, 14163, 10880, 3924, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Gradients for operators defined in linalg_ops.py. Useful reference for derivative formulas is An extended collection of matrix derivative results for forward and reverse mode algorithmic differentiation by Mike Giles: http://eprints.maths.ox.ac.uk/1079/1/NA-08-01.pdf A detailed derivation of formulas for backpropagating through spectral layers (SVD and Eig) by Ionescu, Vantzos & Sminchisescu: https://arxiv.org/pdf/1509.07838v4.pdf """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import control_flow_ops from tensorflow.python.ops import linalg_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops.linalg import linalg_impl as _linalg @ops.RegisterGradient("MatrixInverse") def _MatrixInverseGrad(op, grad): """Gradient for MatrixInverse.""" ainv = op.outputs[0] return -math_ops.matmul( ainv, math_ops.matmul(grad, ainv, adjoint_b=True), adjoint_a=True) @ops.RegisterGradient("MatrixDeterminant") def _MatrixDeterminantGrad(op, grad): """Gradient for MatrixDeterminant.""" a = op.inputs[0] c = op.outputs[0] a_adj_inv = linalg_ops.matrix_inverse(a, adjoint=True) multipliers = array_ops.reshape(grad * c, array_ops.concat([array_ops.shape(c), [1, 1]], 0)) return multipliers * a_adj_inv @ops.RegisterGradient("Cholesky") def _CholeskyGrad(op, grad): """Gradient for Cholesky.""" # Gradient is l^{-H} @ ((l^{H} @ grad) * (tril(ones)-1/2*eye)) @ l^{-1} l = op.outputs[0] num_rows = array_ops.shape(l)[-1] batch_shape = array_ops.shape(l)[:-2] l_inverse = linalg_ops.matrix_triangular_solve(l, linalg_ops.eye( num_rows, batch_shape=batch_shape, dtype=l.dtype)) middle = math_ops.matmul(l, grad, adjoint_a=True) middle = array_ops.matrix_set_diag(middle, 0.5 * array_ops.matrix_diag_part(middle)) middle = array_ops.matrix_band_part(middle, -1, 0) grad_a = math_ops.matmul( math_ops.matmul(l_inverse, middle, adjoint_a=True), l_inverse) grad_a += _linalg.adjoint(grad_a) return grad_a * 0.5 @ops.RegisterGradient("Qr") def _QrGrad(op, dq, dr): """Gradient for Qr.""" q, r = op.outputs if q.dtype.is_complex: raise NotImplementedError("QrGrad not implemented for dtype: %s" % q.dtype) if (r.shape.ndims is None or r.shape.as_list()[-2] is None or r.shape.as_list()[-1] is None): raise NotImplementedError("QrGrad not implemented with dynamic shapes.") if r.shape[-2].value != r.shape[-1].value: raise NotImplementedError("QrGrad not implemented when ncols > nrows " "or full_matrices is true and ncols != nrows.") qdq = math_ops.matmul(q, dq, adjoint_a=True) qdq_ = qdq - _linalg.adjoint(qdq) rdr = math_ops.matmul(r, dr, adjoint_b=True) rdr_ = rdr - _linalg.adjoint(rdr) tril = array_ops.matrix_band_part(qdq_ + rdr_, -1, 0) def _TriangularSolve(x, r): """Equiv to matmul(x, adjoint(matrix_inverse(r))) if r is upper-tri.""" return _linalg.adjoint( linalg_ops.matrix_triangular_solve( r, _linalg.adjoint(x), lower=False, adjoint=False)) grad_a = math_ops.matmul(q, dr + _TriangularSolve(tril, r)) grad_b = _TriangularSolve(dq - math_ops.matmul(q, qdq), r) return grad_a + grad_b @ops.RegisterGradient("MatrixSolve") def _MatrixSolveGrad(op, grad): """Gradient for MatrixSolve.""" a = op.inputs[0] adjoint_a = op.get_attr("adjoint") c = op.outputs[0] grad_b = linalg_ops.matrix_solve(a, grad, adjoint=not adjoint_a) if adjoint_a: grad_a = -math_ops.matmul(c, grad_b, adjoint_b=True) else: grad_a = -math_ops.matmul(grad_b, c, adjoint_b=True) return (grad_a, grad_b) @ops.RegisterGradient("MatrixSolveLs") def _MatrixSolveLsGrad(op, grad): """Gradients for MatrixSolveLs.""" # TODO(rmlarsen): The implementation could be more efficient: # a) Output the Cholesky factorization from forward op instead of # recomputing it here. # b) Implement a symmetric rank-k update op instead of computing # x*z + transpose(x*z). This pattern occurs other places in TensorFlow. def _Overdetermined(op, grad): """Gradients for the overdetermined case of MatrixSolveLs. This is the backprop for the solution to the normal equations of the first kind: X = F(A, B) = (A^T * A + lambda * I)^{-1} * A^T * B which solve the least squares problem min ||A * X - B||_F^2 + lambda ||X||_F^2. """ a = op.inputs[0] b = op.inputs[1] x = op.outputs[0] l2_regularizer = math_ops.cast(op.inputs[2], a.dtype.base_dtype) # pylint: disable=protected-access chol = linalg_ops._RegularizedGramianCholesky( a, l2_regularizer=l2_regularizer, first_kind=True) # pylint: enable=protected-access # Temporary z = (A^T * A + lambda * I)^{-1} * grad. z = linalg_ops.cholesky_solve(chol, grad) xzt = math_ops.matmul(x, z, adjoint_b=True) zx_sym = xzt + array_ops.matrix_transpose(xzt) grad_a = -math_ops.matmul(a, zx_sym) + math_ops.matmul(b, z, adjoint_b=True) grad_b = math_ops.matmul(a, z) return (grad_a, grad_b, None) def _Underdetermined(op, grad): """Gradients for the underdetermined case of MatrixSolveLs. This is the backprop for the solution to the normal equations of the second kind: X = F(A, B) = A * (A*A^T + lambda*I)^{-1} * B that (for lambda=0) solve the least squares problem min ||X||_F subject to A*X = B. """ a = op.inputs[0] b = op.inputs[1] l2_regularizer = math_ops.cast(op.inputs[2], a.dtype.base_dtype) # pylint: disable=protected-access chol = linalg_ops._RegularizedGramianCholesky( a, l2_regularizer=l2_regularizer, first_kind=False) # pylint: enable=protected-access grad_b = linalg_ops.cholesky_solve(chol, math_ops.matmul(a, grad)) # Temporary tmp = (A * A^T + lambda * I)^{-1} * B. tmp = linalg_ops.cholesky_solve(chol, b) a1 = math_ops.matmul(tmp, a, adjoint_a=True) a1 = -math_ops.matmul(grad_b, a1) a2 = grad - math_ops.matmul(a, grad_b, adjoint_a=True) a2 = math_ops.matmul(tmp, a2, adjoint_b=True) grad_a = a1 + a2 return (grad_a, grad_b, None) fast = op.get_attr("fast") if fast is False: raise ValueError("Gradient not defined for fast=False") matrix_shape = op.inputs[0].get_shape()[-2:] if matrix_shape.is_fully_defined(): if matrix_shape[-2] >= matrix_shape[-1]: return _Overdetermined(op, grad) else: return _Underdetermined(op, grad) else: # We have to defer determining the shape to runtime and use # conditional execution of the appropriate graph. matrix_shape = array_ops.shape(op.inputs[0])[-2:] return control_flow_ops.cond(matrix_shape[-2] >= matrix_shape[-1], lambda: _Overdetermined(op, grad), lambda: _Underdetermined(op, grad)) @ops.RegisterGradient("MatrixTriangularSolve") def _MatrixTriangularSolveGrad(op, grad): """Gradient for MatrixTriangularSolve.""" a = op.inputs[0] adjoint_a = op.get_attr("adjoint") lower_a = op.get_attr("lower") c = op.outputs[0] grad_b = linalg_ops.matrix_triangular_solve( a, grad, lower=lower_a, adjoint=not adjoint_a) if adjoint_a: grad_a = -math_ops.matmul(c, grad_b, adjoint_b=True) else: grad_a = -math_ops.matmul(grad_b, c, adjoint_b=True) if lower_a: grad_a = array_ops.matrix_band_part(grad_a, -1, 0) else: grad_a = array_ops.matrix_band_part(grad_a, 0, -1) return (grad_a, grad_b) @ops.RegisterGradient("SelfAdjointEigV2") def _SelfAdjointEigV2Grad(op, grad_e, grad_v): """Gradient for SelfAdjointEigV2.""" e = op.outputs[0] compute_v = op.get_attr("compute_v") # a = op.inputs[0], which satisfies # a[...,:,:] * v[...,:,i] = e[...,i] * v[...,i] with ops.control_dependencies([grad_e, grad_v]): if compute_v: v = op.outputs[1] # Construct the matrix f(i,j) = (i != j ? 1 / (e_i - e_j) : 0). # Notice that because of the term involving f, the gradient becomes # infinite (or NaN in practice) when eigenvalues are not unique. # Mathematically this should not be surprising, since for (k-fold) # degenerate eigenvalues, the corresponding eigenvectors are only defined # up to arbitrary rotation in a (k-dimensional) subspace. f = array_ops.matrix_set_diag( math_ops.reciprocal( array_ops.expand_dims(e, -2) - array_ops.expand_dims(e, -1)), array_ops.zeros_like(e)) grad_a = math_ops.matmul( v, math_ops.matmul( array_ops.matrix_diag(grad_e) + f * math_ops.matmul(v, grad_v, adjoint_a=True), v, adjoint_b=True)) else: _, v = linalg_ops.self_adjoint_eig(op.inputs[0]) grad_a = math_ops.matmul(v, math_ops.matmul( array_ops.matrix_diag(grad_e), v, adjoint_b=True)) # The forward op only depends on the lower triangular part of a, so here we # symmetrize and take the lower triangle grad_a = array_ops.matrix_band_part(grad_a + _linalg.adjoint(grad_a), -1, 0) grad_a = array_ops.matrix_set_diag(grad_a, 0.5 * array_ops.matrix_diag_part(grad_a)) return grad_a @ops.RegisterGradient("Svd") def _SvdGrad(op, grad_s, grad_u, grad_v): """Gradient for the singular value decomposition.""" # The derivation for the compute_uv=False case, and most of # the derivation for the full_matrices=True case, are in # Giles' paper (see reference at top of file). A derivation for # the full_matrices=False case is available at # https://j-towns.github.io/papers/svd-derivative.pdf a = op.inputs[0] a_shape = a.get_shape().with_rank_at_least(2) grad_s_mat = array_ops.matrix_diag(grad_s) if not op.get_attr("compute_uv"): s, u, v = linalg_ops.svd(a, compute_uv=True) grad_a = math_ops.matmul(u, math_ops.matmul(grad_s_mat, v, adjoint_b=True)) grad_a.set_shape(a_shape) return grad_a full_matrices = op.get_attr("full_matrices") # TODO(rmlarsen): Make this work with complex types. if a.dtype.is_complex: raise NotImplementedError( "SVD gradient is not implemented for complex types and " "compute_uv=True.") grad_u_shape = grad_u.get_shape().with_rank_at_least(2) grad_v_shape = grad_v.get_shape().with_rank_at_least(2) m = a_shape[-2].merge_with(grad_u_shape[-2]) n = a_shape[-1].merge_with(grad_v_shape[-2]) batch_shape = a_shape[:-2].merge_with(grad_u_shape[:-2]).merge_with( grad_v_shape[:-2]) a_shape = batch_shape.concatenate([m, n]) m = a_shape[-2].value n = a_shape[-1].value # TODO(rmlarsen): Make this work with placeholders. if m is None or n is None: raise NotImplementedError( "SVD gradient has not been implemented for input with unknown " "inner matrix shape.") s = op.outputs[0] u = op.outputs[1] v = op.outputs[2] use_adjoint = False if m > n: # Compute the gradient for A^H = V * S^T * U^H, and (implicitly) take the # Hermitian transpose of the gradient at the end. use_adjoint = True m, n = n, m u, v = v, u grad_u, grad_v = grad_v, grad_u with ops.control_dependencies([grad_s, grad_u, grad_v]): if full_matrices and abs(m - n) > 1: raise NotImplementedError( "svd gradient is not implemented for abs(m - n) > 1 " "when full_matrices is True") s_mat = array_ops.matrix_diag(s) s2 = math_ops.square(s) # NOTICE: Because of the term involving f, the gradient becomes # infinite (or NaN in practice) when singular values are not unique. # Mathematically this should not be surprising, since for (k-fold) # degenerate singular values, the corresponding singular vectors are # only defined up a (k-dimensional) subspace. In practice, this can # lead to numerical instability when singular values are close but not # exactly equal. f = array_ops.matrix_set_diag( math_ops.reciprocal( array_ops.expand_dims(s2, -2) - array_ops.expand_dims(s2, -1)), array_ops.zeros_like(s)) s_inv_mat = array_ops.matrix_diag(math_ops.reciprocal(s)) v1 = v[..., :, :m] grad_v1 = grad_v[..., :, :m] u_gu = math_ops.matmul(u, grad_u, adjoint_a=True) v_gv = math_ops.matmul(v1, grad_v1, adjoint_a=True) f_u = f * u_gu f_v = f * v_gv term1_nouv = ( grad_s_mat + math_ops.matmul(f_u + _linalg.adjoint(f_u), s_mat) + math_ops.matmul(s_mat, f_v + _linalg.adjoint(f_v))) term1 = math_ops.matmul(u, math_ops.matmul(term1_nouv, v1, adjoint_b=True)) if m == n: grad_a_before_transpose = term1 else: gv1t = array_ops.matrix_transpose(grad_v1) gv1t_v1 = math_ops.matmul(gv1t, v1) term2_nous = gv1t - math_ops.matmul(gv1t_v1, v1, adjoint_b=True) if full_matrices: v2 = v[..., :, m:n] grad_v2 = grad_v[..., :, m:n] v1t_gv2 = math_ops.matmul(v1, grad_v2, adjoint_a=True) term2_nous -= math_ops.matmul(v1t_gv2, v2, adjoint_b=True) u_s_inv = math_ops.matmul(u, s_inv_mat) term2 = math_ops.matmul(u_s_inv, term2_nous) grad_a_before_transpose = term1 + term2 if use_adjoint: grad_a = array_ops.matrix_transpose(grad_a_before_transpose) else: grad_a = grad_a_before_transpose grad_a.set_shape(a_shape) return grad_a
nburn42/tensorflow
tensorflow/python/ops/linalg_grad.py
Python
apache-2.0
14,666
[ 30522, 1001, 9385, 2325, 1996, 23435, 12314, 6048, 1012, 2035, 2916, 9235, 1012, 1001, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1001, 2017, 2089, 2025, 2224, 2023, 5371, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Copyright 2015 CNI authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package invoke import ( "fmt" "os" "path/filepath" ) // FindInPath returns the full path of the plugin by searching in the provided path func FindInPath(plugin string, paths []string) (string, error) { if plugin == "" { return "", fmt.Errorf("no plugin name provided") } if len(paths) == 0 { return "", fmt.Errorf("no paths provided") } var fullpath string for _, path := range paths { full := filepath.Join(path, plugin) if fi, err := os.Stat(full); err == nil && fi.Mode().IsRegular() { fullpath = full break } } if fullpath == "" { return "", fmt.Errorf("failed to find plugin %q in path %s", plugin, paths) } return fullpath, nil }
Crazykev/cri-o
vendor/src/github.com/containernetworking/cni/pkg/invoke/find.go
GO
apache-2.0
1,262
[ 30522, 1013, 1013, 9385, 2325, 27166, 2072, 6048, 1013, 1013, 1013, 1013, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1013, 1013, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
HB.RadioButtonComponent = Ember.Component.extend({ tagName: 'input', type: 'radio', attributeBindings: ['type', 'htmlChecked:checked', 'value', 'name'], htmlChecked: function(){ return this.get('value') === this.get('checked'); }.property('value', 'checked'), change: function(){ this.set('checked', this.get('value')); } });
fractalemagic/hummingbird
app/assets/javascripts/components/radio-button.js
JavaScript
apache-2.0
350
[ 30522, 1044, 2497, 1012, 2557, 8569, 15474, 9006, 29513, 3372, 1027, 7861, 5677, 1012, 6922, 1012, 7949, 1006, 1063, 6415, 18442, 1024, 1005, 7953, 1005, 1010, 2828, 1024, 1005, 2557, 1005, 1010, 17961, 8428, 4667, 2015, 1024, 1031, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package distribution // import "github.com/tiborvass/docker/distribution" import ( "bufio" "compress/gzip" "context" "fmt" "io" "github.com/docker/distribution/reference" "github.com/tiborvass/docker/distribution/metadata" "github.com/tiborvass/docker/pkg/progress" "github.com/tiborvass/docker/registry" "github.com/sirupsen/logrus" ) // Pusher is an interface that abstracts pushing for different API versions. type Pusher interface { // Push tries to push the image configured at the creation of Pusher. // Push returns an error if any, as well as a boolean that determines whether to retry Push on the next configured endpoint. // // TODO(tiborvass): have Push() take a reference to repository + tag, so that the pusher itself is repository-agnostic. Push(ctx context.Context) error } const compressionBufSize = 32768 // NewPusher creates a new Pusher interface that will push to either a v1 or v2 // registry. The endpoint argument contains a Version field that determines // whether a v1 or v2 pusher will be created. The other parameters are passed // through to the underlying pusher implementation for use during the actual // push operation. func NewPusher(ref reference.Named, endpoint registry.APIEndpoint, repoInfo *registry.RepositoryInfo, imagePushConfig *ImagePushConfig) (Pusher, error) { switch endpoint.Version { case registry.APIVersion2: return &v2Pusher{ v2MetadataService: metadata.NewV2MetadataService(imagePushConfig.MetadataStore), ref: ref, endpoint: endpoint, repoInfo: repoInfo, config: imagePushConfig, }, nil case registry.APIVersion1: return nil, fmt.Errorf("protocol version %d no longer supported. Please contact admins of registry %s", endpoint.Version, endpoint.URL) } return nil, fmt.Errorf("unknown version %d for registry %s", endpoint.Version, endpoint.URL) } // Push initiates a push operation on ref. // ref is the specific variant of the image to be pushed. // If no tag is provided, all tags will be pushed. func Push(ctx context.Context, ref reference.Named, imagePushConfig *ImagePushConfig) error { // FIXME: Allow to interrupt current push when new push of same image is done. // Resolve the Repository name from fqn to RepositoryInfo repoInfo, err := imagePushConfig.RegistryService.ResolveRepository(ref) if err != nil { return err } endpoints, err := imagePushConfig.RegistryService.LookupPushEndpoints(reference.Domain(repoInfo.Name)) if err != nil { return err } progress.Messagef(imagePushConfig.ProgressOutput, "", "The push refers to repository [%s]", repoInfo.Name.Name()) associations := imagePushConfig.ReferenceStore.ReferencesByName(repoInfo.Name) if len(associations) == 0 { return fmt.Errorf("An image does not exist locally with the tag: %s", reference.FamiliarName(repoInfo.Name)) } var ( lastErr error // confirmedV2 is set to true if a push attempt managed to // confirm that it was talking to a v2 registry. This will // prevent fallback to the v1 protocol. confirmedV2 bool // confirmedTLSRegistries is a map indicating which registries // are known to be using TLS. There should never be a plaintext // retry for any of these. confirmedTLSRegistries = make(map[string]struct{}) ) for _, endpoint := range endpoints { if imagePushConfig.RequireSchema2 && endpoint.Version == registry.APIVersion1 { continue } if confirmedV2 && endpoint.Version == registry.APIVersion1 { logrus.Debugf("Skipping v1 endpoint %s because v2 registry was detected", endpoint.URL) continue } if endpoint.URL.Scheme != "https" { if _, confirmedTLS := confirmedTLSRegistries[endpoint.URL.Host]; confirmedTLS { logrus.Debugf("Skipping non-TLS endpoint %s for host/port that appears to use TLS", endpoint.URL) continue } } logrus.Debugf("Trying to push %s to %s %s", repoInfo.Name.Name(), endpoint.URL, endpoint.Version) pusher, err := NewPusher(ref, endpoint, repoInfo, imagePushConfig) if err != nil { lastErr = err continue } if err := pusher.Push(ctx); err != nil { // Was this push cancelled? If so, don't try to fall // back. select { case <-ctx.Done(): default: if fallbackErr, ok := err.(fallbackError); ok { confirmedV2 = confirmedV2 || fallbackErr.confirmedV2 if fallbackErr.transportOK && endpoint.URL.Scheme == "https" { confirmedTLSRegistries[endpoint.URL.Host] = struct{}{} } err = fallbackErr.err lastErr = err logrus.Infof("Attempting next endpoint for push after error: %v", err) continue } } logrus.Errorf("Not continuing with push after error: %v", err) return err } imagePushConfig.ImageEventLogger(reference.FamiliarString(ref), reference.FamiliarName(repoInfo.Name), "push") return nil } if lastErr == nil { lastErr = fmt.Errorf("no endpoints found for %s", repoInfo.Name.Name()) } return lastErr } // compress returns an io.ReadCloser which will supply a compressed version of // the provided Reader. The caller must close the ReadCloser after reading the // compressed data. // // Note that this function returns a reader instead of taking a writer as an // argument so that it can be used with httpBlobWriter's ReadFrom method. // Using httpBlobWriter's Write method would send a PATCH request for every // Write call. // // The second return value is a channel that gets closed when the goroutine // is finished. This allows the caller to make sure the goroutine finishes // before it releases any resources connected with the reader that was // passed in. func compress(in io.Reader) (io.ReadCloser, chan struct{}) { compressionDone := make(chan struct{}) pipeReader, pipeWriter := io.Pipe() // Use a bufio.Writer to avoid excessive chunking in HTTP request. bufWriter := bufio.NewWriterSize(pipeWriter, compressionBufSize) compressor := gzip.NewWriter(bufWriter) go func() { _, err := io.Copy(compressor, in) if err == nil { err = compressor.Close() } if err == nil { err = bufWriter.Flush() } if err != nil { pipeWriter.CloseWithError(err) } else { pipeWriter.Close() } close(compressionDone) }() return pipeReader, compressionDone }
tiborvass/docker
distribution/push.go
GO
apache-2.0
6,226
[ 30522, 7427, 4353, 1013, 1013, 12324, 1000, 21025, 2705, 12083, 1012, 4012, 1013, 14841, 12821, 12044, 2015, 1013, 8946, 2121, 1013, 4353, 1000, 12324, 1006, 1000, 20934, 8873, 2080, 1000, 1000, 4012, 20110, 1013, 1043, 5831, 2361, 1000, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/*! * UI development toolkit for HTML5 (OpenUI5) * (c) Copyright 2009-2016 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ // Provides control sap.m.PageAccessibleLandmarkInfo. sap.ui.define(['sap/ui/core/Element', './library'], function(Element, library) { "use strict"; /** * Constructor for a new <code>sap.m.PageAccessibleLandmarkInfo</code> element. * * @param {string} [sId] Id for the new element, generated automatically if no id is given * @param {object} [mSettings] Initial settings for the new element * * @class * Settings for accessible landmarks which can be applied to the container elements of a <code>sap.m.Page</code> control. * These landmarks are e.g. used by assistive technologies (like screenreaders) to provide a meaningful page overview. * @extends sap.ui.core.Element * * @author SAP SE * @version 1.42.8 * * @constructor * @public * @alias sap.m.PageAccessibleLandmarkInfo * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel */ var PageAccessibleLandmarkInfo = Element.extend("sap.m.PageAccessibleLandmarkInfo", /** @lends sap.m.PageAccessibleLandmarkInfo.prototype */ { metadata : { library : "sap.m", properties : { /** * Landmark role of the root container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container. */ rootRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : "Region"}, /** * Texts which describes the landmark of the root container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text * is used. */ rootLabel : {type : "string", defaultValue : null}, /** * Landmark role of the content container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container. */ contentRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : "Main"}, /** * Texts which describes the landmark of the content container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text * is used. */ contentLabel : {type : "string", defaultValue : null}, /** * Landmark role of the header container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container. */ headerRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : "Region"}, /** * Texts which describes the landmark of the header container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text * is used. */ headerLabel : {type : "string", defaultValue : null}, /** * Landmark role of the subheader container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container. */ subHeaderRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : null}, /** * Texts which describes the landmark of the subheader container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text * is used. */ subHeaderLabel : {type : "string", defaultValue : null}, /** * Landmark role of the footer container of the corresponding <code>sap.m.Page</code> control. * * If set to <code>sap.ui.core.AccessibleLandmarkRole.None</code>, no landmark will be added to the container. */ footerRole : {type : "sap.ui.core.AccessibleLandmarkRole", defaultValue : "Region"}, /** * Texts which describes the landmark of the header container of the corresponding <code>sap.m.Page</code> control. * * If not set (and a landmark different than <code>sap.ui.core.AccessibleLandmarkRole.None</code> is defined), a predefined text * is used. */ footerLabel : {type : "string", defaultValue : null} } }}); /** * Returns the landmark information of the given <code>sap.m.PageAccessibleLandmarkInfo</code> instance * of the given area (e.g. <code>"root"</code>). * * Must only be used with the <code>sap.m.Page</code> control! * * @private */ PageAccessibleLandmarkInfo._getLandmarkInfo = function(oInstance, sArea) { if (!oInstance) { return null; } var sRole = null; var sText = null; var oPropertyInfo = oInstance.getMetadata().getProperty(sArea + "Role"); if (oPropertyInfo) { sRole = oInstance[oPropertyInfo._sGetter](); } if (!sRole) { return null; } oPropertyInfo = oInstance.getMetadata().getProperty(sArea + "Label"); if (oPropertyInfo) { sText = oInstance[oPropertyInfo._sGetter](); } return [sRole.toLowerCase(), sText]; }; /** * Writes the landmark information of the given page and area (e.g. <code>"root"</code>). * * Must only be used with the <code>sap.m.Page</code> control! * * @private */ PageAccessibleLandmarkInfo._writeLandmarkInfo = function(oRm, oPage, sArea) { if (!sap.ui.getCore().getConfiguration().getAccessibility()) { return; } var oInfo = PageAccessibleLandmarkInfo._getLandmarkInfo(oPage.getLandmarkInfo(), sArea); if (!oInfo) { return; } var oLandMarks = { role: oInfo[0] }; if (oInfo[1]) { oLandMarks["label"] = oInfo[1]; } oRm.writeAccessibilityState(oPage, oLandMarks); }; return PageAccessibleLandmarkInfo; });
icgretethe/AwarenessApp
resources/sap/m/PageAccessibleLandmarkInfo-dbg.js
JavaScript
apache-2.0
6,098
[ 30522, 1013, 1008, 999, 1008, 21318, 2458, 6994, 23615, 2005, 16129, 2629, 1006, 2330, 10179, 2629, 1007, 1008, 1006, 1039, 1007, 9385, 2268, 1011, 2355, 20066, 7367, 2030, 2019, 20066, 8727, 2194, 1012, 1008, 7000, 2104, 1996, 15895, 6105,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// // AppDelegate.h // ReportChart // // Created by fzhang on 16/3/30. // Copyright © 2016年 fzhang. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
fanstudio/my_oc_libs
FZReportChart/ReportChart/AppDelegate.h
C
apache-2.0
275
[ 30522, 1013, 1013, 1013, 1013, 10439, 9247, 29107, 2618, 1012, 1044, 1013, 1013, 3189, 7507, 5339, 1013, 1013, 1013, 1013, 2580, 2011, 1042, 27922, 5654, 2006, 2385, 1013, 1017, 1013, 2382, 1012, 1013, 1013, 9385, 1075, 2355, 1840, 1042, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"""Voluptuous schemas for the KNX integration.""" import voluptuous as vol from xknx.devices.climate import SetpointShiftMode from homeassistant.const import ( CONF_ADDRESS, CONF_DEVICE_CLASS, CONF_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_PORT, CONF_TYPE, ) import homeassistant.helpers.config_validation as cv from .const import ( CONF_STATE_ADDRESS, CONF_SYNC_STATE, OPERATION_MODES, PRESET_MODES, ColorTempModes, ) class ConnectionSchema: """Voluptuous schema for KNX connection.""" CONF_KNX_LOCAL_IP = "local_ip" TUNNELING_SCHEMA = vol.Schema( { vol.Required(CONF_HOST): cv.string, vol.Optional(CONF_KNX_LOCAL_IP): cv.string, vol.Optional(CONF_PORT): cv.port, } ) ROUTING_SCHEMA = vol.Schema({vol.Optional(CONF_KNX_LOCAL_IP): cv.string}) class CoverSchema: """Voluptuous schema for KNX covers.""" CONF_MOVE_LONG_ADDRESS = "move_long_address" CONF_MOVE_SHORT_ADDRESS = "move_short_address" CONF_STOP_ADDRESS = "stop_address" CONF_POSITION_ADDRESS = "position_address" CONF_POSITION_STATE_ADDRESS = "position_state_address" CONF_ANGLE_ADDRESS = "angle_address" CONF_ANGLE_STATE_ADDRESS = "angle_state_address" CONF_TRAVELLING_TIME_DOWN = "travelling_time_down" CONF_TRAVELLING_TIME_UP = "travelling_time_up" CONF_INVERT_POSITION = "invert_position" CONF_INVERT_ANGLE = "invert_angle" DEFAULT_TRAVEL_TIME = 25 DEFAULT_NAME = "KNX Cover" SCHEMA = vol.Schema( { vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_MOVE_LONG_ADDRESS): cv.string, vol.Optional(CONF_MOVE_SHORT_ADDRESS): cv.string, vol.Optional(CONF_STOP_ADDRESS): cv.string, vol.Optional(CONF_POSITION_ADDRESS): cv.string, vol.Optional(CONF_POSITION_STATE_ADDRESS): cv.string, vol.Optional(CONF_ANGLE_ADDRESS): cv.string, vol.Optional(CONF_ANGLE_STATE_ADDRESS): cv.string, vol.Optional( CONF_TRAVELLING_TIME_DOWN, default=DEFAULT_TRAVEL_TIME ): cv.positive_int, vol.Optional( CONF_TRAVELLING_TIME_UP, default=DEFAULT_TRAVEL_TIME ): cv.positive_int, vol.Optional(CONF_INVERT_POSITION, default=False): cv.boolean, vol.Optional(CONF_INVERT_ANGLE, default=False): cv.boolean, } ) class BinarySensorSchema: """Voluptuous schema for KNX binary sensors.""" CONF_STATE_ADDRESS = CONF_STATE_ADDRESS CONF_SYNC_STATE = CONF_SYNC_STATE CONF_IGNORE_INTERNAL_STATE = "ignore_internal_state" CONF_AUTOMATION = "automation" CONF_HOOK = "hook" CONF_DEFAULT_HOOK = "on" CONF_COUNTER = "counter" CONF_DEFAULT_COUNTER = 1 CONF_ACTION = "action" CONF_RESET_AFTER = "reset_after" DEFAULT_NAME = "KNX Binary Sensor" AUTOMATION_SCHEMA = vol.Schema( { vol.Optional(CONF_HOOK, default=CONF_DEFAULT_HOOK): cv.string, vol.Optional(CONF_COUNTER, default=CONF_DEFAULT_COUNTER): cv.port, vol.Required(CONF_ACTION): cv.SCRIPT_SCHEMA, } ) AUTOMATIONS_SCHEMA = vol.All(cv.ensure_list, [AUTOMATION_SCHEMA]) SCHEMA = vol.All( cv.deprecated("significant_bit"), vol.Schema( { vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_SYNC_STATE, default=True): vol.Any( vol.All(vol.Coerce(int), vol.Range(min=2, max=1440)), cv.boolean, cv.string, ), vol.Optional(CONF_IGNORE_INTERNAL_STATE, default=False): cv.boolean, vol.Required(CONF_STATE_ADDRESS): cv.string, vol.Optional(CONF_DEVICE_CLASS): cv.string, vol.Optional(CONF_RESET_AFTER): cv.positive_int, vol.Optional(CONF_AUTOMATION): AUTOMATIONS_SCHEMA, } ), ) class LightSchema: """Voluptuous schema for KNX lights.""" CONF_STATE_ADDRESS = CONF_STATE_ADDRESS CONF_BRIGHTNESS_ADDRESS = "brightness_address" CONF_BRIGHTNESS_STATE_ADDRESS = "brightness_state_address" CONF_COLOR_ADDRESS = "color_address" CONF_COLOR_STATE_ADDRESS = "color_state_address" CONF_COLOR_TEMP_ADDRESS = "color_temperature_address" CONF_COLOR_TEMP_STATE_ADDRESS = "color_temperature_state_address" CONF_COLOR_TEMP_MODE = "color_temperature_mode" CONF_RGBW_ADDRESS = "rgbw_address" CONF_RGBW_STATE_ADDRESS = "rgbw_state_address" CONF_MIN_KELVIN = "min_kelvin" CONF_MAX_KELVIN = "max_kelvin" DEFAULT_NAME = "KNX Light" DEFAULT_COLOR_TEMP_MODE = "absolute" DEFAULT_MIN_KELVIN = 2700 # 370 mireds DEFAULT_MAX_KELVIN = 6000 # 166 mireds SCHEMA = vol.Schema( { vol.Required(CONF_ADDRESS): cv.string, vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_STATE_ADDRESS): cv.string, vol.Optional(CONF_BRIGHTNESS_ADDRESS): cv.string, vol.Optional(CONF_BRIGHTNESS_STATE_ADDRESS): cv.string, vol.Optional(CONF_COLOR_ADDRESS): cv.string, vol.Optional(CONF_COLOR_STATE_ADDRESS): cv.string, vol.Optional(CONF_COLOR_TEMP_ADDRESS): cv.string, vol.Optional(CONF_COLOR_TEMP_STATE_ADDRESS): cv.string, vol.Optional( CONF_COLOR_TEMP_MODE, default=DEFAULT_COLOR_TEMP_MODE ): cv.enum(ColorTempModes), vol.Optional(CONF_RGBW_ADDRESS): cv.string, vol.Optional(CONF_RGBW_STATE_ADDRESS): cv.string, vol.Optional(CONF_MIN_KELVIN, default=DEFAULT_MIN_KELVIN): vol.All( vol.Coerce(int), vol.Range(min=1) ), vol.Optional(CONF_MAX_KELVIN, default=DEFAULT_MAX_KELVIN): vol.All( vol.Coerce(int), vol.Range(min=1) ), } ) class ClimateSchema: """Voluptuous schema for KNX climate devices.""" CONF_SETPOINT_SHIFT_ADDRESS = "setpoint_shift_address" CONF_SETPOINT_SHIFT_STATE_ADDRESS = "setpoint_shift_state_address" CONF_SETPOINT_SHIFT_MODE = "setpoint_shift_mode" CONF_SETPOINT_SHIFT_MAX = "setpoint_shift_max" CONF_SETPOINT_SHIFT_MIN = "setpoint_shift_min" CONF_TEMPERATURE_ADDRESS = "temperature_address" CONF_TEMPERATURE_STEP = "temperature_step" CONF_TARGET_TEMPERATURE_ADDRESS = "target_temperature_address" CONF_TARGET_TEMPERATURE_STATE_ADDRESS = "target_temperature_state_address" CONF_OPERATION_MODE_ADDRESS = "operation_mode_address" CONF_OPERATION_MODE_STATE_ADDRESS = "operation_mode_state_address" CONF_CONTROLLER_STATUS_ADDRESS = "controller_status_address" CONF_CONTROLLER_STATUS_STATE_ADDRESS = "controller_status_state_address" CONF_CONTROLLER_MODE_ADDRESS = "controller_mode_address" CONF_CONTROLLER_MODE_STATE_ADDRESS = "controller_mode_state_address" CONF_HEAT_COOL_ADDRESS = "heat_cool_address" CONF_HEAT_COOL_STATE_ADDRESS = "heat_cool_state_address" CONF_OPERATION_MODE_FROST_PROTECTION_ADDRESS = ( "operation_mode_frost_protection_address" ) CONF_OPERATION_MODE_NIGHT_ADDRESS = "operation_mode_night_address" CONF_OPERATION_MODE_COMFORT_ADDRESS = "operation_mode_comfort_address" CONF_OPERATION_MODE_STANDBY_ADDRESS = "operation_mode_standby_address" CONF_OPERATION_MODES = "operation_modes" CONF_ON_OFF_ADDRESS = "on_off_address" CONF_ON_OFF_STATE_ADDRESS = "on_off_state_address" CONF_ON_OFF_INVERT = "on_off_invert" CONF_MIN_TEMP = "min_temp" CONF_MAX_TEMP = "max_temp" DEFAULT_NAME = "KNX Climate" DEFAULT_SETPOINT_SHIFT_MODE = "DPT6010" DEFAULT_SETPOINT_SHIFT_MAX = 6 DEFAULT_SETPOINT_SHIFT_MIN = -6 DEFAULT_TEMPERATURE_STEP = 0.1 DEFAULT_ON_OFF_INVERT = False SCHEMA = vol.All( cv.deprecated("setpoint_shift_step", replacement_key=CONF_TEMPERATURE_STEP), vol.Schema( { vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional( CONF_SETPOINT_SHIFT_MODE, default=DEFAULT_SETPOINT_SHIFT_MODE ): cv.enum(SetpointShiftMode), vol.Optional( CONF_SETPOINT_SHIFT_MAX, default=DEFAULT_SETPOINT_SHIFT_MAX ): vol.All(int, vol.Range(min=0, max=32)), vol.Optional( CONF_SETPOINT_SHIFT_MIN, default=DEFAULT_SETPOINT_SHIFT_MIN ): vol.All(int, vol.Range(min=-32, max=0)), vol.Optional( CONF_TEMPERATURE_STEP, default=DEFAULT_TEMPERATURE_STEP ): vol.All(float, vol.Range(min=0, max=2)), vol.Required(CONF_TEMPERATURE_ADDRESS): cv.string, vol.Required(CONF_TARGET_TEMPERATURE_STATE_ADDRESS): cv.string, vol.Optional(CONF_TARGET_TEMPERATURE_ADDRESS): cv.string, vol.Optional(CONF_SETPOINT_SHIFT_ADDRESS): cv.string, vol.Optional(CONF_SETPOINT_SHIFT_STATE_ADDRESS): cv.string, vol.Optional(CONF_OPERATION_MODE_ADDRESS): cv.string, vol.Optional(CONF_OPERATION_MODE_STATE_ADDRESS): cv.string, vol.Optional(CONF_CONTROLLER_STATUS_ADDRESS): cv.string, vol.Optional(CONF_CONTROLLER_STATUS_STATE_ADDRESS): cv.string, vol.Optional(CONF_CONTROLLER_MODE_ADDRESS): cv.string, vol.Optional(CONF_CONTROLLER_MODE_STATE_ADDRESS): cv.string, vol.Optional(CONF_HEAT_COOL_ADDRESS): cv.string, vol.Optional(CONF_HEAT_COOL_STATE_ADDRESS): cv.string, vol.Optional(CONF_OPERATION_MODE_FROST_PROTECTION_ADDRESS): cv.string, vol.Optional(CONF_OPERATION_MODE_NIGHT_ADDRESS): cv.string, vol.Optional(CONF_OPERATION_MODE_COMFORT_ADDRESS): cv.string, vol.Optional(CONF_OPERATION_MODE_STANDBY_ADDRESS): cv.string, vol.Optional(CONF_ON_OFF_ADDRESS): cv.string, vol.Optional(CONF_ON_OFF_STATE_ADDRESS): cv.string, vol.Optional( CONF_ON_OFF_INVERT, default=DEFAULT_ON_OFF_INVERT ): cv.boolean, vol.Optional(CONF_OPERATION_MODES): vol.All( cv.ensure_list, [vol.In({**OPERATION_MODES, **PRESET_MODES})] ), vol.Optional(CONF_MIN_TEMP): vol.Coerce(float), vol.Optional(CONF_MAX_TEMP): vol.Coerce(float), } ), ) class SwitchSchema: """Voluptuous schema for KNX switches.""" CONF_STATE_ADDRESS = CONF_STATE_ADDRESS DEFAULT_NAME = "KNX Switch" SCHEMA = vol.Schema( { vol.Required(CONF_ADDRESS): cv.string, vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_STATE_ADDRESS): cv.string, } ) class ExposeSchema: """Voluptuous schema for KNX exposures.""" CONF_KNX_EXPOSE_TYPE = CONF_TYPE CONF_KNX_EXPOSE_ATTRIBUTE = "attribute" CONF_KNX_EXPOSE_DEFAULT = "default" CONF_KNX_EXPOSE_ADDRESS = CONF_ADDRESS SCHEMA = vol.Schema( { vol.Required(CONF_KNX_EXPOSE_TYPE): vol.Any(int, float, str), vol.Optional(CONF_ENTITY_ID): cv.entity_id, vol.Optional(CONF_KNX_EXPOSE_ATTRIBUTE): cv.string, vol.Optional(CONF_KNX_EXPOSE_DEFAULT): cv.match_all, vol.Required(CONF_KNX_EXPOSE_ADDRESS): cv.string, } ) class NotifySchema: """Voluptuous schema for KNX notifications.""" DEFAULT_NAME = "KNX Notify" SCHEMA = vol.Schema( { vol.Required(CONF_ADDRESS): cv.string, vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, } ) class SensorSchema: """Voluptuous schema for KNX sensors.""" CONF_STATE_ADDRESS = CONF_STATE_ADDRESS CONF_SYNC_STATE = CONF_SYNC_STATE DEFAULT_NAME = "KNX Sensor" SCHEMA = vol.Schema( { vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_SYNC_STATE, default=True): vol.Any( vol.All(vol.Coerce(int), vol.Range(min=2, max=1440)), cv.boolean, cv.string, ), vol.Required(CONF_STATE_ADDRESS): cv.string, vol.Required(CONF_TYPE): vol.Any(int, float, str), } ) class SceneSchema: """Voluptuous schema for KNX scenes.""" CONF_SCENE_NUMBER = "scene_number" DEFAULT_NAME = "KNX SCENE" SCHEMA = vol.Schema( { vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Required(CONF_ADDRESS): cv.string, vol.Required(CONF_SCENE_NUMBER): cv.positive_int, } ) class WeatherSchema: """Voluptuous schema for KNX weather station.""" CONF_SYNC_STATE = CONF_SYNC_STATE CONF_KNX_TEMPERATURE_ADDRESS = "address_temperature" CONF_KNX_BRIGHTNESS_SOUTH_ADDRESS = "address_brightness_south" CONF_KNX_BRIGHTNESS_EAST_ADDRESS = "address_brightness_east" CONF_KNX_BRIGHTNESS_WEST_ADDRESS = "address_brightness_west" CONF_KNX_WIND_SPEED_ADDRESS = "address_wind_speed" CONF_KNX_RAIN_ALARM_ADDRESS = "address_rain_alarm" CONF_KNX_FROST_ALARM_ADDRESS = "address_frost_alarm" CONF_KNX_WIND_ALARM_ADDRESS = "address_wind_alarm" CONF_KNX_DAY_NIGHT_ADDRESS = "address_day_night" CONF_KNX_AIR_PRESSURE_ADDRESS = "address_air_pressure" CONF_KNX_HUMIDITY_ADDRESS = "address_humidity" CONF_KNX_EXPOSE_SENSORS = "expose_sensors" DEFAULT_NAME = "KNX Weather Station" SCHEMA = vol.Schema( { vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_SYNC_STATE, default=True): vol.Any( vol.All(vol.Coerce(int), vol.Range(min=2, max=1440)), cv.boolean, cv.string, ), vol.Optional(CONF_KNX_EXPOSE_SENSORS, default=False): cv.boolean, vol.Required(CONF_KNX_TEMPERATURE_ADDRESS): cv.string, vol.Optional(CONF_KNX_BRIGHTNESS_SOUTH_ADDRESS): cv.string, vol.Optional(CONF_KNX_BRIGHTNESS_EAST_ADDRESS): cv.string, vol.Optional(CONF_KNX_BRIGHTNESS_WEST_ADDRESS): cv.string, vol.Optional(CONF_KNX_WIND_SPEED_ADDRESS): cv.string, vol.Optional(CONF_KNX_RAIN_ALARM_ADDRESS): cv.string, vol.Optional(CONF_KNX_FROST_ALARM_ADDRESS): cv.string, vol.Optional(CONF_KNX_WIND_ALARM_ADDRESS): cv.string, vol.Optional(CONF_KNX_DAY_NIGHT_ADDRESS): cv.string, vol.Optional(CONF_KNX_AIR_PRESSURE_ADDRESS): cv.string, vol.Optional(CONF_KNX_HUMIDITY_ADDRESS): cv.string, } )
tchellomello/home-assistant
homeassistant/components/knx/schema.py
Python
apache-2.0
14,928
[ 30522, 1000, 1000, 1000, 5285, 29441, 8918, 8040, 28433, 2015, 2005, 1996, 14161, 2595, 8346, 1012, 1000, 1000, 1000, 12324, 5285, 29441, 8918, 2004, 5285, 2013, 1060, 2243, 26807, 1012, 5733, 1012, 4785, 12324, 2275, 26521, 4048, 6199, 530...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.in by autoheader. */ /* Whether to build xhprof as dynamic module */ #define COMPILE_DL_XHPROF 1 /* Define to 1 if you have the <dlfcn.h> header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if your C compiler doesn't accept -c and -o together. */ /* #undef NO_MINUS_C_MINUS_O */ /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" /* Define to the version of this package. */ #define PACKAGE_VERSION "" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1
erictj/protean
modules/thirdparty/xhprof/extension/config.h
C
bsd-3-clause
1,655
[ 30522, 1013, 1008, 9530, 8873, 2290, 1012, 1044, 1012, 7013, 2013, 9530, 8873, 2290, 1012, 1044, 1012, 1999, 2011, 9530, 8873, 27390, 2063, 1012, 1008, 1013, 1013, 1008, 9530, 8873, 2290, 1012, 1044, 1012, 1999, 1012, 7013, 2013, 9530, 88...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. """ Tests for swift.common.storage_policies """ import contextlib import six import logging import unittest import os import mock from functools import partial from six.moves.configparser import ConfigParser from tempfile import NamedTemporaryFile from test.unit import patch_policies, FakeRing, temptree, DEFAULT_TEST_EC_TYPE import swift.common.storage_policy from swift.common.storage_policy import ( StoragePolicyCollection, POLICIES, PolicyError, parse_storage_policies, reload_storage_policies, get_policy_string, split_policy_string, BaseStoragePolicy, StoragePolicy, ECStoragePolicy, REPL_POLICY, EC_POLICY, VALID_EC_TYPES, DEFAULT_EC_OBJECT_SEGMENT_SIZE, BindPortsCache) from swift.common.ring import RingData from swift.common.exceptions import RingLoadError from pyeclib.ec_iface import ECDriver class CapturingHandler(logging.Handler): def __init__(self): super(CapturingHandler, self).__init__() self._records = [] def emit(self, record): self._records.append(record) @contextlib.contextmanager def capture_logging(log_name): captured = CapturingHandler() logger = logging.getLogger(log_name) logger.addHandler(captured) try: yield captured._records finally: logger.removeHandler(captured) @BaseStoragePolicy.register('fake') class FakeStoragePolicy(BaseStoragePolicy): """ Test StoragePolicy class - the only user at the moment is test_validate_policies_type_invalid() """ def __init__(self, idx, name='', is_default=False, is_deprecated=False, object_ring=None): super(FakeStoragePolicy, self).__init__( idx, name, is_default, is_deprecated, object_ring) class TestStoragePolicies(unittest.TestCase): def _conf(self, conf_str): conf_str = "\n".join(line.strip() for line in conf_str.split("\n")) if six.PY2: conf = ConfigParser() else: conf = ConfigParser(strict=False) conf.readfp(six.StringIO(conf_str)) return conf def assertRaisesWithMessage(self, exc_class, message, f, *args, **kwargs): try: f(*args, **kwargs) except exc_class as err: err_msg = str(err) self.assertTrue(message in err_msg, 'Error message %r did not ' 'have expected substring %r' % (err_msg, message)) else: self.fail('%r did not raise %s' % (message, exc_class.__name__)) def test_policy_baseclass_instantiate(self): self.assertRaisesWithMessage(TypeError, "Can't instantiate BaseStoragePolicy", BaseStoragePolicy, 1, 'one') @patch_policies([ StoragePolicy(0, 'zero', is_default=True), StoragePolicy(1, 'one'), StoragePolicy(2, 'two'), StoragePolicy(3, 'three', is_deprecated=True), ECStoragePolicy(10, 'ten', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=10, ec_nparity=4), ]) def test_swift_info(self): # the deprecated 'three' should not exist in expect expect = [{'aliases': 'zero', 'default': True, 'name': 'zero', }, {'aliases': 'two', 'name': 'two'}, {'aliases': 'one', 'name': 'one'}, {'aliases': 'ten', 'name': 'ten'}] swift_info = POLICIES.get_policy_info() self.assertEqual(sorted(expect, key=lambda k: k['name']), sorted(swift_info, key=lambda k: k['name'])) @patch_policies def test_get_policy_string(self): self.assertEqual(get_policy_string('something', 0), 'something') self.assertEqual(get_policy_string('something', None), 'something') self.assertEqual(get_policy_string('something', ''), 'something') self.assertEqual(get_policy_string('something', 1), 'something' + '-1') self.assertRaises(PolicyError, get_policy_string, 'something', 99) @patch_policies def test_split_policy_string(self): expectations = { 'something': ('something', POLICIES[0]), 'something-1': ('something', POLICIES[1]), 'tmp': ('tmp', POLICIES[0]), 'objects': ('objects', POLICIES[0]), 'tmp-1': ('tmp', POLICIES[1]), 'objects-1': ('objects', POLICIES[1]), 'objects-': PolicyError, 'objects-0': PolicyError, 'objects--1': ('objects-', POLICIES[1]), 'objects-+1': PolicyError, 'objects--': PolicyError, 'objects-foo': PolicyError, 'objects--bar': PolicyError, 'objects-+bar': PolicyError, # questionable, demonstrated as inverse of get_policy_string 'objects+0': ('objects+0', POLICIES[0]), '': ('', POLICIES[0]), '0': ('0', POLICIES[0]), '-1': ('', POLICIES[1]), } for policy_string, expected in expectations.items(): if expected == PolicyError: try: invalid = split_policy_string(policy_string) except PolicyError: continue # good else: self.fail('The string %r returned %r ' 'instead of raising a PolicyError' % (policy_string, invalid)) self.assertEqual(expected, split_policy_string(policy_string)) # should be inverse of get_policy_string self.assertEqual(policy_string, get_policy_string(*expected)) def test_defaults(self): self.assertGreater(len(POLICIES), 0) # test class functions default_policy = POLICIES.default self.assertTrue(default_policy.is_default) zero_policy = POLICIES.get_by_index(0) self.assertTrue(zero_policy.idx == 0) zero_policy_by_name = POLICIES.get_by_name(zero_policy.name) self.assertTrue(zero_policy_by_name.idx == 0) def test_storage_policy_repr(self): test_policies = [StoragePolicy(0, 'aay', True), StoragePolicy(1, 'bee', False), StoragePolicy(2, 'cee', False), ECStoragePolicy(10, 'ten', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=10, ec_nparity=3), ECStoragePolicy(11, 'eleven', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=10, ec_nparity=3, ec_duplication_factor=2)] policies = StoragePolicyCollection(test_policies) for policy in policies: policy_repr = repr(policy) self.assertTrue(policy.__class__.__name__ in policy_repr) self.assertTrue('is_default=%s' % policy.is_default in policy_repr) self.assertTrue('is_deprecated=%s' % policy.is_deprecated in policy_repr) self.assertTrue(policy.name in policy_repr) if policy.policy_type == EC_POLICY: self.assertTrue('ec_type=%s' % policy.ec_type in policy_repr) self.assertTrue('ec_ndata=%s' % policy.ec_ndata in policy_repr) self.assertTrue('ec_nparity=%s' % policy.ec_nparity in policy_repr) self.assertTrue('ec_segment_size=%s' % policy.ec_segment_size in policy_repr) if policy.ec_duplication_factor > 1: self.assertTrue('ec_duplication_factor=%s' % policy.ec_duplication_factor in policy_repr) collection_repr = repr(policies) collection_repr_lines = collection_repr.splitlines() self.assertTrue( policies.__class__.__name__ in collection_repr_lines[0]) self.assertEqual(len(policies), len(collection_repr_lines[1:-1])) for policy, line in zip(policies, collection_repr_lines[1:-1]): self.assertTrue(repr(policy) in line) with patch_policies(policies): self.assertEqual(repr(POLICIES), collection_repr) def test_validate_policies_defaults(self): # 0 explicit default test_policies = [StoragePolicy(0, 'zero', True), StoragePolicy(1, 'one', False), StoragePolicy(2, 'two', False)] policies = StoragePolicyCollection(test_policies) self.assertEqual(policies.default, test_policies[0]) self.assertEqual(policies.default.name, 'zero') # non-zero explicit default test_policies = [StoragePolicy(0, 'zero', False), StoragePolicy(1, 'one', False), StoragePolicy(2, 'two', True)] policies = StoragePolicyCollection(test_policies) self.assertEqual(policies.default, test_policies[2]) self.assertEqual(policies.default.name, 'two') # multiple defaults test_policies = [StoragePolicy(0, 'zero', False), StoragePolicy(1, 'one', True), StoragePolicy(2, 'two', True)] self.assertRaisesWithMessage( PolicyError, 'Duplicate default', StoragePolicyCollection, test_policies) # nothing specified test_policies = [] policies = StoragePolicyCollection(test_policies) self.assertEqual(policies.default, policies[0]) self.assertEqual(policies.default.name, 'Policy-0') # no default specified with only policy index 0 test_policies = [StoragePolicy(0, 'zero')] policies = StoragePolicyCollection(test_policies) self.assertEqual(policies.default, policies[0]) # no default specified with multiple policies test_policies = [StoragePolicy(0, 'zero', False), StoragePolicy(1, 'one', False), StoragePolicy(2, 'two', False)] self.assertRaisesWithMessage( PolicyError, 'Unable to find default policy', StoragePolicyCollection, test_policies) def test_deprecate_policies(self): # deprecation specified test_policies = [StoragePolicy(0, 'zero', True), StoragePolicy(1, 'one', False), StoragePolicy(2, 'two', False, is_deprecated=True)] policies = StoragePolicyCollection(test_policies) self.assertEqual(policies.default, test_policies[0]) self.assertEqual(policies.default.name, 'zero') self.assertEqual(len(policies), 3) # multiple policies requires default test_policies = [StoragePolicy(0, 'zero', False), StoragePolicy(1, 'one', False, is_deprecated=True), StoragePolicy(2, 'two', False)] self.assertRaisesWithMessage( PolicyError, 'Unable to find default policy', StoragePolicyCollection, test_policies) def test_validate_policies_indexes(self): # duplicate indexes test_policies = [StoragePolicy(0, 'zero', True), StoragePolicy(1, 'one', False), StoragePolicy(1, 'two', False)] self.assertRaises(PolicyError, StoragePolicyCollection, test_policies) def test_validate_policy_params(self): StoragePolicy(0, 'name') # sanity # bogus indexes self.assertRaises(PolicyError, FakeStoragePolicy, 'x', 'name') self.assertRaises(PolicyError, FakeStoragePolicy, -1, 'name') # non-zero Policy-0 self.assertRaisesWithMessage(PolicyError, 'reserved', FakeStoragePolicy, 1, 'policy-0') # deprecate default self.assertRaisesWithMessage( PolicyError, 'Deprecated policy can not be default', FakeStoragePolicy, 1, 'Policy-1', is_default=True, is_deprecated=True) # weird names names = ( '', 'name_foo', 'name\nfoo', 'name foo', u'name \u062a', 'name \xd8\xaa', ) for name in names: self.assertRaisesWithMessage(PolicyError, 'Invalid name', FakeStoragePolicy, 1, name) def test_validate_policies_names(self): # duplicate names test_policies = [StoragePolicy(0, 'zero', True), StoragePolicy(1, 'zero', False), StoragePolicy(2, 'two', False)] self.assertRaises(PolicyError, StoragePolicyCollection, test_policies) def test_validate_policies_type_default(self): # no type specified - make sure the policy is initialized to # DEFAULT_POLICY_TYPE test_policy = FakeStoragePolicy(0, 'zero', True) self.assertEqual(test_policy.policy_type, 'fake') def test_validate_policies_type_invalid(self): class BogusStoragePolicy(FakeStoragePolicy): policy_type = 'bogus' # unsupported policy type - initialization with FakeStoragePolicy self.assertRaisesWithMessage(PolicyError, 'Invalid type', BogusStoragePolicy, 1, 'one') def test_policies_type_attribute(self): test_policies = [ StoragePolicy(0, 'zero', is_default=True), StoragePolicy(1, 'one'), StoragePolicy(2, 'two'), StoragePolicy(3, 'three', is_deprecated=True), ECStoragePolicy(10, 'ten', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=10, ec_nparity=3), ] policies = StoragePolicyCollection(test_policies) self.assertEqual(policies.get_by_index(0).policy_type, REPL_POLICY) self.assertEqual(policies.get_by_index(1).policy_type, REPL_POLICY) self.assertEqual(policies.get_by_index(2).policy_type, REPL_POLICY) self.assertEqual(policies.get_by_index(3).policy_type, REPL_POLICY) self.assertEqual(policies.get_by_index(10).policy_type, EC_POLICY) def test_names_are_normalized(self): test_policies = [StoragePolicy(0, 'zero', True), StoragePolicy(1, 'ZERO', False)] self.assertRaises(PolicyError, StoragePolicyCollection, test_policies) policies = StoragePolicyCollection([StoragePolicy(0, 'zEro', True), StoragePolicy(1, 'One', False)]) pol0 = policies[0] pol1 = policies[1] for name in ('zero', 'ZERO', 'zErO', 'ZeRo'): self.assertEqual(pol0, policies.get_by_name(name)) self.assertEqual(policies.get_by_name(name).name, 'zEro') for name in ('one', 'ONE', 'oNe', 'OnE'): self.assertEqual(pol1, policies.get_by_name(name)) self.assertEqual(policies.get_by_name(name).name, 'One') def test_multiple_names(self): # checking duplicate on insert test_policies = [StoragePolicy(0, 'zero', True), StoragePolicy(1, 'one', False, aliases='zero')] self.assertRaises(PolicyError, StoragePolicyCollection, test_policies) # checking correct retrival using other names test_policies = [StoragePolicy(0, 'zero', True, aliases='cero, kore'), StoragePolicy(1, 'one', False, aliases='uno, tahi'), StoragePolicy(2, 'two', False, aliases='dos, rua')] policies = StoragePolicyCollection(test_policies) for name in ('zero', 'cero', 'kore'): self.assertEqual(policies.get_by_name(name), test_policies[0]) for name in ('two', 'dos', 'rua'): self.assertEqual(policies.get_by_name(name), test_policies[2]) # Testing parsing of conf files/text good_conf = self._conf(""" [storage-policy:0] name = one aliases = uno, tahi default = yes """) policies = parse_storage_policies(good_conf) self.assertEqual(policies.get_by_name('one'), policies[0]) self.assertEqual(policies.get_by_name('one'), policies.get_by_name('tahi')) name_repeat_conf = self._conf(""" [storage-policy:0] name = one aliases = one default = yes """) # Test on line below should not generate errors. Repeat of main # name under aliases is permitted during construction # but only because automated testing requires it. policies = parse_storage_policies(name_repeat_conf) extra_commas_conf = self._conf(""" [storage-policy:0] name = one aliases = ,,one, , default = yes """) # Extra blank entries should be silently dropped policies = parse_storage_policies(extra_commas_conf) bad_conf = self._conf(""" [storage-policy:0] name = one aliases = uno, uno default = yes """) self.assertRaisesWithMessage(PolicyError, 'is already assigned to this policy', parse_storage_policies, bad_conf) def test_multiple_names_EC(self): # checking duplicate names on insert test_policies_ec = [ ECStoragePolicy( 0, 'ec8-2', aliases='zeus, jupiter', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=8, ec_nparity=2, object_ring=FakeRing(replicas=8), is_default=True), ECStoragePolicy( 1, 'ec10-4', aliases='ec8-2', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=10, ec_nparity=4, object_ring=FakeRing(replicas=10))] self.assertRaises(PolicyError, StoragePolicyCollection, test_policies_ec) # checking correct retrival using other names good_test_policies_EC = [ ECStoragePolicy(0, 'ec8-2', aliases='zeus, jupiter', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=8, ec_nparity=2, object_ring=FakeRing(replicas=10), is_default=True), ECStoragePolicy(1, 'ec10-4', aliases='athena, minerva', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=10, ec_nparity=4, object_ring=FakeRing(replicas=14)), ECStoragePolicy(2, 'ec4-2', aliases='poseidon, neptune', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=4, ec_nparity=2, object_ring=FakeRing(replicas=6)), ECStoragePolicy(3, 'ec4-2-dup', aliases='uzuki, rin', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=4, ec_nparity=2, ec_duplication_factor=2, object_ring=FakeRing(replicas=12)), ] ec_policies = StoragePolicyCollection(good_test_policies_EC) for name in ('ec8-2', 'zeus', 'jupiter'): self.assertEqual(ec_policies.get_by_name(name), ec_policies[0]) for name in ('ec10-4', 'athena', 'minerva'): self.assertEqual(ec_policies.get_by_name(name), ec_policies[1]) for name in ('ec4-2', 'poseidon', 'neptune'): self.assertEqual(ec_policies.get_by_name(name), ec_policies[2]) for name in ('ec4-2-dup', 'uzuki', 'rin'): self.assertEqual(ec_policies.get_by_name(name), ec_policies[3]) # Testing parsing of conf files/text good_ec_conf = self._conf(""" [storage-policy:0] name = ec8-2 aliases = zeus, jupiter policy_type = erasure_coding ec_type = %(ec_type)s default = yes ec_num_data_fragments = 8 ec_num_parity_fragments = 2 [storage-policy:1] name = ec10-4 aliases = poseidon, neptune policy_type = erasure_coding ec_type = %(ec_type)s ec_num_data_fragments = 10 ec_num_parity_fragments = 4 [storage-policy:2] name = ec4-2-dup aliases = uzuki, rin policy_type = erasure_coding ec_type = %(ec_type)s ec_num_data_fragments = 4 ec_num_parity_fragments = 2 ec_duplication_factor = 2 """ % {'ec_type': DEFAULT_TEST_EC_TYPE}) ec_policies = parse_storage_policies(good_ec_conf) self.assertEqual(ec_policies.get_by_name('ec8-2'), ec_policies[0]) self.assertEqual(ec_policies.get_by_name('ec10-4'), ec_policies.get_by_name('poseidon')) self.assertEqual(ec_policies.get_by_name('ec4-2-dup'), ec_policies.get_by_name('uzuki')) name_repeat_ec_conf = self._conf(""" [storage-policy:0] name = ec8-2 aliases = ec8-2 policy_type = erasure_coding ec_type = %(ec_type)s default = yes ec_num_data_fragments = 8 ec_num_parity_fragments = 2 """ % {'ec_type': DEFAULT_TEST_EC_TYPE}) # Test on line below should not generate errors. Repeat of main # name under aliases is permitted during construction # but only because automated testing requires it. ec_policies = parse_storage_policies(name_repeat_ec_conf) bad_ec_conf = self._conf(""" [storage-policy:0] name = ec8-2 aliases = zeus, zeus policy_type = erasure_coding ec_type = %(ec_type)s default = yes ec_num_data_fragments = 8 ec_num_parity_fragments = 2 """ % {'ec_type': DEFAULT_TEST_EC_TYPE}) self.assertRaisesWithMessage(PolicyError, 'is already assigned to this policy', parse_storage_policies, bad_ec_conf) def test_add_remove_names(self): test_policies = [StoragePolicy(0, 'zero', True), StoragePolicy(1, 'one', False), StoragePolicy(2, 'two', False)] policies = StoragePolicyCollection(test_policies) # add names policies.add_policy_alias(1, 'tahi') self.assertEqual(policies.get_by_name('tahi'), test_policies[1]) policies.add_policy_alias(2, 'rua', 'dos') self.assertEqual(policies.get_by_name('rua'), test_policies[2]) self.assertEqual(policies.get_by_name('dos'), test_policies[2]) self.assertRaisesWithMessage(PolicyError, 'Invalid name', policies.add_policy_alias, 2, 'double\n') self.assertRaisesWithMessage(PolicyError, 'Invalid name', policies.add_policy_alias, 2, '') # try to add existing name self.assertRaisesWithMessage(PolicyError, 'Duplicate name', policies.add_policy_alias, 2, 'two') self.assertRaisesWithMessage(PolicyError, 'Duplicate name', policies.add_policy_alias, 1, 'two') # remove name policies.remove_policy_alias('tahi') self.assertIsNone(policies.get_by_name('tahi')) # remove only name self.assertRaisesWithMessage(PolicyError, 'Policies must have at least one name.', policies.remove_policy_alias, 'zero') # remove non-existent name self.assertRaisesWithMessage(PolicyError, 'No policy with name', policies.remove_policy_alias, 'three') # remove default name policies.remove_policy_alias('two') self.assertIsNone(policies.get_by_name('two')) self.assertEqual(policies.get_by_index(2).name, 'rua') # change default name to a new name policies.change_policy_primary_name(2, 'two') self.assertEqual(policies.get_by_name('two'), test_policies[2]) self.assertEqual(policies.get_by_index(2).name, 'two') # change default name to an existing alias policies.change_policy_primary_name(2, 'dos') self.assertEqual(policies.get_by_index(2).name, 'dos') # change default name to a bad new name self.assertRaisesWithMessage(PolicyError, 'Invalid name', policies.change_policy_primary_name, 2, 'bad\nname') # change default name to a name belonging to another policy self.assertRaisesWithMessage(PolicyError, 'Other policy', policies.change_policy_primary_name, 1, 'dos') def test_deprecated_default(self): bad_conf = self._conf(""" [storage-policy:1] name = one deprecated = yes default = yes """) self.assertRaisesWithMessage( PolicyError, "Deprecated policy can not be default", parse_storage_policies, bad_conf) def test_multiple_policies_with_no_policy_index_zero(self): bad_conf = self._conf(""" [storage-policy:1] name = one default = yes """) # Policy-0 will not be implicitly added if other policies are defined self.assertRaisesWithMessage( PolicyError, "must specify a storage policy section " "for policy index 0", parse_storage_policies, bad_conf) @mock.patch.object(swift.common.storage_policy, 'VALID_EC_TYPES', ['isa_l_rs_vand', 'isa_l_rs_cauchy']) @mock.patch('swift.common.storage_policy.ECDriver') def test_known_bad_ec_config(self, mock_driver): good_conf = self._conf(""" [storage-policy:0] name = bad-policy policy_type = erasure_coding ec_type = isa_l_rs_cauchy ec_num_data_fragments = 10 ec_num_parity_fragments = 5 """) with capture_logging('swift.common.storage_policy') as records: parse_storage_policies(good_conf) mock_driver.assert_called_once() mock_driver.reset_mock() self.assertFalse([(r.levelname, r.msg) for r in records]) good_conf = self._conf(""" [storage-policy:0] name = bad-policy policy_type = erasure_coding ec_type = isa_l_rs_vand ec_num_data_fragments = 10 ec_num_parity_fragments = 4 """) with capture_logging('swift.common.storage_policy') as records: parse_storage_policies(good_conf) mock_driver.assert_called_once() mock_driver.reset_mock() self.assertFalse([(r.levelname, r.msg) for r in records]) bad_conf = self._conf(""" [storage-policy:0] name = bad-policy policy_type = erasure_coding ec_type = isa_l_rs_vand ec_num_data_fragments = 10 ec_num_parity_fragments = 5 """) with capture_logging('swift.common.storage_policy') as records, \ self.assertRaises(PolicyError) as exc_mgr: parse_storage_policies(bad_conf) self.assertEqual(exc_mgr.exception.args[0], 'Storage policy bad-policy uses an EC ' 'configuration known to harm data durability. This ' 'policy MUST be deprecated.') mock_driver.assert_not_called() mock_driver.reset_mock() self.assertEqual([r.levelname for r in records], ['WARNING']) for msg in ('known to harm data durability', 'Any data in this policy should be migrated', 'https://bugs.launchpad.net/swift/+bug/1639691'): self.assertIn(msg, records[0].msg) slightly_less_bad_conf = self._conf(""" [storage-policy:0] name = bad-policy policy_type = erasure_coding ec_type = isa_l_rs_vand ec_num_data_fragments = 10 ec_num_parity_fragments = 5 deprecated = true [storage-policy:1] name = good-policy policy_type = erasure_coding ec_type = isa_l_rs_cauchy ec_num_data_fragments = 10 ec_num_parity_fragments = 5 default = true """) with capture_logging('swift.common.storage_policy') as records: parse_storage_policies(slightly_less_bad_conf) self.assertEqual(2, mock_driver.call_count) mock_driver.reset_mock() self.assertEqual([r.levelname for r in records], ['WARNING']) for msg in ('known to harm data durability', 'Any data in this policy should be migrated', 'https://bugs.launchpad.net/swift/+bug/1639691'): self.assertIn(msg, records[0].msg) def test_no_default(self): orig_conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:1] name = one default = yes """) policies = parse_storage_policies(orig_conf) self.assertEqual(policies.default, policies[1]) self.assertTrue(policies[0].name, 'Policy-0') bad_conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:1] name = one deprecated = yes """) # multiple polices and no explicit default self.assertRaisesWithMessage( PolicyError, "Unable to find default", parse_storage_policies, bad_conf) good_conf = self._conf(""" [storage-policy:0] name = Policy-0 default = yes [storage-policy:1] name = one deprecated = yes """) policies = parse_storage_policies(good_conf) self.assertEqual(policies.default, policies[0]) self.assertTrue(policies[1].is_deprecated, True) def test_parse_storage_policies(self): # ValueError when deprecating policy 0 bad_conf = self._conf(""" [storage-policy:0] name = zero deprecated = yes [storage-policy:1] name = one deprecated = yes """) self.assertRaisesWithMessage( PolicyError, "Unable to find policy that's not deprecated", parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:] name = zero """) self.assertRaisesWithMessage(PolicyError, 'Invalid index', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:-1] name = zero """) self.assertRaisesWithMessage(PolicyError, 'Invalid index', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:x] name = zero """) self.assertRaisesWithMessage(PolicyError, 'Invalid index', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:x-1] name = zero """) self.assertRaisesWithMessage(PolicyError, 'Invalid index', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:x] name = zero """) self.assertRaisesWithMessage(PolicyError, 'Invalid index', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:x:1] name = zero """) self.assertRaisesWithMessage(PolicyError, 'Invalid index', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:1] name = zero boo = berries """) self.assertRaisesWithMessage(PolicyError, 'Invalid option', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:0] name = """) self.assertRaisesWithMessage(PolicyError, 'Invalid name', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:3] name = Policy-0 """) self.assertRaisesWithMessage(PolicyError, 'Invalid name', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:1] name = policY-0 """) self.assertRaisesWithMessage(PolicyError, 'Invalid name', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:0] name = one [storage-policy:1] name = ONE """) self.assertRaisesWithMessage(PolicyError, 'Duplicate name', parse_storage_policies, bad_conf) bad_conf = self._conf(""" [storage-policy:0] name = good_stuff """) self.assertRaisesWithMessage(PolicyError, 'Invalid name', parse_storage_policies, bad_conf) # policy_type = erasure_coding # missing ec_type, ec_num_data_fragments and ec_num_parity_fragments bad_conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:1] name = ec10-4 policy_type = erasure_coding """) self.assertRaisesWithMessage(PolicyError, 'Missing ec_type', parse_storage_policies, bad_conf) # missing ec_type, but other options valid... bad_conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:1] name = ec10-4 policy_type = erasure_coding ec_num_data_fragments = 10 ec_num_parity_fragments = 4 """) self.assertRaisesWithMessage(PolicyError, 'Missing ec_type', parse_storage_policies, bad_conf) # ec_type specified, but invalid... bad_conf = self._conf(""" [storage-policy:0] name = zero default = yes [storage-policy:1] name = ec10-4 policy_type = erasure_coding ec_type = garbage_alg ec_num_data_fragments = 10 ec_num_parity_fragments = 4 """) self.assertRaisesWithMessage(PolicyError, 'Wrong ec_type garbage_alg for policy ' 'ec10-4, should be one of "%s"' % (', '.join(VALID_EC_TYPES)), parse_storage_policies, bad_conf) # missing and invalid ec_num_parity_fragments bad_conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:1] name = ec10-4 policy_type = erasure_coding ec_type = %(ec_type)s ec_num_data_fragments = 10 """ % {'ec_type': DEFAULT_TEST_EC_TYPE}) self.assertRaisesWithMessage(PolicyError, 'Invalid ec_num_parity_fragments', parse_storage_policies, bad_conf) for num_parity in ('-4', '0', 'x'): bad_conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:1] name = ec10-4 policy_type = erasure_coding ec_type = %(ec_type)s ec_num_data_fragments = 10 ec_num_parity_fragments = %(num_parity)s """ % {'ec_type': DEFAULT_TEST_EC_TYPE, 'num_parity': num_parity}) self.assertRaisesWithMessage(PolicyError, 'Invalid ec_num_parity_fragments', parse_storage_policies, bad_conf) # missing and invalid ec_num_data_fragments bad_conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:1] name = ec10-4 policy_type = erasure_coding ec_type = %(ec_type)s ec_num_parity_fragments = 4 """ % {'ec_type': DEFAULT_TEST_EC_TYPE}) self.assertRaisesWithMessage(PolicyError, 'Invalid ec_num_data_fragments', parse_storage_policies, bad_conf) for num_data in ('-10', '0', 'x'): bad_conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:1] name = ec10-4 policy_type = erasure_coding ec_type = %(ec_type)s ec_num_data_fragments = %(num_data)s ec_num_parity_fragments = 4 """ % {'num_data': num_data, 'ec_type': DEFAULT_TEST_EC_TYPE}) self.assertRaisesWithMessage(PolicyError, 'Invalid ec_num_data_fragments', parse_storage_policies, bad_conf) # invalid ec_object_segment_size for segment_size in ('-4', '0', 'x'): bad_conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:1] name = ec10-4 policy_type = erasure_coding ec_object_segment_size = %(segment_size)s ec_type = %(ec_type)s ec_num_data_fragments = 10 ec_num_parity_fragments = 4 """ % {'segment_size': segment_size, 'ec_type': DEFAULT_TEST_EC_TYPE}) self.assertRaisesWithMessage(PolicyError, 'Invalid ec_object_segment_size', parse_storage_policies, bad_conf) # Additional section added to ensure parser ignores other sections conf = self._conf(""" [some-other-section] foo = bar [storage-policy:0] name = zero [storage-policy:5] name = one default = yes [storage-policy:6] name = duplicate-sections-are-ignored [storage-policy:6] name = apple """) policies = parse_storage_policies(conf) self.assertEqual(True, policies.get_by_index(5).is_default) self.assertEqual(False, policies.get_by_index(0).is_default) self.assertEqual(False, policies.get_by_index(6).is_default) self.assertEqual("object", policies.get_by_name("zero").ring_name) self.assertEqual("object-5", policies.get_by_name("one").ring_name) self.assertEqual("object-6", policies.get_by_name("apple").ring_name) self.assertEqual(0, int(policies.get_by_name('zero'))) self.assertEqual(5, int(policies.get_by_name('one'))) self.assertEqual(6, int(policies.get_by_name('apple'))) self.assertEqual("zero", policies.get_by_index(0).name) self.assertEqual("zero", policies.get_by_index("0").name) self.assertEqual("one", policies.get_by_index(5).name) self.assertEqual("apple", policies.get_by_index(6).name) self.assertEqual("zero", policies.get_by_index(None).name) self.assertEqual("zero", policies.get_by_index('').name) self.assertEqual(policies.get_by_index(0), policies.legacy) def test_reload_invalid_storage_policies(self): conf = self._conf(""" [storage-policy:0] name = zero [storage-policy:00] name = double-zero """) with NamedTemporaryFile(mode='w+t') as f: conf.write(f) f.flush() with mock.patch('swift.common.utils.SWIFT_CONF_FILE', new=f.name): try: reload_storage_policies() except SystemExit as e: err_msg = str(e) else: self.fail('SystemExit not raised') parts = [ 'Invalid Storage Policy Configuration', 'Duplicate index', ] for expected in parts: self.assertTrue( expected in err_msg, '%s was not in %s' % (expected, err_msg)) def test_storage_policy_ordering(self): test_policies = StoragePolicyCollection([ StoragePolicy(0, 'zero', is_default=True), StoragePolicy(503, 'error'), StoragePolicy(204, 'empty'), StoragePolicy(404, 'missing'), ]) self.assertEqual([0, 204, 404, 503], [int(p) for p in sorted(list(test_policies))]) p503 = test_policies[503] self.assertTrue(501 < p503 < 507) def test_get_object_ring(self): test_policies = [StoragePolicy(0, 'aay', True), StoragePolicy(1, 'bee', False), StoragePolicy(2, 'cee', False)] policies = StoragePolicyCollection(test_policies) class NamedFakeRing(FakeRing): def __init__(self, swift_dir, ring_name=None): self.ring_name = ring_name super(NamedFakeRing, self).__init__() with mock.patch('swift.common.storage_policy.Ring', new=NamedFakeRing): for policy in policies: self.assertFalse(policy.object_ring) ring = policies.get_object_ring(int(policy), '/path/not/used') self.assertEqual(ring.ring_name, policy.ring_name) self.assertTrue(policy.object_ring) self.assertTrue(isinstance(policy.object_ring, NamedFakeRing)) def blow_up(*args, **kwargs): raise Exception('kaboom!') with mock.patch('swift.common.storage_policy.Ring', new=blow_up): for policy in policies: policy.load_ring('/path/not/used') expected = policies.get_object_ring(int(policy), '/path/not/used') self.assertEqual(policy.object_ring, expected) # bad policy index self.assertRaises(PolicyError, policies.get_object_ring, 99, '/path/not/used') def test_bind_ports_cache(self): test_policies = [StoragePolicy(0, 'aay', True), StoragePolicy(1, 'bee', False), StoragePolicy(2, 'cee', False)] my_ips = ['1.2.3.4', '2.3.4.5'] other_ips = ['3.4.5.6', '4.5.6.7'] bind_ip = my_ips[1] devs_by_ring_name1 = { 'object': [ # 'aay' {'id': 0, 'zone': 0, 'region': 1, 'ip': my_ips[0], 'port': 6006}, {'id': 0, 'zone': 0, 'region': 1, 'ip': other_ips[0], 'port': 6007}, {'id': 0, 'zone': 0, 'region': 1, 'ip': my_ips[1], 'port': 6008}, None, {'id': 0, 'zone': 0, 'region': 1, 'ip': other_ips[1], 'port': 6009}], 'object-1': [ # 'bee' {'id': 0, 'zone': 0, 'region': 1, 'ip': my_ips[1], 'port': 6006}, # dupe {'id': 0, 'zone': 0, 'region': 1, 'ip': other_ips[0], 'port': 6010}, {'id': 0, 'zone': 0, 'region': 1, 'ip': my_ips[1], 'port': 6011}, {'id': 0, 'zone': 0, 'region': 1, 'ip': other_ips[1], 'port': 6012}], 'object-2': [ # 'cee' {'id': 0, 'zone': 0, 'region': 1, 'ip': my_ips[0], 'port': 6010}, # on our IP and a not-us IP {'id': 0, 'zone': 0, 'region': 1, 'ip': other_ips[0], 'port': 6013}, None, {'id': 0, 'zone': 0, 'region': 1, 'ip': my_ips[1], 'port': 6014}, {'id': 0, 'zone': 0, 'region': 1, 'ip': other_ips[1], 'port': 6015}], } devs_by_ring_name2 = { 'object': [ # 'aay' {'id': 0, 'zone': 0, 'region': 1, 'ip': my_ips[0], 'port': 6016}, {'id': 0, 'zone': 0, 'region': 1, 'ip': other_ips[1], 'port': 6019}], 'object-1': [ # 'bee' {'id': 0, 'zone': 0, 'region': 1, 'ip': my_ips[1], 'port': 6016}, # dupe {'id': 0, 'zone': 0, 'region': 1, 'ip': other_ips[1], 'port': 6022}], 'object-2': [ # 'cee' {'id': 0, 'zone': 0, 'region': 1, 'ip': my_ips[0], 'port': 6020}, {'id': 0, 'zone': 0, 'region': 1, 'ip': other_ips[1], 'port': 6025}], } ring_files = [ring_name + '.ring.gz' for ring_name in sorted(devs_by_ring_name1)] def _fake_load(gz_path, stub_objs, metadata_only=False): return RingData( devs=stub_objs[os.path.basename(gz_path)[:-8]], replica2part2dev_id=[], part_shift=24) with mock.patch( 'swift.common.storage_policy.RingData.load' ) as mock_ld, \ patch_policies(test_policies), \ mock.patch('swift.common.storage_policy.whataremyips') \ as mock_whataremyips, \ temptree(ring_files) as tempdir: mock_whataremyips.return_value = my_ips cache = BindPortsCache(tempdir, bind_ip) self.assertEqual([ mock.call(bind_ip), ], mock_whataremyips.mock_calls) mock_whataremyips.reset_mock() mock_ld.side_effect = partial(_fake_load, stub_objs=devs_by_ring_name1) self.assertEqual(set([ 6006, 6008, 6011, 6010, 6014, ]), cache.all_bind_ports_for_node()) self.assertEqual([ mock.call(os.path.join(tempdir, ring_files[0]), metadata_only=True), mock.call(os.path.join(tempdir, ring_files[1]), metadata_only=True), mock.call(os.path.join(tempdir, ring_files[2]), metadata_only=True), ], mock_ld.mock_calls) mock_ld.reset_mock() mock_ld.side_effect = partial(_fake_load, stub_objs=devs_by_ring_name2) self.assertEqual(set([ 6006, 6008, 6011, 6010, 6014, ]), cache.all_bind_ports_for_node()) self.assertEqual([], mock_ld.mock_calls) # but when all the file mtimes are made different, it'll # reload for gz_file in [os.path.join(tempdir, n) for n in ring_files]: os.utime(gz_file, (88, 88)) self.assertEqual(set([ 6016, 6020, ]), cache.all_bind_ports_for_node()) self.assertEqual([ mock.call(os.path.join(tempdir, ring_files[0]), metadata_only=True), mock.call(os.path.join(tempdir, ring_files[1]), metadata_only=True), mock.call(os.path.join(tempdir, ring_files[2]), metadata_only=True), ], mock_ld.mock_calls) mock_ld.reset_mock() # Don't do something stupid like crash if a ring file is missing. os.unlink(os.path.join(tempdir, 'object-2.ring.gz')) self.assertEqual(set([ 6016, 6020, ]), cache.all_bind_ports_for_node()) self.assertEqual([], mock_ld.mock_calls) # whataremyips() is only called in the constructor self.assertEqual([], mock_whataremyips.mock_calls) def test_singleton_passthrough(self): test_policies = [StoragePolicy(0, 'aay', True), StoragePolicy(1, 'bee', False), StoragePolicy(2, 'cee', False)] with patch_policies(test_policies): for policy in POLICIES: self.assertEqual(POLICIES[int(policy)], policy) def test_quorum_size_replication(self): expected_sizes = {1: 1, 2: 1, 3: 2, 4: 2, 5: 3} for n, expected in expected_sizes.items(): policy = StoragePolicy(0, 'zero', object_ring=FakeRing(replicas=n)) self.assertEqual(policy.quorum, expected) def test_quorum_size_erasure_coding(self): test_ec_policies = [ ECStoragePolicy(10, 'ec8-2', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=8, ec_nparity=2), ECStoragePolicy(11, 'df10-6', ec_type='flat_xor_hd_4', ec_ndata=10, ec_nparity=6), ECStoragePolicy(12, 'ec4-2-dup', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=4, ec_nparity=2, ec_duplication_factor=2), ] for ec_policy in test_ec_policies: k = ec_policy.ec_ndata expected_size = ( (k + ec_policy.pyeclib_driver.min_parity_fragments_needed()) * ec_policy.ec_duplication_factor ) self.assertEqual(expected_size, ec_policy.quorum) def test_validate_ring(self): test_policies = [ ECStoragePolicy(0, 'ec8-2', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=8, ec_nparity=2, is_default=True), ECStoragePolicy(1, 'ec10-4', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=10, ec_nparity=4), ECStoragePolicy(2, 'ec4-2', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=4, ec_nparity=2), ECStoragePolicy(3, 'ec4-2-2dup', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=4, ec_nparity=2, ec_duplication_factor=2) ] policies = StoragePolicyCollection(test_policies) class MockRingData(object): def __init__(self, num_replica): self.replica_count = num_replica def do_test(actual_load_ring_replicas): for policy, ring_replicas in zip(policies, actual_load_ring_replicas): with mock.patch('swift.common.ring.ring.RingData.load', return_value=MockRingData(ring_replicas)): necessary_replica_num = (policy.ec_n_unique_fragments * policy.ec_duplication_factor) with mock.patch( 'swift.common.ring.ring.validate_configuration'): msg = 'EC ring for policy %s needs to be configured ' \ 'with exactly %d replicas.' % \ (policy.name, necessary_replica_num) self.assertRaisesWithMessage(RingLoadError, msg, policy.load_ring, 'mock') # first, do somethign completely different do_test([8, 10, 7, 11]) # then again, closer to true, but fractional do_test([9.9, 14.1, 5.99999, 12.000000001]) def test_storage_policy_get_info(self): test_policies = [ StoragePolicy(0, 'zero', is_default=True), StoragePolicy(1, 'one', is_deprecated=True, aliases='tahi, uno'), ECStoragePolicy(10, 'ten', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=10, ec_nparity=3), ECStoragePolicy(11, 'done', is_deprecated=True, ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=10, ec_nparity=3), ] policies = StoragePolicyCollection(test_policies) expected = { # default replication (0, True): { 'name': 'zero', 'aliases': 'zero', 'default': True, 'deprecated': False, 'policy_type': REPL_POLICY }, (0, False): { 'name': 'zero', 'aliases': 'zero', 'default': True, }, # deprecated replication (1, True): { 'name': 'one', 'aliases': 'one, tahi, uno', 'default': False, 'deprecated': True, 'policy_type': REPL_POLICY }, (1, False): { 'name': 'one', 'aliases': 'one, tahi, uno', 'deprecated': True, }, # enabled ec (10, True): { 'name': 'ten', 'aliases': 'ten', 'default': False, 'deprecated': False, 'policy_type': EC_POLICY, 'ec_type': DEFAULT_TEST_EC_TYPE, 'ec_num_data_fragments': 10, 'ec_num_parity_fragments': 3, 'ec_object_segment_size': DEFAULT_EC_OBJECT_SEGMENT_SIZE, 'ec_duplication_factor': 1, }, (10, False): { 'name': 'ten', 'aliases': 'ten', }, # deprecated ec (11, True): { 'name': 'done', 'aliases': 'done', 'default': False, 'deprecated': True, 'policy_type': EC_POLICY, 'ec_type': DEFAULT_TEST_EC_TYPE, 'ec_num_data_fragments': 10, 'ec_num_parity_fragments': 3, 'ec_object_segment_size': DEFAULT_EC_OBJECT_SEGMENT_SIZE, 'ec_duplication_factor': 1, }, (11, False): { 'name': 'done', 'aliases': 'done', 'deprecated': True, }, # enabled ec with ec_duplication (12, True): { 'name': 'twelve', 'aliases': 'twelve', 'default': False, 'deprecated': False, 'policy_type': EC_POLICY, 'ec_type': DEFAULT_TEST_EC_TYPE, 'ec_num_data_fragments': 10, 'ec_num_parity_fragments': 3, 'ec_object_segment_size': DEFAULT_EC_OBJECT_SEGMENT_SIZE, 'ec_duplication_factor': 2, }, (12, False): { 'name': 'twelve', 'aliases': 'twelve', }, } self.maxDiff = None for policy in policies: expected_info = expected[(int(policy), True)] self.assertEqual(policy.get_info(config=True), expected_info) expected_info = expected[(int(policy), False)] self.assertEqual(policy.get_info(config=False), expected_info) def test_ec_fragment_size_cached(self): policy = ECStoragePolicy( 0, 'ec2-1', ec_type=DEFAULT_TEST_EC_TYPE, ec_ndata=2, ec_nparity=1, object_ring=FakeRing(replicas=3), ec_segment_size=DEFAULT_EC_OBJECT_SEGMENT_SIZE, is_default=True) ec_driver = ECDriver(ec_type=DEFAULT_TEST_EC_TYPE, k=2, m=1) expected_fragment_size = ec_driver.get_segment_info( DEFAULT_EC_OBJECT_SEGMENT_SIZE, DEFAULT_EC_OBJECT_SEGMENT_SIZE)['fragment_size'] with mock.patch.object( policy.pyeclib_driver, 'get_segment_info') as fake: fake.return_value = { 'fragment_size': expected_fragment_size} for x in range(10): self.assertEqual(expected_fragment_size, policy.fragment_size) # pyeclib_driver.get_segment_info is called only once self.assertEqual(1, fake.call_count) if __name__ == '__main__': unittest.main()
matthewoliver/swift
test/unit/common/test_storage_policy.py
Python
apache-2.0
57,607
[ 30522, 1001, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 1001, 2017, 2089, 2025, 2224, 2023, 5371, 3272, 1999, 12646, 2007, 1996, 6105, 1012, 1001, 2017, 2089, 6855, 1037, 6100, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* stringops.c * Date : 26 August 2015 * Author: Ankit Pati */ #include <stdio.h> #include <string.h> /* manual string functions */ int str_len(char s[]) { int len=0; while(s[len]) ++len; return len; } int str_cmp(char s1[], char s2[]) { int i=0, j=0; while(s1[i] && s2[j] && s1[i]==s2[j]) ++i, ++j; return s1[i]-s2[j]; } void str_cat(char s1[], char s2[]) { int i=0, j=0; while(s1[i]) ++i; while((s1[i++]=s2[j++])); } void str_cpy(char des[], char src[]) { int i=0, j=0; while((des[i++]=src[j++])); } /* end of manual string functions */ int main() { char s1[80], s2[80]; int ch, len1, len2; do{ puts("What would you like to do?"); puts(" ( 0) Exit"); puts(" ( 1) Accept Strings\n"); puts("Library Functions"); puts(" ( 2) String Length"); puts(" ( 3) String Compare"); puts(" ( 4) String Concatenate"); puts(" ( 5) String Copy\n"); puts("Manually"); puts(" ( 6) String Length"); puts(" ( 7) String Compare"); puts(" ( 8) String Concatenate"); puts(" ( 9) String Copy"); scanf(" %d%*c", &ch); switch(ch){ case 0: puts("Bye!"); break; case 1: puts("Enter two strings:"); fgets(s1, 80, stdin); /* to avoid the unsafe gets() function */ s1[strlen(s1)-1]='\0'; /* to avoid a quirk of fgets() */ fgets(s2, 80, stdin); s2[strlen(s2)-1]='\0'; break; /* Library Functions */ case 2: len1=strlen(s1); len2=strlen(s2); printf("String 1: %d\nString 2: %d\n", len1, len2); break; case 3: if(!strcmp(s1, s2)) puts("Strings are equal."); else puts("Strings not equal."); break; case 4: strcat(s1, s2); printf("Concatenated String: %s\n", s1); break; case 5: strcpy(s1, s2); printf("String 1: %s\nString 2: %s\n", s1, s2); break; /* end of Library Functions */ /* Manually */ case 6: printf("String 1: %d\nString 2: %d\n", str_len(s1), str_len(s2)); break; case 7: if(!str_cmp(s1, s2)) puts("Strings are equal."); else puts("Strings not equal."); break; case 8: str_cat(s1, s2); printf("Concatenated String: %s\n", s1); break; case 9: str_cpy(s1, s2); printf("String 1: %s\nString 2: %s\n", s1, s2); break; /* end of Manually */ default: puts("Incorrect Choice!"); break; } putchar('\n'); } while(ch); return 0; } /* end of stringops.c */ /* OUTPUT What would you like to do? ( 0) Exit ( 1) Accept Strings Library Functions ( 2) String Length ( 3) String Compare ( 4) String Concatenate ( 5) String Copy Manually ( 6) String Length ( 7) String Compare ( 8) String Concatenate ( 9) String Copy 1 Enter two strings: hello world 2 String 1: 5 String 2: 5 3 Strings not equal. 4 Concatenated String: helloworld 5 String 1: world String 2: world 1 Enter two strings: lorem lorem 6 String 1: 5 String 2: 5 7 Strings are equal. 8 Concatenated String: loremlorem 9 String 1: lorem String 2: lorem 0 Bye! */
ankitpati/fds
main/stringops.c
C
gpl-3.0
3,453
[ 30522, 1013, 1008, 5164, 11923, 1012, 1039, 1008, 3058, 1024, 2656, 2257, 2325, 1008, 3166, 1024, 2019, 23615, 6986, 2072, 1008, 1013, 1001, 2421, 1026, 2358, 20617, 1012, 30524, 1025, 2096, 1006, 1055, 1031, 18798, 1033, 1007, 1009, 1009, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...