from __future__ import absolute_import import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket from .exceptions import ( ClosedPoolError, ProtocolError, EmptyPoolError, HeaderParsingError, HostChangedError, LocationValueError, MaxRetryError, ProxyError, ReadTimeoutError, SSLError, TimeoutError, InsecureRequestWarning, NewConnectionError, ) from .packages.ssl_match_hostname import CertificateError from .packages import six from .packages.six.moves import queue from .connection import ( port_by_scheme, DummyConnection, HTTPConnection, HTTPSConnection, VerifiedHTTPSConnection, HTTPException, BaseSSLError, ) from .request import RequestMethods from .response import HTTPResponse from .util.connection import is_connection_dropped from .util.request import set_file_position from .util.response import assert_header_parsing from .util.retry import Retry from .util.timeout import Timeout from .util.url import ( get_host, parse_url, Url, _normalize_host as normalize_host, _encode_target, ) from .util.queue import LifoQueue xrange = six.moves.xrange log = logging.getLogger(__name__) _Default = object() # Pool objects class ConnectionPool(object): """ Base class for all connection pools, such as :class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`. """ scheme = None QueueCls = LifoQueue def __init__(self, host, port=None): if not host: raise LocationValueError("No host specified.") self.host = _normalize_host(host, scheme=self.scheme) self._proxy_host = host.lower() self.port = port def __str__(self): return "%s(host=%r, port=%r)" % (type(self).__name__, self.host, self.port) def __enter__(self): return self def __exit__(self, exc_type, exc_val, exc_tb): self.close() # Return False to re-raise any potential exceptions return False def close(self): """ Close all pooled connections and disable the pool. """ pass # This is taken from http://hg.python.org/cpython/file/7aaba721ebc0/Lib/socket.py#l252 _blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK} class HTTPConnectionPool(ConnectionPool, RequestMethods): """ Thread-safe connection pool for one host. :param host: Host used for this HTTP Connection (e.g. "localhost"), passed into :class:`httplib.HTTPConnection`. :param port: Port used for this HTTP Connection (None is equivalent to 80), passed into :class:`httplib.HTTPConnection`. :param strict: Causes BadStatusLine to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line, passed into :class:`httplib.HTTPConnection`. .. note:: Only works in Python 2. This parameter is ignored in Python 3. :param timeout: Socket timeout in seconds for each individual connection. This can be a float or integer, which sets the timeout for the HTTP request, or an instance of :class:`urllib3.util.Timeout` which gives you more fine-grained control over request timeouts. After the constructor has been parsed, this is always a `urllib3.util.Timeout` object. :param maxsize: Number of connections to save that can be reused. More than 1 is useful in multithreaded situations. If ``block`` is set to False, more connections will be created but they will not be saved once they've been used. :param block: If set to True, no more than ``maxsize`` connections will be used at a time. When no free connections are available, the call will block until a connection has been released. This is a useful side effect for particular multithreaded situations where one does not want to use more than maxsize connections per host to prevent flooding. :param headers: Headers to include with all requests, unless other headers are given explicitly. :param retries: Retry configuration to use by default with requests in this pool. :param _proxy: Parsed proxy URL, should not be used directly, instead, see :class:`urllib3.connectionpool.ProxyManager`" :param _proxy_headers: A dictionary with proxy headers, should not be used directly, instead, see :class:`urllib3.connectionpool.ProxyManager`" :param \\**conn_kw: Additional parameters are used to create fresh :class:`urllib3.connection.HTTPConnection`, :class:`urllib3.connection.HTTPSConnection` instances. """ scheme = "http" ConnectionCls = HTTPConnection ResponseCls = HTTPResponse def __init__( self, host, port=None, strict=False, timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1, block=False, headers=None, retries=None, _proxy=None, _proxy_headers=None, **conn_kw ): ConnectionPool.__init__(self, host, port) RequestMethods.__init__(self, headers) self.strict = strict if not isinstance(timeout, Timeout): timeout = Timeout.from_float(timeout) if retries is None: retries = Retry.DEFAULT self.timeout = timeout self.retries = retries self.pool = self.QueueCls(maxsize) self.block = block self.proxy = _proxy self.proxy_headers = _proxy_headers or {} # Fill the queue up so that doing get() on it will block properly for _ in xrange(maxsize): self.pool.put(None) # These are mostly for testing and debugging purposes. self.num_connections = 0 self.num_requests = 0 self.conn_kw = conn_kw if self.proxy: # Enable Nagle's algorithm for proxies, to avoid packet fragmentation. # We cannot know if the user has added default socket options, so we cannot replace the # list. self.conn_kw.setdefault("socket_options", []) def _new_conn(self): """ Return a fresh :class:`HTTPConnection`. """ self.num_connections += 1 log.debug( "Starting new HTTP connection (%d): %s:%s", self.num_connections, self.host, self.port or "80", ) conn = self.ConnectionCls( host=self.host, port=self.port, timeout=self.timeout.connect_timeout, strict=self.strict, **self.conn_kw ) return conn def _get_conn(self, timeout=None): """ Get a connection. Will return a pooled connection if one is available. If no connections are available and :prop:`.block` is ``False``, then a fresh connection is returned. :param timeout: Seconds to wait before giving up and raising :class:`urllib3.exceptions.EmptyPoolError` if the pool is empty and :prop:`.block` is ``True``. """ conn = None try: conn = self.pool.get(block=self.block, timeout=timeout) except AttributeError: # self.pool is None raise ClosedPoolError(self, "Pool is closed.") except queue.Empty: if self.block: raise EmptyPoolError( self, "Pool reached maximum size and no more connections are allowed.", ) pass # Oh well, we'll create a new connection then # If this is a persistent connection, check if it got disconnected if conn and is_connection_dropped(conn): log.debug("Resetting dropped connection: %s", self.host) conn.close() if getattr(conn, "auto_open", 1) == 0: # This is a proxied connection that has been mutated by # httplib._tunnel() and cannot be reused (since it would # attempt to bypass the proxy) conn = None return conn or self._new_conn() def _put_conn(self, conn): """ Put a connection back into the pool. :param conn: Connection object for the current host and port as returned by :meth:`._new_conn` or :meth:`._get_conn`. If the pool is already full, the connection is closed and discarded because we exceeded maxsize. If connections are discarded frequently, then maxsize should be increased. If the pool is closed, then the connection will be closed and discarded. """ try: self.pool.put(conn, block=False) return # Everything is dandy, done. except AttributeError: # self.pool is None. pass except queue.Full: # This should never happen if self.block == True log.warning("Connection pool is full, discarding connection: %s", self.host) # Connection never got put back into the pool, close it. if conn: conn.close() def _validate_conn(self, conn): """ Called right before a request is made, after the socket is created. """ pass def _prepare_proxy(self, conn): # Nothing to do for HTTP connections. pass def _get_timeout(self, timeout): """ Helper that always returns a :class:`urllib3.util.Timeout` """ if timeout is _Default: return self.timeout.clone() if isinstance(timeout, Timeout): return timeout.clone() else: # User passed us an int/float. This is for backwards compatibility, # can be removed later return Timeout.from_float(timeout) def _raise_timeout(self, err, url, timeout_value): """Is the error actually a timeout? Will raise a ReadTimeout or pass""" if isinstance(err, SocketTimeout): raise ReadTimeoutError( self, url, "Read timed out. (read timeout=%s)" % timeout_value ) # See the above comment about EAGAIN in Python 3. In Python 2 we have # to specifically catch it and throw the timeout error if hasattr(err, "errno") and err.errno in _blocking_errnos: raise ReadTimeoutError( self, url, "Read timed out. (read timeout=%s)" % timeout_value ) # Catch possible read timeouts thrown as SSL errors. If not the # case, rethrow the original. We need to do this because of: # http://bugs.python.org/issue10272 if "timed out" in str(err) or "did not complete (read)" in str( err ): # Python < 2.7.4 raise ReadTimeoutError( self, url, "Read timed out. (read timeout=%s)" % timeout_value ) def _make_request( self, conn, method, url, timeout=_Default, chunked=False, **httplib_request_kw ): """ Perform a request on a given urllib connection object taken from our pool. :param conn: a connection from one of our connection pools :param timeout: Socket timeout in seconds for the request. This can be a float or integer, which will set the same timeout value for the socket connect and the socket read, or an instance of :class:`urllib3.util.Timeout`, which gives you more fine-grained control over your timeouts. """ self.num_requests += 1 timeout_obj = self._get_timeout(timeout) timeout_obj.start_connect() conn.timeout = timeout_obj.connect_timeout # Trigger any extra validation we need to do. try: self._validate_conn(conn) except (SocketTimeout, BaseSSLError) as e: # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout. self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) raise # conn.request() calls httplib.*.request, not the method in # urllib3.request. It also calls makefile (recv) on the socket. if chunked: conn.request_chunked(method, url, **httplib_request_kw) else: conn.request(method, url, **httplib_request_kw) # Reset the timeout for the recv() on the socket read_timeout = timeout_obj.read_timeout # App Engine doesn't have a sock attr if getattr(conn, "sock", None): # In Python 3 socket.py will catch EAGAIN and return None when you # try and read into the file pointer created by http.client, which # instead raises a BadStatusLine exception. Instead of catching # the exception and assuming all BadStatusLine exceptions are read # timeouts, check for a zero timeout before making the request. if read_timeout == 0: raise ReadTimeoutError( self, url, "Read timed out. (read timeout=%s)" % read_timeout ) if read_timeout is Timeout.DEFAULT_TIMEOUT: conn.sock.settimeout(socket.getdefaulttimeout()) else: # None or a value conn.sock.settimeout(read_timeout) # Receive the response from the server try: try: # Python 2.7, use buffering of HTTP responses httplib_response = conn.getresponse(buffering=True) except TypeError: # Python 3 try: httplib_response = conn.getresponse() except BaseException as e: # Remove the TypeError from the exception chain in # Python 3 (including for exceptions like SystemExit). # Otherwise it looks like a bug in the code. six.raise_from(e, None) except (SocketTimeout, BaseSSLError, SocketError) as e: self._raise_timeout(err=e, url=url, timeout_value=read_timeout) raise # AppEngine doesn't have a version attr. http_version = getattr(conn, "_http_vsn_str", "HTTP/?") log.debug( '%s://%s:%s "%s %s %s" %s %s', self.scheme, self.host, self.port, method, url, http_version, httplib_response.status, httplib_response.length, ) try: assert_header_parsing(httplib_response.msg) except (HeaderParsingError, TypeError) as hpe: # Platform-specific: Python 3 log.warning( "Failed to parse headers (url=%s): %s", self._absolute_url(url), hpe, exc_info=True, ) return httplib_response def _absolute_url(self, path): return Url(scheme=self.scheme, host=self.host, port=self.port, path=path).url def close(self): """ Close all pooled connections and disable the pool. """ if self.pool is None: return # Disable access to the pool old_pool, self.pool = self.pool, None try: while True: conn = old_pool.get(block=False) if conn: conn.close() except queue.Empty: pass # Done. def is_same_host(self, url): """ Check if the given ``url`` is a member of the same host as this connection pool. """ if url.startswith("/"): return True # TODO: Add optional support for socket.gethostbyname checking. scheme, host, port = get_host(url) if host is not None: host = _normalize_host(host, scheme=scheme) # Use explicit default port for comparison when none is given if self.port and not port: port = port_by_scheme.get(scheme) elif not self.port and port == port_by_scheme.get(scheme): port = None return (scheme, host, port) == (self.scheme, self.host, self.port) def urlopen( self, method, url, body=None, headers=None, retries=None, redirect=True, assert_same_host=True, timeout=_Default, pool_timeout=None, release_conn=None, chunked=False, body_pos=None, **response_kw ): """ Get a connection from the pool and perform an HTTP request. This is the lowest level call for making a request, so you'll need to specify all the raw details. .. note:: More commonly, it's appropriate to use a convenience method provided by :class:`.RequestMethods`, such as :meth:`request`. .. note:: `release_conn` will only behave as expected if `preload_content=False` because we want to make `preload_content=False` the default behaviour someday soon without breaking backwards compatibility. :param method: HTTP request method (such as GET, POST, PUT, etc.) :param body: Data to send in the request body (useful for creating POST requests, see HTTPConnectionPool.post_url for more convenience). :param headers: Dictionary of custom headers to send, such as User-Agent, If-None-Match, etc. If None, pool headers are used. If provided, these headers completely replace any pool-specific headers. :param retries: Configure the number of retries to allow before raising a :class:`~urllib3.exceptions.MaxRetryError` exception. Pass ``None`` to retry until you receive a response. Pass a :class:`~urllib3.util.retry.Retry` object for fine-grained control over different types of retries. Pass an integer number to retry connection errors that many times, but no other types of errors. Pass zero to never retry. If ``False``, then retries are disabled and any exception is raised immediately. Also, instead of raising a MaxRetryError on redirects, the redirect response will be returned. :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. :param redirect: If True, automatically handle redirects (status codes 301, 302, 303, 307, 308). Each redirect counts as a retry. Disabling retries will disable redirect, too. :param assert_same_host: If ``True``, will make sure that the host of the pool requests is consistent else will raise HostChangedError. When False, you can use the pool on an HTTP proxy and request foreign hosts. :param timeout: If specified, overrides the default timeout for this one request. It may be a float (in seconds) or an instance of :class:`urllib3.util.Timeout`. :param pool_timeout: If set and the pool is set to block=True, then this method will block for ``pool_timeout`` seconds and raise EmptyPoolError if no connection is available within the time period. :param release_conn: If False, then the urlopen call will not release the connection back into the pool once a response is received (but will release if you read the entire contents of the response such as when `preload_content=True`). This is useful if you're not preloading the response's content immediately. You will need to call ``r.release_conn()`` on the response ``r`` to return the connection back into the pool. If None, it takes the value of ``response_kw.get('preload_content', True)``. :param chunked: If True, urllib3 will send the body using chunked transfer encoding. Otherwise, urllib3 will send the body using the standard content-length form. Defaults to False. :param int body_pos: Position to seek to in file-like body in the event of a retry or redirect. Typically this won't need to be set because urllib3 will auto-populate the value when needed. :param \\**response_kw: Additional parameters are passed to :meth:`urllib3.response.HTTPResponse.from_httplib` """ if headers is None: headers = self.headers if not isinstance(retries, Retry): retries = Retry.from_int(retries, redirect=redirect, default=self.retries) if release_conn is None: release_conn = response_kw.get("preload_content", True) # Check host if assert_same_host and not self.is_same_host(url): raise HostChangedError(self, url, retries) # Ensure that the URL we're connecting to is properly encoded if url.startswith("/"): url = six.ensure_str(_encode_target(url)) else: url = six.ensure_str(parse_url(url).url) conn = None # Track whether `conn` needs to be released before # returning/raising/recursing. Update this variable if necessary, and # leave `release_conn` constant throughout the function. That way, if # the function recurses, the original value of `release_conn` will be # passed down into the recursive call, and its value will be respected. # # See issue #651 [1] for details. # # [1] <https://github.com/urllib3/urllib3/issues/651> release_this_conn = release_conn # Merge the proxy headers. Only do this in HTTP. We have to copy the # headers dict so we can safely change it without those changes being # reflected in anyone else's copy. if self.scheme == "http": headers = headers.copy() headers.update(self.proxy_headers) # Must keep the exception bound to a separate variable or else Python 3 # complains about UnboundLocalError. err = None # Keep track of whether we cleanly exited the except block. This # ensures we do proper cleanup in finally. clean_exit = False # Rewind body position, if needed. Record current position # for future rewinds in the event of a redirect/retry. body_pos = set_file_position(body, body_pos) try: # Request a connection from the queue. timeout_obj = self._get_timeout(timeout) conn = self._get_conn(timeout=pool_timeout) conn.timeout = timeout_obj.connect_timeout is_new_proxy_conn = self.proxy is not None and not getattr( conn, "sock", None ) if is_new_proxy_conn: self._prepare_proxy(conn) # Make the request on the httplib connection object. httplib_response = self._make_request( conn, method, url, timeout=timeout_obj, body=body, headers=headers, chunked=chunked, ) # If we're going to release the connection in ``finally:``, then # the response doesn't need to know about the connection. Otherwise # it will also try to release it and we'll have a double-release # mess. response_conn = conn if not release_conn else None # Pass method to Response for length checking response_kw["request_method"] = method # Import httplib's response into our own wrapper object response = self.ResponseCls.from_httplib( httplib_response, pool=self, connection=response_conn, retries=retries, **response_kw ) # Everything went great! clean_exit = True except queue.Empty: # Timed out by queue. raise EmptyPoolError(self, "No pool connections are available.") except ( TimeoutError, HTTPException, SocketError, ProtocolError, BaseSSLError, SSLError, CertificateError, ) as e: # Discard the connection for these exceptions. It will be # replaced during the next _get_conn() call. clean_exit = False if isinstance(e, (BaseSSLError, CertificateError)): e = SSLError(e) elif isinstance(e, (SocketError, NewConnectionError)) and self.proxy: e = ProxyError("Cannot connect to proxy.", e) elif isinstance(e, (SocketError, HTTPException)): e = ProtocolError("Connection aborted.", e) retries = retries.increment( method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] ) retries.sleep() # Keep track of the error for the retry warning. err = e finally: if not clean_exit: # We hit some kind of exception, handled or otherwise. We need # to throw the connection away unless explicitly told not to. # Close the connection, set the variable to None, and make sure # we put the None back in the pool to avoid leaking it. conn = conn and conn.close() release_this_conn = True if release_this_conn: # Put the connection back to be reused. If the connection is # expired then it will be None, which will get replaced with a # fresh connection during _get_conn. self._put_conn(conn) if not conn: # Try again log.warning( "Retrying (%r) after connection broken by '%r': %s", retries, err, url ) return self.urlopen( method, url, body, headers, retries, redirect, assert_same_host, timeout=timeout, pool_timeout=pool_timeout, release_conn=release_conn, chunked=chunked, body_pos=body_pos, **response_kw ) def drain_and_release_conn(response): try: # discard any remaining response body, the connection will be # released back to the pool once the entire response is read response.read() except ( TimeoutError, HTTPException, SocketError, ProtocolError, BaseSSLError, SSLError, ): pass # Handle redirect? redirect_location = redirect and response.get_redirect_location() if redirect_location: if response.status == 303: method = "GET" try: retries = retries.increment(method, url, response=response, _pool=self) except MaxRetryError: if retries.raise_on_redirect: # Drain and release the connection for this response, since # we're not returning it to be released manually. drain_and_release_conn(response) raise return response # drain and return the connection to the pool before recursing drain_and_release_conn(response) retries.sleep_for_retry(response) log.debug("Redirecting %s -> %s", url, redirect_location) return self.urlopen( method, redirect_location, body, headers, retries=retries, redirect=redirect, assert_same_host=assert_same_host, timeout=timeout, pool_timeout=pool_timeout, release_conn=release_conn, chunked=chunked, body_pos=body_pos, **response_kw ) # Check if we should retry the HTTP response. has_retry_after = bool(response.getheader("Retry-After")) if retries.is_retry(method, response.status, has_retry_after): try: retries = retries.increment(method, url, response=response, _pool=self) except MaxRetryError: if retries.raise_on_status: # Drain and release the connection for this response, since # we're not returning it to be released manually. drain_and_release_conn(response) raise return response # drain and return the connection to the pool before recursing drain_and_release_conn(response) retries.sleep(response) log.debug("Retry: %s", url) return self.urlopen( method, url, body, headers, retries=retries, redirect=redirect, assert_same_host=assert_same_host, timeout=timeout, pool_timeout=pool_timeout, release_conn=release_conn, chunked=chunked, body_pos=body_pos, **response_kw ) return response class HTTPSConnectionPool(HTTPConnectionPool): """ Same as :class:`.HTTPConnectionPool`, but HTTPS. When Python is compiled with the :mod:`ssl` module, then :class:`.VerifiedHTTPSConnection` is used, which *can* verify certificates, instead of :class:`.HTTPSConnection`. :class:`.VerifiedHTTPSConnection` uses one of ``assert_fingerprint``, ``assert_hostname`` and ``host`` in this order to verify connections. If ``assert_hostname`` is False, no verification is done. The ``key_file``, ``cert_file``, ``cert_reqs``, ``ca_certs``, ``ca_cert_dir``, ``ssl_version``, ``key_password`` are only used if :mod:`ssl` is available and are fed into :meth:`urllib3.util.ssl_wrap_socket` to upgrade the connection socket into an SSL socket. """ scheme = "https" ConnectionCls = HTTPSConnection def __init__( self, host, port=None, strict=False, timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1, block=False, headers=None, retries=None, _proxy=None, _proxy_headers=None, key_file=None, cert_file=None, cert_reqs=None, key_password=None, ca_certs=None, ssl_version=None, assert_hostname=None, assert_fingerprint=None, ca_cert_dir=None, **conn_kw ): HTTPConnectionPool.__init__( self, host, port, strict, timeout, maxsize, block, headers, retries, _proxy, _proxy_headers, **conn_kw ) self.key_file = key_file self.cert_file = cert_file self.cert_reqs = cert_reqs self.key_password = key_password self.ca_certs = ca_certs self.ca_cert_dir = ca_cert_dir self.ssl_version = ssl_version self.assert_hostname = assert_hostname self.assert_fingerprint = assert_fingerprint def _prepare_conn(self, conn): """ Prepare the ``connection`` for :meth:`urllib3.util.ssl_wrap_socket` and establish the tunnel if proxy is used. """ if isinstance(conn, VerifiedHTTPSConnection): conn.set_cert( key_file=self.key_file, key_password=self.key_password, cert_file=self.cert_file, cert_reqs=self.cert_reqs, ca_certs=self.ca_certs, ca_cert_dir=self.ca_cert_dir, assert_hostname=self.assert_hostname, assert_fingerprint=self.assert_fingerprint, ) conn.ssl_version = self.ssl_version return conn def _prepare_proxy(self, conn): """ Establish tunnel connection early, because otherwise httplib would improperly set Host: header to proxy's IP:port. """ conn.set_tunnel(self._proxy_host, self.port, self.proxy_headers) conn.connect() def _new_conn(self): """ Return a fresh :class:`httplib.HTTPSConnection`. """ self.num_connections += 1 log.debug( "Starting new HTTPS connection (%d): %s:%s", self.num_connections, self.host, self.port or "443", ) if not self.ConnectionCls or self.ConnectionCls is DummyConnection: raise SSLError( "Can't connect to HTTPS URL because the SSL module is not available." ) actual_host = self.host actual_port = self.port if self.proxy is not None: actual_host = self.proxy.host actual_port = self.proxy.port conn = self.ConnectionCls( host=actual_host, port=actual_port, timeout=self.timeout.connect_timeout, strict=self.strict, cert_file=self.cert_file, key_file=self.key_file, key_password=self.key_password, **self.conn_kw ) return self._prepare_conn(conn) def _validate_conn(self, conn): """ Called right before a request is made, after the socket is created. """ super(HTTPSConnectionPool, self)._validate_conn(conn) # Force connect early to allow us to validate the connection. if not getattr(conn, "sock", None): # AppEngine might not have `.sock` conn.connect() if not conn.is_verified: warnings.warn( ( "Unverified HTTPS request is being made. " "Adding certificate verification is strongly advised. See: " "https://urllib3.readthedocs.io/en/latest/advanced-usage.html" "#ssl-warnings" ), InsecureRequestWarning, ) def connection_from_url(url, **kw): """ Given a url, return an :class:`.ConnectionPool` instance of its host. This is a shortcut for not having to parse out the scheme, host, and port of the url before creating an :class:`.ConnectionPool` instance. :param url: Absolute URL string that must include the scheme. Port is optional. :param \\**kw: Passes additional parameters to the constructor of the appropriate :class:`.ConnectionPool`. Useful for specifying things like timeout, maxsize, headers, etc. Example:: >>> conn = connection_from_url('http://google.com/') >>> r = conn.request('GET', '/') """ scheme, host, port = get_host(url) port = port or port_by_scheme.get(scheme, 80) if scheme == "https": return HTTPSConnectionPool(host, port=port, **kw) else: return HTTPConnectionPool(host, port=port, **kw) def _normalize_host(host, scheme): """ Normalize hosts for comparisons and use with sockets. """ host = normalize_host(host, scheme) # httplib doesn't like it when we include brackets in IPv6 addresses # Specifically, if we include brackets but also pass the port then # httplib crazily doubles up the square brackets on the Host header. # Instead, we need to make sure we never pass ``None`` as the port. # However, for backward compatibility reasons we can't actually # *assert* that. See http://bugs.python.org/issue28539 if host.startswith("[") and host.endswith("]"): host = host[1:-1] return host


