httpd_selinux
Section: httpd SELinux Policy documentation (8)Updated: httpd
Index Return to Main Contents
NAME
httpd_selinux - Security Enhanced Linux Policy for the httpd processesDESCRIPTION
SELinux Linux secures httpd (Apache web server) processes via flexible mandatory access control.
BOOLEANS
SELinux policy is customizable based on least access required. httpd policy is extremely flexible and has several booleans that allow you to manipulate the policy and run httpd with the tightest access possible.
If you want to allow httpd to act as a rela, you must turn on the httpd_can_network_relay boolean.
setsebool -P httpd_can_network_relay 1
If you want to allow HTTPD scripts and modules to connect to databases over the network, you must turn on the httpd_can_network_connect_db boolean.
setsebool -P httpd_can_network_connect_db 1
If you want to allow httpd to run gpg in gpg-web domai, you must turn on the httpd_use_gpg boolean.
setsebool -P httpd_use_gpg 1
If you want to allow httpd cgi suppor, you must turn on the httpd_enable_cgi boolean.
setsebool -P httpd_enable_cgi 1
If you want to allow httpd to access cifs file system, you must turn on the httpd_use_cifs boolean.
setsebool -P httpd_use_cifs 1
If you want to allow Apache to use mod_auth_pa, you must turn on the allow_httpd_mod_auth_pam boolean.
setsebool -P allow_httpd_mod_auth_pam 1
If you want to allow httpd to read home directorie, you must turn on the httpd_enable_homedirs boolean.
setsebool -P httpd_enable_homedirs 1
If you want to allow Apache to communicate with avahi service via dbu, you must turn on the httpd_dbus_avahi boolean.
setsebool -P httpd_dbus_avahi 1
If you want to unify HTTPD handling of all content files, you must turn on the httpd_unified boolean.
setsebool -P httpd_unified 1
If you want to allow HTTPD scripts and modules to connect to the network using TCP, you must turn on the httpd_can_network_connect boolean.
setsebool -P httpd_can_network_connect 1
If you want to allow httpd scripts and modules execmem/execstac, you must turn on the httpd_execmem boolean.
setsebool -P httpd_execmem 1
If you want to allow Apache to use mod_auth_ntlm_winbin, you must turn on the allow_httpd_mod_auth_ntlm_winbind boolean.
setsebool -P allow_httpd_mod_auth_ntlm_winbind 1
If you want to unify HTTPD to communicate with the terminal. Needed for entering the passphrase for certificates at the terminal, you must turn on the httpd_tty_comm boolean.
setsebool -P httpd_tty_comm 1
If you want to allow httpd to read user conten, you must turn on the httpd_read_user_content boolean.
setsebool -P httpd_read_user_content 1
If you want to allow httpd to access nfs file system, you must turn on the httpd_use_nfs boolean.
setsebool -P httpd_use_nfs 1
If you want to allow Apache to execute tmp content, you must turn on the httpd_tmp_exec boolean.
setsebool -P httpd_tmp_exec 1
If you want to allow httpd processes to manage IPA conten, you must turn on the httpd_manage_ipa boolean.
setsebool -P httpd_manage_ipa 1
If you want to allow http daemon to send mai, you must turn on the httpd_can_sendmail boolean.
setsebool -P httpd_can_sendmail 1
If you want to allow httpd to use built in scripting (usually php, you must turn on the httpd_builtin_scripting boolean.
setsebool -P httpd_builtin_scripting 1
If you want to allow http daemon to check spa, you must turn on the httpd_can_check_spam boolean.
setsebool -P httpd_can_check_spam 1
If you want to allow httpd to connect to memcache serve, you must turn on the httpd_can_network_memcache boolean.
setsebool -P httpd_can_network_memcache 1
If you want to allow HTTPD scripts and modules to connect to cobbler over the network, you must turn on the httpd_can_network_connect_cobbler boolean.
setsebool -P httpd_can_network_connect_cobbler 1
If you want to allow HTTPD to run SSI executables in the same domain as system CGI scripts, you must turn on the httpd_ssi_exec boolean.
setsebool -P httpd_ssi_exec 1
If you want to allow httpd to act as a FTP server by listening on the ftp port, you must turn on the httpd_enable_ftp_server boolean.
setsebool -P httpd_enable_ftp_server 1
If you want to allow httpd daemon to change system limit, you must turn on the httpd_setrlimit boolean.
setsebool -P httpd_setrlimit 1
SHARING FILES
If you want to share files with multiple domains (Apache, FTP, rsync, Samba), you can set a file context of public_content_t and public_content_rw_t. These context allow any of the above domains to read the content. If you want a particular domain to write to the public_content_rw_t domain, you must set the appropriate boolean.- Allow httpd servers to read the /var/httpd directory by adding the public_content_t file type to the directory and by restoring the file type.
semanage fcontext -a -t public_content_t "/var/httpd(/.*)?"
restorecon -F -R -v /var/httpd
- Allow httpd servers to read and write /var/tmp/incoming by adding the public_content_rw_t type to the directory and by restoring the file type. This also requires the allow_httpd_anon_write boolean to be set.
semanage fcontext -a -t public_content_rw_t "/var/httpd/incoming(/.*)?"
restorecon -F -R -v /var/httpd/incoming
If you want to allow apache scripts to write to public content. Directories/Files must be labeled public_rw_content_t., you must turn on the allow_httpd_sys_script_anon_write boolean.
setsebool -P allow_httpd_sys_script_anon_write 1
If you want to allow Apache to modify public files used for public file transfer services. Directories/Files must be labeled public_rw_content_t., you must turn on the allow_httpd_anon_write boolean.
setsebool -P allow_httpd_anon_write 1
FILE CONTEXTS
SELinux requires files to have an extended attribute to define the file type.You can see the context of a file using the -Z option to lsP Policy governs the access confined processes have to these files. SELinux httpd policy is very flexible allowing users to setup their httpd processes in as secure a method as possible.
The following file types are defined for httpd:
httpd_apcupsd_cgi_content_t
- Set files with the httpd_apcupsd_cgi_content_t type, if you want to treat the files as httpd apcupsd cgi content.
httpd_apcupsd_cgi_htaccess_t
- Set files with the httpd_apcupsd_cgi_htaccess_t type, if you want to treat the file as a httpd apcupsd cgi access file.
httpd_apcupsd_cgi_ra_content_t
- Set files with the httpd_apcupsd_cgi_ra_content_t type, if you want to treat the files as httpd apcupsd cgi read/append content.
httpd_apcupsd_cgi_rw_content_t
- Set files with the httpd_apcupsd_cgi_rw_content_t type, if you want to treat the files as httpd apcupsd cgi read/write content.
httpd_apcupsd_cgi_script_exec_t
- Set files with the httpd_apcupsd_cgi_script_exec_t type, if you want to transition an executable to the httpd_apcupsd_cgi_script_t domain.
- Paths:
-
/var/www/apcupsd/upsfstats.cgi, /var/www/apcupsd/upsimage.cgi, /var/www/apcupsd/multimon.cgi, /var/www/cgi-bin/apcgui(/.*)?, /var/www/apcupsd/upsstats.cgi
httpd_awstats_content_t
- Set files with the httpd_awstats_content_t type, if you want to treat the files as httpd awstats content.
httpd_awstats_htaccess_t
- Set files with the httpd_awstats_htaccess_t type, if you want to treat the file as a httpd awstats access file.
httpd_awstats_ra_content_t
- Set files with the httpd_awstats_ra_content_t type, if you want to treat the files as httpd awstats read/append content.
httpd_awstats_rw_content_t
- Set files with the httpd_awstats_rw_content_t type, if you want to treat the files as httpd awstats read/write content.
httpd_awstats_script_exec_t
- Set files with the httpd_awstats_script_exec_t type, if you want to transition an executable to the httpd_awstats_script_t domain.
httpd_bugzilla_content_t
- Set files with the httpd_bugzilla_content_t type, if you want to treat the files as httpd bugzilla content.
httpd_bugzilla_htaccess_t
- Set files with the httpd_bugzilla_htaccess_t type, if you want to treat the file as a httpd bugzilla access file.
httpd_bugzilla_ra_content_t
- Set files with the httpd_bugzilla_ra_content_t type, if you want to treat the files as httpd bugzilla read/append content.
httpd_bugzilla_rw_content_t
- Set files with the httpd_bugzilla_rw_content_t type, if you want to treat the files as httpd bugzilla read/write content.
httpd_bugzilla_script_exec_t
- Set files with the httpd_bugzilla_script_exec_t type, if you want to transition an executable to the httpd_bugzilla_script_t domain.
httpd_bugzilla_tmp_t
- Set files with the httpd_bugzilla_tmp_t type, if you want to store httpd bugzilla temporary files in the /tmp directories.
httpd_cache_t
- Set files with the httpd_cache_t type, if you want to store the files under the /var/cache directory.
- Paths:
-
/var/cache/php-.*, /var/cache/mediawiki(/.*)?, /var/cache/lighttpd(/.*)?, /var/cache/mod_gnutls(/.*)?, /var/cache/mod_ssl(/.*)?, /var/cache/mod_.*, /var/cache/ssl.*.sem, /var/cache/php-mmcache(/.*)?, /var/cache/httpd(/.*)?, /var/cache/rt3(/.*)?, /var/cache/php-eaccelerator(/.*)?, /var/cache/mason(/.*)?, /var/cache/mod_proxy(/.*)?
httpd_cobbler_content_t
- Set files with the httpd_cobbler_content_t type, if you want to treat the files as httpd cobbler content.
httpd_cobbler_htaccess_t
- Set files with the httpd_cobbler_htaccess_t type, if you want to treat the file as a httpd cobbler access file.
httpd_cobbler_ra_content_t
- Set files with the httpd_cobbler_ra_content_t type, if you want to treat the files as httpd cobbler read/append content.
httpd_cobbler_rw_content_t
- Set files with the httpd_cobbler_rw_content_t type, if you want to treat the files as httpd cobbler read/write content.
httpd_cobbler_script_exec_t
- Set files with the httpd_cobbler_script_exec_t type, if you want to transition an executable to the httpd_cobbler_script_t domain.
httpd_config_t
- Set files with the httpd_config_t type, if you want to treat the files as httpd configuration data, usually stored under the /etc directory.
- Paths:
-
/etc/vhosts, /etc/httpd(/.*)?, /etc/apache(2)?(/.*)?, /etc/apache-ssl(2)?(/.*)?, /etc/lighttpd(/.*)?
httpd_cvs_content_t
- Set files with the httpd_cvs_content_t type, if you want to treat the files as httpd cvs content.
httpd_cvs_htaccess_t
- Set files with the httpd_cvs_htaccess_t type, if you want to treat the file as a httpd cvs access file.
httpd_cvs_ra_content_t
- Set files with the httpd_cvs_ra_content_t type, if you want to treat the files as httpd cvs read/append content.
httpd_cvs_rw_content_t
- Set files with the httpd_cvs_rw_content_t type, if you want to treat the files as httpd cvs read/write content.
httpd_cvs_script_exec_t
- Set files with the httpd_cvs_script_exec_t type, if you want to transition an executable to the httpd_cvs_script_t domain.
- Paths:
-
/usr/share/cvsweb/cvsweb.cgi, /var/www/cgi-bin/cvsweb.cgi
httpd_dirsrvadmin_content_t
- Set files with the httpd_dirsrvadmin_content_t type, if you want to treat the files as httpd dirsrvadmin content.
httpd_dirsrvadmin_htaccess_t
- Set files with the httpd_dirsrvadmin_htaccess_t type, if you want to treat the file as a httpd dirsrvadmin access file.
httpd_dirsrvadmin_ra_content_t
- Set files with the httpd_dirsrvadmin_ra_content_t type, if you want to treat the files as httpd dirsrvadmin read/append content.
httpd_dirsrvadmin_rw_content_t
- Set files with the httpd_dirsrvadmin_rw_content_t type, if you want to treat the files as httpd dirsrvadmin read/write content.
httpd_dirsrvadmin_script_exec_t
- Set files with the httpd_dirsrvadmin_script_exec_t type, if you want to transition an executable to the httpd_dirsrvadmin_script_t domain.
- Paths:
-
/usr/lib(64)?/dirsrv/cgi-bin(/.*)?, /usr/lib(64)?/dirsrv/dsgw-cgi-bin(/.*)?
httpd_exec_t
- Set files with the httpd_exec_t type, if you want to transition an executable to the httpd_t domain.
- Paths:
-
/usr/sbin/apache(2)?, /usr/bin/mongrel_rails, /usr/sbin/lighttpd, /usr/lib/apache-ssl/.+, /usr/sbin/httpd(.worker)?, /usr/sbin/apache-ssl(2)?
httpd_git_content_t
- Set files with the httpd_git_content_t type, if you want to treat the files as httpd git content.
httpd_git_htaccess_t
- Set files with the httpd_git_htaccess_t type, if you want to treat the file as a httpd git access file.
httpd_git_ra_content_t
- Set files with the httpd_git_ra_content_t type, if you want to treat the files as httpd git read/append content.
httpd_git_rw_content_t
- Set files with the httpd_git_rw_content_t type, if you want to treat the files as httpd git read/write content.
httpd_git_script_exec_t
- Set files with the httpd_git_script_exec_t type, if you want to transition an executable to the httpd_git_script_t domain.
- Paths:
-
/var/www/cgi-bin/cgit, /var/www/git/gitweb.cgi
httpd_helper_exec_t
- Set files with the httpd_helper_exec_t type, if you want to transition an executable to the httpd_helper_t domain.
httpd_initrc_exec_t
- Set files with the httpd_initrc_exec_t type, if you want to transition an executable to the httpd_initrc_t domain.
- Paths:
-
/etc/rc.d/init.d/httpd, /etc/rc.d/init.d/lighttpd
httpd_keytab_t
- Set files with the httpd_keytab_t type, if you want to treat the files as kerberos keytab files.
httpd_lock_t
- Set files with the httpd_lock_t type, if you want to treat the files as httpd lock data, stored under the /var/lock directory
httpd_log_t
- Set files with the httpd_log_t type, if you want to treat the data as httpd log data, usually stored under the /var/log directory.
- Paths:
-
/var/log/apache-ssl(2)?(/.*)?, /var/log/httpd(/.*)?, /var/log/cgiwrap.log.*, /var/log/lighttpd(/.*)?, /etc/httpd/logs, /var/log/apache(2)?(/.*)?, /var/log/cacti(/.*)?
httpd_mediawiki_content_t
- Set files with the httpd_mediawiki_content_t type, if you want to treat the files as httpd mediawiki content.
- Paths:
-
/var/www/wiki/.*.php, /usr/share/mediawiki(/.*)?
httpd_mediawiki_htaccess_t
- Set files with the httpd_mediawiki_htaccess_t type, if you want to treat the file as a httpd mediawiki access file.
httpd_mediawiki_ra_content_t
- Set files with the httpd_mediawiki_ra_content_t type, if you want to treat the files as httpd mediawiki read/append content.
httpd_mediawiki_rw_content_t
- Set files with the httpd_mediawiki_rw_content_t type, if you want to treat the files as httpd mediawiki read/write content.
httpd_mediawiki_script_exec_t
- Set files with the httpd_mediawiki_script_exec_t type, if you want to transition an executable to the httpd_mediawiki_script_t domain.
- Paths:
-
/usr/lib(64)?/mediawiki/math/texvc, /usr/lib(64)?/mediawiki/math/texvc_tex, /usr/lib(64)?/mediawiki/math/texvc_tes
httpd_mediawiki_tmp_t
- Set files with the httpd_mediawiki_tmp_t type, if you want to store httpd mediawiki temporary files in the /tmp directories.
httpd_modules_t
- Set files with the httpd_modules_t type, if you want to treat the files as httpd modules.
- Paths:
-
/usr/lib(64)?/lighttpd(/.*)?, /usr/lib(64)?/apache2/modules(/.*)?, /usr/lib(64)?/apache(/.*)?, /etc/httpd/modules, /usr/lib(64)?/httpd(/.*)?
httpd_munin_content_t
- Set files with the httpd_munin_content_t type, if you want to treat the files as httpd munin content.
httpd_munin_htaccess_t
- Set files with the httpd_munin_htaccess_t type, if you want to treat the file as a httpd munin access file.
httpd_munin_ra_content_t
- Set files with the httpd_munin_ra_content_t type, if you want to treat the files as httpd munin read/append content.
httpd_munin_rw_content_t
- Set files with the httpd_munin_rw_content_t type, if you want to treat the files as httpd munin read/write content.
httpd_munin_script_exec_t
- Set files with the httpd_munin_script_exec_t type, if you want to transition an executable to the httpd_munin_script_t domain.
httpd_nagios_content_t
- Set files with the httpd_nagios_content_t type, if you want to treat the files as httpd nagios content.
httpd_nagios_htaccess_t
- Set files with the httpd_nagios_htaccess_t type, if you want to treat the file as a httpd nagios access file.
httpd_nagios_ra_content_t
- Set files with the httpd_nagios_ra_content_t type, if you want to treat the files as httpd nagios read/append content.
httpd_nagios_rw_content_t
- Set files with the httpd_nagios_rw_content_t type, if you want to treat the files as httpd nagios read/write content.
httpd_nagios_script_exec_t
- Set files with the httpd_nagios_script_exec_t type, if you want to transition an executable to the httpd_nagios_script_t domain.
- Paths:
-
/usr/lib(64)?/nagios/cgi(/.*)?, /usr/lib(64)?/cgi-bin/nagios(/.+)?, /usr/lib(64)?/cgi-bin/netsaint(/.*)?, /usr/lib(64)?/nagios/cgi-bin(/.*)?
httpd_nutups_cgi_content_t
- Set files with the httpd_nutups_cgi_content_t type, if you want to treat the files as httpd nutups cgi content.
httpd_nutups_cgi_htaccess_t
- Set files with the httpd_nutups_cgi_htaccess_t type, if you want to treat the file as a httpd nutups cgi access file.
httpd_nutups_cgi_ra_content_t
- Set files with the httpd_nutups_cgi_ra_content_t type, if you want to treat the files as httpd nutups cgi read/append content.
httpd_nutups_cgi_rw_content_t
- Set files with the httpd_nutups_cgi_rw_content_t type, if you want to treat the files as httpd nutups cgi read/write content.
httpd_nutups_cgi_script_exec_t
- Set files with the httpd_nutups_cgi_script_exec_t type, if you want to transition an executable to the httpd_nutups_cgi_script_t domain.
- Paths:
-
/var/www/nut-cgi-bin/upsstats.cgi, /var/www/nut-cgi-bin/upsimage.cgi, /var/www/nut-cgi-bin/upsset.cgi
httpd_php_exec_t
- Set files with the httpd_php_exec_t type, if you want to transition an executable to the httpd_php_t domain.
httpd_php_tmp_t
- Set files with the httpd_php_tmp_t type, if you want to store httpd php temporary files in the /tmp directories.
httpd_prewikka_content_t
- Set files with the httpd_prewikka_content_t type, if you want to treat the files as httpd prewikka content.
httpd_prewikka_htaccess_t
- Set files with the httpd_prewikka_htaccess_t type, if you want to treat the file as a httpd prewikka access file.
httpd_prewikka_ra_content_t
- Set files with the httpd_prewikka_ra_content_t type, if you want to treat the files as httpd prewikka read/append content.
httpd_prewikka_rw_content_t
- Set files with the httpd_prewikka_rw_content_t type, if you want to treat the files as httpd prewikka read/write content.
httpd_prewikka_script_exec_t
- Set files with the httpd_prewikka_script_exec_t type, if you want to transition an executable to the httpd_prewikka_script_t domain.
httpd_rotatelogs_exec_t
- Set files with the httpd_rotatelogs_exec_t type, if you want to transition an executable to the httpd_rotatelogs_t domain.
httpd_smokeping_cgi_content_t
- Set files with the httpd_smokeping_cgi_content_t type, if you want to treat the files as httpd smokeping cgi content.
httpd_smokeping_cgi_htaccess_t
- Set files with the httpd_smokeping_cgi_htaccess_t type, if you want to treat the file as a httpd smokeping cgi access file.
httpd_smokeping_cgi_ra_content_t
- Set files with the httpd_smokeping_cgi_ra_content_t type, if you want to treat the files as httpd smokeping cgi read/append content.
httpd_smokeping_cgi_rw_content_t
- Set files with the httpd_smokeping_cgi_rw_content_t type, if you want to treat the files as httpd smokeping cgi read/write content.
httpd_smokeping_cgi_script_exec_t
- Set files with the httpd_smokeping_cgi_script_exec_t type, if you want to transition an executable to the httpd_smokeping_cgi_script_t domain.
httpd_squid_content_t
- Set files with the httpd_squid_content_t type, if you want to treat the files as httpd squid content.
httpd_squid_htaccess_t
- Set files with the httpd_squid_htaccess_t type, if you want to treat the file as a httpd squid access file.
httpd_squid_ra_content_t
- Set files with the httpd_squid_ra_content_t type, if you want to treat the files as httpd squid read/append content.
httpd_squid_rw_content_t
- Set files with the httpd_squid_rw_content_t type, if you want to treat the files as httpd squid read/write content.
httpd_squid_script_exec_t
- Set files with the httpd_squid_script_exec_t type, if you want to transition an executable to the httpd_squid_script_t domain.
- Paths:
-
/usr/lib64/squid/cachemgr.cgi, /usr/lib/squid/cachemgr.cgi
httpd_squirrelmail_t
- Set files with the httpd_squirrelmail_t type, if you want to treat the files as httpd squirrelmail data.
httpd_suexec_exec_t
- Set files with the httpd_suexec_exec_t type, if you want to transition an executable to the httpd_suexec_t domain.
- Paths:
-
/usr/lib(64)?/apache(2)?/suexec(2)?, /usr/lib(64)?/cgi-bin/(nph-)?cgiwrap(d)?, /usr/sbin/suexec
httpd_suexec_tmp_t
- Set files with the httpd_suexec_tmp_t type, if you want to store httpd suexec temporary files in the /tmp directories.
httpd_sys_content_t
- Set files with the httpd_sys_content_t type, if you want to treat the files as httpd sys content.
- Paths:
-
/usr/share/icecast(/.*)?, /usr/share/htdig(/.*)?, /etc/htdig(/.*)?, /var/www/svn/conf(/.*)?, /usr/share/mythtv/data(/.*)?, /var/lib/htdig(/.*)?, /srv/gallery2(/.*)?, /srv/([^/]*/)?www(/.*)?, /usr/share/ntop/html(/.*)?, /usr/share/mythweb(/.*)?, /var/lib/cacti/rra(/.*)?, /usr/share/openca/htdocs(/.*)?, /usr/share/selinux-policy[^/]*/html(/.*)?, /usr/share/drupal.*, /var/lib/trac(/.*)?, /var/www(/.*)?, /var/www/icons(/.*)?
httpd_sys_htaccess_t
- Set files with the httpd_sys_htaccess_t type, if you want to treat the file as a httpd sys access file.
httpd_sys_ra_content_t
- Set files with the httpd_sys_ra_content_t type, if you want to treat the files as httpd sys read/append content.
httpd_sys_rw_content_t
- Set files with the httpd_sys_rw_content_t type, if you want to treat the files as httpd sys read/write content.
- Paths:
-
/var/spool/viewvc(/.*)?, /etc/mock/koji(/.*)?, /var/lib/svn(/.*)?, /var/spool/gosa(/.*)?, /etc/zabbix/web(/.*)?, /etc/drupal.*, /var/www/gallery/albums(/.*)?, /var/lib/koji(/.*)?, /var/www/html/configuration.php, /usr/share/wordpress/wp-content/upgrade(/.*)?, /etc/dokuwiki(/.*)?, /var/lib/drupal.*, /usr/share/wordpress-mu/wp-content(/.*)?, /var/www/moodledata(/.*)?, /usr/share/wordpress/wp-content/uploads(/.*)?, /var/www/svn(/.*)?
httpd_sys_script_exec_t
- Set files with the httpd_sys_script_exec_t type, if you want to transition an executable to the httpd_sys_script_t domain.
- Paths:
-
/var/www/svn/hooks(/.*)?, /usr/share/mythweb/mythweb.pl, /usr/share/wordpress/.*.php, /usr/lib/cgi-bin(/.*)?, /var/www/perl(/.*)?, /usr/share/mythtv/mythweather/scripts(/.*)?, /usr/share/wordpress-mu/wp-config.php, /var/www/html/[^/]*/cgi-bin(/.*)?, /var/www/[^/]*/cgi-bin(/.*)?, /var/www/cgi-bin(/.*)?
httpd_tmp_t
- Set files with the httpd_tmp_t type, if you want to store httpd temporary files in the /tmp directories.
httpd_tmpfs_t
- Set files with the httpd_tmpfs_t type, if you want to store httpd files on a tmpfs file system.
httpd_unconfined_script_exec_t
- Set files with the httpd_unconfined_script_exec_t type, if you want to transition an executable to the httpd_unconfined_script_t domain.
httpd_user_content_t
- Set files with the httpd_user_content_t type, if you want to treat the files as httpd user content.
httpd_user_htaccess_t
- Set files with the httpd_user_htaccess_t type, if you want to treat the file as a httpd user access file.
httpd_user_ra_content_t
- Set files with the httpd_user_ra_content_t type, if you want to treat the files as httpd user read/append content.
httpd_user_rw_content_t
- Set files with the httpd_user_rw_content_t type, if you want to treat the files as httpd user read/write content.
httpd_user_script_exec_t
- Set files with the httpd_user_script_exec_t type, if you want to transition an executable to the httpd_user_script_t domain.
httpd_var_lib_t
- Set files with the httpd_var_lib_t type, if you want to store the httpd files under the /var/lib directory.
- Paths:
-
/var/lib/rt3/data/RT-Shredder(/.*)?, /var/lib/httpd(/.*)?, /var/lib/dav(/.*)?
httpd_var_run_t
- Set files with the httpd_var_run_t type, if you want to store the httpd files under the /run directory.
- Paths:
-
/var/run/mod_.*, /var/run/apache.*, /var/run/lighttpd(/.*)?, /var/run/gcache_port, /var/run/httpd.*, /var/run/wsgi.*, /var/lib/php/session(/.*)?
httpd_w3c_validator_content_t
- Set files with the httpd_w3c_validator_content_t type, if you want to treat the files as httpd w3c validator content.
httpd_w3c_validator_htaccess_t
- Set files with the httpd_w3c_validator_htaccess_t type, if you want to treat the file as a httpd w3c validator access file.
httpd_w3c_validator_ra_content_t
- Set files with the httpd_w3c_validator_ra_content_t type, if you want to treat the files as httpd w3c validator read/append content.
httpd_w3c_validator_rw_content_t
- Set files with the httpd_w3c_validator_rw_content_t type, if you want to treat the files as httpd w3c validator read/write content.
httpd_w3c_validator_script_exec_t
- Set files with the httpd_w3c_validator_script_exec_t type, if you want to transition an executable to the httpd_w3c_validator_script_t domain.
- Paths:
-
/usr/share/w3c-markup-validator/cgi-bin(/.*)?, /usr/lib/cgi-bin/check
httpd_w3c_validator_tmp_t
- Set files with the httpd_w3c_validator_tmp_t type, if you want to store httpd w3c validator temporary files in the /tmp directories.
Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels.
PORT TYPES
SELinux defines port types to represent TCP and UDP ports.You can see the types associated with a port by using the following command:
semanage port -l
Policy governs the access confined processes have to these ports. SELinux httpd policy is very flexible allowing users to setup their httpd processes in as secure a method as possible.
The following port types are defined for httpd:
- http_cache_port_t
-
Default Defined Ports: tcp 8021
- http_port_t
-
Default Defined Ports: tcp 8021
PROCESS TYPES
SELinux defines process types (domains) for each process running on the systemYou can see the context of a process using the -Z option to psP Policy governs the access confined processes have to files. SELinux httpd policy is very flexible allowing users to setup their httpd processes in as secure a method as possible.
The following process types are defined for httpd:
httpd_cvs_script_t, httpd_rotatelogs_t, httpd_bugzilla_script_t, httpd_smokeping_cgi_script_t, httpd_nagios_script_t, httpd_dirsrvadmin_script_t, httpd_suexec_t, httpd_php_t, httpd_w3c_validator_script_t, httpd_user_script_t, httpd_awstats_script_t, httpd_apcupsd_cgi_script_t, httpd_nutups_cgi_script_t, httpd_munin_script_t, httpd_sys_script_t, httpd_prewikka_script_t, httpd_git_script_t, httpd_unconfined_script_t, httpd_t, httpd_helper_t, httpd_squid_script_t, httpd_cobbler_script_t, httpd_mediawiki_script_t
Note: semanage permissive -a PROCESS_TYPE can be used to make a process type permissive. Permissive process types are not denied access by SELinux. AVC messages will still be generated.
COMMANDS
semanage fcontext can also be used to manipulate default file context mappings.semanage permissive can also be used to manipulate whether or not a process type is permissive.
semanage module can also be used to enable/disable/install/remove policy modules.
semanage port can also be used to manipulate the port definitions
semanage boolean can also be used to manipulate the booleans
system-config-selinux is a GUI tool available to customize SELinux policy settings.
AUTHOR
This manual page was autogenerated by genman.py.SEE ALSO
selinux(8), httpd(8), semanage(8), restorecon(8), chcon(1) , setsebool(8)Index
- NAME
- DESCRIPTION
- BOOLEANS
- SHARING FILES
- FILE CONTEXTS
- PORT TYPES
- PROCESS TYPES
- COMMANDS
- AUTHOR
- SEE ALSO
This document was created by man2html, using the manual pages.
Time: 05:34:26 GMT, December 24, 2015


These are a few data example that are displayed as they could be on a web interface to a PACS system. Click on the list item to launch DWV with the selected data.
The folowing items link to data available online but not in a secured way due to
same origin policy.
To see them start Google Chrome with --disable-web-security
(do not forget to remove that flag for normal browsing).
Non DICOM Image formats:
Data sources:


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/elaborator.html ---
Over the last few months I have been idly writing something called "from unicode to bytecode", which is some (still extremely incomplete) documentation as to how Lean turns a string of unicode characters (the input file) into bytecode. One reason it's incomplete currently is that I have no real idea what bytecode is. But when I started this project I had no idea what a scanner / parser / token / etc was either, so I'm definitely moving forwards.
I am now trying to understand the elaborator better. Here is a very basic question.
This works (by which I think I mean "Lean's kernel manages to fully parse and elaborate the string of characters and add a new term easy
to the environment"):
theorem easy {i : ℕ} {n : ℕ} : i < n → i < nat.succ n := λ H, lt.trans H $ nat.lt_succ_self n
If I replace the n
with an underscore, it still works
theorem easy {i : ℕ} {n : ℕ} : i < n → i < nat.succ n := λ H, lt.trans H $ nat.lt_succ_self _
Somehow Lean knows from the type of everything that it wants nat.lt_succ_self _
to have type n < nat.succ n
and hence it knows _
should be n
But this doesn't work:
theorem easy {i : ℕ} {n : ℕ} : i < n → i < nat.succ n := λ H, lt.trans _ $ nat.lt_succ_self n
Here Lean knows from type theory that it wants _
to be a proof of i < n
and even though H : i < n
is in the local context, it won't take it and insert it.
We get an error which, if you don't understand magic, looks silly:
don't know how to synthesize placeholder context: i n : ℕ, H : i < n ⊢ i < n
"Well, you knew how to synthesize n
when that was in the local context..."
I think that as a learner (as I still am, but I am thinking more about people who are like I was last October, i.e. complete beginners), you have to just trust some stuff to magic.
You type "simp" and sometimes it works and sometimes it doesn't, but if it does, then you'll take it.
Maybe your confusion comes from the fact that the two situations are in fact very different. In the first one, Lean doesn't just guess and take a natural number from the local context. The reason that the placeholder gets filled in is because n
is the only possible choice if you want the theorem to type-check.
In the second case, any value of type i < n
would work.
I think that whilst initially this way of thinking -- "sometimes it just works by magic" -- is initially the only way to proceed. But now I want to start understanding Lean properly and in particular I want to know exactly what I can expect the elaborator to do.
Thanks Gabriel, I could see that the situations somehow felt different but you have very quickly got to the heart of the matter.
In other words, the first placeholder can be solved by unification while type checking the right-hand side. The second one cannot.
I think that the _
(when it is representing n
) gets filled in initially as something like ?m_1
Oh it perhaps even initially gets filled in as (?m_1 : nat)
and then we have to solve nat.lt_succ_self (?m_1 : nat) : n < nat.succ n
and we know the type of nat.lt.succ_self
is ?m_1 < nat.succ ?m_1
and those two types really now have to be _equal_. I realise now I am slightly unsure what it means for two types to be equal. For example if ?m_1
was equal to m
and it was a theorem that m = n
, would these two types be equal?
Pretty much in this order. You essentially start with ?m_1: ?m_2
and ?m_2: Sort ?u_3
for the underscore. Then the elaborator wants to construct the application nat.lt_succ_self ?m_1
, so it needs to make sure that the type of ?m_1
is nat
, and you get the unification constraint ?m_2 =?= nat
.
I have seen Mario writing these =?=
s
it was a theorem that m = n, would these two types be equal?
No, only definitional equality is used in unification.
And these types would be equal because of some theorem
=?=
is just the notation for "should unify with"
I could probably answer these questions myself now
unification = assign the ?m_1, ..., ?m_n in such a way that the two sides are definitionally equal
if I could get Lean to print out these =?=
constraints myself.
Is there some set_option I can turn on
so I can just watch it all happening?
I remember when I discovered set_option pp.all true and very quickly developed a much better understanding of what a term was
and when I discovered various set_option things for simp and very quickly got a much better understanding of what simp di.
did
set_option trace.type_context.is_def_eq true
oh gosh
even when I fill in all the _
I still get outputs
This must be because of @
theorem easy {i : ℕ} {n : ℕ} : i < n → i < nat.succ n := λ H, lt.trans H $ nat.lt_succ_self n
The output also includes all the unification you get for type-checking, even if there are no underscores.
produces two bursts of excitement:
[type_context.is_def_eq] ℕ =?= ?m_1 ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ?m_1 ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ?m_1 ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ?m_1 ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ?m_1 ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ?m_1 ... success (approximate mode) [type_context.is_def_eq] ?m_1 =?= ℕ ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ℕ ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ℕ ... success (approximate mode) [type_context.is_def_eq] ?m_1 =?= n ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ?m_1 ... success (approximate mode) [type_context.is_def_eq] ?m_1 =?= nat.has_lt ... success (approximate mode) [type_context.is_def_eq] ?m_1 =?= nat.has_lt ... success (approximate mode)
and
Yes, I'm not sure how much you can learn from the output.
[type_context.is_def_eq] ?m_1 =?= i < n ... success (approximate mode) [type_context.is_def_eq] i < nat.succ n =?= ?m_3 < ?m_4 ... success (approximate mode) [type_context.is_def_eq] partial_order.to_preorder ℕ =?= partial_order.to_preorder ℕ ... success (approximate mode) [type_context.is_def_eq] i < n =?= ?m_3 < ?m_4 ... success (approximate mode) [type_context.is_def_eq] ?m_1 =?= ?m_4 < ?m_5 ... success (approximate mode) [type_context.is_def_eq] ?m_1 =?= H ... success (approximate mode) [type_context.is_def_eq] ?m_3 < ?m_4 =?= ?m_5 < nat.succ ?m_5 ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ℕ ... success (approximate mode) [type_context.is_def_eq] ℕ =?= ℕ ... success (approximate mode) [type_context.is_def_eq] ?m_1 =?= n ... success (approximate mode) [type_context.is_def_eq] n < nat.succ n =?= ?m_3 < ?m_4 ... success (approximate mode) [type_context.is_def_eq] ?m_1 =?= nat.lt_succ_self n ... success (approximate mode) [type_context.is_def_eq] i < n → i < nat.succ n =?= i < n → i < nat.succ n ... success (approximate mode)
In my current state I can probably learn quite a bit
I think the guilty party is lt.trans
or, as it should really be known
[rips mask off in Scooby-doo like manner]
@lt_trans _ _ _ _ _
Hmm
definition Npreorder : preorder ℕ := by apply_instance theorem easy' {i : ℕ} {n : ℕ} : i < n → i < nat.succ n := λ H, @lt.trans ℕ Npreorder i n (nat.succ n) H $ nat.lt_succ_self n
I still get a bunch of output from set_option trace.type_context.is_def_eq true
aargh it's the notation
[type_context.is_def_eq] ?m_1 =?= n ... success (approximate mode)
Nice to see we're in "approximate mode"
Doesn't fill me with confidence
Checking the equality of two terms without metavariables is a special case of unification. That's also why it's called is_def_eq
. So whenever the elaborator makes sure that a term type-checks, it will produce unification constraints.
Am I "being the elaborator" at the minute? So far I am up to
definition Npreorder : preorder ℕ := by apply_instance definition Nhas_lt : has_lt ℕ := by apply_instance theorem easy' {i : ℕ} {n : ℕ} : @has_lt.lt ℕ Nhas_lt i n → @has_lt.lt ℕ Nhas_lt i (nat.succ n) := λ H, @lt.trans ℕ Npreorder i n (nat.succ n) H $ nat.lt_succ_self n
I am having real trouble elaborating this any more.
In fact I would go so far to say that this term can't be elaborated any more.
although of course things could be unfolded.
What does the unfolding? Is that still the elaborator? Does the elaborator have to think about the actual definition of the term @has_lt.lt
or does it just check its type?
I am not sure I care at all about the definition of @has_lt.lt nat Nhas_lt
, all I need to know is that N is a preorder.
If you need to unify has_lt.lt a b c d
and nat.lt c d
, then yes, the elaborator will unfold has_lt.lt
.
In this case, I don't think we unfold has_lt.lt
anywhere. (At least we don't need to.)
The easy'
theorem is still missing the domain of the lambda, if you want to write down a "fully elaborated" term.
BTW, I believe it's a mistake to think of elaboration as "filling things in" (even though that may be literal meaning of the word). From a big picture point of view elaboration is the translation of pre-expressions (which are close to what you write down) to type-correct terms in the core type theory. Personally I think of a pre-expression more like a recipe that tells the elaborator to do what you want.
Oh! Yes, I forgot about the lambda.
So am I changing a pexpr
to an expr
?
No, you're changing one pexpr
into another pexpr
.
dammit I want an expr
I read about them in the manual
I am concerned that I might have more than one <=
on my nat
Npreorder
says that nat
has the structure of a preorder
I guess as an exercise you could write down the proof of easy
using the expr
constructors:
open tactic expr theorem easy {i n} : i < n -> i < nat.succ n := by do exact $ lam /- fill in here -/
and the <
on it is I think called something like Npreorder.lt
but the <
I want is called has_lt.lt
Actually I don't even know what it's called
Yes, they are many lt
s on nat
and they all mean the same in the end. AFAICT you have has_lt.lt
everywhere though, as you should.
it's called Nhas_lt
I guess
I am not so sure about the lt
coming from the preorder
I used type class inference to define the preorder on nat
Ah, I understand now. The question is about the relation between Npreorder
and Nhas_lt
: the terms @preorder.to_has_lt nat Npreorder
and Nhas_lt
are definitionally equal. (And type-checking actually needs to verify this equality.)
The more I elaborate, the greater the output of set_option trace.type_context.is_def_eq true
becomes!
I guess as an exercise you could write down the proof of
easy
using theexpr
constructors:open tactic expr theorem easy {i n} : i < n -> i < nat.succ n := by do exact $ lam /- fill in here -/
Oh I like this comment. Thanks! I might start with something easier than easy
but this looks like a fun game :-)
I might well find it a challenge to prove 1 + 1 = 2
in this mode
woo I made Prop
meta definition prop : expr (ff) := expr.sort level.zero
That's the proof that expr
is inhabited
Note that expr ff = pexpr
I just noticed that expr was demanding a bool so I gave it one
Hmm, that's funny. pexpr.lean
says @[reducible] meta def pexpr := expr ff
but #print pexpr
says that it's id_rhs Type (expr ff)
rofl and id_rhs
is an abbreviation. @Kenny Lau here's when you should use reducible, apparently, and abbreviations too.
so when exactly?
Oh this is all much too hard. I don't know how to turn anything at all into an expr. How do I turn a nat into an expr? How do I turn a Prop into an expr? How do I turn a proof into an expr? How do I turn a Type into an expr? Oh -- are these questions too general?
How do I turn a constructor into an expr? Is that a sensible question?
How do I turn nat.zero
into an expr?
If f : X -> Y
and I have an expr ex
representing the...name? x : X
, how do I create an expr corresponding to f x
?
How do I turn eq.refl
into an expr?
This sort of exercise might be a really good bridge to the Programming In Lean book.
All this expr stuff is introduced at the same time as everything else somehow
Perhaps one can abstract it away first
and think about making exprs from usual Lean terms rather than letting the elaborator do it
Does the elaborator take a list of tokens and return an expr?
I am still at the stage where I don't know if I have the words right
I feel like this could be a cute blog post, explaining how to get from a string of unicode characters to an expr, even a really stupid string like theorem X : unit = unit := eq.refl unit
I don't know how to turn this into an expr
theorem very_easy : unit = unit := by do to_expr ```(eq.refl unit) >>= exact
that's kind of a cheat because I didn't start by do exact $
but all this stuff like get_local
and to_expr
, all these functions return tactic
something.
Do I have to use the tactic monad?
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Toggle navigation
Backbone Game Engine
Documentation
Examples
Github
Examples
Some examples built with Backbone Game Engine. Play and modify at will.
Super Mario Bros, level 1-1
Mariocraft
Ludo's Quest
(available on the App Store)
Bouncing ball
Mario in an empty world
Hoppy frog


new Version()
Collection of helper functions for handling version numbers. This class
contains a set of static functions that deal with Major-Minor-Patch
version identifiers.
- Source:
Example
1.2.3
1 is the major version
2 is the minor version
3 is the patch version
Methods
(static) compare(base, other) → {int}
Given two versions return -1, 0 or 1 depending on if first version
is less than, equal or greater than the second version respectively.
Parameters:
| Name | Type | Description |
|---|---|---|
base |
string | Base version |
other |
string | Version to compare to |
- Source:
Returns:
Either -1, 0 or 1
- Type
- int
(static) diff(base, other) → {Array.<int>}
Returns the difference between two version numbers. This is a
pairwise comparison of each element in the version identifier.
Parameters:
| Name | Type | Description |
|---|---|---|
base |
string | Base version |
other |
string | Version to compare to |
- Source:
Returns:
A pairwise comparison of each version number
- Type
- Array.<int>
(static) equals(base, other) → {boolean}
Returns if two version are equivalent
Parameters:
| Name | Type | Description |
|---|---|---|
base |
string | Base version |
other |
string | Version to compare to |
- Source:
Returns:
If the version are equivalent
- Type
- boolean
(static) greaterThan(base, other) → {boolean}
Returns if a given version is greater than the other
Parameters:
| Name | Type | Description |
|---|---|---|
base |
string | Base version |
other |
string | Version to compare to |
- Source:
Returns:
If the base is greater than the other version
- Type
- boolean
(static) lessThan(base, other) → {boolean}
Returns if the given version is less than the other
Parameters:
| Name | Type | Description |
|---|---|---|
base |
string | Base version |
other |
string | Version to compare to |
- Source:
Returns:
If the base is less than the other version
- Type
- boolean
(static) major(version) → {int}
Returns the major number of a version string
Parameters:
| Name | Type | Description |
|---|---|---|
version |
string | A version identifier |
- Source:
Returns:
Major version number
- Type
- int
(static) minor(version) → {int}
Returns the minor number of a version string
Parameters:
| Name | Type | Description |
|---|---|---|
version |
string | A version identifier |
- Source:
Returns:
Minor version number
- Type
- int
(static) patch(version) → {int}
Returns the patch number of a version string
Parameters:
| Name | Type | Description |
|---|---|---|
version |
string | A version identifier |
- Source:
Returns:
- Type
- int
(static) split(version) → {Array.<int>}
Given a string representation of a version, convert the version
to a 3 element array
Parameters:
| Name | Type | Description |
|---|---|---|
version |
string | A version identifier |
- Source:
Returns:
[major, minor, patch] Version array
- Type
- Array.<int>
(static) toString(version) → {string}
Returns a string representation of a version array
Parameters:
| Name | Type | Description |
|---|---|---|
version |
Array.<int> |
- Source:
Returns:
- Type
- string


2.2.7. Raised Foundation Classification¶
<IP_ADDRESS>. What is Raised Foundation Classification¶
The code in this package enables to see if a building is elevated on piles piers or posts (PPP).
For classification, the path of a folder holding the images has to be supplied. The result will be a comma separated value file in that folder, listing the filenames, classification (1: elevated, 0: not elevated), and the confidence of the prediction.
<IP_ADDRESS>. Use the module¶
A pretrained model is shipped with BRAILS. So you can use it directly without training your own model.
The first time you initialize this model, it will download the model from the internet to your local computer.
The images used in the example can be downloaded from here.
# import the module
from brails.modules import FoundationHeightClassifier
# initialize a roof classifier
model = FoundationHeightClassifier()
# define the paths of images in a list
from glob import glob
imgs = glob('image_examples/Foundation/*/*.jpg')
# use the model to predict
predictions = model.predict(imgs)
The predictions look like this:
Image : a.jpg Class : 1 (52.5%)
Image : b.jpg Class : 1 (56.36%)
Image : c.jpg Class : 0 (83.4%)
Image : d.jpg Class : 0 (63.43%)
Results written in file tmp/FoundationElevation.csv
The images used in this example are:
This module is currently under active development and testing. Currently, for the data set used, classification reaches an F1-score of 72% on a random test set that holds 20% of the data. Further optional code to improve the quality and speed of the classification is available. More details about the training, modification, improvement of this module can be found here.
Note
The classifier takes an image as the input and will always produce a prediction. Since the classifier is trained to classify only a specific category of images, its prediction is meaningful only if the input image belongs to the category the model is trained for.


This is the main dashboard for users logged in as an administrator.
For more information, see the following wiki page(s):


Plenty of evidence exists that sport is beneficial for us
In his column of November 18, Peter Rhodes asks for proof of the benefits which can be gained from participation in sports.
If he had been present at Shifnal’s Bright Star Boxing Academy on November 16, he would have heard brave testimonies from members whose lives have been dramatically changed through participation in the sport.
There was a young woman who had many problems. She is now successfully competing and coaching.
There are sessions for men with poor mental health and female victims of abuse.
There are many varied sport clubs run by dedicated volunteers who give youngsters exercise, discipline and purpose in their lives.
I hope that Peter Rhodes will accept this as the evidence which he sought.
Jenny Johnson, Shifnal
Send us your letters for publication:
Email us at<EMAIL_ADDRESS>or write to: Readers’ Letters, Shropshire Star, Ketley, Telford, TF1 5HU. Letters MUST include the writer’s name, address and telephone number. Letters will only be published anonymously in exceptional circumstances. The editor reserves the right to condense or amend letters.


Replying to a message simplifies your correspondence, since you do not have to enter the recipient's e-mail address manually.
Most popular e-mail applications follow a similar procedure
1. Click on the closed e-mail message to select it or open the message.
2. From the Action menu, click on Reply or click Reply in the toolbar.
3. A new message window will open. The recipient's address will appear automatically in the To field. The Subject will be the same subject as in the original message and the content of the original message will usually be included, preceded by > signs.
4. Add your new content to the message. If desired, you can delete part or all of the content from the original message.
5. Then Click at Send button.


A boggy definition of Infinity
Consider the following declarations:
CoInductive LList (A:Type) : Type :=
| LNil : LList A
| LCons : A -> LList A -> LList A.
Arguments LNil {A}.
Arguments LCons {A} _ _.
A distracted student confuses keywords and gives an inductive
definition of being infinite:
Inductive BugInfinite {A: Type} : LList A -> Prop :=
BugInfinite_intro :
forall a (l:LList A),
BugInfinite l -> BugInfinite (LCons a l).
Show that this predicate can never be satisfied.
Solution
Follow this link


WITNESS LIST Natural Resources Committee April 9, 2003-3:00P HB 1628 For: Cellins, Dick (Acton Municipal Utility Dist.) English, Richard (Acton Municipal Utility District General Manager) On: Stepherson, Angela (Texas Commission on Environmental Quality) HB 2074 For: Gilmer, Gary (Self and Real-Edwards Conservation & Reclamation District) HB 2293 For: Bonavita, Evelyn (Region L Water Planning Group) Butler, Susan (San Antonio Water System) Ford, Phil (Brazos River Authority, General Mgr.) Robbins, Dean (Texas Water Conservation Assn.) Rochelle, Martin (San Antonio Water System) Rothe, Greg (San Antonio River Authority) Taylor, Jeff (City of Houston Public Utilities Division Public Works & Engineering, Deputy Director) Against: Alders, David (Self) Griffith, Carl (Self and Jefferson Co.) Howe, Billy (Texas Farm Bureau) Middleton, Gary (City of Victoria, Mayor) Montagne, David (Sabine River Authority of Texas) Neild, William E. (Lower Neches Valley Authority LNVA) Rich, Jim (Beaumont Chamber of Commerce) Rutherford, Verna (Port Arthur Chamber of Commerce) Stroder, Robert (Lower Neches Valley Authority) On: Ellis, Greg (Edwards Aquifer Authority) Hess, Myron (National Wildlife Federation) Hoffman, Margaret (TCEQ) Kramer, Ken (Lone Star Chapter, Sierra Club) MacLeod, Mark (Environmental Defense) Mullican, Bill (Texas Water Development Board) Registering, but not testifying: For: Adams, Jim (Region H Water Planning Group) Aghamalian, Brandon (City of Fort Worth - Mayor & Council) Burke, John (Aqua Water Supply Corp.) Cain, Randy (City of Dallas) Cain, Randy (City of Lubbock) Gibbs, Gary (Association of Electric Companies of TX (AECT)) Harris, Ron (Collin Cnty) Rice, Irvin M. (Self and Trinity Improvement Assoc) Suhm, Vic (North Texas Commision) Votteler, Todd (Guadalupe-Blanco River Authority) White, Michael L. (Greater Houston Partnership) HB 2854 For: Vaughan III, Ben F. (Self and Coastal Conservation Association - Texas) Against: Alders, David (Self) Glacken, Shawn (Association of Electric Companies of Texas) HB 2887 For: Beyer, David J (Self) Middleton, Donald W. (Self) Morgan, Veronica (Self and Mitchell & Morgan, LLP Engineers) Rodriquez, John J. (Self) HB 3028 For: Brogan, Frank C. (Port of Corpus Christi Authority; Texas Ports Association) On: Stagner, Steve (Texas Council of Engineering Companies) HB 3030 For: Beveridge, Doug (Tx Land & Mineral Owners Association) Bowers, Richard (North Plains Groundwater Conservation Dist.) Hofbauer, Donna (Self) Lenz, Carole (Harris County Commissioner Steve Radack Precinct Three) On: Hardee, Jackie (Tx Comm on Environmental Quality) HB 3214 For: Berkel, Joseph A (River Place MUD) HB 3229 For: Fieseler, Ronald G. (Blanco-Pedernales Groundwater Conservation District) HB 3537 For: Dorman, David (Mayor City of Melissa) Against: Burke, John (Aqua Water Supply Corp.) Petersen, Ken (Texas Rural Water Association) HB 3538 For: Dorman, David E. (City of Melissa, Mayor) Helsley, Thad (City of McKinney) Robinson, Lawrence W. (City of McKinney) Against: Bryant, Leahmon F. (Texas Rural Water) Burke, John (Aqua Water Supply Corp) Knight, Allen (North Collin Water Supply) Loiselle, Donna (Gunter Rural Water Supply Corp.) Monson, Duke (North Collin WSC) Petersen, Ken (Texas Rural Water Assn.) On: Stepherson, Angela (Texas Commission on Environmental Quality) HB 3556 For: Holland, Scott (Sterling Co. Underground Water Conservation District & Irion Co. Water Conservation District) HB 3559 For: Gunn, Wm. T. (Self and Gunn & Whittington Dev. Co. LTD, owner) Horne, Ed (Self) Willatt, Mike (Self) HB 3560 For: Gunn, Wm. T. (Self and Gunn & Whittington Dev. Co. LTD, owner) Horne, Ed (Self) Willatt, Mike (Self)


BR
This is to be used in the BODY Tag.
This breaks the current line and starts a new line.
This is not a Container Tag and thus need not be closed.
Attributes
- CLEAR :
- LEFT :
Break to the next line only when the left
margin is clear.
- RIGHT :
Break to the next line only when the right
margin is clear.
Syntax
...Text...

...Text...
OR
...Text / Image...

...Text / Image...
Example

Effect
Current Line Breaks
To Next Line
Home
About


randomness
`Prev `__
R
`Next `__
--------------
**randomness**: n.
1. An inexplicable misfeature; gratuitous inelegance.
2. A `*hack* <../H/hack.html>`__ or `*crock* <../C/crock.html>`__ that
depends on a complex combination of coincidences (or, possibly, the
combination upon which the crock depends for its accidental failure to
malfunction). “This hack can output characters 40--57 by putting the
character in the four-bit accumulator field of an XCT and then
extracting six bits — the low 2 bits of the XCT opcode are the right
thing.” “What randomness!”
3. Of people, synonymous with flakiness. The connotation is that the
person so described is behaving weirdly, incompetently, or
inappropriately for reasons which are (a) too tiresome to bother
inquiring into, (b) are probably as inscrutable as quantum phenomena
anyway, and (c) are likely to pass with time. “Maybe he has a real
complaint, or maybe it's just randomness. See if he calls back.”
Despite the negative connotations of most jargon uses of this term have,
it is worth noting that randomness can actually be a valuable resource,
very useful for applications in cryptography and elsewhere. Computers
are so thoroughly deterministic that they have a hard time generating
high-quality randomness, so hackers have sometimes felt the need to
built special-purpose contraptions for this purpose alone. One
well-known website offers random bits `generated by radioactive
decay `__. Another derives random bits
from `chaotic systems `__ in analog electronics.
Originally, the latter site got its random bits by doing photometry on
lava lamps. Hackers invariably found this hilarious. If you have to ask
why, you'll never get it.)
--------------
+-----------------------------------+----------------------------+-------------------------+
| `Prev `__ | `Up <../R.html>`__ | `Next `__ |
+-----------------------------------+----------------------------+-------------------------+
| random numbers | `Home <../index.html>`__ | rape |
+-----------------------------------+----------------------------+-------------------------+


3
John the Baptist Prepares the Way
1 In those days John the Baptist came preaching in the wilderness of Judea,
2 “Repent, for the kingdom of heaven is at hand.”
3 For this is he who was spoken of by the prophet Isaiah when he said,
“The voice of one crying in the wilderness:
‘Prepare the way of the Lord;
make his paths straight.’ ”
4 Now John wore a garment of camel's hair and a leather belt around his waist, and his food was locusts and wild honey.
5 Then Jerusalem and all Judea and all the region about the Jordan were going out to him,
6 and they were baptized by him in the river Jordan, confessing their sins.
7 But when he saw many of the Pharisees and Sadducees coming for baptism, he said to them, “You brood of vipers! Who warned you to flee from the wrath to come?
8 Bear fruit in keeping with repentance.
9 And do not presume to say to yourselves, ‘We have Abraham as our father,’ for I tell you, God is able from these stones to raise up children for Abraham.
10 Even now the axe is laid to the root of the trees. Every tree therefore that does not bear good fruit is cut down and thrown into the fire.
11 “I baptize you with water for repentance, but he who is coming after me is mightier than I, whose sandals I am not worthy to carry. He will baptize you with the Holy Spirit and with fire.
12 His winnowing fork is in his hand, and he will clear his threshing floor and gather his wheat into the barn, but the chaff he will burn with unquenchable fire.”
The Baptism of Jesus
13 Then Jesus came from Galilee to the Jordan to John, to be baptized by him.
14 John would have prevented him, saying, “I need to be baptized by you, and do you come to me?”
15 But Jesus answered him, “Let it be so now, for thus it is fitting for us to fulfill all righteousness.” Then he consented.
16 And when Jesus was baptized, immediately he went up from the water, and behold, the heavens were opened to him, and he saw the Spirit of God descending like a dove and coming to rest on him;
17 and behold, a voice from heaven said, “This is my beloved Son, with whom I am well pleased.”


Press the buttom to start the program.
The more steps you enter, the better the computation accuracy and the more time the computation will take.
How To Make Pi


All Categories
Books
Mobiles & Accessories
Television & Video Players
Home »
Customer Reviews »
Compare »
Help »


$5,032
monetization_on$5,032 $1,055
account_circle$5,032 $1,055
local_mallYour main list is growing
Your main list is growing
This is your current active plan
Total
Total
Total
Total
48% From Last 24 Hours
36% From Last 6 Months
36% From Last 6 Months
36% From Last 6 Months
+384
+384
Last week user's
Total earning
New order
Today visitors
Total revenue
472
Deals added89
Deals wonprevious
% Change
Trend
New submissions
New contacts
Active forms
Forms views
Conversion
By Company
By Other
Followings
Follows
Recharge of next month
Order of next month
Payment of next month
May 23 - June 01 (2018)
May 28 - June 01 (2018)
May 30 - June 01 (2018)
+11%From Previous Month
+12%From Previous Month
+52%From Previous Month
+52%From Previous Month
Open Tickets
Tickets
From Previous Month
Close Tickets
Tickets
From Previous Month
New Clients
Clients
From Previous Month
New Orders
Orders
From Previous Month
Total Income :
Total Revenue :
Active Projects :
Total Product
64%
New Orders
34%
Conversion Rate
64%
Revenue
54%


Enable javascript to view functionalaty of application otherwise application will not work properly.
{{ name }}
{{roll}}


A little bit about my background:
I am from Hong Kong. I have a younger brother who is studying in UK.
I play piano, flute and a little bit of drum set and organ.
I studied in Hong Kong until year 9, at Wah Yan Primary School and then Wah Yan College.


Wednesday is Joe Biden’s 77th birthday — here are the ages of all the 2020 Democratic presidential candidates
by Grace Panetta, Business Insider US- The 2020 Democratic primary field is one of the most diverse in history in terms of age.
- Mayor Pete Buttigieg, 37, and Rep. Tulsi Gabbard, 38, are attempting to overtake Teddy Roosevelt’s status as America’s youngest president.
- President Donald Trump holds the title of oldest US president on his first Inauguration Day, taking office at 70 years and 220 days old. Former Vice President Joe Biden, Sen. Elizabeth Warren, and Sen. Bernie Sanders would all break his record if elected.
- Here are the ages of 2020 Democratic candidates and how old they would be upon taking office on Inauguration Day 2021.
- Visit Business Insider’s homepage for more stories.
Former Vice President Joe Biden turned 77 on November 20.
Biden, who served as a county executive in Delaware in 1970 before being elected to the Senate in 1972, has been in elected office longer than eight of his fellow Democratic primary contenders have been alive.
The 2020 field is one of the most diverse in history in terms of age, which has become a focal point for 2020 Democrats. Mayor Pete Buttigieg, 37, for example, is partially centering his campaign on the theme of intergenerational justice, arguing a new generation of leadership can solve the problems facing America.
The US Constitution mandates that a candidate must be at least 35 to be eligible for the presidency. The youngest-ever president was Theodore Roosevelt, who took office at 42 years and 322 days old in 1901.
Buttigieg, 37, and Rep. Tulsi Gabbard, 38, are attempting to overtake Roosevelt’s record as America’s youngest president.
President Donald Trump holds the title of oldest president at the time of his first election, taking office at 70 years and 220 days old.
But three of the top candidates in the Democratic primary field could break his record.
Biden, Sen. Bernie Sanders, and Sen. Elizabeth Warren would be the oldest presidents ever on their first Inauguration Day if elected, hypothetically taking office at ages 78, 79, and 71.
Here’s a breakdown of the 2020 Democrats’ ages and how old they would be for their inauguration.
Mayor Pete Buttigieg is 37, and he would be 39 years and one day old upon taking office.
Read more about Buttigieg’s campaign.
Rep. Tulsi Gabbard is 38, and she would be 39 years and 283 days old upon taking office.
Read more about Gabbard’s campaign.
Andrew Yang is 44, and he would be 46 years and seven days old on Inauguration Day.
Read more about Yang’s campaign.
Former HUD Secretary Julián Castro is 45, and he would be 46 years and 126 days old upon taking office.
Read more about Castro’s campaign.
Sen. Cory Booker is 50. If elected, he would be 51 years and 268 days old when assuming office.
Read more about Booker’s campaign.
Gov. Steve Bullock of Montana is 53. He would be 54 years and 284 days old on Inauguration Day.
Read more about Bullock’s campaign.
Sen. Michael Bennet of Colorado is 54. He would be 56 years and 53 days old upon taking office.
Read more about Bennet’s campaign.
Sen. Kamala Harris is 55, and she would be 56 years and 92 days old upon taking office.
Read more about Harris’ campaign.
Rep. John Delaney is 56, and he would be 57 years and 249 days old when taking office.
Read more about Delaney’s campaign.
Sen. Amy Klobuchar is 59. She would be 60 years and 240 days old on Inauguration Day.
Read more about Klobuchar’s campaign.
The billionaire activist Tom Steyer is 62. He would be 63 years and 207 days old on Inauguration Day.
Read more about Steyer’s campaign.
Former Gov. Deval Patrick of Massachusetts is 63. He would be 64 years and 173 days old upon taking office.
Read more about Patrick’s campaign.
Marianne Williamson is 67, and she would be 68 years and 196 days old upon taking office.
Read more about Williamson’s campaign.
Sen. Elizabeth Warren is 70. She would be 71 years and 212 days old upon taking office in 2021.
Read more about Warren’s campaign.
Former Vice President Joe Biden is 77, and he would be 78 years and 61 days old on Inauguration Day 2021.
Read more about Biden’s campaign.
Former Mayor Michael Bloomberg of New York City is also 77. He would be 78 years and 341 days old upon taking office.
Read more about Bloomberg’s campaign.
Sen. Bernie Sanders is 78. He would be 79 years and 134 days old upon assuming office.
Read more about Sanders’ campaign.
Read more:
Democrats are clashing over how to fix US healthcare. Here are the 7 key terms you need to know.


| 815 | (A) | witħ arowes and alblasters and achillers grete |
| 819 | (C) | witħ arowes & arblaste . & asschelers manye |
| 812 | (D) | with arwes & arblast and archers many |
| 788 | (E) | witħ arwes & arblastes . & many maner schottys . |
| (Ex) | ---- no text ---- | |
| 836 | (L) | with arwes & arblastes & archers manye |
| 759 | (P) | with arowes & alblasters & aschelers grete |
| 798 | (U) | Witħ arwes and arblastes / and archers many |
| (V) | ---- no text ---- |


How our service sector can ride out the political storm
by Chung Shing-cheongTop government officials, from Chief Executive Carrie Lam Cheng Yuet-ngor to her principal ministers, have stressed repeatedly that the anti-government protests, which have been going on for more than five months now, have taken a significant toll on our economy.
But is our economy really as bad as they claim it to be? Not quite, actually.
If one pays a visit to some of what has been described as “fallen districts” over the weekend, (i.e., the favorite shopping destinations of mainland tourists such as Mong Kok, Tsuen Wan, Yuen Long, Sheung Shui, etc.), they will probably notice the retail stores that have gone out of business are predominantly pharmacies, beauty stores and souvenir outlets, which mainly cater for mainland visitors.
On the other hand, neighborhood stores that mainly serve local residents appear to be largely unaffected.
As far as our frontline service industries are concerned, as long as they don’t rely overwhelmingly on the spending of mainland visitors, they are capable of weathering the economic downturn.
That many pharmacies, beauty stores and souvenir outlets across the city have closed down should remind us of the danger for our retail and service industries – for our entire economy – to rely too much on mainland tourists.
Nor should businesses overlook the tastes and needs of local consumers, lest they remain highly vulnerable to local political volatility in the days ahead.
Of course, the early closing of the MTR train service and the police’s iron-fist crackdown on protesters are also to blame for the current hardships which our retail and service sectors are facing.
But as long as the MTR resumes normal service hours as soon as possible, and once the police start to go easy on some of the mass demonstrations, I believe many of our citizens will be in the mood for spending again.
This article appeared in the Hong Kong Economic Journal on Nov 9
Translation by Alan Lee
– Contact us at<EMAIL_ADDRESS>RT/CG


About Me
Hello! My name is Manolo Lagahit and I am a student at Year Up studying Software Development and Testing.
Before Year Up I was a nursing student and working as a Nursing Assistant and I hope that I can apply the knowledge I gained from Nursing to working in a buisness setting.
I've gained many skills at Year Up such as programming languages like, JavaScript, Java, and Python. I learned how to use many Microsoft apps like, Excel, SharePoint, Power Apps, and Teams.
However, I didn't only learn technical skills, but I also learned many soft skills like, effective communication, public speaking, and teamwork. These are skills that I gained comfort with from nursing, but Year Up has helped me strengthen them more.
I hope that all the new knowledge I've gained at Year Up and the skills that I already have from Nursing will help me become a strong member in the corporate world, as a person who not only has the technical skill to succeed, but to also be a compassionate team member.
Page Origin
The HTML/CSS comes from Sara Newman's WEB110 class as taught at Seattle Central. This page provides a basis for students to build a responsive portal page.
Study how this page is built, and use it as a foundation for your portal or other sites!
Copyright [2014-2020] [Sara Newman]. Licensed under the Apache License, Version 2.0


Next: SLA_DMOON - Approx Moon Pos/Vel
Up: SUBPROGRAM SPECIFICATIONS
Previous: SLA_DM2AV - Rotation Matrix to Axial Vector
- ACTION:
- Matrix inversion and solution of simultaneous equations
(double precision).
- CALL:
- CALL sla_DMAT (N, A, Y, D, JF, IW)
- GIVEN:
-
| N |
I |
number of unknowns |
| A |
D(N,N) |
matrix |
| Y |
D(N) |
vector |
- RETURNED:
-
| A |
D(N,N) |
matrix inverse |
| Y |
D(N) |
solution |
| D |
D |
determinant |
| JF |
I |
singularity flag: 0=OK |
| IW |
I(N) |
workspace |
- NOTES:
- 1.
- For the set of n simultaneous linear equations in n unknowns:
Ay = x
where:
- A is a non-singular matrix,
- y is the vector of n unknowns, and
- x is the known vector,
sla_DMAT computes:
- the inverse of matrix A,
- the determinant of matrix A, and
- the vector of n unknowns y.
Argument N is the order n, A (given) is the matrix A,
Y (given) is the vector x and Y (returned)
is the vector y.
The argument A (returned) is the inverse matrix A-1,
and D is det(A).
- 2.
- JF is the singularity flag. If the matrix is non-singular,
JF=0 is returned. If the matrix is singular, JF=-1
and D=0D0 are returned. In the latter case, the contents
of array A on return are undefined.
- 3.
- The algorithm is Gaussian elimination with partial pivoting.
This method is very fast; some much slower algorithms can give
better accuracy, but only by a small factor.
- 4.
- This routine replaces the obsolete sla_DMATRX.
Next: SLA_DMOON - Approx Moon Pos/Vel
Up: SUBPROGRAM SPECIFICATIONS
Previous: SLA_DM2AV - Rotation Matrix to Axial Vector
SLALIB --- Positional Astronomy Library
Starlink User Note 67
P. T. Wallace
12 October 1999
E-mail:ptw@star.rl.ac.uk


| Slides | PDF | Video |
| Week 1 - Aug 18, 2020 |
|
Video |
| Week 1.5 - Aug 20, 2020 |
|
Video |
| Week 2 - Aug 24, 2020 |
PDF |
Video |
| Week 2.5 - Aug 27, 2020 |
PDF |
Video |
| Week 3.0 - Sep 1, 2020 |
PDF |
|
| Week 3.5 - Sep 3, 2020 |
PDF |
Video |
| Week 4 - Sep 10, 2020 |
PDF |
Video |
| Week 5 - Sep 17, 2020 |
PDF |
Video |
| Week 6 - Sep 21, 2020 |
|
|
| Week 6.5 - Sep 24, 2020 |
PDF |
Video |
Week 8 - Oct 8, 2020
SQL From Class
|
PDF |
Video |
Week 9 - Oct 13, 2020
window.sql
json.sql
|
PDF |
Video |
Week 9.5 - Oct 15, 2020
|
PDF |
Video |
Week 10 - Oct 20, 2020 |
PDF |
|
Week 10.5 - Oct 22, 2020
In Class SQL
|
PDF |
|
Week 11 - Oct 27, 2020 |
PDF |
|
Week 12.5 - Nov 5, 2020 |
PDF |
|
Week 12.5 - Nov 5, 2020
PDF |
|
Week 13 - Nov 10, 2020 |
PDF |
|
Week 14 - Nov 17, 2020 |
PDF |
|
Week 14.5 - Nov 19, 2020 |
|
|
Week 15 - Nov 24, 2020 |
|
|


This section explains how you can setup your Xamarin Forms application to be able to inject, intercept & invoke events within your app.
We will be using WebView
as our primary browser, this will renderer down to native implemenations:
WkWebView
on iOSGoogleChrome
on AndroidA custom renderer will be used so to make things less likely to interfere with other components, we will subclass WebView
and create HybridWebView
. In this example repository I have modified the HybridWebView
to accept either a local html file or a url, you will only need to do this if you are displaying both in your app. To see this alternative implementation see here.
public class HybridWebView : WebView
{
public static readonly BindableProperty UriProperty = BindableProperty.Create(nameof(Uri), typeof(string), typeof(HybridWebView), default(string));
public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(HybridWebView));
public string Uri
{
get => (string)GetValue(UriProperty);
set => SetValue(UriProperty, value);
}
public ICommand Command
{
get => (ICommand)GetValue(CommandProperty);
set => SetValue(CommandProperty, value);
}
public void InvokeAction(IBrowserInvocation data)
{
if (Command == null)
return;
if (!Command.CanExecute(data))
return;
Command.Execute(data);
}
}
You can reference this webview in xaml:
<ContentPage ...
xmlns:controls="clr-namespace:YourNameSpace;assembly=CustomRenderer"
x:Class="YourNameSpace.HybridWebViewPage"
Padding="0,40,0,0">
<controls:HybridWebView Command="{Binding InvokeNameCommand}" Uri="https://axemasta.github.io/JavascriptForms/"/>
</ContentPage>
In my source code example I am using the following interface IBrowserInvocation
:
public interface IBrowserInvocation
{
string BrowserUrl { get; }
string Data { get; }
Coordinates ElementCoordinates { get; }
Coordinates DisplayDimensions { get; }
BrowserInfo BrowserInfo { get; }
string ElementName { get; }
}
You do not have to use this object, I simply wanted to pass some extra information to my App when a javascript event is invoked. By default a string
is passed to the app from the javascript, so if you use a more complex object type (like my example) you should serialise it as JSON first (var json = JSON.stringify('{ "foo" : "bar" }');
).
Next we will setup our custom renderers on each platform.
For the entire class see the source code example here.
Your renderer will need to inherit WkWebViewRenderer
and implement IWKScriptMessageHandler
. IWKScriptMessageHandler
will add the following method to your class:
public void DidReceiveScriptMessage(WKUserContentController userContentController, WKScriptMessage message)
{
}
This is the method that will be called if our javascript invocation has been successful. The data passed from the javascript can be found in the message.Body
property.
You will need to add a new paramaterless constructor to your renderer that initializes a WKWebViewConfiguration
object, we will use this setup inject the javascript.
WKUserContentController _userController;
public HybridWebViewRenderer() : this(new WKWebViewConfiguration())
{
}
public HybridWebViewRenderer(WKWebViewConfiguration config) : base(config)
{
string js = "alert('I have been loaded!')";
string nativeCaller = "function invokeNative(payload) { window.webkit.messageHandlers.invokeAction.postMessage(payload); }";
_userController = config.UserContentController;
var myScript = new WKUserScript(new NSString(js), WKUserScriptInjectionTime.AtDocumentEnd, false);
var nativeInvoker = new WKUserScript(new NSString(nativeCaller), WKUserScriptInjectionTime.AtDocumentEnd, false);
_userController.AddUserScript(myScript);
_userController.AddUserScript(nativeInvoker);
_userController.AddScriptMessageHandler(this, "invokeAction");
}
We create a new WKUserScript
containing our javascript and add it to the web view. We then add a script message handler, this handler is a web kit handler and will be invoked by our native caller script. The message handler name is a string and any number of handlers can be added to the webview.
Finally we override the OnElementChanged
method of the renderer and handle setup / teardown of the WebView
.
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);
if (e.OldElement != null)
{
userController.RemoveAllUserScripts();
userController.RemoveScriptMessageHandler("invokeAction");
HybridWebView hybridWebView = e.OldElement as HybridWebView;
}
if (e.NewElement != null)
{
HybridWebView hybridWebView = Element as HybridWebView;
if (hybridWebView == null)
throw new InvalidCastException("Could not cast Element as HybridWebView");
LoadRequest(new NSUrlRequest(new NSUrl(hybridWebView.Uri)));
}
}
Finally don’t forget to export your renderer 😇
[assembly: ExportRenderer(typeof(HybridWebView), typeof(HybridWebViewRenderer))]
For the entire class and external classes see the source code example here.
Your renderer will need to inherit Xamarin.Forms.Platform.Android.WebViewRenderer
. Add a new constructor to your renderer and pass in the Context
class, otherwise the compiler will shout at you (one of my fave quirks on android). This time we will be doing the majority of the config in the OnElementChanged
method.
const string nativeInvokeScript = "function invokeNative(payload) { jsBridge.invokeAction(payload); }";
const string testScript = "alert('I have been loaded!')";
protected override void OnElementChanged(ElementChangedEventArgs<WebView> e)
{
base.OnElementChanged(e);
if (e.OldElement != null)
{
Control.RemoveJavascriptInterface("jsBridge");
}
if (e.NewElement != null)
{
HybridWebView hybridWebView = Element as HybridWebView;
if (hybridWebView == null)
throw new NullReferenceException();
Control.SetWebViewClient(
new JavascriptWebViewClient(this,
LoadScript(nativeInvokeScript),
LoadScript(testScript)
));
Control.AddJavascriptInterface(new JSBridge(this), "jsBridge");
Control.LoadUrl(hybridWebView.Uri);
}
}
We now need to create a webview client and a javascript bridge.
Create a class that inherits FormsWebViewClient
:
public class JavascriptWebViewClient : FormsWebViewClient
{
string[] _scripts;
public JavascriptWebViewClient(HybridWebViewRenderer renderer, params string[] scripts) : base(renderer)
{
_scripts = scripts;
}
public override void OnPageFinished(WebView view, string url)
{
base.OnPageFinished(view, url);
if (_scripts != null && _scripts.Count() > 0)
{
foreach (string script in _scripts)
{
view.EvaluateJavascript(script, null);
}
}
}
}
I have jazzed up this class a little from the official Xamarin sample. In this example only 1 script is passed to the webview and it is prefixed with: "javascript: {0}"
. In my example we use a few scripts so it makes sense to make the scripts and array.
We will now need a callback for our injected scripts, add the following class:
public class JSBridge : Java.Lang.Object
{
readonly WeakReference<HybridWebViewRenderer> hybridWebViewRenderer;
public JSBridge(HybridWebViewRenderer hybridRenderer)
{
hybridWebViewRenderer = new WeakReference<HybridWebViewRenderer>(hybridRenderer);
}
[JavascriptInterface]
[Export("invokeAction")]
public void InvokeAction(string data)
{
HybridWebViewRenderer hybridRenderer;
if (hybridWebViewRenderer != null && hybridWebViewRenderer.TryGetTarget(out hybridRenderer))
{
try
{
IBrowserInvocation args = JsonConvert.DeserializeObject<BrowserInvocation>(data);
((HybridWebView)hybridRenderer.Element).InvokeAction(args);
}
catch (Exception ex)
{
Debug.WriteLine($"Unable to parse browser invocation: {data}");
Debug.WriteLine(ex);
}
}
}
}
This class maintains a weak reference to the webview renderer in order to avoid a circular dependency. Similar to iOS this class exports the action "invokeAction"
which acts as the link between the browser and app. When the action is called you can handle the payload invoked from the browser and then call the InvokeAction
method on the HybridWebView
which will update the view models.
In order to use the [Export]
attribute, you must add a project reference in the android project to: Mono.Android.Export
.
Our webview’s each inject shared and native code. Each renderer specifies a slightly different “hook” to invoke the c# code. In my examples I have made the common invokation method generic and then injected the native handler on each platform, leaving us with the following call stack:
=> Javascript Event
=> Javascript Event Listener {external code}
-------------------------------------------------------
=> InvokeCSharpAction(); {our code}
=> InvokeNative();
=> Method invoked in renderer
We then invoke an ICommand
with the given payload (string
, IBrowserInvocation
etc), which can be bound too and handled further from any viewmodel. This has given us a really easy MVVM friendly native level implementation 😁
We now have a custom renderer for each platform that can inject and invoke javascript into the natively rendered WebView
. In my source code example I added a more detailed invocation object, this is a great place to start. Further improvements could be:
console.log()
events and logging them in the xamarin app