text:
EVENT_TYPE(CANCELLED)

// Marks the creation/destruction of a request (net::URLRequest or
// SocketStream).
EVENT_TYPE(REQUEST_ALIVE)

// ------------------------------------------------------------------------
// HostResolverImpl
// ------------------------------------------------------------------------

// The start/end of waiting on a host resolve (DNS) request.
// The BEGIN phase contains the following parameters:
//
//   {
//     "source_dependency": <Source id of the request being waited on>,
//   }
EVENT_TYPE(HOST_RESOLVER_IMPL)

// The start/end of a host resolve (DNS) request.  Note that these events are
// logged for all DNS requests, though not all requests result in the creation
// of a HostResolvedImpl::Request object.
//
// The BEGIN phase contains the following parameters:
//
//   {
//     "host": <Hostname associated with the request>,
//     "source_dependency": <Source id, if any, of what created the request>,
//   }
//
// If an error occurred, the END phase will contain these parameters:
//   {
//     "net_error": <The net error code integer for the failure>,
//     "os_error": <The exact error code integer that getaddrinfo() returned>,
//   }

EVENT_TYPE(HOST_RESOLVER_IMPL_REQUEST)

// This event is logged when a request is handled by a cache entry.
EVENT_TYPE(HOST_RESOLVER_IMPL_CACHE_HIT)

// This event means a request was queued/dequeued for subsequent job creation,
// because there are already too many active HostResolverImpl::Jobs.
//
// The BEGIN phase contains the following parameters:
//
//   {
//     "priority": <Priority of the queued request>,
//   }
EVENT_TYPE(HOST_RESOLVER_IMPL_JOB_POOL_QUEUE)

// This event is created when a new HostResolverImpl::Request is evicted from
// JobPool without a Job being created, because the limit on number of queued
// Requests was reached.
EVENT_TYPE(HOST_RESOLVER_IMPL_JOB_POOL_QUEUE_EVICTED)

// This event is created when a new HostResolverImpl::Job is about to be created
// for a request.
EVENT_TYPE(HOST_RESOLVER_IMPL_CREATE_JOB)

// This is logged for a request when it's attached to a
// HostResolverImpl::Job.  When this occurs without a preceding
// HOST_RESOLVER_IMPL_CREATE_JOB entry, it means the request was attached to an
// existing HostResolverImpl::Job.
//
// If the BoundNetLog used to create the event has a valid source id, the BEGIN
// phase contains the following parameters:
//
//   {
//     "source_dependency": <Source identifier for the attached Job>,
//   }
EVENT_TYPE(HOST_RESOLVER_IMPL_JOB_ATTACH)

// The creation/completion of a host resolve (DNS) job.
// The BEGIN phase contains the following parameters:
//
//   {
//     "host": <Hostname associated with the request>,
//     "source_dependency": <Source id, if any, of what created the request>,
//   }
//
// On success, the END phase has these parameters:
//   {
//     "address_list": <The host name being resolved>,
//   }
// If an error occurred, the END phase will contain these parameters:
//   {
//     "net_error": <The net error code integer for the failure>,
//     "os_error": <The exact error code integer that getaddrinfo() returned>,
//   }
EVENT_TYPE(HOST_RESOLVER_IMPL_JOB)

// ------------------------------------------------------------------------
// InitProxyResolver
// ------------------------------------------------------------------------

// The start/end of auto-detect + custom PAC URL configuration.
EVENT_TYPE(INIT_PROXY_RESOLVER)

// The start/end of when proxy autoconfig was artificially paused following
// a network change event. (We wait some amount of time after being told of
// network changes to avoid hitting spurious errors during auto-detect).
EVENT_TYPE(INIT_PROXY_RESOLVER_WAIT)

// The start/end of download of a PAC script. This could be the well-known
// WPAD URL (if testing auto-detect), or a custom PAC URL.
//
// The START event has the parameters:
//   {
//     "url": <URL string of script being fetched>,
//   }
//
// If the fetch failed, then the END phase has these parameters:
//   {
//      "error_code": <Net error code integer>,
//   }
EVENT_TYPE(INIT_PROXY_RESOLVER_FETCH_PAC_SCRIPT)

// The start/end of the testing of a PAC script (trying to parse the fetched
// file as javascript).
//
// If the parsing of the script failed, the END phase will have parameters:
//   {
//      "error_code": <Net error code integer>,
//   }
EVENT_TYPE(INIT_PROXY_RESOLVER_SET_PAC_SCRIPT)

// This event means that initialization failed because there was no
// configured script fetcher. (This indicates a configuration error).
EVENT_TYPE(INIT_PROXY_RESOLVER_HAS_NO_FETCHER)

// This event is emitted after deciding to fall-back to the next PAC
// script in the list.
EVENT_TYPE(INIT_PROXY_RESOLVER_FALLING_BACK_TO_NEXT_PAC_URL)

// ------------------------------------------------------------------------
// ProxyService
// ------------------------------------------------------------------------

// The start/end of a proxy resolve request.
EVENT_TYPE(PROXY_SERVICE)

// The time while a request is waiting on InitProxyResolver to configure
// against either WPAD or custom PAC URL. The specifics on this time
// are found from ProxyService::init_proxy_resolver_log().
EVENT_TYPE(PROXY_SERVICE_WAITING_FOR_INIT_PAC)

// This event is emitted to show what the PAC script returned. It can contain
// extra parameters that are either:
//   {
//      "pac_string": <List of valid proxy servers, in PAC format>,
//   }
//
//  Or if the the resolver failed:
//   {
//      "net_error": <Net error code that resolver failed with>,
//   }
EVENT_TYPE(PROXY_SERVICE_RESOLVED_PROXY_LIST)

// This event is emitted whenever the proxy settings used by ProxyService
// change.
//
// It contains these parameters:
//  {
//     "old_config": <Dump of the previous proxy settings>,
//     "new_config": <Dump of the new proxy settings>,
//  }
//
// Note that the "old_config" key will be omitted on the first fetch of the
// proxy settings (since there wasn't a previous value).
EVENT_TYPE(PROXY_CONFIG_CHANGED)

// ------------------------------------------------------------------------
// Proxy Resolver
// ------------------------------------------------------------------------

// Measures the time taken to execute the "myIpAddress()" javascript binding.
EVENT_TYPE(PAC_JAVASCRIPT_MY_IP_ADDRESS)

// Measures the time taken to execute the "myIpAddressEx()" javascript binding.
EVENT_TYPE(PAC_JAVASCRIPT_MY_IP_ADDRESS_EX)

// Measures the time taken to execute the "dnsResolve()" javascript binding.
EVENT_TYPE(PAC_JAVASCRIPT_DNS_RESOLVE)

// Measures the time taken to execute the "dnsResolveEx()" javascript binding.
EVENT_TYPE(PAC_JAVASCRIPT_DNS_RESOLVE_EX)

// This event is emitted when a javascript error has been triggered by a
// PAC script. It contains the following event parameters:
//   {
//      "line_number": <The line number in the PAC script
//                      (or -1 if not applicable)>,
//      "message": <The error message>,
//   }
EVENT_TYPE(PAC_JAVASCRIPT_ERROR)

// This event is emitted when a PAC script called alert(). It contains the
// following event parameters:
//   {
//      "message": <The string of the alert>,
//   }
EVENT_TYPE(PAC_JAVASCRIPT_ALERT)

// Measures the time that a proxy resolve request was stalled waiting for a
// proxy resolver thread to free-up.
EVENT_TYPE(WAITING_FOR_PROXY_RESOLVER_THREAD)

// This event is emitted just before a PAC request is bound to a thread. It
// contains these parameters:
//
//   {
//     "thread_number": <Identifier for the PAC thread that is going to
//                       run this request>,
//   }
EVENT_TYPE(SUBMITTED_TO_RESOLVER_THREAD)

// ------------------------------------------------------------------------
// ClientSocket
// ------------------------------------------------------------------------

// The start/end of a TCP connect(). This corresponds with a call to
// TCPClientSocket::Connect().
//
// The START event contains these parameters:
//
//   {
//     "address_list": <List of network address strings>,
//   }
//
// And the END event will contain the following parameters on failure:
//
//   {
//     "net_error": <Net integer error code>,
//   }
EVENT_TYPE(TCP_CONNECT)

// Nested within TCP_CONNECT, there may be multiple attempts to connect
// to the individual addresses. The START event will describe the
// address the attempt is for:
//
//   {
//     "address": <String of the network address>,
//   }
//
// And the END event will contain the system error code if it failed:
//
//   {
//     "os_error": <Integer error code the operating system returned>,
//   }
EVENT_TYPE(TCP_CONNECT_ATTEMPT)

// The start/end of a TCP connect(). This corresponds with a call to
// TCPServerSocket::Accept().
//
// The END event will contain the following parameters on success:
//   {
//     "address": <Remote address of the accepted connection>,
//   }
// On failure it contains the following parameters
//   {
//     "net_error": <Net integer error code>,
//   }
EVENT_TYPE(TCP_ACCEPT)

// Marks the begin/end of a socket (TCP/SOCKS/SSL).
EVENT_TYPE(SOCKET_ALIVE)

// This event is logged to the socket stream whenever the socket is
// acquired/released via a ClientSocketHandle.
//
// The BEGIN phase contains the following parameters:
//
//   {
//     "source_dependency": <Source identifier for the controlling entity>,
//   }
EVENT_TYPE(SOCKET_IN_USE)

// The start/end of a SOCKS connect().
EVENT_TYPE(SOCKS_CONNECT)

// The start/end of a SOCKS5 connect().
EVENT_TYPE(SOCKS5_CONNECT)

// This event is emitted when the SOCKS connect fails because the provided
// was longer than 255 characters.
EVENT_TYPE(SOCKS_HOSTNAME_TOO_BIG)

// These events are emitted when insufficient data was read while
// trying to establish a connection to the SOCKS proxy server
// (during the greeting phase or handshake phase, respectively).
EVENT_TYPE(SOCKS_UNEXPECTEDLY_CLOSED_DURING_GREETING)
EVENT_TYPE(SOCKS_UNEXPECTEDLY_CLOSED_DURING_HANDSHAKE)

// This event indicates that a bad version number was received in the
// proxy server's response. The extra parameters show its value:
//   {
//     "version": <Integer version number in the response>,
//   }
EVENT_TYPE(SOCKS_UNEXPECTED_VERSION)

// This event indicates that the SOCKS proxy server returned an error while
// trying to create a connection. The following parameters will be attached
// to the event:
//   {
//     "error_code": <Integer error code returned by the server>,
//   }
EVENT_TYPE(SOCKS_SERVER_ERROR)