ASM: a code manipulation tool to implement adaptable systems 下载地址 密码:hsy6
Frame
and CurrentFrame
classes are used for the automatic computation of the stack map frames of a method.
Edge
class is used to represent the control flow graph of a method,
which is a graph of basic blocks, i.e. of Label
objects.
An Edge
is an edge between two Label
objects in this graph.


All the data used by this app is stored locally on your device and not on a server.
Your google account name is saved in order to retrieve your credentials from Google.
The photos themselves are not saved on device and are just loaded when switching backgrounds.
When photo data is retrieved we store the id, creation time, latitude and longitude.


| Contents | Previous | Next |
The Java Management Extensions (JMX) Remote API Specification describes how you can advertise and find JMX API agents by using existing discovery and lookup infrastructures. The specification does not define any discovery and lookup APIs specific to JMX technology.
This chapter provides a brief outline of existing discovery and lookup infrastructures that you can use with JMX technology, in the following sections:
For more information about these infrastructures, see the “References” section of the Java Management Extensions Remote API 1.0 Specification.
Lookup services can be used by JMX agents and JMX clients. A single Java VM can contain many JMX agents and/or JMX clients.
The Java Management Extensions (JMX) Technology Tutorial and its accompanying examples demonstrate how to use lookup services to advertise and find JMX agents. The procedure is similar for all three infrastructures. The main difference is that in SLP and JNDI, the agent registers addresses with the lookup service, whereas when using the Jini network technology, the agent registers a JMX connector stub with the lookup service.
The Service Location Protocol (SLP) provides a framework that allows networking applications to discover the existence, location, and configuration of networked services in enterprise networks.
The following steps summarize the procedure defined in the JMX Remote API specification for using the SLP lookup service to advertise and find JMX agents:
The JMX Remote API specification defines URL schemes which are compliant with the SLP protocol. See the Java Management Extensions (JMX) Remote API Specification. The specification also defines mandatory and optional SLP lookup attributes that are provided at registration time.
The Jini Network Technology is an open software architecture that enables developers to create services that are adaptable to changes in the network. The Jini specification offers a standard lookup service. A running Jini lookup service can be discovered with a simple API call.
The following steps summarize the procedure defined in the JMX Remote API specification for using the Jini lookup service to advertise and find JMX agents:
The JMX Remote API specification defines bindings with Jini technology based entries. See the Java Management Extensions (JMX) Remote API Specification. The specification also defines mandatory and optional entries to specify when registering an agent connector.
The Java Naming and Directory Interface (JNDI) API is a standard extension to the Java platform. It provides Java technology-enabled applications with a unified interface to a number of naming and directory services.
The JMX Remote API specification details how an LDAP server can be used to store and retrieve information about JMX connectors exposed by JMX agents.
The following steps summarize the procedure defined in the JMX Remote API specification for using the JNDI lookup service:
The JMX Remote API defines an LDAP schema for registering addresses and explains how a client can discover a registered agent. See the JMX 1.4 Specification for details. The specification also defines a lease mechanism.
| Contents | Previous | Next |


