OAT High Availability Deployment
Table of Contents
SSH Password-less Connection between Hosts
Deploy the Web Applications with Load Balancers
Enable the Haproxy ports in the Firewall
Deploy the Web Applications with HA & Load Balancer
Deploy Mariadb and Galera Replicator
Galera Configuration with Three-node Cluster
Configure Mysql with HA & Load Balancers
In this guide, we will provide you with the complete deployment process of the OAT HA (high availability) solution. In this solution, we are using HAProxy to construct a highly available and scalable web cluster with two load balancers, two web servers and three Mysql servers. In addition, Keepalived, a framework for server failover, is also included to avoid the single point of failure (SNOF). The detailed topology is described in the following figure.
A minimum of three servers are required for this implementation. The deployment environment has been validated in Ubuntu 14.04.1, Fedora 20, RHEL 7 and SLES 12. This guide is intended for OpenSUSE 13.2.
Edit /etc/hosts and match the host name with its IP address in the cluster. Make sure the connectivity among hosts.
Create the ssh key pair with ssh-keygen and paste the public key to the $HOME/.ssh/authorized_keys file of the target server and vice versa.
HAProxy is renowned for one of the most popular load balancing and proxying solution. In our deployment, HAProxy is used to balance the load of the two web applications.
To install haproxy:
# zypper in haproxy
# chkconfig haproxy on
Backup the original haproxy configuration.
# mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy_backup.cfg
# vim /etc/haproxy/haproxy.cfg
Create a new one with the following settings:
global
maxconn 4096
user haproxy
group haproxy
log <IP_ADDRESS> local1 debug
daemon
defaults
log global
mode http
option dontlognull
retries 3
option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
frontend http-in
mode http
option httplog
bind *:442
reqadd X-Forwarded-Proto:\ http
acl is_whitelist path_beg -i /WhiteListPortal
use_backend whitelist_portal if is_whitelist
default_backend trust_dashboard_portal
backend trust_dashboard_portal
mode http
balance roundrobin
option httpchk HEAD /TrustDashBoard/login.htm HTTP/1.1\r\nHost:\ *:8080
option forwardfor
cookie LSW_WEB insert
option httpclose
server <lb1 hostname> <lb1 IP>:8080 cookie LSW_WEB01 check
server <lb2 hostname> <lb2 IP>:8080 cookie LSW_WEB02 check
backend whitelist_portal
mode http
balance roundrobin
option httpchk HEAD /WhiteListPortal HTTP/1.1\r\nHost:\ *:8080
option forwardfor
cookie LSW_WEB insert
option httpclose
server <lb1 hostname> <lb1 IP>:8080 cookie LSW_WEB01 check
server <lb2 hostname> <lb2 IP>:8080 cookie LSW_WEB02 check
frontend https-in
bind *:443
mode tcp
option tcplog
acl is_att path_beg -i /AttestationService
acl is_his path_beg -i /HisPrivacyCAWebServices2
use_backend Att-https if is_att
use_backend His-https if is_his
default_backend WLM-https
backend WLM-https
mode tcp
balance roundrobin
option tcplog
option httpchk HEAD /WLMService HTTP/1.1\r\nHost:\ *:8181
option ssl-hello-chk
server <lb1 hostname> <lb1 IP>:8181 check
server <lb2 hostname> <lb2 IP>:8181 check
backend Att-https
mode tcp
balance roundrobin
option tcplog
option httpchk HEAD /AttestationService HTTP/1.1\r\nHost:\ *:8181
option ssl-hello-chk
server <lb1 hostname> <lb1 IP>:8181 check
server <lb2 hostname> <lb2 IP>:8181 check
backend His-https
mode tcp
balance roundrobin
option tcplog
option httpchk HEAD /HisPrivacyCAWebServices2/hisPrivacyCAWebService2?wsdl HTTP/1.1\r\nHost:\ *:8181
option ssl-hello-chk
server <lb1 hostname> <lb1 IP>:8181 check
server <lb2 hostname> <lb2 IP>:8181 check
listen stats *:9000
stats enable
stats uri /
stats hide-version
stats realm OAT\ Haproxy
stats auth admin:<admin pwd>
Replace the contents in the angle brackets with the load balancer server hostname and IP.
Then, start HAProxy
# service haproxy start
Now you are able to access HAProxy＊s statistics page through the url http://<load balancer_hostname>:9000/ with username admin and password <admin password>
Redo the exact same steps to setup the other load balancer server.
Execute the commands below to open ports:
# iptables -I INPUT 1 -p tcp --dport 8181 -j ACCEPT
# iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
# iptables -I INPUT 1 -p tcp --dport 442 -j ACCEPT
# iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT
# iptables -I INPUT 1 -p tcp --dport 3307 -j ACCEPT
To enable the virtual IP address we will use keepalived.
# zypper in keepalived
# chkconfig keepalived on
Good, keepalived is now installed. If you want to enable mail alert, be sure to install sendmail.
# mv /etc/ keepalived/keepalived.conf /etc/ keepalived/keepalived.bak.conf
Now let＊s add the configuration for keepalived in the file /etc/keepalived/keepalived.conf.
global_defs {
notification_email {
<admin＊s email addr> # The email address for notification
}
notification_email_from <from email addr> # The from address for the notification
smtp_server <the mail server IP> # Specify the SMTP server address
smtp_connect_timeout 30
}
vrrp_script haproxy {
script "killall -0 haproxy"
interval 2
weight 2
}
vrrp_instance 50 {
virtual_router_id 50
advert_int 1
priority 101
state MASTER
interface eth0 # change to your network interface
smtp_alert # activate email notification, optional
authentication {
auth_type PASS
auth_pass 1111
}
virtual_ipaddress {
<virtual IP> dev eth0 # The virtual IP address shared by the two load balancers. Do change eth0 to the actual network interface
}
track_script {
haproxy
}
}
Voila, let＊s save the configuration and start the service.
# service keepalived start
The next step is to install and configure keepalived on the second load balancer. Repeat the previous steps on the second server starting from keepalived installation. The only difference is the minor change in the configuration of keeplived. Be sure to make two setting changes.
From:
priority 101
state MASTER
To:
priority 100
state BACKUP
Mariadb/Galera is synchronous multi-master cluster for MariaDB/InnoDB database. Data committed on one server will be replicated across the whole cluster, which prevents the cluster from the SNOF.
If you already have Mariadb installed, remove the mariadb Server or its dependencies.
Firstly, install Mariadb packages
# cd $TMP_DIR
# wget http://download.opensuse.org/repositories/home:/ottokek/openSUSE_13.2/x86_64/galera-3-25.3.x-89.1.x86_64.rpm
# wget http://download.opensuse.org/repositories/home:/ottokek/openSUSE_13.2/x86_64/mariadb-galera-client-10.0.14-19.1.x86_64.rpm
# zypper in mariadb-galera-errormessages-10.0.14-19.1.x86_64.rpm mariadb-galera-client-10.0.14-19.1.x86_64.rpm mariadb-galera-10.0.14-19.1.x86_64.rpm galera-3.x-22.1.x86_64.rpm
As there are a couple of wsrep_sst related scripts missing from these packages, they would be downloaded directly from github:
# wget https://raw.githubusercontent.com/allfs/mariadb/master/scripts/wsrep_sst_rsync.sh -O /usr/bin/wsrep_sst_rsync
# wget https://raw.githubusercontent.com/allfs/mariadb/master/scripts/wsrep_sst_common.sh -O /usr/bin/wsrep_sst_common
# wget https://raw.githubusercontent.com/allfs/mariadb/master/scripts/wsrep_sst_mysqldump.sh -O /usr/bin/wsrep_sst_mysqldump
# wget https://raw.githubusercontent.com/allfs/mariadb/master/scripts/wsrep_sst_xtrabackup.sh -O /usr/bin/wsrep_sst_xtrabackup
# wget https://raw.githubusercontent.com/allfs/mariadb/master/scripts/wsrep_sst_xtrabackup-v2.sh -O /usr/bin/wsrep_sst_xtrabackup-v2
Grant the wsrep script files with the execution permissions:
# chmod +x /usr/bin/wsrep*
Then, configure Mysql Server, start the mysql server on all nodes and run the command below to set the root password.
# chkconfig mysql on
# service mysql start
# mysql_secure_installation
Repeat the same steps on the second and the third database server.
In OAT, one attestation server has its own set of endorsement certificate and PrivacyCA certificate generated upon server setup. In the HA implementation, there are two or more web applications to offload each other. However, only one set of certificates will be created and used in the cluster. Therefore, the certificate will be generated on one server and transfer to other servers hosting web applications.
Regarding how to install the OAT server, you may refer to the wiki (https://github.com/OpenAttestation/OpenAttestation/wiki ) to install all the necessary dependencies beforehand.
On the first server, download and compile the source code from git source (https://github.com/OpenAttestation/OpenAttestation) to $HOME folder
Switch to openjdk 1.7:
# update_alternative 每config java
# git checkout v2.2
# cd $HOME/OpenAttestation/
# mvn clean install
# cd deploy
And redo it on the other oat web server.
# ./deploy_opensuse_ha.sh --mysql <mysql password> --ip <The virtual IP> --port <the oatserver port on load balancer> --mysql_port <the mysql port on load balancer>
Notice: the parameter port here is the oat server https port on the load balancer. It was set as 443 in /etc/haproxy/haproxy.cfg in our implementation.
On the second server:
# cd $HOME/ OpenAttestation/deploy
# ./deploy_opensuse_ha.sh --mysql <mysql password> --ip <The virtual IP> --port <the oatserver port on load balancer> --ha_master <the first server IP>
Here the ha_master is the IP/hostname of the first web server deployed.
 TO sst@'%' IDENTIFIED BY 'yourpass';"
# mysql -uroot 每p<password> mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'sst'@'localhost' IDENTIFIED BY 'yourpass";
Remove user accounts with empty user names because they cause problems:
# mysql 每uroot 每p<password> mysql -e "DELETE FROM mysql.user WHERE user='';"
Then open the firewall port 4567, 3306, 4444, 4568
# iptables -I INPUT 1 -p tcp --dport 4567 -j ACCEPT
# iptables -I INPUT 1 -p tcp --dport 3306 -j ACCEPT
# iptables -I INPUT 1 -p tcp --dport 4444 -j ACCEPT
# iptables -I INPUT 1 -p tcp --dport 4568 -j ACCEPT
After that, let＊s begin the configuration:
Edit /etc/my.cnf.d/server.cnf, add the following content under [galera] section:
[galera]
wsrep_provider=/usr/lib64/galera-3/libgalera_smm.so #it could be located in /usr/lib/galera/ libgalera_smm.so depends on the platform
wsrep_cluster_address=gcomm://
wsrep_node_address=<first db server IP>
wsrep_sst_method=rsync
wsrep_sst_auth=sst:<yourpass>
wsrep_cluster_name="my_wsrep_cluster"
binlog_format=row
wsrep_slave_threads=1
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
query_cache_size=0
bind-address=<IP_ADDRESS>
Move onto the second server:
Edit /etc/my.cnf.d/server.cnf, add the following content under [galera] section:
[galera]
wsrep_provider=/usr/lib64/galera-3/libgalera_smm.so #it could be located in /usr/lib/galera/ libgalera_smm.so depends on the platform
wsrep_cluster_address=gcomm://<first db server IP>
wsrep_node_address=<second db server IP>
wsrep_sst_method=rsync
wsrep_sst_auth=sst:<yourpass>
wsrep_cluster_name="my_wsrep_cluster"
binlog_format=row
wsrep_slave_threads=1
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
query_cache_size=0
bind-address=<IP_ADDRESS>
OK, let＊s re-launch mariadb/mysql service to apply the settings.
# service mysql restart
Then, restart the service on the second db server to let it join the cluster.
# service mysql restart
Now the configuration is done and the service is up. Let＊s check the wsrep status.
# mysql 每usst 每p<yourpass> -e "show status like 'wsrep%';" | egrep 'wsrep_ready|wsrep_cluster_size'
The result should look like this. If any of the return values does not match the result below, you will have to verify your configurations and restart MySQL.
wsrep_cluster_size 2
wsrep_ready ON
OK, now the galera cluster works. In order to avoid any split-brain situation, the cluster is recommended to have at least three nodes. So add one more database node into the cluster. Redo the same steps as the second node. The only difference is the setting listed below.
wsrep_cluster_address=gcomm://<second db server IP>
wsrep_node_address=<third db server IP>
Restart the mysql service on the third node:
# service mysql restart
It will automatically connect to the other node and will be a member of the cluster. After joined the cluster, check the size of the cluster and it should be 3 now.
# mysql 每u<username> 每p<password> -e "show status like 'wsrep%';" | grep ＆wsrep_cluster_size'
That＊s it! Check the replication by creating databases, tables and fields.
Important note: when your 3 node replication is setup, change the address of the first node with this gcomm:// address by gcomm://<third db server IP>.
For the time being, there are three database nodes. In OAT, one single entry point is needed to access the database. To avoid SNOF, a HAProxy is to set up on top of the existing Galera cluster.
Add the following configurations to the bottom of /etc/haproxy/haproxy.cfg. Redo this on the other load balancer server.
listen galera_cluster *:3307
mode tcp
balance roundrobin
option tcpka
option mysql-check user haproxy
server <db server1 hostname> <db server1 IP>:3306 check weight 1
server <db server2 hostname> <db server2 IP>:3306 check weight 1
server <db server3 hostname> <db server3 IP>:3306 check weight 1
When you specify the option mysql-check with a username. You need to add a user in the mysql database like this:
# mysql 每u<username> -p<password> mysql -e ※insert into user(Host,User,ssl_cipher, x509_issuer, x509_subject, authentication_string) values('%', 'haproxy', '','', '', '');
GRANT ALL PRIVILEGES on *.* TO 'haproxy'@'%'; flush privileges;§
Reboot HAProxy.
# service
haproxy restart
When it is done, update the OAT server configuration with the latest connection
string.
Remember to make the same change on the other web application server. Restart tomcat to take effect.
# service tomcat restart
OK. Finally we have the complete initial OAT HA environment setup in a three-node cluster.
Now, you are able to access the oat web portal by http://<virtual IP>:442/TrustDashBoard/login.htm and http://<virtual IP>:442/WhiteListPortal/login.htm
If there is a system failure or upgrade which needs a system reboot, check the running status of the keepalived, haproxy, tomcat and mysql service. If any of them fail to start, restart them or check the error log for details.
If one of the nodes comes across some hardware failure or system crash, to setup a new node to join the HA cluster, please follow this guide to build a fresh node.
1. Setup Haproxy. http://www.leaseweblabs.com/2011/07/high-availability-load-balancing-using-haproxy-on-ubuntu-part-1/#comment-79665
2. Setup Keepalived. http://www.leaseweblabs.com/2011/09/setting-up-keepalived-on-ubuntu-load-balancing-using-haproxy-on-ubuntu-part-2/
3. HAProxy logging. http://kvz.io/blog/2010/08/11/haproxy-logging/
4. Mariadb-Galera. http://blog.laimbock.com/2014/07/08/howto-setup-mariadb-galera-cluster-10-on-centos/comment-page-1/
5. Mysql-Galera with HAProxy. http://www.sebastien-han.fr/blog/2012/04/08/mysql-galera-cluster-with-haproxy/


Qibocal Reports
Uploaded Reports
Please select a report from the table below:
Title
Date
Platform
Start-time (UTC)
End-time (UTC)


Choose one that posts lots of pictures! (like StarshipPorn)
Select a directory (Chrome) or multiple files (Firefox).


patients homoplasmy vomiting CVS N/A mtDNA pediatric cyclic syndrome study {border-style children px;} #ffffff;} disease A > G gastrointestinal MT-ND Gastroenterol T > C rRNA Cyclic C > T MT-RNR Pediatr Rome associated n = ), patients. DNA functional mitochondrial reported clinical diagnosis patients, disorders migraine showed (.%) G > A data heteroplasmy history patient sequencing studies treatment variants .±. Chinese MT-CYB attacks family performed polymorphism px; received {font-family However, analysis episodes font-size included including mutation n = ). onset syndrome: tRNA CVS. MT-C age care criteria double; local mean medical polymorphisms quality underwent using (Case Children’s Clinical Fudan Hospital LHON PMID: Patients Pediatric abdominal acid admitted blood border-color border-width burden center. eng hospitalization p.IV prevalence solid; subjects urine visits {font-style {font-weight (range: ./j.-...x ./s--- Associated BMC HTN Han Hepatol III Leber Mitochondrial Nutr Prevalence Results adults bold burdens characteristics cohort common courier; deafness, department diagnosed did em; emergency features frequency headache hereditary hospitals identified infection lower median mild n = ) obtained optic p.TA periods personal present previously prophylactic pt;} retrospective severe stereotypical study, study. tertiary therapy upper


Open source, MVC web application (currently at version 5.1) written in PHP
Out of the box it has support for:
MySQL, Postgres, SQLite and SQL Server.
composer create-project laravel/laravel my-project --prefer-dist
Key folders for day to day work
All web requests will go through the public/ directory and hit the index.php file
From here on you define the structure of the URLs, it is not based on directory structure, but based on the routes you define in app/Http/routes.php
GET requests
Route::get('/', function () {
return 'Index';
});
Route::get('/about', function () {
return 'About';
});
POST requests
Route::post('/', function () {
return 'Posted to Index';
});
Handling parameters as part of the URL
Route::get('user/{id}', function ($id) {
return 'User '.$id;
});
Handling parameters as part of the URL with a constraint
Route::get('user/{id}', function ($id) {
return 'User '.$id;
})->where('id', '[0-9]+');
Pointing a route at a controller
Route::get('user/{id}', [
'uses' => 'UserController@showProfile'
]);
class UserController extends Controller
{
public function showProfile($id)
{
return 'User '.$id;
}
}
Naming routes
Route::get('blog/', [
'uses' => 'blogController@index',
'as' => 'blog.index'
]);
Route::get('blog/{slug}', [
'uses' => 'blogController@showPost',
'as' => 'blog.post'
]);
Which allows you generate the route path
route('blog.index') # /blog/
route('blog.post', ['slug' => 'hello-world']) # /blog/hello-world
route('blog.post', ['slug' => $blog['slug']]) # /blog/hello-world
The Eloquent ORM included with Laravel provides a beautiful, simple ActiveRecord implementation for working with your database. Each database table has a corresponding "Model" which is used to interact with that table. Models allow you to query for data in your tables, as well as insert new records into the table.
From: http://laravel.com/docs/5.1/eloquent
Basic model
namespace App;
use Illuminate\Database\Eloquent\Model;
class BlogPost extends Model
{
}
Eloquent will assume the DB table is called blog_posts
// Retrieve all records
$posts = BlogPost::all();
// Single record
$post = BlogPost::where(['slug' => 'hello-world'])->first();
Creating a record
$post = new BlogPost;
$post->name = 'Hello World';
$post->slug = 'hello-world';
$post->content = 'Lorem ipsum dolor[..]id est laborum.';
$post->save();
Model $fillable attribute
namespace App;
use Illuminate\Database\Eloquent\Model;
class BlogPost extends Model
{
protected $fillable = ['name', 'slug', 'content'];
}
Create a record via mass assignment
$formData = Input::all();
$post = BlogPost::create($formData);
Out of the box Laravel has a template engine called Blade.
Blade view files use the .blade.php file extension and are typically stored in the resources/views directory.
From: http://laravel.com/docs/5.1/blade
Basic example
@extends('layouts.master')
@section('title', 'Page Title')
@section('sidebar')
@parent
This is appended to the master sidebar.
@endsection
@section('content')
This is my body content.
@endsection
Using Blade templates
Route::get('/', function () {
return view('index');
});
This will try to include the file resources/views/index.blade.php
(will also try for index.php if not found)
Passing data to the view
return view('blog.post', ['post' => $post]);
Note that dots are treated as slashes (e.g. 'blog.post' = 'resources/views/blog/post.blade.php')
Outputting variables

{{ $blog['post'] }}

If statements and foreach loops
@if (count($posts) > 0)
@foreach ($posts as $post)

{{ $post['name'] }}

@endforeach
@else
No posts
@else
|
|
|


Broome County Catholic Charities kicks off annual turkey collection
by Dan ConklinVESTAL (WBNG) — As Thanksgiving approaches, Catholic Charities of Broome County is giving you the chance to ensure everyone in Broome County has food on their table this year.
The annual Thanks-4-Giving Turkey Drive is officially underway, collecting Thanksgiving turkeys, as well as other non-perishable food items, to fight hunger in Broome County this holiday season.
Organizers with Catholic Charities say these holiday baskets can help those in need enjoy a holiday dinner, something many people take for granted.
“We’re trying to fill those baskets now and make sure everyone gets what they need. There’s a lot of people in need in Broome County. There’s a poverty rate that’s quite higher than it is in the rest of New York State, so we just want to make sure we’re doing our part,” explained Mary Whitcombe.
Organizers will be in front of Walmart in Vestal’s Town Square Mall from Monday, November 18th through Friday November 22nd, collecting Thanksgiving turkeys and other non-perishables. They say they hope to collect 3,500 turkeys this year.


| Environment | Observations | Actions | Agents | Manual Control | Action Shape | Action Values | Observation Shape | Observation Values | Num States |
|---|---|---|---|---|---|---|---|---|---|
| Boxing | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Combat: Tank | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Combat: Plane | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Double Dunk | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Entombed: Competitive | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Entombed: Cooperative | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Flag Capture | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Joust | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Ice Hockey | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Maze Craze | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Mario Bros | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Othello | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Pong: Classic | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Pong: Basketball | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Pong: Foozpong | Graphical | Discrete | 4 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Pong: Quadrapong | Graphical | Discrete | 4 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Pong: Team Volleyball | Graphical | Discrete | 4 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Space Invaders | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Space War | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Surround: Original | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Tennis | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Video Checkers | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Wizard of Wor | Graphical | Discrete | 2 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
| Warlords | Graphical | Discrete | 4 | No | (1,) | [0,17] | (210, 160, 3) | (0,255) | ? |
The Atari environments are based off the Arcade Learning Environment. This environment was instrumental in the development of modern reinforcement learning, and so we hope that our multi-agent version of it will be useful in the development of multi-agent reinforcement learning.
Most games are two player, with the exception of Warlords and a couple of Pong variations which are four player.
There are three types of games:
The ALE environment has been studied extensively and examined for various flaws and how to fix them.
repeat_action_probability
environment parameter, by default. This is the recommended approach of “Machado et al. (2018), “Revisiting the Arcade Learning Environment: Evaluation Protocols and Open Problems for General Agents”All the Atari environments have the following environment parameters:
<atar_game>.env(seed=None, obs_type='rgb_image', frameskip=3, repeat_action_probability=0.25, full_action_space=True)
seed: Set to specific value for deterministic, reproducible behavior.
obs_type: default value of 'rgb_image' leads to (210, 160, 3) image pixel observations like you see as a a human, 'grayscale_image' leads to a black and white (210, 160, 1) image, 'ram' leads to an observation of the 1024 bits that comprise the RAM of the atari console.
frameskip: number of frames to skip each time you take an action.
repeat_action_probability: probability you repeat an action from the previous frame (not step, frame), even after you have chosen a new action. Simulates the joystick getting stuck and not responding 100% quickly to moves.
full_action_space: The effective action space of the atari games is often smaller than the full space of 18 moves. This shrinks the action space to this smaller space.
If you use the Atari environments in your research please cite the following paper:
@Article{bellemare13arcade,
author = { {Bellemare}, M.~G. and {Naddaf}, Y. and {Veness}, J. and {Bowling}, M.},
title = {The Arcade Learning Environment: An Evaluation Platform for General Agents},
journal = {Journal of Artificial Intelligence Research},
year = "2013",
month = "jun",
volume = "47",
pages = "253--279",
}


Name you want to give to this gradle installation.
When you configure a job 'Build' section and select 'Invoke Gradle' as the method to run gradle, this name will appear in the 'Gradle Version' list.


Survey Questions
About You
Name (Required)
Link to Photo Image (Required)
Instructions
For each question, select a value of between 1 and 5, where
1 = Strong Disagree
and
5 = Strongly Agree!
Question 1
Your mind is always buzzing with unexplored ideas and plans.
1
2
3
4
5
Question 2
Generally speaking, you rely more on your experience than your imagination.
1
2
3
4
5
Question 3
You find it easy to stay relaxed and focused even when there is some pressure.
1
2
3
4
5
Submit
It's a Match!


By the time I'd finsihed reading the chapter and got a chance to actually have the conversation there was no one around to actually try this with. So I read everyone elses blog to see how they found it and it was interesting to see all the different perspectives. I will try my best to do it this week since it does sound so interesting.
To be honest this week I didn't really have time to be mindful but in saying that I did notice that I hadn't left the house in a few days (other than going to work on Monday) so I made sure that over the weekend I went out and saw friends, went to the beach, called my dad etc. Just making sure to keep my mental health up by being connected to others and having a good time. Sometimes this helps a lot more than being mindfull. However, I will 100% continue to practice mindfulness as I know it is a really important/helpful skill.


{% responsive_image_block %} path: assets/images/image-icon/logo.png alt: {{ site.description | escape }} {% endresponsive_image_block %} {{ site.title | escape }}
{{ site.subtitle | escape }}
The Eagle Rex Cycling Club provides effective fitness training methods and workout programs to cyclists of all skill and experience levels.
Training Plans
{% responsive_image path: assets/images/image-icon/training.png alt: "Icon representing Training Plans" %}Combine elements of CrossFit and Strength Training to achieve your ultimate goals, build on your strengths, target weaknesses and achieve peak performance.
Workout Routines
{% responsive_image path: assets/images/image-icon/workouts.png alt: "Icon representing Workout Routines" %}Get access to all the Eagle Rex cycling workout routines. Break through your current limits with our proven method.
Free Zwift Resources
{% responsive_image path: assets/images/image-icon/zwift.png alt: "Icon representing our Free Zwift Resources" %}Reach Your Physique Goals and Achieve Peak Performance.
About Us
{% responsive_image path: assets/images/image-icon/us.png alt: "Icon representing the About Us section" %}A little bit about who we are, and what we try to be.
Our main Facebook group for questions, support and just sharing Eagle Rex love
Strava
{% responsive_image path: assets/images/image-icon/strava.png alt: "Icon representing Strava" %}This is the page Where herdlings strut their stuff


Eurex ETD CSV
The standard Eurex Clearing CSV format is supported for ETD positions. This is a standard CSV file with a header row.
Fields
Each row in the CSV input file corresponds to a single position.
The following fields are supported:
| Column Name | Format | Optional | Description |
|---|---|---|---|
Product ID |
Text | No | Eurex product code e.g. CONF |
Expiry Year |
yyyy | No | Actual expiry year |
Expiry Month |
Month Number | No | Actual expiry month |
Expiry Day |
Day Number | Yes | Actual expiry day – required for flex contracts |
Version Number |
Number | Yes | Required for options |
Product Settlement Type |
Text | Yes | Required for flex contracts |
Call Put Flag |
C or P |
Yes | Required for options |
Exercise Price |
Number | Yes | Required for options |
Exercise Style |
AMERICAN or EUROPEAN |
Yes | Required for flex options |
Instrument Type |
Future , Option , Flex Option |
No | |
Assigned/Notified Balance |
Number | Yes | Not used |
Exercised/Allocated Balance |
Number | Yes | Not used |
Long Balance |
Number | No | |
Short Balance |
Number | No | |
OpenGammaId |
Text | Yes | Custom internal identifier |
By default, each loaded position is given a globally unique identifier corresponding to the next value in an incrementing sequence.
When analysis of position-level results is required, it can be important to ensure that the results can be tied back to a specific input position via an identifier.
The field OpenGammaId
is supported in order to allow such an identifier to be specified.
Example
The following CSV file describes a position in ABBN:
Product ID,Expiry Year,Expiry Month,Expiry Day,Version Number,Product Settlement Type,Call Put Flag,Exercise Price,Exercise Style Flag,Instrument Type,Assigned/Notified Balance,Exercised/Allocated Balance,Long Balance,Short Balance
ABBN,2016,12,,0,S,C,20,AMERICAN,Option,0,0,10,7
Limitations
See Known Limitations.
API
The ETD CSV parser is implemented by EurexEtdTradeFileReader
.
The code below shows a simple example of using it directly to load trades from a CSV input file:
MarginEnvironment environment = MarginEnvironmentFactory.buildBasicEnvironment(new EurexPrismaReplication());
...
OgmLinkResolver linkResolver = environment.getInjector().getInstance(OgmLinkResolver.class);
Reader etdReader = new BufferedReader(new FileReader("etd.csv"));
EurexEtdTradeFileReader.parse(linkResolver, etdReader);
The OgmLinkResolver
is required when loading ETD positions in order to resolve a valid reference to a security in
the environment. Security definitions are part of the theoretical instruments ETD input file. For further details on the
input files, see Market Data.


Ever since I was about 17 I noticed my mental health and overall hapinnes decline. Mental illness runs in my family and I was becomming overwhelmed with anxiety, which I first mistook for depression. Eventually at 19 physical symptoms of uneasiness, nervousness, racing heart, and sweaty palms became a common thing. I felt worthless, hated my feelings and wanted to die but was too afraid of what would happen after I actaully eneded my own life since I don't believe in any religion.
To deal with my problems I resorted to drinking heavily about four or five times a week, which was fun but too self detrimental.
I told them I needed to see a doctor and putting up with my illness wasn't going to work for me. I told my doctor about my problem and she said it an anxiety disorder and she was going to give me something to 'make it all better.' She gave me samples of Paxil and Xanax and told me to not worry because everthing was going to get better for me.
I decided to look up Paxil and see what people had to say about it, what I read was not what I expected.
I went to see a counselor as well and her advice was not too listen to what I read on the internet and give the Paxil a try. I figured that life couldn't get any worse at this point so I began to pop the little pink pills. At first I noticed nothing but two or three weeks later I woke up out of bed and realized how much energy I had. Soon after I began to feel more self confidence and less anxious, just an overall feeling of being chill for once. Now after about three months of Paxil I couldn't be happier that I decided to go with this drug.
 If you actually have a chemical imbalance in your brain than Paxil can offer relief. As far as being addicted to Paxil I can't claim I am or not, I've never tried to go off of it. I have however gone two days without it and was fine, no withdrawl symptons at all. I also have not had any bad interactions between Paxil and alcohol, weed, salvia, mushrooms, Xanax, vicodin or other opiates, and other various recreational drugs (DXM, diphenhydrinate, and other legal highs). So if you feel you truely have depression or an anxiety disorder than give an SSRI a try, I know life can't get much worse when you have one of these disorders so please do something about it.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


e03 (4p - 7p) : Final Exam
| num | ready? | description | exam date |
|---|---|---|---|
| e03 (4p - 7p) | true | Final Exam | Mon 06/11 04:00PM |
Final Exam (3 hours)
Seating arrangement
Please seat yourself in the exam hall according to this seating chart
Layout of the room is available here
If you would like to request a left handed or right handed seat, please contact the instructor.
Instructions for the exam
- You may bring one 8.5” x 11” piece of paper with notes on both sides. This paper will be collected along with your exam, so make your own copy if you would like to keep it.
- No calculators or phones are allowed in the exam
- No other notes or books are allowed
- There are no makeups for this exam
- You must write your name on every single sheet of paper including your notes
- We will provide you with scratch paper
Exam topics
You are expected to know all the material covered in class. Most of the emphasis will be on topics covered in post midterm 1 - such as dynamic memory allocation, heap vs stack, linked-lists, iteration through lists, pointer arithmetic, strings and recursion on linked-lists and strings
You must know all material covered in lecture slides as well homworks 1-14, labs 00- lab08. Special emphasis will be placed in labs 6-8.
Here are some important topics that you should definitely expect questions on:
- Flow control if-else statements
- Data types and declarations
- While loops
- For loops
- Evaluating expressions
- Data representation
- Arrays
- Passing parameters to functions
- Passing arrays to functions and returning arrays from functions
- Pointers
- Structs
- Pointers and structs
- Pointers and arrays
- Arrays of structs
- Dynamic Memory Allocation
- Linked-lists
- Strings
- Iteration through lists
- Recursion on linked lists and strings
Exam resources
- Pracice problem: Please go through the problems in our Concept Inventory for additional preparation.
- Collaborative notes: You may add to this COLLABORATIVE DOCUMENT.
- Consolidated exam notes
- Resources from midterm
Solutions to all homeworks
Past midterms
- Midterm 1 Question paper
- Midterm 2 question paper
- Code written in lecture https://github.com/ucsb-cs16-s18-mirza/cs16-s18-lectures
-
Past exams: You may also refer to all the past exams. Please note that some questions on these exams may refer to labs that you have not completed so far. You will only be asked questions related to the labs you have completed. The past exams should however provide some information on the expected difficulty and approximate format of the exam. Please note that there may be differences in content as well.
- Winter’17
- Spring’17
- Winter’18


Find
My Recipes
Shopping List
My Profile
Cranberry and Apple Stuffed Acorn Squash Recipe
Curried Lentils and Rice
Old-Fashioned Oatmeal Cookies
Previous
Next
Most Viewed Today
Mic's Yorkshire Puds
Curried Chicken Salad
Big Night Pizza
On A Budget
Roasted Asparagus
Blueberry Oatmeal Squares
Crock Pot Roast


hi everybody,

I don't understant the concept of views and propagators implementation, can you give me other details and examples about views and
the necessary steps to implement a propagator, because i took a look on some constraint such as distinct, but i it's very vagness for me.

thanks,
amina.

Avec Windows Live, vous organisez, retouchez et partagez vos photos.


Write your own filter¶
New in version 0.7.
Writing own filters is very easy. All you have to do is to subclass the Filter class and override the filter method. Additionally a filter is instanciated with some keyword arguments you can use to adjust the behavior of your filter.
Subclassing Filters¶
As an example, we write a filter that converts all Name.Function tokens to normal Name tokens to make the output less colorful.
from pygments.util import get_bool_opt
from pygments.token import Name
from pygments.filter import Filter
class UncolorFilter(Filter):
def __init__(self, **options):
Filter.__init__(self, **options)
self.class_too = get_bool_opt(options, 'classtoo')
def filter(self, lexer, stream):
for ttype, value in stream:
if ttype is Name.Function or (self.class_too and
ttype is Name.Class):
ttype = Name
yield ttype, value
Some notes on the lexer argument: that can be quite confusing since it doesn’t need to be a lexer instance. If a filter was added by using the add_filter() function of lexers, that lexer is registered for the filter. In that case lexer will refer to the lexer that has registered the filter. It can be used to access options passed to a lexer. Because it could be None you always have to check for that case if you access it.
Using a decorator¶
You can also use the simplefilter decorator from the pygments.filter module:
from pygments.util import get_bool_opt
from pygments.token import Name
from pygments.filter import simplefilter
@simplefilter
def uncolor(lexer, stream, options):
class_too = get_bool_opt(options, 'classtoo')
for ttype, value in stream:
if ttype is Name.Function or (class_too and
ttype is Name.Class):
ttype = Name
yield ttype, value
The decorator automatically subclasses an internal filter class and uses the decorated function for filtering.


A Busy Royal Game of Ur Board
I’ve done a lot of experimenting with making Royal Game of Ur sets. The famous set that most people are familiar with at the British Museum is visually beautiful and busy.
I’ve experimented with some more minimal designs like the one below.
With my latest board, I embraced the busyness. I’ve made the board even more busy and it’s an interesting contrast to my minimalistic approach.
This board is made with Red Oak plywood. Red Oak is beautiful with amazing grains, but not actually the best for shading with a wood burner. I found more success with using textures and I think it complements the board pretty well.


Ms. Magazine [ http://msmagazine.com/ ]
Ms on iPad [ http://store.feminist.org/getandgivems.aspx ]
Get the Ms. app, print edition, or both! [ http://store.feminist.org/getandgivems.aspx ]
Dear Dry,
Get the awesome new Spring issue of Ms. [ http://store.feminist.org/getandgivems.aspx ] We have delved into everything from Beyonce’s fierce feminism to in-depth analysis of fracking as a feminist issue, to a special excerpt from Eve Ensler’s just released memoir.
Join Ms. today to receive our fearless, feminist reporting on your mobile device (iPhone, iPad or Android). [ http://store.feminist.org/getandgivems.aspx ] As a bonus, you will also receive our special 40th Anniversary issue FREE*. And you can also get the print edition delivered right to your mailbox.
The Spring issue also features:
* 10 things you need to know about the health insurance benefits available to you under the Affordable Care Act
* How some international family planning aid ends up in the hands of anti-women forces
* Plus national and global reports and short takes, the Ms. Calendar of upcoming feminist events nationwide, and the classic Ms. No Comment
Join Ms. today. [ http://store.feminist.org/getandgivems.aspx ]The one way you can keep up with feminist ideas, happenings, milestones and news.
For women’s equality.
Katherine Spillar
Executive Editor
P.S. Choose the format that fits your life: digital, print, or both! [ http://store.feminist.org/getandgivems.aspx ] Take Ms. with you everywhere you go! !
*For Android devices, if you purchase issues directly through the Google Play store, the 40th Anniversary Issue will cost $0.99. This issue is free when you purchase a subscription through the *Ms. store* [ http://store.feminist.org/getandgivems.aspx ].
“You have received this e-mail because of your interest in promotions and Ms. magazine. To unsubscribe, please click here. [ http://salsa.democracyinaction.org/o/1400/p/salsa/supporter/unsubscribe/public/index.sjs?unsubscribe_page_KEY=494 ]”
1600 Wilson Boulevard, Suite 801, Arlington, VA 22209 |<PHONE_NUMBER> | webmaster@feminist.org


Bayesian fitting and sensitivity analysis methods for adaptive spline surfaces. Built to handle continuous and categorical inputs as well as functional or scalar output. An extension of the methodology in Denison, Mallick and Smith (1998) <doi:10.1023/A:1008824606259>.
| Version: | 0.2.2 |
| Suggests: | knitr |
| Published: | 2017-03-17 |
| Author: | Devin Francom [aut, cre], Bruno Sanso [ths], Agner Fog [ctb, cph] |
| Maintainer: | Devin Francom <devinfrancom at gmail.com> |
| License: | GPL-3 |
| NeedsCompilation: | yes |
| Materials: | NEWS |
| CRAN checks: | BASS results |
| Reference manual: | BASS.pdf |
| Vignettes: |
1 |
| Package source: | BASS_0.2.2.tar.gz |
| Windows binaries: | r-devel: BASS_0.2.2.zip, r-release: BASS_0.2.2.zip, r-oldrel: BASS_0.2.2.zip |
| OS X binaries: | r-release: BASS_0.2.2.tgz, r-oldrel: BASS_0.2.2.tgz |
| Old sources: | BASS archive |
Please use the canonical form https://CRAN.R-project.org/package=BASS to link to this page.


Blockcore is the foundation for realizing blockchains and includes core functionality to create your own custom blockchain with a lot of tooling supporting your blockchain.
The tooling as part of the Blockcore platform includes; Block Explorer, Block Indexing, Block Analytics, Wallets, API Wallet Service, Developer Tooling, Documentation and more.
Blockcore is under continuous development to stay at the cutting edge of Bitcoin and blockchain technology. We invite you to engage with our community on our Discord.


R/dashboard.R
check_threshold.Rd
The action is only triggered if any values in df[[test_variable]] exceed test_threshold. Intended for use in calculating dashboard metrics.
check_threshold(df, test_threshold, test_variable = "pct_change", action = function(...) warning(..., call. = FALSE), msg = paste("Threshold of", test_threshold, "for", test_variable, "exceeded:"))
| df | data frame: table containing statistic to check |
|---|---|
| test_threshold | numeric: if exceeded, while produce warning |
| test_variable | character: Name of variable in df that contains the test statistic |
| action | function: function call to perform if threshold is exceeded
(intended to be |
| msg | character: message to be printed in action |
Other dashboard functions: est_churn
,
est_part
, format_result
,
scaleup_part
library(dplyr) # produce warnings x <- data.frame(tot = "All", year = 2008:2018, part = rnorm(11, 1000, sd = 100)) x <- mutate(x, pct_change = (part - lag(part)) / lag(part) * 100) check_threshold(x, 5)#> Warning: Threshold of 5 for pct_change exceeded: #> tot year part pct_change #> 1 All 2009 1025.5317 19.248476 #> 2 All 2010 756.2736 -26.255460 #> 3 All 2011 999.4429 32.153604 #> 4 All 2012 1062.1553 6.274736 #> 5 All 2014 817.8182 -26.642623 #> 6 All 2015 975.2675 19.252351# this will produce an error # check_threshold(x, 5, action = function(...) stop(..., call. = FALSE))


json_decode (PHP 5 >= 5.2.0, PECL json >= 1.2.0, PHP 7) json_decode — 对 JSON 格式的字符串进行解码 说明 mixed json_decode ( string $json [, bool $assoc = false [, int $depth = 512 [, int $options = 0 ]]] ) 接受一个 JSON 编码的字符串并且把它转换为 PHP 变量 参数 json 待解码的 json string 格式的字符串。 这个函数仅能处理 UTF-8 编码的数据。 Note: PHP implements a superset of JSON as specified in the original » RFC 4627 - it will also encode and decode scalar types and NULL. RFC 4627 only supports these values when they are nested inside an array or an object. Although this superset is consistent with the expanded definition of "JSON text" in the newer » RFC 7159 (which aims to supersede RFC 4627) and » ECMA-404, this may cause interoperability issues with older JSON parsers that adhere strictly to RFC 4627 when encoding a single scalar value. assoc 当该参数为 TRUE 时，将返回 array 而非 object 。 depth User specified recursion depth. options Bitmask of JSON decode options. Currently only JSON_BIGINT_AS_STRING is supported (default is to cast large integers as floats) 返回值 Returns the value encoded in json in appropriate PHP type. Values true, false and null are returned as TRUE, FALSE and NULL respectively. NULL is returned if the json cannot be decoded or if the encoded data is deeper than the recursion limit. 范例 Example #1 json_decode() 的例子 以上例程会输出： object(stdClass)#1 (5) { ["a"] => int(1) ["b"] => int(2) ["c"] => int(3) ["d"] => int(4) ["e"] => int(5) } array(5) { ["a"] => int(1) ["b"] => int(2) ["c"] => int(3) ["d"] => int(4) ["e"] => int(5) } Example #2 Accessing invalid object properties Accessing elements within an object that contain characters not permitted under PHP's naming convention (e.g. the hyphen) can be accomplished by encapsulating the element name within braces and the apostrophe. {'foo-bar'}; // 12345 ?> Example #3 common mistakes using json_decode() Example #4 depth errors array( 'English' => array( 'One', 'January' ), 'French' => array( 'Une', 'Janvier' ) ) ) ); // Define the errors. $constants = get_defined_constants(true); $json_errors = array(); foreach ($constants["json"] as $name => $value) { if (!strncmp($name, "JSON_ERROR_", 11)) { $json_errors[$value] = $name; } } // Show the errors for different depths. foreach (range(4, 3, -1) as $depth) { var_dump(json_decode($json, true, $depth)); echo 'Last error: ', $json_errors[json_last_error()], PHP_EOL, PHP_EOL; } ?> 以上例程会输出： array(1) { [1]=> array(2) { ["English"]=> array(2) { [0]=> string(3) "One" [1]=> string(7) "January" } ["French"]=> array(2) { [0]=> string(3) "Une" [1]=> string(7) "Janvier" } } } Last error: JSON_ERROR_NONE NULL Last error: JSON_ERROR_DEPTH Example #5 json_decode() of large integers 以上例程会输出： object(stdClass)#1 (1) { ["number"]=> float(1.2345678901235E+19) } object(stdClass)#1 (1) { ["number"]=> string(20) "12345678901234567890" } 注释 Note: The JSON spec is not JavaScript, but a subset of JavaScript. Note: In the event of a failure to decode, json_last_error() can be used to determine the exact nature of the error. 更新日志 版本 说明 5.6.0 Invalid non-lowercased variants of the true, false and null literals are no longer accepted as valid input, and will generate warnings. 5.4.0 The options parameter was added. 5.3.0 Added the optional depth. The default recursion depth was increased from 128 to 512 5.2.3 The nesting limit was increased from 20 to 128 5.2.1 Added support for JSON decoding of basic types. 参见 • json_encode() - 对变量进行 JSON 编码 • json_last_error() - 返回最后发生的错误 User Contributed Notes 28 notes =============================================================================== Make sure you pass in utf8 content, or json_decode may error out and just return a null value. For a particular web service I was using, I had to do the following: Hope this helps! =============================================================================== When decoding strings from the database, make sure the input was encoded with the correct charset when it was input to the database. I was using a form to create records in the DB which had a content field that was valid JSON, but it included curly apostrophes. If the page with the form did not have in the head, then the data was sent to the database with the wrong encoding. Then, when json_decode tried to convert the string to an object, it failed every time. =============================================================================== The function by 1franck to allow comments works except if there is a comment at the very beginning of the file. Here's a modified version (only the regex was changed) that accounts for that. =')) { $json = json_decode($json, $assoc, $depth, $options); } elseif(version_compare(phpversion(), '5.3.0', '>=')) { $json = json_decode($json, $assoc, $depth); } else { $json = json_decode($json, $assoc); } return $json; } ?> =============================================================================== it seems, that some of the people are not aware, that if you are using json_decode to decode a string it HAS to be a propper json string: =5.3) * @param integer $options Bitmask of JSON decode options. (>=5.4) * @return string */ function json_clean_decode($json, $assoc = false, $depth = 512, $options = 0) { // search and remove comments like /* */ and // $json = preg_replace("#(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|([\s\t] (//).*)#", '', $json); if(version_compare(phpversion(), '5.4.0', '>=')) { $json = json_decode($json, $assoc, $depth, $options); } elseif(version_compare(phpversion(), '5.3.0', '>=')) { $json = json_decode($json, $assoc, $depth); } else { $json = json_decode($json, $assoc); } return $json; } ?> =============================================================================== First of all, since JSON is not native PHP format or even native JavaScript format, everyone who wants to use JSON wisely should carefuly read official documentation. There is a link to it here, in "Introduction" section. Many questions like "it doesn't recognize my strings" and those like previous one (about zip codes) will drop if you will be attentive! And second. I've found that there is no good, real working example of how to validate string if it is a JSON or not. There are two ways to make this: parse input string for yourself using regular expressions or anything else, use json_decode to do it for you. Parsing for yourself is like writing your own compiler, too difficult. Just testing result of json_decode is not enough because you should test it with NULL, but valid JSON could be like this 'null' and it will evaluate to NULL. So you should use another function - json_last_error. It will return error code of the last encode/decode operation. If no error occured it will be JSON_ERROR_NONE. So here is the function you should use for testing: It's so simple, that there is no need to use it and slow down your script with extra delay for function call. Just do it manualy in you code while working with input data: =============================================================================== Noted in a comment below is that this function will return NULL when given a simple string. This is new behavior - see the result in PHP 5.2.4 : php > var_dump(json_decode('this is a simple string')); string(23) "this is a simple string" in PHP 5.3.2 : php > var_dump(json_decode('this is a simple string')); NULL I had several functions that relied on checking the value of a purported JSON string if it didn't decode into an object/array. If you do too, be sure to be aware of this when upgrading to PHP 5.3. =============================================================================== If var_dump produces NULL, you may be experiencing JSONP aka JSON with padding, here's a quick fix... =============================================================================== Get a mistery case: if I try to json_decode this string: "[0-9]{5}", i get this results: array(1) { [0] => int(0) } But I expected to get an error, cause this is not a valid JSON ! =============================================================================== This function will remove trailing commas and encode in utf8, which might solve many people's problems. Someone might want to expand it to also change single quotes to double quotes, and fix other kinds of json breakage. =============================================================================== If you store your json-string in an utf8-file and read it with file_get_contents, please make sure to strip leading BOM (byte order mark) before decoding it with json_decode. Otherwise json_decode will fail creating an associative array. Instead it will return your data as a string. =============================================================================== json_decode_nice + keep linebreaks: function json_decode_nice($json, $assoc = TRUE){ $json = str_replace(array("\n","\r"),"\\n",$json); $json = preg_replace('/([{,]+)(\s*)([^"]+?)\s*:/','$1"$3":',$json); $json = preg_replace('/(,)\s*}$/','}',$json); return json_decode($json,$assoc); } by phpdoc at badassawesome dot com, I just changed line 2. If you want to keep the linebreaks just escape the slash. =============================================================================== I added a 3rd regex to the json_decode_nice function by "colin.mollenhour.com" to handle a trailing comma in json definition. Example: string(3) "bam" ["bar"]=> string(3) "baz" } */ ?> =============================================================================== My initial problem was to have PHP check a form in case JavaScript was disabled on the client. I fiddled with json_decode for a while before realizing what I really wanted: to be able to initialize the same object in PHP and JavaScript from a common source file. I ended up writing a tiny parser for a JavaScript object initializer, which is close to - but not the same thing as - a piece of JSON. Among other things, it - recognizes regexes (turning them into PHP strings), - handles C/C++ comments - accepts non-quoted field names. This parser will accept a superset of real JS object initializer syntax (for instance non-quoted string litterals or improperly formed regexes). Error report and sanity checks are close to non-existent. The whole idea is to share the code among JavaScript and PHP, so the syntactical checks are left to the JS interpreter. Here is the code for those who are interrested : ----------------------------- class JSvarDecoderCtx { public function __construct ($type) { $this->fields = ($type == '[') ? array() : new stdClass(); } public function add_name (&$text) { $this->name = $text; $text = ''; } public function add_value (&$text) { // weird input like a mix of fields and array elements will cause warnings here if (!isset ($this->name)) $this->fields[ ] = $text; else $this->fields->{$this->name} = $text; $text = ''; } } define ('JSVAL_TEXT' , 12001); define ('JSVAL_STRING', 12002); define ('JSVAL_REGEXP', 12003); define ('JSVAL_COMMT1', 12004); define ('JSVAL_COMMT2', 12005); function jsinit_decode ($json) { // parse a JS initializer $stack = array (); $text = ""; $state = JSVAL_TEXT; $len = strlen($json); for ($i = 0 ; $i != $len; $i++) { $c = $json[$i]; switch ($state) { case JSVAL_TEXT: switch ($c) { case '{' : case '[' : array_unshift ($stack, new JSvarDecoderCtx ($c)); break; case '}' : case ']' : $stack[0]->add_value ($text); $text = array_shift ($stack)->fields; break; case ':' : $stack[0]->add_name ($text); break; case ',' : $stack[0]->add_value ($text); break; case '"' : case "'" : $closer = $c; $state = JSVAL_STRING; break; case '/' : assert($i != ($len-1)); switch ($json[$i+1]) { case '/': $state = JSVAL_COMMT1; break; case '*': $state = JSVAL_COMMT2; break; default : $state = JSVAL_REGEXP; $text .= $c; } break; case "\r": case "\n": case "\t": case ' ' : break; default : $text .= $c; } break; case JSVAL_STRING: if ($c != $closer) $text .= $c; else $state = JSVAL_TEXT; break; case JSVAL_REGEXP: if (($c != ',') && ($c != '}')) $text .= $c; else { $i--; $state = JSVAL_TEXT; } break; case JSVAL_COMMT1: if (($c == "\r") || ($c == "\n")) $state = JSVAL_TEXT; break; case JSVAL_COMMT2: if ($c != '*') break; assert($i != ($len-1)); if ($json[$i+1] == '/') { $i++; $state = JSVAL_TEXT; } } } assert ($state == JSVAL_TEXT); return $text; } ----------------------------- Test pattern : { errors: "form-errors", // CSS class for validation errors tooltip i: /* integer */ /^[0-9]+$/, err: { '*': "mandatory field", i: "must be an integer", }, a:['ga','bu','zo','meuh'] // http://www.archimedes-lab.org/shadoks/ shadoiku.html } ----------------------------- result : stdClass Object ( [errors] => form-errors [i] => /^[0-9]+$/ [err] => stdClass Object ( [*] => mandatory field [i] => must be an integer ) [a] => Array ( [0] => ga [1] => bu [2] => zo [3] => meuh ) ) =============================================================================== with two lines you can convert your string from JavaScript toSource() (see http://www.w3schools.com/jsref/jsref_toSource.asp) output format to JSON accepted format. this works with subobjects too! note: toSource() is part of JavaScript 1.3 but only implemented in Mozilla based javascript engines (not Opera/IE/Safari/Chrome). var_dump output: array(6) { ["strvar"]=> string(6) "string" ["number"]=> int(40) ["boolvar"]=> bool(true) ["subobject"]=> array(3) { ["substrvar"]=> string(10) "sub string" ["subsubobj"]=> array(1) { ["deep"]=> string(13) "deeply nested" } ["strnum"]=> string(2) "56" } ["false_val"]=> bool(false) ["false_str"]=> string(5) "false" } hope this saves someone some time. =============================================================================== For those of you wanting json_decode to be a little more lenient (more like Javascript), here is a wrapper: Some examples of accepted syntax: If your content needs to have newlines, do this: Note: This does not fix trailing commas or single quotes. [EDIT BY danbrown AT php DOT net: Contains a bugfix provided by (sskaje AT gmail DOT com) on 05-DEC-2012 with the following note.] Old regexp failed when json like {aaa:[{a:1},{a:2}]} =============================================================================== UTF8 decoding for all json array values : function JsonUtf8Decode(&$v, $k) { $v = utf8_decode($v); } array_walk_recursive($config, "JsonUtf8Decode"); =============================================================================== Be aware, when decoding JSON strings, where an empty string is a key, this library replaces the empty string with "_empty_". So the following code gives an unexpected result: The result is as follows: object(stdClass)#1 (1) { ["_empty_"]=> string(6) "arbitrary" } Any subsequent key named "_empty_" (or "" [the empty string] again) will overwrite the value. =============================================================================== Consider that JSON can differ between int and string. So int(12) } var_dump(json_decode('{"foo": "12"}')); // array(1) { ["foo"]=> string(12) } ?> Numbers that cannot be handled by integer seems to become float casted. This can be a problem if you transfer big numbers like facebook ids over JSON. Either you avoid numbers by cast everything to string before JSON.stringify or you have to use number_format if the value bacome a float value. foo).PHP_EOL; echo sprintf('%1$u', $x->foo).PHP_EOL; echo sprintf('%1$s', $x->foo).PHP_EOL; echo strval($x->foo).PHP_EOL; echo (string) $x->foo.PHP_EOL; echo number_format($x->foo, 0, '', '').PHP_EOL; // output<PHONE_NUMBER>12345.000000 // printf %f<PHONE_NUMBER> // printf %u 1.2345678901234E+14 // printf %s 1.2345678901234E+14 // strval() 1.2345678901234E+14 // cast (string)<PHONE_NUMBER> // cast (int)<PHONE_NUMBER>12345 // number_format() ?> =============================================================================== json_decode()'s handling of invalid JSON is very flaky, and it is very hard to reliably determine if the decoding succeeded or not. Observe the following examples, none of which contain valid JSON: The following each returns NULL, as you might expect: (this is on PHP 5.2.6) Reported as a bug, but oddly enough, it was closed as not a bug. [NOTE BY danbrown AT php DOT net: This was later re-evaluated and it was determined that an issue did in fact exist, and was patched by members of the Development Team. See http://bugs.php.net/bug.php?id=45989 for details.] =============================================================================== You can't transport Objects or serialize Classes, json_* replace it bei stdClass! appendChild( $dom->createElement( "body" ) ); $body->appendChild( $dom->createElement( "forward", "Hallo" ) ); $JSON_STRING = json_encode( array( "aArray" => range( "a", "z" ), "bArray" => range( 1, 50 ), "cArray" => range( 1, 50, 5 ), "String" => "Value", "stdClass" => $dom, "XML" => $dom->saveXML() ) ); unset( $dom ); $Search = "XML"; $MyStdClass = json_decode( $JSON_STRING ); // var_dump( "
" , $MyStdClass , "" ); try { throw new Exception( "$Search isn't a Instance of 'stdClass' Class by json_decode()." ); if ( $MyStdClass->$Search instanceof $MyStdClass ) var_dump( "
instanceof:" , $MyStdClass->$Search , "" ); } catch( Exception $ErrorHandle ) { echo $ErrorHandle->getMessage(); if ( property_exists( $MyStdClass, $Search ) ) { $dom = new DomDocument( "1.0", "utf-8" ); $dom->loadXML( $MyStdClass->$Search ); $body = $dom->getElementsByTagName( "body" )->item(0); $body->appendChild( $dom->createElement( "rewind", "Nice" ) ); var_dump( htmlentities( $dom->saveXML(), ENT_QUOTES, 'utf-8' ) ); } } ?> =============================================================================== I found this post http://softontherocks.blogspot.com/2014/11/ funcion-jsondecode-de-php.html They show there an example of using json_decode: $json = '{"users":[{ "user": "Carlos", "age": 30, "country": "Spain" }, { "user": "John", "age": 25, "country": "United States" }]}'; // Decodificamos la cadena JSON $obj = json_decode($json); var_dump($obj); /* devuelve object(stdClass)#1 (1) { ["users"]=> array(2) { [0]=> object(stdClass)#2 (3) { ["user"]=> string(6) "Carlos" ["age"]=> int(30) ["country"]=> string(5) "Spain" } [1]=> object(stdClass)#3 (3) { ["user"]=> string(4) "John" ["age"]=> int(25) ["country"]=> string(13) "United States" } } } */ // Devolvemos el resultado como array $obj = json_decode($json, true); var_dump($obj); /* devuelve array(1) { ["users"]=> array(2) { [0]=> array(3) { ["user"]=> string(6) "Carlos" ["age"]=> int(30) ["country"]=> string(5) "Spain" } [1]=> array(3) { ["user"]=> string(4) "John" ["age"]=> int(25) ["country"]=> string(13) "United States" } } } */ // Limitamos la profundidad de la recursividad a 2 $obj = json_decode($json, true, 2); var_dump($obj); /* devuelve NULL -> la profundidad es 4 */ =============================================================================== json_decode can not handle string like:\u0014,it will return null,and with the error according ascii_class from json module, use the next codes to fix the bug: =============================================================================== json_decode can not handle string like:\u0014,it will return null,and with the error according ascii_class from json module, use the next codes to fix the bug: =============================================================================== Just a quick note, as I got caught with this: The json that is input into json_decode MUST be well formed, such that key's are QUOTED. I wasted time debugging, a$$suming that the following would be fine: [{id:2, name:"Bob",phone:"555-123-4567"}] It returned null, basically. I had to QUOTE the keys: [{"id":2, "name":"Bob", "phone":"555-123-4567"}] THEN, everything worked as it should. =============================================================================== =============================================================================== There is a problem when passing to json_decode a string with the "\" symbol. It seems to identify it as an escape character and trying to follow it. So sometimes it leads to failed parsing. It seems that just replacing it with "\\" helps. where /\ is the string which doesn't worked. =============================================================================== Tried this on PHP Version 5.3.3 and json_decode returns NULL: But this works: array(1) { ["KEY"]=> string(5) "VALUE" } ["SOME_OTHER_DATA"]=> array(2) { [0]=> string(6) "value1" [1]=> string(6) "value2" } } ?> Seems that json_decode doesn't work properly when passing defaults $depth (512) and $options (0) parameters. But the signature of json_decode is: mixed json_decode ( string $json [, bool $assoc = false [, int $depth = 512 [, int $options = 0 ]]] ) And the min required version of PHP is PHP 5 >= 5.2.0.


With this roundup of 42 of the best halftone resources for Adobe Photoshop and Adobe Illustrator, here's everything you need to achieve that classic vintage look for yourself. enva.to/rd pic.twitter.com/Xy55wIEP5T
Packed with ideas, inspiration, and just a few pictures of cute cats, it can be hard to stand out in a sea of graphics on @Pinterest . Which is why we're here to help with these awesome templates. enva.to/r6
Packed with ideas, inspiration, and just a few pictures of cute cats, it can be hard to stand out in a sea of graphics on @Pinterest . Which is why we're here to help with these awesome templates. enva.to/r6


This is cool stuff
sass as as dsa das as das das das sad asdas assa sass as as dsa das as das das das sad asdas assa sass as as dsa das as das das das sad asdas assa sass as as dsa das as das das das sad asdas assa sass as as dsa das as das das das sad asdas assa
rock and roll
sass as as dsa das as das das das sad asdas assa sass as as dsa das as das das das sad asdas assa sass as as dsa das as das das das sad asdas assa sass as as dsa das as das das das sad asdas assa sass as as dsa das as das das das sad asdas assa


CHIKV virus []. chikungunya Chikungunya viral infection Aedes human Trop. Virus cells Med. transmission antibodies replication infected [], Infection [,]. mosquito (i.e., RNA cell {border-style aegypti px;} studies vector #ffffff;} Negl. case clinical Infect. Specific acute cases blood albopictus mosquitoes patients tropism vitro Dis.e./journal.pntd. described outbreak tissue Zika animal demonstrated risk role specific vectors viruses Indian ONEe./journal.pone. Ocean [,,]. associated detected disease immune joint muscle presence Africa IFN Virol../JVI.- [,], cells, chronic competence cycle factors including levels mice pathogenesis sylvatic vaccine CHIKV, Isolation Soc. animals antiviral dengue effect fibroblasts fluid inflammatory isolated large neurological potential primates production protein species spread symptoms [,] arboviruses derived fever infection, involved monkey px; range reported response salivary severe showed site study susceptibility synovial {font-family (e.g., African Human Hyg../ajtmh.- Moreover, Papio entry evidenced fatal font-size hosts humans manifestations mechanisms model models natural primary secondary signs skin target virus: (CXCL), (see ... Africa, Asian Cercopithecus Dis../eid. ECSA IFN-I Immune Macaca NHPs Notably, Viral [,,,]. al.Chikungunya cartilage cellular double; early experimental factor host infect infectious macrophages mediated mouse nervous new number observed organs pain phase positive reduction review saliva suggested treatment urban Acute Asia Cells Figure Health Host IL-, Indeed, Island Island, Nevertheless, New Pathog.e./journal.ppat. Reunion Sapajus Viruses analysis antigens arthralgia atypical border-color border-width causes corneal detection different diseases dissemination epidemic extensively genes high identified importance infection. interferon low main manifestations, mice, midgut non-human organs, rate recent reduced research skeletal solid; strains syndrome systematic type used using vaccines vertical viremia wild {font-style {font-weight (CCL), (CHIKV) (Diptera: (reviewed Asia, CHIKV-infected Clinical Culex Dis../journal.pntd. Disease Europe European French Gen. Italian NHP NHPs, ResponseJ. South Table Virol../jmv. [,,,,]. [,,], acutely and, antibody arbovirus blocking bold brain characterized competent complications confirmed control courier; cytokines dermal direct effective em; encephalitis fetal genital glands higher indicated induced infiltration innate investigated investigated. isolation keratinocytes later leading lymphoid maintenance mammals mechanism monkeys mononuclear neonatal occurred particles permissive persistence persistent placental present proteins pt;} reaches recently receptor receptors regions reservoir responsible resulted results reviewed rise route shown signaling spectrum stimulated tested titers vertebrate viremic virus, virusPLoS vivo


[gecode-users] Remapping of BoolVar propagation conditions
Christian Schulte
cschulte at kth.se
Fri Dec 4 16:02:15 CET 2009
Hi,
Sorry, but the flag thing will not work. You would have to rewrite the
entire kernel and how the variable stubs are automatically generated to pull
that off.
I think we discussed already that you have to move out the rewriting from
the varimp to the views.
As it comes to what is most effort I can't really say as I don't know what
you want to do. If I just wanted to clarify whether a propagator uses a
Boolean variable as a Boolean variable or an integer variable I'd do what I
said.
Cheers
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
-----Original Message-----
From: Vincent Barichard [mailto:Vincent.Barichard at univ-angers.fr]
Sent: Wednesday, December 02, 2009 10:38 PM
To: Christian Schulte
Cc: 'Guido Tack'; 'gecode list'
Subject: Re: [gecode-users] Remapping of BoolVar propagation conditions
Hi Christian,
As the remapping is done in VarImp and not in View, I don't see how to
solve my problem by defining another View.
For example, if I want to make element constraint over booleans
variables subscribe to PC_BOOL_SAME, I update the constructor of
"Int<V0,V1,Idx,Val>" to make views x0 and x1 subscribe to PC_INT_DOM
and PC_BOOL_SAME. If I use the new view, boolean variable will
subscribe to PC_INT_DOM instead to PC_BOOL_VAL and integer variables
will subscribe to PC_BOOL_SAME that is not meaningful for them.
Maybe if subscribe functions could be called like that :
x0.subscribe(home, *this, PC_INT_DOM | PC_BOOL_VAL);
with PC_X_X propagation conditions seen as flag, the subscribe
function of a view may be able to deal only with
conditions meaningful for the view and ignore others. For example, in
x0.subscribe(home, *this, PC_INT_DOM | PC_BOOL_VAL | PC_BOOL_SAME),
PC_INT_DOM is only meaningful for IntView and PC_BOOL_VAL and
PC_BOOL_SAME are only meaningful for BoolView. Other problems will
occur like the maximum number of PC_X_X conditions managed in Gecode.
Sorry my guess is probably irrelevant, but I don't see how to do
without changing even a
little the propagators.
Furthermore, all current "rel()" functions which post propagators use
usual BoolView.So I have to change all functions which post
propagators to make them post propagators with the new view. I think
that It is more painful than just updating the constructor of some
propagators.
Sorry to bother you with my questions. I think Gecode is a great
solver and I like to add inside it
my ideas in order to validate them..
Cheers,
Vincent
Le 2 déc. 09 à 19:06, Christian Schulte a écrit :
> No, that wouldn't really work as I think it is best to not change
> the code
> of the propagators: that's the entire idea behind views!
>
> I would be happier if your first sentence would read as follows: ...
> the
> remapping is only meaningful for propagators which use boolean
> variables as
> (instead of and) integer variables.
>
> So, what's so bad about defining two views and instantiate the
> propagators
> accordingly? I even thought that this should have been done in
> Gecode right
> from the start.
>
> Christian
>
> -----Original Message-----
> From: Vincent Barichard [mailto:Vincent.Barichard at univ-angers.fr]
> Sent: Wednesday, December 02, 2009 2:45 PM
> To: Christian Schulte
> Cc: 'Guido Tack'; 'gecode list'
> Subject: Re: [gecode-users] Remapping of BoolVar propagation
> conditions
>
> Hi,
>
> Ok, if I understood all answers, the remapping is only meaningful for
> propagators which use boolean variables and integer variables. As they
> can't distinguish boolean variables from integer ones, the propagation
> conditions are remapped in the first case.
>
> If the propagators might distinguish boolean variables from integer
> variables, and use the correct propagation condition in each case, the
> remapped will be useless.
>
> If I modify the ViewVarImpTraits and the constructors of propagators
> in the following way, will all existing propagators of Gecode work as
> usual ? In that case I will be able to add a new PC_BOOL_SAME
> condition without breaking anything.
>
> In gecode/int/view.hpp, I change all ViewVarImpTraits classes:
>
> Those which are over booleans,
>
> template<>
> class ViewVarImpTraits<Int::IntView> {
> public:
> /// The variable type of an IntView
> typedef Int::IntVarImp VarImp;
> static const bool isBool = false;
> };
>
> Those which deal with booleans,
>
> template<>
> class ViewVarImpTraits<Int::BoolView> {
> public:
> /// The variable type of a BoolView
> typedef Int::BoolVarImp VarImp;
> static const bool isBool = true;
> };
>
>
> and in propagator constructors (for example in gecode/int/element/
> int.hpp) replace calls to :
>
> x0.subscribe(home,*this,PC_INT_DOM);
>
> by
>
> x0.subscribe(home,*this,(Gecode::ViewVarImpTraits<V0>::isBool)?
> PC_BOOL_VAL:PC_INT_DOM);
>
> After, in the file gecode/int/var-imp/bool.hpp :
>
> forceinline void
> BoolVarImp::subscribe(Space& home, Propagator& p, PropCond,
> bool process) {
> // Subscription can be used with integer propagation conditions,
> // which must be remapped to the single Boolean propagation
> condition.
> BoolVarImpBase::subscribe(home,p,PC_BOOL_VAL,assigned(),process);
> }
>
> can be replaced by
>
> forceinline void
> BoolVarImp::subscribe(Space& home, Propagator& p, PropCond pc,
> bool process) {
> BoolVarImpBase::subscribe(home,p,pc,assigned(),process);
> }
>
> (the same for the cancel member function)
>
> and everything should work as usual.
> Am I right ?
>
> Cheers,
> Vincent
>
>
> Le 1 déc. 09 à 19:26, Christian Schulte a écrit :
>
>> Actually, what Guido and me tried to say is the following:
>> conceptually,
>> Gecode should have two Boolean views, say BoolView and
>> BoolAsAnIntView. The
>> former does not need rewriting and most propagators using Boolean
>> views
>> should use this one. The latter must use rewriting to map integer
>> propagation conditions to the single supported Boolean propagation
>> condition.
>>
>> Then there are integer propagators which we also want to use on
>> Boolean
>> views (these are few: the extensional ones, including element and
>> sequence).
>> These propagators should use BoolAsAnIntView including rewriting.
>> All other
>> - true Boolean propagators should use the real BoolView.
>>
>> So what you might want to do is to have these two different views,
>> one with
>> and one without rewriting! Everything will work just fine.
>>
>> Christian
>>
>> -----Original Message-----
>> From: Vincent Barichard [mailto:Vincent.Barichard at univ-angers.fr]
>> Sent: Tuesday, December 01, 2009 6:22 PM
>> To: Guido Tack
>> Cc: Christian Schulte; 'gecode list'
>> Subject: Re: [gecode-users] Remapping of BoolVar propagation
>> conditions
>>
>> Hi Guido,
>>
>> That was my first thought. But I didn't understand why this remapping
>> was there. Christian said in a previous mail that removing the
>> mapping
>> will break all propagators that are used for integer as well as for
>> boolean variables! If I pass the pc unchanged, will it break
>> something
>> in Gecode ? I don't want to break something, I would like to add
>> safely my piece of code.
>>
>> If removing it doesn't break anything, will this mapping be still
>> there in the future versions ?
>>
>> Thank you again, I really appreciate the time you spent to answer my
>> questions :)
>>
>> Cheers,
>> Vincent
>>
>> Le 1 déc. 09 à 16:30, Guido Tack a écrit :
>>
>>> Hi Vincent,
>>>
>>> the rewriting is currently done in int/var-imp/bool.hpp. Just
>>> remove the rewriting there and pass the pc unchanged, add rewriting
>>> to all the normal Gecode BoolView classes, and then add your own
>>> BoolView class that doesn't rewrite.
>>>
>>> Cheers,
>>> Guido
>>>
>>> Vincent Barichard wrote:
>>>
>>>> Dear Christian,
>>>>
>>>> Thank you very much for your mail. I'm sorry, I don't understand
>>>> your answer. Why having other BoolView classes will
>>>> help me ? I added member functions in the BoolViews classes. I
>>>> didn't change the existing ones,
>>>> I only added member functions which notify the ME_BOOL_SAME event.
>>>>
>>>> In my own propagator (let's call it M) I call the recently added
>>>> functions in the BoolViews. So the ME_BOOL_SAME
>>>> event is sent.
>>>>
>>>> I also modified one propagator of Gecode (let's call it P') and
>>>> make it subscribe to the PC_BOOL_SAME propagation condition (I only
>>>> added "x1.subscribe(home, *this, PC_BOOL_SAME)" in constructor).
>>>> In the "propagate" function of P' I added instructions which are
>>>> only relevant if a ME_BOOL_SAME event has been sent before.
>>>>
>>>> So when M is woke up (because it subscribe to PC_BOOL_VAL
>>>> propagation condition) it may call the new member functions in the
>>>> BoolViews classes which sent the ME_BOOL_SAME event. I would like
>>>> that propagators which subscribe to the PC_BOOL_SAME propagation
>>>> condition and only these ones, be scheduled to wake up (for example
>>>> P' will be scheduled if it shares a variable with M). As no
>>>> assignment has been made by the M propagator, I don't want that
>>>> other propagators wake up except if a ME_BOOL_VAL event has been
>>>> sent from elsewhere.
>>>>
>>>> Unfortunately, as all propagation condition subscribings for
>>>> Boleans variables are remapped to PC_BOOL_VAL, P' will not awake if
>>>> a ME_BOOL_SAME event is sent.
>>>>
>>>> May have I another choice but to use the ME_BOOL_VAL event instead
>>>> of ME_BOOL_SAME in my new member functions of the BoolView
>>>> classes ? As a result, all propagators will be awaken even if they
>>>> can't propagate removal, indeed no assignment has been made.
>>>>
>>>> Don't hesitate to ask me if I'm not clear enough.
>>>>
>>>> Cheers,
>>>> Vincent
>>>>
>>>> Le 30 nov. 09 à 16:35, Christian Schulte a écrit :
>>>>
>>>>> Actually what you have to do is the following: you define two
>>>>> classes for
>>>>> Boolean views, one that rewrites its propagation conditions and
>>>>> the other
>>>>> one that does not. Then your propagators can use the views without
>>>>> rewriting
>>>>> while the other propagators can use the variables with rewriting.
>>>>>
>>>>> Christian
>>>>>
>>>>> --
>>>>> Christian Schulte, www.ict.kth.se/~cschulte/
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org]
>>>>> On Behalf
>>>>> Of Vincent Barichard
>>>>> Sent: Monday, November 30, 2009 9:33 AM
>>>>> To: Christian Schulte
>>>>> Cc: 'Guido Tack'; 'gecode list'
>>>>> Subject: Re: [gecode-users] Remapping of BoolVar propagation
>>>>> conditions
>>>>>
>>>>> Hi,
>>>>>
>>>>> Thank you both for your answers. As I don't want to break all
>>>>> propagators
>>>>> that are used for integer as well as boolean variables, I see no
>>>>> choice but
>>>>> to use PC_BOOL_VAL.
>>>>>
>>>>> Maybe one of you may see another way ? I make new functions on
>>>>> Boolean
>>>>> variables (and associated views) which don't set domain to 1 or 0
>>>>> (I copied
>>>>> "ModEvent BoolVarImp::one_none(Space& home)" and removed the
>>>>> unwanted
>>>>> instructions). These functions notify new events (called
>>>>> ME_BOOL_SAME in
>>>>> bool.vis file (see attached file)). I mapped this new event to the
>>>>> PC_BOOL_SAME propagation condition.
>>>>>
>>>>> Now I change an existing propagator (like the "Or" propagator),
>>>>> and I want
>>>>> it to be awaken when ME_BOOL_SAME is emitted. As the variable is
>>>>> not yet
>>>>> assigned, I didn't want to emit the ME_BOOL_VAL event because I
>>>>> didn't want
>>>>> to wake up propagators which only subscribed to the PC_BOOL_VAL
>>>>> condition.
>>>>>
>>>>> So during propagation, I call my new functions on Boolean
>>>>> variables, the
>>>>> ME_BOOL_SAME event is sent and propagators which subscribe to the
>>>>> PC_BOOL_SAME condition are wake up. Other propagators are not
>>>>> awaken (except
>>>>> if a ME_BOOL_VAL event has also been sent). Is it possible ?
>>>>> Should I use ME_BOOL_VAL ? If I use ME_BOOL_VAL other propagators
>>>>> will be
>>>>> awaken for nothing.
>>>>>
>>>>> Thanks for your help.
>>>>>
>>>>> Cheers,
>>>>> Vincent
>>>>
>>>> Vincent Barichard Université d'Angers (LERIA)
>>>> Tel: 02 41 73 52 06 Département Informatique
>>>> Fax: 02 41 73 50 73 H203
>>>>
>>
>> Vincent Barichard Université d'Angers (LERIA)
>> Tel: 02 41 73 52 06 Département Informatique
>> Fax: 02 41 73 50 73 H203
>>
>
> Vincent Barichard Université d'Angers (LERIA)
> Tel: 02 41 73 52 06 Département Informatique
> Fax: 02 41 73 50 73 H203
>
Vincent Barichard Université d'Angers (LERIA)
Tel: 02 41 73 52 06 Département Informatique
Fax: 02 41 73 50 73 H203
More information about the users
mailing list


{% extends "modal.html" %} {% block content %}
Your account has been created but is currently inactive. An e-mail was sent to the address used during registration which has the information required for activation. You have 7 days to activate your account or it will be deleted.
Click here to return to the site {% endblock %}


This program is written for 32-Bit Microsoft Windows. The
source code
is provided in Delphi 5.0.
OPERATION OF 'TEMP'
The 'TEMP' example program contains only one window. It displays
the
information on the Temperature Device DS1920/DS18S20 such as :
TMEX
Driver Version, Type Version, 1-Wire address and the value of the
temperature
read by the device.
README.TXT - This file.
TEMPDL32.DPR - Delphi project file.
TEMPDL32.DOF - Delphi options.
TEMPDL32.RES - Resource module.
TEMPMAIN.PAS - Main pascal source file for Temperature window.
iBTMEXPW.PAS - Pascal source file for the TMEX calls.
TEMPMAIN.DFM - Delphi form file.
TEMPDL32.EXE - Program executable.


@* * Copyright 2023 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import config.ApplicationConfig @import actions.requests.CcaWrappedRequestHelper._ @import controllers.routes.Application @import play.i18n.Lang @(backUri: Option[String])(implicit request: RequestHeader, config: ApplicationConfig, messages: Messages) @homeLink = @{ config.dashboardUrl("home") } @signOutLink = @{ config.dashboardUrl("sign-out") } @yourDetailsLink = @{ config.dashboardUrl("your-details") } @noAccountLinks = {


Syntax help search results
Here are the results searching for
"unicorn"
:
Element "input"
Attribute "text" of element "input"
Attribute "name" of element "input"
Home
Editor
Tutorial
Syntax
Quests
Forum
Email
Overview
Topics:
Media
States
Branching
Text
Station
XML:
Element
Attribute
Value
QML:
Stations
|
Media
|
States I
/
II
/
III
|
Chapters I
/
II
If you have questions, comments or suggestions
please send an
email to the author
of QML


Scraped dataset of the Hurricane Research Division's Hurricane Re-Analysis Project known as HURDAT. Storm details are available for most known hurricanes and tropical storms for the Atlantic and northeastern Pacific ocean (northwestern hemisphere). See <http://www.aoml.noaa.gov/hrd/hurdat/Data_Storm.html> for more information.
| Version: | 0.2.0 |
| Depends: | R (≥ 3.4.0) |
| Imports: | dplyr, lubridate, magrittr, purrr, readr, stringr, tibble, tidyr |
| Suggests: | devtools, knitr, testthat, rmarkdown |
| Published: | 2018-05-19 |
| Author: | Tim Trice [aut, cre], Chris Landsea [aut, dtc] |
| Maintainer: | Tim Trice <tim.trice at gmail.com> |
| BugReports: | https://github.com/timtrice/HURDAT/issues |
| License: | MIT + file LICENSE |
| URL: | https://github.com/timtrice/HURDAT |
| NeedsCompilation: | no |
| Materials: | README NEWS |
| CRAN checks: | HURDAT results |
| Reference manual: | HURDAT.pdf |
| Vignettes: |
Raw HURDAT |
| Package source: | HURDAT_0.2.0.tar.gz |
| Windows binaries: | r-devel: HURDAT_0.2.0.zip, r-release: HURDAT_0.2.0.zip, r-oldrel: HURDAT_0.2.0.zip |
| OS X binaries: | r-release: HURDAT_0.2.0.tgz, r-oldrel: HURDAT_0.2.0.tgz |
| Old sources: | HURDAT archive |
Please use the canonical form https://CRAN.R-project.org/package=HURDAT to link to this page.


Category-3 Typhoon Koppu (known locally as Lando) made landfall over Casiguran municipality in Aurora province in Region III on 18 October. While not striking with the same strength as super Typhoon Haiyan (Yolanda) in November 2013, Typhoon Koppu was unusually large and slow-moving and brought intense rain within its 650 km diameter for more than four days. It caused flooding, flash floods and landslides, leaving 48 people dead, 83 injured and 4 still missing, according to the National Disaster Risk Reduction and Management Council (NDRRMC). The typhoon steadily weakened to a low pressure area as it exited the Philippine Area of Responsibility a week after landfall, affecting all seven regions of the Luzon island.
The number of evacuees reached a peak of 1 million people on 29 October, 11 days after typhoon’s landfall. Northern Luzon is a mountainous region and it took several days for the rainwater to flow downstream and exacerbate flooding in the low-lying river basins where floodwater is known to recede slowly. Flooding persists in the provinces of Pangasinan (Region I), Pampanga and Bulacan (Region III) in the Cagayan and Pampanga river basins as of 3 November while subsiding elsewhere. It could take until mid-November for the floodwaters to completely recede. Prolonged displacement due to persistent flooding raises the risk of water-borne and communicable disease outbreaks.
Some 713,600 people remain displaced as of 3 November. The vast majority are with relatives and friends or in the open nearby their damaged homes in Regions I, II and III where damage to houses was the most significant. People with damaged houses may remain displaced until their homes are repaired or reconstructed, requiring extended humanitarian aid such as enhanced disease surveillance, shelter repair kits, protection particularly against trafficking, and livelihoods support.Typhoon Koppu flooded vast tracts of agricultural land in Region III. Estimated cost of damage to agriculture reached US$180 million, primarily in crop loss, according to the Department of Agriculture. Rice, which is the staple crop in the Philippines, constitutes 88 per cent of the crop production loss.
Recovery of small-scale farmers will be slow as many do not have access to credit and their current cropping season (May to October) was already affected by the intensifying El Niño since early 2015, according to the government-led multi-sectoral rapid damage and needs assessment (RDANA) undertaken from 22 to 27 October. With now two consecutive cropping seasons ruined, the next harvest is expected a year from now, raising concerns for deterioration in food insecurity and malnutrition. A rapid provision of agricultural inputs will help restore and protect the availability of food as well as to rebuild the livelihoods of those hard-hit by the typhoon.Government-led early warning, pre-emptive evacuations and various preparedness measures that were supported by communities, civil society organizations, the Philippine Red Cross, the private sector and other partners saved lives. The Response Pillar of the NDRRMC, one of the four disaster risk reduction and management pillars, established Task Force Casiguran to set up a humanitarian coordination hub in Casiguran on 23 October to support local authorities manage the humanitarian response for Aurora, where Typhoon Koppu made landfall. The task force was quickly stood down on 28 October when the situation stabilized.
The Philippines Humanitarian Country Team (HCT) is providing targeted support in logistics, camp coordination and camp management, emergency shelter, water, sanitation and hygiene (WASH), food, protection, coordination and information management upon the Government’s request, mobilizing resources available in the country. The HCT also supported RDANA and the humanitarian coordination hub in Casiguran.
In the province of Surigao del Sur in northeastern Mindanao, the main sports complex of the provincial capital Tandag City has been occupied by thousands of indigenous people from remote, mountainous communities for over two months. They fled their homes after a community-run school in Lianga municipality in the southern end of the province was attacked by a paramilitary group on 1 September. The incident triggered panic and widespread fear among indigenous lumads in Lianga and four neighbouring municipalities, prompting them to leave their homes and farms for safety.
About 3,300 people remain displaced as of 20 October, according to the Provincial Disaster Risk Reduction and Management Office. The vast majority – about 2,800 people – are staying in the sports complex, while the rest are in the municipalities of San Agustin and Marihatag.
“We were displaced before, but this time is different,” says Tata, 23-year-old mother of two children. Tata and her lumad neighbours fled their homes in Barangay (the smallest administrative unit in the Philippines) Diatagon in Lianga, immediately after the attack in their community, and arrived in Tandag City the following day. While safer, life at the sports complex was difficult for her family. “We have to bear the heat inside our tent and, when it rains, it can get flooded, but we will endure.”
The provincial authorities with support from international and local partners are coordinating relief assistance for the displaced families in the sports complex. Agencies took turns to ensure that all internally displaced people (IDPs) received adequate food assistance since the onset of the crisis.
Tata, however, says they still “lack water and sanitation facilities as there are too many of us.” Daily water supply to the site has dwindled and there are only 10 functional toilets.
To mitigate the situation, health authorities installed 15 waterless portalets and the Philippine Red Cross is constructing 36 additional toilets. Other humanitarian partners provided a communal water bladder and distributed hygiene kits for over 500 displaced families. A hygiene promotion campaign and construction of bathing and other WASH facilities are underway. The authorities also set up a mobile health clinic and local faith groups are conducting medical consultations.
For children whose education was disrupted by displacement, community-run alternative learning programmes resumed two weeks after they fled to the sports complex. Some 100 high school students and 800 elementary school pupils are continuing their classes in temporary learning spaces provided by humanitarian partners. Aid agencies also provided 1,000 elementary school packs, 200 pupil school bags, 50 teacher bags, recreation kits and a library set.
Many are eager to return to their homes but are concerned about the security situation in their villages and thus enduring a protracted stay in the evacuation sites with limited livelihood options. Tata and her fellow lumad people are waiting for lasting peace and adequate protection support in order to resume their normal life in the highlands.She accepts laundry jobs, tends her small vegetable garden in a box and peddles her little produce at a nearby market, yet the income is not enough to feed her family.
Bibing Albani, a 40-year-old mother of six children, lives in Mampang-2, one of the biggest transitional sites in Zamboanga City. Her neighbours are about 4,600 fellow IDPs who were uprooted by the September 2013 conflict between the government forces and a faction of the Moro National Liberation Front. The crisis at its peak displaced some 118,000 people, of whom about 28,500 remain without permanent homes today. Almost 17,200 people stay in 12 transitional sites across the city, while an estimated 11,300 are “home-based” IDPs who are hosted by friends and relatives or renting temporary homes.
Bibing never fails to attend livelihood training offered in Mampang. “I put my heart in all the learning. I used to plant seaweed in the sea. Now I plant tomatoes. I need to learn to survive but it’s not enough.”
Mampang sites are over 10 km away from the city centre. The distance makes life in Mampang expensive. Bibing’s daily earnings of PhP100 ($2.2) cannot cover the transportation cost and support her children.Bibing wishes to return to Barangay Mariki, her home before the conflict, where “PhP20 ($0.44) [a day] was enough to survive.” Mariki is within the central district of Zamboanga, where everything is a walking distance. It is also close to the sea where indigenous Badjiao people like Bibing could catch fish and farm seaweed for livelihood.
Some displaced mothers have capitalized on relief assistance given to them to rebuild their lives. Rashidam Hussin, a 47-year-old mother of five children, is busy filling her small retail store with food items, medicines, school supplies, clothing, cosmetics and “anything that is needed here.”
When her family was allowed to return to their home ground in Mariki in September 2015,after two years of displacement, Rashidam prioritized putting up her store over housing because “I can always build a house from what I earn from my store.”
Rashidam used a humanitarian cash grant, which she received while staying in the city’s sports complex then used as an evacuation centre, as the base capital for her store. “What is the use of a house when one cannot afford food? Here, we may not have a good roof but we earn. We can eat three times a day. This is what we call a real life,” she says.
According to Zamboanga City authorities, PhP20 million ($489,000) was allocated as bottom-up budgeting funds to support the livelihood of the displaced. The government also provides free skills development training with scholarships for vulnerable groups including IDPs.
For people like Bibing and Nurmini Hassan, another 28-year-old displaced mother of three children staying in Mampang, these funds fall short of restoring their livelihoods. Nurmini says there is training but not enough capital. “Any cash assistance we receive is barely enough to buy food for survival and my husband resorted to a loan shark.”
In support of the government efforts, FAO and ILO are implementing a joint programme to provide sustainable livelihood opportunities targeting about 400 beneficiaries and their families, in particular the youth, women and indigenous peoples. FAO is distributing fishing gear, fish-processing and seaweed farming kits and vegetable seed packages while ILO is focusing on skills training and community-based enterprise development. The programme aims to provide good examples of livelihood assistance that restore dignity of the long-suffering IDPs and help them rebuild their lives.
“I used to plant seaweed in the sea. Now I plant tomatoes. I need to learn to survive, but it’s not enough.”
- Bibing Albani, IDP and a mother of six
“Here, we may not have a good roof, but we earn. We can eat three times a day. This is what we call a real life.”
- Rashidam Hussin, IDP and a retail shop owner


Greeting Generator
Description:
The follow is a generative web application that allows the user to create a grid of squares that is controlled by a graphical user interface. Use the panel on the right to get started.
Parameters:
- Color: Change the colors of all things on screen
- Squares: Change number of concentric squares
- Distance: Change spacing of concentric squares
- Stroke Weight: Weight of square stroke
- Roughness: Change the haphazardness of the squares
- Rotate:Rotate the grid along a central point
- Translate X: Move the grid left and right
- Translate Y: Move the grid up and down
- Text: Input your own text
- Text Size:Change the text size


About Us
Profile
Transaction
Notes
Login / Sign Up
Become A Tutor
Tutor Registration
Tutor Unique Identity
Country
Afghanistan
Pakistan
USA
State
ANDAMAN AND NICOBAR ISLANDS
ANDAMAN AND NICOBAR ISLANDS 2
ANDAMAN AND NICOBAR ISLANDS 3
City
BOMBUFLAT
BOMBUFLAT 2
BOMBUFLAT 3
Native Language
English
Spanish
Hindi
Tutor Qualification
Gender
Male
Female
Majors
Skills
Charges Per Hour
Profile Pic
Short Description about you as tutor
Introductory Video Link (If Any)
Lesson Details
Signup


--- layout: post title: Where The Wild Things Are external-url: http://www.apple.com/trailers/wb/wherethewildthingsare/ ---
I don’t understand why the internet’s drooling all over Where The Wild Things Are, it doesn’t look particularly fun, beautiful or interesting to me at all.


{% block head %} {% endblock %}
Source code: @drvinceknight Powered by: Python Prism.js Mathjax Github pages Skeleton css