// This event indicates that the SOCKS proxy server asked for an authentication
// method that we don't support. The following parameters are attached to the
// event:
//   {
//     "method": <Integer method code>,
//   }
EVENT_TYPE(SOCKS_UNEXPECTED_AUTH)

// This event indicates that the SOCKS proxy server's response indicated an
// address type which we are not prepared to handle.
// The following parameters are attached to the event:
//   {
//     "address_type": <Integer code for the address type>,
//   }
EVENT_TYPE(SOCKS_UNKNOWN_ADDRESS_TYPE)

// The start/end of a SSL connect().
EVENT_TYPE(SSL_CONNECT)

// The start/end of a SSL accept().
EVENT_TYPE(SSL_ACCEPT)

// An SSL error occurred while trying to do the indicated activity.
// The following parameters are attached to the event:
//   {
//     "net_error": <Integer code for the specific error type>,
//     "ssl_lib_error": <SSL library's integer code for the specific error type>
//   }
EVENT_TYPE(SSL_HANDSHAKE_ERROR)
EVENT_TYPE(SSL_READ_ERROR)
EVENT_TYPE(SSL_WRITE_ERROR)

// An SSL Snap Start was attempted
// The following parameters are attached to the event:
//   {
//     "type": <Integer code for the Snap Start result>,
//   }
EVENT_TYPE(SSL_SNAP_START)

// We found that our prediction of the server's certificates was correct and
// we merged the verification with the SSLHostInfo.
EVENT_TYPE(SSL_VERIFICATION_MERGED)

// An SSL error occurred while calling an NSS function not directly related to
// one of the above activities.  Can also be used when more information than
// is provided by just an error code is needed:
//   {
//     "function": <Name of the NSS function, as a string>,
//     "param": <Most relevant parameter, if any>,
//     "ssl_lib_error": <NSS library's integer code for the specific error type>
//   }
EVENT_TYPE(SSL_NSS_ERROR)

// The specified number of bytes were sent on the socket.
// The following parameters are attached:
//   {
//     "byte_count": <Number of bytes that were just sent>,
//     "hex_encoded_bytes": <The exact bytes sent, as a hexadecimal string.
//                           Only present when byte logging is enabled>,
//   }
EVENT_TYPE(SOCKET_BYTES_SENT)

// The specified number of bytes were received on the socket.
// The following parameters are attached:
//   {
//     "byte_count": <Number of bytes that were just received>,
//     "hex_encoded_bytes": <The exact bytes received, as a hexadecimal string.
//                           Only present when byte logging is enabled>,
//   }
EVENT_TYPE(SOCKET_BYTES_RECEIVED)

// ------------------------------------------------------------------------
// ClientSocketPoolBase::ConnectJob
// ------------------------------------------------------------------------

// The start/end of a ConnectJob.
EVENT_TYPE(SOCKET_POOL_CONNECT_JOB)

// The start/end of the ConnectJob::Connect().
//
// The BEGIN phase has these parameters:
//
//   {
//     "group_name": <The group name for the socket request.>,
//   }
EVENT_TYPE(SOCKET_POOL_CONNECT_JOB_CONNECT)

// This event is logged whenever the ConnectJob gets a new socket
// association. The event parameters point to that socket:
//
//   {
//     "source_dependency": <The source identifier for the new socket.>,
//   }
EVENT_TYPE(CONNECT_JOB_SET_SOCKET)

// Whether the connect job timed out.
EVENT_TYPE(SOCKET_POOL_CONNECT_JOB_TIMED_OUT)

// ------------------------------------------------------------------------
// ClientSocketPoolBaseHelper
// ------------------------------------------------------------------------

// The start/end of a client socket pool request for a socket.
EVENT_TYPE(SOCKET_POOL)

// The request stalled because there are too many sockets in the pool.
EVENT_TYPE(SOCKET_POOL_STALLED_MAX_SOCKETS)

// The request stalled because there are too many sockets in the group.
EVENT_TYPE(SOCKET_POOL_STALLED_MAX_SOCKETS_PER_GROUP)

// Indicates that we reused an existing socket. Attached to the event are
// the parameters:
//   {
//     "idle_ms": <The number of milliseconds the socket was sitting idle for>,
//   }
EVENT_TYPE(SOCKET_POOL_REUSED_AN_EXISTING_SOCKET)

// This event simply describes the host:port that were requested from the
// socket pool. Its parameters are:
//   {
//     "host_and_port": <String encoding the host and port>,
//   }
EVENT_TYPE(TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET)

// This event simply describes the host:port that were requested from the
// socket pool. Its parameters are:
//   {
//     "host_and_port": <String encoding the host and port>,
//   }
EVENT_TYPE(TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS)

// A backup socket is created due to slow connect
EVENT_TYPE(SOCKET_BACKUP_CREATED)

// This event is sent when a connect job is eventually bound to a request
// (because of late binding and socket backup jobs, we don't assign the job to
// a request until it has completed).
//
// The event parameters are:
//   {
//      "source_dependency": <Source identifer for the connect job we are
//                            bound to>,
//   }
EVENT_TYPE(SOCKET_POOL_BOUND_TO_CONNECT_JOB)

// Identifies the NetLog::Source() for the Socket assigned to the pending
// request. The event parameters are:
//   {
//      "source_dependency": <Source identifier for the socket we acquired>,
//   }
EVENT_TYPE(SOCKET_POOL_BOUND_TO_SOCKET)

// The start/end of a client socket pool request for multiple sockets.
// The event parameters are:
//   {
//      "num_sockets": <Number of sockets we're trying to ensure are connected>,
//   }
EVENT_TYPE(SOCKET_POOL_CONNECTING_N_SOCKETS)

// ------------------------------------------------------------------------
// URLRequest
// ------------------------------------------------------------------------

// Measures the time it took a net::URLRequestJob to start. For the most part
// this corresponds with the time between net::URLRequest::Start() and
// net::URLRequest::ResponseStarted(), however it is also repeated for every
// redirect, and every intercepted job that handles the request.
//
// For the BEGIN phase, the following parameters are attached:
//   {
//      "url": <String of URL being loaded>,
//      "method": <The method ("POST" or "GET" or "HEAD" etc..)>,
//      "load_flags": <Numeric value of the combined load flags>,
//   }
//
// For the END phase, if there was an error, the following parameters are
// attached:
//   {
//      "net_error": <Net error code of the failure>,
//   }
EVENT_TYPE(URL_REQUEST_START_JOB)

// This event is sent once a net::URLRequest receives a redirect. The parameters
// attached to the event are:
//   {
//     "location": <The URL that was redirected to>,
//   }
EVENT_TYPE(URL_REQUEST_REDIRECTED)

// Measures the time a net::URLRequest is blocked waiting for an extension to
// respond to the onBefoteRequest extension event.
EVENT_TYPE(URL_REQUEST_BLOCKED_ON_EXTENSION)

// ------------------------------------------------------------------------
// HttpCache
// ------------------------------------------------------------------------

// Measures the time while getting a reference to the back end.
EVENT_TYPE(HTTP_CACHE_GET_BACKEND)

// Measures the time while opening a disk cache entry.
EVENT_TYPE(HTTP_CACHE_OPEN_ENTRY)

// Measures the time while creating a disk cache entry.
EVENT_TYPE(HTTP_CACHE_CREATE_ENTRY)

// Measures the time it takes to add a HttpCache::Transaction to an http cache
// entry's list of active Transactions.
EVENT_TYPE(HTTP_CACHE_ADD_TO_ENTRY)

// Measures the time while deleting a disk cache entry.
EVENT_TYPE(HTTP_CACHE_DOOM_ENTRY)

// Measures the time while reading/writing a disk cache entry's response headers
// or metadata.
EVENT_TYPE(HTTP_CACHE_READ_INFO)
EVENT_TYPE(HTTP_CACHE_WRITE_INFO)

// Measures the time while reading/writing a disk cache entry's body.
EVENT_TYPE(HTTP_CACHE_READ_DATA)
EVENT_TYPE(HTTP_CACHE_WRITE_DATA)

// ------------------------------------------------------------------------
// Disk Cache / Memory Cache
// ------------------------------------------------------------------------

// The creation/destruction of a disk_cache::EntryImpl object.  The "creation"
// is considered to be the point at which an Entry is first considered to be
// good and associated with a key.  Note that disk and memory cache entries
// share event types.
//
// For the BEGIN phase, the following parameters are attached:
//   {
//     "created": <true if the Entry was created, rather than being opened>,
//     "key": <The Entry's key>,
//   }
EVENT_TYPE(DISK_CACHE_ENTRY_IMPL)
EVENT_TYPE(DISK_CACHE_MEM_ENTRY_IMPL)

// Logs the time required to read/write data from/to a cache entry.
//
// For the BEGIN phase, the following parameters are attached:
//   {
//     "index": <Index being read/written>,
//     "offset": <Offset being read/written>,
//     "buf_len": <Length of buffer being read to/written from>,
//     "truncate": <If present for a write, the truncate flag is set to true.
//                  Not present in reads or writes where it is false>,
//   }
//
// For the END phase, the following parameters are attached:
//   {
//     "bytes_copied": <Number of bytes copied.  Not present on error>,
//     "net_error": <Network error code.  Only present on error>,
//   }
EVENT_TYPE(ENTRY_READ_DATA)
EVENT_TYPE(ENTRY_WRITE_DATA)

// Logged when sparse read/write operation starts/stops for an Entry.
//
// For the BEGIN phase, the following parameters are attached:
//   {
//     "offset": <Offset at which to start reading>,
//     "buff_len": <Bytes to read/write>,
//   }
EVENT_TYPE(SPARSE_READ)
EVENT_TYPE(SPARSE_WRITE)

// Logged when a parent Entry starts/stops reading/writing a child Entry's data.
//
// For the BEGIN phase, the following parameters are attached:
//   {
//     "source_dependency": <Source id of the child entry>,
//     "child_len": <Bytes to read/write from/to child>,
//   }
EVENT_TYPE(SPARSE_READ_CHILD_DATA)
EVENT_TYPE(SPARSE_WRITE_CHILD_DATA)

// Logged when sparse GetAvailableRange operation starts/stops for an Entry.
//
// For the BEGIN phase, the following parameters are attached:
//   {
//     "buff_len": <Bytes to read/write>,
//     "offset": <Offset at which to start reading>,
//   }
//
// For the END phase, the following parameters are attached.  No parameters are
// attached when cancelled:
//   {
//     "length": <Length of returned range. Only present on success>,
//     "start": <Position where returned range starts. Only present on success>,
//     "net_error": <Resulting error code. Only present on failure. This may be
//                   "OK" when there's no error, but no available bytes in the
//                   range>,
//   }
EVENT_TYPE(SPARSE_GET_RANGE)