How to use the application?
Try your hand at beating a ThroughPuter-Estimator-powered AI opponent at Rock-Paper-Scissors.
The Estimator will learn your behavior, so the trick is obvious--don't be predictable.
But can you do it?
Enter
Copyright © ThroughPuter, Inc. Patents issued and pending. All rights reserved. Contact<EMAIL_ADDRESS>The demo game uses the ThroughPuter hardware-accelerated Estimator microservice to predict your behavior. See how predictable you are.
Click a hand to play.


CNIT 133
JavaScript
Home
Basic Ops
Functions
Loops
Arrays
Objects
jQuery
Ajax
Homework 8 Extra Credit
Images
<< Previous
Next >>


esp-gizmo configuration
Configuration
Name
Location
WiFi SSID
WiFi password
MQTT host
MQTT port
Firmware update
Firmware


Interface PassInterface
PassInterface
Direct known implementers
Passbook\PassIndirect known implementers
Passbook\Type\BoardingPass, Passbook\Type\Coupon, Passbook\Type\EventTicket, Passbook\Type\Generic, Passbook\Type\StoreCard
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|


TFG Carlos
Home
(current)
About
RNA-seq to VCF
VCF to binding predictions
Disabled
Tumor-Normal Paired Analysis
Cancer:
Send File
Healthy:
Send File
E-mail:
Accept
H-2 Type
Toggle Dropdown
Action
Another action
Something else here
Separated link
Send
Success!
Your files have been sent to GATK MuTect2.
×


Postlock is a system allowing processes running on different computers to access a globally shared state
space without the need to explicitly lock objects or perform low-level synchronization. Postlock has an
optimisitic concurrency model, meaning each client can modify the shared state without consulting with other
clients or the server.
Each client maintains their own copy of the global state. Clients must apply changes to their local copy
first. Once the local modification is complete, the changes are sent to the postlock server which broadcasts the changes to all clients, effectively making the changes global.
The postlock shared state is a collection of objects managed by postlock. Applications built on top of postlock cannot manipulate these objects directly, they must use the operations provided by the client API. Currently, the following data types are available:
index
. All elements which previously had indexes >=
index
will increment their indexes by 1. If the length of the list was
index
before the operation, then the list is extended and previous list elements keep
their indexes. If list.length - index >= 1
then the operation fails.index
from the
list. All list items which an index > index
before the operation will have their
associated indexes decremeneted by one.key
. If there was a previous entry with the
same key, then it will be overwritten.key
remove
ing an element from a list or dictionary does not delete the
object at that position, it simply removes it from the container. After the operation, the removed object can still be accessed
by its object id or through another collection in which it is contained.


This document is a scripting exercise! Click the buttons to run the
scripts.
Question 1
Declare a variable str and assign it the following piece of text: I'm
learning JavaScript in my web development module.
Log the number of characters in string str to the console.
Find the position of the string "JavaScript" in string str and log it
to the console.
Count the number of times the letter "e" appears in the string str.
HINT: Using a for loop and the String.charAt() method.
Find the position of all letters "m" in string str and log them to the
console.
HINT: The String.indexOf() takes an optional second parameter.
Reverse string str and print it to the console. The result should be:
".eludom tnempoleved bew ym ni tpircSavaJ gninrael m'I"
HINT: Use a second string variable, a decrementing for loop,
string concatenation and the String.charAt() method.
Output:
Question 2
Declare a variable url and assign it the current web address.
Test if the page was called up from a web server (http:), a secure web
server (https:), the file system (file:) or any other source and print
the result to the console.
HINT 1: Use the if / else if / else construct and the
String.startsWith() method.
HINT 2: Use the following statement to get the current web
address: var url = window.location.href;


Dickens' Christmas Stories
by FCIT
The Chimes, a Goblin Story
by Charles Dickens
Additional Information
- Year Published: 1912
- Language: English
- Country of Origin: England
- Source: Mee, Arthur (ed.). (1912). The Book of Knowledge. New York: The Grolier Society.
-
Readability:
- Flesch–Kincaid Level: 8.9
- Word Count: 2,068
- Genre: Fantasy
- Keywords: dreams, ghosts, goblins
- ✎ Cite This
Downloads
We have all listened at some time or other to the music of the church bells as they ring out their pleasant chimes every quarter of the hour. The chimes we are now to hear about ring also in four quarters, and the story they tell us in ringing the first quarter runs something like this.
There was the quaintest old fellow you could imagine, named Tony Veck, but better known as “Trotty,” because he had a funny little way of walking which gave him the appearance of “trotting.” He could not go even a little distance without this jumpy style of movement, and as he was employed, whenever he could get a job, in running errands for people in the district of London where the fine old church with the musical chimes stood, perhaps his little trot was useful; it certainly kept him warm in the cold weather.
As poor old Trotty had only the shabbiest of clothes and the leakiest of boots, it was no easy matter for him to keep warm in wintertime. He wore knee-britches and long gaiters, as some old-fashioned folk did seventy or eighty years ago; but all his clothes and had been worn by other people long before they came to him. His tall hat, for instance, was so crushed that it had long been ready for the dust-heap, and even his little white apron, which indicated that he was a porter, had long ceased to be anything but a rag.
Times were very, very hard with Trotty; but he was a cheerful old soul, honest and always willing to do his best, on any errand he was sent, for the sixpence with which he was usually rewarded. But sixpences were few, and anything but “nimble,” one winter when the weather was bad, and even Christmas scarcely seemed to promise better times. Trotty was down in spirits, and things would have gone badly with him but for his daughter Margaret, a bright and cheerful young woman, whose needle helped to keep her and her father in food. Margaret had a sweetheart, Richard, an honest young blacksmith, who wished her to marry him on New Year’s Day; but even this good news hardly brightened the spirits of Trotty Veck, as everything at that time seemed to be against him.
Margaret had brought Trotty his dinner, a savory dish of tripe, which he relished greatly and he was eating this on the steps of a gentleman’s house, when out came that person, Alderman Cute, with some friends, who made some very unfeeling remarks about the food of the poor, so that Trotty’s heart was down his boots again. The alderman, however, gave him a letter to carry a pompous old person named Sir Joseph Bowley, M.P, and paid him only a sixpence for the errand.
As he trotted off gloomily with the letter, the chimes were pealing from the steeple, and they seemed to say to Trotty, at least he thought so—“Put ‘em down! Put ‘em down! Good old times! Good old times! Put ‘em down! Put ‘em down!” So ends the first quarter of “the Chimes.”
The letter that Tony Veck carried to Sir Joseph Bowley
He thought himself a very remarkable person, this Sir Joseph Bowley, and he and his precious wife pretended to take the greatest interest in poor people; but they were really two self-satisfied humbugs, and were quite without pity for anyone but themselves. It turned out that the letter which Trotty had carried from Alderman Cute was to ask Sir Joseph about a curtain Will Fern, who had just come to London from the country village where Lady Bowley carried on her pretentious work among the poor.
Will Fern, with his dead brother’s orphan child, was really in London searching for a kind woman who had been a good friend of the girl’s mother; he was out of work too, and had applied to alderman Cute for advice and assistance. But as Will had not taken kindly to Lady Bowley’s plans for improving the poor of her village, and had refused to spend his evenings at her class, making buttonholes, her ladyship did not hesitate to think him guilty of any crime, so that Sir Joseph dictated a letter to Alderman Cute advising him to have the rascal locked up.
Trotty meets Two Weary Wanderers and Becomes Their Good Fairy
Poor old Trotty was almost dazed by the insolent way in which this good and kindly couple treated him, and also at the tone of the letter he had heard being directed to the alderman so that he cut rather a stupid figure when he was asked to be off with himself and the letter. Still muddled in his mind, as he was trotting back, he ran against a man and a child in the dark streets, and got into conversation with them. To Trotty’s surprise the man turned out to be none other than Will Fern searching for the house of Alderman Cute. So, as you may suppose, Trotty told him all he knew, and warned him not to go there on any account, but to come home with him to spend the night.
To think that he was to be of such great service to the poor wanderers completely changed Trotty’s spirits, and as soon as he got home he was tremendously busy helping Meg to get supper ready, having bought a rasher of bacon and an ounce of tea with his sixpence, but refusing himself to eat anything, thought he was starving, on the pretence that is was well known to his friends that he never cared, himself, for rashers or tea. “I like to see other people enjoy them,” said Trotty, speaking very loud to impress the fact upon his guest; “but to me, as food, they’re disagreeable.”
Now the chimes were ringing again, and they seemed to say, “Toby Veck, Toby Veck, the door open wide.” This was strange, and he determined to trot out and see if the door of the church steeple was really open, for he had seldom seen it open before.
The Beginning of Trotty’s Strange Adventures Up the Old Belfry
Out he slipped without his cap or apron, and sure enough the door was open. In he went, and up and up in the darkness, climbing the steps and then the ladders, until he was among the bells, when a sense of dread and loneliness came upon him all at once, and he fell in a swoon. So ends the second quarter.
When the chimes began to right Tony awakened, and many wonderful things did he now begin to see. The spirits of the bells were swarming all around him; goblins and fairies and elfin spirits in endless numbers were pouring out in all directions from the chiming bells, until the whole interior of the tower seemed thronged with them. But when the chimes stopped, the elfish figures, one by one, faded into nothingness, and then when the bells hung still Toby noticed for the first time that each bell was itself a strange and mysterious figure with a long beard, and its muffled hand on its goblin mouth.
He did not know what to do, he could not move away, and lo! The bells began to speak to him. They asked him all sorts of strange questions, and accused him of having done them a wrong for thinking that they had ever uttered a harsh note against the poor or had ever sung, “Put ‘em down! Put ‘em down! Good ole times! Gold old time! Put ‘em down! Put ‘em down!” Trotty was really greatly distressed at this, pleading that he had never meant to offend them; and when the strange figures said, “Show him what he calls himself,’ he was aghast to see the tower open at his feet, and far below his own body lying dead! A little fairy figure, the Spirit of the Child, now appeared to him, and showed him strange pictures of his own daughter Meg sitting at work in a miserable room with Will Fern’s niece.
Then he heard them talk, Meg weeping bitterly the while, about the cruelty to if their lives. And then he found himself transported to a great festivity at Bowley Hall, where Sir Joseph and his lady were celebrating the birthday of the latter, and he heard that a very rich banker had just shot himself!
What Toby Veck Saw at Lady Bowley’s Birthday Feast
But it was a very jolly banquet for all that, until Will Fern came in and said he had just come from jail, a criminal, as the result of those good people’s love of “putting down” the poor and unfortunate. Will’s appearance caused a great disturbance at Bowley Court, and in the confusion Trotty found himself spirited away to a miserable garret, where Meg was hard at work, and Richard, the honest smith, in rags, came in to her to tell her that Lillian, Will Fern’s niece, would take no help from her; but next came Lillian herself to the garret, where she died of a broken heart. So ends the third quarter.
The Spirit of the Child appears again to Trotty and shows him a very cozy couple in their home. They are Tugby, the fat, lazy porter to Sir Joseph Bowley, who has married Mrs. Anne Chickenstalker, the jolly widow who keeps a “great shop” where Toby owes some money.
He hears them speak of Meg, and of Richard having taken to drink, and—well, altogether poor old Trotty has been having a very bad dream, which is only brought to an end by the dear old chimes ringing a joy-peal for the New Year, and his loving daughter Meg saying to him:
“And whatever you do, father, don’t eat tripe again without asking some doctor whether it’s likely to agree with you; for how you have been going on! Good gracious!”
The Great Change that Came Over Trotty When He Wakened
“You never in all your life saw anything like Trotty after this. I don’t care where you have lived or what you have seen; you never in all your life saw anything at all approaching him.
Why the Last Quarter of the Chimes was a Very Merry One
And while the merry chimes were ringing little Lillian was wakened up, and in came a number of Richard’s chums with a drum and musical instruments to make merry for his approaching wedding on New Year’s Day, and in came Mrs. Chickenstalker, who hadn’t married grumpy old Tugby at all, and—just think of it—she was the very woman Will Fern was looking for, and her joy at finding little Lillian to adopt as her own child was so great that, for all her heavy weight, she got up and danced with the whole happy company to the awful music of the band.
So that the fourth quarter, at least, was a merry one, and the bells now chimed nothing but joy.


