module poorwsgi link | top
Poor WSGI connector for Python
Current Contents:
Current Contents:
* request - Headers, Request and FieldStorage classes, which is used for managing requests. * results - default result handlers of connector like: directory index, send_file, SERVER_RETURN, redirect, servers errors or debug output handler. * session - self-contained cookie based session class * state - constants like http status code, log levels and method types * wsgi - Application callable class, which is the main point for poorwsgi web application.
Module dependences:
poorwsgi.results
Module dependences:
poorwsgi.wsgi
Module dependences:
request
Module dependences:
results
Module dependences:
results
Module dependences:
state
Module dependences:
wsgi
app = __poorwsgi__ - callable Application class instance top
Short reference to application instance ( DEPRECATED )
application = __poorwsgi__ - callable Application class instance top
Application callable instance, which is need by wsgi server ( DEPRECATED )
module wsgi link | top
Module dependences:
collections
Module dependences:
path
Module dependences:
poorwsgi.request
Module dependences:
poorwsgi.results
Module dependences:
posix
Module dependences:
re
class Application link | top
Poor WSGI application which is called by WSGI server.
Working of is describe in PEP 333. This object store route dispatch table, and have methods for it's using and of course __call__ method for use as WSGI application.
Working of is describe in PEP 333. This object store route dispatch table, and have methods for it's using and of course __call__ method for use as WSGI application.
auto_args (READ | WRITE) top
Automatic parsing request arguments from uri.
If it is True (default), Request object do automatic parsing request uri to its args variable.
If it is True (default), Request object do automatic parsing request uri to its args variable.
auto_cookies (READ | WRITE) top
Automatic parsing cookies from request headers.
If it is True (default) and Cookie request header was set, SimpleCookie object was paresed to Request property cookies.
If it is True (default) and Cookie request header was set, SimpleCookie object was paresed to Request property cookies.
auto_form (READ | WRITE) top
Automatic parsing arguments from request body.
If it is True (default) and method is POST, PUT or PATCH, and request content type is one of form_content_types, Request object do automatic parsing request body to its form variable.
If it is True (default) and method is POST, PUT or PATCH, and request content type is one of form_content_types, Request object do automatic parsing request body to its form variable.
auto_json (READ | WRITE) top
Automatic parsing JSON from request body.
If it is True (default), method is POST, PUT or PATCH and request content type is one of json_content_types, Request object do automatic parsing request body to json variable.
If it is True (default), method is POST, PUT or PATCH and request content type is one of json_content_types, Request object do automatic parsing request body to json variable.
debug (READ | WRITE) top
Application debug as another way how to set poor_Debug.
This setting will be rewrite by poor_Debug environment variable.
This setting will be rewrite by poor_Debug environment variable.
dhandlers (READ) top
document_index (READ | WRITE) top
Application document_root as another way how to set poor_DocumentRoot.
This setting will be rewrite by poor_DocumentRoot environ variable.
This setting will be rewrite by poor_DocumentRoot environ variable.
document_root (READ | WRITE) top
Application document_root as another way how to set poor_DocumentRoot.
This setting will be rewrite by poor_DocumentRoot environ variable.
This setting will be rewrite by poor_DocumentRoot environ variable.
filters (READ) top
Copy of filter table.
Filter table contains regular expressions and convert functions, see Application.set_filter and Application.route.
Default filters are:
For more details see
Filter table contains regular expressions and convert functions, see Application.set_filter and Application.route.
Default filters are:
:int
- match number and convert it to int:float
- match number and convert it to float:word
- match one unicoee word:hex
- match hexadecimal value and convert it to str:re:
- match user defined regular expressionnone
- match any string withount '/' characterFor more details see
/debug-info
page of your application, where
you see all filters with regular expression definition.form_content_types (READ) top
Copy of form content type list.
Containt list of strings as form content types, which is use for testing, when automatics Form object is create from request body.
Containt list of strings as form content types, which is use for testing, when automatics Form object is create from request body.
handlers (READ) top
json_content_types (READ) top
Copy of json content type list.
Containt list of strings as json content types, which is use for testing, when automatics Json object is create from request body.
Containt list of strings as json content types, which is use for testing, when automatics Json object is create from request body.
keep_blank_values (READ | WRITE) top
Keep blank values in request arguments.
If it is 1 (0 is default), automatic parsing request uri or body keep blank values as empty string.
If it is 1 (0 is default), automatic parsing request uri or body keep blank values as empty string.
name (READ) top
Return application name.
post (READ) top
pre (READ) top
rhandlers (READ) top
secret_key (READ | WRITE) top
Application secret_key could be replace by poor_SecretKey in request.
Secret key is used by PoorSession class. It is generate from some server variables, and the best way is set to your own long key.
Secret key is used by PoorSession class. It is generate from some server variables, and the best way is set to your own long key.
shandlers (READ) top
strict_parsing (READ | WRITE) top
Strict parse request arguments.
If it is 1 (0 is default), automatic parsing request uri or body raise with exception on parsing error.
If it is 1 (0 is default), automatic parsing request uri or body raise with exception on parsing error.
def __call__(self, environ, start_response) link | top
def __init__(self, name='__main__') link | top
Application class is per name singleton.
That means, there could be exist only one instance with same name.
That means, there could be exist only one instance with same name.
def __profile_request__(self, environ, start_response) link | top
Profiler version of __request__.
This method is used if set_profile is used.
This method is used if set_profile is used.
def __repr__(self) link | top
Return repr(self).
def __request__(self, environ, start_response) link | top
Create Request instance and return wsgi response.
This method create Request object, call handlers from Application.__pre (Application.handler_from_pre), uri handler (handler_from_table), default handler (Application.handler_from_default) or error handler (Application.error_from_table), and handlers from Application.__post.
This method create Request object, call handlers from Application.__pre (Application.handler_from_pre), uri handler (handler_from_table), default handler (Application.handler_from_default) or error handler (Application.error_from_table), and handlers from Application.__post.
def add_post_process(self, fn) link | top
Append post process handler.
Method for direct append function to list functions which are called after each request.
Method for direct append function to list functions which are called after each request.
app.add_post_process(after_each_request)
def add_pre_process(self, fn) link | top
Append pre proccess handler.
Method adds function to list functions which is call before each request.
Method adds function to list functions which is call before each request.
app.add_pre_process(before_each_request)
def default(self, method=3) link | top
Set default handler.
This is decorator for default handler for http method (called before error_not_found).
This is decorator for default handler for http method (called before error_not_found).
@app.default(METHOD_GET_POST) def default_get_post(req): # this function will be called if no uri match in internal # uri table with method. It's similar like not_found error, # but without error ...
def del_profile(self) link | top
Remove profiler from application.
def error_from_table(self, req, code) link | top
Internal method, which is called if error was accured.
If status code is in Application.shandlers (fill with http_state function), call this handler.
If status code is in Application.shandlers (fill with http_state function), call this handler.
def get_options(self) link | top
Returns dictionary with application variables from system environment.
Application variables start with
Application variables start with
app_
prefix,
but in returned dictionary is set without this prefix.
poor_LogLevel = warn # Poor WSGI variable app_db_server = localhost # application variable db_server app_templates = app/templ # application variable templatesThis method works like Request.get_options, but work with os.environ, so it works only with wsgi servers, which set not only request environ, but os.environ too. Apaches mod_wsgi don't do that, uWsgi and PoorHTTP do that.
def handler_from_default(self, req) link | top
Internal method, which is called if no handler is found.
def handler_from_pre(self, req) link | top
Internal method, which run all pre (pre_proccess) handlers.
This method was call before end-point route handler.
This method was call before end-point route handler.
def handler_from_table(self, req) link | top
Call right handler from handlers table (fill with route function).
If no handler is fined, try to find directory or file if Document Root, resp. Document Index is set. Then try to call default handler for right method or call handler for status code 404 - not found.
If no handler is fined, try to find directory or file if Document Root, resp. Document Index is set. Then try to call default handler for right method or call handler for status code 404 - not found.
def http_state(self, code, method=7) link | top
Wrap function to handle http status codes like http errors.
def is_route(self, uri) link | top
Check if uri have any registered record.
def is_rroute(self, r_uri) link | top
Check if regular expression uri have any registered record.
def log_debug(self, message) link | top
Logging method, which create message as LOG_DEBUG level.
def log_error(self, message, level=(3, 'E')) link | top
Logging method with the same functionality like in Request object.
But as get_options read configuration from os.environ which could not work in same wsgi servers like Apaches mod_wsgi.
This method write to stderr so messages, could not be found in servers error log!
But as get_options read configuration from os.environ which could not work in same wsgi servers like Apaches mod_wsgi.
This method write to stderr so messages, could not be found in servers error log!
def log_info(self, message) link | top
Logging method, which create message as LOG_INFO level.
def log_warning(self, message) link | top
Logging method, which create message as LOG_WARNING level.
def pop_default(self, method) link | top
Pop default handler for method.
def pop_http_state(self, code, method) link | top
Pop handerl for http state and method.
As Application.pop_route, for pop multimethod handler, you must call pop_http_state for each method.
As Application.pop_route, for pop multimethod handler, you must call pop_http_state for each method.
def pop_route(self, uri, method) link | top
Pop handler for uri and method from handers table.
Method must be define unique, so METHOD_GET_POST could not be use. If you want to remove handler for both methods, you must call pop route for each method state.
Method must be define unique, so METHOD_GET_POST could not be use. If you want to remove handler for both methods, you must call pop route for each method state.
def pop_rroute(self, r_uri, method) link | top
Pop handler and convertors for uri and method from handlers table.
For mor details see Application.pop_route.
For mor details see Application.pop_route.
def post_process(self) link | top
Append post process handler.
This decorator append function to be called after each request, if you want to use it redefined all outputs.
This decorator append function to be called after each request, if you want to use it redefined all outputs.
@app.pre_process() def after_each_request(req): ...
def pre_process(self) link | top
Append pre process hendler.
This is decorator for function to call before each request.
This is decorator for function to call before each request.
@app.pre_process() def before_each_request(req): ...
def route(self, uri, method=3) link | top
Wrap function to be handler for uri and specified method.
You can define uri as static path or as groups which are hand to handler as next parameters.
You can define uri as static path or as groups which are hand to handler as next parameters.
# static uri @app.route('/user/post', method=METHOD_POST) def user_create(req): ... # group regular expression @app.route('/user/<name>') def user_detail(req, name): ... # group regular expression with filter @app.route('/<surname:word>/<age:int>') def surnames_by_age(req, surname, age): ... # group with own regular expression filter @app.route('/<car:re:\w+>/<color:re:#[\da-fA-F]+>') def car(req, car, color): ...If you can use some name of group which is python keyword, like class, you can use **kwargs syntax:
@app.route('/<class>/<len:int>') def classes(req, **kwargs): return "'%s' class is %d lenght." % (kwargs['class'], kwargs['len'])Be sure with ordering of call this decorator or set_route function with groups regular expression. Regular expression routes are check with the same ordering, as you create internal table of them. First match stops any other searching. In fact, if groups are detect, they will be transfer to normal regular expression, and will be add to second internal table.
def rroute(self, ruri, method=3) link | top
Wrap function to be handler for uri defined by regular expression.
Both of function, rroute and set_rroute store routes to special internal table, which is another to table of static routes.
Both of function, rroute and set_rroute store routes to special internal table, which is another to table of static routes.
@app.rroute(r'/user/\w+') # simple regular expression def any_user(req): ... @app.rroute(r'/user/(?P<user>\w+)') # regular expression with def user_detail(req, user): # groups ...Be sure with ordering of call this decorator or set_rroute function. Regular expression routes are check with the same ordering, as you create internal table of them. First match stops any other searching.
def set_default(self, fn, method=3) link | top
Set default handler.
Set fn default handler for http method called befor error_not_found.
Set fn default handler for http method called befor error_not_found.
app.set_default(default_get_post, METHOD_GET_POST)
def set_filter(self, name, regex, convertor=poorwsgi.results.uni) link | top
Create new filter or overwrite builtins.
Arguments:
Arguments:
name
- Name of filter which is used in route or set_route
method.regex
- regular expression which used for filterconvertor
- convertor function or class, which gets unicode in
input. Default is uni function, which is wrapper
to unicode string.
app.set_filter('uint', r'\d+', int)
def set_http_state(self, code, fn, method=7) link | top
Set fn as handler for http state code and method.
def set_profile(self, runctx, dump) link | top
Set profiler for __call__ function.
Arguments:
Typical usage:
Arguments:
runctx
- function from profiler moduledump
- path and prefix for .profile filesTypical usage:
import cProfile cProfile.runctx('from simple import *', globals(), locals(), filename="log/init.profile") app.set_profile(cProfile.runctx, 'log/req')
def set_route(self, uri, fn, method=3) link | top
Set handler for uri and method.
Another way to add fn as handler for uri. See Application.route documentation for details.
Another way to add fn as handler for uri. See Application.route documentation for details.
app.set_route('/use/post', user_create, METHOD_POST)
def set_rroute(self, r_uri, fn, method=3, convertors=()) link | top
Set hanlder for uri defined by regular expression.
Another way to add fn as handler for uri defined by regular expression. See Application.rroute documentation for details.
Another way to add fn as handler for uri defined by regular expression. See Application.rroute documentation for details.
app.set_rroute('/use/\w+/post', user_create, METHOD_POST)This method is internally use, when groups are found in static route, adding by route or set_route method.
re_filter = (<(\w+)(:[^>]+)?>, 32) top
check, if there is define filter in uri
module request link | top
Module dependences:
_io
Module dependences:
cgi
Module dependences:
collections.abc
Module dependences:
http.cookies
Module dependences:
inspect
Module dependences:
json
Module dependences:
os
Module dependences:
poorwsgi.results
Module dependences:
re
Module dependences:
urllib.parse
Module dependences:
wsgiref.headers
class Args link | top
Compatibility class for read values from QUERY_STRING.
Class is based on dictionary. It has getfirst and getlist methods, which can call function on values.
Class is based on dictionary. It has getfirst and getlist methods, which can call function on values.
def __init__(self, req, keep_blank_values=0, strict_parsing=0) link | top
Initialize self. See help(type(self)) for accurate signature.
def getfirst(self, name, default=None, fce=poorwsgi.results.uni) link | top
Returns first variable value for key or default.
Arguments:
Arguments:
fce
- function which processed value.def getlist(self, name, fce=poorwsgi.results.uni) link | top
Returns list of variable values for key or empty list.
Arguments:
Arguments:
fce
- function which processed value.class BrokenClientConnection link | top
Helping class for Broken Connection Pipe detect.
def __init__(self, remote_host, remote_addr) link | top
Initialize self. See help(type(self)) for accurate signature.
def __str__(self) link | top
Return str(self).
class EmptyForm link | top
Compatibility class as fallback.
This class is used when poor_AutoArgs or poor_AutoForm is set to Off.
This class is used when poor_AutoArgs or poor_AutoForm is set to Off.
def getfirst(self, name, default=None, fce=poorwsgi.results.uni) link | top
def getlist(self, name, fce=poorwsgi.results.uni) link | top
def getvalue(self, name, default=None) link | top
class FieldStorage link | top
Class based of cgi.FieldStorage.
Instead of FieldStorage from cgi module, can have better getfirst and getlist methods which can call function on values and can set file_callback.
Constructor post special environment to base class, which do POST emulation for any request, because base cgi.FieldStorage know only GET, HEAD and POST methods an read from all variables, which we don't want.
There are some usable variables, which you can use, if you want to test what variable it is:
Instead of FieldStorage from cgi module, can have better getfirst and getlist methods which can call function on values and can set file_callback.
Constructor post special environment to base class, which do POST emulation for any request, because base cgi.FieldStorage know only GET, HEAD and POST methods an read from all variables, which we don't want.
There are some usable variables, which you can use, if you want to test what variable it is:
name
- variable name, the same name from input attribute.type
- content-type of variable. All variables have internal
content-type, if that is no file, content-type is text/plain.filename
- if variable is file, filename is its name from form.file
- file type instance, from you can read variable. This instance
could be TemporaryFile as default for files, StringIO for normal
variables or instance of your own file type class, create from
file_callback.lists
- if variable is list of variables, this contains instances of
FieldStorage.def __bool__(self) link | top
def __contains__(self, key) link | top
Dictionary style __contains__ method.
def __del__(self) link | top
def __enter__(self) link | top
def __exit__(self, *args) link | top
def __getattr__(self, name) link | top
def __getitem__(self, key) link | top
Dictionary style indexing.
def __init__(self, req, headers=None, outerboundary=b'', environ={}, keep_blank_values=0, strict_parsing=0, limit=None, encoding='utf-8', errors='replace', file_callback=None) link | top
Constructor of FieldStorage.
Many of input parameters are need only for next internal use, because
Many of input parameters are need only for next internal use, because
FieldStorage
parse variables recursive. You need add only:
req - Request object.
keep_blank_values - if you want to parse blank values as right
empty values.
strict_parsing - if you want to raise exception on parsing
error.
file_callback - callback for creating instance of uploading
files.def __iter__(self) link | top
def __len__(self) link | top
Dictionary style len(x) support.
def __repr__(self) link | top
Return a printable representation.
def get(self, key, default=None) link | top
Compatibility methods with dict, alias for getvalue.
def getfirst(self, name, default=None, fce=poorwsgi.results.uni) link | top
Returns first variable value for key or default, if key not exist.
Arguments:
Arguments:
fce
- function which processed value.def getlist(self, name, fce=poorwsgi.results.uni) link | top
Returns list of variable values for key or empty list.
Arguments:
Arguments:
fce
- function which processed value, str is default.def getvalue(self, key, default=None) link | top
Dictionary style get() method, including 'value' lookup.
def keys(self) link | top
Dictionary style keys() method.
def make_file(self, binary=None) link | top
Return readable and writable temporary file.
Arguments:
Arguments:
binary
- unused. Here is only for backward compatibilitydef read_binary(self) link | top
Internal: read binary data.
def read_lines(self) link | top
Internal: read lines until EOF or outerboundary.
def read_lines_to_eof(self) link | top
Internal: read lines until EOF.
def read_lines_to_outerboundary(self) link | top
Internal: read lines until outerboundary.
Data is read as bytes: boundaries and line ends must be converted
to bytes for comparisons.
def read_multi(self, environ, keep_blank_values, strict_parsing) link | top
Internal: read a part that is itself multipart.
def read_single(self) link | top
Internal: read an atomic part.
def read_urlencoded(self) link | top
Internal: read data in query string format.
def skip_lines(self) link | top
Internal: skip lines until outer boundary if defined.
class Headers link | top
Class inherited from collections.Mapping.
As PEP 333, resp. RFC 2616 says, all headers names must be only US-ASCII character except control characters or separators. And headers values must be store in string encoded in ISO-8859-1. This class methods Headers.add and Headers.add_header do auto convert values from UTF-8 to ISO-8859-1 encoding if it is possible. So on every modification methods must be use UTF-8 string or unicode.
As PEP 333, resp. RFC 2616 says, all headers names must be only US-ASCII character except control characters or separators. And headers values must be store in string encoded in ISO-8859-1. This class methods Headers.add and Headers.add_header do auto convert values from UTF-8 to ISO-8859-1 encoding if it is possible. So on every modification methods must be use UTF-8 string or unicode.
def __contains__(self, key) link | top
def __delitem__(self, name) link | top
Delete item identied by lower name.
def __eq__(self, other) link | top
Return self==value.
def __getitem__(self, name) link | top
Return header item identified by lower name.
def __init__(self, headers=[], strict=True) link | top
Headers constructor.
Headers object could be create from list, set or tuple of pairs name, value. Or from dictionary. All names or values must be iso-8859-1 encodable. If not, AssertionError will be raised.
If strict is False, headers names and values are not encoded to iso-8859-1. This is for input headers using only!
Headers object could be create from list, set or tuple of pairs name, value. Or from dictionary. All names or values must be iso-8859-1 encodable. If not, AssertionError will be raised.
If strict is False, headers names and values are not encoded to iso-8859-1. This is for input headers using only!
def __iter__(self) link | top
def __len__(self) link | top
Return len of header items.
def __repr__(self) link | top
Return repr(self).
def __setitem__(self, name, value) link | top
Delete item if exist and set it's new value.
def add(self, name, value) link | top
Set header name to value.
Duplicate names are not allowed instead of
Duplicate names are not allowed instead of
Set-Cookie
.def add_header(self, name, value, **kwargs) link | top
Extended header setting.
name is the header field to add. kwargs arguments can be used to set additional parameters for the header field, with underscores converted to dashes. Normally the parameter will be added as name="value" unless value is None, in which case only the name will be added.
name is the header field to add. kwargs arguments can be used to set additional parameters for the header field, with underscores converted to dashes. Normally the parameter will be added as name="value" unless value is None, in which case only the name will be added.
h.add_header('Content-Disposition', 'attachment', filename='image.png')All names must be US-ASCII string except control characters or separators.
def get(self, key, default=None) link | top
D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
def get_all(self, name) link | top
Return tuple of all values of header identifed by lower name.
def iso88591(value) link | top
Doing automatic conversion to iso-8859-1 strings.
In python 2.x can convert unicode to iso-8859-1 strings, or from utf-8 string to iso-8859-1 string. On python 3.x converts from utf-8 to iso-8859-1 string. That means, all input value of Headers class must be UTF-8 stings.
In python 2.x can convert unicode to iso-8859-1 strings, or from utf-8 string to iso-8859-1 string. On python 3.x converts from utf-8 to iso-8859-1 string. That means, all input value of Headers class must be UTF-8 stings.
def items(self) link | top
Return tuple of headers pairs.
def keys(self) link | top
Alias for names method.
def names(self) link | top
Return tuple of headers names.
def setdefault(self, name, value) link | top
Set header value if not exist, and return it's value.
def values(self) link | top
Return tuple of headers values.
class Json link | top
Compatibility class for read values from JSON POST, PUT or PATCH request.
It has getfirst and getlist methods, which can call function on values.
It has getfirst and getlist methods, which can call function on values.
def __init__(self, req, charset) link | top
Initialize self. See help(type(self)) for accurate signature.
def getfirst(self, name, default=None, fce=poorwsgi.results.uni) link | top
Returns first variable value for key or default, if key not exist.
Arguments:
Arguments:
fce
- function which processed value.def getlist(self, name, fce=poorwsgi.results.uni) link | top
Returns list of variable values for key or empty list.
Arguments:
Arguments:
fce
- function which processed value.class Request link | top
HTTP request object with all server elements.
It could be compatible as soon as possible with mod_python.apache.request.
Special variables for user use:
It could be compatible as soon as possible with mod_python.apache.request.
Special variables for user use:
app_
- as prefix for any your application variable (not
defined)args (READ | WRITE) top
Extended dictionary (Args instance) of request arguments.
Argument are parsed from QUERY_STRING, which is typical, but not only for GET method. Arguments are parsed when Application.auto_args is set which is default.
This property could be set only once.
Argument are parsed from QUERY_STRING, which is typical, but not only for GET method. Arguments are parsed when Application.auto_args is set which is default.
This property could be set only once.
body_bytes_sent (READ) top
Internal variable to store count of bytes which are really sent.
clength (READ | WRITE) top
Property to store output content length for header.
This value was set automatically when size of output data are less then buffer size.
This value was set automatically when size of output data are less then buffer size.
config (READ | WRITE) top
For config object (default None).
content_type (READ | WRITE) top
Content-Type header string, by default
Another way to set content_type is via headers_out object property.
text/html; charset=utf-8
.Another way to set content_type is via headers_out object property.
cookies (READ) top
SimpleCookie iterable object of all cookies from Cookie header.
This property was set if Application.auto_cookies is set to true, which is default. Otherwise cookies was empty tuple.
This property was set if Application.auto_cookies is set to true, which is default. Otherwise cookies was empty tuple.
debug (READ) top
Value of poor_Debug variable.
document_index (READ) top
Value of poor_DocumentIndex variable.
Variable is used to generate index html page, when poor_DocumentRoot is set.
Variable is used to generate index html page, when poor_DocumentRoot is set.
environ (READ) top
err_headers_out (READ) top
Reference to output headers object for error pages.
form (READ | WRITE) top
Dictionary like class (FieldStorage instance) of body arguments.
Arguments must be send in request body with content type one of Application.form_content_types. Method must be POST, PUT or PATCH. Request body is parsed when Application.auto_form is set, which default and when method is POST, PUT or PATCH.
This property could be set only once.
Arguments must be send in request body with content type one of Application.form_content_types. Method must be POST, PUT or PATCH. Request body is parsed when Application.auto_form is set, which default and when method is POST, PUT or PATCH.
This property could be set only once.
forwarded_for (READ) top
X-Forward-For http header if exists.
forwarded_host (READ) top
X-Forward-Host http header if exists.
forwarded_proto (READ) top
X-Forward-Proto http header if exists.
headers_in (READ) top
Reference to input headers object.
headers_out (READ | WRITE) top
Reference to output headers object.
hostname (READ) top
Host, as set by full URI or Host: header.
is_body_request (READ) top
is_xhr (READ) top
.If X-Requested-With header is set and have XMLHttpRequest value.
json (READ) top
Json dictionary if request content type is JSON.
Json types is defined in Application.json_content_types, typical is
Json types is defined in Application.json_content_types, typical is
application/json
and request method must be POST, PUT or PATCH and
Application.auto_json must be set to true (default). Otherwise json
is EmptyForm.logger (READ) top
DEPRECATED For special logger function (default req.log_error).
Use log_error, log_info, log_debug or logging method instead of that.
Use log_error, log_info, log_debug or logging method instead of that.
method (READ) top
String containing the method -
GET
, HEAD
, POST
, etc.method_number (READ) top
Method number constant from state module.
poor_environ (READ) top
port (READ) top
Alias for server_port property.
protocol (READ) top
Alias for server_protocol property
referer (READ) top
Request referer if is available or None.
remote_addr (READ) top
Remote address.
remote_host (READ) top
Remote hostname.
scheme (READ) top
Alias for server_scheme property.
secret_key (READ) top
Value of poor_SecretKey variable.
Secret key is used by PoorSession class. It is generate from some server variables, and the best way is set programmatically by Application.secret_key from random data.
Secret key is used by PoorSession class. It is generate from some server variables, and the best way is set programmatically by Application.secret_key from random data.
secretkey (READ) top
DEPRECATED alias for secret_key.
server_admin (READ) top
Server admin if set, or webmaster@hostname.
server_hostname (READ) top
Server name variable.
server_port (READ) top
Server port.
server_protocol (READ) top
Server protocol, as given by the client.
In HTTP/0.9. cgi SERVER_PROTOCOL value.
In HTTP/0.9. cgi SERVER_PROTOCOL value.
server_scheme (READ) top
server_software (READ) top
Server software.
status (READ | WRITE) top
Http status code, which is state.HTTP_OK (200) by default.
If you want to set this variable (which is very good idea in http_state handlers), it is good solution to use some of HTTP_ constant from state module.
If you want to set this variable (which is very good idea in http_state handlers), it is good solution to use some of HTTP_ constant from state module.
uri (READ) top
The path portion of the URI.
uri_handler (READ | WRITE) top
This property is set at the same point as uri_rule.
It was set by Application object when end point handler is known before calling all pre handlers. Typical use case is set some special attribute to handler, and read them in pre handler.
It was set by Application object when end point handler is known before calling all pre handlers. Typical use case is set some special attribute to handler, and read them in pre handler.
uri_rule (READ | WRITE) top
Rule from one of application handler table.
This property could be set once, and that do Application object. There are some internal uri_rules which is set typical if some internal handler was called. There are: {_default_handler_, _directory_index_, _debug_info_ and _send_file_ }. In other case, there be url or regex.
This property could be set once, and that do Application object. There are some internal uri_rules which is set typical if some internal handler was called. There are: {_default_handler_, _directory_index_, _debug_info_ and _send_file_ }. In other case, there be url or regex.
user (READ | WRITE) top
For user object, who is login for example (default None).
user_agent (READ) top
Browser user agent string.
def __del__(self) link | top
def __end_of_request__(self) link | top
Method for internal use only!.
This method was called from Application object at the end of request for returning right value to wsgi server.
This method was called from Application object at the end of request for returning right value to wsgi server.
def __init__(self, environ, start_response, app_config) link | top
Object was created automatically in wsgi module.
It's input parameters are the same, which Application object gets from WSGI server plus file callback for auto request body parsing.
It's input parameters are the same, which Application object gets from WSGI server plus file callback for auto request body parsing.
def __reset_buffer__(self) link | top
Clean _buffer (*for internal server error use*).
It could be used in error pages, typical in internal_server_error. But be careful, this method not help you, when any data was sent to wsgi server.
It could be used in error pages, typical in internal_server_error. But be careful, this method not help you, when any data was sent to wsgi server.
def construct_url(self, uri) link | top
This function returns a fully qualified URI string.
Url is create from the path specified by uri, using the information stored in the request to determine the scheme, server host name and port. The port number is not included in the string if it is the same as the default port 80.
Url is create from the path specified by uri, using the information stored in the request to determine the scheme, server host name and port. The port number is not included in the string if it is the same as the default port 80.
def document_root(self) link | top
Returns DocumentRoot setting.
def flush(self) link | top
Flushes the output buffer.
def get_options(self) link | top
Returns dictionary with application variables from environment.
Application variables start with
Application variables start with
app_
prefix, but in returned
dictionary is set without this prefix.
#!ini poor_LogLevel = warn # Poor WSGI variable app_db_server = localhost # application variable db_server app_templates = app/templ # application variable templates
def get_remote_host(self) link | top
Returns REMOTE_ADDR CGI enviroment variable.
def log_debug(self, message) link | top
Logging method, which create message as LOG_DEBUG level.
def log_error(self, message, level=(3, 'E'), server=None) link | top
An interface to log error via wsgi.errors.
Arguments:
Arguments:
message
- string with the error messagelevel
- is one of the following flags constants:
LOG_EMERG
LOG_ALERT
LOG_CRIT
LOG_ERR (default)
LOG_WARNING
LOG_NOTICE
LOG_INFO
LOG_DEBUG
LOG_NOERRNOserver
- interface only compatibility parameterdef log_info(self, message) link | top
Logging method, which create message as LOG_INFO level.
def log_warning(self, message) link | top
Logging method, which create message as LOG_WARNING level.
def read(self, length=-1) link | top
Read data from client (typical for XHR2 data POST).
If length is not set, or if is lower then zero, Content-Length was be use.
If length is not set, or if is lower then zero, Content-Length was be use.
def sendfile(self, path, offset=0, limit=-1) link | top
Send file defined by path to client.
Offset and len is not supported yet.
Offset and len is not supported yet.
@app.route('myfile.txt') def myfile(req): req.content_type('text/plain') length = req.sendfile('myfile.txt') req.log_error('sending myfile.txt with %d length' % length)
def set_content_lenght(self, length) link | top
DEPRECATED Use req.clength = length instead of call this method.
def write(self, data, flush=0) link | top
Write data to buffer.
If len of data is bigger then poor_BufferSize, data was be sent to client via old write method (directly). Otherwise, data was be sent at the end of request as iterable object.
If len of data is bigger then poor_BufferSize, data was be sent to client via old write method (directly). Otherwise, data was be sent at the end of request as iterable object.
re_httpUrlPatern = (^(http|https):\/\/, 32) top
simple regular expression for construct_url method
module results link | top
Default Poor WSGI handlers.
Module dependences:
_io
Module dependences:
builtins
Module dependences:
inspect
Module dependences:
json
Module dependences:
mimetypes
Module dependences:
operator
Module dependences:
path
Module dependences:
posix
Module dependences:
sys
Module dependences:
time
Module dependences:
traceback
class SERVER_RETURN link | top
Compatible with mod_python.apache exception.
def __init__(self, code=500) link | top
code is one of HTTP_* status from state module
def bad_request(req) link | top
400 Bad Request server error handler.
def cmp(a, b) link | top
def debug_info(req, app) link | top
def directory_index(req, _path) link | top
Returns directory index as html page
def forbidden(req) link | top
403 - Forbidden Access server error handler.
def handlers_view(handlers, sort=True) link | top
Returns sorted handlers list.
def hbytes(val) link | top
Return pair value and unit.
def html_escape(s) link | top
Escape to html entities.
def human_methods_(m) link | top
Return methods in text.
def internal_server_error(req) link | top
More debug 500 Internal Server Error server handler.
It was be called automatically when no handlers are not defined in dispatch_table.errors. If poor_Debug variable is to On, Tracaback will be generated.
It was be called automatically when no handlers are not defined in dispatch_table.errors. If poor_Debug variable is to On, Tracaback will be generated.
def method_not_allowed(req) link | top
405 Method Not Allowed server error handler.
def not_found(req) link | top
404 - Page Not Found server error handler.
def not_implemented(req, code=None) link | top
501 Not Implemented server error handler.
def not_modified(req) link | top
def redirect(req, uri, permanent=0, text=None) link | top
Redirect the browser to another location.
When permanent is true, MOVED_PERMANENTLY status is sent to the client, otherwise it is MOVED_TEMPORARILY. A short text is sent to the browser informing that the document has moved (for those rare browsers that do not support redirection); this text can be overridden by supplying a text string.
This function raises SERVER_RETURN exception with a value of state.DONE to ensuring that any later phases or stacked handlers do not run.
When permanent is true, MOVED_PERMANENTLY status is sent to the client, otherwise it is MOVED_TEMPORARILY. A short text is sent to the browser informing that the document has moved (for those rare browsers that do not support redirection); this text can be overridden by supplying a text string.
This function raises SERVER_RETURN exception with a value of state.DONE to ensuring that any later phases or stacked handlers do not run.
def send_file(req, path, content_type=None) link | top
Returns file with content_type as fast as possible on wsgi.
def send_json(req, data, **kwargs) link | top
Send data as application/json.
def uni(text) link | top
Automatic conversion from str to unicode with utf-8 encoding.
default_shandlers = {304: {1: <function not_modified at 0x7fc7d62f76a8>, 2: <function not_modified at 0x7fc7d62f76a8>, 4: <function not_modified at 0x7fc7d62f76a8>, 8: <function not_modified at 0x7fc7d62f76a8>, 16: <function not_modified at... top
http state handlers, which is called if programmer don't defined his own
html_escape_table = {'&': '&', '"': '"', "'": ''', '>': '>', '<': '<'} top
module session link | top
PoorSession self-contained cookie class.
Module dependences:
_hashlib
Module dependences:
_pickle
Module dependences:
base64
Module dependences:
builtins
Module dependences:
bz2
Module dependences:
http.cookies
Module dependences:
time
class NoCompress link | top
Fake compress class/module whith two static method for PoorSession.
If compress parameter is None, this class is use
If compress parameter is None, this class is use
def compress(data, compresslevel=9) link | top
Get two params, data, and compresslevel. Method only return data.
def decompress(data) link | top
Get one parameter data, which returns.
class PoorSession link | top
Self-contained cookie with session data.
You cat store or read data from object via PoorSesssion.data variable which must be dictionary. Data is stored to cookie by pickle dump. Be careful with stored object. You can add object with litle python trick:
You cat store or read data from object via PoorSesssion.data variable which must be dictionary. Data is stored to cookie by pickle dump. Be careful with stored object. You can add object with litle python trick:
sess = PoorSession(req) sess.data['class'] = obj.__class__ # write to cookie sess.data['dict'] = obj.__dict__.copy() obj = sess.data['class']() # read from cookie obj.__dict__ = sess.data['dict'].copy()Or for beter solution, you can create export and import methods for you object like that:
class Obj(object): def import(self, d): self.attr1 = d['attr1'] self.attr2 = d['attr2'] def export(self): d = {'attr1': self.attr1, 'attr2': self.attr2} return d obj = Obj() sess = PoorSession(req) sess.data['class'] = obj.__class__ # write to cookie sess.data['dict'] = obj.export() obj = sess.data['class']() # read from cookie obj.import(sess.data['dict'])
def __init__(self, req, expires=0, path='/', SID='SESSID', compress=<module 'bz2' from '/usr/lib/python3.6/bz2.py'>) link | top
Constructor.
Arguments:
Arguments:
req
Request objectexpires
cookie expire time in seconds, if it 0, no expire is setpath
cookie pathSID
cookie key namecompress
compress module or class. Could be bz2, gzip.zlib, or any
other, which have standard compress and decompress
methods. Or it could be None to not use any compressing
method.def destroy(self) link | top
Destroy session. In fact, set cookie expires value to past (-1).
def header(self, req, headers_out=None) link | top
Generate cookie headers and append it to headers_out if it set.
Returns list of cookie header pairs.
Returns list of cookie header pairs.
def renew(self) link | top
Renew cookie, in fact set expires to next time if it set.
def write(self, req) link | top
Store data to cookie value.
This method is called automatically in header method.
This method is called automatically in header method.
def hidden(text, passwd) link | top
(en|de)crypt text with sha hash of passwd via xor.
Arguments:
Arguments:
text
raw data to (en|de)crypt. Could be str, unicode or bytespasswd
passwordreturns
stringmodule state link | top
Constants like http status code, log levels and method types.
Module dependences:
operator
DECLINED = 2 top
DONE = 1 top
HTTP_ACCEPTED = 202 top
HTTP_BAD_GATEWAY = 502 top
HTTP_BAD_REQUEST = 400 top
HTTP_CONFLICT = 409 top
HTTP_CONTINUE = 100 top
HTTP_CREATED = 201 top
HTTP_ERROR = 3 top
HTTP_EXPECTATION_FAILED = 417 top
HTTP_FAILED_DEPENDENCY = 424 top
HTTP_FORBIDDEN = 403 top
HTTP_GATEWAY_TIME_OUT = 504 top
HTTP_GONE = 410 top
HTTP_INSUFFICIENT_STORAGE = 507 top
HTTP_INTERNAL_SERVER_ERROR = 500 top
HTTP_LENGTH_REQUIRED = 411 top
HTTP_LOCKED = 423 top
HTTP_METHOD_NOT_ALLOWED = 405 top
HTTP_MOVED_PERMANENTLY = 301 top
HTTP_MOVED_TEMPORARILY = 302 top
HTTP_MULTIPLE_CHOICES = 300 top
HTTP_MULTI_STATUS = 207 top
HTTP_NON_AUTHORITATIVE = 203 top
HTTP_NOT_ACCEPTABLE = 406 top
HTTP_NOT_EXTENDED = 510 top
HTTP_NOT_FOUND = 404 top
HTTP_NOT_IMPLEMENTED = 501 top
HTTP_NOT_MODIFIED = 304 top
HTTP_NO_CONTENT = 204 top
HTTP_OK = 200 top
HTTP_PARTIAL_CONTENT = 206 top
HTTP_PAYMENT_REQUIRED = 402 top
HTTP_PRECONDITION_FAILED = 412 top
HTTP_PROCESSING = 102 top
HTTP_PROXY_AUTHENTICATION_REQUIRED = 407 top
HTTP_RANGE_NOT_SATISFIABLE = 416 top
HTTP_REQUEST_ENTITY_TOO_LARGE = 413 top
HTTP_REQUEST_TIME_OUT = 408 top
HTTP_REQUEST_URI_TOO_LARGE = 414 top
HTTP_RESET_CONTENT = 205 top
HTTP_SEE_OTHER = 303 top
HTTP_SERVICE_UNAVAILABLE = 503 top
HTTP_SWITCHING_PROTOCOLS = 101 top
HTTP_TEMPORARY_REDIRECT = 307 top
HTTP_UNAUTHORIZED = 401 top
HTTP_UNPROCESSABLE_ENTITY = 422 top
HTTP_UNSUPPORTED_MEDIA_TYPE = 415 top
HTTP_USE_PROXY = 305 top
HTTP_VARIANT_ALSO_VARIES = 506 top
HTTP_VERSION_NOT_SUPPORTED = 505 top
LOG_ALERT = (1, 'A') top
LOG_CRIT = (2, 'C') top
LOG_DEBUG = (7, 'D') top
LOG_EMERG = (0, 'S') top
LOG_ERR = (3, 'E') top
LOG_INFO = (6, 'I') top
LOG_NOERRNO = (8, '0') top
LOG_NOTICE = (5, 'N') top
LOG_WARNING = (4, 'W') top
METHOD_ALL = 511 top
short constants for set all method types METHOD_HEAD | ... | METHOD_PATCH
METHOD_CONNECT = 128 top
METHOD_DELETE = 16 top
METHOD_GET = 2 top
METHOD_GET_POST = 7 top
METHOD_HEAD = 1 top
METHOD_OPTIONS = 64 top
METHOD_PATCH = 256 top
METHOD_POST = 4 top
METHOD_PUT = 8 top
METHOD_TRACE = 32 top
OK = 0 top
levels = {'emerg': (0, 'S'), 'alert': (1, 'A'), 'crit': (2, 'C'), 'error': (3, 'E'), 'warn': (4, 'W'), 'notice': (5, 'N'), 'info': (6, 'I'),... top
log levels which could be set with poor_LogLevel environment variable
methods = {'HEAD': 1, 'GET': 2, 'POST': 4, 'PUT': 8, 'DELETE': 16, 'TRACE': 32, 'OPTIONS': 64, 'CONNECT': 128, 'PATCH': 256} top
know method types


A collection of several scripts to make working with Trados a little bit easire
How To
Alt + Enter / Alt + NumpadEnter: The English segment in Trados will be copied and filtered for in the most recently opened PDF - that way you can immediately jump in the reference file to the segment you are QCing
Obviously, the script has its limitations: if the text in the PDF for example has a hard return and the segment in Trados doesn't, it wouldn't be found
Alt + Numpad+ - Filter for the complete source segment
F9 - Insert the English in the segment, approve segment and move to next one
Numpad0 + Numpad2 - Activate the Trados window
Ctrl + Alt + F12: Set up the Trados tab jumper (see below)
Trados Tab Jumper
Purpose
Quickly jump between several tabs in Trados
This also applies the most recent filter which makes it especially useful in CC1
How To
Hold Numpad2 and then press any number on the number strap (above the keys) to jump to this tab
1 jumps to tab 1, 2 jumps to tab 2 etc.
How to start
Press Ctrl + Alt + F12
After the message box has been popped up, activate your Trados and press "Scroll Lock" (upper right on your keyboard)
This will set the window size of Trados as this is needed for the script (if you need to resize Trados, please relaunch the application)


public interface DpTransCallback
In order to orchestrate transactions with multiple sources of data, ConfD/NCS implements a two-phase commit protocol towards all data sources that participate in a transaction.
Each NETCONF operation will be an individual transaction. These transactions are typically very short lived. Transactions originating from the CLI or the Web UI have longer life. The transaction can be viewed as a conceptual state machine where the different phases of the transaction are different states and the invocations of the callback functions are state transitions. The following ASCII art depicts the state machine.
+-------+ | START | +-------+ | init() | v read() +------+ finish() ------> | READ | --------------------> START +------+ ^ | trans_unlock() | | trans_lock() | v read() +----------+ finish() ------> | VALIDATE | -----------------> START +----------+ | write_start() | v write() +-------+ finish() -------> | WRITE | -------------------> START +-------+ | prepare() | v +----------+ commit() +-----------+ | PREPARED | -----------> | COMMITTED | +----------+ +-----------+ | abort() | | | finish() v | +---------+ v | ABORTED | START +---------+ | finish() | v START
Example: Callback class MyTransCb
* public class MyTransCb { @TransCallback(callType=TransCBType.INIT) public void init(DpTrans trans) throws DpCallbackException { trace("init(): userinfo= " + trans.getUserInfo()); } @TransCallback(callType=TransCBType.FINISH) public void finish(DpTrans trans) throws DpCallbackException { trace("finish()"); } } // And so on ...
| Modifier and Type | Field and Description |
|---|---|
static int |
M_ABORT
Bit flag for the
abort(DpTrans) method. |
static int |
M_ALL |
static int |
M_COMMIT
Bit flag for the
commit(DpTrans) method. |
static int |
M_FINISH
Bit flag for the
finish(DpTrans) method. |
static int |
M_INIT
Bit flag for the
init(DpTrans) method. |
static int |
M_PREPARE
Bit flag for the
prepare(DpTrans) method. |
static int |
M_TRANS_LOCK
Bit flag for the
transLock(DpTrans) method. |
static int |
M_TRANS_UNLOCK
Bit flag for the
transUnlock(DpTrans) method. |
static int |
M_WRITE_START
Bit flag for the
writeStart(DpTrans) method. |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(DpTrans trans)
This callback is responsible for
undoing whatever was done in the prepare() phase.
|
void |
commit(DpTrans trans)
This callback is responsible for
undoing whatever was done in the prepare() phase.
|
void |
finish(DpTrans trans)
This callback is responsible for
releasing resources allocated in the init() phase.
|
void |
init(DpTrans trans)
The callback must indicate which WORKER_SOCKET
should be used for future communications in this transaction.
|
int |
mask()
Mask of flags for each method that is supported by this callback:
M_INIT
M_TRANS_LOCK
M_TRANS_UNLOCK
M_WRITE_START
M_PREPARE
M_ABORT
M_COMMIT
M_FINISH
|
void |
prepare(DpTrans trans)
If we have multiple sources of data it is highly recommended
that the callback is implemented.
|
void |
transLock(DpTrans trans)
This callback is invoked when the validation phase of the transaction
starts.
|
void |
transUnlock(DpTrans trans)
This callback is called when the validation of the transaction
failed, or the validation is triggered explicitly (i.e.
|
void |
writeStart(DpTrans trans)
This callback is invoked when the validation succeeded and the
write phase of the transaction starts.
|
static final int M_ABORT
abort(DpTrans)
method.static final int M_ALL
static final int M_COMMIT
commit(DpTrans)
method.static final int M_FINISH
finish(DpTrans)
method.static final int M_INIT
init(DpTrans)
method.static final int M_PREPARE
prepare(DpTrans)
method.static final int M_TRANS_LOCK
transLock(DpTrans)
method.static final int M_TRANS_UNLOCK
transUnlock(DpTrans)
method.static final int M_WRITE_START
writeStart(DpTrans)
method.void abort(DpTrans trans) throws DpCallbackException
trans
- TransactionDpCallbackException
- Callback method failed.void commit(DpTrans trans) throws DpCallbackException
trans
- TransactionDpCallbackException
- Callback method failed.void finish(DpTrans trans) throws DpCallbackException
trans
- TransactionDpCallbackException
- Callback method failed.void init(DpTrans trans) throws DpCallbackException
trans
- TransactionDpCallbackException
- Callback method failed.int mask()
void prepare(DpTrans trans) throws DpCallbackException
trans
- TransactionDpCallbackException
- Callback method failed.void transLock(DpTrans trans) throws DpCallbackException
The transaction enters VALIDATE state, where the system will perform a series of read() operations.
The trans lock is set until either transUnlock() or finish() is called. the system ensures that a transLock is set on a single transaction only.
trans
- TransactionDpCallbackException
- Callback method failed.void transUnlock(DpTrans trans) throws DpCallbackException
The transaction re-enters READ state.
trans
- TransactionDpCallbackException
- Callback method failed.void writeStart(DpTrans trans) throws DpCallbackException
The transaction enters the WRITE state. No more read() operations will be performed by the system.
trans
- TransactionDpCallbackException
- Callback method failed.


Welcome to use
Server
Username
Password
Connect
Disconnect
Select local file:
Select
Remote path:
Upload


Broken Bookshelf:
When you cut the string, it falls to the floor and you hear a faint sigh.
Shall you read the book?
Read the book.


Following the method of Bailey et al., computes for a collection of candidate models the probability of backtest overfitting, the performance degradation and probability of loss, and the stochastic dominance.
| Version: | 1.3.4 |
| Depends: | utils, lattice |
| Suggests: | PerformanceAnalytics, foreach, grid, latticeExtra, testthat, doParallel, knitr |
| Published: | 2014-05-31 |
| Author: | Matt Barry |
| Maintainer: | Matt Barry <mrb at softisms.com> |
| BugReports: | https://github.com/mrbcuda/pbo/issues |
| License: | MIT + file LICENSE |
| URL: | https://github.com/mrbcuda/pbo |
| NeedsCompilation: | no |
| Materials: | README |
| In views: | Finance |
| CRAN checks: | pbo results |
| Reference manual: | pbo.pdf |
| Vignettes: |
Using the PBO package |
| Package source: | pbo_1.3.4.tar.gz |
| Windows binaries: | r-devel: pbo_1.3.4.zip, r-release: pbo_1.3.4.zip, r-oldrel: pbo_1.3.4.zip |
| OS X binaries: | r-release: pbo_1.3.4.tgz, r-oldrel: pbo_1.3.4.tgz |
Please use the canonical form https://CRAN.R-project.org/package=pbo to link to this page.


Number baseball game is by guessing each digit from 0 to 9 that
specify a different 3-digit number.
If you match the digit number and order, that is a strike.
If you only match the number but not the order, it’s a ball.
specify a different 3-digit number.
<Example>
Answer : 378
Your guess: 389
This would result in one strike, one ball since '3' is in the correct
position and although '8' is included in the answer it is not in the
correct position.
Try to guess the number with the least amount of tries
Good Luck!
I am an aspiring software developer.
I am most familiar with coding in Python along with R for statistical
modeling. However, I am capable with HTML, CSS, Javascript, and SQL.
Solving numeric puzzles has always been fun for me which led me to
create this page. It was a game I played alot in school with my friends
in between classes. In my free time I am usually jogging or bouldering.


MCFS-ID (Monte Carlo Feature Selection and Interdependency Discovery) is a Monte Carlo method-based tool for feature selection. It also allows for the discovery of interdependencies between the relevant features. MCFS-ID is particularly suitable for the analysis of high-dimensional, 'small n large p' transactional and biological data. M. Draminski, J. Koronacki (2018) <doi:10.18637/jss.v085.i12>.
| Version: |
1.2.15 |
| Depends: |
rJava (≥ 0.5-0), R (≥ 2.70) |
| Imports: |
yaml, ggplot2, reshape2, dplyr, igraph (≥ 1.0.1) |
| Suggests: |
testthat, R.rsp |
| Published: |
2018-10-20 |
| Author: |
Michal Draminski [aut, cre],
Jacek Koronacki [aut],
Julian Zubek [ctb] |
| Maintainer: |
Michal Draminski <michal.draminski at ipipan.waw.pl> |
| License: |
GPL-3 |
| URL: |
www.ipipan.eu/staff/m.draminski/mcfs.html |
| NeedsCompilation: |
no |
| SystemRequirements: |
Java (>= 6) |
| Citation: |
rmcfs citation info |
| Materials: |
NEWS |
| CRAN checks: |
rmcfs results |


D-link do something realy wierd with swTemperatureTable. So it’s values not discovered but set manualy as items
Based on MIB from vendor. Checked on local single and stacked DGS/DWS-3120-xx devices.
Main system Items, Ttiggers and Graphs.
LLD Network interfaces.
LLD Memory, Temperature and Fan values (though D-link does something weird with fan and temperature OIDs, probably depends on firmware, so this prototypes was added semi-manualy).
There are no macros links in this template.
There are no template links in this template.
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Environment management |
-
 | SNMP agent |
agentDRAMutilizationUnitID
Update: 3600
 |
| Network Interfaces |
-
 | SNMP agent |
ifIndex
Update: 3600
 |
|Name|Description|Type|Key and additional info|
|—-|———–|—-|—-|
|Device firmware version|
Version number of the Firmware.
|SNMP agent
|sysFirmwareVersion
Update: 3600
|
|Device hardware version|
Version number of the Hardware.
|SNMP agent
|sysHardwareVersion
Update: 3600
|
|Device location|
The physical location of this node (e.g., telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string.
|
SNMP agent|sysLocation
Update: 3600
|
|Device description|
A textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software. It is mandatory that this only contain printable ASCII characters.
|
SNMP agent|sysDescr
Update: 3600
|
|Device serial number|
A textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software. It is mandatory that this only contain printable ASCII characters.
|
SNMP agent|agentSerialNumber
Update: 3600
|
|Device contact details|
-
|
SNMP agent|sysContact
Update: 3600
|
|Device name|
An administratively-assigned name for this managed node. By convention, this is the node's fully-qualified domain name. If the name is unknown, the value is the zero-length string.
|
SNMP agent|sysName
Update: 3600
|
|Device uptime|
The time since the network management portion of the system was last re-initialized.
|
SNMP agent|sysUpTime
Update: 300
|
|Device CPU utilization|
The time scale is set at 5 minute intervals. The value will be between 0% (idle) and 100% (very busy).
|
SNMP agent|agentCPUutilizationIn5min
Update: 300
|
|Device fan $1-1|
-
|
SNMP agent|swFanSpeed.1.[{#SNMPVALUE}]
Update: 300

LLD
|
|Device fan $1-2|
-
|
SNMP agent|swFanSpeed.2.[{#SNMPVALUE}]
Update: 300

LLD
|
|Device memory total, unit $1|
-
|
SNMP agent|agentDRAMutilizationTotalDRAM[{#SNMPVALUE}]
Update: 300

LLD
|
|Device memory used, unit $1|
-
|
SNMP agent|agentDRAMutilizationUsedDRAM[{#SNMPVALUE}]
Update: 300

LLD
|
|Device memory utilization, unit $1|
-
|
SNMP agent|agentDRAMutilization[{#SNMPVALUE}]
Update: 300

LLD
|
|Device temperature, unit $1|
-
|
SNMP agent|swTemperatureCurrent[{#SNMPVALUE}]
Update: 300

LLD
|
|Alias of interface $1|
-
|
SNMP agent|ifAlias[{#SNMPVALUE}]
Update: 3600

LLD
|
|Inbound errors on interface $1|
The number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol.
|
SNMP agent|ifInErrors[{#SNMPVALUE}]
Update: 3600

LLD
|
|Incoming traffic on interface $1|
The total number of octets received on the interface, including framing characters.
|
SNMP agent|ifInOctets[{#SNMPVALUE}]
Update: 300

LLD
|
|Operational status of interface $1|
The current operational state of the interface. The testing(3) state indicates that no operational packets can be passed.
|
SNMP agent|ifOperStatus[{#SNMPVALUE}]
Update: 3600

LLD
|
|Outgoing traffic on interface $1|
The total number of octets transmitted out of the interface, including framing characters.
|
SNMP agent|ifOutOctets[{#SNMPVALUE}]
Update: 300

LLD
|
|Speed of interface $1|
An estimate of the interface's current bandwidth in bits per second. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth.
|
SNMP agent`|ifSpeed[{#SNMPVALUE}]
Update: 3600

LLD
|
| Name | Description | Expression | Priority |
|---|---|---|---|
| {HOST.NAME} unit {#SNMPVALUE} - 1st fan failed |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.1.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - 2nd fan failed |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.2.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - temperature high |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swTemperatureCurrent[{#SNMPVALUE}].avg(#3)}=40

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - 1st fan failed (LLD) |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.1.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - 2nd fan failed (LLD) |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.2.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - temperature high (LLD) |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swTemperatureCurrent[{#SNMPVALUE}].avg(#3)}=40

Recovery expression:
 | high |
D-link do something realy wierd with swTemperatureTable. So it’s values not discovered but set manualy as items
Based on MIB from vendor. Checked on local single and stacked DGS/DWS-3120-xx devices.
Main system Items, Ttiggers and Graphs.
LLD Network interfaces.
LLD Memory, Temperature and Fan values (though D-link does something weird with fan and temperature OIDs, probably depends on firmware, so this prototypes was added semi-manualy).
There are no macros links in this template.
There are no template links in this template.
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Environment management |
-
 | SNMP agent |
agentDRAMutilizationUnitID
Update: 3600
 |
| Network Interfaces |
-
 | SNMP agent |
ifIndex
Update: 3600
 |
|Name|Description|Type|Key and additional info|
|—-|———–|—-|—-|
|Device firmware version|
Version number of the Firmware.
|SNMP agent
|sysFirmwareVersion
Update: 3600
|
|Device hardware version|
Version number of the Hardware.
|SNMP agent
|sysHardwareVersion
Update: 3600
|
|Device location|
The physical location of this node (e.g., telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string.
|
SNMP agent|sysLocation
Update: 3600
|
|Device description|
A textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software. It is mandatory that this only contain printable ASCII characters.
|
SNMP agent|sysDescr
Update: 3600
|
|Device serial number|
A textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software. It is mandatory that this only contain printable ASCII characters.
|
SNMP agent|agentSerialNumber
Update: 3600
|
|Device contact details|
-
|
SNMP agent|sysContact
Update: 3600
|
|Device name|
An administratively-assigned name for this managed node. By convention, this is the node's fully-qualified domain name. If the name is unknown, the value is the zero-length string.
|
SNMP agent|sysName
Update: 3600
|
|Device uptime|
The time since the network management portion of the system was last re-initialized.
|
SNMP agent|sysUpTime
Update: 300
|
|Device CPU utilization|
The time scale is set at 5 minute intervals. The value will be between 0% (idle) and 100% (very busy).
|
SNMP agent|agentCPUutilizationIn5min
Update: 300
|
|Device fan $1-1|
-
|
SNMP agent|swFanSpeed.1.[{#SNMPVALUE}]
Update: 300

LLD
|
|Device fan $1-2|
-
|
SNMP agent|swFanSpeed.2.[{#SNMPVALUE}]
Update: 300

LLD
|
|Device memory total, unit $1|
-
|
SNMP agent|agentDRAMutilizationTotalDRAM[{#SNMPVALUE}]
Update: 300

LLD
|
|Device memory used, unit $1|
-
|
SNMP agent|agentDRAMutilizationUsedDRAM[{#SNMPVALUE}]
Update: 300

LLD
|
|Device memory utilization, unit $1|
-
|
SNMP agent|agentDRAMutilization[{#SNMPVALUE}]
Update: 300

LLD
|
|Device temperature, unit $1|
-
|
SNMP agent|swTemperatureCurrent[{#SNMPVALUE}]
Update: 300

LLD
|
|Alias of interface $1|
-
|
SNMP agent|ifAlias[{#SNMPVALUE}]
Update: 3600

LLD
|
|Inbound errors on interface $1|
The number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol.
|
SNMP agent|ifInErrors[{#SNMPVALUE}]
Update: 3600

LLD
|
|Incoming traffic on interface $1|
The total number of octets received on the interface, including framing characters.
|
SNMP agent|ifInOctets[{#SNMPVALUE}]
Update: 300

LLD
|
|Operational status of interface $1|
The current operational state of the interface. The testing(3) state indicates that no operational packets can be passed.
|
SNMP agent|ifOperStatus[{#SNMPVALUE}]
Update: 3600

LLD
|
|Outgoing traffic on interface $1|
The total number of octets transmitted out of the interface, including framing characters.
|
SNMP agent|ifOutOctets[{#SNMPVALUE}]
Update: 300

LLD
|
|Speed of interface $1|
An estimate of the interface's current bandwidth in bits per second. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth.
|
SNMP agent`|ifSpeed[{#SNMPVALUE}]
Update: 3600

LLD
|
| Name | Description | Expression | Priority |
|---|---|---|---|
| {HOST.NAME} unit {#SNMPVALUE} - 1st fan failed |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.1.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - 2nd fan failed |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.2.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - temperature high |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swTemperatureCurrent[{#SNMPVALUE}].avg(#3)}=40

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - 1st fan failed (LLD) |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.1.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - 2nd fan failed (LLD) |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.2.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - temperature high (LLD) |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swTemperatureCurrent[{#SNMPVALUE}].avg(#3)}=40

Recovery expression:
 | high |
D-link do something realy wierd with swTemperatureTable. So it’s values not discovered but set manualy as items
Based on MIB from vendor. Checked on local single and stacked DGS/DWS-3120-xx devices.
Main system Items, Ttiggers and Graphs.
LLD Network interfaces.
LLD Memory, Temperature and Fan values (though D-link does something weird with fan and temperature OIDs, probably depends on firmware, so this prototypes was added semi-manualy).
There are no macros links in this template.
There are no template links in this template.
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Environment management |
-
 | SNMP agent |
agentDRAMutilizationUnitID
Update: 3600
 |
| Network Interfaces |
-
 | SNMP agent |
ifIndex
Update: 3600
 |
|Name|Description|Type|Key and additional info|
|—-|———–|—-|—-|
|Device firmware version|
Version number of the Firmware.
|SNMP agent
|sysFirmwareVersion
Update: 3600
|
|Device hardware version|
Version number of the Hardware.
|SNMP agent
|sysHardwareVersion
Update: 3600
|
|Device location|
The physical location of this node (e.g., telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string.
|
SNMP agent|sysLocation
Update: 3600
|
|Device description|
A textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software. It is mandatory that this only contain printable ASCII characters.
|
SNMP agent|sysDescr
Update: 3600
|
|Device serial number|
A textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software. It is mandatory that this only contain printable ASCII characters.
|
SNMP agent|agentSerialNumber
Update: 3600
|
|Device contact details|
-
|
SNMP agent|sysContact
Update: 3600
|
|Device name|
An administratively-assigned name for this managed node. By convention, this is the node's fully-qualified domain name. If the name is unknown, the value is the zero-length string.
|
SNMP agent|sysName
Update: 3600
|
|Device uptime|
The time since the network management portion of the system was last re-initialized.
|
SNMP agent|sysUpTime
Update: 300
|
|Device CPU utilization|
The time scale is set at 5 minute intervals. The value will be between 0% (idle) and 100% (very busy).
|
SNMP agent|agentCPUutilizationIn5min
Update: 300
|
|Device fan $1-1|
-
|
SNMP agent|swFanSpeed.1.[{#SNMPVALUE}]
Update: 300

LLD
|
|Device fan $1-2|
-
|
SNMP agent|swFanSpeed.2.[{#SNMPVALUE}]
Update: 300

LLD
|
|Device memory total, unit $1|
-
|
SNMP agent|agentDRAMutilizationTotalDRAM[{#SNMPVALUE}]
Update: 300

LLD
|
|Device memory used, unit $1|
-
|
SNMP agent|agentDRAMutilizationUsedDRAM[{#SNMPVALUE}]
Update: 300

LLD
|
|Device memory utilization, unit $1|
-
|
SNMP agent|agentDRAMutilization[{#SNMPVALUE}]
Update: 300

LLD
|
|Device temperature, unit $1|
-
|
SNMP agent|swTemperatureCurrent[{#SNMPVALUE}]
Update: 300

LLD
|
|Alias of interface $1|
-
|
SNMP agent|ifAlias[{#SNMPVALUE}]
Update: 3600

LLD
|
|Inbound errors on interface $1|
The number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol.
|
SNMP agent|ifInErrors[{#SNMPVALUE}]
Update: 3600

LLD
|
|Incoming traffic on interface $1|
The total number of octets received on the interface, including framing characters.
|
SNMP agent|ifInOctets[{#SNMPVALUE}]
Update: 300

LLD
|
|Operational status of interface $1|
The current operational state of the interface. The testing(3) state indicates that no operational packets can be passed.
|
SNMP agent|ifOperStatus[{#SNMPVALUE}]
Update: 3600

LLD
|
|Outgoing traffic on interface $1|
The total number of octets transmitted out of the interface, including framing characters.
|
SNMP agent|ifOutOctets[{#SNMPVALUE}]
Update: 300

LLD
|
|Speed of interface $1|
An estimate of the interface's current bandwidth in bits per second. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth.
|
SNMP agent`|ifSpeed[{#SNMPVALUE}]
Update: 3600

LLD
|
| Name | Description | Expression | Priority |
|---|---|---|---|
| {HOST.NAME} unit {#SNMPVALUE} - 1st fan failed |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.1.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - 2nd fan failed |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.2.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - temperature high |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swTemperatureCurrent[{#SNMPVALUE}].avg(#3)}=40

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - 1st fan failed (LLD) |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.1.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - 2nd fan failed (LLD) |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swFanSpeed.2.[{#SNMPVALUE}].max(30m)}=0

Recovery expression:
 | high |
| {HOST.NAME} unit {#SNMPVALUE} - temperature high (LLD) |
-
 |
Expression: {SNMP D-link DGS-3120-xx:swTemperatureCurrent[{#SNMPVALUE}].avg(#3)}=40

Recovery expression:
 | high |


QSGTexture Class
The QSGTexture class is a baseclass for textures used in the scene graph. More...
| Header: | #include <QSGTexture> |
| qmake: | QT += quick |
| Inherits: | QObject |
| Inherited By: |
Public Types
| enum | AnisotropyLevel { AnisotropyNone, Anisotropy2x, Anisotropy4x, Anisotropy8x, Anisotropy16x } |
| enum | Filtering { None, Nearest, Linear } |
| enum | WrapMode { Repeat, ClampToEdge } |
Public Functions
| QSGTexture() | |
| ~QSGTexture() | |
| QSGTexture::AnisotropyLevel | anisotropyLevel() const |
| virtual void | bind() = 0 |
| QRectF | convertToNormalizedSourceRect(const QRectF &rect) const |
| QSGTexture::Filtering | filtering() const |
| virtual bool | hasAlphaChannel() const = 0 |
| virtual bool | hasMipmaps() const = 0 |
| QSGTexture::WrapMode | horizontalWrapMode() const |
| virtual bool | isAtlasTexture() const |
| QSGTexture::Filtering | mipmapFiltering() const |
| virtual QRectF | normalizedTextureSubRect() const |
| virtual QSGTexture * | removedFromAtlas() const |
| void | setAnisotropyLevel(AnisotropyLevel level) |
| void | setFiltering(Filtering filter) |
| void | setHorizontalWrapMode(WrapMode hwrap) |
| void | setMipmapFiltering(Filtering filter) |
| void | setVerticalWrapMode(WrapMode vwrap) |
| virtual int | textureId() const = 0 |
| virtual QSize | textureSize() const = 0 |
| void | updateBindOptions(bool force = false) |
| QSGTexture::WrapMode | verticalWrapMode() const |
- 32 public functions inherited from QObject
Additional Inherited Members
- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 2 signals inherited from QObject
- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 9 protected functions inherited from QObject
- 2 protected variables inherited from QObject
Detailed Description
The QSGTexture class is a baseclass for textures used in the scene graph.
Users can freely implement their own texture classes to support arbitrary input textures, such as YUV video frames or 8 bit alpha masks. The scene graph backend provides a default implementation of normal color textures. As the implementation of these may be hardware specific, they are constructed via the factory function QQuickWindow::createTextureFromImage().
The texture is a wrapper around an OpenGL texture, which texture id is given by textureId() and which size in pixels is given by textureSize(). hasAlphaChannel() reports if the texture contains opacity values and hasMipmaps() reports if the texture contains mipmap levels.
To use a texture, call the bind() function. The texture parameters specifying how the texture is bound, can be specified with setMipmapFiltering(), setFiltering(), setHorizontalWrapMode() and setVerticalWrapMode(). The texture will internally try to store these values to minimize the OpenGL state changes when the texture is bound.
Texture Atlasses
Some scene graph backends use texture atlasses, grouping multiple small textures into one large texture. If this is the case, the function isAtlasTexture() will return true. Atlasses are used to aid the rendering algorithm to do better sorting which increases performance. The location of the texture inside the atlas is given with the normalizedTextureSubRect() function.
If the texture is used in such a way that atlas is not preferable, the function removedFromAtlas() can be used to extract a non-atlassed copy.
Note: All classes with QSG prefix should be used solely on the scene graph's rendering thread. See Scene Graph and Rendering for more information.
See also Scene Graph - Rendering FBOs and Scene Graph - Rendering FBOs in a thread.
Member Type Documentation
enum QSGTexture::AnisotropyLevel
Specifies the anisotropic filtering level to be used when the texture is not screen aligned.
| Constant | Value | Description |
|---|---|---|
QSGTexture::AnisotropyNone | 0 | No anisotropic filtering. |
QSGTexture::Anisotropy2x | 1 | 2x anisotropic filtering. |
QSGTexture::Anisotropy4x | 2 | 4x anisotropic filtering. |
QSGTexture::Anisotropy8x | 3 | 8x anisotropic filtering. |
QSGTexture::Anisotropy16x | 4 | 16x anisotropic filtering. |
This enum was introduced or modified in Qt 5.9.
enum QSGTexture::Filtering
Specifies how sampling of texels should filter when texture coordinates are not pixel aligned.
| Constant | Value | Description |
|---|---|---|
QSGTexture::None | 0 | No filtering should occur. This value is only used together with setMipmapFiltering(). |
QSGTexture::Nearest | 1 | Sampling returns the nearest texel. |
QSGTexture::Linear | 2 | Sampling returns a linear interpolation of the neighboring texels. |
enum QSGTexture::WrapMode
Specifies how the texture should treat texture coordinates.
| Constant | Value | Description |
|---|---|---|
QSGTexture::Repeat | 0 | Only the factional part of the texture coordiante is used, causing values above 1 and below 0 to repeat. |
QSGTexture::ClampToEdge | 1 | Values above 1 are clamped to 1 and values below 0 are clamped to 0. |
Member Function Documentation
QSGTexture::QSGTexture()
Constructs the QSGTexture base class.
QSGTexture::~QSGTexture()
Destroys the QSGTexture.
QSGTexture::AnisotropyLevel QSGTexture::anisotropyLevel() const
Returns the anisotropy level in use for filtering this texture.
This function was introduced in Qt 5.9.
See also setAnisotropyLevel().
[pure virtual]
void QSGTexture::bind()
Call this function to bind this texture to the current texture target.
Binding a texture may also include uploading the texture data from a previously set QImage.
Warning: This function can only be called from the rendering thread.
QRectF QSGTexture::convertToNormalizedSourceRect(const QRectF &rect) const
Returns rect converted to normalized coordinates.
See also normalizedTextureSubRect().
QSGTexture::Filtering QSGTexture::filtering() const
Returns the sampling mode to be used for this texture.
See also setFiltering().
[pure virtual]
bool QSGTexture::hasAlphaChannel() const
Returns true if the texture data contains an alpha channel.
[pure virtual]
bool QSGTexture::hasMipmaps() const
Returns true if the texture data contains mipmap levels.
QSGTexture::WrapMode QSGTexture::horizontalWrapMode() const
Returns the horizontal wrap mode to be used for this texture.
See also setHorizontalWrapMode().
[virtual]
bool QSGTexture::isAtlasTexture() const
Returns weither this texture is part of an atlas or not.
The default implementation returns false.
QSGTexture::Filtering QSGTexture::mipmapFiltering() const
Returns whether mipmapping should be used when sampling from this texture.
See also setMipmapFiltering().
[virtual]
QRectF QSGTexture::normalizedTextureSubRect() const
Returns the rectangle inside textureSize() that this texture represents in normalized coordinates.
The default implementation returns a rect at position (0, 0) with width and height of 1.
[virtual]
QSGTexture *QSGTexture::removedFromAtlas() const
This function returns a copy of the current texture which is removed from its atlas.
The current texture remains unchanged, so texture coordinates do not need to be updated.
Removing a texture from an atlas is primarily useful when passing it to a shader that operates on the texture coordinates 0-1 instead of the texture subrect inside the atlas.
If the texture is not part of a texture atlas, this function returns 0.
Implementations of this function are recommended to return the same instance for multiple calls to limit memory usage.
Warning: This function can only be called from the rendering thread.
void QSGTexture::setAnisotropyLevel(AnisotropyLevel level)
Sets the level of anisotropic filtering to be used for the upcoming bind() call to level. The default value is QSGTexture::AnisotropyNone, which means no anisotropic filtering is enabled.
This function was introduced in Qt 5.9.
See also anisotropyLevel().
void QSGTexture::setFiltering(Filtering filter)
Sets the sampling mode to be used for the upcoming bind() call to filter.
See also filtering().
void QSGTexture::setHorizontalWrapMode(WrapMode hwrap)
Sets the horizontal wrap mode to be used for the upcoming bind() call to hwrap
See also horizontalWrapMode().
void QSGTexture::setMipmapFiltering(Filtering filter)
Sets the mipmap sampling mode to be used for the upcoming bind() call to filter.
Setting the mipmap filtering has no effect it the texture does not have mipmaps.
See also mipmapFiltering() and hasMipmaps().
void QSGTexture::setVerticalWrapMode(WrapMode vwrap)
Sets the vertical wrap mode to be used for the upcoming bind() call to vwrap
See also verticalWrapMode().
[pure virtual]
int QSGTexture::textureId() const
Returns the OpenGL texture id for this texture.
The default value is 0, indicating that it is an invalid texture id.
The function should at all times return the correct texture id.
Warning: This function can only be called from the rendering thread.
[pure virtual]
QSize QSGTexture::textureSize() const
Returns the size of the texture.
void QSGTexture::updateBindOptions(bool force = false)
Update the texture state to match the filtering, mipmap and wrap options currently set.
If force is true, all properties will be updated regardless of weither they have changed or not.
QSGTexture::WrapMode QSGTexture::verticalWrapMode() const
Returns the vertical wrap mode to be used for this texture.
See also setVerticalWrapMode().


A numeric annotation specifies how many database entities must match a particular query element. Both vertices and edges may be annotated. (Subqueries are also annotated, as described in Chapter 6, Subqueries.) Numeric annotations can specify a range of values, giving them a great deal more flexibility than the alternative of specifying exact structural matches.
There are three legal forms of numeric annotation:
An unbounded range
[i
..] on a vertex or edge means that at
least i
instances of the corresponding
database element must be present to match the query. An unbounded
range will match any number greater than or equal to
i
of database elements.
A bounded range
[i
..j
] means
that at least i
and no more than
j
instances are required for a
match. The query will not match database structures that have
fewer than or more than the specified number of elements.
An exact annotation
means that exactly
the specified number of database elements must be present to match
the query. For example, if you specify a vertex annotation of
[2]
, the query will not match database
structures that have one, three, or more matching vertices.
We can use numeric annotations to restate the query with which we began this chapter, finding movies produced by exactly two studios:
Figure 4.3 includes two numeric annotations,
one on the vertex representing studio objects, and one on
the adjacent edge. The [2]
annotation on the
studio vertex
indicates that the query can only
match subgraphs containing exactly two studio objects.
Of course, all the other parts of the query must also be
satisfied—those two studio objects must be linked to the same
actor object by produced links. This annotation also serves to group
the two studio-movie pairs in a single subgraph with one movie object
and two linked studio objects, rather than returning the
multiple subgraphs we saw in
Chapter 2, Query Basics.
The [1..]
edge annotation is included because
we cannot assume that linked objects
in a database are connected by only a single link. If a database
contains multiple links between objects, then we usually want to group
these links, in addition to grouping the objects, in the query
results. Because we may not know how many links connect one object to
another, we use the unbounded annotation [1..]
on
the edge. For now, we’ll note that this is usually the correct
annotation for an adjacent
edge and simply follow this convention in
defining the next several queries. The section on
“Understanding Multiple Annotations” later in this chapter provides a
more complete explanation of this edge annotation.
Edges adjacent to annotated vertices must be annotated for the reason cited above. Only one of two adjacent vertices may be annotated because annotating adjacent vertices can result in ambiguities in interpreting the query. Proximity enforces these requirements and will not execute queries with illegal annotations. See “Adjacency Requirements” later in this chapter for a more detailed explanation of the reasons behind these requirements.
When executing an annotated query, the vertex annotation takes precedence over the edge annotation. That is, the query processor first satisfies requirements on the vertex and then checks to see if it can satisfy requirements on the corresponding edges.
To see how Proximity handles the query shown in Figure 4.3, consider the database fragment shown in Figure 4.4. This fragment contains information about studios that produced some recent Academy Award winning pictures.
The above fragment includes four different movies: two produced by a
single studio (Forrest Gump and
Chicago), one produced by two studios
(Titanic), and one produced by three studios
(Shakespeare in Love).
Executing the query shown in Figure 4.3
on this database fragment yields the matching subgraph shown in
Figure 4.5.
Rather than returning two subgraphs, each with one movie and one
studio, this query returns a single subgraph containing the same data
that would have been spread across multiple matches had we omitted
the annotations from the query.
Because we used an exact annotation of [2]
on
the studio vertex, the query does not match
subgraphs containing movies connected to a single studio or to more
than two studios. If we want to instead find all the movies produced
by two or more studios, we need to change the numeric annotation on
the studio vertex to use the unbounded
range [2..]
, as shown in
Figure 4.6.
The results of executing this modified query on the data shown in
Figure 4.4 are shown below:
This time, the unbounded annotation [2..]
on the
studio vertex matches both the
subgraph containing the two studios that produced
Titanic and the subgraph containing the
three studios that produced Shakespeare in
Love.
A variation on this query structure forms one of the most common QGraph queries, the star query. Star queries find all database elements linked to a core object. Star queries are typically used to find subgraphs such as “all actors in a movie” or “all authors for a paper” (assuming the corresponding database contains the appropriate objects and links).
Star queries can use either
directed or
undirected edges.
To create a star query for the movie and studio database, we need to determine which type of objects should serve as the core vertex for the query. Because this database links multiple studios to a single movie, we make the core vertex match movie objects.
The query above finds and returns a subgraph for each movie in the
database. Each subgraph includes all the actors linked from that
movie. The results of executing
this query on the database fragment in
Figure 4.4 are shown below:
Just as we can annotate vertices so that they match more than one object, we can also annotate edges so that they match more than one link. For example, the database fragment shown in Figure 4.11 contains information on several actors and the roles they played in the movie Angels in America.
The database fragment indicates that Al Pacino played a single role,
Justin Kirk played two different roles, and Meryl Streep played four
different roles in this movie.
It’s worth noting that the database fragment shown in Figure 4.11 uses a different schema to represent actors and roles from that used in Figure 3.8. The example in Chapter 3, Conditions used multiple attribute values on a single link to indicate that an actor played multiple roles in a movie. The example in this chapter uses multiple links to represent the same kind of information. Proximity does not requires any particular representational schema for a given dataset, although consistency within a dataset is important. You can determine the appropriate schema for your data.
A query that uses edge annotations to find actors playing multiple roles is shown in Figure 4.12.
Here we include the annotation [2..]
on the edge
connecting the actor vertex to the
movie vertex, indicating that the query
matches actor-movie pairs connected by two or more
role links. Annotated edges can stand alone;
they do not require that any adjacent
vertices be annotated.
The existence condition on the
role edge
requires that matching edges have a Role
attribute, but doesn’t place any requirements on the specific
value of this attribute.
The results of executing this query on the database fragment shown in Figure 4.11 are shown below.
Just as vertex annotations group matching objects, the query’s edge annotation groups matching links into a single subgraph in the query’s results. Without the edge annotation, this query returns seven subgraphs—one for each unique actor-role-movie subgraph in the database.
An annotation of [1]
is not
equivalent
to no
annotation. A [1]
annotation requires that the query only match subgraphs that contain
exactly one of the annotated entities. A query with no annotation
will match each appropriate database entity regardless of number,
although it will not group the matches into a single subgraph. This
can be seen by comparing the results for the two queries below.
The query on the right includes an exact [1]
annotation on the studio vertex (and
the standard [1..]
annotation on the
incident edge to satisfy QGraph’s adjacency requirements for
annotations). The query on the left has no annotations.
Executing these queries on the database fragment shown in
Figure 4.4 yields distinctly different
results. Figure 4.15 shows the
results from the unannotated query.
The query without annotations matches all the studio-movie pairs in the
database. Studios are not grouped; each match forms a separate
subgraph. Compare these results to that for the query containing the
[1]
vertex annotation.
The results of executing the annotated query include just
two subgraphs, matching the two
instances in the database where a movie is linked to exactly one
studio.


| Package | Description |
|---|---|
| bftsmart.consensus | |
| bftsmart.consensus.messages | |
| bftsmart.consensus.roles | |
| bftsmart.tom | |
| bftsmart.tom.core | |
| bftsmart.tom.leaderchange |
| Modifier and Type | Field | Description |
|---|---|---|
java.util.HashSet<ConsensusMessage> |
Epoch.proof |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Set<ConsensusMessage> |
Epoch.getProof() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
Epoch.addToProof(ConsensusMessage pm) |
| Modifier and Type | Method | Description |
|---|---|---|
ConsensusMessage |
MessageFactory.createAccept(int id,
int epoch,
byte[] value) |
Creates a WRITE message to be sent by this process
|
ConsensusMessage |
MessageFactory.createPropose(int id,
int epoch,
byte[] value) |
Creates a PROPOSE message to be sent by this process
|
ConsensusMessage |
MessageFactory.createWrite(int id,
int epoch,
byte[] value) |
Creates a WRITE message to be sent by this process
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
Acceptor.deliver(ConsensusMessage msg) |
Called by communication layer to delivery Paxos messages.
|
void |
Acceptor.processMessage(ConsensusMessage msg) |
Called when a Consensus message is received or when a out of context message must be processed.
|
void |
Acceptor.proposeReceived(Epoch epoch,
ConsensusMessage msg) |
Called when a PROPOSE message is received or when processing a formerly out of context propose which
is know belongs to the current das.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Set<ConsensusMessage> |
MessageContext.getProof() |
Returns the proof for the das.
|
| Constructor | Description |
|---|---|
MessageContext(int sender,
int viewID,
TOMMessageType type,
int session,
int sequence,
int operationId,
int replyServer,
byte[] signature,
long timestamp,
int numOfNonces,
long seed,
int regency,
int leader,
int consensusId,
java.util.Set<ConsensusMessage> proof,
TOMMessage firstInBatch,
boolean noOp) |
Constructor
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Queue<ConsensusMessage> |
ExecutionManager.getStoppedMsgs() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
ExecutionManager.addOutOfContextMessage(ConsensusMessage m) |
Stores a message established as being out of context (a message that
doesn't belong to current executing das).
|
boolean |
ExecutionManager.checkLimits(ConsensusMessage msg) |
Checks if this message can execute now.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Set<ConsensusMessage> |
CertifiedDecision.getConsMessages() |
Get proof of the decision in the form of authenticated Consensus Messages
|
| Constructor | Description |
|---|---|
CertifiedDecision(int pid,
int cid,
byte[] decision,
java.util.Set<ConsensusMessage> consMsgs) |
Constructor
|
Copyright © 2018. All rights reserved.


This application links to the mlb.com website to obtain live real time data. The
Two types of data are pulled from the site and rolled into this web application The first is a series of JSON files which describe
all the current games and status. The second source is a collection of RSS feeds which are consolidated by MLB Division and rolled out in the various tickers.
I have also added a few Feeds for the Boston Red Sox.


Anna Henderson
A harmonious union of design and tech is Anna's main goal. As she studies at Victoria University of Wellington she utilizes all areas of her life to gain inspiration and motivation, in the hope that her creations will let her magic connect with the magic of the world that surrounds her.


Author: Lincoln Baxter, Matej Briskar
Level: Intermediate
Technologies: Forge
Summary: The forge-from-scratch
quickstart demonstrates how JBoss Forge can generate a Java EE (JPA, EJB, JAX-RS, JSF) web-enabled database application.
Target Product: JBoss EAP
Source: https://github.com/jboss-developer/jboss-eap-quickstarts/
The forge-from-scratch
quickstart demonstrates how to create a fully Java EE compliant project using JBoss Forge and Red Hat JBoss Developer Studio and deploy it to Red Hat JBoss Enterprise Application Platform 7.1 or later.
The generated example will be a standard Maven, Java Web project with JPA, EJB, CDI, JSF with complete JAX-RS endpoints for all data Entities. It will also provide views to Create
, Read
, Update
, and Delete
records.
But that is not all! You can use Forge on your new or existing projects to continue to enhance any application.
Note: This quickstart uses the H2 database included with Red Hat JBoss Enterprise Application Platform 7.1. It is a lightweight, relational example datasource that is used for examples only. It is not robust or scalable, is not supported, and should NOT be used in a production environment!
The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform 7.1 or later.
All you need to build this project is Java 8.0 (Java SDK 1.8) or later and Red Hat JBoss Developer Studio 10.0 or greater. These versions of JBoss Developer Studio embed Maven 3.3.3, so you do not need to install it separately.
JBoss Developer Studio 10.3 ships with Forge 3.5.1.Final.
Forge Console
Window. To open it, navigate to menu item Window -> Show View -> Other. Locate Forge -> Forge Console and click OK.$ cd QUICKSTART_HOME/forge-from-scratch/
generate.fsh
. Run this file from the Forge console using the run
command:
$ run generate.fsh
At this point, Forge creates the new project and builds it.
$ project-new --named forge-example --top-level-package org.example;
***SUCCESS*** Project named 'forge-example' has been created.
***SUCCESS***
message.build
command is executed, which should result in ***SUCCESS*** Build Success
near the end of the console output.NOTE: After you run the run generate.fsh
command, you will see the following warnings in the Problems window for the generated files. You can ignore these warnings.
Web XML Problem: location references to "/faces/error.xhtml" that does not exist in web content web.xml /forge-example/src/main/webapp/WEB-INF line 17
Web XML Problem: location references to "/faces/error.xhtml" that does not exist in web content web.xml /forge-example/src/main/webapp/WEB-INF line 21
JPA Problem: No connection specified for project. No database-specific validation will be performed. forge-example
This quickstart created a native Java EE 7 application.
QUICKSTART_HOME/forge-from-scratch/
folder. You see a folder with the name forge-example
.Project Explorer
view in JBoss Developer Studio.Run As
--> Run on Server
. If you have more than one server, choose the JBoss EAP 7.1 Runtime server. Then click Finish
.Note: You will see the following warnings in the server log. You can ignore these warnings.
WFLYTX0013: Node identifier property is set to the default value. Please make sure it is unique.
WFLYDM0111: Keystore /home/user/eap-7.1/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
HHH000059: Defining hibernate.transaction.flush_before_completion=true ignored in HEM
HHH000431: Unable to determine H2 database version, certain features may not work
The application appears in a 'Welcome to Forge' Window and displays the following:
Welcome to Forge
Your application is running.
The following entities are displayed on the lower left side of the page:
When you click on an entity, you are provided with a form that allows you to:
The running application also provides links to find more information about the Forge.
When you are ready to undeploy the application from JBoss EAP:
Servers
window.forge-example
project created by this quickstart, right-click, and choose Remove
.OK
when asked if you are sure you want to remove resource from the server. You should see the following message:
INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "forge-example.war" (runtime-name: "forge-example.war")
Open generate.fsh
and take a look inside! There is not much magic happening here. All of the commands used to generate this project are clearly listed just as if they were typed by your own hands.
Play around with creating more entities, relationships, UI, and generating JAX-RS endpoints,all with just a few simple commands.