// Indicates the children of a sparse EntryImpl are about to be deleted.
// Not logged for MemEntryImpls.
EVENT_TYPE(SPARSE_DELETE_CHILDREN)

// Logged when an EntryImpl is closed.  Not logged for MemEntryImpls.
EVENT_TYPE(ENTRY_CLOSE)

// Logged when an entry is doomed.
EVENT_TYPE(ENTRY_DOOM)

// ------------------------------------------------------------------------
// HttpStreamFactoryImpl
// ------------------------------------------------------------------------

// Measures the time taken to fulfill the HttpStreamRequest.
EVENT_TYPE(HTTP_STREAM_REQUEST)

// Measures the time taken to execute the HttpStreamFactoryImpl::Job
EVENT_TYPE(HTTP_STREAM_JOB)

// Identifies the NetLog::Source() for the Job that fulfilled the request.
// request. The event parameters are:
//   {
//      "source_dependency": <Source identifier for the job we acquired>,
//   }
EVENT_TYPE(HTTP_STREAM_REQUEST_BOUND_TO_JOB)

// ------------------------------------------------------------------------
// HttpNetworkTransaction
// ------------------------------------------------------------------------

// Measures the time taken to send the tunnel request to the server.
EVENT_TYPE(HTTP_TRANSACTION_TUNNEL_SEND_REQUEST)

// This event is sent for a tunnel request.
// The following parameters are attached:
//   {
//     "line": <The HTTP request line, CRLF terminated>,
//     "headers": <The list of header:value pairs>,
//   }
EVENT_TYPE(HTTP_TRANSACTION_SEND_TUNNEL_HEADERS)

// Measures the time to read the tunnel response headers from the server.
EVENT_TYPE(HTTP_TRANSACTION_TUNNEL_READ_HEADERS)

// This event is sent on receipt of the HTTP response headers to a tunnel
// request.
// The following parameters are attached:
//   {
//     "headers": <The list of header:value pairs>,
//   }
EVENT_TYPE(HTTP_TRANSACTION_READ_TUNNEL_RESPONSE_HEADERS)

// Measures the time taken to send the request to the server.
EVENT_TYPE(HTTP_TRANSACTION_SEND_REQUEST)

// This event is sent for a HTTP request.
// The following parameters are attached:
//   {
//     "line": <The HTTP request line, CRLF terminated>,
//     "headers": <The list of header:value pairs>,
//   }
EVENT_TYPE(HTTP_TRANSACTION_SEND_REQUEST_HEADERS)

// Measures the time to read HTTP response headers from the server.
EVENT_TYPE(HTTP_TRANSACTION_READ_HEADERS)

// This event is sent on receipt of the HTTP response headers.
// The following parameters are attached:
//   {
//     "headers": <The list of header:value pairs>,
//   }
EVENT_TYPE(HTTP_TRANSACTION_READ_RESPONSE_HEADERS)

// Measures the time to read the entity body from the server.
EVENT_TYPE(HTTP_TRANSACTION_READ_BODY)

// Measures the time taken to read the response out of the socket before
// restarting for authentication, on keep alive connections.
EVENT_TYPE(HTTP_TRANSACTION_DRAIN_BODY_FOR_AUTH_RESTART)

// ------------------------------------------------------------------------
// SpdySession
// ------------------------------------------------------------------------

// The start/end of a SpdySession.
//   {
//     "host": <The host-port string>,
//     "proxy": <The Proxy PAC string>,
//   }
EVENT_TYPE(SPDY_SESSION)

// This event is sent for a SPDY SYN_STREAM.
// The following parameters are attached:
//   {
//     "flags": <The control frame flags>,
//     "headers": <The list of header:value pairs>,
//     "id": <The stream id>,
//   }
EVENT_TYPE(SPDY_SESSION_SYN_STREAM)

// This event is sent for a SPDY SYN_STREAM pushed by the server, where a
// net::URLRequest is already waiting for the stream.
// The following parameters are attached:
//   {
//     "flags": <The control frame flags>,
//     "headers": <The list of header:value pairs>,
//     "id": <The stream id>,
//     "associated_stream": <The stream id>,
//   }
EVENT_TYPE(SPDY_SESSION_PUSHED_SYN_STREAM)

// This event is sent for a SPDY HEADERS frame.
// The following parameters are attached:
//   {
//     "flags": <The control frame flags>,
//     "headers": <The list of header:value pairs>,
//     "id": <The stream id>,
//   }
EVENT_TYPE(SPDY_SESSION_HEADERS)

// This event is sent for a SPDY SYN_REPLY.
// The following parameters are attached:
//   {
//     "flags": <The control frame flags>,
//     "headers": <The list of header:value pairs>,
//     "id": <The stream id>,
//   }
EVENT_TYPE(SPDY_SESSION_SYN_REPLY)

// On sending a SPDY SETTINGS frame.
// The following parameters are attached:
//   {
//     "settings": <The list of setting id:value pairs>,
//   }
EVENT_TYPE(SPDY_SESSION_SEND_SETTINGS)

// Receipt of a SPDY SETTINGS frame.
// The following parameters are attached:
//   {
//     "settings": <The list of setting id:value pairs>,
//   }
EVENT_TYPE(SPDY_SESSION_RECV_SETTINGS)

// The receipt of a RST_STREAM
// The following parameters are attached:
//   {
//     "stream_id": <The stream ID for the window update>,
//     "status": <The reason for the RST_STREAM>,
//   }
EVENT_TYPE(SPDY_SESSION_RST_STREAM)

// Sending of a RST_STREAM
// The following parameters are attached:
//   {
//     "stream_id": <The stream ID for the window update>,
//     "status": <The reason for the RST_STREAM>,
//   }
EVENT_TYPE(SPDY_SESSION_SEND_RST_STREAM)

// Sending of a SPDY PING frame.
// The following parameters are attached:
//   {
//     "unique_id": <The unique id of the PING message>,
//   }
EVENT_TYPE(SPDY_SESSION_PING)

// Receipt of a SPDY GOAWAY frame.
// The following parameters are attached:
//   {
//     "last_accepted_stream_id": <Last stream id accepted by the server, duh>,
//     "active_streams":          <Number of active streams>,
//     "unclaimed_streams":       <Number of unclaimed push streams>,
//   }
EVENT_TYPE(SPDY_SESSION_GOAWAY)

// Receipt of a SPDY WINDOW_UPDATE frame (which controls the send window).
//   {
//     "stream_id": <The stream ID for the window update>,
//     "delta"    : <The delta window size>,
//     "new_size" : <The new window size (computed)>,
//   }
EVENT_TYPE(SPDY_SESSION_SEND_WINDOW_UPDATE)

// Sending of a SPDY WINDOW_UPDATE frame (which controls the receive window).
//   {
//     "stream_id": <The stream ID for the window update>,
//     "delta"    : <The delta window size>,
//     "new_size" : <The new window size (computed)>,
//   }
EVENT_TYPE(SPDY_SESSION_RECV_WINDOW_UPDATE)

// Sending a data frame
//   {
//     "stream_id": <The stream ID for the window update>,
//     "length"   : <The size of data sent>,
//     "flags"    : <Send data flags>,
//   }
EVENT_TYPE(SPDY_SESSION_SEND_DATA)

// Receiving a data frame
//   {
//     "stream_id": <The stream ID for the window update>,
//     "length"   : <The size of data sent>,
//     "flags"    : <Send data flags>,
//   }
EVENT_TYPE(SPDY_SESSION_RECV_DATA)

// Logs that a stream is stalled on the send window being closed.
EVENT_TYPE(SPDY_SESSION_STALLED_ON_SEND_WINDOW)

// Session is closing
//   {
//     "status": <The error status of the closure>,
//   }
EVENT_TYPE(SPDY_SESSION_CLOSE)

// Event when the creation of a stream is stalled because we're at
// the maximum number of concurrent streams.
EVENT_TYPE(SPDY_SESSION_STALLED_MAX_STREAMS)

// ------------------------------------------------------------------------
// SpdySessionPool
// ------------------------------------------------------------------------

// This event indicates the pool is reusing an existing session
//   {
//     "id": <The session id>,
//   }
EVENT_TYPE(SPDY_SESSION_POOL_FOUND_EXISTING_SESSION)

// This event indicates the pool is reusing an existing session from an
// IP pooling match.
//   {
//     "id": <The session id>,
//   }
EVENT_TYPE(SPDY_SESSION_POOL_FOUND_EXISTING_SESSION_FROM_IP_POOL)

// This event indicates the pool created a new session
//   {
//     "id": <The session id>,
//   }
EVENT_TYPE(SPDY_SESSION_POOL_CREATED_NEW_SESSION)

// This event indicates that a SSL socket has been upgraded to a SPDY session.
//   {
//     "id": <The session id>,
//   }
EVENT_TYPE(SPDY_SESSION_POOL_IMPORTED_SESSION_FROM_SOCKET)

// This event indicates that the session has been removed.
//   {
//     "id": <The session id>,
//   }
EVENT_TYPE(SPDY_SESSION_POOL_REMOVE_SESSION)

// ------------------------------------------------------------------------
// SpdyStream
// ------------------------------------------------------------------------

// The begin and end of a SPDY STREAM.
EVENT_TYPE(SPDY_STREAM)

// Logs that a stream attached to a pushed stream.
EVENT_TYPE(SPDY_STREAM_ADOPTED_PUSH_STREAM)

// This event indicates that the send window has been updated
//   {
//     "id":         <The stream id>,
//     "delta":      <The window size delta>,
//     "new_window": <The new window size>,
//   }
EVENT_TYPE(SPDY_STREAM_SEND_WINDOW_UPDATE)

// This event indicates that the recv window has been updated
//   {
//     "id":         <The stream id>,
//     "delta":      <The window size delta>,
//     "new_window": <The new window size>,
//   }
EVENT_TYPE(SPDY_STREAM_RECV_WINDOW_UPDATE)

// ------------------------------------------------------------------------
// HttpStreamParser
// ------------------------------------------------------------------------

// Measures the time to read HTTP response headers from the server.
EVENT_TYPE(HTTP_STREAM_PARSER_READ_HEADERS)

// ------------------------------------------------------------------------
// SocketStream
// ------------------------------------------------------------------------

// Measures the time between SocketStream::Connect() and
// SocketStream::DidEstablishConnection()
//
// For the BEGIN phase, the following parameters are attached:
//   {
//      "url": <String of URL being loaded>,
//   }
//
// For the END phase, if there was an error, the following parameters are
// attached:
//   {
//      "net_error": <Net error code of the failure>,
//   }
EVENT_TYPE(SOCKET_STREAM_CONNECT)