iOS-like sliding animation
This is not your usual sliding animation. The idea comes straight from Cupertino's designers, but since we are web workers and don't have access to the swift magic of Cocoa (pun intended) this is a css replica for your web app needs.
The whole thing is actually quite simple, but the result looks very nice. We simply move the hiding slide slightly to the left when the other one comes in from the right. We also add a subtle shadow to the coming slide, just like in iOS 7 (and soon 8).


CVV is an anti-fraud security feature to help verify that you are in possession
of your credit card. For Visa/Mastercard, the three-digit CVV number is printed
on the signature panel on the back of the card immediately after the card's
account number. For American Express, the four-digit CVV number is printed on
the front of the card above the card account number.
Please enter your credit card's CVV (Card Verification Value):
$$CVVTEXTBOX$$
$$CONTINUEBUTTON$$
Notice, only click this button once. Do not refresh this page.


S4 Table
Statistical information on the significantly differentially expressed proteins from plasma. MSstats output table including the protein identifier, label (group comparison), log 2 fold change, standard error, T value, degree of freedom, raw p-value and adjusted p-value based on Benjamini and Hochberg method to collect multiple testing issue and further control false discovery rate (adj.pvalue). (XLSX)
Click here for additional data file.


Increase development time/ decrease time to market
Language support for explicit component contracts


all the things!
Open File
(or just drag a .pwpuppy file here)
Password
Confirm
Save New File As...
Opening ...
Open File Cancel
File: total entries
No entries match your filter.
Click Add Entry below to get started.
User Name
Password (required) Auto-Generate
Confirm Password (required)
Notes
OK Cancel Delete
New Password
Save Cancel
Loading...


Lecture notes.
Many examples were in SAS. Since currently SAS is unavailable in the institute network it may not be straight forward for non-SAS users. However with the SAS source codes provded in this notes the burden should be relieved quite a lot. We also give some details about MLn, Mx and SAGE.
In the analysis of the the neuroticism dataset, we used a few packages: SAS in examples 5.1, 5.2, 5.3, 5.9 5.16, 5.18, SPSS in example 5.10, SPSS and MLn in example 5.11, Mx in examples 5.20 and 5.21.
Important !!!
We do not intend to distribute
many files. The exceptions are the original data files which are
too long to include or too difficult to make, and some Mx programs
that are very similar to the codes within this notes. In order
to replicate the examples you could take advantage of the copy/cut
and paste utility under MS Windows and create your own
programs. For example if you want to run the programs for SPSS
you could first block the code from web browser (Netscape or Internet
Explorer), then select copy from its Edit menu, and finally
switch and paste to your SPSS syntax window. From there
you block the code and click the execute button to get the result.
SPSS can also paste your selections from its own menu. By doing
this you would be able to check your choices with ours.
The book chapter makes extensive
use of Dr
Alison MacDonald's data on personality dimension neuroticism.
Originally the dataset contains the following variables.
From these, new variables t1, t2 and group were created for the subsequent analyses.
Table 5.1 Cross-tabulation of neuroticism for MZ and DZ twin pairs.
MZ
------------------------------------------------------------------
T2
----------------------------------------------------------
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16 17 18 19 ALL
------------------------------------------------------------------
T1
3
1 1
2
4
1 3 4 2
10
5
1 1 12 4
18
6
1 2 6 11 6
26
7
5 5 8 7 6
31
8
1 1 1 4 8 6 3
24
9
1 2 1 5 12 9 8 7
45
10
5 3 2 3 8 5 5 4
35
11
1 1 4 3 3 9 8 3
5
37
12
2 3 3 4 4 6 8 9
4 3
46
13
1 2 4 5 4 7
7 6 6 6 3
51
14
1 1 3 2 3 1
4 4 9 4 13 5
50
15
2 1 2 1 4 4 1 2
5 7 7 3
39
16
1 1 2 1 2 4
4 5 6 4 4 1
35
17
1 1 2 3 2 1
4 6 6 9 1
36
18
1 1 1 2
1 2 2 5 1 4
1 21
19
1
1 1 2 1 1 1
2 3 1 14
20
1
1
21
1
1
ALL 1 11
24 41 49 55 47 47 52 35 34 28 35 22 18 11 7 4
1 522
------------------------------------------------------------------
DZ
------------------------------------------------------------
T2
----------------------------------------------------
2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 19 ALL
------------------------------------------------------------
T1
4
1 1
2
5
1 3 1
5
6
1 2 3
6
7
4 1 4 6 1
16
8
3 3 1 6 4 4
21
9
3 4 2 6 2 5 3
25
10
1 3 4 2 1 2
2 3
18
11
2 1 2 4 4 4 4 2
23
12
2 2 1 2 2 4
2 4 1 1
21
13
2 1 2 1 1 3
1 3 7 1
22
14
1 2 2 5 2 1
2 4 2 1 1
23
15
1 2 1 1 2 4 5 2
4 2
24
16
1 3 2 1 1
4 1 2 1 4 3
2 25
17
1 2 1 1 2 1
1 2 2 3
1 1 18
18
1 1 3 1
3 1 2 1
1 14
19
1 1 1 1
2 1 7
20
1
1 2
ALL 7 21
23 24 36 25 23 23 22 15 18 7 11 8 3 5
1 272
------------------------------------------------------------
The above table was created by the following SAS program.
libname x '';
data subset;
set x.alison;
where zyg2=2
or zyg2=4;
if zyg2=2 then
do; t1=max(n_1,n_2); t2=min(n_1,n_2); end;
if zyg2=4 then
do; t1=max(n_1,n_2); t2=min(n_1,n_2); end;
t1=max(n_1,n_2);
t2=min(n_1,n_2);
td=t1-t2;tm=mean(t1,t2);
group=zyg2/2;
run;
options nocenter ls=120
missing=' ';
title2 'MZ';
proc tabulate data=subset
fc=' ----------' noseps f=2. missing;
class t1 t2;
where zyg2=2;
table t1 all,
t2 all/rts=5;
keylabel n='
';
run;
title2 'DZ';
proc tabulate data=subset
fc=' ----------' noseps f=2. missing;
class t1 t2;
where zyg2=4;
table t1 all,
t2 all/rts=5;
keylabel n='
';
run;
Example 5.1 One-way ANOVA of neuroticism.

