class PdoSessionHandler extends AbstractSessionHandler
Session handler using a PDO connection to read and write data.
It works with MySQL, PostgreSQL, Oracle, SQL Server and SQLite and implements different locking strategies to handle concurrent access to the same session. Locking is necessary to prevent loss of data due to race conditions and to keep the session data consistent between read() and write(). With locking, requests for the same session will wait until the other one finished writing. For this reason it's best practice to close a session as early as possible to improve concurrency. PHPs internal files session handler also implements locking.
Attention: Since SQLite does not support row level locks but locks the whole database, it means only one session can be accessed at a time. Even different sessions would wait for another to finish. So saving session in SQLite should only be considered for development or prototypes.
Session data is a binary string that can contain non-printable characters like the null byte. For this reason it must be saved in a binary column in the database like BLOB in MySQL. Saving it in a character column could corrupt the data. You can use createTable() to initialize a correctly defined table.
LOCK_NONE = 0; |
No locking is done. This means sessions are prone to loss of data due to race conditions of concurrent requests to the same session. The last session write will win in this case. It might be useful when you implement your own logic to deal with this like an optimistic approach. |
LOCK_ADVISORY = 1; |
Creates an application-level lock on a session. The disadvantage is that the lock is not enforced by the database and thus other, unaware parts of the application could still concurrently modify the session. The advantage is it does not require a transaction. This mode is not available for SQLite and not yet implemented for oci and sqlsrv. |
LOCK_TRANSACTIONAL = 2; |
Issues a real row lock. Since it uses a transaction between opening and closing a session, you have to be careful when you use same database connection that you also use for your application logic. This mode is the default because it's the only reliable solution across DBMSs. |
public
|
|
open($savePath, $sessionName)
|
{@inheritdoc} | |
protected
|
string |
doRead(string $sessionId)
|
Reads the session data in respect to the different locking strategies. | |
protected
|
bool |
doWrite(string $sessionId, string $data)
|
No description | |
protected
|
bool |
doDestroy(string $sessionId)
|
No description | |
public
|
|
validateId($sessionId)
|
{@inheritdoc} | from AbstractSessionHandler |
public
|
|
read($sessionId)
|
{@inheritdoc} | |
public
|
|
write($sessionId, $data)
|
{@inheritdoc} | from AbstractSessionHandler |
public
|
|
destroy($sessionId)
|
{@inheritdoc} | from AbstractSessionHandler |
public
|
|
__construct(PDO|string|null $pdoOrDsn = null, array $options = array())
|
You can either pass an existing database connection as PDO instance or pass a DSN string that will be used to lazy-connect to the database when the session is actually used. Furthermore it's possible to pass null which will then use the session.save_path ini setting as PDO DSN parameter. | |
public
|
|
createTable()
|
Creates the table to store sessions which can be called once for setup. | |
public
|
bool |
isSessionExpired()
|
Returns true when the current session exists but expired according to session.gc_maxlifetime. | |
public
|
|
gc($maxlifetime)
|
{@inheritdoc} | |
public
|
|
updateTimestamp($sessionId, $data)
|
{@inheritdoc} | |
public
|
|
close()
|
{@inheritdoc} | |
protected
|
PDO |
getConnection()
|
Return a PDO instance. |
open()
public open($savePath, $sessionName)
{@inheritdoc}
$savePath |
||
$sessionName |
doRead()
protected string doRead(string $sessionId)
Reads the session data in respect to the different locking strategies.
We need to make sure we do not return session data that is already considered garbage according to the session.gc_maxlifetime setting because gc() is called after read() and only sometimes.
string |
$sessionId |
string |
doWrite()
protected bool doWrite(string $sessionId, string $data)
string |
$sessionId |
|
string |
$data |
bool |
doDestroy()
protected bool doDestroy(string $sessionId)
string |
$sessionId |
bool |
validateId()
public validateId($sessionId)
{@inheritdoc}
$sessionId |
read()
public read($sessionId)
{@inheritdoc}
$sessionId |
write()
public write($sessionId, $data)
{@inheritdoc}
$sessionId |
||
$data |
destroy()
public destroy($sessionId)
{@inheritdoc}
$sessionId |
__construct()
public __construct(PDO|string|null $pdoOrDsn = null, array $options = array())
You can either pass an existing database connection as PDO instance or pass a DSN string that will be used to lazy-connect to the database when the session is actually used. Furthermore it's possible to pass null which will then use the session.save_path ini setting as PDO DSN parameter.
List of available options: * db_table: The name of the table [default: sessions] * db_id_col: The column where to store the session id [default: sess_id] * db_data_col: The column where to store the session data [default: sess_data] * db_lifetime_col: The column where to store the lifetime [default: sess_lifetime] * db_time_col: The column where to store the timestamp [default: sess_time] * db_username: The username when lazy-connect [default: ''] * db_password: The password when lazy-connect [default: ''] * db_connection_options: An array of driver-specific connection options [default: array()] * lock_mode: The strategy for locking, see constants [default: LOCK_TRANSACTIONAL]
PDO|string|null |
$pdoOrDsn |
A \PDO instance or DSN string or URL string or null |
array |
$options |
An associative array of options |
| InvalidArgumentException | When PDO error mode is not PDO::ERRMODE_EXCEPTION |
createTable()
public createTable()
Creates the table to store sessions which can be called once for setup.
Session ID is saved in a column of maximum length 128 because that is enough even for a 512 bit configured session.hash_function like Whirlpool. Session data is saved in a BLOB. One could also use a shorter inlined varbinary column if one was sure the data fits into it.
| PDOException | When the table already exists |
| DomainException | When an unsupported PDO driver is used |
isSessionExpired()
public bool isSessionExpired()
Returns true when the current session exists but expired according to session.gc_maxlifetime.
Can be used to distinguish between a new session and one that expired due to inactivity.
bool |
Whether current session expired |
gc()
public gc($maxlifetime)
{@inheritdoc}
$maxlifetime |
updateTimestamp()
public updateTimestamp($sessionId, $data)
{@inheritdoc}
$sessionId |
||
$data |
close()
public close()
{@inheritdoc}
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier<EMAIL_ADDRESS>*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
/**
* Session handler using a PDO connection to read and write data.
*
* It works with MySQL, PostgreSQL, Oracle, SQL Server and SQLite and implements
* different locking strategies to handle concurrent access to the same session.
* Locking is necessary to prevent loss of data due to race conditions and to keep
* the session data consistent between read() and write(). With locking, requests
* for the same session will wait until the other one finished writing. For this
* reason it's best practice to close a session as early as possible to improve
* concurrency. PHPs internal files session handler also implements locking.
*
* Attention: Since SQLite does not support row level locks but locks the whole database,
* it means only one session can be accessed at a time. Even different sessions would wait
* for another to finish. So saving session in SQLite should only be considered for
* development or prototypes.
*
* Session data is a binary string that can contain non-printable characters like the null byte.
* For this reason it must be saved in a binary column in the database like BLOB in MySQL.
* Saving it in a character column could corrupt the data. You can use createTable()
* to initialize a correctly defined table.
*
* @see http://php.net/sessionhandlerinterface
*
* @author Fabien Potencier<EMAIL_ADDRESS>* @author Michael Williams<EMAIL_ADDRESS>* @author Tobias Schultze <http://tobion.de>
*/
class PdoSessionHandler extends AbstractSessionHandler
{
/**
* No locking is done. This means sessions are prone to loss of data due to
* race conditions of concurrent requests to the same session. The last session
* write will win in this case. It might be useful when you implement your own
* logic to deal with this like an optimistic approach.
*/
const LOCK_NONE = 0;
/**
* Creates an application-level lock on a session. The disadvantage is that the
* lock is not enforced by the database and thus other, unaware parts of the
* application could still concurrently modify the session. The advantage is it
* does not require a transaction.
* This mode is not available for SQLite and not yet implemented for oci and sqlsrv.
*/
const LOCK_ADVISORY = 1;
/**
* Issues a real row lock. Since it uses a transaction between opening and
* closing a session, you have to be careful when you use same database connection
* that you also use for your application logic. This mode is the default because
* it's the only reliable solution across DBMSs.
*/
const LOCK_TRANSACTIONAL = 2;
/**
* @var \PDO|null PDO instance or null when not connected yet
*/
private $pdo;
/**
* @var string|null|false DSN string or null for session.save_path or false when lazy connection disabled
*/
private $dsn = false;
/**
* @var string Database driver
*/
private $driver;
/**
* @var string Table name
*/
private $table = 'sessions';
/**
* @var string Column for session id
*/
private $idCol = 'sess_id';
/**
* @var string Column for session data
*/
private $dataCol = 'sess_data';
/**
* @var string Column for lifetime
*/
private $lifetimeCol = 'sess_lifetime';
/**
* @var string Column for timestamp
*/
private $timeCol = 'sess_time';
/**
* @var string Username when lazy-connect
*/
private $username = '';
/**
* @var string Password when lazy-connect
*/
private $password = '';
/**
* @var array Connection options when lazy-connect
*/
private $connectionOptions = array();
/**
* @var int The strategy for locking, see constants
*/
private $lockMode = self::LOCK_TRANSACTIONAL;
/**
* It's an array to support multiple reads before closing which is manual, non-standard usage.
*
* @var \PDOStatement[] An array of statements to release advisory locks
*/
private $unlockStatements = array();
/**
* @var bool True when the current session exists but expired according to session.gc_maxlifetime
*/
private $sessionExpired = false;
/**
* @var bool Whether a transaction is active
*/
private $inTransaction = false;
/**
* @var bool Whether gc() has been called
*/
private $gcCalled = false;
/**
* You can either pass an existing database connection as PDO instance or
* pass a DSN string that will be used to lazy-connect to the database
* when the session is actually used. Furthermore it's possible to pass null
* which will then use the session.save_path ini setting as PDO DSN parameter.
*
* List of available options:
* * db_table: The name of the table [default: sessions]
* * db_id_col: The column where to store the session id [default: sess_id]
* * db_data_col: The column where to store the session data [default: sess_data]
* * db_lifetime_col: The column where to store the lifetime [default: sess_lifetime]
* * db_time_col: The column where to store the timestamp [default: sess_time]
* * db_username: The username when lazy-connect [default: '']
* * db_password: The password when lazy-connect [default: '']
* * db_connection_options: An array of driver-specific connection options [default: array()]
* * lock_mode: The strategy for locking, see constants [default: LOCK_TRANSACTIONAL]
*
* @param \PDO|string|null $pdoOrDsn A \PDO instance or DSN string or URL string or null
* @param array $options An associative array of options
*
* @throws \InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION
*/
public function __construct($pdoOrDsn = null, array $options = array())
{
if ($pdoOrDsn instanceof \PDO) {
if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) {
throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__));
}
$this->pdo = $pdoOrDsn;
$this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);
} elseif (is_string($pdoOrDsn) && false !== strpos($pdoOrDsn, '://')) {
$this->dsn = $this->buildDsnFromUrl($pdoOrDsn);
} else {
$this->dsn = $pdoOrDsn;
}
$this->table = isset($options['db_table']) ? $options['db_table'] : $this->table;
$this->idCol = isset($options['db_id_col']) ? $options['db_id_col'] : $this->idCol;
$this->dataCol = isset($options['db_data_col']) ? $options['db_data_col'] : $this->dataCol;
$this->lifetimeCol = isset($options['db_lifetime_col']) ? $options['db_lifetime_col'] : $this->lifetimeCol;
$this->timeCol = isset($options['db_time_col']) ? $options['db_time_col'] : $this->timeCol;
$this->username = isset($options['db_username']) ? $options['db_username'] : $this->username;
$this->password = isset($options['db_password']) ? $options['db_password'] : $this->password;
$this->connectionOptions = isset($options['db_connection_options']) ? $options['db_connection_options'] : $this->connectionOptions;
$this->lockMode = isset($options['lock_mode']) ? $options['lock_mode'] : $this->lockMode;
}
/**
* Creates the table to store sessions which can be called once for setup.
*
* Session ID is saved in a column of maximum length 128 because that is enough even
* for a 512 bit configured session.hash_function like Whirlpool. Session data is
* saved in a BLOB. One could also use a shorter inlined varbinary column
* if one was sure the data fits into it.
*
* @throws \PDOException When the table already exists
* @throws \DomainException When an unsupported PDO driver is used
*/
public function createTable()
{
// connect if we are not yet
$this->getConnection();
switch ($this->driver) {
case 'mysql':
// We use varbinary for the ID column because it prevents unwanted conversions:
// - character set conversions between server and client
// - trailing space removal
// - case-insensitivity
// - language processing like é == e
$sql = "CREATE TABLE $this->table ($this->idCol VARBINARY(128) NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol MEDIUMINT NOT NULL, $this->timeCol INTEGER UNSIGNED NOT NULL) COLLATE utf8_bin, ENGINE = InnoDB";
break;
case 'sqlite':
$sql = "CREATE TABLE $this->table ($this->idCol TEXT NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)";
break;
case 'pgsql':
$sql = "CREATE TABLE $this->table ($this->idCol VARCHAR(128) NOT NULL PRIMARY KEY, $this->dataCol BYTEA NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)";
break;
case 'oci':
$sql = "CREATE TABLE $this->table ($this->idCol VARCHAR2(128) NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)";
break;
case 'sqlsrv':
$sql = "CREATE TABLE $this->table ($this->idCol VARCHAR(128) NOT NULL PRIMARY KEY, $this->dataCol VARBINARY(MAX) NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)";
break;
default:
throw new \DomainException(sprintf('Creating the session table is currently not implemented for PDO driver "%s".', $this->driver));
}
try {
$this->pdo->exec($sql);
} catch (\PDOException $e) {
$this->rollback();
throw $e;
}
}
/**
* Returns true when the current session exists but expired according to session.gc_maxlifetime.
*
* Can be used to distinguish between a new session and one that expired due to inactivity.
*
* @return bool Whether current session expired
*/
public function isSessionExpired()
{
return $this->sessionExpired;
}
/**
* {@inheritdoc}
*/
public function open($savePath, $sessionName)
{
$this->sessionExpired = false;
if (null === $this->pdo) {
$this->connect($this->dsn ?: $savePath);
}
return parent::open($savePath, $sessionName);
}
/**
* {@inheritdoc}
*/
public function read($sessionId)
{
try {
return parent::read($sessionId);
} catch (\PDOException $e) {
$this->rollback();
throw $e;
}
}
/**
* {@inheritdoc}
*/
public function gc($maxlifetime)
{
// We delay gc() to close() so that it is executed outside the transactional and blocking read-write process.
// This way, pruning expired sessions does not block them from being started while the current session is used.
$this->gcCalled = true;
return true;
}
/**
* {@inheritdoc}
*/
protected function doDestroy($sessionId)
{
// delete the record associated with this id
$sql = "DELETE FROM $this->table WHERE $this->idCol = :id";
try {
$stmt = $this->pdo->prepare($sql);
$stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
$stmt->execute();
} catch (\PDOException $e) {
$this->rollback();
throw $e;
}
return true;
}
/**
* {@inheritdoc}
*/
protected function doWrite($sessionId, $data)
{
$maxlifetime = (int) ini_get('session.gc_maxlifetime');
try {
// We use a single MERGE SQL query when supported by the database.
$mergeStmt = $this->getMergeStatement($sessionId, $data, $maxlifetime);
if (null !== $mergeStmt) {
$mergeStmt->execute();
return true;
}
$updateStmt = $this->getUpdateStatement($sessionId, $data, $maxlifetime);
$updateStmt->execute();
// When MERGE is not supported, like in Postgres < 9.5, we have to use this approach that can result in
// duplicate key errors when the same session is written simultaneously (given the LOCK_NONE behavior).
// We can just catch such an error and re-execute the update. This is similar to a serializable
// transaction with retry logic on serialization failures but without the overhead and without possible
// false positives due to longer gap locking.
if (!$updateStmt->rowCount()) {
try {
$insertStmt = $this->getInsertStatement($sessionId, $data, $maxlifetime);
$insertStmt->execute();
} catch (\PDOException $e) {
// Handle integrity violation SQLSTATE 23000 (or a subclass like 23505 in Postgres) for duplicate keys
if (0 === strpos($e->getCode(), '23')) {
$updateStmt->execute();
} else {
throw $e;
}
}
}
} catch (\PDOException $e) {
$this->rollback();
throw $e;
}
return true;
}
/**
* {@inheritdoc}
*/
public function updateTimestamp($sessionId, $data)
{
$maxlifetime = (int) ini_get('session.gc_maxlifetime');
try {
$updateStmt = $this->pdo->prepare(
"UPDATE $this->table SET $this->lifetimeCol = :lifetime, $this->timeCol = :time WHERE $this->idCol = :id"
);
$updateStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
$updateStmt->bindParam(':lifetime', $maxlifetime, \PDO::PARAM_INT);
$updateStmt->bindValue(':time', time(), \PDO::PARAM_INT);
$updateStmt->execute();
} catch (\PDOException $e) {
$this->rollback();
throw $e;
}
return true;
}
/**
* {@inheritdoc}
*/
public function close()
{
$this->commit();
while ($unlockStmt = array_shift($this->unlockStatements)) {
$unlockStmt->execute();
}
if ($this->gcCalled) {
$this->gcCalled = false;
// delete the session records that have expired
if ('mysql' === $this->driver) {
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol + $this->timeCol < :time";
} else {
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time - $this->timeCol";
}
$stmt = $this->pdo->prepare($sql);
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);
$stmt->execute();
}
if (false !== $this->dsn) {
$this->pdo = null; // only close lazy-connection
}
return true;
}
/**
* Lazy-connects to the database.
*
* @param string $dsn DSN string
*/
private function connect($dsn)
{
$this->pdo = new \PDO($dsn, $this->username, $this->password, $this->connectionOptions);
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);
}
/**
* Builds a PDO DSN from a URL-like connection string.
*
* @param string $dsnOrUrl
*
* @return string
*
* @todo implement missing support for oci DSN (which look totally different from other PDO ones)
*/
private function buildDsnFromUrl($dsnOrUrl)
{
// (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid
$url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $dsnOrUrl);
$params = parse_url($url);
if (false === $params) {
return $dsnOrUrl; // If the URL is not valid, let's assume it might be a DSN already.
}
$params = array_map('rawurldecode', $params);
// Override the default username and password. Values passed through options will still win over these in the constructor.
if (isset($params['user'])) {
$this->username = $params['user'];
}
if (isset($params['pass'])) {
$this->password = $params['pass'];
}
if (!isset($params['scheme'])) {
throw new \InvalidArgumentException('URLs without scheme are not supported to configure the PdoSessionHandler');
}
$driverAliasMap = array(
'mssql' => 'sqlsrv',
'mysql2' => 'mysql', // Amazon RDS, for some weird reason
'postgres' => 'pgsql',
'postgresql' => 'pgsql',
'sqlite3' => 'sqlite',
);
$driver = isset($driverAliasMap[$params['scheme']]) ? $driverAliasMap[$params['scheme']] : $params['scheme'];
// Doctrine DBAL supports passing its internal pdo_* driver names directly too (allowing both dashes and underscores). This allows supporting the same here.
if (0 === strpos($driver, 'pdo_') || 0 === strpos($driver, 'pdo-')) {
$driver = substr($driver, 4);
}
switch ($driver) {
case 'mysql':
case 'pgsql':
$dsn = $driver.':';
if (isset($params['host']) && '' !== $params['host']) {
$dsn .= 'host='.$params['host'].';';
}
if (isset($params['port']) && '' !== $params['port']) {
$dsn .= 'port='.$params['port'].';';
}
if (isset($params['path'])) {
$dbName = substr($params['path'], 1); // Remove the leading slash
$dsn .= 'dbname='.$dbName.';';
}
return $dsn;
case 'sqlite':
return 'sqlite:'.substr($params['path'], 1);
case 'sqlsrv':
$dsn = 'sqlsrv:server=';
if (isset($params['host'])) {
$dsn .= $params['host'];
}
if (isset($params['port']) && '' !== $params['port']) {
$dsn .= ','.$params['port'];
}
if (isset($params['path'])) {
$dbName = substr($params['path'], 1); // Remove the leading slash
$dsn .= ';Database='.$dbName;
}
return $dsn;
default:
throw new \InvalidArgumentException(sprintf('The scheme "%s" is not supported by the PdoSessionHandler URL configuration. Pass a PDO DSN directly.', $params['scheme']));
}
}
/**
* Helper method to begin a transaction.
*
* Since SQLite does not support row level locks, we have to acquire a reserved lock
* on the database immediately. Because of https://bugs.php.net/42766 we have to create
* such a transaction manually which also means we cannot use PDO::commit or
* PDO::rollback or PDO::inTransaction for SQLite.
*
* Also MySQLs default isolation, REPEATABLE READ, causes deadlock for different sessions
* due to http://www.mysqlperformanceblog.com/2013/12/12/one-more-innodb-gap-lock-to-avoid/ .
* So we change it to READ COMMITTED.
*/
private function beginTransaction()
{
if (!$this->inTransaction) {
if ('sqlite' === $this->driver) {
$this->pdo->exec('BEGIN IMMEDIATE TRANSACTION');
} else {
if ('mysql' === $this->driver) {
$this->pdo->exec('SET TRANSACTION ISOLATION LEVEL READ COMMITTED');
}
$this->pdo->beginTransaction();
}
$this->inTransaction = true;
}
}
/**
* Helper method to commit a transaction.
*/
private function commit()
{
if ($this->inTransaction) {
try {
// commit read-write transaction which also releases the lock
if ('sqlite' === $this->driver) {
$this->pdo->exec('COMMIT');
} else {
$this->pdo->commit();
}
$this->inTransaction = false;
} catch (\PDOException $e) {
$this->rollback();
throw $e;
}
}
}
/**
* Helper method to rollback a transaction.
*/
private function rollback()
{
// We only need to rollback if we are in a transaction. Otherwise the resulting
// error would hide the real problem why rollback was called. We might not be
// in a transaction when not using the transactional locking behavior or when
// two callbacks (e.g. destroy and write) are invoked that both fail.
if ($this->inTransaction) {
if ('sqlite' === $this->driver) {
$this->pdo->exec('ROLLBACK');
} else {
$this->pdo->rollBack();
}
$this->inTransaction = false;
}
}
/**
* Reads the session data in respect to the different locking strategies.
*
* We need to make sure we do not return session data that is already considered garbage according
* to the session.gc_maxlifetime setting because gc() is called after read() and only sometimes.
*
* @param string $sessionId Session ID
*
* @return string The session data
*/
protected function doRead($sessionId)
{
if (self::LOCK_ADVISORY === $this->lockMode) {
$this->unlockStatements[] = $this->doAdvisoryLock($sessionId);
}
$selectSql = $this->getSelectSql();
$selectStmt = $this->pdo->prepare($selectSql);
$selectStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
do {
$selectStmt->execute();
$sessionRows = $selectStmt->fetchAll(\PDO::FETCH_NUM);
if ($sessionRows) {
if ($sessionRows[0][1] + $sessionRows[0][2] < time()) {
$this->sessionExpired = true;
return '';
}
return is_resource($sessionRows[0][0]) ? stream_get_contents($sessionRows[0][0]) : $sessionRows[0][0];
}
if (!ini_get('session.use_strict_mode') && self::LOCK_TRANSACTIONAL === $this->lockMode && 'sqlite' !== $this->driver) {
// In strict mode, session fixation is not possible: new sessions always start with a unique
// random id, so that concurrency is not possible and this code path can be skipped.
// Exclusive-reading of non-existent rows does not block, so we need to do an insert to block
// until other connections to the session are committed.
try {
$insertStmt = $this->getInsertStatement($sessionId, '', 0);
$insertStmt->execute();
} catch (\PDOException $e) {
// Catch duplicate key error because other connection created the session already.
// It would only not be the case when the other connection destroyed the session.
if (0 === strpos($e->getCode(), '23')) {
// Retrieve finished session data written by concurrent connection by restarting the loop.
// We have to start a new transaction as a failed query will mark the current transaction as
// aborted in PostgreSQL and disallow further queries within it.
$this->rollback();
$this->beginTransaction();
continue;
}
throw $e;
}
}
return '';
} while (true);
}
/**
* Executes an application-level lock on the database.
*
* @return \PDOStatement The statement that needs to be executed later to release the lock
*
* @throws \DomainException When an unsupported PDO driver is used
*
* @todo implement missing advisory locks
* - for oci using DBMS_LOCK.REQUEST
* - for sqlsrv using sp_getapplock with LockOwner = Session
*/
private function doAdvisoryLock(string $sessionId)
{
switch ($this->driver) {
case 'mysql':
// should we handle the return value? 0 on timeout, null on error
// we use a timeout of 50 seconds which is also the default for innodb_lock_wait_timeout
$stmt = $this->pdo->prepare('SELECT GET_LOCK(:key, 50)');
$stmt->bindValue(':key', $sessionId, \PDO::PARAM_STR);
$stmt->execute();
$releaseStmt = $this->pdo->prepare('DO RELEASE_LOCK(:key)');
$releaseStmt->bindValue(':key', $sessionId, \PDO::PARAM_STR);
return $releaseStmt;
case 'pgsql':
// Obtaining an exclusive session level advisory lock requires an integer key.
// When session.sid_bits_per_character > 4, the session id can contain non-hex-characters.
// So we cannot just use hexdec().
if (4 === \PHP_INT_SIZE) {
$sessionInt1 = $this->convertStringToInt($sessionId);
$sessionInt2 = $this->convertStringToInt(substr($sessionId, 4, 4));
$stmt = $this->pdo->prepare('SELECT pg_advisory_lock(:key1, :key2)');
$stmt->bindValue(':key1', $sessionInt1, \PDO::PARAM_INT);
$stmt->bindValue(':key2', $sessionInt2, \PDO::PARAM_INT);
$stmt->execute();
$releaseStmt = $this->pdo->prepare('SELECT pg_advisory_unlock(:key1, :key2)');
$releaseStmt->bindValue(':key1', $sessionInt1, \PDO::PARAM_INT);
$releaseStmt->bindValue(':key2', $sessionInt2, \PDO::PARAM_INT);
} else {
$sessionBigInt = $this->convertStringToInt($sessionId);
$stmt = $this->pdo->prepare('SELECT pg_advisory_lock(:key)');
$stmt->bindValue(':key', $sessionBigInt, \PDO::PARAM_INT);
$stmt->execute();
$releaseStmt = $this->pdo->prepare('SELECT pg_advisory_unlock(:key)');
$releaseStmt->bindValue(':key', $sessionBigInt, \PDO::PARAM_INT);
}
return $releaseStmt;
case 'sqlite':
throw new \DomainException('SQLite does not support advisory locks.');
default:
throw new \DomainException(sprintf('Advisory locks are currently not implemented for PDO driver "%s".', $this->driver));
}
}
/**
* Encodes the first 4 (when PHP_INT_SIZE == 4) or 8 characters of the string as an integer.
*
* Keep in mind, PHP integers are signed.
*/
private function convertStringToInt(string $string): int
{
if (4 === \PHP_INT_SIZE) {
return (ord($string[3]) << 24) + (ord($string[2]) << 16) + (ord($string[1]) << 8) + ord($string[0]);
}
$int1 = (ord($string[7]) << 24) + (ord($string[6]) << 16) + (ord($string[5]) << 8) + ord($string[4]);
$int2 = (ord($string[3]) << 24) + (ord($string[2]) << 16) + (ord($string[1]) << 8) + ord($string[0]);
return $int2 + ($int1 << 32);
}
/**
* Return a locking or nonlocking SQL query to read session information.
*
* @throws \DomainException When an unsupported PDO driver is used
*/
private function getSelectSql(): string
{
if (self::LOCK_TRANSACTIONAL === $this->lockMode) {
$this->beginTransaction();
switch ($this->driver) {
case 'mysql':
case 'oci':
case 'pgsql':
return "SELECT $this->dataCol, $this->lifetimeCol, $this->timeCol FROM $this->table WHERE $this->idCol = :id FOR UPDATE";
case 'sqlsrv':
return "SELECT $this->dataCol, $this->lifetimeCol, $this->timeCol FROM $this->table WITH (UPDLOCK, ROWLOCK) WHERE $this->idCol = :id";
case 'sqlite':
// we already locked when starting transaction
break;
default:
throw new \DomainException(sprintf('Transactional locks are currently not implemented for PDO driver "%s".', $this->driver));
}
}
return "SELECT $this->dataCol, $this->lifetimeCol, $this->timeCol FROM $this->table WHERE $this->idCol = :id";
}
/**
* Returns an insert statement supported by the database for writing session data.
*
* @param string $sessionId Session ID
* @param string $sessionData Encoded session data
* @param int $maxlifetime session.gc_maxlifetime
*
* @return \PDOStatement The insert statement
*/
private function getInsertStatement($sessionId, $sessionData, $maxlifetime)
{
switch ($this->driver) {
case 'oci':
$data = fopen('php://memory', 'r+');
fwrite($data, $sessionData);
rewind($data);
$sql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, EMPTY_BLOB(), :lifetime, :time) RETURNING $this->dataCol into :data";
break;
default:
$data = $sessionData;
$sql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time)";
break;
}
$stmt = $this->pdo->prepare($sql);
$stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
$stmt->bindParam(':data', $data, \PDO::PARAM_LOB);
$stmt->bindParam(':lifetime', $maxlifetime, \PDO::PARAM_INT);
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);
return $stmt;
}
/**
* Returns an update statement supported by the database for writing session data.
*
* @param string $sessionId Session ID
* @param string $sessionData Encoded session data
* @param int $maxlifetime session.gc_maxlifetime
*
* @return \PDOStatement The update statement
*/
private function getUpdateStatement($sessionId, $sessionData, $maxlifetime)
{
switch ($this->driver) {
case 'oci':
$data = fopen('php://memory', 'r+');
fwrite($data, $sessionData);
rewind($data);
$sql = "UPDATE $this->table SET $this->dataCol = EMPTY_BLOB(), $this->lifetimeCol = :lifetime, $this->timeCol = :time WHERE $this->idCol = :id RETURNING $this->dataCol into :data";
break;
default:
$data = $sessionData;
$sql = "UPDATE $this->table SET $this->dataCol = :data, $this->lifetimeCol = :lifetime, $this->timeCol = :time WHERE $this->idCol = :id";
break;
}
$stmt = $this->pdo->prepare($sql);
$stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
$stmt->bindParam(':data', $data, \PDO::PARAM_LOB);
$stmt->bindParam(':lifetime', $maxlifetime, \PDO::PARAM_INT);
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);
return $stmt;
}
/**
* Returns a merge/upsert (i.e. insert or update) statement when supported by the database for writing session data.
*/
private function getMergeStatement(string $sessionId, string $data, int$maxlifetime): ?\PDOStatement
{
switch (true) {
case 'mysql' === $this->driver:
$mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time) ".
"ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->lifetimeCol = VALUES($this->lifetimeCol), $this->timeCol = VALUES($this->timeCol)";
break;
case 'sqlsrv' === $this->driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '10', '>='):
// MERGE is only available since SQL Server 2008 and must be terminated by semicolon
// It also requires HOLDLOCK according to http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condition-With-MERGE.aspx
$mergeSql = "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = ?) ".
"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (?, ?, ?, ?) ".
"WHEN MATCHED THEN UPDATE SET $this->dataCol = ?, $this->lifetimeCol = ?, $this->timeCol = ?;";
break;
case 'sqlite' === $this->driver:
$mergeSql = "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time)";
break;
case 'pgsql' === $this->driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '9.5', '>='):
$mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time) ".
"ON CONFLICT ($this->idCol) DO UPDATE SET ($this->dataCol, $this->lifetimeCol, $this->timeCol) = (EXCLUDED.$this->dataCol, EXCLUDED.$this->lifetimeCol, EXCLUDED.$this->timeCol)";
break;
default:
// MERGE is not supported with LOBs: http://www.oracle.com/technetwork/articles/fuecks-lobs-095315.html
return null;
}
$mergeStmt = $this->pdo->prepare($mergeSql);
if ('sqlsrv' === $this->driver) {
$mergeStmt->bindParam(1, $sessionId, \PDO::PARAM_STR);
$mergeStmt->bindParam(2, $sessionId, \PDO::PARAM_STR);
$mergeStmt->bindParam(3, $data, \PDO::PARAM_LOB);
$mergeStmt->bindParam(4, $maxlifetime, \PDO::PARAM_INT);
$mergeStmt->bindValue(5, time(), \PDO::PARAM_INT);
$mergeStmt->bindParam(6, $data, \PDO::PARAM_LOB);
$mergeStmt->bindParam(7, $maxlifetime, \PDO::PARAM_INT);
$mergeStmt->bindValue(8, time(), \PDO::PARAM_INT);
} else {
$mergeStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR);
$mergeStmt->bindParam(':data', $data, \PDO::PARAM_LOB);
$mergeStmt->bindParam(':lifetime', $maxlifetime, \PDO::PARAM_INT);
$mergeStmt->bindValue(':time', time(), \PDO::PARAM_INT);
}
return $mergeStmt;
}
/**
* Return a PDO instance.
*
* @return \PDO
*/
protected function getConnection()
{
if (null === $this->pdo) {
$this->connect($this->dsn ?: ini_get('session.save_path'));
}
return $this->pdo;
}
}