// A message sent on the SocketStream.
EVENT_TYPE(SOCKET_STREAM_SENT)

// A message received on the SocketStream.
EVENT_TYPE(SOCKET_STREAM_RECEIVED)

// ------------------------------------------------------------------------
// WebSocketJob
// ------------------------------------------------------------------------

// This event is sent for a WebSocket handshake request.
// The following parameters are attached:
//   {
//     "headers": <handshake request message>,
//   }
EVENT_TYPE(WEB_SOCKET_SEND_REQUEST_HEADERS)

// This event is sent on receipt of the WebSocket handshake response headers.
// The following parameters are attached:
//   {
//     "headers": <handshake response message>,
//   }
EVENT_TYPE(WEB_SOCKET_READ_RESPONSE_HEADERS)

// ------------------------------------------------------------------------
// SOCKS5ClientSocket
// ------------------------------------------------------------------------

// The time spent sending the "greeting" to the SOCKS server.
EVENT_TYPE(SOCKS5_GREET_WRITE)

// The time spent waiting for the "greeting" response from the SOCKS server.
EVENT_TYPE(SOCKS5_GREET_READ)

// The time spent sending the CONNECT request to the SOCKS server.
EVENT_TYPE(SOCKS5_HANDSHAKE_WRITE)

// The time spent waiting for the response to the CONNECT request.
EVENT_TYPE(SOCKS5_HANDSHAKE_READ)

// ------------------------------------------------------------------------
// HTTP Authentication
// ------------------------------------------------------------------------

// The time spent authenticating to the proxy.
EVENT_TYPE(AUTH_PROXY)

// The time spent authentication to the server.
EVENT_TYPE(AUTH_SERVER)

// ------------------------------------------------------------------------
// HTML5 Application Cache
// ------------------------------------------------------------------------

// This event is emitted whenever a request is satistifed directly from
// the appache.
EVENT_TYPE(APPCACHE_DELIVERING_CACHED_RESPONSE)

// This event is emitted whenever the appcache uses a fallback response.
EVENT_TYPE(APPCACHE_DELIVERING_FALLBACK_RESPONSE)

// This event is emitted whenever the appcache generates an error response.
EVENT_TYPE(APPCACHE_DELIVERING_ERROR_RESPONSE)

// ------------------------------------------------------------------------
// Global events
// ------------------------------------------------------------------------
// These are events which are not grouped by source id, as they have no
// context.

// This event is emitted whenever NetworkChangeNotifier determines that the
// underlying network has changed.
EVENT_TYPE(NETWORK_IP_ADDRESSES_CHANGED)


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using Nini.Config;
using OpenMetaverse.Imaging;
using OpenMetaverse.StructuredData;
using OpenSim.Data;
using OpenSim.Framework.Communications.Cache;
using CSJ2K;

// using OpenSim.Region.Framework.Interfaces;

namespace OpenSim.Framework.Communications.Capabilities
{
    public class Caps
    {
        //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        /// <summary>
        /// This is the uuid portion of every CAPS path.  It is used to make capability urls private to the requester.
        /// </summary>
        private string m_capsObjectPath;
        private CapsHandlers m_capsHandlers;
        private IHttpServer m_httpListener;
        private UUID m_agentID;
        private string m_regionName;

        public string CapsObjectPath
        {
            get { return m_capsObjectPath; }
        }

        public string CapsBase
        {
            get { return ("/CAPS/" + CapsObjectPath); }
        }

        public UUID AgentID
        {
            get { return m_agentID; }
        }

        public string RegionName
        {
            get { return m_regionName; }
        }

        public string HostName
        {
            get { return m_httpListener.FullHostName; }
        }

        public uint Port
        {
            get { return m_httpListener.Port; }
        }

        public IHttpServer HttpListener
        {
            get { return m_httpListener; }
        }

        public bool SSLCaps
        {
            get { return m_httpListener.Secure; }
        }

        public CapsHandlers CapsHandlers
        {
            get { return m_capsHandlers; }
        }

        public Caps(IHttpServer httpServer, string capsPath, UUID agent, string regionName)
        {
            m_capsObjectPath = capsPath;
            m_httpListener = httpServer;
            m_agentID = agent;
            m_regionName = regionName;
            m_capsHandlers = new CapsHandlers(httpServer);
        }

        /// <summary>
        /// Register a handler.  This allows modules to register handlers.
        /// </summary>
        /// <param name="capName"></param>
        /// <param name="handler"></param>
        public void RegisterHandler(string capName, IRequestHandler handler)
        {
            m_capsHandlers[capName] = new CapsHandler(capName, handler, false);
            //m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path);
        }

        /// <summary>
        /// Register an external handler. The service for this capability is somewhere else
        /// given by the URL.
        /// </summary>
        /// <param name="capsName"></param>
        /// <param name="url"></param>
        public void RegisterHandler(string capsName, string url)
        {
            m_capsHandlers[capsName] = new CapsHandler(capsName, url, false);
        }

        /// <summary>
        /// Registers an external handler that also can respond to pause and resume commands
        /// </summary>
        /// <param name="capsName"></param>
        /// <param name="url"></param>
        /// <param name="pauseTrafficHandler"></param>
        /// <param name="resumeTrafficHandler"></param>
        public void RegisterHandler(string capsName, string url, Action pauseTrafficHandler,
            Action resumeTrafficHandler, Action<int> setMaxBandwidthHandler)
        {
            var handler = new CapsHandler(capsName, url, true);
            handler.PauseTrafficHandler = pauseTrafficHandler;
            handler.ResumeTrafficHandler = resumeTrafficHandler;
            handler.MaxBandwidthHandler = setMaxBandwidthHandler;

            m_capsHandlers[capsName] = handler;
        }

        /// <summary>
        /// Remove a named caps handler
        /// </summary>
        /// <param name="capsname"></param>
        public void DeregisterHandler(string capsname)
        {
            if (m_capsHandlers.ContainsCap(capsname))
                m_capsHandlers.Remove(capsname);

            //m_log.DebugFormat("[CAPS]: Deregistering handler for {0}", capName);
        }

        /// <summary>
        /// Remove all CAPS service handlers.
        ///
        /// </summary>
        /// <param name="httpListener"></param>
        /// <param name="path"></param>
        /// <param name="restMethod"></param>
        public void DeregisterHandlers()
        {
            if (m_capsHandlers != null)
            {
                foreach (string capsName in m_capsHandlers.Caps)
                {
                    m_capsHandlers.Remove(capsName);
                }
            }
        }

        public void PauseTraffic()
        {
            foreach (string capsName in m_capsHandlers.Caps)
            {
                var handler = m_capsHandlers[capsName];
                handler.PauseTraffic();
            }
        }

        public void ResumeTraffic()
        {
            foreach (string capsName in m_capsHandlers.Caps)
            {
                var handler = m_capsHandlers[capsName];
                handler.ResumeTraffic();
            }
        }