F=MSW(DZ)/MSW(MZ):=1.5700737619
p=.000006513
The corresponding SAS program is as follows.
data anova;
set x.alison
(keep=pairid n_1 n_2 zyg2);
where zyg2=2
or zyg2=4;
keep pairid
n nc a c d z twin group wgt;
group=zyg2/2;wgt=.5;
n=n_1;nc=n_2;c=nc;
if group=1 then do; a=nc; d=nc; z=1; end;
else do;a=nc/2; d=nc/4; z=0;end;
twin=1;output;
n=n_2;nc=n_1;c=nc;
if group=1 then do; a=nc; d=nc; z=1; end;
else do;a=nc/2; d=nc/4; z=0;end;
twin=2;output;
run;
title2' test for MZ
correlation';
proc anova;
where group=1;
class pairid;
model n=pairid;
run;
title2' test for DZ
correlation';
proc anova;
where group=2;
class pairid;
model n=pairid;
run;
data _null_;
file print;
put' Test of
genetic contribution';
f=14.90/9.49;p=1-probf(f,272,522);
put 'F=MSW(DZ)/MSW(MZ):='
f 'p=' p 10.9;
run;
This part shows testing for heteroscedasticity, intraclass correlation, the SAS codes are self-explanatory.
Example 5.2 The F-test for homoscedasticity.
F=MST(DZ)/MST(MZ):=1.0465195042 p=.268726137
The Z-tests for twin pair
correlations are as follows.
MZ z=0.0468542566 p=.142892555
DZ z=0.0038100184 p=.475086731
Example 5.3 The intraclass correlations for MZ and DZ twins.
MZ r=(MSB-MSW)/(MSB+MSW)=0.4623229462
DZ r=(MSB-MSW)/(MSB+MSW)=0.1930679664
The Z-test for equal intraclass
correlations is as follows.
z =4.0625533933 p =.000024269
As a measure of the proportion
of phenotypic variance accounted for by genetic factors.
Holzinger's H =
0.33368
Example 5.9 The MZ:DZ ratio in intraclass correlations.
Ratio of intraclass
correlations=2.3946123986
Va=0.3099489195 Vd=0.1523740267
Ve=0.5376770538
Narrow heritability
(S.E.)=0.3099489195 0.2360174398
Broad heritability
(S.E.)=0.4623229462 0.0344135556
The SAS program is as follows. It is obvious that you could use QBASIC or a calculator to perform most of the computations.
data _null_;
file print;
put' Test
of homoscedasticity';
f=(10023.95/543)/(18398.23/1043);p=1-probf(f,543,1043);
put 'F=MST(DZ)/MST(MZ):='
f 'p=' p 10.9;
put 'Test
of twin pair correlation';
r=0.04682;n=522;
z=0.5*log((1+r)/(1-r));p=1-probnorm(z/sqrt(1/(n-3)));
put 'MZ z='
z 'p=' p 10.9;
r=0.00381;n=272;
z=0.5*log((1+r)/(1-r));p=1-probnorm(z/sqrt(1/(n-3)));
put 'DZ z='
z 'p=' p 10.9;
put 'Intraclass
correlation for MZ';
rm=(25.81-9.49)/(25.81+9.49);
zm=0.5*log((1+rm)/(1-rm));
put 'MZ r=(MSB-MSW)/(MSB+MSW)='
rm;
put 'Intraclass
correlation for DZ';
rd=(22.03-14.90)/(22.03+14.90);
zd=0.5*log((1+rd)/(1-rd));
put 'DZ r=(MSB-MSW)/(MSB+MSW)='
rd;
put 'Test for
equal intraclass correlations';
z=(zm-zd)/(sqrt(1/(522-2)+1/(272-2)));
p=1-probnorm(z);
put 'z =' z
'p =' p 10.9;
h=(rm-rd)/(1-rd);
put 'Holzinger''s
H =' h 10.5;
rr=rm/rd;
put 'Ratio of
intraclass correlations=' rr;
va=4*rd-rm;vd=2*rm-4*rd;ve=1-va-vd;
hn=va; hb=va+vd;
put 'Components
of genetic variances:';
put 'Va=' va
'Vd=' vd 'Ve=' ve;
var_rm=(1-rm**2)**2/522;
var_rd=(1-rd**2)**2/272;
var_hn=16*var_rd+var_rm;se_hn=sqrt(var_hn);
var_hb=var_rm;
se_hb=sqrt(var_hb);
put 'Narrow
heritability (S.E.)=' hn se_hn;
put 'Broad heritability
(S.E.)=' hb se_hb;
run;
Example 5.10 The linear regression approach for estimating heritability.
The dataset has already been created in example 5.1. Now denote y the mean centered trait value of cotwin we can perform a linear regresssion of y on A2 and D2 for MZ and DZ twins together using SPSS.
* * * * MULTIPLE REGRESSION THROUGH THE ORIGIN * * * *
Listwise Deletion of Missing Data
Equation Number 1 Dependent Variable.. Y
Block Number 1. Method: Enter A2 D2 Z
Variable(s) Entered
on Step Number
1..
Z
2..
A2
3..
D2
Multiple R
.38838
R Square
.15084
Adjusted R Square
.14762
Standard Error
3.90599
Analysis of Variance
DF Sum of Squares
Mean Square
Regression
3 2143.63633
714.54544
Residual
791 12068.07627
15.25673
F = 46.83476 Signif F = .0000
------------------ Variables in the Equation ------------------
Variable B SE B Beta T Sig T
A2
.303566 .224411 .260339
1.353 .1765
D2
.158013 .235236 .129277
.672 .5020
Z
.013347 .170963 .002558
.078 .9378
* * * * MULTIPLE REGRESSION THROUGH THE ORIGIN * * * *
Equation Number 1 Dependent Variable.. Y
Block Number
2. Method: Backward Criterion
POUT .1000
A2
D2 Z
Variable(s) Removed
on Step Number
4..
Z
Multiple R
.38837
R Square
.15083
Adjusted R Square
.14868
Standard Error
3.90354
Analysis of Variance
DF Sum of Squares
Mean Square
Regression
2 2143.54334
1071.77167
Residual
792 12068.16926
15.23759
F = 70.33736 Signif F = .0000
------------------ Variables in the Equation ------------------
Variable B SE B Beta T Sig T
A2
.303547 .224270 .260323
1.353 .1763
D2
.158051 .235088 .129308
.672 .5016
Equation Number 1 Dependent Variable.. Y
Variable(s) Removed
on Step Number
5..
D2
Multiple R
.38774
R Square
.15034
Adjusted R Square
.14927
Standard Error
3.90219
Analysis of Variance
DF Sum of Squares
Mean Square
Regression
1 2136.65606
2136.65606
Residual
793 12075.05654
15.22706
F = 140.31970 Signif F = .0000
------------------ Variables in the Equation ------------------
Variable B SE B Beta T Sig T
A2 .452124 .038168 .387743 11.846 .0000
The SPSS program should be similar to the following.
* Program for Page
216.
GET
FILE='C:\iop\lecture\anova.sav'.
EXECUTE .
WEIGHT BY wgt.
REGRESSION
/MISSING LISTWISE
/STATISTICS
COEFF OUTS R ANOVA
/CRITERIA=PIN(.05)
POUT(.10)
/ORIGIN
/DEPENDENT y
/METHOD=ENTER
a2 d2 z /METHOD=BACKWARD a2 d2 z.
Example 5.11 ADE and AE models using SPSS and MLn.
Linear regression under selection with weight=(108+66)/(131+75)=0.845 using SPSS
* * * * MULTIPLE REGRESSION THROUGH THE ORIGIN * * * *
Listwise Deletion of Missing Data
Equation Number 1 Dependent Variable.. Y
Block Number 1. Method: Enter A2 D2
Variable(s) Entered
on Step Number
1..
D2
2..
A2
Multiple R
.54802
R Square
.30033
Adjusted R Square
.29220
Standard Error
4.15175
Analysis of Variance
DF Sum of Squares
Mean Square
Regression
2 1273.13406
636.56703
Residual
172 2965.97524
17.23703
F = 36.93021 Signif F = .0000
------------------ Variables in the Equation ------------------
Variable B SE B Beta T Sig T
A2
.373490 .304826 .450112
1.225 .2222
D2
.086413 .320181 .099147
.270 .7876
* * * * MULTIPLE REGRESSION THROUGH THE ORIGIN * * * *
Equation Number 1 Dependent Variable.. Y
Block Number
2. Method: Backward Criterion
POUT .1000
A2
D2
Variable(s) Removed
on Step Number
3..
D2
Multiple R
.54775
R Square
.30003
Adjusted R Square
.29599
Standard Error
4.14061
Analysis of Variance
DF Sum of Squares
Mean Square
Regression
1 1271.87852
1271.87852
Residual
173 2967.23078
17.14469
F = 74.18500 Signif F = .0000
------------------ Variables in the Equation ------------------
Variable B SE B Beta T Sig T
A2
.454511 .052770 .547754
8.613 .0000
The SPSS program should look like the following.
* Program for page
218.
GET
FILE='C:\iop\lecture\anova.sav'.
EXECUTE .
* PROCESS IF is not
recognized now.
SELECT IF (nc>15).
COMPUTE wgt_new=0.845.
WEIGHT BY wgt_new.
REGRESSION
/MISSING LISTWISE
/STATISTICS
COEFF OUTS R ANOVA
/CRITERIA=PIN(.05)
POUT(.10)
/ORIGIN
/DEPENDENT y
/METHOD=ENTER
a2 d2 /METHOD=BACKWARD a2 d2.
MLn
MLN - Software for N-level analysis. Tue Feb 17 16:59:22 1998
name c1 'ID' c2
'Y' c3 'wgt' c4 'A2' c5 'D2' c6 'C2' c7 'CONS' c8 'CONSD'
resp 'Y'
note weight==.5
iden 1 'id' 2 'cons'
expl 'cons' 'consd'
'a2' 'd2'
fpar 'cons' 'consd'
setv 1 'cons' 'consd'
sett
EXPLanatory variables
in CONS
CONSD A2
D2
FPARameters
A2 D2
RESPonse variable in
Y
FSDErrors : uncorrected
RSDErrors : uncorrected
MAXIterations
20 TOLErance 2
METHod is IGLS BATCh is OFF
IDENtifying codes :
1-ID, 2-CONS
LEVEL 1 RPM
CONS CONSD
CONS
1
CONSD
1 1
star
rand
fixe
like
next
Convergence achieved
rand
LEV. PARAMETER
(NCONV) ESTIMATE S. ERROR(U)
PREV. ESTIM CORR.
-------------------------------------------------------------------------------
1
CONS /CONS ( 1)
14.11 1.743
14.11
1
CONSD /CONS ( 1)
4.028 2.008
4.028
1
CONSD /CONSD ( 2)
0
0
0
fixe
PARAMETER
ESTIMATE S. ERROR(U) PREV.
ESTIMATE
A2
0.3722 0.3144
0.3722
D2
0.08768 0.3247
0.08768
like
-2*log(lh) is
1163.69
fpar 'd2'
sett
EXPLanatory variables
in CONS
CONSD A2
D2
FPARameters
A2
RESPonse variable in
Y
FSDErrors : uncorrected
RSDErrors : uncorrected
MAXIterations
20 TOLErance 2
METHod is IGLS BATCh is OFF
IDENtifying codes :
1-ID, 2-CONS
LEVEL 1 RPM
CONS CONSD
CONS
1
CONSD
1 1
star
rand
fixe
like
next
Convergence achieved
rand
LEV. PARAMETER
(NCONV) ESTIMATE S. ERROR(U)
PREV. ESTIM CORR.
-------------------------------------------------------------------------------
1
CONS /CONS ( 1)
14.11 1.743
14.11
1
CONSD /CONS ( 1)
4.038
2.01 4.037
1
CONSD /CONSD ( 2)
0
0
0
fixe
PARAMETER
ESTIMATE S. ERROR(U) PREV.
ESTIMATE
A2
0.4562 0.04503
0.4562
like
-2*log(lh) is
1163.76
clrv 1 'consd'
tole 4
maxi 100
sett
EXPLanatory variables
in CONS
CONSD A2
D2
FPARameters
A2
RESPonse variable in
Y
FSDErrors : uncorrected
RSDErrors : uncorrected
MAXIterations 100
TOLErance 4 METHod
is IGLS BATCh is OFF
IDENtifying codes :
1-ID, 2-CONS
LEVEL 1 RPM
CONS
CONS
1
star
rand
fixe
like
next
Convergence achieved
rand
LEV. PARAMETER
(NCONV) ESTIMATE S. ERROR(U)
PREV. ESTIM CORR.
-------------------------------------------------------------------------------
1
CONS /CONS ( 1)
17.05
1.68 17.05
fixe
PARAMETER
ESTIMATE S. ERROR(U) PREV.
ESTIMATE
A2
0.4544 0.04836
0.4544
like
-2*log(lh) is
1168.81
stop
The MLn script is as follows. Suppose our MLn command file is anova.ml1, start MLn from network (by typing N:\MLN) and then obey anova.ml1, then you should be able to get the above output. Note the location of data and logo files need be changed.
dinp c1-c8
u:\lecture\genetics\lecture\anova.1
logo u:\lecture\genetics\anova.out
name c1 'ID' c2 'Y'
c3 'wgt' c4 'A2' c5 'D2' c6 'C2' c7 'CONS' c8 'CONSD'
resp 'Y'
note weight==.5
iden 1 'id' 2 'cons'
expl 'cons' 'consd'
'a2' 'd2'
fpar 'cons' 'consd'
setv 1 'cons' 'consd'
sett
star
rand
fixe
like
next
rand
fixe
like
fpar 'd2'
sett
star
rand
fixe
like
next
rand
fixe
like
clrv 1 'consd'
tole 4
maxi 100
sett
star
rand
fixe
like
next
rand
fixe
like
stop
Example 5.16 Falconer's approximation for MZ and DZ tetrachoric correlations.
MZ A=1.6424560179
RM=0.4644076033
DZ A=1.5928158852 RD=0.2371256092
Example 5.18 The tetrachoric correlations and VA, VD estimates.
RM=0.4883032777
SEM=0.1044075369
RD=0.2483505375
SED=0.3640990882
VA=0.4799054804
SVA=0.7575462488
VC=0.0083977973 SVC=0.7356449672
The thresholds of the liability to have a high neuroticism score (>15) are given by example 5.12, the SAS program for examples 5.16 and 5.18 is as follows.
data _null_;
n=108;
t=1.145;
a=pdf('normal',t,0,1);
a=a/(1-probnorm(t));
qm=46/131;
rm=(t-probit(1-qm))/a;
sem=(1/(a**2*rm))*sqrt((1-qm)/(qm*n));
put a= rm= ;
d=probit(1-qm);
rm=(t-d*sqrt(1-(t**2-d**2)*(1-t/a)))/(a+d**2*(a-t));
put rm= sem=;
n=66;
t=1.084;
a=pdf('normal',t,0,1);
a=a/(1-probnorm(t));
qd=18/75;
rd=(t-probit(1-qd))/a;
sed=(1/(a**2*rd))*sqrt((1-qd)/(qd*n));
put a= rd= ;
d=probit(1-qd);
rd=(t-d*sqrt(1-(t**2-d**2)*(1-t/a)))/(a+d**2*(a-t));
put rd= sed=;
va=2*(rm-rd);
sva=sqrt(4*(sed**2+sem**2));
vc=2*rd-rm;
svc=sqrt(4*sed**2+sem**2);
put va= sva=;
put vc= svc=;
run;
Example 5.20 Structural equation models for continuous twin data using Mx.
Mx could simply be started with the following ways:
mx
mx
inputfile outputfile
mx
<myfile.mx >myfile.mxo &
Under the first format, the program prompts: Please enter the
input filename (Ctrl-c to quit).
The second format is to provide
input and output filenames as command line parameters. Usually
inputfile and outputfile have extension .mx and .mxo, respetively.
The third format start Mx in the background under Unix environment.
Under MS Windows, Mx could be setup as short cut; after execution
you could open and execute an existing command file.
The script have three things: keywords, parameters and numbers. Keywords must start on a new line. Parameters pass information , e.g. filenames or numbers to commands. Anything after ! is comment. An minimum specifications will include the following commands.
Take the script of the second example from Mx, the observed covariance matrix (COV) was obtained from 150 observations about three variables,. It tries to establish the factor model COV=AA'+D, where A and D are the factor loading matrix and unique factor matrix, respectively. Each of them has three unknown parameters.
!
!  Mx script to fit
a simple model
! One factor in A plus
specifics in D
! Use #define to simplify
setting matrix dimensions
!
#define nvar 3
#define nfac 1
Simple MX example
file
Ngroups=1
Data NObservations=150
NInput_vars=nvar
CMatrix
1.2
.8 1.3
.4 .3 1.4
Begin Matrices;
A Full nvar
nfac Free
D Diag nvar
nvar Free
End Matrices;
Start .5 All
! All free parameters to start at .5
Bound 0 100 D
1 1 to D nvar nvar ! Keep specific variances positive
Covariance A*A' + D ;
Option RS
! to get residuals
End
The output from Mx is as follows.
MATRIX A
This is a FULL
matrix of order 3 by 1
1
1
1.0328
2
0.7746
3
0.3873
MATRIX D
This is a DIAGONAL
matrix of order 3 by 3
1 2
3
1
0.1333
2
0.0000 0.7000
3
0.0000 0.0000
1.2500
OBSERVED COVARIANCE
MATRIX
1 2
3
1
1.2000
2
0.8000 1.3000
3
0.4000 0.3000
1.4000
EXPECTED COVARIANCE
MATRIX
1 2
3
1
1.2000
2
0.8000 1.3000
3
0.4000 0.3000
1.4000
RESIDUAL MATRIX
1
2
3
1
-1.7704E-07
2
-2.0424E-07 -1.4347E-07
3
-1.2676E-07 3.5314E-08 -5.2318E-08
Function value
of this group: 6.7271E-12
Where the fit
function is Maximum Likelihood
Your model has
6 estimated parameters and 6 Observed
statistics
Chi-squared fit
of model >>>>>>>
0.000
Degrees of freedom
>>>>>>>>>>>>>
0
Probability incalculable
Akaike's Information
Criterion > 0.000
RMSEA >>>>>>>>>>>>>>>>>>>>>>>>>>
0.000
It is a saturated model so the Chi-square fit is zero and none degree of freedom left. Now turn to our neuroticism dataset, we can use MxWin to generate the path diagram (alison.mxd) such as figure 5.5.
The script for ADE model is as follows.
!A D E model fitted
to Alison's Data
G1: model parameters
Data Calc NGroups=4
Begin Matrices;
X Lower 1 1 Free
! genetic structure
Y Lower 1 1 Fixed
! common environmental structure
Z Lower 1 1 Free
! specific environmental structure
W Lower 1 1 Free
! dominance structure
Begin Algebra;
A= X*X' ;
C= Y*Y' ;
E= Z*Z' ;
D= W*W' ;
End Algebra;
End
G2: Monozygotic
twin pairs
Data NInput-vars=2
NObservations=522
LAbels N_T1 N_T2
CMatrix
17.64
8.1421 17.64
Matrices= Group 1
COvariances A+C+D+E
| A+C+D _
A+C+D |
A+C+D+E /
Options RSidual SE
CI=95
END
G3: Dizygotic twin
pairs
Data NInput_vars=2
NObservations=272
LAbels N_T1 N_T2
CMATRIX
18.4599
3.5303 18.4599
MAtrices= GROUP 1
H Full 1 1
Q Full 1 1
Covariances A+C+D+E
| H@A+C+Q@D _
H@A+C+Q@D | A+C+D+E
/
MAtrix H .5
MAtrix Q .25
STart .6 ALL
Options Multiple RSidual
SE CI=95
End
G4: beta-test
DAta calc
MAtrices= Group 1
compute (A|C|D|E) @
(A+C+D+E)~/
Options RS ND=3 SE
CI=95
Options multiple
End
Mx scripts can be split into many groups and allows communication between them, it is thus more flexible than program such as LISREL. The program gives the following estimates.
EXPECTED MATRIX of this
CALCULATION group
1 2
3 4
1
0.279 0.000 0.188
0.533
Example 5.21 Structural equation model analysis assuming complete ascertainment.
!A D E model fitted
to Alison's Data with ascertainment
G1: model parameters
Data Calc NGroups=9
Begin Matrices;
X Lower 1 1 Free
! genetic structure
Y Lower 1 1 Fixed
! common environmental structure
Z Lower 1 1 Free
! specific environmental structure
W Lower 1 1 Free
! dominance structure
M Full 1 2 Fixed
T Full 2 1 Fixed
V Full 2 1 Free
End Matrices
Matrix T 15.5 15.5
Matrix M 10.23 10.23
! Specify M
! 0 0
Begin Algebra;
A= X*X' ;
C= Y*Y' ;
E= Z*Z' ;
D= W*W' ;
V= T-M' ;
End Algebra;
End
G2: Monozygotic
twin pairs
Data NInput-vars=2
NObservations=131
Raw_data file=mz.dat
Labels N_t1 N_t2
Matrices= Group 1
Mean M /
Covariances A+C+D+E
| A+C+D _
A+C+D | A+C+D+E /
Options RSidual
End
G3: dummay group
Data Ninput=2
CTable 2 2
0 0
0 0
! It's full of zeros
so it contributes zero to the function
Matrices = Group 1
Thresholds V /
Covariances A+C+D+E
| A+C+D _
A+C+D | A+C+D+E /
Option RSiduals
End
G4: Calculate ascertainment
correction
Data Ninput=0
Matrices
I Iden 1 1
J Izero 1 2
P Full 2 2 = %P3
T Full 1 1
K Unit 2 1
Compute T*\ln(I-J*P*K)
/
Matrix T 262
! twice the sample size of group 2
Options User-defined
RSiduals Multiple
End
G5: Dizygotic twin
pairs
Data NInput_vars=2
NObservations=75
Raw_data file=dz.dat
Labels N_t1 N_t2
Matrices= Group 1
H Full 1 1
Q Full 1 1
Mean M /
Covariances A+C+D+E
| H@A+C+Q@D _
H@A+C+Q@D | A+C+D+E /
Matrix H .5
Matrix Q .25
Start 3.5 All
Options Multiple RSidual
End
G6: dummy group
Data Ninput=2
CTable 2 2
0 0
0 0
!
EXPECTED MATRIX
of this CALCULATION group
1 2
3 4
1
0.295 0.000 0.166
0.539
The programs allowing for adjustment
of ascertainment are given for ADE,
ACE, AE, DE, CE, and E models, respectively.
Models with means and variances
as free parameters are also given for ADE,
ACE, AE, DE, CE and E only.
Chapter 5 does not provide an example for this. Bonney's regressive models and Haseman-Elston sib pair analysis have been sucessfully implemented in the package SAGE (Statistical Analysis for Genetic Epidemiology). It is composed of series of programs and famous for its capability to include covariates in the analysis. Here we introduce programs FSP, REGC and SIBPAL. FSP is a program for family structure processing. REGC is a program for segregation analysis of continuous trait using regressive models. SIBPAL is a program for Haseman-Elston sib pair analysis.
FSP builds a data structure
for each pedigree, checks pedigree data for correctness of coding,
prepares data for use in SIBPAL and REGC. As of SAGE 2.2, the
typical input and output files for FSP, REGC and SIBPAL are listed
as follows.
Here we set up examples from sage. You can examine these sample files, they are in strict Fortran format. Now you can type name of the program (eg fsp) at DOS prompt, you can issue exit command to return to Windows. We will not go into more details of these programs. Since Fortran refuses to open an existing file for output, you need delete the previous results in order to run the program again. We have a very naive DOS program clean.bat to do this.
Any suggestions and problems
brought to our attention is appreciated.
Pak
Chung Sham and Jing
Hua Zhao 16/2/1998