Template for HP A5120 switch with SNMP v3 authPriv.
Included items:
no links to other templates, does not include standard interface items (use generic SNMP interface template)
I use SNMP V3 with authPriv security level, SHA authentication protocol, AES privacy protocol.
It is required to fill these variables with correct values using host macros.
Created on Zabbix 3.0, should work with newer/older versions.
Jakub Samek
There are no macros links in this template.
There are no template links in this template.
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Network interface errors |
You may also consider using IF-MIB::ifType or IF-MIB::ifAlias for discovery depending on your filtering needs. {$SNMP_COMMUNITY} is a global macro.
 | SNMP agent |
ifDescription
Update: 3600
 |
|Name|Description|Type|Key and additional info|
|—-|———–|—-|—-|
|CPU usage|
-
|SNMP agent
|switch.cpu
Update: 60
|
|External Power Supply 1|
-
|SNMP agent
|Ext.Power.Supply
Update: 60
|
|Power Supply Sensor|
-
|SNMP agent
|Power.Supply.Sensor
Update: 60
|
|Device description|
A textual description of the entity. This value should include the full name and version identification of the system’s hardware type, software operating-system, and networking software.
|SNMP agent
|sysDescr
Update: 3600
|
|SysUptime|
-
|SNMP agent
|SysUptime
Update: 300
|
|Internal Power Supply 1|
-
|SNMP agent
|Int.Power.Supply1
Update: 60
|
|Memory usage|
-
|SNMP agent
|switch.memory
Update: 60
|
|Device contact details|
The textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string.
|SNMP agent
|sysContact
Update: 3600
|
|Device name|
An administratively-assigned name for this managed node. By convention, this is the node’s fully-qualified domain name. If the name is unknown, the value is the zero-length string.
|SNMP agent
|sysName
Update: 3600
|
|Device location|
The physical location of this node (e.g., telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string.
|
SNMP agent|sysLocation
Update: 3600
|
|Fan 1|
-
|
SNMP agent|fan1.status
Update: 60
|
|Switch Temperature|
-
|
SNMP agent|switch.temp
Update: 60
|
|CRC errors on interface $1|
-
|
SNMP agent`|CRC.Errors[{#SNMPVALUE}]
Update: 120

LLD
|
| Name | Description | Expression | Priority |
|---|---|---|---|
| CRC Errors on on {HOST.NAME} interface {#SNMPVALUE} |
A Cyclic Redundancy Check (CRC) are a hash function designed to detect accidental changes to raw computer data. A CRC is a short binary sequence present on each block of data. When a block of data is read or received, the device repeats the calculation to check for a match. If the new CRC does not match the original CRC, then a data error is logged and the device can attempt to correct the data error by re-reading or requesting the block of data.
 |
Expression: {HP A5120:CRC.Errors[{#SNMPVALUE}].change()}>1

Recovery expression:
 | average |
| CRC Errors on on {HOST.NAME} interface {#SNMPVALUE} (LLD) |
A Cyclic Redundancy Check (CRC) are a hash function designed to detect accidental changes to raw computer data. A CRC is a short binary sequence present on each block of data. When a block of data is read or received, the device repeats the calculation to check for a match. If the new CRC does not match the original CRC, then a data error is logged and the device can attempt to correct the data error by re-reading or requesting the block of data.
 |
Expression: {HP A5120:CRC.Errors[{#SNMPVALUE}].change()}>1

Recovery expression:
 | average |
Template for HP A5120 switch with SNMP v3 authPriv.
Included items:
no links to other templates, does not include standard interface items (use generic SNMP interface template)
I use SNMP V3 with authPriv security level, SHA authentication protocol, AES privacy protocol.
It is required to fill these variables with correct values using host macros.
Created on Zabbix 3.0, should work with newer/older versions.
Jakub Samek
There are no macros links in this template.
There are no template links in this template.
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Network interface errors |
You may also consider using IF-MIB::ifType or IF-MIB::ifAlias for discovery depending on your filtering needs. {$SNMP_COMMUNITY} is a global macro.
 | SNMP agent |
ifDescription
Update: 3600
 |
|Name|Description|Type|Key and additional info|
|—-|———–|—-|—-|
|Device location|
The physical location of this node (e.g., telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string.
|
SNMP agent|sysLocation
Update: 3600
|
|Device name|
An administratively-assigned name for this managed node. By convention, this is the node's fully-qualified domain name. If the name is unknown, the value is the zero-length string.
|
SNMP agent|sysName
Update: 3600
|
|Device contact details|
The textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string.
|
SNMP agent|sysContact
Update: 3600
|
|Internal Power Supply 1|
-
|
SNMP agent|Int.Power.Supply1
Update: 60
|
|Device description|
A textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software.
|
SNMP agent|sysDescr
Update: 3600
|
|Memory usage|
-
|
SNMP agent|switch.memory
Update: 60
|
|Power Supply Sensor|
-
|
SNMP agent|Power.Supply.Sensor
Update: 60
|
|CPU usage|
-
|
SNMP agent|switch.cpu
Update: 60
|
|SysUptime|
-
|
SNMP agent|SysUptime
Update: 300
|
|External Power Supply 1|
-
|
SNMP agent|Ext.Power.Supply
Update: 60
|
|Switch Temperature|
-
|
SNMP agent|switch.temp
Update: 60
|
|Fan 1|
-
|
SNMP agent|fan1.status
Update: 60
|
|CRC errors on interface $1|
-
|
SNMP agent`|CRC.Errors[{#SNMPVALUE}]
Update: 120

LLD
|
| Name | Description | Expression | Priority |
|---|---|---|---|
| CRC Errors on on {HOST.NAME} interface {#SNMPVALUE} |
A Cyclic Redundancy Check (CRC) are a hash function designed to detect accidental changes to raw computer data. A CRC is a short binary sequence present on each block of data. When a block of data is read or received, the device repeats the calculation to check for a match. If the new CRC does not match the original CRC, then a data error is logged and the device can attempt to correct the data error by re-reading or requesting the block of data.
 |
Expression: change(/HP A5120/CRC.Errors[{#SNMPVALUE}])>1

Recovery expression:
 | average |
| CRC Errors on on {HOST.NAME} interface {#SNMPVALUE} (LLD) |
A Cyclic Redundancy Check (CRC) are a hash function designed to detect accidental changes to raw computer data. A CRC is a short binary sequence present on each block of data. When a block of data is read or received, the device repeats the calculation to check for a match. If the new CRC does not match the original CRC, then a data error is logged and the device can attempt to correct the data error by re-reading or requesting the block of data.
 |
Expression: change(/HP A5120/CRC.Errors[{#SNMPVALUE}])>1

Recovery expression:
 | average |
Template for HP A5120 switch with SNMP v3 authPriv.
Included items:
no links to other templates, does not include standard interface items (use generic SNMP interface template)
I use SNMP V3 with authPriv security level, SHA authentication protocol, AES privacy protocol.
It is required to fill these variables with correct values using host macros.
Created on Zabbix 3.0, should work with newer/older versions.
Jakub Samek
There are no macros links in this template.
There are no template links in this template.
| Name | Description | Type | Key and additional info |
|---|---|---|---|
| Network interface errors |
You may also consider using IF-MIB::ifType or IF-MIB::ifAlias for discovery depending on your filtering needs. {$SNMP_COMMUNITY} is a global macro.
 | SNMP agent |
ifDescription
Update: 3600
 |
|Name|Description|Type|Key and additional info|
|—-|———–|—-|—-|
|Device location|
The physical location of this node (e.g., telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string.
|
SNMP agent|sysLocation
Update: 3600
|
|Device name|
An administratively-assigned name for this managed node. By convention, this is the node's fully-qualified domain name. If the name is unknown, the value is the zero-length string.
|
SNMP agent|sysName
Update: 3600
|
|Device contact details|
The textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string.
|
SNMP agent|sysContact
Update: 3600
|
|Internal Power Supply 1|
-
|
SNMP agent|Int.Power.Supply1
Update: 60
|
|Device description|
A textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software.
|
SNMP agent|sysDescr
Update: 3600
|
|Memory usage|
-
|
SNMP agent|switch.memory
Update: 60
|
|Power Supply Sensor|
-
|
SNMP agent|Power.Supply.Sensor
Update: 60
|
|CPU usage|
-
|
SNMP agent|switch.cpu
Update: 60
|
|SysUptime|
-
|
SNMP agent|SysUptime
Update: 300
|
|External Power Supply 1|
-
|
SNMP agent|Ext.Power.Supply
Update: 60
|
|Switch Temperature|
-
|
SNMP agent|switch.temp
Update: 60
|
|Fan 1|
-
|
SNMP agent|fan1.status
Update: 60
|
|CRC errors on interface $1|
-
|
SNMP agent`|CRC.Errors[{#SNMPVALUE}]
Update: 120

LLD
|
| Name | Description | Expression | Priority |
|---|---|---|---|
| CRC Errors on on {HOST.NAME} interface {#SNMPVALUE} |
A Cyclic Redundancy Check (CRC) are a hash function designed to detect accidental changes to raw computer data. A CRC is a short binary sequence present on each block of data. When a block of data is read or received, the device repeats the calculation to check for a match. If the new CRC does not match the original CRC, then a data error is logged and the device can attempt to correct the data error by re-reading or requesting the block of data.
 |
Expression: change(/HP A5120/CRC.Errors[{#SNMPVALUE}])>1

Recovery expression:
 | average |
| CRC Errors on on {HOST.NAME} interface {#SNMPVALUE} (LLD) |
A Cyclic Redundancy Check (CRC) are a hash function designed to detect accidental changes to raw computer data. A CRC is a short binary sequence present on each block of data. When a block of data is read or received, the device repeats the calculation to check for a match. If the new CRC does not match the original CRC, then a data error is logged and the device can attempt to correct the data error by re-reading or requesting the block of data.
 |
Expression: change(/HP A5120/CRC.Errors[{#SNMPVALUE}])>1

Recovery expression:
 | average |


--- layout: documentation title: PEExportedFunctionType ---
The PEExportType specifies the type describing exported functions.
| Field Name | Type | Description |
|---|---|---|
| Function_Name0..1 | StringObjectPropertyType |
The Function_Name field specifies the name of the function exported by the PE binary. |
| Entry_Point0..1 | HexBinaryObjectPropertyType |
The Entry_Point field specifies the entry point of the function exported by the PE binary. |
| Ordinal0..1 | NonNegativeIntegerObjectPropertyType |
The Ordinal field specifies the ordinal value (index) of the function exported by the PE binary. |


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet commodo urna. Curabitur sollicitudin neque nec nulla eleifend, ut egestas massa ornare. Vivamus facilisis ut augue ac tincidunt. Proin dictum purus rutrum libero condimentum, in feugiat sapien euismod. Sed vel condimentum arcu. Etiam dictum iaculis mauris, vel auctor neque dictum viverra. Maecenas at tincidunt ligula, in egestas ex. Praesent hendrerit lobortis tortor tempus finibus. Mauris magna elit, lobortis eu lacinia eu, mollis at diam.
mummies are naturally hard workers with organized attitude but the life can take them away, and busy due to the multitasking power that every women earn so she has to delight herself The food we eat on a daily basis affects how our bodies work, how we heal and grow, and how we maintain energy and strength for years to come. It also determines the basic nutritional health
Pregnancy is the one time in your life when you’re eating habits directly affect another person. Your decision to incorporate delicious vegetables, whole grains and legumes, lean protein, and otherwise food choices into your eating plan before and during pregnancy will give your baby a strong start in life. Maintaining a regular exercise routine throughout your pregnancy can help you stay healthy and feel your best. Regular exercise during pregnancy can improve your posture and decrease some common discomforts such as backaches and fatigue. There is evidence that physical activity may prevent gestational diabetes (diabetes that develops during pregnancy), relieve stress, and build more stamina needed for labor and delivery.
Your Health is our Duty


Purchase Transaction:
Go to Stock InwardAlloy Transaction
In any purchase transaction it is require provide costing details first, costing
detail capture purchase amount for individual category of item.
There are 5 purchase categories are defined in system:
- Metal Items: All gold/ silver and alloy items, amount needs to be entered
for per gram.
- Stone Items: All diamond/ color stone and cubic zircon items to be entered
for per cent.
- Labor charges: labor amounts are captured for different jewel products, the
charges is based on the gross weight of the jewels. User can also define
minimum charges for individual jewel category.
- Certification charges:Certification charges are applicable on stone products,
similar to labor charges certification charges are define based on stone
weight,Here charges are applied for different range of weight, system has option
to input user define ranges up to three different weight ranges.
- Stamping charges: stamping charges are applied on stone products.
After setting the costing details we can make purchase entry for all jewel items,
enter supplier information on top section, i.e. select supplier,
contact name, remarks etc. Please ensure you have all necessary jewel information
with you while making purchase entry following information.


Welcome to Hello Chess, a server for playing live chess and chess variants, including four-player chess, crazyhouse 960, and S-Chess (also known as Seirawan Chess).


social work natural disaster workers disasters Social affected assessment people climate-change-induced climate {border-style role disasters. px;} research #ffffff;} change communities households South data study intervention International community findings order participants assessments practice principle assessed relief rural Disaster disaster. ecological impacts indicated knowledge px; required systems {font-family Africa Research Work collab: collected factors floods font-size food information Assessment Furthermore, London. Orme article assessing change: conduct cope disaster, disasters, distress double; edn., experienced following interventions. providing risk services theory vulnerability :). African Climate Coates Data Dominelli Green O’Brien Rain Zapf addition, address applied areas border-color border-width conducted contribute coping. framework intervene interventions needs process provide solid; study. viewed worker workers, {font-style {font-weight (Dominelli Cheung Coulshed Department Dow Federation However, ICSU National Press, Pretoria. Red Risk Routledge, SRD Studies Table Tzaneen Workers analysed approaches assess based bold conducting context courier; damage development effects em; environmental extreme focus global help helping household impact important including individuals intervention. interventions, involved level lightning livelihoods need person place planning played policy poor professional proper pt;} shocks specific strategy support understand vulnerable weather


Child Rights and You
Vision
-
A happy, healthy and creative child whose rights are protected and honoured in a society that is built on respect for dignity, justice and equity for all.
Mission
-
To enable people to take responsibility for the situation of the deprived Indian child and so motivate them to seek resolution through individual and collective action thereby enabling children to realise their full potential
-
To make people discover their potential for action and change
-
To enable peoples’ collectives and movements encompassing diverse segments, to pledge their particular strengths, working in partnership to secure, protect and honour the rights of India’s children.


Equivalent to clicking the Table command on the Data menu. Creates a table based on the input values and formulas you define on a worksheet. Use data tables to perform a "what-if" analysis by changing certain constant values in your workbook to see how values in other cells are affected.
Syntax
TABLE(row_ref, column_ref)
TABLE?(row_ref, column_ref)
Row_ref specifies the one cell to use as the row input for your table.
Row_ref should be either an external reference to a single cell on the active worksheet, such as !$A$1 or !Price, or an R1C1-style reference to a single cell in the form of text, such as "R1C1", "R[-1]C[-1]", or "Price".
If row_ref is an R1C1-style reference, it is assumed to be relative to the active cell in the selection.
Column_ref specifies the one cell to use as the column input for your table. Column_ref is subject to the same restrictions as row_ref.
Return to index


Daily Schedule
Task
Day of the Week
Mon
Tue
Wed
Thu
Fri
Sat
Sun
College
Java
Web Design
C lang
Python
Practical
OFF
Work
Subject preparation and project


Hockey Skills Development
Athletes U training methods provide the environment and structure for players to focus on improving their individual skills, confidence, and game with professional guidance from trained and experienced Skills Coaches.
We offer year round training for dedicated athletes looking to reach the next level.
Can I enroll? Athletes U is for anyone trying to improve their game.
Our programs help athletes improve individual skills and confidence to help reach their goals.
"You are your own competition. Be better than you were yesterday".
Athletes U offers skill development programs and camps year round.
Our skill development programs begin Summer 2019. That's right, develop your game through our six week skill development program this summer.
The sessions focus on mastering the skills of skating, puck control, shooting, and other fundamental concepts. Stay tuned for more information about our upcoming camps.
Find out what Athletes U is all about.
We offer a six week skill development program Jul-Aug that you can register in, each session focuses on a different skill. We offer skill sessions for Atom, Peewee, and Bantam.
Skill Sessions
Schedule per division
To register or for more information connect with us
Athletes U will have Extra ice booked This summer (May-August)
Extra ice program will be available for:Git
Dont miss out, contact us to stay updated on upcoming Skates for your age group
To register or for more information connect with us
For more information about any of the upcoming programs connect with us
Athletes U offers Camps year round.
Camps offer an intensive set of
specified training exercises to help athletes
master new skills in a short period of time.
We have plans for a preseason camp August 12-16. The camp will consist of
power skating, puck control, and skills for Game like situations.
The camp will be offered for each group Atom, Peewee, and Bantam.
Camp break down
Schedule per division
To register or for more information connect with us
Athletes U has plans for mini 2/3 day camps throught the year beginning 2019/2020. These include a Power Skating specific camp, and a Puck control + Shooting camp.


“You don’t have to be big. You have to be remarkable.”
About this project
Blogomatic is a platform that allows you to create your own blogs, as well as read and discover other bloggers contents. We are a society of researchers and talented people with a great mindsets who aim to spread their knowledge and ideas to inspire the humanity.
Angry Nerds team
We are a software development team, we want to give the society a chance to express themselves freely. We came from different backgrounds we have all the different:Experiences,talents, skills, opinions, and personalities, but we have the same goal to spread the knowledge and respect diversity.
My name is Aya Hariri, I am a 27 years old. I am a freelance graphic designer and previously worked as a project manager in an event management company, before starting the software development program.The reason behind my career shift is I want to be able to design and develop websites.
My name is Ola Daoud, I am 24 years old fresh graduate architect from the University of Jordan. I have been learning programming for a month right now, and is my first project at this scale so I am very excited.
My name is Mohammad AlMokdad, I am 22 years old guy. Graduated from Zarqa University with Bachelor degree in Computer Science. I am a beginner photographer with a lot of passion in programming and photography. I love Arabic language and aim to participate in it's technical revival.
My name is Husam Ajour, and I'm 25 years old. I have a bachelor's degree in Computer Science from PSUT, and I have three years of experience as a Freelance Front-End Developer. The reason why I joined this course is to enhance my programming skills and learn Back-End Development in addition to other skills.


Zend\Validator\Hostname allows you to validate a hostname against a set of known specifications. It is possible to check for three different types of hostnames: a DNS Hostname (i.e. domain.com), IP address (i.e. <IP_ADDRESS>), and Local hostnames (i.e. localhost). By default only DNS hostnames are matched.
The following options are supported for Zend\Validator\Hostname:
A basic example of usage is below:
1 2 3 4 5 6 7 8 9 | $validator = new Zend\Validator\Hostname();
if ($validator->isValid($hostname)) {
// hostname appears to be valid
} else {
// hostname is invalid; print the reasons
foreach ($validator->getMessages() as $message) {
echo "$message\n";
}
}
|
This will match the hostname $hostname and on failure populate getMessages() with useful error messages.
You may find you also want to match IP addresses, Local hostnames, or a combination of all allowed types. This can be done by passing a parameter to Zend\Validator\Hostname when you instantiate it. The parameter should be an integer which determines what types of hostnames are allowed. You are encouraged to use the Zend\Validator\Hostname constants to do this.
The Zend\Validator\Hostname constants are: ALLOW_DNS to allow only DNS hostnames, ALLOW_IP to allow IP addresses, ALLOW_LOCAL to allow local network names, ALLOW_URI to allow RFC3986-compliant addresses, and ALLOW_ALL to allow all four above types.
Note
Additional Information on ALLOW_URI
ALLOW_URI allows to check hostnames according to RFC3986. These are registered names which are used by WINS, NetInfo and also local hostnames like those defined within your .hosts file.
To just check for IP addresses you can use the example below:
1 2 3 4 5 6 7 8 9 | $validator = new Zend\Validator\Hostname(Zend\Validator\Hostname::ALLOW_IP);
if ($validator->isValid($hostname)) {
// hostname appears to be valid
} else {
// hostname is invalid; print the reasons
foreach ($validator->getMessages() as $message) {
echo "$message\n";
}
}
|
As well as using ALLOW_ALL to accept all common hostnames types you can combine these types to allow for combinations. For example, to accept DNS and Local hostnames instantiate your Zend\Validator\Hostname class as so:
1 2 | $validator = new Zend\Validator\Hostname(Zend\Validator\Hostname::ALLOW_DNS |
Zend\Validator\Hostname::ALLOW_IP);
|
Some Country Code Top Level Domains (ccTLDs), such as ‘de’ (Germany), support international characters in domain names. These are known as International Domain Names (IDN). These domains can be matched by Zend\Validator\Hostname via extended characters that are used in the validation process.
Note
IDN domains
Until now more than 50 ccTLDs support IDN domains.
To match an IDN domain it’s as simple as just using the standard Hostname validator since IDN matching is enabled by default. If you wish to disable IDN validation this can be done by either passing a parameter to the Zend\Validator\Hostname constructor or via the setValidateIdn() method.
You can disable IDN validation by passing a second parameter to the Zend\Validator\Hostname constructor in the following way.
1 2 3 4 5 6 7 | $validator =
new Zend\Validator\Hostname(
array(
'allow' => Zend\Validator\Hostname::ALLOW_DNS,
'useIdnCheck' => false
)
);
|
Alternatively you can either pass TRUE or FALSE to setValidateIdn() to enable or disable IDN validation. If you are trying to match an IDN hostname which isn’t currently supported it is likely it will fail validation if it has any international characters in it. Where a ccTLD file doesn’t exist in Zend/Validator/Hostname specifying the additional characters a normal hostname validation is performed.
Note
IDN validation
Please note that IDNs are only validated if you allow DNS hostnames to be validated.
By default a hostname will be checked against a list of known TLDs. If this functionality is not required it can be disabled in much the same way as disabling IDN support. You can disable TLD validation by passing a third parameter to the Zend\Validator\Hostname constructor. In the example below we are supporting IDN validation via the second parameter.
1 2 3 4 5 6 7 8 | $validator =
new Zend\Validator\Hostname(
array(
'allow' => Zend\Validator\Hostname::ALLOW_DNS,
'useIdnCheck' => true,
'useTldCheck' => false
)
);
|
Alternatively you can either pass TRUE or FALSE to setValidateTld() to enable or disable TLD validation.
Note
TLD validation
Please note TLDs are only validated if you allow DNS hostnames to be validated.
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.


{{ company_name }}
Redirecting to payment gateway
Please do not refresh or go back.
{% csrf_token %} {% for key, value in data_dict.items %}
{% endfor %}


You have received the following notice from {{ site_name }}:
The following data was rejected:
{{ data_name }}
And the reasons for rejection:
{{ reason | safe }}
You can update your data here: {{ data_url }}


They don't take up much space.  Don't need pplenty of walks and cats are quieter. Also cats do a very good job of keeping themselves clean
Dogs make you laugh. DDogs help you make friends.You meet a lot of people when you are walking with your dog.Some tech-savvy dogs are learnng how to recognize and respond commands. Also dogs keep us fit and healthy. Dods are real-life heroes.


I-T dept. detects ₹435-cr undisclosed income after raids on TN firm
The company has systematically inflated its expenditure using bogus or fabricated invoices, sources said
by PTIThe income tax department has detected alleged undisclosed income of ₹435 crore after it raided a Tamil Nadu-based company, the CBDT said on Sunday.
Unaccounted cash of ₹32.6 crore and about 10 kgs of gold jewellery has been seized during the search operations that were launched on November 15 at twenty premises in “a tier 3 city of Tamil Nadu”, it said without disclosing the exact locations.
“The company is in the business of manufacturing certain specialised materials which are supplied to the health sector in India and abroad,” the CBDT said in a statement.
The Central Board of Direct Taxes is the policy-making body for the I-T department
It said the company, which was not identified, was “indulging in substantial tax evasion”.
“The major finding of the search action is that the company has systematically inflated its expenditure using bogus or fabricated invoices.
“By booking such non-existent expenditure in its books of account, the company and its promoters have suppressed the true income of the company over the years,” it said.
It wars found, the CBDT said, that the company would pay for such bogus expenses by cheque or RTGS and then receive the cash back.
“The unaccounted income so generated has been deployed by the company’s promote₹ into investments in immovable properties by making unaccounted payments, further investments in the business itself as share capital and in fixed bank deposits, cash and other valuables,” it said.
The undisclosed income of the company and its promoters is estimated at about ₹435 crore, it said.
Further enquiries are in progress, the statement said.


Most of my work can be found on my GitHub. Please note that some of work is in private repositories or on organizational GitLabs to prevent any security issues amongst other things.
The Wall of Thanks is an application built as an online opportunity bulletin for students and faculty at Stuyvesant High School. It has a filtering system, automatic and customizable emailing system for notifications and reminders, and accounts set up using Google OAuth. Watch this fun demo!
The Wall of Thanks was an application built using Node.js and employing MongoDB. It was created to allow users to share their gratitude in a time of uncertainty amidst the rise of COVID-19, especially in NYC.
StuyActivites is an after-school activity manager actively used by nearly 3500 students and faculty members at Stuyvesant High School, which I helped create in my time as Student Union President and Vice President. It is built in Python 3 using Flask, Amazon S3, PIL, and SQLAlchemy and the front-end is built with WTForms, Jinja, jQuery, and various JS libraries. The application features a club chartering and approval system, meeting and attendance management with personalized and global calendars for students, and a built-in room reservation system. Students can join and create clubs online, can request funding from the Student Union or Parent’s Association for their organizations, and can get information out to their members all from one convenient site.
An artificial intelligence program that serves as a virtual study buddy to help students target their academic weaknesses and better prepare for testing alongside teammates developed in assistance with mentors from Google NYC.
Based on Apple’s PhotoBooth using Java in Processing. Allows users to take pictures, apply filters and draw on their pictures, and save them. Experimented with the OpenCV facial recognition library while creating filters. Also employs a GUI using the controlP5 library.


D Y PATIL
Home
Home
Student Details
Student Details
Add Member
Add Member
Suggest Topic
Suggest Topic
Submissions
Submissions
Mentor
Mentor
Logout
Logout


TABLE OF CONTENT
A. GS1 Related B. GS2 Related POLITY 1. ‘Preventive detention no quick fix’ INTERNATIONAL RELATIONS 1. India, Spain call for ‘zero tolerance’ to terrorism C. GS3 Related ECONOMY 1. India is no longer the fastest-growing economy 2. Plan for Indian SEZs in Bangladesh hits bump INTERNAL SECURITY 1. Strategic Partnership model takes effect D. GS4 Related E. Concepts-in-News: Related Concepts to Revise/Learn F. Bills/Acts/Schemes/Orgs in News G. Practice Questions for UPSC Prelims Exam
UPSC Current Affairs 2017: News Analysis
A. GS1 Related
Nothing here for today!!
1. ‘Preventive detention no quick fix’
In news:
- Supreme Court ruling: Preventive detention of a person by a State after branding him a ‘goonda’ merely because the normal legal process is ineffective and time-consuming in ‘curbing the evil he spreads’ is illegal.
- The detention of a person was a serious matter affecting the liberty of the citizen.
- Preventive detention cannot be resorted to when sufficient remedies are available under the general laws of the land for any omission or commission under such laws.
Category: INTERNATIONAL RELATIONS
1. India, Spain call for ‘zero tolerance’ to terrorism
In news:
- India and Spain stressed that there should be “zero tolerance” to terrorism and called on the international community to end “selective or partial” approaches in combating the menace which posed the gravest threat to international peace and stability.
- Agreements signed: transfer of sentenced persons and visa waiver for holders of diplomatic passports.
- Five MoUs were signed between the two countries on cooperation in organ transplantation, cybersecurity, renewable energy, civil aviation and one between India’s Foreign Service Institute and Diplomatic Academy of Spain.
C. GS3 Related
1. India is no longer the fastest-growing economy
In News:
- India lost its fastest-growing major economy tag in the fourth quarter of 2016-17, with GDP growth coming in at 6.1% compared with China’s 6.9% in the same period.
Key data:
- GDP grew 7.1% in the financial year 2016-17, slower than the 8% registered in 2015-16.
- The GDP numbers were based on the new 2011-12 base year recently adopted.
- Gross value added (GVA) growth was 6.6% for 2016-17 and 5.6% in the fourth quarter, compared with 7.9% in 2015-16 and 8.7% in Q4 of that year.
Reason:
2. Plan for Indian SEZs in Bangladesh hits bump
In news:
- India’s plan to step up investments in Bangladesh by setting up three mega Special Economic Zones (SEZ) at Mongla, Bheramara and Mirsarai – the sites in Bangladesh , exclusively meant for Indian companies in the latter’s territory has hit a major hurdle.
- Constraints:
- Inadequate infrastructure and lack of uninterrupted power supply
- Ambiguity and uncertainty regarding incentives offered by the Bangladesh Government to develop the SEZs
BACKGROUND INFORMATION:
- India and Bangladesh had inked a Memorandum of Understanding (MoU) in June 2015 — during Prime Minister Narendra Modi’s visit to Bangladesh — for cooperation on establishing Indian SEZs in Bangladesh.
- The plan was to develop Indian SEZs at Mirsarai (1,005 acres), Bheramara (about 480 acres) and Mongla (200 acres).
- The construction of these SEZs and Indian investment in the zones were to be facilitated through concessional Line of Credit extended by India to Bangladesh.
1. Strategic Partnership model takes effect
In news:
- Strategic Partnership (SP) policy which intends to promote Indian private sector participation in defence manufacturing, formally came into effect.
Strategic Partnership (SP) policy:
- The SP model is being implemented to enable participation of private Indian firms in ‘Make in India’ in defence.
- The SP is expected to play the role of a system integrator by building an extensive ecosystem comprising development partners, specialised vendors and suppliers.
- Various selection and evaluation criteria have been stipulated for short-listing the SP.
- SPs will be identified primarily based on their experience and competence in integration of multi-disciplinary functional system of systems, engineering and manufacturing
- Of the four segments under SP, two are for the Navy: submarines and utility helicopters. The others are single-engine fighter aircraft for the Indian Air Force and armoured vehicles for the Army.
D. GS4 Related
Nothing here for Today!!!
PIB Articles Editorials Roundup
E. Concepts-in-News: Related Concepts to Revise/Learn
Prelims worthy factual information
- Punjab to join hand with UN Agency against Drugs. Punjab will soon sign an agreement with United Nations Office on Drugs and Crime (UNODC) for its war against drug addiction.
F. Bills/Acts/Schemes/Orgs in News
|
Article in News |
About the article |
G. Practice Questions for UPSC Prelims Exam
Question 1: Apart from India, in which of the following two countries, Tamil is an official language?
- Mauritius and Malaysia
- Malaysia and Indonesia
- Sri Lanka and Mauritius
- Sri Lanka and Singapore
Question 2: The Machia Biological Park is located in which state?
- Rajasthan
- Sikkim
- Nagaland
- Manipur
Question 3: Bathymetry is related to which of the following studies?
- Climatology
- Oceanography
- Economic Geography
- Astronomy
Question 4: Ramman is a religious festival and ritual theatre of ____?
- Uttarkhand
- Uttar Pradesh
- West Bengal
- Madhya Pradesh
Question 5: Who among the following was known as Bengal’s Greata Garbo?
- Suchitra Sen
- Amaravati
- Kanan Devi
- Bharathi Shirodkor
“Proper Current Affairs preparation is the key to success in the UPSC- Civil Services Examination. We have now launched a comprehensive ‘Online Current Affairs Crash Course’. Limited seats available. Click here to Know More.”


Amazon Hub self-service lockers launch in Australia – just in time for Black Friday
by Stephen LambrechtsAmazon Hub self-service lockers launch in Australia – just in time for Black Friday
Counter service also available
(Image credit: Amazon Australia)
Amazon Hub – an alternative parcel delivery network that allows customers to retrieve their goods from self-service lockers or pickup counters – has been available to Amazon's US customers since 2011.
As of today, that same pickup service is available in Australia, meaning consumers can choose to have their upcoming Black Friday 2019 orders shipped to over a hundred Amazon Hub locations situated in Commonwealth Bank branches, Victorian Authorised Newsagents Association locations and Stockland shopping centres across the country.
The online retail behemoth has already announced that hundreds of additional locations will become available by the end of the year, with thousands more set to open throughout 2020.
- Amazon Australia Black Friday and Cyber Monday 2019 deals
- The best Amazon deals and sales in Australia
- Amazon shopping tips and tricks: how to get the best bargains on Black Friday
Locker and Counter options
As the name would suggest, Amazon Hub's Locker service lets users pick up their items from a self-service kiosk at a location of their choosing, while its Counter service invites customers to collect their parcels from store partners – the idea being that increased on-foot shop traffic will drive new customers.
In order to use Amazon Hub, customers must simply proceed to checkout during the purchase process, where they can choose the Locker or Counter pickup point that's nearest to them.
Locker customers get three days to collect their goods before they're returned to the Amazon warehouse, while stores that offer Counter pickup will hold on to your items for 14-days.
So if you haven't signed up to become a Prime member yet, do so now and you'll get a 30-day long free trial period and save on shipping costs for items purchased from Amazon US.


comment on your Video.
Your Order is Accepted.
Your Order is Delivered.

Casual Dining
Online
Offline
Bekaries
Sydney, Australia


new Map(root)
Map constructor.
Parameters:
| Name | Type | Description |
|---|---|---|
root |
Object | root node |
- Source:
Extends
Methods
-
assoc(key, value) → {Map}
-
Associate a key with a value.
Parameters:
Name Type Description key
String key value
* value - Source:
Returns:
new map instance, original is unaffected- Type
- Map
-
contains(key) → {Boolean}
-
Check if map contains a mapping for the specified key.
Parameters:
Name Type Description key
String key - Source:
Returns:
- Type
- Boolean
-
dissoc(key) → {Map}
-
Remove a mapping.
Parameters:
Name Type Description key
String key - Source:
Returns:
new map instance, original is unaffected- Type
- Map
-
dissocIn(path) → {Associative}
-
Remove existing nested value.
Parameters:
Name Type Description path
Array path to nested value - Inherited From:
- Source:
Returns:
new associative instance, original is unaffected- Type
- Associative
-
entries() → {Array}
-
Get all mappings as an array of [key, value] arrays.
- Source:
Returns:
array of [key, value] arrays- Type
- Array
-
equals(otherMap) → {Boolean}
-
Check whether both maps contain exactly the same keys mapped to the same values. Associative values are compared recursively, ordinal values are compared using '==='.
Parameters:
Name Type Description otherMap
Map map to compare with - Source:
Returns:
- Type
- Boolean
-
fill(var_args) → {Map}
-
Fill map from variable-length arguments list. If key is already present, its value is replaced.
Parameters:
Name Type Argument Description var_args
Object <repeatable>
arguments list in form of 'key1, value1, key2, value2, ...' key-value pairs - Source:
Returns:
new map instance, original is unaffected- Type
- Map
-
fillFromObject(obj, f) → {Map}
-
Fill map from JavaScript object. If key is already present, its value is replaced.
Parameters:
Name Type Argument Description obj
Object JavaScript object f
function <optional>
function applied to each value - Source:
Returns:
new map instance, original is unaffected- Type
- Map
-
filter(pred) → {Map}
-
Filter using a predicate.
Parameters:
Name Type Description pred
function predicate - Source:
Returns:
new map instance, original is unaffected- Type
- Map
-
find(pred) → {*}
-
Find value using a predicate.
Parameters:
Name Type Description pred
function predicate - Source:
Returns:
found value or null- Type
- *
-
foreach(f)
-
Execute side-effecting function for each entry.
Parameters:
Name Type Description f
function function called for each entry - Source:
-
get(key) → {Object}
-
Get value by key.
Parameters:
Name Type Description key
String key - Source:
Returns:
value or null- Type
- Object
-
getIn(path) → {*}
-
Get value from a nested associative collection.
Parameters:
Name Type Description path
Array path to nested key - Inherited From:
- Source:
Returns:
nested value or null- Type
- *
-
isAssociative(obj) → {Boolean}
-
Check whether supplied object is instance of Associative.
Parameters:
Name Type Description obj
Object object to check - Inherited From:
- Source:
Returns:
- Type
- Boolean
-
isEmpty() → {Boolean}
-
Check whether map is empty.
- Source:
Returns:
- Type
- Boolean
-
isInstance(obj) → {Boolean}
-
Check whether obj is map instance.
Parameters:
Name Type Description obj
* object to check - Source:
Returns:
- Type
- Boolean
-
join(otherMap) → {Map}
-
Join two maps. If key is already present in this map, its value is replaced.
Parameters:
Name Type Description otherMap
Map map to join with - Source:
Returns:
new map instance, original maps are unaffected- Type
- Map
-
keys() → {Array}
-
Get all keys as an array.
- Source:
Returns:
array of keys- Type
- Array
-
makeSafeKey(key) → {String}
-
Ensure safe key.
Parameters:
Name Type Description key
String key - Source:
Returns:
key without special symbold, e.g. dot- Type
- String
-
map(f) → {Map}
-
Map values.
Parameters:
Name Type Description f
function map function - Source:
Returns:
new map instance, original is unaffected- Type
- Map
-
merge(otherMap) → {Map}
-
Deep merge another map into this. Another map has higher priority in case of non-mergeable conflicting values.
Parameters:
Name Type Description otherMap
Map map to merge data from - Source:
Returns:
new map instance, original is unaffected- Type
- Map
-
reduce(f, acc) → {*}
-
Reduce map values with function f and initial value acc.
Parameters:
Name Type Description f
function function of (acc, value, key, originalMap); should return next accumulator value acc
* initial value - Source:
Returns:
reduce result- Type
- *
-
size() → {Number}
-
Get the number of mappings.
- Source:
Returns:
- Type
- Number
-
toObject(f) → {Object}
-
Convert to JavaScript object.
Parameters:
Name Type Argument Description f
function <optional>
function applied to each value - Source:
Returns:
JavaScript object containing same mappings as this map- Type
- Object
-
toString() → {String}
-
Get human-readable map representation.
- Source:
Returns:
- Type
- String
-
update(key, f) → {Map}
-
Update existing value or create new mapping. If key is missing, f will be called without arguments and the result will be associated with the key.
Parameters:
Name Type Description key
String key f
function update function - Source:
Returns:
new map instance, original is unaffected- Type
- Map
-
updateIfExists(key, f) → {Map}
-
Update existing value.
Parameters:
Name Type Description key
String key f
function update function - Source:
Returns:
new map instance, original is unaffected- Type
- Map
-
updateIn(path, f) → {Associative}
-
Update existing nested value or create new mapping. If key is missing, f will be called without arguments and the result will be associated with the key.
Parameters:
Name Type Description path
Array path to existing nested key f
function update function - Inherited From:
- Source:
Returns:
new associative instance, original is unaffected- Type
- Associative
-
values() → {Array}
-
Get all values as an array.
- Source:
Returns:
array of values- Type
- Array


Paragraphs are really easy to print but if you need a break inbetween you add these brs
This needs to be done now. Unless you do it, you will not be able to graduate.


Please select all the items you wish to add to your cart then push the "checkout" button below!
30.30
5.99
1.99
22.00
3.43
6.55
2.25
8.91
575.99
9000
Receipt Paid successfully


What are some differences that XHTML has compared to HTML?
Answer
Some of the key differences are:
- An XHTML element must have an XHTML
<DOCTYPE>
- Attributes values must be enclosed in quotes
- Attribute minimization is forbidden (e.g. one has to use
checked="checked"
instead of checked
)
- Elements must always be properly nested
- Elements must always be closed
- Special characters must be escaped
Good to hear
- Any element can be self-closed
- Tags ands attributes are case-sensitive, usually lowercase
Additional links


Confusion Matrix Calculator
True positive:
True negative:
False positive:
False negative:
Precision:
Specificity:
Recall or sensibility:
F1-score:


public class MainActivity
extends Activity
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
MainActivity.SensorsUpdateThread
This thread class is responsible to send the messages to the Handler with
an interval in case if the bluetooth is connected successfully and able
to receive data stream.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) static float |
altitude |
static byte[] |
buffer |
protected float[] |
compass_historyValue
Compass history for graph view
|
(package private) int |
compass_historyValue_count |
private java.lang.String |
Device_Model |
protected boolean |
flag_dismiss |
(package private) TextView |
heading |
(package private) LinearLayout |
heading_background |
(package private) RelativeLayout |
heading_sensor
UI variables to display the several UI elements while the program is
running
|
(package private) TextView |
heading_title |
(package private) LinearLayout |
humidity_background |
protected float[] |
humidity_historyValue
humidity history for graph view
|
(package private) int |
humidity_historyValue_count |
(package private) RelativeLayout |
humidity_sensor |
(package private) TextView |
humidity_title |
(package private) TextView |
hummidity |
private boolean |
isDestroyed |
(package private) ImageView |
iv_compass_needle |
(package private) ImageView |
iv_heading |
(package private) ImageView |
iv_humidity |
(package private) ImageView |
iv_light |
(package private) ImageView |
iv_pressure |
(package private) static ImageView |
iv_pressure_needle |
(package private) ImageView |
iv_tempreture |
(package private) ImageView |
iv_uvindex |
protected static LayoutInflater |
layoutInflater |
(package private) TextView |
light |
(package private) LinearLayout |
light_background |
protected float[] |
light_historyValue
light history for graph view
|
(package private) int |
light_historyValue_count |
(package private) RelativeLayout |
light_sensor |
(package private) TextView |
light_title |
protected static org.achartengine.model.XYSeries |
lineDataSeries |
protected static org.achartengine.renderer.XYMultipleSeriesRenderer |
lineRenderer |
protected static org.achartengine.GraphicalView |
lineView
variables for displaying graphs
|
(package private) BluetoothAdapter |
mBluetoothAdapter
Bluetooth Adapter of the device
|
private BluetoothDataReader |
mBluetoothDataReader
A utility class instance that provides the easy read operation from
bluetooth data stream.
|
(package private) BluetoothDevice |
mBluetoothDevice
Bluetooth Device that is intended to get the information
|
private java.io.InputStream |
mBluetoothIS
Bluetooth input stream to read the incoming data from the device
|
(package private) java.io.OutputStream |
mBluetoothOS
Bluetooth socket output stream
|
(package private) BluetoothSocket |
mBluetoothSocket
A Bluetooth socket that connects the device to stream the data
|
private MainActivity.SensorsUpdateThread |
mSensorUpdateThread
A class extension of Thread to perform the sensor update.
|
protected static java.util.UUID |
MY_UUID |
private Handler |
myHandler |
protected boolean |
popup_flag_heading
variables for the graph popup
|
protected boolean |
popup_flag_humidity |
protected boolean |
popup_flag_light |
protected boolean |
popup_flag_pressure |
protected boolean |
popup_flag_temperature |
protected boolean |
popup_flag_UV |
protected static View |
popupView |
protected static PopupWindow |
popupWindow |
(package private) TextView |
pressure |
(package private) LinearLayout |
pressure_background |
protected float[] |
pressure_historyValue
pressure history for graph view
|
(package private) int |
pressure_historyValue_count |
(package private) RelativeLayout |
pressure_sensor |
(package private) TextView |
pressure_title |
private long |
PrevTime |
protected static double[] |
range |
protected static int |
REQUEST_CONNECT_DEVICE |
protected static int |
REQUEST_ENABLE_BT |
(package private) TextView |
sensor_name |
(package private) TextView |
sensor_value |
private Handler |
sensorUpdateThreadHandler
A companion handler to update the sensors UI
|
(package private) java.lang.Boolean |
socketConnected
A flag indicating the connectivity of the socket
|
protected long |
startTime |
(package private) LinearLayout |
temperature_background |
(package private) TextView |
temperature_title |
(package private) TextView |
tempreture |
protected float[] |
tempreture_historyValue
temperature history for graph view
|
(package private) int |
tempreture_historyValue_count |
(package private) RelativeLayout |
tempreture_sensor |
protected static int |
Total_values |
(package private) LinearLayout |
uv_background |
protected float[] |
UV_historyValue
UV history for graph view
|
(package private) int |
UV_historyValue_count |
(package private) RelativeLayout |
uv_sensor |
(package private) TextView |
uv_title |
(package private) TextView |
UVindex |
protected RelativeLayout |
whole_page |
| Constructor and Description |
|---|
MainActivity() |
| Modifier and Type | Method and Description |
|---|---|
protected float |
find_average(float[] values,
int count)
solves the averages of an array of values
|
protected float |
find_largest(float[] values,
int count)
finds the largest value in the graph
|
protected float |
find_smallest(float[] values,
int count)
finds the smallest value in an array
|
protected org.achartengine.model.XYMultipleSeriesDataset |
getLineDataSet()
used for the graph
|
protected org.achartengine.renderer.XYMultipleSeriesRenderer |
getLineRenderer()
used for the graph
|
protected void |
makeGraph(float[] values,
int count,
java.lang.String name,
java.lang.String measure)
Initializes and makes the graph.
|
protected void |
makepopUpWindow()
Makes a popup windows that displays the sensor graph
|
void |
onActivityResult(int requestCode,
int resultCode,
Intent data)
This will be called once the DeviceListActivity is finished to make a
connection with selected device if user has selected a device while
DeviceListActivity.java was running.
|
void |
onClick(View v)
This function handles the on click for all the sensor boxes to display a
pop-up with graphical representation showing the trend of change in
values with time
|
void |
onCreate(Bundle savedInstanceState) |
void |
onDestroy() |
protected void |
onPause() |
void |
onResume() |
protected void |
putZero()
resets the history values
|
private void |
sendCommand(java.lang.String command) |
protected static void |
setElevation()
sets the Global elevation variable
|
protected void |
setHeading()
Updates the Heading graphic and graph on the UI.
|
protected void |
setHumidity()
Updates the humidty graph and graphic on the UI.
|
protected void |
setLight()
Updates the light graphic on the UI.
|
protected void |
setPressure()
Updates the pressure graph on the UI
|
protected void |
setTempreture()
Updates the temperature graphic on the UI and the graph
|
protected void |
setUV()
Updates the UV graphic and graph on the UI.
|
void |
showDevicesForSelection()
shows a list of bluetooth devices to select from
|
void |
startBluetooth()
starts the bluetooth connection
|
BluetoothAdapter mBluetoothAdapter
BluetoothDevice mBluetoothDevice
BluetoothSocket mBluetoothSocket
java.lang.Boolean socketConnected
java.io.OutputStream mBluetoothOS
protected static final int Total_values
protected float[] compass_historyValue
int compass_historyValue_count
protected float[] UV_historyValue
int UV_historyValue_count
protected float[] humidity_historyValue
int humidity_historyValue_count
protected float[] light_historyValue
int light_historyValue_count
protected float[] tempreture_historyValue
int tempreture_historyValue_count
protected float[] pressure_historyValue
int pressure_historyValue_count
RelativeLayout heading_sensor
RelativeLayout uv_sensor
RelativeLayout tempreture_sensor
RelativeLayout pressure_sensor
RelativeLayout light_sensor
RelativeLayout humidity_sensor
LinearLayout heading_background
LinearLayout uv_background
LinearLayout temperature_background
LinearLayout pressure_background
LinearLayout light_background
LinearLayout humidity_background
TextView sensor_name
TextView sensor_value
TextView heading
ImageView iv_heading
ImageView iv_compass_needle
TextView UVindex
ImageView iv_uvindex
TextView hummidity
ImageView iv_humidity
TextView light
ImageView iv_light
TextView tempreture
ImageView iv_tempreture
TextView pressure
ImageView iv_pressure
TextView heading_title
TextView uv_title
TextView humidity_title
TextView light_title
TextView temperature_title
TextView pressure_title
static ImageView iv_pressure_needle
private java.io.InputStream mBluetoothIS
private BluetoothDataReader mBluetoothDataReader
public static byte[] buffer
protected static final java.util.UUID MY_UUID
protected static final int REQUEST_CONNECT_DEVICE
protected static final int REQUEST_ENABLE_BT
protected RelativeLayout whole_page
protected long startTime
private MainActivity.SensorsUpdateThread mSensorUpdateThread
private java.lang.String Device_Model
private boolean isDestroyed
private long PrevTime
private Handler sensorUpdateThreadHandler
static float altitude
protected static org.achartengine.GraphicalView lineView
protected static org.achartengine.model.XYSeries lineDataSeries
protected static org.achartengine.renderer.XYMultipleSeriesRenderer lineRenderer
protected static double[] range
protected static PopupWindow popupWindow
protected static View popupView
protected static LayoutInflater layoutInflater
protected boolean popup_flag_heading
protected boolean popup_flag_UV
protected boolean popup_flag_humidity
protected boolean popup_flag_light
protected boolean popup_flag_temperature
protected boolean popup_flag_pressure
protected boolean flag_dismiss
private Handler myHandler
public void onCreate(Bundle savedInstanceState)
protected void putZero()
public void onResume()
public void onDestroy()
public void startBluetooth()
public void showDevicesForSelection()
public void onActivityResult(int requestCode, int resultCode, Intent data)
protected void setPressure()
protected static void setElevation()
protected void setTempreture()
protected void setLight()
protected void setHumidity()
protected void setUV()
protected void setHeading()
protected void onPause()
public void onClick(View v)
protected void makepopUpWindow()
protected void makeGraph(float[] values, int count, java.lang.String name, java.lang.String measure)
values
- graph valuescount
- size of valuesname
- name of the grpahmeasure
- Unitys of the graphprotected float find_largest(float[] values, int count)
values
- array of valuescount
- size of valuesprotected float find_smallest(float[] values, int count)
values
- array of valuescount
- size of valuesprotected float find_average(float[] values, int count)
values
- array of valuescount
- size of valuesprotected org.achartengine.model.XYMultipleSeriesDataset getLineDataSet()
protected org.achartengine.renderer.XYMultipleSeriesRenderer getLineRenderer()
private void sendCommand(java.lang.String command)


O.o
blackjok3r14-Nov-18 07:59 PM
it seems to yes
i just did blockreward * 0.99
Alright14-Nov-18 07:59 PM
this is in the code you just PRed?
blackjok3r14-Nov-18 07:59 PM
and then it leaves 1% behind in the pools address
no
its in the pool
the daemon change is nothing
mostly reacivitaing disabled code
my pool master branch migh not even be working atm ... that why I havent gone to sleep
wanted to get it fixed before leaving incase someon tries to use it
Alright14-Nov-18 08:00 PM
worked when I tested
move to a separate branch then revert master
blackjok3r14-Nov-18 08:01 PM
ive been activly commitingshit I think its wokrking atm, but wiuth extra prints
I wise wyou cpould just reset it to a commit ... git is stupid like that
Alright14-Nov-18 08:01 PM
very annoying
blackjok3r14-Nov-18 08:03 PM
how?
blackjok3r14-Nov-18 08:16 PM
I know thoes ....
but they dont reset master to a previous point in time
I accidentallymerged old code (not having latest git pull) and broke master
only way I know how to fix, si copy all files out of repo foilder from previous commit and then git pull master and copy them all back in and commit it agin
one day I will learn to creat a new branch every time before AI start messing with things, getting better at it but still forget at times
ComputerGenie 👴👴👴14-Nov-18 08:21 PM
GitKraken
grewalsatinder14-Nov-18 08:52 PM
on linux I'm able to use Github desktop
found some fork had it compiled for linux
but then it's bundled git was giving curl 3 related issue, so replaced it with the compiled git-core lib
found gitkraken good, but I still like Github Desktop
riddler18k14-Nov-18 09:44 PM
GitHub Dekstop is awesome
Also use the git extension/plugin with VSCode .... fidgety but good once working(edited)
anyone recommend me a stable pool for zex plz? yesterday was chaotic
IndieBlock14-Nov-18 10:37 PM
Hey all
In need of devs?
That_Guy814-Nov-18 11:26 PM
Ginasis Mining Pool: http://zex.ginasismining.com is running the pool at 0% fee for a promotional period to help spread the hashrate. Don’t be lazy, get some hashrate over to help secure the network.
Alright14-Nov-18 11:33 PM
is dpow'd spreading hashrate doesn't make much difference
ginasismining is a good pool though
That_Guy814-Nov-18 11:33 PM
And if all the hashrate is on 1 pool and it goes down?
That won’t make much of a difference for the current block?
Alright14-Nov-18 11:34 PM
set backup obviously
That_Guy814-Nov-18 11:34 PM
A set back and waste of precious paid for hashrate.
Alright14-Nov-18 11:35 PM
but again, that doesn't affect security if major hashrate drops off the network
just means I'll mine more coins on my solo pool (edited)
That_Guy814-Nov-18 11:36 PM
Potentially not ? Wouldn’t it get stuck on current block?
Due to high diff?
Alright14-Nov-18 11:36 PM
would take longer than normal than stabilize
but again, does not affect security
That_Guy814-Nov-18 11:37 PM
Securing the network can mean many things other than pure security.
Alright14-Nov-18 11:37 PM
You know... wasn't trying to knock your pool or anything
was just trying to be technical
That_Guy814-Nov-18 11:38 PM
And I’m just being technical right back
I’ll still love you...
Alright14-Nov-18 11:40 PM
@SHossain can you add forkwitch and ginasis to channel description
blackjok3r15-Nov-18 01:27 AM
How is forkwich pool working... @forkwitch has refused to answer any pings
forkwitch15-Nov-18 04:06 AM
It´s a little changed https://github.com/s-nomp/s-nomp pool software @blackjok3r. From benchmarking i say it´s rocksolid for equihash coin. Sorry i can only reply to pings quick on weekend. In the week it´s working time : ( ... in free time and breaks i control pool and webservers.
Anyone get einsteinium working properly? 2014-08-13 17:18:17 ERROR: ConnectBlock() : coinbase does not pay to the charity in the first output) 2014-08-13 17:18:17 InvalidChainFound: invalid block=d...
z-nomp is mining pool software for Zcash and Zclassic so you can create internet money in your home! - z-classic/z-nomp
blackjok3r15-Nov-18 04:21 AM
How do you calculate the founders reward size ?
as the math in the daemon is a little strange... will ahev a look at this code though thanks ... Sti;l going to keep my solution, as for multi sig payments and CC vouts in block reward...trying to calculate those in the pool is basciallt imposible.
forkwitch15-Nov-18 04:25 AM
Einsteinium example was super for me learning quick changes then you can play with VOUT structure and everything like you want. Manipulation of coinbase transaction with the nomp code is exciting. Honestly i dont make calculation. I just make static value with 70.0000002 ZEX for founder. Is it wrong?
Forkwitch pool is taken offline and goes back online in the weekend i can use it for quick testings. It has 0 MSol and i see many other pools. My pool was 0 fee pool and i dont want to steal income from other who have pool with earned fee. @blackjok3r when pool is needed urgent please make me a ping.
blackjok3r15-Nov-18 04:31 AM
no problem, we have 2 1% pools up with my software
But nobody is using http://zex.ginasismining.com/workers
Guys please use this pool aswell ... the Op spent many hours wokring with me to get i up
That_Guy815-Nov-18 04:33 AM
Ginasismining is currently at 0% to reward early adopters. once a stable hash rate has been reached it will change back to 1%
blackjok3r15-Nov-18 04:49 AM
@polycryptoblog
thats the other pool if you want to hash away on it still
skysmile15-Nov-18 07:14 AM
Equihash96 or Equihash144 or Equihash192 or Equihash210?

Oszy15-Nov-18 10:18 AM
yes what's what i said
skysmile15-Nov-18 10:23 AM
z9
That_Guy815-Nov-18 10:56 AM
Thanks @FishyGuts
Oszy15-Nov-18 11:00 AM
yes z9 works
BlockTech15-Nov-18 12:42 PM
What is this coin and it's purpose ?
jorian15-Nov-18 12:48 PM
check pin and channel msg
Machgielis15-Nov-18 01:06 PM
Hi All. We have a new community manager we are onboarding now. We will also list the pools on our Twitter to try and bring in some more people for you. Many updates to follow shortly.
3
We are also working on more exchange listings now.
4
That_Guy815-Nov-18 03:26 PM
we have finally finished up theming the pool, Hopefully you guys don't find it an eyesore http://zex.ginasismining.com
*Note: Price details are not yet functional. Will be updated when we can resolve that.
Payments tab has full block explorer integrations also
Oszy15-Nov-18 03:35 PM
eyesore? i went blind in 2 seconds
this is torture
c2k15-Nov-18 03:38 PM
thanks for getting it going @That_Guy8 ...appreciate your hard work
but i would have to agree with oszy...the blue is very tough onthe eyes
maybe make it a softer blue...powder or sky blue perhaps?
CryptoNinjaa15-Nov-18 03:39 PM
yeah the bigger blue text is ok but the smaller blue text send my eyes funny
wookie15-Nov-18 04:13 PM
@That_Guy8 yeah, the blue on grey/black background is really hard to see


HOME
PROJECTS
PUBLICATIONS
TEACHING
STUDENTS
WORKSHOPS/TUTORIALS
School of Thrones
Prom Night Is Coming
(S2, 2012/2013)
Targaryen Burn
(S1, 2012/2013)
Prom Night Is Coming
(S2, 2011/2012)
Targaryen Burn
(S1, 2011/2012)