        public void SetMaxBandwidth(int bwMax)
        {
            foreach (string capsName in m_capsHandlers.Caps)
            {
                var handler = m_capsHandlers[capsName];
                handler.SetMaxBandwidth(bwMax);
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.blackboxgaming.engine.factories;

import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.physics.bullet.collision.btBoxShape;
import com.badlogic.gdx.physics.bullet.collision.btCapsuleShape;
import com.badlogic.gdx.physics.bullet.collision.btCollisionShape;
import com.badlogic.gdx.physics.bullet.collision.btCompoundShape;
import com.badlogic.gdx.physics.bullet.collision.btConeShape;
import com.badlogic.gdx.physics.bullet.collision.btConvexHullShape;
import com.badlogic.gdx.physics.bullet.collision.btCylinderShape;
import com.badlogic.gdx.physics.bullet.collision.btSphereShape;
import com.blackboxgaming.engine.util.Global;

/**
 *
 * @author Adrian
 */
public class CollisionShapeFactory {

    public static btBoxShape getCubeShape(float size) {
        return new btBoxShape(new Vector3(0.5f * size, 0.5f * size, 0.5f * size));
    }

    public static btSphereShape getSphereShape(float size) {
        return new btSphereShape(0.5f * size);
    }

    public static btCompoundShape getSphereShape(float size, Vector3 origin) {
        btCompoundShape collistionShape = new btCompoundShape();
        collistionShape.addChildShape(new Matrix4().translate(origin), new btSphereShape(0.5f * size));
        return collistionShape;
    }

    public static btConeShape getConeShape(float size) {
        return new btConeShape(0.5f * size, 2f * size);
    }

    public static btCapsuleShape getCapsuleShape(float size) {
        return new btCapsuleShape(0.5f * size, 1f * size);
    }

    public static btCylinderShape getCylinderShape(float size) {
        return new btCylinderShape(new Vector3(0.5f * size, size, 0.5f * size));
    }

    public static btCylinderShape getCylinderShape(float radius, float length) {
        return new btCylinderShape(new Vector3(radius, 0.5f * length, radius));
    }

    public static btBoxShape getTileShape(float size) {
        return new btBoxShape(new Vector3(0.5f * size, size / 20f, 0.5f * size));
    }

    public static btBoxShape getBoxShape(float width, float height, float depth) {
        return new btBoxShape(new Vector3(0.5f * width, 0.5f * height, 0.5f * depth));
    }

    public static btCompoundShape getBoxShape(float width, float height, float depth, Vector3 origin) {
        btCompoundShape collistionShape = new btCompoundShape();
        collistionShape.addChildShape(new Matrix4().translate(origin), new btBoxShape(new Vector3(0.5f * width, 0.5f * height, 0.5f * depth)));
        return collistionShape;
    }

    public static btCollisionShape getCollisionShape(String shapeName, float size) {
        btCollisionShape shape = null;
        if (shapeName == null) {
            return null;
        }
        switch (shapeName) {
            case "box":
                shape = getCubeShape(size);
                break;
            case "sphere":
                shape = getSphereShape(size);
                break;
            case "cone":
                shape = getConeShape(size);
                break;
            case "capsule":
                shape = getCapsuleShape(size);
                break;
            case "cylinder":
                shape = getCylinderShape(size);
                break;
            case "tile":
                shape = getTileShape(size);
                break;
        }
        return shape;
    }

    public static btCollisionShape getTreeCollisionShape(String treeName) {
        if (treeName == null) {
            return null;
        }
        btCompoundShape collistionShape = new btCompoundShape();
        switch (treeName) {
            case "bigtooth_aspen":
                collistionShape.addChildShape(new Matrix4().translate(0, 5, 0), new btCylinderShape(new Vector3(0.25f, 5, 0.25f)));
                collistionShape.addChildShape(new Matrix4().translate(0, 15, 0), new btSphereShape(5));
                break;
            case "black_spruce":
                collistionShape.addChildShape(new Matrix4().translate(0, 1f, 0), new btCylinderShape(new Vector3(0.175f, 1f, 0.175f)));
                collistionShape.addChildShape(new Matrix4().translate(0, 6, 0), new btConeShape(2.5f, 8));
                break;
            case "river_burch":
                collistionShape.addChildShape(new Matrix4().translate(0, 2f, -0.95f).rotate(new Quaternion(0.000000f, 0.843391f, 0.537300f, 0.000000f)).rotate(Vector3.X, 90), new btCylinderShape(new Vector3(0.25f, 2f, 0.25f)));
                collistionShape.addChildShape(new Matrix4().translate(0.55f, 2f, 0.55f).rotate(new Quaternion(0.079459f, 0.603553f, 0.786566f, 0.103553f)).rotate(Vector3.X, 90), new btCylinderShape(new Vector3(0.25f, 2f, 0.25f)));
                collistionShape.addChildShape(new Matrix4().translate(-0.35f, 2f, 0.55f).rotate(new Quaternion(-0.053057f, 0.606445f, 0.790334f, -0.069145f)).rotate(Vector3.X, 90), new btCylinderShape(new Vector3(0.25f, 2f, 0.25f)));
                collistionShape.addChildShape(new Matrix4().translate(0, 7.5f, -3.5f), new btSphereShape(6f));
                collistionShape.addChildShape(new Matrix4().translate(2, 7.5f, 2f), new btSphereShape(6f));
                collistionShape.addChildShape(new Matrix4().translate(-1.6f, 7.5f, 2f), new btSphereShape(6f));
                break;
        }

        return collistionShape;
    }

    public static btCollisionShape getConcaveShape() {
        float halfWidth = Global.planeRange;
        float halfHeight = 1.25f / 2f;
        float halfDepth = 5;

        float tipLength = (Global.platformLength/2f - Global.planeRange);
        float tipHeight = Global.tipHeight;

        btCompoundShape collistionShape = new btCompoundShape();
        collistionShape.addChildShape(new Matrix4(), CollisionShapeFactory.getBoxShape(halfWidth * 2f, halfHeight * 2f, halfDepth * 2f));
        btConvexHullShape right = new btConvexHullShape();
        right.addPoint(new Vector3(halfWidth, halfHeight, halfDepth));
        right.addPoint(new Vector3(halfWidth + tipLength, halfHeight + tipHeight, halfDepth));
        right.addPoint(new Vector3(halfWidth + tipLength, -halfHeight - tipHeight, halfDepth));
        right.addPoint(new Vector3(halfWidth, -halfHeight, halfDepth));

        right.addPoint(new Vector3(halfWidth, halfHeight, -halfDepth));
        right.addPoint(new Vector3(halfWidth + tipLength, halfHeight + tipHeight, -halfDepth));
        right.addPoint(new Vector3(halfWidth + tipLength, -halfHeight - tipHeight, -halfDepth));
        right.addPoint(new Vector3(halfWidth, -halfHeight, -halfDepth));

        btConvexHullShape left = new btConvexHullShape();
        left.addPoint(new Vector3(-halfWidth, halfHeight, halfDepth));
        left.addPoint(new Vector3(-halfWidth - tipLength, halfHeight + tipHeight, halfDepth));
        left.addPoint(new Vector3(-halfWidth - tipLength, -halfHeight - tipHeight, halfDepth));
        left.addPoint(new Vector3(-halfWidth, -halfHeight, halfDepth));

        left.addPoint(new Vector3(-halfWidth, halfHeight, -halfDepth));
        left.addPoint(new Vector3(-halfWidth - tipLength, halfHeight + tipHeight, -halfDepth));
        left.addPoint(new Vector3(-halfWidth -tipLength, -halfHeight - tipHeight, -halfDepth));
        left.addPoint(new Vector3(-halfWidth, -halfHeight, -halfDepth));

//        btShapeHull f = new btShapeHull(right);
//        float margin = right.getMargin();
//        f.buildHull(margin);
//        btConvexHullShape right2 = new btConvexHullShape(f);

        collistionShape.addChildShape(new Matrix4(), left);
        collistionShape.addChildShape(new Matrix4(), right);

        return collistionShape;
    }

}


text:
Test

    Welcome to the test seciton of this study aid.

    Test yourself with the syllabus by answering all the questions. You won't know how many you have correct until all questions have been answered.

    Select the belts you are studying for.

    Remember that you have to remember all previous belts when grading for your next one.

    Good luck!

Start


text:
using FluentAssertions;
using HealthNet.Integrations.Runners;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute;
using NUnit.Framework;

namespace HealthNet.Integrations
{
  class When_getting_the_health_status_using_a_custom_version_provider<TFixtureRunner>
    : HealthCheckResponseFixturesBase <TFixtureRunner> where TFixtureRunner : IFixtureRunner, new()
  {
    protected override void ConfigureDependencies(IServiceCollection services)
    {
      services.AddTransient(x =>
      {
        var versionProvider = Substitute.For<IVersionProvider>();
        versionProvider.GetSystemVersion().Returns("9.8");
        return versionProvider;
      });
    }

    [Test]
    public void Should_return_version_number_from_custom_version_number_provider()
    {
      RawContent.Should().Contain("\"systemVersion\":\"9.8\"");
    }
  }
}


text:
// Koala - Core - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
/*global IO*/

var Koala = {

  /**
   * Version.
   */
  version: '0.0.1',

  lexers: {},
  formatters: {},

  /**
   * Render _str_ as _type_, with optional _formatter_
   * defaulting to HTML. _str_ should be a filename or
   * extension such as '.js'.
   *
   * @param  {string} type
   * @param  {string} str
   * @param  {Formatter} formatter
   * @return {string}
   * @api public
   */

  render: function(type, str, formatter) {
    var grammar = this.lexers[type];
    formatter = formatter || this.formatters.HTML;

    if (!grammar) throw new Error("syntax highlighting for `" + type + "' is not supported");
    return formatter.render(grammar, str);
  }

};

IO.include('plugins/smartdown/koala/formatter.js');
IO.include('plugins/smartdown/koala/lexer.js');
IO.include('plugins/smartdown/koala/formatters/html.js');
IO.include('plugins/smartdown/koala/grammars/javascript.js');
IO.include('plugins/smartdown/koala/grammars/ruby.js');


text: export { default } from './SequelizePlain'


text:
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({15:[function(require,module,exports){
'use strict';

const constants = require('constants');
const rulesEngine = require('rules-engine');
const settings = require('settings');
const domHelper = require('dom-helper');

// Query filter for getting current tab
const CURRENT_TAB_QUERY_INFO = {
  active: true,
  currentWindow: true
};

/**
 * Current tab info
 */
let currentTab = {
  url: null,
  title: null
};

/**
 * Current bookmark if set
 */
let currentBookmark = null;

/** DOM elements */
let elements = {
  suggestionsContainer: null,
  body: null
};

let helpers = {
  /**
   * Sets pop-up state
   * @param {string} state - State CSS class
   */
  setState(state) {
    $.set(elements.body, {
      className: state
    });
  },

  /**
   * Searches bookmark by URL
   * @param {string} url
   * @return {Promise.<Object>}
   */
  getBookmarkByUrl(url) {
    return new Promise(resolve => {
      chrome.bookmarks.search({ url: url }, treeNodes => {
        resolve(treeNodes[0] || null);
      });
    });
  },

  /**
   * @param {string} folderId
   * @return {Promise.<BookmarkTreeNode>}
   */
  createBookmark(folderId, bookmark) {
    return new Promise(resolve => {
      // Move the bookmark if it was created before
      if (bookmark) {
        chrome.bookmarks.move(bookmark.id, {
          parentId: folderId
        }, resolve);
      } else {
        chrome.bookmarks.create({
          url: currentTab.url,
          title: currentTab.title,
          parentId: folderId,
        }, resolve);
      }
    }).then(newBookmark => {
      // Keep bookmark
      currentBookmark = newBookmark;

      return newBookmark;
    });
  },

  /**
   * Removes previously added bookmark
   * @return {Promise}
   */
  removeBookmark(bookmark) {
    return new Promise(resolve => {
      if (bookmark) {
        chrome.bookmarks.remove(bookmark.id, resolve);
      } else {
        resolve();
      }
    });
  }
};

/**
 * Retrieves current tab
 * @return {Promise.<Tab>}
 */
function getCurrentTab() {
  return new Promise(resolve => {
    chrome.tabs.query(CURRENT_TAB_QUERY_INFO, tabs => resolve(tabs[0]));
  });
}

/** Element generation methods */
let render = {
  /**
   * Matched rules
   * @param {Array.<Rule>} rules
   * @param {BookmarkTreeNode} bookmark
   */
  suggestions(rules, bookmark) {
    if (!rules.length) {
      helpers.setState('no-match');

      return;
    }

    let documentFragment = document.createDocumentFragment();
    let bookmarkFolderId = bookmark ? bookmark.parentId : null;

    let lastRuleIndex = rules.length - 1;

    rules.forEach((rule, index) => {
      let isSelected = bookmarkFolderId === rule.folder.id;

      let folderIcon = domHelper.create.icon({
        id: constants.icons.folder,
        className: 'mdc-list-item__start-detail'
      });

      let folder = {
        tag: 'span',
        className: 'mdc-list-item__text',
        contents: [{
          tag: 'span',
          className: 'folder-name',
          textContent: rule.folder.title,
          title: rule.folder.title
        }, {
          tag: 'span',
          className: 'folder-name mdc-list-item__text__secondary mdc-theme--text-hint-on-background',
          textContent: rule.folder.path,
          title: rule.folder.path
        }]
      };

      let bookmarkIcon = {
        tag: 'span',
        className: 'mdc-list-item__end-detail',
        contents: [
          domHelper.create.icon({
            id: constants.icons.starBorder,
            className: 'bookmark-icon'
          }),
          domHelper.create.icon({
            id: constants.icons.star,
            className: 'bookmark-icon-selected'
          })
        ]
      };

      let row = $.create('li', {
        className: `mdc-list-item suggestion-row js-suggestion-row ${isSelected ? 'is-selected' : ''}`,
        'data-folder-id': rule.folder.id,
        contents: [
          folderIcon,
          folder,
          bookmarkIcon
        ]
      });

      documentFragment.appendChild(row);

      if (lastRuleIndex !== index) {
        documentFragment.appendChild($.create('li', {
          className: 'mdc-list-divider',
          role: 'separator'
        }));
      }
    });

    elements.suggestionsContainer.appendChild(documentFragment);

    helpers.setState('has-match');
  }
};

let actions = {
  /**
   * Creates a bookmark inside selected folder for current tab
   * @param {Event} event
   * @param {BookmarkTreeNode} bookmark
   */
  bookmarkSuggestion(event, bookmark) {
    let row = event.target.closest('.js-suggestion-row');
    let folderId = row.dataset.folderId;

    if (row.classList.contains('is-selected')) {
      helpers.removeBookmark(currentBookmark)
        .then(() => {
          row.classList.remove('is-selected');
          currentBookmark = null;
        });
    } else {
      helpers.createBookmark(folderId, bookmark)
        .then(() => {
          // Clear selection
          $$('.js-suggestion-row', elements.suggestionsContainer)
            .forEach(row => row.classList.remove('is-selected'));

          row.classList.add('is-selected');
        });
    }
  },

  /**
   * Adds rule using current tab's data
   * @param {BookmarkTreeNode} bookmark
   */
  addRule(bookmark) {
    let message = { currentTab };

    if (bookmark) {
      message.bookmarkFolder = { id: bookmark.parentId };
    }

    /*
      There are two cases:
      1. Options page isn't open - add a rule during initialization
      2. Options page is open - add a rule on message receiving
    */
    settings.setRuleSuggestData(message).then(() => {
      // Callback won't work here because pop-up is closed
      chrome.runtime.openOptionsPage();

      // Send message to options page. Works only if page is already opened
      chrome.runtime.sendMessage({ addSuggestedRule: true });
    });
  }
};

$.ready().then(() => {
  elements.suggestionsContainer = document.getElementById('suggestions');
  elements.body = document.body;

  let addRuleLink = document.getElementById('add-rule-button');
  addRuleLink.addEventListener('click', () => actions.addRule(currentBookmark));

  $.delegate(elements.suggestionsContainer,
             'click',
             '.js-suggestion-row',
             (event) => actions.bookmarkSuggestion(event, currentBookmark));

  getCurrentTab().then(tab => {
    // Keep current tab info
    currentTab = tab;

    Promise.all([
      rulesEngine.match({ url: tab.url, title: tab.title }),
      helpers.getBookmarkByUrl(tab.url),
      settings.get('autoBookmark')
    ]).then(([rules, bookmark, { autoBookmark: autoBookmark }]) => {
      // Keep current page bookmark
      currentBookmark = bookmark;

      // Auto Bookmark first suggestion
      if (rules.length && !bookmark && autoBookmark) {
        helpers.createBookmark(rules[0].folder.id, bookmark)
          .then((newBookmark) => {
            render.suggestions(rules, newBookmark);
          });
      } else {
        render.suggestions(rules, bookmark);
      }
    });
  });
});

},{"constants":7,"dom-helper":8,"rules-engine":10,"settings":11}]},{},[15]);


text:
define([
    "exports", "lodash", "dojo/_base/lang",
    "dojo/io-query"
],
function (exports, _, lang, ioQuery) {

    var cachedContext = undefined;

    /**
     * Methods for working with the context. Context allows working with independent sets of data in the same browser.
     * Set the context by setting a 'ctx' URL parameter.
     */
    lang.mixin(exports, {

        /**
         * Get the current context
         * @returns {string}
         */
        getContext: function() {
            if (_.isUndefined(cachedContext)) {
                cachedContext = null;

                var query = location.search;
                if (query) {
                    query = query.substring(1);
                }
                if (query) {
                    var queryObject = ioQuery.queryToObject(query);
                    cachedContext = queryObject.ctx || null;
                }
            }

            return cachedContext;
        },

        /**
         * Set the current context
         * @param {string} context
         */
        setContext: function(context) {
            if (context) {
                location.search = ioQuery.objectToQuery({ctx: context});
            } else {
                location.search = "";
            }
        }
    });
});


text:
require 'rack/response'
require 'stringio'

describe Rack::Response do
  should "have sensible default values" do
    response = Rack::Response.new
    status, header, body = response.finish
    status.should.equal 200
    header.should.equal({})
    body.each { |part|
      part.should.equal ""
    }

    response = Rack::Response.new
    status, header, body = *response
    status.should.equal 200
    header.should.equal({})
    body.each { |part|
      part.should.equal ""
    }
  end

  it "can be written to" do
    response = Rack::Response.new

    _, _, body = response.finish do
      response.write "foo"
      response.write "bar"
      response.write "baz"
    end

    parts = []
    body.each { |part| parts << part }

    parts.should.equal ["foo", "bar", "baz"]
  end

  it "can set and read headers" do
    response = Rack::Response.new
    response["Content-Type"].should.equal nil
    response["Content-Type"] = "text/plain"
    response["Content-Type"].should.equal "text/plain"
  end

  it "can override the initial Content-Type with a different case" do
    response = Rack::Response.new("", 200, "content-type" => "text/plain")
    response["Content-Type"].should.equal "text/plain"
  end

  it "can set cookies" do
    response = Rack::Response.new

    response.set_cookie "foo", "bar"
    response["Set-Cookie"].should.equal "foo=bar"
    response.set_cookie "foo2", "bar2"
    response["Set-Cookie"].should.equal ["foo=bar", "foo2=bar2"].join("\n")
    response.set_cookie "foo3", "bar3"
    response["Set-Cookie"].should.equal ["foo=bar", "foo2=bar2", "foo3=bar3"].join("\n")
  end

  it "can set cookies with the same name for multiple domains" do
    response = Rack::Response.new
    response.set_cookie "foo", {:value => "bar", :domain => "sample.example.com"}
    response.set_cookie "foo", {:value => "bar", :domain => ".example.com"}
    response["Set-Cookie"].should.equal ["foo=bar; domain=sample.example.com", "foo=bar; domain=.example.com"].join("\n")
  end

  it "formats the Cookie expiration date accordingly to RFC 6265" do
    response = Rack::Response.new

    response.set_cookie "foo", {:value => "bar", :expires => Time.now+10}
    response["Set-Cookie"].should.match(
      /expires=..., \d\d ... \d\d\d\d \d\d:\d\d:\d\d .../)
  end

  it "can set secure cookies" do
    response = Rack::Response.new
    response.set_cookie "foo", {:value => "bar", :secure => true}
    response["Set-Cookie"].should.equal "foo=bar; secure"
  end

  it "can set http only cookies" do
    response = Rack::Response.new
    response.set_cookie "foo", {:value => "bar", :httponly => true}
    response["Set-Cookie"].should.equal "foo=bar; HttpOnly"
  end

  it "can delete cookies" do
    response = Rack::Response.new
    response.set_cookie "foo", "bar"
    response.set_cookie "foo2", "bar2"
    response.delete_cookie "foo"
    response["Set-Cookie"].should.equal [
      "foo2=bar2",
      "foo=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 -0000"
    ].join("\n")
  end

  it "can delete cookies with the same name from multiple domains" do
    response = Rack::Response.new
    response.set_cookie "foo", {:value => "bar", :domain => "sample.example.com"}
    response.set_cookie "foo", {:value => "bar", :domain => ".example.com"}
    response["Set-Cookie"].should.equal ["foo=bar; domain=sample.example.com", "foo=bar; domain=.example.com"].join("\n")
    response.delete_cookie "foo", :domain => ".example.com"
    response["Set-Cookie"].should.equal ["foo=bar; domain=sample.example.com", "foo=; domain=.example.com; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 -0000"].join("\n")
    response.delete_cookie "foo", :domain => "sample.example.com"
    response["Set-Cookie"].should.equal ["foo=; domain=.example.com; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 -0000",
                                         "foo=; domain=sample.example.com; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 -0000"].join("\n")
  end

  it "can delete cookies with the same name with different paths" do
    response = Rack::Response.new
    response.set_cookie "foo", {:value => "bar", :path => "/"}
    response.set_cookie "foo", {:value => "bar", :path => "/path"}
    response["Set-Cookie"].should.equal ["foo=bar; path=/",
                                         "foo=bar; path=/path"].join("\n")

    response.delete_cookie "foo", :path => "/path"
    response["Set-Cookie"].should.equal ["foo=bar; path=/",
                                         "foo=; path=/path; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 -0000"].join("\n")
  end

  it "can do redirects" do
    response = Rack::Response.new
    response.redirect "/foo"
    status, header, body = response.finish
    status.should.equal 302
    header["Location"].should.equal "/foo"

    response = Rack::Response.new
    response.redirect "/foo", 307
    status, header, body = response.finish

    status.should.equal 307
  end

  it "has a useful constructor" do
    r = Rack::Response.new("foo")
    status, header, body = r.finish
    str = ""; body.each { |part| str << part }
    str.should.equal "foo"

    r = Rack::Response.new(["foo", "bar"])
    status, header, body = r.finish
    str = ""; body.each { |part| str << part }
    str.should.equal "foobar"

    object_with_each = Object.new
    def object_with_each.each
      yield "foo"
      yield "bar"
    end
    r = Rack::Response.new(object_with_each)
    r.write "foo"
    status, header, body = r.finish
    str = ""; body.each { |part| str << part }
    str.should.equal "foobarfoo"

    r = Rack::Response.new([], 500)
    r.status.should.equal 500

    r = Rack::Response.new([], "200 OK")
    r.status.should.equal 200
  end

  it "has a constructor that can take a block" do
    r = Rack::Response.new { |res|
      res.status = 404
      res.write "foo"
    }
    status, _, body = r.finish
    str = ""; body.each { |part| str << part }
    str.should.equal "foo"
    status.should.equal 404
  end

  it "doesn't return invalid responses" do
    r = Rack::Response.new(["foo", "bar"], 204)
    _, header, body = r.finish
    str = ""; body.each { |part| str << part }
    str.should.be.empty
    header["Content-Type"].should.equal nil
    header['Content-Length'].should.equal nil

    lambda {
      Rack::Response.new(Object.new)
    }.should.raise(TypeError).
      message.should =~ /stringable or iterable required/
  end

  it "knows if it's empty" do
    r = Rack::Response.new
    r.should.be.empty
    r.write "foo"
    r.should.not.be.empty

    r = Rack::Response.new
    r.should.be.empty
    r.finish
    r.should.be.empty

    r = Rack::Response.new
    r.should.be.empty
    r.finish { }
    r.should.not.be.empty
  end

  should "provide access to the HTTP status" do
    res = Rack::Response.new
    res.status = 200
    res.should.be.successful
    res.should.be.ok

    res.status = 400
    res.should.not.be.successful
    res.should.be.client_error
    res.should.be.bad_request

    res.status = 404
    res.should.not.be.successful
    res.should.be.client_error
    res.should.be.not_found

    res.status = 405
    res.should.not.be.successful
    res.should.be.client_error
    res.should.be.method_not_allowed

    res.status = 422
    res.should.not.be.successful
    res.should.be.client_error
    res.should.be.unprocessable

    res.status = 501
    res.should.not.be.successful
    res.should.be.server_error

    res.status = 307
    res.should.be.redirect
  end

  should "provide access to the HTTP headers" do
    res = Rack::Response.new
    res["Content-Type"] = "text/yaml"

    res.should.include "Content-Type"
    res.headers["Content-Type"].should.equal "text/yaml"
    res["Content-Type"].should.equal "text/yaml"
    res.content_type.should.equal "text/yaml"
    res.content_length.should.be.nil
    res.location.should.be.nil
  end

  it "does not add or change Content-Length when #finish()ing" do
    res = Rack::Response.new
    res.status = 200
    res.finish
    res.headers["Content-Length"].should.be.nil

    res = Rack::Response.new
    res.status = 200
    res.headers["Content-Length"] = "10"
    res.finish
    res.headers["Content-Length"].should.equal "10"
  end

  it "updates Content-Length when body appended to using #write" do
    res = Rack::Response.new
    res.status = 200
    res.headers["Content-Length"].should.be.nil
    res.write "Hi"
    res.headers["Content-Length"].should.equal "2"
    res.write " there"
    res.headers["Content-Length"].should.equal "8"
  end

  it "calls close on #body" do
    res = Rack::Response.new
    res.body = StringIO.new
    res.close
    res.body.should.be.closed
  end

  it "calls close on #body when 204, 205, or 304" do
    res = Rack::Response.new
    res.body = StringIO.new
    res.finish
    res.body.should.not.be.closed

    res.status = 204
    _, _, b = res.finish
    res.body.should.be.closed
    b.should.not.equal res.body

    res.body = StringIO.new
    res.status = 205
    _, _, b = res.finish
    res.body.should.be.closed
    b.should.not.equal res.body

    res.body = StringIO.new
    res.status = 304
    _, _, b = res.finish
    res.body.should.be.closed
    b.should.not.equal res.body
  end

  it "wraps the body from #to_ary to prevent infinite loops" do
    res = Rack::Response.new
    res.finish.last.should.not.respond_to?(:to_ary)
    lambda { res.finish.last.to_ary }.should.raise(NoMethodError)
  end
end


text:
from test_framework import generic_test

def roman_to_integer(s: str) -> int:
    # TODO - you fill in here.
    return 0

if __name__ == '__main__':
    exit(
        generic_test.generic_test_main('roman_to_integer.py',
                                       'roman_to_integer.tsv',
                                       roman_to_integer))


text:
#ifndef __LAGOPUS_SESSION_H__
#define __LAGOPUS_SESSION_H__

/**
 * @file       lagopus_session.h
 */
#include "lagopus_ip_addr.h"

typedef struct session *lagopus_session_t;

/*
 * If you have changed, also changed following.
 * - session_type_to_str
 * - session_type_to_enum
 */
typedef enum {
  SESSION_PASSIVE     = 0x0001,
  SESSION_ACTIVE      = 0x0002,
  SESSION_ACCEPTED    = 0x0004,
  SESSION_TCP         = 0x0010,
  SESSION_TCP6        = 0x0020,
  SESSION_UNIX_DGRAM  = 0x0100,
  SESSION_UNIX_STREAM = 0x0200,
  SESSION_TLS         = 0x1000,
} session_type_t;

/**
 * Create a session.
 *
 *  @param[in]  session_type  A session type for creating.
 *  @param[out] session       A created session.
 *
 *  @retval LAGOPUS_RESULT_OK      Succeeded.
 *  @retval !=LAGOPUS_RESULT_OK    Failed.
 *
 *  @details Call this function for creating a session for tcp, tcp6, tls etc.
 *  Session_type must be set socket type(SESSION_PASSIVE or SESSION_ACCEPTED)
 *  and protocol type(SESSION_TCP or SESSION_TCP6).
 */
lagopus_result_t
session_create(session_type_t session_type, lagopus_session_t *session);

/**
 * Create a session pair.
 *
 *  @param[in]  session_type  A session type for creating but only SESSION_UNIX_DGRAM or SESSION_UNIX_STREAM are allowed.
 *  @param[out] session[2]    created session pair.
 *
 *  @retval LAGOPUS_RESULT_OK      Succeeded.
 *  @retval !=LAGOPUS_RESULT_OK    Failed.
 *
 *  @details Call this function for creating session pair for unix domain sockets.
 *  Session_type must be set SESSION_UNIX_DGRAM or SESSION_UNIX_STREAM.
 */
lagopus_result_t
session_pair(session_type_t session_type, lagopus_session_t session[2]);

/**
 * Destroy session.
 *
 *  @param[in] session A session.
 *
 *  @details Call this function to destroy a session object.
 */
void
session_destroy(lagopus_session_t session);

/**
 * Return a session is alive or not.
 *
 *  @param[in] session  A session pointer.
 *
 *  @retval TRUE  Alive.
 *  @retval FALSE Dead.
 *
 */
bool
session_is_alive(lagopus_session_t session);

/**
 * Connect a session to a server.
 *
 *  @param[in]  s       A session.
 *  @param[in]  daddr   A server address.
 *  @param[in]  dport   A server port.
 *  @param[in]  saddr   A source address or NULL.
 *  @param[in]  sport   A source port or 0.
 *
 *  @retval LAGOPUS_RESULT_OK          Succeeded.
 *  @retval LAGOPUS_RESULT_EINPROGRESS The connection cannot be
 *  completed immediately.
 *
 *  @details Connect a non-blocking socket session to a server socket.
 *  Set a source address and a source port if needed.
 *
 */
lagopus_result_t
session_connect(lagopus_session_t s, lagopus_ip_address_t *daddr, uint16_t dport,
                lagopus_ip_address_t *saddr, uint16_t sport);

/**
 * Close a session.
 *
 *  @param[in]  s  A session.
 *
 */
void
session_close(lagopus_session_t s);

/**
 * Check a session socket.
 *
 *  @param[in]  s       A session.
 *
 *  @retval LAGOPUS_RESULT_OK            Succeeded.
 *  @retval LAGOPUS_RESULT_SOCKET_ERROR  Failed, a session socket is invalid.
 *
 */
lagopus_result_t
session_connect_check(lagopus_session_t s);

/**
 * Read data from a session.
 *
 *  @param[in]  s       A session.
 *  @param[in]  buf     Read data buffer.
 *  @param[in]  n       Read data size.
 *
 *  @retval Size of read data.
 *
 */
ssize_t
session_read(lagopus_session_t s, void *buf, size_t n);

/**
 * Write data to a session.
 *
 *  @param[in]  s       A session.
 *  @param[in]  buf     Write data buffer.
 *  @param[in]  n       Write data size.
 *
 *  @retval Size of wrote data.
 *
 */
ssize_t
session_write(lagopus_session_t s, void *buf, size_t n);

/**
 * Get socket descriptor in a session.
 *
 *  @param[in]  s       A session.
 *
 *  @retval A descripor in session.
 *
 *  @details TEST USE ONLY.
 *
 */
int
session_sockfd_get(lagopus_session_t s);

/**
 * Put socket descriptor into a session.
 *
 *  @param[in]  s       A session.
 *  @param[in]  sock    A descripor.
 *
 *  @details TEST USE ONLY.
 *
 */
void
session_sockfd_set(lagopus_session_t s, int sock);

/**
 * Put socket writer into a session.
 *
 *  @param[in]  s       A session.
 *  @param[in]  write   A writer
 *
 *  @details TEST USE ONLY.
 *
 */
void
session_write_set(lagopus_session_t s, ssize_t (*write)(lagopus_session_t ,
                  void *, size_t));

/**
 * Fgets for a session.
 *
 *  @param[in]  str     Store a read string to.
 *  @param[in]  size    Size of str.
 *  @param[in]  s       A session.
 *
 *  @retval Pointer to str.
 *
 */
char *
session_fgets(char *restrict str, int size, lagopus_session_t s);

/**
 * Bind for a session.
 *
 *  @param[in]  s      A session.
 *  @param[in]  addr   A source address.
 *  @param[in]  port   A source port.
 *
 *  @retval LAGOPUS_RESULT_OK              Succeeded.
 *  @retval LAGOPUS_RESULT_POSIX_API_ERROR Failed, in systemcalls.
 *
 */
lagopus_result_t
session_bind(lagopus_session_t s, lagopus_ip_address_t *saddr, uint16_t port);

/**
 * Accept for a session.
 *
 *  @param[in]   s1      A session.
 *  @param[out]  s2     A accepted session.
 *
 *  @retval LAGOPUS_RESULT_OK              Succeeded.
 *  @retval LAGOPUS_RESULT_POSIX_API_ERROR Failed, in systemcalls.
 *
 *  @details Allocated a accepted new sessesion, if succeeded.
 */
lagopus_result_t
session_accept(lagopus_session_t s1, lagopus_session_t *s2);

/**
 * Clear a read/write event in a session.
 *
 *  @param[in]   s     A session.
 *
 *  @details Clear a read/write event in a session for polling.
 */
void
session_event_clear(lagopus_session_t s);

/**
 * Set a read event into a session.
 *
 *  @param[in]   s     A session.
 *
 *  @details Set a read event into a session for polling.
 */
void
session_read_event_set(lagopus_session_t s);

/**
 * Unset a read event into a session.
 *
 *  @param[in]   s     A session.
 *
 *  @details Unset a read event into a session for polling.
 */
void
session_read_event_unset(lagopus_session_t s);

/**
 * Return a session is readable or not.
 *
 *  @param[in]   s     A session.
 *  @param[out]  b     Readable or not.
 *
 *  @retval LAGOPUS_RESULT_OK Succeeded.
 *
 */
lagopus_result_t
session_is_readable(lagopus_session_t s, bool *b);

/**
 * Return a session is read on or not.
 *
 *  @param[in]   s     A session.
 *  @param[out]  b     Read on or not.
 *
 *  @retval LAGOPUS_RESULT_OK Succeeded.
 *
 */
lagopus_result_t
session_is_read_on(lagopus_session_t s, bool *b);

/**
 * Set a write event into a session.
 *
 *  @param[in]   s     A session.
 *
 *  @details Set a write event into a session for polling.
 */
void
session_write_event_set(lagopus_session_t s);

/**
 * Unset a write event into a session.
 *
 *  @param[in]   s     A session.
 *
 *  @details Unset a write event into a session for polling.
 */
void
session_write_event_unset(lagopus_session_t s);

/**
 * Return a session is writable or not.
 *
 *  @param[in]   s     A session.
 *  @param[out]  b     Writable or not.
 *
 *  @retval LAGOPUS_RESULT_OK Succeeded.
 *
 */
lagopus_result_t
session_is_writable(lagopus_session_t s, bool *b);

/**
 * Return a session is write on or not.
 *
 *  @param[in]   s     A session.
 *  @param[out]  b     Write on or not.
 *
 *  @retval LAGOPUS_RESULT_OK Succeeded.
 *
 */
lagopus_result_t
session_is_write_on(lagopus_session_t s, bool *b);

/**
 * Poll for sessions.
 *
 *  @param[in]  s[]      Sessions.
 *  @param[in]  n        Number of sessions.
 *  @param[in]  timeout  Timeout(msec).
 *
 *  @retval > 0                            Succeeded, return value is number of readable/writable session.
 *  @retval LAGOPUS_RESULT_TIMEDOUT        Timeouted.
 *  @retval LAGOPUS_RESULT_INTERRUPTED     Interrupted.
 *  @retval LAGOPUS_RESULT_POSIX_API_ERROR Failed, in systemcalls.
 *
 */
lagopus_result_t
session_poll(lagopus_session_t s[], int n, int timeout);

/**
 * Return a session is passive or not.
 *
 *  @param[in]   s     A session.
 *
 *  @retval Passive or not.
 *
 */
bool
session_is_passive(lagopus_session_t s);

/**
 * Fprintf for a session.
 *
 *  @param[in]  s       A session.
 *  @param[in]  fmt     format.
 *  @param[in]  ...     variable args.
 *
 *
 */
int
session_printf(lagopus_session_t s, const char *fmt, ...)
__attribute__((format(printf, 2, 3)));

/**
 * Vprintf for a session.
 *
 *  @param[in]  s       A session.
 *  @param[in]  fmt     format.
 *  @param[in]  ap      variable args.
 *
 *
 */
int
session_vprintf(lagopus_session_t s, const char *fmt, va_list ap)
__attribute__((format(printf, 2, 0)));;

/**
 * Return a session is passive or not.
 *
 *  @param[in]   session_type     session type.
 *
 *  @retval TRUE  passive.
 *  @retval FALSE not passive.
 *
 */
bool
session_type_is_passive(const session_type_t session_type);

/**
 * Return a session is active or not.
 *
 *  @param[in]   session_type     session type.
 *
 *  @retval TRUE  active.
 *  @retval FALSE not active.
 *
 */
bool
session_type_is_active(const session_type_t session_type);

/**
 * Return a session is accepted or not.
 *
 *  @param[in]   session_type     session type.
 *
 *  @retval TRUE  accepted.
 *  @retval FALSE not accepted.
 *
 */
bool
session_type_is_accepted(const session_type_t session_type);

/**
 * Return a session is tcp or not.
 *
 *  @param[in]   session_type     session type.
 *
 *  @retval TRUE  TCP.
 *  @retval FALSE not TCP.
 *
 */
bool
session_type_is_tcp(const session_type_t session_type);

/**
 * Return a session is tcp6 or not.
 *
 *  @param[in]   session_type     session type.
 *
 *  @retval TRUE  TCP6.
 *  @retval FALSE not TCP6.
 *
 */
bool
session_type_is_tcp6(const session_type_t session_type);

/**
 * Return a session is tls or not.
 *
 *  @param[in]   session_type     session type.
 *
 *  @retval TRUE  TLS.
 *  @retval FALSE not TLS.
 *
 */
bool
session_type_is_tls(const session_type_t session_type);

/**
 * Get a session id.
 *
 *  @param[in]   s     A session.
 *
 *  @retval Session id.
 *
 */
uint64_t
session_id_get(lagopus_session_t s);

#endif /* __SESSION_H__ */


text:
{{#settings}}

    {{title}}

    	<input type="text" name="{{name}}" class="form-control" id="field-{{name}}" value="{{value}}" />

{{/settings}}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <meta charset="utf-8"/>

        <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />

                SFML 2.4.2

sf

Event

MouseButtonEvent

sf::Event::MouseButtonEvent Member List

This is the complete list of members for sf::Event::MouseButtonEvent, including all inherited members.

button	sf::Event::MouseButtonEvent

x	sf::Event::MouseButtonEvent

y	sf::Event::MouseButtonEvent

                SFML is licensed under the terms and conditions of the zlib/png license.

                Copyright © Laurent Gomila  ::
                Documentation generated by doxygen  ::


text:
<?php

namespace Application\Arferr\BlogBundle\Service;

use Application\Arferr\BlogBundle\Event\NewCommentEvent;
use Application\Arferr\BlogBundle\Repository\CommentRepository;
use Doctrine\ORM\EntityManager;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Application\Arferr\BlogBundle\Entity\Comment;

/**
 * Class CommentManager
 * @package Application\Arferr\BlogBundle
 */
class CommentManager {
    /**
     * @var EventDispatcher
     */
    protected $eventDispatcher;

    /**
     * @var EntityManager
     */
    protected $em;

    /**
     * @param EventDispatcher $eventDispatcher
     * @param EntityManager $em
     * @param CommentRepository $repository
     */
    public function __construct($eventDispatcher, $em) {
        $this->setEventDispatcher($eventDispatcher);
        $this->setEm($em);
    }

    /**
     * @param \Doctrine\ORM\EntityManager $em
     */
    public function setEm($em)
    {
        $this->em = $em;
    }

    /**
     * @return \Doctrine\ORM\EntityManager
     */
    public function getEm()
    {
        return $this->em;
    }

    /**
     * @param \Symfony\Component\EventDispatcher\EventDispatcher $eventDispatcher
     */
    public function setEventDispatcher($eventDispatcher)
    {
        $this->eventDispatcher = $eventDispatcher;
    }

    /**
     * @return \Symfony\Component\EventDispatcher\EventDispatcher
     */
    public function getEventDispatcher()
    {
        return $this->eventDispatcher;
    }

    /**
     * @return Comment
     */
    public function createComment()
    {
        return new Comment();
    }

    /**
     * Dispatches new comment event.
     *
     * @param $username
     * @param $content
     * @param $postId
     */
    public function dispatchNewCommentEvent($username, $content, $postId) {
        $event = new NewCommentEvent();
        $event->setAuthorUsername($username);
        $event->setContent($content);
        $event->setPostId($postId);

        $this->getEventDispatcher()->dispatch('application_arferr_blog.event.new_comment', $event);
    }

    /**
     * Persists or updates comment entity.
     *
     * @param Comment $comment
     * @param bool $andFlush
     */
    public function updateComment(Comment $comment, $andFlush = true)
    {
        $this->getEm()->persist($comment);
        if ($andFlush) {
            $this->getEm()->flush();
        }
    }
}


text:
namespace app_list {

// Returns a kString text item containing the localized string with the given
// GRIT ID.
ash::SearchResultTextItem CreateStringTextItem(int text_id);

// Returns a kString text item containing `text`.
ash::SearchResultTextItem CreateStringTextItem(const std::u16string& text);

// Returns a kIconifiedText text item containing `text`.
ash::SearchResultTextItem CreateIconifiedTextTextItem(
    const std::u16string& text);

// Returns a kIcon text item with the given text icon code.
ash::SearchResultTextItem CreateIconCodeTextItem(
    ash::SearchResultTextItem::IconCode icon_code);

// Given a `text_vector`, such as a ChromeSearchResult's title or details,
// returns a 'flattened' string that is the concatenation of all text in
// `text_vector` without formatting. Requires that all elements of
// `text_vector` are kString items.
std::u16string StringFromTextVector(
    const std::vector<ash::SearchResultTextItem>& text_vector);

}  // namespace app_list

#endif  // CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_RESULT_UTIL_H_


text:
package app.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "clasic_labels")
public class ClassicLabel implements Label {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private long id;

	@Basic
	private String title;

	@Column(name = "sub_title")
	private String subTitle;

	public ClassicLabel() {  }

	public ClassicLabel(String title) {
		this.title = title;
		this.subTitle = "Sub Title";
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSubTitle() {
		return subTitle;
	}

	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="Torgovorot\TorgBundle\Entity\AdsCars" table="ads_cars">
    <id name="id" type="integer" column="id">
      <generator strategy="IDENTITY"/>
    </id>
    <field name="ownerId" type="integer" column="owner_id" nullable="true"/>
    <field name="title" type="string" column="title" length="255" nullable="true"/>
    <field name="catId" type="integer" column="cat_id" nullable="true"/>
    <field name="markId" type="integer" column="mark_id" nullable="true"/>
    <field name="model" type="string" column="model" length="255" nullable="true"/>
    <field name="yearProd" type="integer" column="year_prod" nullable="true"/>
    <field name="bodyId" type="integer" column="body_id" nullable="true"/>
    <field name="runDistance" type="float" column="run_distance" precision="10" scale="0" nullable="true"/>
    <field name="yearsOld" type="integer" column="years_old" nullable="true"/>
    <field name="wincode" type="integer" column="wincode" nullable="true"/>
    <field name="volume" type="float" column="volume" precision="10" scale="0" nullable="true"/>
    <field name="power" type="float" column="power" precision="10" scale="0" nullable="true"/>
    <field name="engineId" type="integer" column="engine_id" nullable="true"/>
    <field name="conditionId" type="integer" column="condition_id" nullable="true"/>
    <field name="color" type="string" column="color" length="255" nullable="true"/>
    <field name="photoIds" type="string" column="photo_ids" length="255" nullable="true"/>
    <field name="chIds" type="string" column="ch_ids" length="255" nullable="true"/>
    <field name="price" type="float" column="price" precision="10" scale="0" nullable="true"/>
    <field name="torg" type="integer" column="torg" nullable="true"/>
    <field name="addrId" type="string" column="addr_id" length="255" nullable="true"/>
    <field name="isYourTown" type="integer" column="is_your_town" nullable="true"/>
    <field name="town" type="string" column="town" length="255" nullable="true"/>
    <field name="description" type="text" column="description" nullable="true"/>
    <field name="shortDesc" type="text" column="short_desc" nullable="true"/>
    <field name="time" type="datetime" column="time" nullable="true"/>
    <field name="updated" type="datetime" column="updated" nullable="true"/>
    <field name="vip" type="integer" column="vip" nullable="true"/>
    <field name="premium" type="integer" column="premium" nullable="true"/>
    <field name="emergency" type="integer" column="emergency" nullable="true"/>
    <field name="views" type="integer" column="views" nullable="true"/>
    <field name="special" type="integer" column="special" nullable="true"/>
    <field name="adsState" type="integer" column="ads_state" nullable="true"/>
  </entity>
</doctrine-mapping>