--- layout: post title: No Virgin London Marathon 2013 For Me date: 2012-09-27 18:34:03.000000000 +01:00 tags: - race - Marathon - London type: post published: true ---
Look what I found on my doorstep this evening...
This is not the magazine I wanted to receive today.
Now to find another spring marathon to do instead. Hmmmm, Edinburgh? Paris? Milton Keynes?


Artwork Here!
Using the Riot API, we analyse your match history to highlight areas you excel at and where you could make improvements. Are you really as good at Vayne as you think you are or are you a better Kog'maw?
Get started!We analyse 1000s of matches, comparing the strengths and weakness of champions, not just on overall performance but against their lane opponents and as a part of the team composition as a whole. So who should you really pick against that Katarina?
Let's see!


%block name="css_extra"/>
<%include file="common/header.html" /> <%block name="bodyextra"/> <%include file="common/footer.html" /> <%block name="js_extra"/>


your library is your portrait.
accounts work
- GSTIN Registration
- GSTIN Modification
- GSTIN Cancellation / Surrender
- GST Return Filing ( All types )
- GST Audit
- E-way Bill Registration / Generation
- Income Tax Return ( All types )
- Balance Sheet & Profit-Loss Account
- Provisional & Projected Balance Sheet
- Tax Audit Report
Show Large Modal
- GSTIN Registration
- GSTIN Modification
- GSTIN Cancellation / Surrender
- GST Return Filing ( All types )
- GST Audit
- E-way Bill Registration / Generation
- Income Tax Return ( All types )
- Balance Sheet & Profit-Loss Account
- Provisional & Projected Balance Sheet
- Tax Audit Report
- Submission and Reply to Income Tax Notice
- Digital Signature Certificate ( All 3 Classes)
- TDS Returns
- Accounting / Book-Keeping Services
- Pan Card
- Tan Registration
- Profession Tax Registration and Returns
- ESIC and EPF
- CMA Data
- Project Report
- Incorporation Of Private Limited Company
- Incorporation Of Public Limited Company
- Incorporation Of LLP
- Incorporation Of OPC
- Incorporation Of Section 8 Company
- Incorporation Of Producer Company
- Incorporation Of Nidhi Company
- Quarterly Accounting Facility
- Formation Of Pvt. Ltd / Ltd / LLP / OPC/ Section 8 Company/ Producer Company
- Addition / Change In Directors
- Annual ROC Filing
- Alteration Of AOA / MOA


Chocolate Pizza
POSTED ON 15 DEC 2013 / DESSERTS
For the fig-swirl: Melt butter over medium heat in saucepan. Add brown sugar and stir to dissolve. Halve all of the figs and toss in the saucepan with water and lemon juice. Cook over medium heat, stirring frequently, until you have a chunky-jammy mixture. Add salt with one or two stirs, set aside and let cool completely
Ice cream: In a small pot over medium heat, combine milk, and granulate sugar until sugar is completely dissolved and the milk is just barely lukewarm. Whisk in the egg yolks. Set mixture in the fridge and wait until the fig mixture is cooled
Using an ice cream machine, pour liquids into the frozen basin and process according to manufacture instructions, i.e., let spin and thicken for 20 minutes. Pour semi-frozen mixture into a pyrex dish or glass Tupperware. Freeze for at least two hours before serving.
Vanessa Stevenson
Food enthusiast, phtotography fan. Add a pinch of raw foodism and that's
pretty much who I am.


The method you are trying to use in your request is either not recognized or not supported. In case of the latter please consider waiting for the next version of this webserver which will almost certainly not exist but might implement your desired feature set.


No, Scanner.nextInt()
will scan in integers as they come
regardless of line structure.
However, the examples will show one text integer per line.
Professionally written code carefully checks the input for errors. We won't do that, but will rely on what comes automatically with Java. Say that the input file looked like this:
5 1 2 3 4
The file is incorrect since it says that five integers are to be added up, but only four integers follow. The line after the "4" is blank. Here is what happens if you run the program with this file:
C:\users\default\JavaLessons>java AddUpAll File name? data.dat Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at AddUpAll.main(AddUpAll.java:24) C:\users\default\JavaLessons>
The fifth execution of nextInt()
failed because it could not find an integer in the remaining characters of the file.
Here is another defective file:
5 10 20 30 40 50 60 70
What is the problem with this input data?


ME, MYSELF & IRENE **1/2 (out of four) -a review by Bill Chambers<EMAIL_ADDRESS>(Film, DVD, and books about movies reviews. Essays. Contests. http://filmfreakcentral.net Bring a friend.)
starring Jim Carrey, Renee Zellweger, Chris Cooper, Michael Bowman screenplay by Peter Farrelly & Mike Cerrone & Bobby Farrelly directed by The Farrelly Brothers
Memo to the Farrelly Brothers (There's Something About Mary, Kingpin): comedies don't need plot, they need jokes. While watching Me, Myself & Irene, I thought back to a bit from that show of shows, "The Simpsons", in which papa Homer wails "Be funny!" as he attacks the television during an especially lame program. The film's dense (in every sense of the word) screenplay, an unseemly love letter to Rhode Island (the Farrellys' birthplace), is beneath Jim Carrey, who is given precisely two notes to play that he has dwelled upon enough already.
Charlie (Carrey), a Rhode Island state trooper, has let people walk all over him for years; his bottled hostility has finally come uncorked and manifested itself in the form of a second personality by the name of Hank, a swaggering, Clint Eastwood-type with zero powers of repression. The police force puts him on medication, then asks him to escort a cutie pie criminal (Renee Zellweger, still wincing) from Rhode Island to Messena, where her arrest warrant awaits.
We expect that their trip to Messena will comprise the bulk of the story, and that along the way Charlie will lose or forget to take his pills and hulk out. Despite the odds, he and Irene will fall in love. But Me, Myself & Irene needlessly goes and gets itself a villain--worse, one with an entirely incomprehensible motive. Chris Cooper, an actor not famed for his comic gifts, is embarrassingly earnest as the heavy.
Even prior to Cooper's entrance, the theatre begins to smell like flop sweat. Carrey's patented fearlessness provokes a couple of belly laughs early on, but his performance, a sort of Jekyll & Hyde revue of his Truman Show and Cable Guy personas, grows old fast. Contributing to this over-familiarity is a climax that effectively duplicates Liar, Liar's hilarious bathroom brawl between Carrey and himself. (And yet the Farrellys snipped a moment in which Carrey had sex with a watermelon because it too closely resembled American Pie's pastry rape.)
Everything about Me, Myself & Irene lacks edge, including the gross-out gags (the second best of which the filmmakers have the nerve to apologize for in a quick, closing credits take) and shockingly unfunny narration (whose tediousness is highlighted by the brothers' tendency to allow for hypothetically lengthy giggles with slow-paced editing).
Stay through to the bitter end for a mildly amusing post-script.
-June, 2000
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Attribute Directives
Interact with the element it's on to change its properties.[ngClass]
"rounder: true"
[ngStyle]
paraStyle = "font-size: 20px; color: limegreen; font-family: serif;";
Structual Directives
Change the structure of the HTML code.[*ngIf]
charming is it not?
No no! No no no!
[ngSwitch] and [*ngSwitchCase]
Choose a BDK that Billy would send ya.
Please Select a BDK
erua! Billy Cai bu hui rang wo shua lao gun!
Is Billy or I really interested in BF1?
My benben would BOOM should I accept that!
Sorry but a Huoxing game is not supported.
[*ngFor]
This div will show all the SDKs (being) given to SDK fans.
- {{ sdk }}


-coins:lir-opt=...can also be used instead of
-coins:ssa-opt=...(When ''lir-opt'' and ''ssa-opt'' are both written, only ''lir-opt'' is effective.)
Use SSA pass. This is necessary for using the SSA module. There are several optimizations in this module. To invoke the optimization, you should specify the optimizers with this option. Specified optimizers are invoked from left to right.
Both <optimizations-in-SSA-form> and <optimizations-in-normal-form> are optional with the separating "/".
note: <optimizations-in-normal-form> is available after coins-<IP_ADDRESS>.
<optimizations-in-SSA-form> is of the form "xxx/yyy/.../zzz". First, as `xxx' you MUST specify to which kind of SSA form you like to translate, such as minimal, semi-pruned or pruned. And then, as `yyy' you can specify the optimizers which the SSA module invokes. You can specify the same optimizer two times, three times, and so on. Only optimizations that you specify are performed in that order. Finally, as `zzz' you MUST specify how to back translate from SSA form.
These options are defined as follows:
note:
java -cp ./classes coins.ssa.ProApp -t xxxxwhere, ``-t'' option specifies xxx as the working directory. If ``-t'' option is not given, ``/tmp'' directory is used.
java -cp ./classes coins.ssa.ProApp -t xxxx -n
-coins:ssa-opt=stlin/shlin/prun/shlin/cse/shlin/srd3/shlinthen you may see the movement of instructions for some LIR instructions in the process of SSA optimization.
<optimizations-in-normal-form> is of the form "www/...". You can specify as `www' the following options.
Example (<optimizations-in-SSA-form>) : If you specify the option
-coins:ssa-opt=prun/cstp/cse/srd3the SSA module performs the following in that order:
Example (<optimizations-in-normal-form>/<optimizations-in-SSA-form>)
-coins:ssa-opt=divex2/esplt/pdeqp/prun/divex/cse/cstp/hli/osr/hli/cstp/cpyp/preqp/cstp/rpe/dce/srd3"divex2/esplt/pdeqp" is <optimizations-in-normal-form> and the rest is <optimizations-in-SSA-form>.
If you DO NOT want to do that, specify this option.
x1=phi(x1,x1,x1)
x1=phi(y1,y1,y1)
x1=phi(y1,y1,x1) or x1=phi(y1,y1,BOTTOM)
If you DO NOT want to do that, specify this option.
If you DO NOT want to do SSA based coalescing, specify this option.
If you WANT to do that, specify this option.
(This coalescing can be specified after any back translation method.
But it may have no effect after the back translation by Sreedhar's
Method III since that method does not insert copy assignment statements
which can be coalesced by Chaitin's coalescing.)
If you DO NOT want to do that, specify this option.
If you DO NOT want to do that, specify this option.
1 : Output only the message that the SSA module is invoked 100 : Output the agenda of the SSA module 1500 : Output two kinds of information: (a) The inserted phi-functions when the SSA module translates normal LIR into SSA form. (b) The inserted copy assign statements when the SSA module back translates SSA form into normal LIR. 2000 : Output general debug information of all optimizers in the SSA module 10000 : Output much information about Sreedhar's Method IIIThe trace information includes the levels less than or equal to what you specified. If you specify
trace=SSA.1500then the SSA module outputs information related to the level `1', `100' and `1500'.
-coins:ssa-opt=prun/dump/srd3/dumpthe SSA module outputs the LIR (1) after translation into the pruned SSA form, and (2) after back translation from SSA form.


Home
Meet Chris
Issues
Volunteer
Donate
Contact
Volunteer
First Name
Last Name
Email
How would you like to help?
Go door to door
Make phone calls
Put sign in yard
Host an event


App Dev:
Python,
Go,
Java,
JavaScript,
React,
Babel,
HTML,
CSS,
Vim,
Tabs
Dev Ops:
Terraform,
Vault,
Nomad,
Kubernetes,
Consul,
Boundary,
Waypoint,
Vagrant,
Packer,
Linux,
Containers,
Automation,
Tools,
Continuous Integration,
Config Management,
Git
Data Infrastructure:
Databases,
Distributed Systems,
Message Queues,
Analytics,
Architecture


Page Title
This is a list of Tokyo.
1. Tokyo Skytree (World record buildilg)
2. Kaminarimon (History)
3. Ameyoko (shopping)
4. Tokyo Domu (History and the most important place)
5. Ueno Zoological Gardens (ZOO)
6. Edo Tokyo Museum (If they want to know about history)
7. Tokyo station (Station)
8. Ajinomotostadium (FIFA World Cup 2002)
9. Shyouwakienkouen (History)
10. Ginza (History and Shopping)
11. Toyosu Ichiba (Eat and experience)
12. Koukyomae Hiroba (History)
13. Yasukuni Tempo (History and Tempo)
"width="800" height="605">
14. Tokyo Tower (must go)
15. Kokkaigizidou (kind of history)
16. Odaiba (shopping and game)
17. Roppongi (night shopping place)
"width="800" height="605">
18. Shibuya (must go)
"width="800" height="605">
19. Meijijingu (History)
20. Kabukicho (really really really must go)
21. Giburi musiam (History)
22. Takaosan (beautiful)


Weather Comparer
Weather Comparer
A program to get the forecast of two cities using OpenWeather's API and Bootstrap.
City 1:
Enter a city
City 2:
Enter a city
Compare
5 Day Forecast
Loading...
High
Low
Loading...
High
Low


Stranger Things: The sound of the Upside Down
The antsy bingers of Netflix will eagerly anticipate the digital release of the Survive soundtrack, out today.
Read moreLorem ipsum dolor sit amet, consectetur adipisicing elit. At cupiditate omnis possimus illo quos, corporis minima!
Lorem ipsum dolor sit amet, consectetur adipisicing elit. At cupiditate omnis possimus illo quos, corporis minima!
Lorem ipsum dolor sit amet, consectetur adipisicing elit. At cupiditate omnis possimus illo quos, corporis minima!
Lorem ipsum dolor sit amet, consectetur adipisicing elit. At cupiditate omnis possimus illo quos, corporis minima!
The antsy bingers of Netflix will eagerly anticipate the digital release of the Survive soundtrack, out today.
Read moreThe highly anticipated world championship fight will take place at 10am and is the second major boxing blockbuster in the nation after 43 years.
The antsy bingers of Netflix will eagerly anticipate the digital release of the Survive soundtrack, out today.
Read more


This is going to be hard.
Having been a loyal Facebook user since 2005, I’ve decided to part ways with, or at least ignore, what has become one of my strongest and most consistent connections to my extended group of friends and family.
Although I cherish the countless inspiring, hilarious, and otherwise absurd interactions I’ve had on Facebook over the years, it has come to a point where it seems that I can no longer regulate my own participation in an ever-widening social web that seems to be spiraling out of control. Posts disappear, random strangers show up, and privacy settings seem to change daily. Buzzfeed, Upworthy, and other horrible memes abound. It is a constant time-suck.\
Blogger and Twitter provide a more straightforward stream of information with which I can interact more easily. Both are wonderfully simple platforms. I can post. I can delete posts. I can edit posts! I am in control of what it looks like, and in what order it’s presented. It’s all public, and open.
My last consistently updated blog existed before I had a Facebook account. Hopefully, this is a good time to start again.


Type spaces of newforms#
Let \(f\) be a new modular eigenform of level \(\Gamma_1(N)\), and \(p\) a prime dividing \(N\), with \(N = Mp^r\) (\(M\) coprime to \(p\)). Suppose the power of \(p\) dividing the conductor of the character of \(f\) is \(p^c\) (so \(c \le r\)).
Then there is an integer \(u\), which is \(\operatorname{min}([r/2], r-c)\), such that any twist of \(f\) by a character mod \(p^u\) also has level \(N\). The type space of \(f\) is the span of the modular eigensymbols corresponding to all of these twists, which lie in a space of modular symbols for a suitable \(\Gamma_H\) subgroup. This space is the key to computing the isomorphism class of the local component of the newform at \(p\).
- class sage.modular.local_comp.type_space.TypeSpace(f, p, base_extend=True)#
Bases:
SageObject
The modular symbol type space associated to a newform, at a prime dividing the level.
- character_conductor()#
Exponent of \(p\) dividing the conductor of the character of the form.
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space().character_conductor() 0
- conductor()#
Exponent of \(p\) dividing the level of the form.
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space().conductor() 2
- eigensymbol_subspace()#
Return the subspace of self corresponding to the plus eigensymbols of \(f\) and its Galois conjugates (as a subspace of the vector space returned by
free_module()
).EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: T = example_type_space(); T.eigensymbol_subspace() Vector space of degree 6 and dimension 1 over Number Field in a1 with defining polynomial ... Basis matrix: [...] sage: T.eigensymbol_subspace().is_submodule(T.free_module()) True
- form()#
The newform of which this is the type space.
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space().form() q + ... + O(q^6)
- free_module()#
Return the underlying vector space of this type space.
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space().free_module() Vector space of dimension 6 over Number Field in a1 with defining polynomial ...
- group()#
Return a \(\Gamma_H\) group which is the level of all of the relevant twists of \(f\).
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space().group() Congruence Subgroup Gamma_H(98) with H generated by [15, 29, 43]
- is_minimal()#
Return True if there exists a newform \(g\) of level strictly smaller than \(N\), and a Dirichlet character \(\chi\) of \(p\)-power conductor, such that \(f = g \otimes \chi\) where \(f\) is the form of which this is the type space. To find such a form, use
minimal_twist()
.The result is cached.
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space().is_minimal() True sage: example_type_space(1).is_minimal() False
- minimal_twist()#
Return a newform (not necessarily unique) which is a twist of the original form \(f\) by a Dirichlet character of \(p\)-power conductor, and which has minimal level among such twists of \(f\).
An error will be raised if \(f\) is already minimal.
EXAMPLES:
sage: from sage.modular.local_comp.type_space import TypeSpace, example_type_space sage: T = example_type_space(1) sage: T.form().q_expansion(12) q - q^2 + 2*q^3 + q^4 - 2*q^6 - q^8 + q^9 + O(q^12) sage: g = T.minimal_twist() sage: g.q_expansion(12) q - q^2 - 2*q^3 + q^4 + 2*q^6 + q^7 - q^8 + q^9 + O(q^12) sage: g.level() 14 sage: TypeSpace(g, 7).is_minimal() True
Test that github issue #13158 is fixed:
sage: f = Newforms(256,names='a')[0] sage: T = TypeSpace(f,2) # long time sage: g = T.minimal_twist() # long time sage: g[0:3] # long time [0, 1, 0] sage: str(g[3]) in ('a', '-a', '-1/2*a', '1/2*a') # long time True sage: g[4:] # long time [] sage: g.level() # long time 64
- prime()#
Return the prime \(p\).
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space().prime() 7
- rho(g)#
Calculate the action of the group element \(g\) on the type space.
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: T = example_type_space(2) sage: m = T.rho([2,0,0,1]); m [-1 1 0 -1] [ 0 0 -1 1] [ 0 -1 -1 1] [ 1 -1 -2 2] sage: v = T.eigensymbol_subspace().basis()[0] sage: m * v == v True
We test that it is a left action:
sage: T = example_type_space(0) sage: a = [0,5,4,3]; b = [0,2,3,5]; ab = [1,4,2,2] sage: T.rho(ab) == T.rho(a) * T.rho(b) True
An odd level example:
sage: from sage.modular.local_comp.type_space import TypeSpace sage: T = TypeSpace(Newform('54a'), 3) sage: a = [0,1,3,0]; b = [2,1,0,1]; ab = [0,1,6,3] sage: T.rho(ab) == T.rho(a) * T.rho(b) True
- tame_level()#
The level away from \(p\).
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space().tame_level() 2
- u()#
Largest integer \(u\) such that level of \(f_\chi\) = level of \(f\) for all Dirichlet characters \(\chi\) modulo \(p^u\).
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space().u() 1 sage: from sage.modular.local_comp.type_space import TypeSpace sage: f = Newforms(Gamma1(5), 5, names='a')[0] sage: TypeSpace(f, 5).u() 0
- sage.modular.local_comp.type_space.example_type_space()#
Quickly return an example of a type space. Used mainly to speed up doctesting.
EXAMPLES:
sage: from sage.modular.local_comp.type_space import example_type_space sage: example_type_space() # takes a while but caches stuff (21s on sage.math, 2012) 6-dimensional type space at prime 7 of form q + ... + O(q^6)
The above test takes a long time, but it precomputes and caches various things such that subsequent doctests can be very quick. So we don’t want to mark it
# long time
.
- sage.modular.local_comp.type_space.find_in_space(f, A, base_extend=False)#
Given a Newform object \(f\), and a space \(A\) of modular symbols of the same weight and level, find the subspace of \(A\) which corresponds to the Hecke eigenvalues of \(f\).
If
base_extend = True
, this will return a 2-dimensional space generated by the plus and minus eigensymbols of \(f\). Ifbase_extend = False
it will return a larger space spanned by the eigensymbols of \(f\) and its Galois conjugates.(NB: “Galois conjugates” needs to be interpreted carefully – see the last example below.)
\(A\) should be an ambient space (because non-ambient spaces don’t implement
base_extend
).EXAMPLES:
sage: from sage.modular.local_comp.type_space import find_in_space
Easy case (\(f\) has rational coefficients):
sage: f = Newform('99a'); f q - q^2 - q^4 - 4*q^5 + O(q^6) sage: A = ModularSymbols(GammaH(99, [13])) sage: find_in_space(f, A) Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 25 for Congruence Subgroup Gamma_H(99) with H generated by [13] of weight 2 with sign 0 over Rational Field
Harder case:
sage: f = Newforms(23, names='a')[0] sage: A = ModularSymbols(Gamma1(23)) sage: find_in_space(f, A, base_extend=True) Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 45 for Gamma_1(23) of weight 2 with sign 0 over Number Field in a0 with defining polynomial x^2 + x - 1 sage: find_in_space(f, A, base_extend=False) Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 45 for Gamma_1(23) of weight 2 with sign 0 over Rational Field
An example with character, indicating the rather subtle behaviour of
base_extend
:sage: chi = DirichletGroup(5).0 sage: f = Newforms(chi, 7, names='c')[0]; f # long time (4s on sage.math, 2012) q + c0*q^2 + (zeta4*c0 - 5*zeta4 + 5)*q^3 + ((-5*zeta4 - 5)*c0 + 24*zeta4)*q^4 + ((10*zeta4 - 5)*c0 - 40*zeta4 - 55)*q^5 + O(q^6) sage: find_in_space(f, ModularSymbols(Gamma1(5), 7), base_extend=True) # long time Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 12 for Gamma_1(5) of weight 7 with sign 0 over Number Field in c0 with defining polynomial x^2 + (5*zeta4 + 5)*x - 88*zeta4 over its base field sage: find_in_space(f, ModularSymbols(Gamma1(5), 7), base_extend=False) # long time (27s on sage.math, 2012) Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 12 for Gamma_1(5) of weight 7 with sign 0 over Cyclotomic Field of order 4 and degree 2
Note that the base ring in the second example is \(\QQ(\zeta_4)\) (the base ring of the character of \(f\)), not \(\QQ\).


At Needle in the Haystack Solutions, our goal is to accelerate the process of mainstreaming electric vehicles to provide for a greener future.
Our pursuit for success is translated in everything we do - from how we empower our employees, to how we work with our clients,
to how we govern the organization and connect to communities, we strive for nothing but the best and only the best results.
Our team is made up of the following members:
We provide two products for our valuable clients.
Our first product allows users to find the closest electric car charging station to them to minimize wastage of time and increase convenience.
Our second product helps our clients find the best charging network configuration for their organization to maximize profits.
At our charging locations, we provide Regular and Fast Chargers. All our charging locations are conveniently located at Hotels or Convenience Stores
Please share you feedback and comments with us!
West Lafayette, IN, USA
+(123)-456-7890
<EMAIL_ADDRESS>Add us on Social Media
Instagram: @needlehaystacksolution
Twitter:@needlesolutions


Preparation time
over 2 hours
Cooking time
10 to 30 mins
Serves
Makes 12
Every country has something like these little pies – Polish pierogi, Indian samosas, Spanish and Argentinian empanadas – and this is Norway's version, made with Jarlsberg cheese and caraway seeds for that special Norwegian flavour. We give these dix points! If you're a lazybones you could use puff pastry, but you'll end up with something that's more like a fried pasty. Try these as a great little starter or beer blotter.
First make your starter mixture for the dough. Pour the lukewarm water into a bowl, add the sugar and yeast, then stir in 100g/3½oz of the flour. Mix well and leave the mixture to rise for 2–3 hours.
Add the milk, salt, the rest of the flour, and the butter and egg then knead the mixture into a relatively firm dough. Leave it to rise for 2 hours.
Meanwhile, make the filling. Heat the olive oil in a frying pan, add the onion and cook gently for about five minutes until translucent. Add the garlic and continue to cook for another two minutes. Stir in the ham, cheese, parsley and caraway seeds, then season to taste and set aside to cool.
Preheat the oven to 200C/400F/Gas 6.
Roll out the dough thinly on a floured surface and cut out 12 small circles.  Place a spoonful of filling on to one half of a pastry circle, then brush the edges with the beaten egg, and fold the pastry over to enclose the filling. Squeeze the edges together and brush again with the beaten egg. Fill the rest of the circles in the same way.
Place the pies on a greased baking tray and bake them for 12–15 minutes until golden.


b u i underlined
googleurl and paths go to page 1
document fragments: url paths #mailling address
Download the sales report (PDF, 10MB)
Watch the video (stream opens in separate tab, HD quality)
Play the car game (requires Flash)
Download Latest Firefox for Windows (64-bit) (English, US)
_code data
The HTML
<blockquote>
Element (or HTML Block Quotation Element) indicates that the enclosed text is an extended quotation.
the quote element <q>
- is intended
for short quotations that don't require paragraph breaks.
We use html We use html
121 Los Altos
US
25th
C8
var a = 5
Ctrl
PING mozilla.org