text
stringlengths 3
1.04M
|
---|
Recognizing and finding faces in images.
Classifying articles in categories like sports, politics, entertainment, etc.
Recognizing handwritten characters using the images of the letters.
Under the paradigm of Supervised Learning, the program is trained on a set of data points which are pre-defined training examples. This is done to facilitate the program to find a better prediction (performance measure) on a new test data set.
In unsupervised learning, the training dataset doesn’t have well defined relationships and patterns laid out for program to learn.
The basis difference between the above mentioned learnings is that for supervised learning, a portion of output dataset is provided to train the model, in order to generate the desired outputs. On the other hand, in unsupervised learning no such dataset is provided for learning, rather the data is clustered into classes.
Reinforced learning involves learning and updating the parameters of model based on the feedback and errors of the output. Any dataset would be divided into two categories, training set and test set. The program is trained using the well-defined training dataset and is then fine-tuned using feedback from the results of test dataset.
Probability is the most common element across most of the machine learning algorithms. This section presents a basic introduction to probability, which will help in better understanding of machine learning algorithms. A random variable X represents outcomes or states of the world.
The super set of all possible outcomes (be it discrete, continuous or mixed).
p(x) stands for probability density functions. It assigns a number to all the points in the sample space. The value of p(x) is always non-negative and area of the contour (integration/sum) is 1.
Joint probability distribution is the probability density function jointly for two random variables. It is equals to the probability of X=x, Y=y; p(x,y).
Conditional probability distribution is Probability(X=x|Y=y), which stands for probability of X=x given Y=y.
Here, P(A) and P(B) are the independent probabilities of event A and B. P(B|A) is the probability of event B, given that event A has happened and similarly P(A|B) is the probability of event A, given that event B has happened.
Classification is a machine learning discipline of identifying the elements to their set or categories, on the basis of a training set data, where the membership/categories of the elements are known. Classification problem is an instance of supervised learning, because the training set of identified data points is available. The mathematical function which implements classification is known as classification.
Classification can be primarily of two types; Binary classification and Multi-Class Classification. In case of binary classification, the elements are divided into two classes; on the other hand, as the name suggests multi-class classification involves assigning objects among several classes.
Given a set of 2 data, Regression aims to find the most suited mathematical relationship and represent the set of data. The purpose of Regression in machine learning is to predict the output value using the training data and the key difference between regression and classification is that; classifiers have dependent variables that are categorical, whereas Regression model have dependent variables that are continuous values.
Here, if y is a categorical/discrete variable, then the function would be a classifier.
However, if y is a continuous/real number, then this will be a regression problem. |
package org.activityinfo.ui.client.page.entry.form;
/*
* #%L
* ActivityInfo Server
* %%
* Copyright (C) 2009 - 2013 UNICEF
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.activityinfo.legacy.client.Dispatcher;
import org.activityinfo.legacy.client.KeyGenerator;
import org.activityinfo.legacy.shared.command.CreateLocation;
import org.activityinfo.legacy.shared.command.result.VoidResult;
import org.activityinfo.legacy.shared.model.*;
import org.activityinfo.ui.client.page.entry.admin.AdminComboBox;
import org.activityinfo.ui.client.page.entry.admin.AdminComboBoxSet;
import org.activityinfo.ui.client.page.entry.admin.AdminFieldSetPresenter;
/**
* Presents a form dialog for a Site for an Activity that has a LocationType
* that is bound to an AdminLevel
*/
public class BoundLocationSection extends FormSectionWithFormLayout<SiteDTO> implements LocationFormSection {
private final Dispatcher dispatcher;
private AdminFieldSetPresenter adminFieldSet;
private AdminComboBoxSet comboBoxes;
private BoundAdminComboBox leafComboBox;
private LocationDTO location;
public BoundLocationSection(Dispatcher dispatcher, ActivityDTO activity) {
this.dispatcher = dispatcher;
adminFieldSet = new AdminFieldSetPresenter(dispatcher,
activity.getCountry().getBounds(),
activity.getAdminLevels());
comboBoxes = new AdminComboBoxSet(adminFieldSet, new BoundAdminComboBox.Factory());
for (AdminComboBox comboBox : comboBoxes) {
add(comboBox.asWidget());
leafComboBox = (BoundAdminComboBox) comboBox;
}
}
@Override
public void updateForm(LocationDTO location, boolean isNew) {
this.location = location;
adminFieldSet.setSelection(location);
}
@Override
public void save(final AsyncCallback<Void> callback) {
if (isDirty()) {
newLocation();
dispatcher.execute(new CreateLocation(location), new AsyncCallback<VoidResult>() {
@Override
public void onFailure(Throwable caught) {
callback.onFailure(caught);
}
@Override
public void onSuccess(VoidResult result) {
callback.onSuccess(null);
}
});
} else {
callback.onSuccess(null);
}
}
private void newLocation() {
location = new LocationDTO(location);
location.setId(new KeyGenerator().generateInt());
location.setName(leafComboBox.getValue().getName());
for (AdminLevelDTO level : adminFieldSet.getAdminLevels()) {
location.setAdminEntity(level.getId(), adminFieldSet.getAdminEntity(level));
}
}
private boolean isDirty() {
for (AdminLevelDTO level : adminFieldSet.getAdminLevels()) {
AdminEntityDTO original = location.getAdminEntity(level.getId());
AdminEntityDTO current = adminFieldSet.getAdminEntity(level);
if (current == null && original != null) {
return true;
}
if (current != null && original == null) {
return true;
}
if (current.getId() != original.getId()) {
return true;
}
}
return false;
}
@Override
public boolean validate() {
return comboBoxes.validate();
}
@Override
public void updateModel(SiteDTO m) {
m.setLocation(location);
}
@Override
public void updateForm(SiteDTO m, boolean isNew) {
}
}
|
<?php
/**
* Photo model.
*
* Something related to photos, the guts are in this file.
* Upload, update, delete and generate, oh my!
* @author Jaisen Mathai <[email protected]>
*/
class Photo extends Media
{
public function __construct($params = null)
{
parent::__construct();
if(isset($params['utility']))
$this->utility = $params['utility'];
else
$this->utility = new Utility;
if(isset($params['url']))
$this->url = $params['url'];
else
$this->url = new Url;
if(isset($params['image']))
$this->image = $params['image'];
else
$this->image = getImage();
if(isset($params['user']))
$this->user = $params['user'];
else
$this->user = new User;
if(isset($params['config']))
$this->config = $params['config'];
}
/**
* Adds the urls for the photo.
* pathWxH is a resource.
* photoWxH is an enumerated array [path, width, height]
*
* @param array $photo the photo object
* @param array $options Options for the photo such as crop (CR) and greyscale (BW)
* @param string $protocol http or https
* @return array
*/
public function addApiUrls($photo, $sizes, $token=null, $filterOpts=null, $protocol=null)
{
if($protocol === null)
$protocol = $this->utility->getProtocol(false);
foreach($sizes as $size)
{
$options = $this->generateFragmentReverse($size);
$fragment = $this->generateFragment($options['width'], $options['height'], $options['options']);
$path = $this->generateUrlPublic($photo, $options['width'], $options['height'], $options['options'], $protocol);
$photo["path{$size}"] = $path;
if(strstr($fragment, 'xCR') === false)
{
$dimensions = $this->getRealDimensions($photo['width'], $photo['height'], $options['width'], $options['height']);
$photo["photo{$fragment}"] = array($path, intval($dimensions['width']), intval($dimensions['height']));
}
else
{
$photo["photo{$fragment}"] = array($path, intval($options['width']), intval($options['height']));
}
}
$photo['path_base'] = $this->generateUrlBaseOrOriginal($photo, 'base');
// the original needs to be conditionally included
if($this->config->site->allowOriginalDownload == 1 || $this->user->isAdmin())
{
$photo['path_original'] = $this->generateUrlBaseOrOriginal($photo, 'original');
$photo['pathDownload'] = $this->generateUrlDownload($photo, $token);
}
elseif(isset($photo['path_original']))
{
unset($photo['path_original']);
}
$photo['url'] = $this->getPhotoViewUrl($photo, $filterOpts);
return $photo;
}
/**
* Delete a photo from the remote database and remote filesystem.
* This deletes the original photo and all versions.
*
* @param string $id ID of the photo
* @return boolean
*/
public function delete($id)
{
// TODO, validation
// TODO, do not delete record from db - mark as deleted
$photo = $this->db->getPhoto($id);
if(!$photo)
return false;
$fileStatus = $this->fs->deletePhoto($photo);
$dataStatus = $this->db->deletePhoto($photo);
return $fileStatus && $dataStatus;
}
/**
* Delete the source files of a photo from the remote filesystem.
* This deletes the original photo and all versions.
* Database entries are left in tact.
* Typically used for migration.
*
* @param string $id ID of the photo
* @return boolean
*/
public function deleteSourceFiles($id)
{
// TODO, validation
$photo = $this->db->getPhoto($id);
if(!$photo)
return false;
$fileStatus = $this->fs->deletePhoto($photo);
if(!$fileStatus)
$this->logger->warn(sprintf('Could not delete source photo from file system (%s)', $photo['id']));
$dbStatus = $this->db->deletePhotoVersions($photo);
if(!$dbStatus)
$this->logger->warn(sprintf('Could not delete source photo from database (%s)', $photo['id']));
return $fileStatus && $dbStatus;
}
/**
* Output the contents of the original photo
* Gets a file pointer from the adapter
* which can be a local or remote file
*
* @param array $photo photo object as returned from the API (not the DB)
* @return
*/
public function download($photo, $isAttachment = true)
{
$fp = $this->fs->downloadPhoto($photo);
if(!$fp)
return false;
header('Content-Type: image/jpeg');
if($isAttachment)
{
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="'.$photo['filename_original'].'"');
}
while($buffer = fgets($fp, 4096))
echo $buffer;
fclose($fp);
return true;
}
/**
* Versions of a photo are stored by a deterministic key in the database.
* Given $width, $height and $options this method returns that key.
*
* @param int $width Width of the photo to generate
* @param int $height Height of the photo to generate
* @param string $options Options for the photo such as crop (CR) and greyscale (BW)
* @return string
*/
public function generateCustomKey($width, $height, $options = null)
{
return sprintf('path%s', $this->generateFragment($width, $height, $options));
}
/**
* Generates the "fragment" for the photo version.
* This fragment is used in the file name as well as the database key.
*
* @param int $width Width of the photo to generate
* @param int $height Height of the photo to generate
* @param string $options Options for the photo such as crop (CR) and greyscale (BW)
* @return string
*/
public function generateFragment($width, $height, $options = null)
{
$fragment = "{$width}x{$height}";
if(!empty($options))
$fragment .= "x{$options}";
return $fragment;
}
/**
* Generate a version of the photo as specified by the width, height and options.
* This method requires the $hash be validated to keep random versions of images to be created.
* The photo is generated, uploaded to the remote file system and added to the database.
* Operations are done in place on a downloaded version of the base photo and this file name is returned.
*
* @param string $id The id of the photo.
* @param int $width The width of the requested photo.
* @param int $height The height of the requested photo.
* @param string $options Optional options to be applied on the photo
* @return mixed string on success, false on failure
*/
public function generate($id, $hash, $width, $height, $options = null)
{
if(!$this->isValidHash($hash, $id, $width, $height, $options))
return false;
$photo = $this->db->getPhoto($id);
if(!$photo)
{
$this->logger->crit(sprintf('Could not get photo from db in generate method (%s)', $id));
return false;
}
$filename = $this->fs->getPhoto($photo['path_base']);
if(!$filename)
{
$this->logger->crit(sprintf('Could not get photo from fs in generate method %s', $photo['path_base']));
return false;
}
try
{
$this->image->load($filename);
}
catch(OPInvalidImageException $e)
{
$this->logger->crit('Could not get image from image adapter in generate method', $e);
return false;
}
$maintainAspectRatio = true;
if(!empty($options))
{
$optionsArray = (array)explode('x', $options);
foreach($optionsArray as $option)
{
switch($option)
{
case 'BW':
$this->image->greyscale();
break;
case 'CR':
$maintainAspectRatio = false;
break;
}
}
}
$this->image->scale($width, $height, $maintainAspectRatio);
$this->image->write($filename, 'jpg');
$customPath = $this->generateCustomUrl($photo['path_base'], $width, $height, $options);
$key = $this->generateCustomKey($width, $height, $options);
$resFs = $this->fs->putPhoto($filename, $customPath, $photo['date_taken']);
$resDb = $this->db->postPhoto($id, array($key => $customPath));
// TODO unlink $filename
if($resFs && $resDb)
return $filename;
return false;
}
/**
* Does the opposite of $this->generateFragment.
* Given a string fragment this will return it's parts as an array.
* The $options must start with a width and height (i.e. 800x600)
*
* @param string $options Options for the photo such as crop (CR) and greyscale (BW)
* @return array
*/
public function generateFragmentReverse($options)
{
$options = explode('x', $options);
$width = array_shift($options);
$height = array_shift($options);
$options = implode('x', $options);
return array('width' => $width, 'height' => $height, 'options' => $options);
}
/**
* When a custom version of a photo needs to be generated it must be accompanied by a hash.
* This method generates that hash based on a secret and normalization of parameters.
* The method takes any number of arguments and processes them all.
*
* @param string $param1 any parameter value
* ...
* @param string $paramN any parameter value
* @return mixed string on success, FALSE on error
*/
public function generateHash(/*$args1, $args2, ...*/)
{
$args = func_get_args();
if(count($args) === 0)
return false;
foreach($args as $k => $v)
{
if(strlen($v) == 0)
unset($args[$k]);
}
$args[] = $this->config->secrets->secret;
return substr(sha1(implode('.', $args)), 0, 5);
}
/**
* Generates the default paths given a photo name.
* These paths will also be the initial versions of the photo that are stored in the file system and database.
* We need the prefix for the original to be different from the base
* A random number between 1,000,000 and 9,999,999 is sufficient when paired with the filename
*
* @param string $photoName File name of the photo
* @return array
*/
public function generatePaths($photoName, $date_taken)
{
$ext = substr($photoName, (strrpos($photoName, '.')+1));
$rootName = preg_replace('/[^a-zA-Z0-9.-_]/', '-', substr($photoName, 0, (strrpos($photoName, '.'))));
$baseName = sprintf('%s-%s.%s', $rootName, dechex(rand(1000000,9999999)), 'jpg');
$originalName = sprintf('%s-%s.%s', $rootName, uniqid(), $ext);
return array(
'path_original' => sprintf('/original/%s/%s', date('Ym', $date_taken), $originalName),
'path_base' => sprintf('/base/%s/%s', date('Ym', $date_taken), $baseName)
);
}
/**
* Obtain a public URL for the base photo.
*
* @param array $photo The photo object as returned from the database.
* @param string $protocol Protocol for the URL
* @return mixed string URL on success, FALSE on failure
*/
public function generateUrlBaseOrOriginal($photo, $type = 'base', $protocol = null)
{
if(!$protocol)
$protocol = $this->utility->getProtocol(false);
// force a protocol if specified in the configs for assets
// we only do this for static assets
// assets which need to run through the API to be generated inherit the current protocol
// See #1236
$assetProtocol = $protocol;
if(!empty($this->config->site->assetProtocol))
$assetProtocol = $this->config->site->assetProtocol;
if($type === 'base')
return "{$assetProtocol}://{$photo['host']}{$photo['path_base']}";
elseif($type === 'original')
return "{$assetProtocol}://{$photo['host']}{$photo['path_original']}";
}
/**
* Obtain a public URL for the original photo.
* If the user is the owner we return the URL to the static asset.
* If the user is logged in but not the owner we route through the API host.
*
* @param array $photo The photo object as returned from the database.
* @param string $protocol Protocol for the URL
* @return mixed string URL on success, FALSE on failure
*/
public function generateUrlDownload($photo, $token = null, $protocol = null)
{
if(!$protocol)
$protocol = $this->utility->getProtocol(false);
if($token)
return sprintf('%s://%s/photo/%s/token-%s/download', $protocol, $this->utility->getHost(), $photo['id'], $token);
else
return sprintf('%s://%s/photo/%s/download', $protocol, $this->utility->getHost(), $photo['id']);
}
/**
* Photo urls are either to existing files on the remote filesystem or a call back to this server to generate it.
* The requested photo is looked up in the database and if it exists is returned.
* If it does not exist then a URL which will generate, store and return it when called is returned.
*
* @param array $photo The photo object as returned from the database.
* @param int $width The width of the requested photo.
* @param int $height The height of the requested photo.
* @param string $options Optional options to be applied on the photo
* @param string $protocol Protocol for the URL
* @return mixed string URL on success, FALSE on failure
*/
public function generateUrlPublic($photo, $width, $height, $options = null, $protocol = null)
{
if(!$protocol)
$protocol = $this->utility->getProtocol(false);
// force a protocol if specified in the configs for assets
// we only do this for static assets
// assets which need to run through the API to be generated inherit the current protocol
// See #1236
$assetProtocol = $protocol;
if(!empty($this->config->site->assetProtocol))
$assetProtocol = $this->config->site->assetProtocol;
$key = $this->generateCustomKey($width, $height, $options);
if(isset($photo[$key]))
return "{$assetProtocol}://{$photo['host']}{$photo[$key]}";
elseif(isset($photo['id']))
return "{$protocol}://{$_SERVER['HTTP_HOST']}".$this->generateUrlInternal($photo['id'], $width, $height, $options); // TODO remove reference to HTTP_HOST
else
return false;
}
/**
* This is the method called if a version of a requested photo does not exist.
* It simply returns a url pointing back to the server which will generate the photo when called.
*
* @param string $id The id of the photo.
* @param int $width The width of the requested photo.
* @param int $height The height of the requested photo.
* @param string $options Optional options to be applied on the photo
* @return string
*/
// TODO make private and called via an API in the photo controller
public function generateUrlInternal($id, $width, $height, $options = null)
{
$fragment = $this->generateFragment($width, $height, $options);
$hash = $this->generateHash($id, $width, $height, $options);
return sprintf('/photo/%s/create/%s/%s.jpg', $id, $hash, $fragment);
}
/**
* Returns all albums a photo belongs to
*
* @param string Photo id
* @return array
*/
public function getAlbumsForPhoto($id)
{
return $this->db->getPhotoAlbums($id);
}
/**
* Calculate the width and height of a scaled photo
*
* @param int $originalWidth The width of the original photo.
* @param int $originalHeight The height of the original photo.
* @param int $newWidth The width of the new photo.
* @param int $newHeight The height of the new photo.
* @return array
*/
public function getRealDimensions($originalWidth, $originalHeight, $newWidth, $newHeight)
{
if(empty($originalWidth) || empty($originalHeight))
return array('width' => $newWidth, 'height' => $newHeight);
$originalRatio = $originalWidth / $originalHeight;
$newRatio = $newWidth / $newHeight;
if($originalRatio <= $newRatio)
{
$height = $newHeight;
$width = intval($newHeight / (1 / $originalRatio));
}
else
{
$width = $newWidth;
$height = intval($newWidth / $originalRatio);
}
return array('width' => $width, 'height' => $height);
}
/**
* Parse the exif date
*
* @param $exif the exif block
* @param $key the exif key to get the date from
* @return the parsed date or false if not found
*/
protected function parseExifDate($exif, $key)
{
// gh-1335
// rely on strtotime which handles the following formats which have been seen
// 2013/01/01 00:00:00
// 2013:01:01 00:00:00
if(array_key_exists($key, $exif))
return strtotime($exif[$key]);
return false;
}
/**
* Reads exif data from a photo.
*
* @param $photo Path to the photo.
* @return array
*/
protected function readExif($photo, $allowAutoRotate)
{
$exif = @exif_read_data($photo);
if(!$exif)
$exif = array();
$size = getimagesize($photo);
// DateTimeOriginal is the right thing. If it is not there
// use DateTime which might be the date the photo was modified
$parsedDate = $this->parseExifDate($exif, 'DateTimeOriginal');
if($parsedDate === false)
{
$parsedDate = $this->parseExifDate($exif, 'DateTime');
if($parsedDate === false)
{
if(array_key_exists('FileDateTime', $exif))
$parsedDate = $exif['FileDateTime'];
else
$parsedDate = time();
}
}
$date_taken = $parsedDate;
$width = $size[0];
$height = $size[1];
// Since we stopped auto rotating originals we have to use the Orientation from
// exif and if this photo was autorotated
// Gh-1031 Gh-1149
if($this->autoRotateEnabled($allowAutoRotate) && isset($exif['Orientation']))
{
// http://recursive-design.com/blog/2012/07/28/exif-orientation-handling-is-a-ghetto/
switch($exif['Orientation'])
{
case '6':
case '8':
case '5':
case '7':
$width = $size[1];
$height = $size[0];
break;
}
}
$exif_array = array('date_taken' => $date_taken, 'width' => $width,
'height' => $height, 'cameraModel' => @$exif['Model'],
'cameraMake' => @$exif['Make'],
'ISO' => @$exif['ISOSpeedRatings'],
'Orientation' => @$exif['Orientation'],
'exposureTime' => @$exif['ExposureTime']);
if(isset($exif['GPSLongitude'])) {
$exif_array['longitude'] = $this->getGps($exif['GPSLongitude'], $exif['GPSLongitudeRef']);
}
if(isset($exif['GPSLatitude'])) {
$exif_array['latitude'] = $this->getGps($exif['GPSLatitude'], $exif['GPSLatitudeRef']);
}
$exif_array['FNumber'] = $this->frac2Num(@$exif['FNumber']);
$exif_array['focalLength'] = $this->frac2Num(@$exif['FocalLength']);
return $exif_array;
}
public function transform($id, $transformations)
{
$photo = $this->db->getPhoto($id);
if(!$photo)
{
$this->logger->crit('Could not get photo from db in transform method');
return false;
}
$filename = $this->fs->getPhoto($photo['path_base']);
if(!$filename)
{
$this->logger->crit('Could not get photo from fs in transform method');
return false;
}
try
{
$this->image->load($filename);
}
catch(OPInvalidImageException $e)
{
$this->logger->crit('Could not get image from image adapter in transform method', $e);
return false;
}
// update the file on the file system and update the db with the path
$paths = $this->generatePaths($photo['filename_original']);
$updateFields = array('path_base' => $paths['path_base']);
foreach($transformations as $trans => $value)
{
switch($trans)
{
case 'rotate':
$this->image->rotate($value);
$updateFields['rotation'] = intval(($photo['rotation'] + $value) % 360);
break;
}
}
$updateFs = $this->fs->putPhoto($filename, $paths['path_base'], $photo['date_taken']);
$updateDb = $this->db->postPhoto($id, $updateFields);
unlink($filename);
// purge photoVersions
$delVersionsResp = $this->db->deletePhotoVersions($photo);
if(!$delVersionsResp)
return false;
return true;
}
/**
* Update the attributes of a photo in the database.
*
* @param string $id The id of the photo.
* @param array $attributes The attributes to save
* @return mixed string on success, false on failure
*/
public function update($id, $attributes = array())
{
if(empty($attributes))
return $id;
$tagObj = new Tag;
// to preserve json columns we have to do complete writes
$currentPhoto = $this->db->getPhoto($id);
unset($currentPhoto['id'], $currentPhoto['albums']);
$currentPhoto['tags'] = implode(',', $currentPhoto['tags']);
$attributes = array_merge($currentPhoto, $attributes);
$attributes = $this->prepareAttributes($attributes, null, null);
if(isset($attributes['tags']) && !empty($attributes['tags']))
$attributes['tags'] = $tagObj->sanitizeTagsAsString($attributes['tags']);
// trim all the attributes
foreach($attributes as $key => $val)
$attributes[$key] = $this->trim($val);
// since tags can be created adhoc we need to ensure they're here
if(isset($attributes['tags']) && !empty($attributes['tags']))
$tagObj->createBatch($attributes['tags']);
$status = $this->db->postPhoto($id, $attributes);
if(!$status)
return false;
return $id;
}
public function replace($id, $localFile, $name, $attributes = array())
{
// check if file type is valid
if(!$this->utility->isValidMimeType($localFile))
{
$this->logger->warn(sprintf('Invalid mime type for %s', $localFile));
return false;
}
$allowAutoRotate = isset($attributes['allowAutoRotate']) ? $attributes['allowAutoRotate'] : '1';
$exif = $this->readExif($localFile, $allowAutoRotate);
$iptc = $this->readIptc($localFile);
if(isset($attributes['date_taken']) && !empty($attributes['date_taken']))
$date_taken = $attributes['date_taken'];
elseif(isset($exif['date_taken']))
$date_taken = $exif['date_taken'];
else
$date_taken = time();
$resp = $this->createAndStoreBaseAndOriginal($name, $localFile, $date_taken, $allowAutoRotate);
$paths = $resp['paths'];
$attributes = array_merge($this->whitelistParams($attributes), $resp['paths']);
if($resp['status'])
{
$this->logger->info("Photo ({$id}) successfully stored on the file system (replacement)");
$fsExtras = $this->fs->getMetaData($localFile);
if(!empty($fsExtras))
$attributes['extraFileSystem'] = $fsExtras;
$defaults = array('title', 'description', 'tags', 'latitude', 'longitude');
foreach($iptc as $iptckey => $iptcval)
{
if(empty($iptcval))
continue;
if($iptckey == 'tags')
$attributes['tags'] = implode(',', array_unique(array_merge((array)explode(',', $attributes['tags']), $iptcval)));
else if(!isset($attributes[$iptckey])) // do not clobber if already in $attributes #1011
$attributes[$iptckey] = $iptcval;
}
foreach($defaults as $default)
{
if(!isset($attributes[$default]))
$attributes[$default] = null;
}
$exifParams = array('width' => 'width', 'height' => 'height', 'cameraMake' => 'exifCameraMake', 'cameraModel' => 'exifCameraModel',
'FNumber' => 'exifFNumber', 'exposureTime' => 'exifExposureTime', 'ISO' => 'exifISOSpeed', 'focalLength' => 'exifFocalLength', 'latitude' => 'latitude', 'longitude' => 'longitude');
foreach($exifParams as $paramName => $mapName)
{
// do not clobber if already in $attributes #1011
if(isset($exif[$paramName]) && !isset($attributes[$mapName]))
$attributes[$mapName] = $exif[$paramName];
}
$attributes['date_taken_day'] = date('d', $date_taken);
$attributes['date_taken_month'] = date('m', $date_taken);
$attributes['date_taken_year'] = date('Y', $date_taken);
$attributes['hash'] = sha1_file($localFile);
$attributes['size'] = intval(filesize($localFile)/1024);
$attributes['host'] = $this->fs->getHost();
$attributes['filename_original'] = $name;
$tagObj = new Tag;
if(isset($attributes['tags']) && !empty($attributes['tags']))
$tagObj->createBatch($attributes['tags']);
$photo = $this->db->getPhoto($id);
// normally we delete the existing photos
// in some cases we may have already done this (migration)
if(!isset($_POST['skipDeletes']) || empty($_POST['skipDeletes']))
{
$this->logger->info(sprintf('Purging photos in replace API for photo %s', $id));
// purge photoVersions
$delVersionsResp = $this->db->deletePhotoVersions($photo);
if(!$delVersionsResp)
{
$this->logger->info('Could not purge photo versions from the database');
return false;
}
// delete all photos from the original photo object (includes paths to existing photos)
// check if skipDeleteOriginal is passed in and remove from $photo and $attributes to preserve
if($skipOriginal === '1')
unset($photo['path_original']);
$delFilesResp = $this->fs->deletePhoto($photo);
if(!$delFilesResp)
{
$this->logger->info('Could not purge photo versions from the file system');
return false;
}
}
// trim all the attributes
foreach($attributes as $key => $val)
$attributes[$key] = $this->trim($val);
// update photo paths / hash
$updPathsResp = $this->db->postPhoto($id, $attributes);
unlink($localFile);
unlink($resp['localFileCopy']);
if($updPathsResp)
return true;
}
$this->logger->warn('Could not upload files for replacement');
return false;
}
/**
* Downloads a photo from a URL and stores it locally.
* Used in ApiShareController to attach a photo in an email.
*
* @param string $url URL of the photo to store locally
* @return mixed file pointer on success, FALSE on failure
*/
public function storeLocally($url)
{
$file = tempnam(sys_get_temp_dir(), 'opme-locally-');
$fp = fopen($file, 'w');
if(!$fp)
{
$this->logger->warn('Could not create file pointer to store photo locally');
return false;
}
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);
$curl_errno = curl_errno($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
fclose($fp);
if($curl_errno !== 0)
{
$this->logger->warn('Storing photo locally failed due to curl error');
return false;
}
if($code != '200')
{
$this->logger->warn('Fetching of photo to store locally did not return a 200 HTTP response');
return false;
}
return $file;
}
/**
* Uploads a new photo to the remote file system and database.
*
* @param string $localFile The local file system path to the photo.
* @param string $name The file name of the photo.
* @param array $attributes The attributes to save
* @return mixed string on success, false on failure
*/
public function upload($localFile, $name, $attributes = array())
{
// check if file type is valid
if(!$this->utility->isValidMimeType($localFile))
{
$this->logger->warn(sprintf('Invalid mime type for %s', $localFile));
return false;
}
$id = $this->user->getNextId('photo');
if($id === false)
{
$this->logger->crit('Could not fetch next photo ID');
return false;
}
$tagObj = new Tag;
$filename_original = $name;
$allowAutoRotate = isset($attributes['allowAutoRotate']) ? $attributes['allowAutoRotate'] : '1';
$exif = $this->readExif($localFile, $allowAutoRotate);
$iptc = $this->readIptc($localFile);
if(isset($attributes['date_taken']) && !empty($attributes['date_taken']))
$date_taken = $attributes['date_taken'];
elseif(isset($exif['date_taken']))
$date_taken = $exif['date_taken'];
else
$date_taken = time();
$resp = $this->createAndStoreBaseAndOriginal($name, $localFile, $date_taken, $allowAutoRotate);
$paths = $resp['paths'];
$attributes = $this->whitelistParams($attributes);
if($resp['status'])
{
$this->logger->info("Photo ({$id}) successfully stored on the file system");
$fsExtras = $this->fs->getMetaData($localFile);
if(!empty($fsExtras))
$attributes['extraFileSystem'] = $fsExtras;
$defaults = array('title', 'description', 'tags', 'latitude', 'longitude');
foreach($iptc as $iptckey => $iptcval)
{
if(empty($iptcval))
continue;
if($iptckey == 'tags')
$attributes['tags'] = implode(',', array_unique(array_merge((array)explode(',', $attributes['tags']), $iptcval)));
else if(!isset($attributes[$iptckey])) // do not clobber if already in $attributes #1011
$attributes[$iptckey] = $iptcval;
}
foreach($defaults as $default)
{
if(!isset($attributes[$default]))
$attributes[$default] = null;
}
$exifParams = array('width' => 'width', 'height' => 'height', 'cameraMake' => 'exifCameraMake', 'cameraModel' => 'exifCameraModel',
'FNumber' => 'exifFNumber', 'exposureTime' => 'exifExposureTime', 'ISO' => 'exifISOSpeed', 'focalLength' => 'exifFocalLength', 'latitude' => 'latitude', 'longitude' => 'longitude');
foreach($exifParams as $paramName => $mapName)
{
// do not clobber if already in $attributes #1011
if(isset($exif[$paramName]) && !isset($attributes[$mapName]))
$attributes[$mapName] = $exif[$paramName];
}
if(isset($attributes['date_uploaded']) && !empty($attributes['date_uploaded']))
$date_uploaded = $attributes['date_uploaded'];
else
$date_uploaded = time();
if($this->config->photos->autoTagWithDate == 1)
{
$dateTags = sprintf('%s,%s', date('F', $date_taken), date('Y', $date_taken));
if(!isset($attributes['tags']) || empty($attributes['tags']))
$attributes['tags'] = $dateTags;
else
$attributes['tags'] .= ",{$dateTags}";
}
if(isset($exif['latitude']))
$attributes['latitude'] = floatval($exif['latitude']);
if(isset($exif['longitude']))
$attributes['longitude'] = floatval($exif['longitude']);
if(isset($attributes['tags']) && !empty($attributes['tags']))
$attributes['tags'] = $tagObj->sanitizeTagsAsString($attributes['tags']);
// since tags can be created adhoc we need to ensure they're here
if(isset($attributes['tags']) && !empty($attributes['tags']))
$tagObj->createBatch($attributes['tags']);
$attributes['owner'] = $this->owner;
$attributes['actor'] = $this->getActor();
$attributes = array_merge(
$this->getDefaultAttributes(),
array(
'hash' => sha1_file($localFile), // fallback if not in $attributes
'size' => intval(filesize($localFile)/1024),
'filename_original' => $filename_original,
'width' => @$exif['width'],
'height' => @$exif['height'],
'date_taken' => $date_taken,
'date_taken_day' => date('d', $date_taken),
'date_taken_month' => date('m', $date_taken),
'date_taken_year' => date('Y', $date_taken),
'date_uploaded' => $date_uploaded,
'date_uploaded_day' => date('d', $date_uploaded),
'date_uploaded_month' => date('m', $date_uploaded),
'date_uploaded_year' => date('Y', $date_uploaded),
'path_original' => $paths['path_original'],
'path_base' => $paths['path_base']
),
$attributes
);
// trim all the attributes
foreach($attributes as $key => $val)
$attributes[$key] = $this->trim($val);
$stored = $this->db->putPhoto($id, $attributes, $date_taken);
unlink($localFile);
unlink($resp['localFileCopy']);
if($stored)
{
$this->logger->info("Photo ({$id}) successfully stored to the database");
return $id;
}
else
{
$this->logger->warn("Photo ({$id}) could NOT be stored to the database");
return false;
}
}
$this->logger->warn("Photo ({$id}) could NOT be stored to the file system");
return false;
}
/**
* Generates a path for a custom version of a photo.
* This defines in a deterministic way what the URL for this version of the photo will be.
*
* @param string $basePath Path to the base version of the photo from the database.
* @param int $width The width of the desired photo version.
* @param int $height The height of the desired photo version.
* @param string $options The options for the desired photo version.
* @return string The path to be used for this photo.
*/
private function generateCustomUrl($basePath, $width, $height, $options)
{
$fragment = $this->generateFragment($width, $height, $options);
$customPath = preg_replace('#^/base/#', '/custom/', $basePath);
if(stristr($customPath, '.') === false)
return "{$customPath}_{$fragment}.jpg";
$customName = substr($customPath, 0, strrpos($customPath, '.'));
return "{$customName}_{$fragment}.jpg";
}
/**
* The default attributes for a new photo.
*
* @return array Default values for a new photo
*/
private function getDefaultAttributes()
{
return array(
'app_id' => $this->config->application->app_id,
'host' => $this->fs->getHost(),
'views' => 0,
'status' => 1,
'permission' => 0, // TODO
'license' => ''
);
}
/**
* Generate photo view url for the API
*
* @return array Default values for a new photo
*/
private function getPhotoViewUrl($photo, $filterOpts=null)
{
return sprintf('%s://%s%s', $this->utility->getProtocol(false), $this->utility->getHost(false), $this->url->photoView($photo['id'], $filterOpts, false));
}
/**
* Validates the hash component of the generate new photo request.
*
* @param $hash The hash to validate
* @param $param2 One of the options
* ...
* @param $paramN One of the options
* @return boolean
*/
private function isValidHash(/*$hash, $args1, $args2, ...*/)
{
$args = func_get_args();
foreach($args as $k => $v)
{
if(strlen($v) == 0)
unset($args[$k]);
}
$args[] = $this->config->secrets->secret;
$hash = array_shift($args);
return (substr(sha1(implode('.', $args)), 0, 5) == $hash);
}
private function frac2Num($frac)
{
$parts = explode('/', $frac);
if (count($parts) <= 0)
return 0;
if (count($parts) == 1)
return $parts[0];
// DIV/0
if($parts[1] == 0)
return 0;
return floatval($parts[0]) / floatval($parts[1]);
}
/*** GPS Utils
* from http://stackoverflow.com/questions/2526304/php-extract-gps-exif-data
**/
private function getGps($exifCoord, $hemi)
{
$degrees = count($exifCoord) > 0 ? $this->frac2Num($exifCoord[0]) : 0;
$minutes = count($exifCoord) > 1 ? $this->frac2Num($exifCoord[1]) : 0;
$seconds = count($exifCoord) > 2 ? $this->frac2Num($exifCoord[2]) : 0;
$flip = ($hemi == 'W' or $hemi == 'S') ? -1 : 1;
return $flip * ($degrees + $minutes / 60 + $seconds / 3600);
}
private function autoRotate($file, $allowAutoRotate = false)
{
if($this->autoRotateEnabled($allowAutoRotate))
{
exec(sprintf('%s -ai %s', $this->config->modules->exiftran, escapeshellarg($file)));
}
}
protected function autoRotateEnabled($allowAutoRotate)
{
if($allowAutoRotate != '0' && is_executable($this->config->modules->exiftran))
return true;
return false;
}
protected function trim($string)
{
return preg_replace('/^([ \r\n]+)|(\s+)$/', '', $string);
}
private function createAndStoreBaseAndOriginal($name, $localFile, $date_taken, $allowAutoRotate)
{
$paths = $this->generatePaths($name, $date_taken);
// resize the base image before uploading
$localFileCopy = "{$localFile}-copy";
$this->logger->info("Making a local copy of the uploaded image. {$localFile} to {$localFileCopy}");
copy($localFile, $localFileCopy);
$this->autoRotate($localFileCopy, $allowAutoRotate);
$baseImage = $this->image->load($localFileCopy);
if(!$baseImage)
{
$this->logger->warn('Could not load image, possibly an invalid image file.');
return false;
}
$baseImage->scale($this->config->photos->baseSize, $this->config->photos->baseSize);
$baseImage->write($localFileCopy, 'jpg');
$uploaded = $this->fs->putPhotos(
array(
array($localFile => array($paths['path_original'], $date_taken)),
array($localFileCopy => array($paths['path_base'], $date_taken))
)
);
return array('status' => $uploaded, 'paths' => $paths, 'localFileCopy' => $localFileCopy);;
}
/**
* Reads IPTC data from a photo.
*
* @param $photo Path to the photo.
* @return array
*/
private function readIptc($photo)
{
$size = getimagesize($photo, $info);
$iptc_array = array();
if(isset($info['APP13']))
{
$iptc = iptcparse($info['APP13']);
if(!empty($iptc))
{
// TODO deal with charset
// TODO with alternates as both of these are arrays.
// TODO eventually HTML-ify the description
// get the title.
// sometime (like from Adobe software) it is in 2#005 instead of 2#105
// see https://github.com/openphoto/frontend/issues/260
if(isset($iptc['2#105']))
$iptc_array['title'] = $iptc['2#105'][0];
else if(isset($iptc['2#005']))
$iptc_array['title'] = $iptc['2#005'][0];
if(isset($iptc['2#120']))
$iptc_array['description'] = $iptc['2#120'][0];
if(isset($iptc['2#025']))
$iptc_array['tags'] = $iptc['2#025'];
}
}
return $iptc_array;
}
private function whitelistParams($attributes)
{
$returnAttrs = array();
$matches = array('id' => 1,'host' => 1,'app_id' => 1,'title' => 1,'description' => 1,'key' => 1,'hash' => 1,'tags' => 1,'size' => 1,'photo'=>1,'height' => 1,
'rotation'=>1,'altitude' => 1, 'latitude' => 1,'longitude' => 1,'views' => 1,'status' => 1,'permission' => 1,'albums'=>1,'groups' => 1,'license' => 1,
'path_base' => 1, 'path_original' => 1, 'date_taken' => 1, 'date_uploaded' => 1, 'filename_original' => 1 /* TODO remove in 1.5.0, only used for upgrade */);
$patterns = array('exif.*','date.*','extra.*');
foreach($attributes as $key => $val)
{
if(isset($matches[$key]))
{
$returnAttrs[$key] = $val;
continue;
}
foreach($patterns as $pattern)
{
if(preg_match("/^{$pattern}$/", $key))
{
$returnAttrs[$key] = $val;
continue;
}
}
}
return $returnAttrs;
}
}
|
Bagpipes, Braveheart and the bonnie banks of Loch Lomond, think you know everything there is to know about Scotland’s history, tradition, and roots? Think again. Scotland is a land with great history and scenic landscapes. Thousands of acres of green stretch from the ragged coastline up the hills to be replaced by scenic mountains, lakes, castles, and churches.
Glasgow has transformed itself from an industrial city to one of the cultural capitals of Europe. It combines the energy and sophistication of a great international city with some of Europe’s most spectacular scenery. Glasgow boasts world famous art collections, the best shopping in the UK outside London, and the most vibrant and exciting nightlife. Just beyond the city of Glasgow lies some of Scotland’s most beautiful scenery. The local area is rich in history and heritage and each of its delightful country towns and villages has its own fascinating tale to tell.
Kibble Palace and much more!
Scotland’s capital city, Edinburgh, is famous for its history, architecture, festivals, friendly people, and city walking. The city is divided between the Old Town and the New Town. The Old Town is where you will find the vast amount of ancient buildings, while the New Town is dominated by business, order, and classical Georgian architecture. A great way to get a good feel for the city is to take one of the Open Top Bus City Tours. The majority of these tours allow you to hop on and off as you wish at each stop.
The Scotch Whisky Experience and much more!
St. Andrews has a special place in Scottish history and legend, taking its name from the saint whose relics were brought to the town. It played an important role in Scotland’s affairs, its cathedral was the largest building in Scotland and it was the centre of the country’s religious life. It has the oldest university in Scotland (Prince William studied here) and, of course, has been a pilgrimage to golfers wishing to play on the links where golf was first played. The historic town is easily and best explored on foot where the shops, many interesting buildings, museums, bars and restaurants are all easily accessible.
Cambo Estate Gardens and much more!
Stirling is Scotland’s heritage capital, where the Wars of Independence were fought and won; where, for three centuries, monarchs ruled in regal splendor and where merchants and craftsmen plied their trade below the castle rock. Nowadays you can literally touch and feel the sense of history and nationhood, which is Stirling’s trademark, as you meander through the Old Town, enter the spectacular cliff-top castle or sample the town’s unique ‘living history’ events program.
Rob Roy’s Grave and much more! |
Inspection Robots for Pipeline Leaks — Inuktun Services Ltd.
When you consider the current pipeline inventory in Canada alone is an estimated 840,000 kilometres, the requirement for structural integrity assessment and leak detection is critical for reducing associated human and environmental risks. Deploying inspection robots for pipe inspection not only eliminates the need for confined space entry or direct human intervention in potentially hazardous environments, it also allows for objective reporting of real-time conditions and comparative data results.
The integrity of pipelines relies on the integrity of its inspection equipment, and IM3™ (Multi-Mission Modular) technology delivers. See far in advance to reduce risk with our robotic solutions. Inuktun’s Spectrum™ cameras and Versatrax™ crawlers can be found performing remote visual inspection (RVI) of transmission and distribution lines; boiler, furnace tubes and HVAC ducting; high energy pipes; trenchless construction and civil engineering operations; process pipes; sewer and storm drains; difficult to inspect and unpiggable pipes – and so much more. IM3™ technology is designed to perform in-service pipe inspections of a multitude of pipelines transporting various commodities with unique operating characteristics and a wide range of environmental settings.
Learn more about Inuktun’s robotic solutions for integrity assessments during ASME’s webinar on Inspection Robots: Pipeline Leaks taking place on April 23, 2019. This webinar features two leaders in pipeline robotic inspection, including our very own Wes Kirkland, Director of US Field Sales Operations for Eddyfi Technologies. Wes will explain how IM3™ technology inspects pipes for leaks, corrosion, and remaining useful life as well as best practices for employing inspection robots as part of an ongoing inspection and maintenance program. Get your questions ready and sign up for this event here!
With Eddyfi Technologies’ recent acquisition of Inuktun, our product offering expands beyond RVI to powerful nondestructive testing options for even more comprehensive structural integrity assessments. Contact our team to discuss your specific requirements for collecting repeatable, actionable, meaningful and preventative data today. |
Can anyone help with the meaning of the writing in the top right and left of this print. I have tentatively identified the signature lower left as Ichikawa Yoshikazu also known as Yoshikazu Utagawa. There is also writing in the left hand margin but the print has been trimmed through it and so it may not be readable. |
Maybe this will kind of explain it (absent holdbacks of course)!
I sent this email to Teresa Fuller today in an effort to get some understanding regarding how the IA Website is going to be handled in the interest of the Public. As a member of the media I don’t mind doing a PRR, even though it does add to the burden of the City Clerk’s Office. My thought is that it would be helpful to the Public who actually want to read what went on and draw their own conclusions. I actually thought that was the intent of posting the IA Investigations. I don’t mind reporters picking aspects of an IA Report that they think are important and writing a story from it, it’s just that sometimes I might or the Public might see something that they feel is significant. That is why I always try to give you the links so you can make your own judgement. So I hope everyone including Officer Fuller realize some of what I’m doing here.
Previous PostWHAT IS THE BIG SECRET??Next PostA FLY ON THE WALL! |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta name="Keywords" content="photography,software,photos,digital darkroom,gallery,image,photographer,adobe,photoshop,lightroom" >
<meta name="generator" content="Adobe Photoshop Lightroom" >
<title>Channel Islands July/August 2011</title>
<link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="./custom.css" >
<link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="../resources/css/master.css" >
<script type="text/javascript">
window.AgMode = "publish";
cellRolloverColor="#A1A1A1";
cellColor="#949494";
</script>
<script type="text/javascript" src="../resources/js/live_update.js">
</script>
<!--[if lt IE 7.]> <script defer type="text/javascript" src="../resources/js/pngfix.js"></script> <![endif]-->
<!--[if gt IE 6]> <link rel="stylesheet" href="../resources/css/ie7.css"></link> <![endif]-->
<!--[if lt IE 7.]> <link rel="stylesheet" href="../resources/css/ie6.css"></link> <![endif]-->
</head>
<body>
<div id="wrapper_large">
<div id="sitetitle">
<h1 onclick="clickTarget( this, 'metadata.siteTitle.value' );" id="metadata.siteTitle.value" class="textColor">Channel Islands July/August 2011</h1>
</div>
<div id="collectionHeader">
<h1 onclick="clickTarget( this, 'metadata.groupTitle.value' );" id="metadata.groupTitle.value" class="textColor">Diving on the Horizon</h1>
<p onclick="clickTarget( this, 'metadata.groupDescription.value' );" id="metadata.groupDescription.value" class="textColor">Web Photo Gallery created by Adobe Lightroom.</p>
</div>
<div id="stage2">
<div id="previewFull" class="borderTopLeft borderBottomRight">
<div id="detailTitle" class="detailText">
</div>
<div class="detailNav">
<ul>
<li class="previous"> <a class="paginationLinks detailText" href="../content/Channel_Islands_20100801_60_large.html">Previous</a> </li>
<li class="index"> <a href="../index_3.html" class="detailLinks detailText">Index</a> </li>
<li class="next"> <a class="paginationLinks detailText" href="../content/Channel_Islands_20100801_66_large.html">Next</a> </li>
</ul>
</div>
<a href="../index_3.html">
<div style="margin-left:15px;">
<div class="dropShadow">
<div class="inner">
<img src="images/large/Channel_Islands_20100801_65.jpg"
class="previewFullImage preview"
id="previewImage"
alt=""
onclick="var node=parentNode.parentNode.parentNode.parentNode; if( node.click ) { return node.click(); } else { return true; }">
</div>
</div>
</div>
</a>
<div style="clear:both; height:5px"></div>
<div id="detailCaption" class="detailText">
</div>
</div>
</div>
<div class="clear">
</div>
<div id="contact">
<a href="mailto:[email protected]"> <span
class="textColor" id="metadata.contactInfo.value">Gregg Kellogg</span>
</a>
</div>
<div class="clear">
</div>
</div>
</body>
</html>
|
KB Spoon Holographic has a penetrating shine that can draw fish from up to 50 yards away. This spoon dates back to 1929 and is known as "The Big Fish Spoon". A distingtive 2 in 1 spoon that can be utilized at either end. Place the hook at the large end for wide wobbling action and mid depth running. Switch hook to small end for tighter wobble, more vibration and deeper running. Good for casting, trolling or vertical jigging. KB Spoon...Truly the Stuff of Legends!
detailedDescription":"KB Spoon Holographic Series 1/4 oz 1-1/2\" Long. Unique hour glass shape. Come in 10 holographic, highly reflective, 3D colors with nickel backs. Great for ice fishing, panfish, walleye and trout. |
# Dynamodb2
TODO: Write a gem description
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'dynamodb2'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install dynamodb2
## Usage
TODO: Write usage instructions here
## Contributing
1. Fork it ( https://github.com/[my-github-username]/dynamodb2/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
|
<?php
/*********************************************************************************
* Zurmo is a customer relationship management program developed by
* Zurmo, Inc. Copyright (C) 2014 Zurmo Inc.
*
* Zurmo is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* Zurmo is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact Zurmo, Inc. with a mailing address at 27 North Wacker Drive
* Suite 370 Chicago, IL 60606. or at email address [email protected].
*
* The interactive user interfaces in original and modified versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the Zurmo
* logo and Zurmo copyright notice. If the display of the logo is not reasonably
* feasible for technical reasons, the Appropriate Legal Notices must display the words
* "Copyright Zurmo Inc. 2014. All rights reserved".
********************************************************************************/
/**
* Pseudo-validator. Used to mark an attribute
* as read-only.
*/
class RedBeanModelReadOnlyValidator extends CValidator
{
/**
* See the yii documentation.
*/
// The RedBeanModel is commented out here because the method
// definition must match that of the base class.
protected function validateAttribute(/*RedBeanModel*/ $model, $attributeName)
{
}
}
?>
|
import * as React from "react";
import { CarbonIconProps } from "../../";
declare const Product16: React.ForwardRefExoticComponent<
CarbonIconProps & React.RefAttributes<SVGSVGElement>
>;
export default Product16;
|
A life path since childhood, hospitality seems to run in Lucienne Anhar’s blood. Her family is passionate about food to the point of obsession – her 98 year-old grandmother still cooks the best Javanese Peranakan dishes at home and often frequents the street food vendors in her hometown. Lucienne studied hospitality and food and beverage at Ecole Hoteliere de Lausanne for four years, then worked in fine dining restaurants in Europe and the Caribbean, before moving to New York where she dined at as many restaurants as humanly possible. Returning to her family business, the Tugu Hotels & Restaurants Group in Indonesia, she helped design and open a number of unique hotels and restaurants in Bali, Jakarta and Lombok, aiming to transport guests to the beautifully ethereal, grandiose era of Indonesian history through art, antiques, and cultural experiences. She loves discovering, tasting and learning about the most authentic and local flavours wherever she travels, and while in Indonesia, she continuously searches for and experiments the best and widest array of sambals of the many islands in the Indonesian archipelago. |
Flying Skunk is a hybrid between Lowryder #2 and an old skool Skunk from the nineties. The result is an autoflowering variety which will take you back in time.
The old school indica dominant Skunk is one of the most stable and reliable varieties available on the market today. Pairing it with a Lowryder #2 was a no-brainer which created the extremely stable hybrid Flying Skunk as a result. She's a very quick grower and the first signs of flowering are already noticeable after 17-18 days. She has a typical indica christmas tree shape with a dense leaf structure and dense, solid buds which spread a strong scent during flowering.
The effect of the Flying Skunk is very mellow and it brings a chill vibe. Ideal for an evening with friends or relaxing on the couch. The taste is just like a Skunk is supposed to taste: soft, spicy and refreshing. Let the buds dry for at least 2 weeks in order to get the maximum taste and effect from your Flying Skunk.
Flying Skunk is 100% autoflowering and will complete her life cycle in 65 - 70 days. From seed to harvest! |
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.ecr.model;
import java.io.Serializable;
/**
*
*/
public class ListImagesResult implements Serializable, Cloneable {
/**
* <p>
* The list of image IDs for the requested repository.
* </p>
*/
private java.util.List<ImageIdentifier> imageIds;
/**
* <p>
* The <code>nextToken</code> value to include in a future
* <code>ListImages</code> request. When the results of a
* <code>ListImages</code> request exceed <code>maxResults</code>, this
* value can be used to retrieve the next page of results. This value is
* <code>null</code> when there are no more results to return.
* </p>
*/
private String nextToken;
/**
* <p>
* The list of image IDs for the requested repository.
* </p>
*
* @return The list of image IDs for the requested repository.
*/
public java.util.List<ImageIdentifier> getImageIds() {
return imageIds;
}
/**
* <p>
* The list of image IDs for the requested repository.
* </p>
*
* @param imageIds
* The list of image IDs for the requested repository.
*/
public void setImageIds(java.util.Collection<ImageIdentifier> imageIds) {
if (imageIds == null) {
this.imageIds = null;
return;
}
this.imageIds = new java.util.ArrayList<ImageIdentifier>(imageIds);
}
/**
* <p>
* The list of image IDs for the requested repository.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if
* any). Use {@link #setImageIds(java.util.Collection)} or
* {@link #withImageIds(java.util.Collection)} if you want to override the
* existing values.
* </p>
*
* @param imageIds
* The list of image IDs for the requested repository.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ListImagesResult withImageIds(ImageIdentifier... imageIds) {
if (this.imageIds == null) {
setImageIds(new java.util.ArrayList<ImageIdentifier>(
imageIds.length));
}
for (ImageIdentifier ele : imageIds) {
this.imageIds.add(ele);
}
return this;
}
/**
* <p>
* The list of image IDs for the requested repository.
* </p>
*
* @param imageIds
* The list of image IDs for the requested repository.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ListImagesResult withImageIds(
java.util.Collection<ImageIdentifier> imageIds) {
setImageIds(imageIds);
return this;
}
/**
* <p>
* The <code>nextToken</code> value to include in a future
* <code>ListImages</code> request. When the results of a
* <code>ListImages</code> request exceed <code>maxResults</code>, this
* value can be used to retrieve the next page of results. This value is
* <code>null</code> when there are no more results to return.
* </p>
*
* @param nextToken
* The <code>nextToken</code> value to include in a future
* <code>ListImages</code> request. When the results of a
* <code>ListImages</code> request exceed <code>maxResults</code>,
* this value can be used to retrieve the next page of results. This
* value is <code>null</code> when there are no more results to
* return.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
* <p>
* The <code>nextToken</code> value to include in a future
* <code>ListImages</code> request. When the results of a
* <code>ListImages</code> request exceed <code>maxResults</code>, this
* value can be used to retrieve the next page of results. This value is
* <code>null</code> when there are no more results to return.
* </p>
*
* @return The <code>nextToken</code> value to include in a future
* <code>ListImages</code> request. When the results of a
* <code>ListImages</code> request exceed <code>maxResults</code>,
* this value can be used to retrieve the next page of results. This
* value is <code>null</code> when there are no more results to
* return.
*/
public String getNextToken() {
return this.nextToken;
}
/**
* <p>
* The <code>nextToken</code> value to include in a future
* <code>ListImages</code> request. When the results of a
* <code>ListImages</code> request exceed <code>maxResults</code>, this
* value can be used to retrieve the next page of results. This value is
* <code>null</code> when there are no more results to return.
* </p>
*
* @param nextToken
* The <code>nextToken</code> value to include in a future
* <code>ListImages</code> request. When the results of a
* <code>ListImages</code> request exceed <code>maxResults</code>,
* this value can be used to retrieve the next page of results. This
* value is <code>null</code> when there are no more results to
* return.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public ListImagesResult withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getImageIds() != null)
sb.append("ImageIds: " + getImageIds() + ",");
if (getNextToken() != null)
sb.append("NextToken: " + getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ListImagesResult == false)
return false;
ListImagesResult other = (ListImagesResult) obj;
if (other.getImageIds() == null ^ this.getImageIds() == null)
return false;
if (other.getImageIds() != null
&& other.getImageIds().equals(this.getImageIds()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null
&& other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode
+ ((getImageIds() == null) ? 0 : getImageIds().hashCode());
hashCode = prime * hashCode
+ ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public ListImagesResult clone() {
try {
return (ListImagesResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
} |
Global warming is my top issue, which led to my voting for Brady Walkinshaw over Pramila Jayapal. Walkinshaw gets the urgency of this issue in a way that Jayapal does not. While I support issues like immigrant rights and equal pay, making anything other than combating climate change your top issue is akin to arguing over the bar tab on the Titanic.
I am also supporting I-732, the revenue-neutral carbon tax, as an appropriate first step. Does it do enough? No. But it’s a statewide initiative whose success will depend on at least some support from Eastern Washington, where I grew up. The people of Spokane, Yakima and Wenatchee could care less if it doesn’t right all of the environmental justice wrongs of our carbon culture — indeed, a more progressive strategy would be doomed to fail.
The carbon tax, I-732, is the most important issue on the ballot this election. Voters have the opportunity to break the partisan log-jam in the U.S. by taking action on global warming. When combined with the policies of British Columbia, California and Oregon, it would establish a price on carbon for a combined economy that would rank as the world’s fifth largest. Let that sink in: Larger than France, India, Brazil or Italy. And once it is passed, it would be model legislation for other states to adopt.
Washingtonians have a reputation as entrepreneurs, risk-takers and visionaries. I-732 follows in that tradition by being the most aggressive tax on carbon in the world. At the same time, it would address known shortcomings in our tax code by repealing the archaic B&O tax and reducing the regressive sales tax by 1 percent.
Prosperity is the most important goal for our country. Wishing for economic well-being for as many people as possible in our country is like wishing for three more wishes, because prosperity can snowball and give us more control over our future as individuals, families, communities and regions and as a country. We need prosperity to invest in education, prepare for our energy future and build the infrastructure we need to handle the future.
It is crucial that all segments of society have opportunities to earn that prosperity, because people are motivated and willing to be productive when they feel they have a shot at leading a productive life, and that in turn makes our whole society more productive — and we will need all hands on deck and all minds engaged to be ready for what the future throws at us. While it may seem like a focus on economic well-being would point me toward a vote for a Republican president, I feel that republicans effectively squash motivation among low and mid-earners by increasing the gap between rich and poor, reducing expectations and hope when we need exactly the opposite. For that reason, I voted for Hillary Clinton.
As a farmer and county farm bureau president (Yakima) my votes are driven by desperation to remain competitive in a brutal, global economic environment. Initiatives and politicians that would promote regulations and taxes and would increase costs at a time when nearly all agricultural commodities are down in price, some by two-thirds from the high, are an intolerable burden for Washington state agriculture.
The two initiatives with the greatest negative impact on farmers are I-1433, which would increase the minimum wage and I-732, which would impose a carbon tax. I voted against both. We pay the highest minimum wage in Washington compared to every country save Australia. A carbon tax would increase the costs of fuel and fertilizer, would reduce labor mobility and would offshore processing to other states and countries.
Down-ballot the most important votes to me were for the three insurgent Washington State Supreme Court candidates, who are David DeWolf, Greg Zempel and Dave Larson. The present supreme court seems economically illiterate and hopelessly detached from the negative impact of its rulings on small farmers and the business community. Finally, I enthusiastically voted for Steve McLaughlin for commissioner of public lands. He is the only candidate with actual experience in public-lands management.
Economic security for middle-class working Americans is the most important issue. I felt Bernie Sanders was the best choice for this issue. As he did not secure the nomination, I am currently undecided between Hillary Clinton and Jill Stein. Decision forthcoming.
My top issues are protection of Social Security benefits, including higher cost-of-living adjustments and a fairer method of determining them for people on fixed incomes in times of rising prices that aren’t being honestly portrayed or calculated. Hillary Clinton and all other Democrats are vastly superior to any Republican and the entire Republican platform, the latter of which would cut or privatize Social Security. At best, Donald Trump just wants the system to take care of itself, supposedly by vaguely improving the economy through nebulous methods that never worked in the past. By contrast, Clinton has said she supports measures to preserve or even expand Social Security, such as raising the cap — such an obvious fix.
Don’t let Donald Trump anywhere near the White House. Hillary Clinton is more qualified, without question.
Yet that repellent man still has a chance? How is this even possible? The GOP has shown that it can’t govern, by obstructing everything that would help this country. They are acting like petulant children and must be replaced with people who will do their job. This election is about sanity versus vanity. I pray the voters make the choice that would help the most Americans.
I am most concerned with the protection of individual liberty and ensuring that government continues to let us live our lives to the fullest. This led me to vote for mostly Republican and Libertarian candidates. This is important to me because, in my view, the amount of individual liberty we have is quickly shrinking in all areas, whether it be economically, legally or otherwise.
What is important to me in this election is post-election healing and restoring faith in government. I think the Republican candidate for president has set our country back at least 50 years — that it’s ok to be a racist, to be unethical in how you treat your customers and clients and being all about self. While the Democratic candidate may have issues, I believe she has the best of intentions on how we should treat our fellow human beings.
Getting a ninth U.S. Supreme Court justice confirmed and ending the congressional gridlock is the most important issue. I put the blame for the current state of the country’s frame of mind solely on the refusal of Congress to do it’s job of representing the people of the country. It is not for them to just raise money for their next campaign.
The issue that matters most to me is restoring confidence in our government — being confident that the electorate and elected alike understand and respect the foundations of our country. These include three branches of government each with separate powers and responsibilities with rule of law. A healthy democracy absolutely relies on a free press and that we all share responsibility for the things that benefit us all — clean air and water, a safe and efficient transportation system, education, military.
Would I choose a doctor or builder or mechanic — let alone a president — who knows next to nothing about how to do the job or how to separate fact from fiction? Of course not. I have to have confidence that the president is competent and knowledgeable. Nothing matters to me as much as having a safe and sane federal government, which is why I am voting for Hilary Clinton.
Constitutional government is my issue. The intricacy of our system of government, with separated powers, checks, balances and a division of responsibilities, is vital — seemingly beyond the capacity of the press to explain or fpr inattentive voters to appreciate.
The anti-government bias, the hate, the cynicism, the stinginess, the egotism that the far right wing has embraced are treated as normal, though arising from the basest motives. This accounts for the appeal of Donald Trump. The ability of Republican leaders to pretend obstruction rather than loyal opposition fulfills their oath to defend the Constitution. The notion that a proposal’s merit is determined by its pocketbook impact, not justice, fairness or public benefit.
The Democratic Party today has the public servants who want government to benefit all of us, not just a few. Republicans, who like to hate government — favor unlimited arms over peace and prize ignorance over education and science — chose a lazy power monger who blames their victims for the problems their greed has caused. I voted for leaders ready for the hard work to undo the damage humans have done to the earth. I did not vote for any Republicans.
I expect my government to work. Period. My taxes pay politicians’ salaries, and I am not a fan of the current Congress and its need for endless witch hunts. America has issues to be dealt with.
I find the need of our Congress to spend our money on endless partisan committees a slap in the face of taxpayers.More than $25 million was spent on eight Benghazi committees. Under the Bush administration, there were multiple embassy attacks and more than 30 good Americans lost their lives in service to our country. Not one hearing; not one committee.
Work ethic matters. I grew up in a time when both parties worked together to solve problems, not create new ones. Integrity matters, and I find very little in our current Congress.
We are supposed to all be Americans first, party voters second. I love my country and do not believe that all this hate and venom are good for us. “Land of the brave” has become the land of the whiner, the fearful, the crybaby. Perhaps the terrible people we are electing are a true reflection of our lost souls. Not much dignity or integrity these days. Makes me very sad.
Nikolaj Lasbo: 206-464-2326 or [email protected]; on Twitter: @NikolajLasbo. |
A wonderful creation from the humble origins of British cooking. These Yorkshire puddings are light, crispy and crunchy, with meaty pork sausages added. At Wickedfood Earth Country Cooking School we make them in our Sausage-making Workshop, and serve them with a delicious onion gravy. The Yorkshire puddings need to be made at the last minute and served as soon as they come out of the oven.
Heat the lard/oil in a large casserole pot or frying pan with a lid. Add the sausages and brown all sides (no need to cook them through). Remove them from the pan and set aside.
Add the sliced onion and fry over a low heat for ± 20 minutes till soft, taking care that they do not colour. Once cool, slice in half length ways, and then in half again horizontally so you get 4 pieces from each sausage.
Add the red wine, bring to the boil and reduce by half. Add the stock, Worcestershire sauce and tomato paste, bring back to the boil and simmer on low for ± 20 minutes. Season with salt.
Pre-heat your oven to 230°C. Grease a 12-cup muffin pan.
Sift the flour and salt together in a mixing bowl.
Add the eggs and stir, slowly add the milk to make a smooth batter. Beat in the cold water.
About 20 minutes before you are ready to serve, put ±1 t of lard/oil into each individual muffin cup, together with 2 pieces of sausage.
Place the muffin pan into the pre-heated oven for ±3 minutes.
Working quickly, when the fat is sizzling hot, divide the batter among the individual muffin pan cups and bake in the oven for ±20 minutes until well risen, puffy and brown.
Remove and serve immediately, with onion gravy on the side. |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RotatingWalkInMatrix.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RotatingWalkInMatrix.Tests")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("793f4bfb-afae-420b-86e6-1090ef30f8a9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Eleanor Roosevelt (October 11, 1884 – November 7, 1962) created a new standard for First Ladies because instead of retreating to a private life of decorating and entertaining, Eleanor continued her public life by holding press conferences, giving lectures, doing radio broadcasts, and writing a daily syndicated newspaper column. She was an outspoken advocate for social justice for women and minorities both during her stint as First Lady of the United States (1933-1945) and afterwards.
"After her husband [Franklin D. Roosevelt] suffered a polio attack in 1921, Eleanor stepped forward to help Franklin with his political career. When her husband became president in 1933, Eleanor dramatically changed the role of the first lady. " Learn more with seven short videos, and one full television episode (forty-six minutes long.) There is a Quick Facts section in the left-hand column, and a two-page biography feature as well.
"For seven years she [Eleanor Roosevelt] represented the United States at the United Nations (UN), which was created in large part by her husband. While a member, she helped to write the Universal Declaration of Human Rights which described that people throughout the world should be treated fairly and had certain rights that no government should be able to take away." Visit Ducksters for a comprehensive biography for elementary and middle-school students, an audio version of the page, and a ten-question quiz.
"As she [Eleanor Roosevelt] moved from first lady to diplomat to citizen activist, she not only became the most ardent champion of human rights, but also one of the century's most prolific journalists – publishing more than 8,000 columns, 580 articles, 27 books, 100,000 letters, delivering over 1000 speeches, and appearing on more than 300 radio and television shows." This research center at The George Washington University is working to bring Eleanor's "voice back into the written record."
"Both her [Eleanor Roosevelt's] parents died when she was a child, her mother in 1892, and her father in 1894. After her mother's death, Eleanor went to live with her grandmother, Mrs. Valentine G. Hall, in Tivoli, New York. She was educated by private tutors until the age of 15, when she was sent to Allenswood, a school for girls in England." Visit the FDR Library site for an Eleanor biography with Fast Facts and a timeline. The bio is also available as a printable three-page PDF.
Although the full video from this PBS television special is not available online, there is lots of collateral material worth seeing. It includes a biography, a timeline, bonus video clips and a multimedia interactive about Eleanor's goodwill tour of the South Pacific in 1943. "To make her trip useful, Eleanor, traveling as a representative of the Red Cross, inspected the organization's installations on the islands. She kept the plans of her trip a secret and made the 10,000 mile journey to Australia alone so as not to incur criticism for disrupting military operations."
Feldman, Barbara. "Eleanor Roosevelt." Surfnetkids. Feldman Publishing. 9 Oct. 2018. Web. 21 Apr. 2019. <https://www.surfnetkids.com/resources/eleanor-roosevelt/ >.
By Barbara J. Feldman. Originally published October 9, 2018. Last modified October 9, 2018. |
/*
* Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "platform/heap/Visitor.h"
#include "platform/heap/Handle.h"
#include "platform/heap/Heap.h"
namespace blink {
// GCInfo indices start from 1 for heap objects, with 0 being treated
// specially as the index for freelist entries and large heap objects.
int GCInfoTable::s_gcInfoIndex = 0;
size_t GCInfoTable::s_gcInfoTableSize = 0;
GCInfo const** s_gcInfoTable = nullptr;
void GCInfoTable::ensureGCInfoIndex(const GCInfo* gcInfo, size_t* gcInfoIndexSlot)
{
ASSERT(gcInfo);
ASSERT(gcInfoIndexSlot);
// Keep a global GCInfoTable lock while allocating a new slot.
AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex);
MutexLocker locker(mutex);
// If more than one thread ends up allocating a slot for
// the same GCInfo, have later threads reuse the slot
// allocated by the first.
if (*gcInfoIndexSlot)
return;
int index = ++s_gcInfoIndex;
size_t gcInfoIndex = static_cast<size_t>(index);
ASSERT(gcInfoIndex < GCInfoTable::maxIndex);
if (gcInfoIndex >= s_gcInfoTableSize)
resize();
s_gcInfoTable[gcInfoIndex] = gcInfo;
releaseStore(reinterpret_cast<int*>(gcInfoIndexSlot), index);
}
void GCInfoTable::resize()
{
// (Light) experimentation suggests that Blink doesn't need
// more than this while handling content on popular web properties.
const size_t initialSize = 512;
size_t newSize = s_gcInfoTableSize ? 2 * s_gcInfoTableSize : initialSize;
ASSERT(newSize < GCInfoTable::maxIndex);
s_gcInfoTable = reinterpret_cast<GCInfo const**>(realloc(s_gcInfoTable, newSize * sizeof(GCInfo)));
ASSERT(s_gcInfoTable);
memset(reinterpret_cast<uint8_t*>(s_gcInfoTable) + s_gcInfoTableSize * sizeof(GCInfo), 0, (newSize - s_gcInfoTableSize) * sizeof(GCInfo));
s_gcInfoTableSize = newSize;
}
void GCInfoTable::init()
{
RELEASE_ASSERT(!s_gcInfoTable);
resize();
}
void GCInfoTable::shutdown()
{
free(s_gcInfoTable);
s_gcInfoTable = nullptr;
}
StackFrameDepth* Visitor::m_stackFrameDepth = nullptr;
#if ENABLE(ASSERT)
void assertObjectHasGCInfo(const void* payload, size_t gcInfoIndex)
{
HeapObjectHeader::fromPayload(payload)->checkHeader();
#if !defined(COMPONENT_BUILD)
// On component builds we cannot compare the gcInfos as they are statically
// defined in each of the components and hence will not match.
BaseHeapPage* page = pageFromObject(payload);
ASSERT(page->orphaned() || HeapObjectHeader::fromPayload(payload)->gcInfoIndex() == gcInfoIndex);
#endif
}
#endif
}
|
# examples
Code examples
|
Do you want to move forward in your approach to the Armenian market? Looking to identify distributors, importers, partners or direct customers?Opt for a prospecting mission that will accompany you in your search for business partners. The CCI FA will be in charge of organizing a meeting program with the decision makers of the companies selected according to your specifications. The CCI France Armenia puts at your disposal its experience, its network, its files and its staff to help you to identify reliable partners.
The CCI France Arménie is in charge of contacting and confirming appointments made with prospects who have been rigorously selected together with the company. On this basis, an appointment schedule is established.A summary of the mission is given to you. Any follow-up actions to be implemented are then studied.
A post-mission follow-up can be ensured by the CCI FA over a period of 6 months after the prospecting mission. This consists of relaunching previously initiated contacts and the eventual setting up of a new appointment program in order to finalize the partnership approach. |
North Eastern Hill University (NEHU), Shillong invited applicants for walk-in interview for the post of ‘Junior Engineer’ at NEHU, Tura Campus. Posts are purely on Contractual Basis. The candidates eligible for the post may appear for the interview on 15 June 2015.
North Eastern Hill University (NEHU), Shillong invited applicants for walk-in interview for the post of ‘Junior Engineer’ at NEHU, Tura Campus. Posts are purely on Contractual Basis. The candidates eligible for the post may appear for the interview on 15 June 2015 (Monday) at 12:00 Noon in the Committee Room, Administrative Building of North Eastern Hill University, Mawkynroh, Umshing, Shillong – 793 022.
Educational Qualification: Possess Diploma in Civil Engineeringfrom recognized university or Institute and the relevant post- qualification experience in the concerned field. Knowledge of Computer Applicationwill be given preference.
Interested candidates may appear for the Walk –in- Interview on 15 June 2015 (Monday) at 12:00 Noonin the Committee Room, Administrative Building of North Eastern Hill University, Mawkynroh, Umshing, Shillong – 793 022 along with original Certificates/ documents (for verification). Registration will be done from 11:00 AM to 11:30 AM on the same day. Candidate may apply on the plain paper with complete bio- data along with a set of attested photo copies of relevant certificates/ testimonials in support of date of birth, qualifications, experience, category (SC/ ST/ PWD), etc. and a recent passport size photograph pasted on it. |
İyilikci O, Aydın E, Canbeyli R. (2009). Blue but not red light stimulation in the dark has antidepressant effect in behavioral despair. Behavioral Brain Research.27(6), 395-401.
Schulz D, Aksoy A, Canbeyli R. (2008). Behavioral despair is differentially affected by the length and timing of photic stimulation in the dark phase of an L/D cycle. Prog Neuropsychopharmacol Biol Psychiatry, 32(5),1257-62.
Pezuk P, Aydin E, Aksoy A, Canbeyli R. (2008). Effects of BNST lesions in female rats on forced swimming and navigational learning.Brain Research.1228,199-207.
Pezuk P, Goz D, Aksoy A, Canbeyli, R. (2006). BNST lesions aggravate behavioral despair but do not impair navigational learning in rats. Brain Res Bull, 69(4), 416-21.
Yilmaz A, Aksoy A, Canbeyli, R. (2004). A single day of constant light (L/L) provides immunity to behavioral despair in female rats maintained on an L/D cycle. Prog Neuropsychopharmacol Biol Psychiatry, 28(8), 1261-5.
Aksoy A, Schulz D, Yilmaz A, Canbeyli R.(2004). Seasonal variability in behavioral despair in female rats. Int J Neurosci, 114(12), 1513-20.
Aydemir N, Ozkara C, Canbeyli R, Tekcan A. (2004). Changes in quality of life and self-perspective related to surgery in patients with temporal lobe epilepsy. Epilepsy Behav, 5(5), 735-42.
Bozkulak O, Tabakoglu HO, Aksoy A, Kurtkaya O, Sav A, Canbeyli R, Gulsoy M. (2004). The 980-nm diode laser for brain surgery: histopathology and recovery period. Lasers Med Sci, 19(1), 41-7.
Bulduk S, Canbeyli R. (2004). Effect of inescapable tones on behavioral despair in Wistar rats. Prog Neuropsychopharmacol Biol Psychiatry, 28(3), 471-5.
Tataroglu O, Aksoy A, Yilmaz A, Canbeyli R. (2004). Effect of lesioning the suprachiasmatic nuclei on behavioral despair in rats. Brain Res. 1001(1-2), 118-24.
Cemalcilar Z, Canbeyli R, Sunar D. (2003). Learned helplessness, therapy, and personality traits: an experimental study. J Soc Psychol, 143(1), 65-81.
Yilmaz A, Schulz D, Aksoy A, Canbeyli R. (2002). Prolonged effect of an anesthetic dose of ketamine on behavioral despair.Pharmacol Biochem Behav, 71, 341-4.
Gülsoy, M., Çelikel, T. A., Kurt, A., Canbeyli, R. & Çilesiz, İ. (2001). Er: YAG laser ablation of cerebral tissue. Lasers in Medical Science, 16, 40-43.
Schulz, D. & Canbeyli, R. (2000). Lesions of the bed nucleus of the stria terminalis enhances learned despair. Brain Research Bulletin, 52(2), 83-87.
Gülsoy, M., Çelikel, T., Kurtkaya, Ö., Sav, A., Kurt, A., Canbeyli, R. & Çilesiz, İ. (2000). Stereotaxic Use of the 980nm Diode Laser in Rat Cortical and Subcortical Tissues, in Clinical Lasers and Diagnostics, Proceedings of the SPIE, 243-246.
Gülsoy, M., Çelikel, T., Kurtkaya, Ö., Sav, A., Kurt, A., Canbeyli, R. & Çilesiz, İ. (1999). Application of the 980 nm diode laser in stereotaxic surgery. IEEE Journal of Selected Topics in Quantum Electronics on Lasers in Medicine and Biology, 5(4), 1090-1094.
Schulz, D. & Canbeyli, R. (1999). Freezing behavior in BNST-lesioned Wistar rats. J. F. McGinty (Ed.) Advancing from the ventral striatum to the extended amygdala: Implications for neuropsychiatry and drug abuse. New York Academy of Sciences, 877, 728-731. |
plink [email protected] -m remote_deploy.sh
|
abide by the contract", conforms on the market requirement, joins within the market competition by its good quality at the same time as provides far more comprehensive and great company for customers to let them grow to be major winner. The pursue in the company, will be the clients' pleasure for Pet Cleaning Near Me , pet cleaning near me , Pet Cleaning Mitt , We focus on providing service for our clients as a key element in strengthening our long-term relationships. Our continual availability of high grade products in combination with our excellent pre-sale and after-sales service ensures strong competitiveness in an increasingly globalized market. We are willing to cooperate with business friends from at home and abroad and create a great future together.
The very rich projects management experiences and one to one service model make the high importance of business communication and our easy understanding of your expectations for Pet Cleaning Near Me , pet cleaning near me , Pet Cleaning Mitt , We've got more than 200 workers expert technical team 15 years' experience exquisite workmanship stable and reliable quality competitive price and sufficient production capacity this is how we make our customers stronger. If you have any inquiry please do not hesitate to contact us. |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TFKaldi: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">TFKaldi
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacekaldi.html">kaldi</a></li><li class="navelem"><b>gmm</b></li><li class="navelem"><a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">LdaGmm</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">kaldi.gmm.LdaGmm Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1GMM.html#a5a00ddc3ca02790d2b5a0e7c6873e1c5">__init__</a>(self, conf)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1GMM.html">kaldi.gmm.GMM</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1GMM.html#a73912da2d5e8defe500910daa6c063dd">align</a>(self)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1GMM.html">kaldi.gmm.GMM</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>conf</b> (defined in <a class="el" href="classkaldi_1_1gmm_1_1GMM.html">kaldi.gmm.GMM</a>)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1GMM.html">kaldi.gmm.GMM</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>conf_file</b>(self) (defined in <a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a>)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>graphopts</b>(self) (defined in <a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a>)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>name</b>(self) (defined in <a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a>)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>parent_gmm_alignments</b>(self) (defined in <a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a>)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1GMM.html#a27d812ae87876212f8e6614c8b034ca6">test</a>(self)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1GMM.html">kaldi.gmm.GMM</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1GMM.html#a629741a04c739a8f3aed07b037213182">train</a>(self)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1GMM.html">kaldi.gmm.GMM</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>trainops</b>(self) (defined in <a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a>)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>trainscript</b>(self) (defined in <a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a>)</td><td class="entry"><a class="el" href="classkaldi_1_1gmm_1_1LdaGmm.html">kaldi.gmm.LdaGmm</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>
|
Making extra money is something that a lot of people want to do. Whether they are paying off debt or saving for a trip, extra money comes in handy from time to time. In the past, I’ve discussed different ways to make extra money doing things like blogging or selling stuff on eBay. Today, I want to go over five part-time jobs that you can do to make extra money.
The first job that you can do to make extra money is to become a restaurant server. If you have a 9-5 gig, working on the weekends at a restaurant will be perfect for you. Weekends are usually the busiest time at most restaurants anyway, so you can probably make close to $100 a shift. If you work at a top tier restaurant, you may be able to bring in close to $300 each day.
The next job that will help you make extra money is to become a car valet. This is another job that can be done on the weekends or weeknights after work. Valets get paid by the hour plus they earn tips. The amount of money that you can make depends on where and who you’re valeting for. Certain hotel brands may be good to work for.
The third job on the list is to become a bartender. If you know your alcohol and know how to mix drinks, you will always be able to find a part-time job. I have several friends who have been bartenders over the years. They can make hundreds of dollars on Friday and Saturday nights. If they decided to do private events, they could make even more money. The better the drinks are, the more tips that the bartenders can get.
Working retail is the fourth job on the list. Many retailers are flexible with their hours, so they allow some people just to work on weekends. Retail positions are very popular around the holiday season. Those businesses are looking for as much help as they can get. I’ve worked retail as a part-time job before. While you won’t make as much as you can as a server or bartender, it’s still a very easy job.
Driving part-time is the last thing on the list. It’s not technically a job, but you can make a lot of money driving part-time with Uber or Lyft. I have a friend who used to drive for Uber. She would make about $300 a week driving for them part-time. That’s not bad for working 15-20 hours each week.
Those were five jobs that you can do to make extra money. There should be no complaining if you are making enough cash at your full-time position. There are options out there for you to earn more. Some of these jobs may pay more than others, but you should find one that you like. Figure out which one works for you and start bringing in this extra money.
What have you done to make extra cash?
I’ve done a lot of side jobs — waiting tables, selling beer at NFL games, working as a runner or production assistant for a concert. Now, I’m more focused on blogging, freelance writing, social media consulting, and brand ambassador gigs. |
Preheat oven to 350 F. In a large bowl, combine the flour, sugar, and salt. Cut in the butter until crumbly. Pat firmly and evenly onto the bottom and sides of a 10” flan or quiche pan with removable base. Bake for 20 – 25 minutes on until a light golden color.
Preheat oven to 350 F. Place blueberries in bottom of flan. In a large bowl, whisk together the egg, corn syrup, lemon juice and vanilla. In a separate bowl, combine the sugar and flour, then stir it into the egg mixture. Add the melted butter. Pour over the blueberries, filling each tart shell right to the top. Bake on the bottom oven rack, until bubbly and slightly crusty on top, approximately 18-23 minutes. |
Spyhunter 4 Email and Password 2017 is the tool that basically used to activate the Spyhunter 4 Crack. Sphyhunter 4 Crack is the software that basically offers you protection against malicious threats that can harm your Pc. Now a days lots of harmful threats have been appeared that can damage your pc. Basically developers develop this software for protection of Pc from malicious threats or unauthorized access. I think it’s the basic need of every professional and home users.
Many people round the world routinely use the pc or laptop for their personal purposes. Hackers can access through unauthorized way and steel the personal information. So this purposes to protect the information its very supportive software.
Spyhunter 4 Email and Password 2017 is basic need to activate Spyhunter 4 Crack. SpyHunter 4 Key is also licensed by West Coast Labs Checkmark Certification System. It reacts with advanced technology to stay one step onward of today’s malware threats. It has also the aptitude to detect and remove rootkits that are used to stealth install rascal anti-spyware programs and other Trojans. Spyhunter 4 Crack offers the top security to your pc and protect them from malicious threats.
Spyhunter 4 Crack works 100% efficiently on all windows operating system either windows 10, windows 8, windows 7 and windows XP. It comes with lots of features like works as anti-malware, anti-phishing, anti-rogues, anti-adware and much more. Many professional personally like this software because it offers both online as well as offline protection to your Pc.
Malware Protection: with just in single click it Identify, eliminate and block spyware, Trojans, cookies, adware, rootkits, key loggers, worms and additional sorts of malware. Easily help you.
System Guards: They will detect and stop any processes those try to secretly auto-start malware entries by abusing the Windows registry.
Exclusions: The removals feature permits you to remove certain programs from being detected in future SpyHunter scans.
Compact OS: The integrated SpyHunter 4 Crack Compact OS helps in the elimination of rootkits and extra persistent malware infections. Have very friendly interface.
How to Crack Spyhunter 4 Email and Password? |
In the departure hall of Auckland Airport on a quiet Saturday morning two weeks after the election, a wizened little customs officer barked at the couple in front of us, "Can't you read, the sign says Chinese passports over there".
The couple looked surprised, so were we. Too surprised to be shocked for a moment. New Zealand's customs and immigration staff have been shining advertisements for this country for so long. I wish I'd written about them years ago.
Immigration desk officers of most countries are a surly breed. If they speak at all it's a gruff monosyllable. If you get a nod of the head when they've done with your passport you're lucky. But New Zealand border officials have been so different. I don't think it was just to fellow Kiwis, as far as I could tell foreigners were getting a pleasant reception too.
It is one of the many little things about our modern, worldly little country that has made me immensely proud.
I shouldn't be writing in the past tense on the evidence of one momentary lapse. But it was two weeks after the election, all attention was on Winston Peters. Larger party leaders were practically prostrating themselves for his favour. I couldn't help wondering whether that embarrassing little fellow in a New Zealand uniform was feeling enormously affirmed by it all.
Many with his attitude would have been happy this week. We're closing some doors to the world. We're getting New Zealand First restrictions on foreign investment in housing and farmland. On Monday the Cabinet decided a sale of any land larger than 5ha would need clearance from the Overseas Investment Office. Buyers will have to come and live here if they want to own it.
David Parker, a thinking person and Labour's most experienced minister, said he hoped the farm sales restrictions would mollify the sort of concerns that produced Trump and Brexit. "The middle class in New Zealand is uncomfortable that their prospects in life are being to some extent hampered by the influence of the 1 per centers from overseas who can outbid them for assets that they would otherwise be the buyers of," he said.
Really? I'm probably "middle class", my bank balance won't buy me the properties the 1 per centers enjoy in New Zealand and I don't mind in the slightest. In fact I'm rather proud to see rock stars and internet billionaires buying breathtakingly beautiful landscape in remote parts of my country. It is not as if we don't have vast tracts of land in national parks and the conservation estate. Does it matter whether high country grazing blocks are owned by a foreigner or the local landed gentry?
Closing the land to foreigners, said Parker, "sends a message that the New Zealand Government is at the forefront of trying to deal with some of the excesses of globalised capital." What does that mean? Foreign investment hasn't damaged land as far as I'm aware. Some of those rock stars and global capitalists have cared for the land so much they have put parts of it under covenant with the Queen Elizabeth II Trust.
US TV host Matt Lauer may be the latest celebrity to be exposed as a sexual creep but according to TVNZ's report this week, Lauer didn't close the road through his property on Lake Hawea, his tenant did. Keeping these high country stations for Kiwi farmers will not make them more public, probably less.
Shutting foreign buyers out of the market will also lower their value and take this country out of the conversation of the Learjet set.
I suppose people who use phrases like "globalised capital" will be glad of that, as will be those who want to keep this country small and closed for folk like themselves. Parker said, "We want to avoid the backlash that has occurred with the election of President Trump, Brexit and the rise of fringe parties in Europe."
You don't avoid a backlash by giving in to it. We should never forget Trump and Brexit did not win the New Zealand election. The modern, open worldly New Zealand of John Key was supported by enough voters for National to have been comfortably returned under the electoral systems of the UK and the US.
Labour is not a backward party at heart. When it comes to the crunch, as it did on TPP, it wants the country open to the global economy. It has not yet cut immigration. But if it adopts the language of New Zealand First, it will give the opposite impression to other countries.
Worse, much worse, this country would come to believe the election really was a triumph for the narrow, foolish, fearful, jealous and nasty little New Zealand we thought we had left so far behind. |
using System.Collections.Generic;
using IdentityServer4.Models;
using IdentityServer4.Test;
namespace BruCloudIdentity.IdentityServerConfiguration
{
public static class InMemoryConfiguration
{
public static IEnumerable<ApiResource> GetApiResources()
{
var apiResourceList = new List<ApiResource>
{
new ApiResource("api1", "My API")
};
return apiResourceList;
}
public static IEnumerable<Client> GetClients()
{
var clientList = new List<Client>
{
new Client
{
ClientId = "client",
// no interactive user, use the clientid/secret for authentication
AllowedGrantTypes = GrantTypes.ClientCredentials,
// secret for authentication
ClientSecrets =
{
new Secret("secret".Sha256())
},
// scopes the client has access to
AllowedScopes = { "api1" }
},
new Client
{
ClientId = "ro.client",
// no interactive user, use the clientid/secret for authentication
AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
// secret for authentication
ClientSecrets =
{
new Secret("secret".Sha256())
},
// scopes the client has access to
AllowedScopes = { "api1" }
}
};
return clientList;
}
public static List<TestUser> GetUsers()
{
return new List<TestUser>
{
new TestUser
{
SubjectId = "1",
Username = "alice",
Password = "password"
},
new TestUser
{
SubjectId = "2",
Username = "bob",
Password = "password"
}
};
}
}
} |
// LzhRegister.cpp
#include "StdAfx.h"
#include "../../Common/RegisterArc.h"
#include "LzhHandler.h"
static IInArchive *CreateArc() { return new NArchive::NLzh::CHandler; }
static CArcInfo g_ArcInfo =
{ L"Lzh", L"lzh lha", 0, 6, { '-', 'l' }, 2, false, CreateArc, 0 };
REGISTER_ARC(Lzh)
|
#ifndef _WavFile_h_
#define _WavFile_h_
/*
WavFile.h
public-domain sample code by Vokaturi, 2017-01-30
Code that attempts to open a simplistic mono or stereo 16-bit PCM WAV file
for use with the sample code that comes with the Vokaturi software.
This will run on:
- macOS
- Linux
- Windows if the file path contains ASCII characters only
This code is not really meant for production purposes;
its known limitations include at least the following:
- does not support files with more than two channels
- does not support compressed audio formats
- does not support files with more than "fmt", "PAD" and "data" chunks
- does not support files with "PAD" chunks longer than 9000 bytes
- on Windows, runs only if the file path is ASCII-only
- sends messages only to stderr
Nevertheless, "simplistic mono or stereo 16-bit PCM WAV" is a format
into which you will be able to convert most more complicated formats
with the help of audio file converters,
such as those available in iTunes, Windows Media Player, or Praat.
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include "Vokaturi.h"
#define my me ->
typedef struct {
FILE *f;
double samplingFrequency;
int numberOfChannels;
int numberOfSamples;
int sampleOffset;
unsigned char *cache;
int cacheSize;
} VokaturiWavFile;
inline static void VokaturiWavFile_open (const char *fileName, VokaturiWavFile *me) {
my f = fopen (fileName, "rb");
if (my f == NULL) {
fprintf (stderr, "VokaturiWavFile error: cannot open file %s.\n", fileName);
return;
}
/*
Check that this really is a WAV file,
by checking for the header, which should be "RIFFxxxxWAVEfmt ",
where the x'es can be anything.
*/
char buffer [10000], *header = & buffer [0];
fread (header, 1, 10000, my f);
if (strncmp (header, "RIFF", 4) ||
strncmp (header + 8, "WAVE", 4) ||
strncmp (header + 12, "fmt ", 4))
{
fprintf (stderr, "VokaturiWavFile error: %s is not a simplistic WAV file.\n", fileName);
fclose (my f);
my f = NULL;
return;
}
unsigned int fmtChunkSize =
(unsigned char) header [16] |
((unsigned char) header [17]) << 8 |
((unsigned char) header [18]) << 16 |
((unsigned char) header [19]) << 24;
if (fmtChunkSize != 16) {
if (fmtChunkSize == 18) {
/*
This is a "fmt" chunk that has an additional 2 bytes that denote
the size of the extension (which is zero).
*/
} else {
fprintf (stderr, "VokaturiWavFile error: %s has a fmt chunk of size %u.\n", fileName, fmtChunkSize);
fclose (my f);
my f = NULL;
return;
}
}
unsigned int audioFormat =
(unsigned char) header [20] |
((unsigned char) header [21]) << 8;
if (audioFormat != 1) {
fprintf (stderr, "VokaturiWavFile error: %s has compressed audio format %u.\n", fileName, audioFormat);
fclose (my f);
my f = NULL;
return;
}
unsigned int numberOfChannels =
(unsigned char) header [22] |
((unsigned char) header [23]) << 8;
if (numberOfChannels > 2) {
fprintf (stderr, "VokaturiWavFile error: %s has more than two channels.\n", fileName);
fclose (my f);
my f = NULL;
return;
}
my numberOfChannels = numberOfChannels;
unsigned int sampleRate =
(unsigned char) header [24] |
((unsigned char) header [25]) << 8 |
((unsigned char) header [26]) << 16 |
((unsigned char) header [27]) << 24;
if (sampleRate < 8000) {
fprintf (stderr, "VokaturiWavFile error: a sample rate of %u Hz is not supported.\n", sampleRate);
fclose (my f);
my f = NULL;
return;
}
my samplingFrequency = sampleRate;
unsigned int bitsPerSample =
(unsigned char) header [34] |
((unsigned char) header [35]) << 8;
if (bitsPerSample != 16) {
fprintf (stderr, "VokaturiWavFile error: %s is not 16-bit PCM.\n", fileName);
fclose (my f);
my f = NULL;
return;
}
if (fmtChunkSize == 18) header += 2; // skip the optional word, which always contains zero
if (! strncmp (header + 36, "data", 4)) {
my sampleOffset = 44;
} else if (! strncmp (header + 36, "PAD ", 4) || ! strncmp (header + 36, "fact", 4) || ! strncmp (header + 36, "LIST", 4)) {
unsigned int chunkSize =
(unsigned char) header [40] |
((unsigned char) header [41]) << 8 |
((unsigned char) header [42]) << 16 |
((unsigned char) header [43]) << 24;
if (chunkSize > 9000) {
fprintf (stderr, "VokaturiWavFile error: %s has a too large \"%.4s\" chunk.\n", fileName, header + 36);
fclose (my f);
my f = NULL;
return;
}
if (! strncmp (header + 36 + 4 + 4 + chunkSize, "data", 4)) {
my sampleOffset = 44 + 4 + 4 + chunkSize;
} else {
fprintf (stderr, "VokaturiWavFile error: %s has no data chunk.\n", fileName);
fclose (my f);
my f = NULL;
return;
}
} else {
fprintf (stderr, "VokaturiWavFile error: %s contains un unrecognized \"%.4s\" chunk.\n", fileName, header + 36);
fclose (my f);
my f = NULL;
return;
}
const int bytesPerSample = 2;
unsigned int dataChunkSize =
(unsigned char) header [my sampleOffset - 4] |
((unsigned char) header [my sampleOffset - 3]) << 8 |
((unsigned char) header [my sampleOffset - 2]) << 16 |
((unsigned char) header [my sampleOffset - 1]) << 24;
if (dataChunkSize < 100 * bytesPerSample * numberOfChannels) {
fprintf (stderr, "VokaturiWavFile error: %s does not have at least 100 samples.\n", fileName);
fclose (my f);
my f = NULL;
return;
}
my numberOfSamples = dataChunkSize / bytesPerSample / numberOfChannels;
my cache = NULL;
my cacheSize = 0;
}
inline static int VokaturiWavFile_valid (VokaturiWavFile *me) {
return my f != NULL;
}
inline static void VokaturiWavFile_close (VokaturiWavFile *me) {
if (my f) fclose (my f);
}
inline static void VokaturiWavFile_clear (VokaturiWavFile *me) {
if (my f) {
fclose (my f);
my f = NULL;
}
if (my cache) {
free (my cache);
my cache = NULL;
my cacheSize = 0;
}
}
inline static void _VokaturiWavFile_readToCache (VokaturiWavFile *me,
int startSample, // base-0
int numberOfSamples)
{
const int bytesPerSample = 2;
fseek (my f, my sampleOffset + startSample * bytesPerSample, SEEK_SET);
int numberOfBytes = bytesPerSample * numberOfSamples * my numberOfChannels;
if (numberOfBytes > my cacheSize) {
if (my cache) free (my cache);
my cache = (unsigned char *) malloc (my cacheSize = numberOfBytes);
}
fread (my cache, sizeof (char), numberOfBytes, my f);
}
inline static void VokaturiWavFile_fillSamples (VokaturiWavFile *me,
int channel, // 0 = left or only channel; 1 = right channel
int startSample, // base-0
int numberOfSamples,
double *samples)
{
_VokaturiWavFile_readToCache (me, startSample, numberOfSamples);
unsigned char *p = & my cache [0];
for (int isamp = 0; isamp < numberOfSamples; isamp ++) {
if (channel == 1) p += 2; // skip left channel
/* First narrow to 16 bits, then change signedness! */
int16_t sample_int = (int16_t) (uint16_t) (p [0] | p [1] << 8); // signed little-endian two bytes
p += 2;
samples [isamp] = sample_int / 32768.0;
if (my numberOfChannels > 1 && channel == 0) p += 2; // skip right channel
}
}
inline static double * VokaturiWavFile_readAll (VokaturiWavFile *me, int channel) {
double *samples = (double *) calloc (my numberOfSamples, sizeof * samples);
if (samples == NULL) return NULL;
VokaturiWavFile_fillSamples (me, channel, 0, my numberOfSamples, samples);
return samples;
}
inline static void VokaturiWavFile_fillVoice (VokaturiWavFile *me, VokaturiVoice voice,
int channel, // 0 = left or only channel; 1 = right channel
int startSample, // base-0
int numberOfSamples)
{
_VokaturiWavFile_readToCache (me, startSample, numberOfSamples);
unsigned char *p = & my cache [0];
for (int isamp = 0; isamp < numberOfSamples; isamp ++) {
if (channel == 1) p += 2; // skip left channel
/* First narrow to 16 bits, then change signedness! */
int16_t sample_int = (int16_t) (uint16_t) (p [0] | p [1] << 8); // signed little-endian two bytes
p += 2;
double sample = sample_int / 32768.0;
VokaturiVoice_fill (voice, 1, & sample);
if (my numberOfChannels > 1 && channel == 0) p += 2; // skip right channel
}
}
/* End of file WavFile.h */
#endif
|
using UnityEngine;
namespace BitStrap.Examples
{
public class EmailHelperExample : MonoBehaviour
{
[Header( "Edit the fields and click the buttons to test them!" )]
public string email = "[email protected]";
[Button]
public void IsValidEmail()
{
Debug.LogFormat( "Email \"{0}\" is valid? {1}", email, EmailHelper.IsEmail( email ) );
}
[Button]
public void CheckEmailTypo()
{
string suggestedEmail;
if( EmailHelper.IsMistyped( email, out suggestedEmail ) )
Debug.LogFormat( "Email \"{0}\" may be mistyped. Did you mean: \"{1}\"", email, suggestedEmail );
else
Debug.LogFormat( "Email \"{0}\" seems legit!", email );
}
}
}
|
Mel. Some 随意 pics of Melissa. Wallpaper and background images in the 梅利莎·琼·哈特 club tagged: melissa joan hart red carpet photoshoot. |
package nuesoft.repositorysample.repository;
import org.jdeferred.Deferred;
import org.jdeferred.DoneCallback;
import org.jdeferred.FailCallback;
import java.util.Map;
import nuesoft.repositorysample.exception.AlreadyAuthenticatedError;
import nuesoft.repositorysample.exception.AuthenticationRequiredError;
import nuesoft.repositorysample.exception.ModelStateError;
import nuesoft.repositorysample.model.base.BaseModel;
import nuesoft.repositorysample.repository.base.IAdapter;
import nuesoft.repositorysample.store.Authenticator;
import nuesoft.repositorysample.webService.MyRequest;
import nuesoft.repositorysample.webService.Response;
/**
* Created by mysterious on 8/14/17.
*/
public class RestAdapter extends IAdapter {
private String baseUrl;
private String tokenLocalStorageKey;
public static Authenticator authenticator;
/*
* +----------------+----------------+--------+--------+---------+
* | state / ACTION | CHANGE | SAVE | RELOAD | DELETE |
* +----------------+----------------+--------+--------+---------+
* | new | new | loaded | error | error |
* +----------------+----------------+--------+--------+---------+
* | loaded | dirty | error | loaded | deleted |
* +----------------+----------------+--------+--------+---------+
* | dirty | dirty / loaded | loaded | loaded | deleted |
* +----------------+----------------+--------+--------+---------+
* | deleted | error | error | error | error |
* +----------------+----------------+--------+--------+---------+
*/
public RestAdapter(String baseUrl, String tokenLocalStorageKey, Authenticator authenticator1) {
this.baseUrl = baseUrl;
this.tokenLocalStorageKey = tokenLocalStorageKey;
authenticator = authenticator1;
}
public String getBaseUrl() {
return this.baseUrl;
}
public Authenticator getAuthenticator() {
if (authenticator == null) {
authenticator = new Authenticator();
}
return authenticator;
}
public Deferred login(Map<String, Object> credentials) throws AlreadyAuthenticatedError {
if (authenticator.isAuthenticated()) {
throw new AlreadyAuthenticatedError();
}
final Deferred deferred = this.request("sessions", "POST").addParameters(credentials).send();
deferred.then(new DoneCallback<Response>() {
@Override
public void onDone(Response response) {
getAuthenticator().setToken(response.getField("token"));
deferred.resolve(response);
}
}).fail(new FailCallback<Response>() {
@Override
public void onFail(Response result) {
deferred.reject(result);
}
});
return deferred;
}
public void logout() {
authenticator.deleteJwtToken();
}
public MyRequest request(String resources, String verb) {
try {
return new MyRequest(this, resources, verb).addAuthenticationHeaders(false);
} catch (AuthenticationRequiredError authenticationRequiredError) {
authenticationRequiredError.printStackTrace();
}
return null;
}
@Override
public <T extends BaseModel> Deferred save(final T model) throws ModelStateError {
String verb = "";
String resourceUrl = "";
switch (model.getStatus()) {
case "loaded": {
throw new ModelStateError("Object is not changed.");
}
case "deleted": {
throw new ModelStateError("Object is deleted.");
}
case "new": {
verb = "POST";
resourceUrl = T.url;
break;
}
default: {
verb = "PUT";
resourceUrl = model.getResourcePath();
break;
}
}
Deferred deferred = this.request(resourceUrl, verb).addParameters(model.toHashMap()).ifMatch(model.geteTag()).send();
return deferred;
}
@Override
public <T extends BaseModel> Deferred delete(T model) throws ModelStateError {
switch (model.getStatus()) {
case "new": {
throw new ModelStateError("Cannot delete unsaved objects.");
}
case "deleted": {
throw new ModelStateError("Object is already deleted.");
}
}
return this.request(model.getResourcePath(), "DELETE").ifMatch(model.geteTag()).send();
}
@Override
public <T extends BaseModel> Deferred reload(T model) throws ModelStateError {
switch (model.getStatus()) {
case "new": {
throw new ModelStateError("Save object before reload.");
}
case "deleted": {
throw new ModelStateError("Object is deleted");
}
}
return this.request(model.getResourcePath(), "GET").ifNoneMatch(model.geteTag()).send();
}
public <T extends BaseModel> void updateFromResponse(T model, Response response) {
model.updateProperties(response.getMap());
}
@Override
public <T extends BaseModel> void getOne(int id) {
// r.setPostProcessor(new ResponseCallBack()).send()
}
@Override
public <T extends BaseModel> Deferred getAll() {
String verb = "GET";
String resourceUrl = T.url;
try {
final Deferred deferred = this.request(resourceUrl, verb).addAuthenticationHeaders(true).send();
return deferred;
} catch (AuthenticationRequiredError authenticationRequiredError) {
authenticationRequiredError.printStackTrace();
}
return null;
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
namespace System.Security.Cryptography.Xml
{
[Serializable]
internal enum ReferenceTargetType
{
Stream,
XmlElement,
UriReference
}
}
|
package com.game.assistance.model;
import java.util.Date;
public class HeroInfoModel {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column hero_info.hero_id
*
* @mbggenerated
*/
private Integer heroId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column hero_info.app_name
*
* @mbggenerated
*/
private String appName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column hero_info.name
*
* @mbggenerated
*/
private String name;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column hero_info.type
*
* @mbggenerated
*/
private String type;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column hero_info.teamID
*
* @mbggenerated
*/
private String teamId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column hero_info.stars
*
* @mbggenerated
*/
private Integer stars;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column hero_info.link
*
* @mbggenerated
*/
private String link;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column hero_info.image_url
*
* @mbggenerated
*/
private String imageUrl;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column hero_info.create_time
*
* @mbggenerated
*/
private Date createTime;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column hero_info.hero_id
*
* @return the value of hero_info.hero_id
* @mbggenerated
*/
public Integer getHeroId() {
return heroId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column hero_info.hero_id
*
* @param heroId the value for hero_info.hero_id
* @mbggenerated
*/
public void setHeroId(Integer heroId) {
this.heroId = heroId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column hero_info.app_name
*
* @return the value of hero_info.app_name
* @mbggenerated
*/
public String getAppName() {
return appName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column hero_info.app_name
*
* @param appName the value for hero_info.app_name
* @mbggenerated
*/
public void setAppName(String appName) {
this.appName = appName == null ? null : appName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column hero_info.name
*
* @return the value of hero_info.name
* @mbggenerated
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column hero_info.name
*
* @param name the value for hero_info.name
* @mbggenerated
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column hero_info.type
*
* @return the value of hero_info.type
* @mbggenerated
*/
public String getType() {
return type;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column hero_info.type
*
* @param type the value for hero_info.type
* @mbggenerated
*/
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column hero_info.teamID
*
* @return the value of hero_info.teamID
* @mbggenerated
*/
public String getTeamId() {
return teamId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column hero_info.teamID
*
* @param teamId the value for hero_info.teamID
* @mbggenerated
*/
public void setTeamId(String teamId) {
this.teamId = teamId == null ? null : teamId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column hero_info.stars
*
* @return the value of hero_info.stars
* @mbggenerated
*/
public Integer getStars() {
return stars;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column hero_info.stars
*
* @param stars the value for hero_info.stars
* @mbggenerated
*/
public void setStars(Integer stars) {
this.stars = stars;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column hero_info.link
*
* @return the value of hero_info.link
* @mbggenerated
*/
public String getLink() {
return link;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column hero_info.link
*
* @param link the value for hero_info.link
* @mbggenerated
*/
public void setLink(String link) {
this.link = link == null ? null : link.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column hero_info.image_url
*
* @return the value of hero_info.image_url
* @mbggenerated
*/
public String getImageUrl() {
return imageUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column hero_info.image_url
*
* @param imageUrl the value for hero_info.image_url
* @mbggenerated
*/
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl == null ? null : imageUrl.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column hero_info.create_time
*
* @return the value of hero_info.create_time
* @mbggenerated
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column hero_info.create_time
*
* @param createTime the value for hero_info.create_time
* @mbggenerated
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
} |
The vast majority of those with health insurance are either covered at work, by their spouse's employer, have purchased individual policies or they qualify for government-provided health care (Medicaid and or CHIP). However you choose to be insured, there are many choices to make when it comes to getting the best healthcare for your money. Let’s explore these options so you can make an informed decision that fits your family’s needs and stays within your budget.
When you’ve got a family, their health is usually at the top of your list.
The vast majority of those with health insurance are either covered at work, by their spouse’s employer, have purchased individual policies or they qualify for government-provided health care (Medicaid and or CHIP).
However you choose to be insured, there are many choices to make when it comes to getting the best healthcare for your money. Let’s explore these options so you can make an informed decision that fits your family’s needs and stays within your budget.
Let’s look at each of these categories and the good and bad that come with each type.
A Health Maintenance Organization or HMO is a group of healthcare professionals and medical facilities who come together to offer specific healthcare services for a fixed price.
Each patient with an HMO plan has a primary care physician (PCP). The PCP’s within HMOs must determine when a specialist is needed. Specialist services are not covered unless an in-network referral is made. With HMO plans, all your care is coordinated by your PCP.
The main advantage of HMO plans is that your out-of-pocket costs are typically lower and more predictable than other insurance plan types.
A disadvantage of HMOs is that care from out of network healthcare professionals is usually not covered, except in an emergency. Additionally, specialist services require a referral from your PCP, which may require an extra doctor appointment. Some find it difficult to get the care they need because it is not covered under an HMO or their PCP won’t issue the necessary referral.
A Preferred Provider Organization has the managed care aspect of an HMO with the added benefit of flexibility. Within a PPO, you can choose to see any health provider of your choice. There is one small caveat to this, your benefits will be less, and you’ll pay more out of pocket than if you stay in network, but you get to see the healthcare providers you want. If provider choice is important to you, a PPO is likely a good choice if available.
A primary advantage of PPOs is the ability to choose the healthcare providers you want to see.
Because you have flexibility in which healthcare professionals you see, it can be hard to predict your out-of-pocket expenses, as prices vary depending on whom you see.
Indemnity or Fee-for-Service plans are traditional plans that let you see any doctor or specialist you choose without having to get a referral. The insurance company pays a set portion of your charges, and you pay the rest. Overall, indemnity plans are the most flexible of the options as there are no provider restrictions. These plans are getting hard to find and are typically quite expensive.
The most significant advantage of Indemnity plans is that you can see any provider you want without having to get referrals or prior approval.
A couple of disadvantages to these plans include the fact that Insurance companies often shift costs to you through higher premiums and deductibles to manage costs, making these plans more expensive than HMOs and PPOs. Also, you may have to pay for healthcare services up front and submit a claim for reimbursement, which ties your money up without the guarantee of getting it back.
In addition to health insurance plans, healthcare savings account options are available, including Health Savings Accounts (HSAs), Flexible Spending Accounts (FSA) and some employers offer Health Reimbursement Accounts (HRAs). Each of these accounts has specific rules and requirements, and are a great way to help save pre-tax money to help pay for healthcare costs.
Many obtain health insurance through their job or their spouse’s employer. However, many small employers aren’t able to offer health insurance. If your employer doesn’t offer insurance, you may be able to get coverage through a labor union, professional association or other organization.
If you cannot find suitable group coverage, you can purchase an individual policy. You can search on the Affordable Care Acts site, Healthcare.gov, to find and compare policies from your state’s marketplace and see if you’re eligible for subsidies to help offset the costs.
You can also purchase health insurance from an insurance carrier or broker, known as off-exchange plans.
Faith-based healthcare is another option to consider. While these plans are not health insurance per se, the plans offer a cost-sharing approach to pay for healthcare costs. There are several faith-based options out there, so you’ll need to read the fine print very carefully to make sure you know all the in’s and out’s.
In addition to employer-sponsored health insurance and purchasing individual plans, there are government provided healthcare options available to those who qualify. Let’s cover two types of coverage available, Medicaid and CHIP.
You may qualify for low-cost or free care through Medicaid based on income and family size.
Medicaid provides health coverage for some low-income people, pregnant women, families, children, and those with disabilities in all states. Medicaid covers all low-income adults below a certain income level in some states.
To see if you qualify for Medicaid coverage, check out the U.S. Department of Health & Human Services site.
If your children need health coverage, they may qualify for the Children’s Health Insurance Program (CHIP). CHIP provides affordable health coverage to children whose family earns too much to qualify for Medicaid. CHIP also covers pregnant women in some states. You can see if you’re eligible for CHIP here.
There are many ways to obtain health insurance for your family. Be sure to consider all the possibilities when choosing your coverage to make sure you get the best healthcare and the most value for your money.
Lauren Hargrave is a writer from San Francisco who focuses on technology, finance and wellness. She follows comedians like most people follow bands and believes an outdoor sweat session can cure almost any bad mood. She’s also been writing her first novel for so long, her mom doesn’t ask about it anymore. |
PC/PLLC Names that Contain the Name of a Species, click here.
Out of State Specialists, click here.
Declawing of Cats, click here.
Declawing of Cats Fact Sheet, click here.
Funding for Licensure Boards, click here.
Liability for Reporting Abuse, click here.
Regulations Mandating Spay/Neuter, click here.
Emergency Medical Personnel, click here.
Expedited Adoption of Cats, click here.
Click here for a wrap up of the 2017 legislative session. |
I know that there is a negative stigma attached to doing a cleanse or detoxing so I thought that I would make a few simple suggestions.
During this time, focus on increasing the amount of fruits and vegetables that you eat and reduce the amount of breads, baked goods and processed snacks that you eat.
For 5 days, you will focus on eating a Whole Foods, Plant-Based diet, keeping it as simple as possible. Also take time for daily walks, practice meditation or mindfulness and make sure that you are getting the night rest that you need.
Even after you complete the fifth day of the cleanse, your body will still be busy eliminating toxins that were stirred up. Your digestive system will be used to a simpler, cleaner diet and may be sensitive to anything processed. It is important to ensure that you slowly transition to eating other foods. Consider reintroducing one food at a time and give your body a day or so to respond.
1. Upon rising; drink the juice of 1 lemon, followed by several tall glasses of water. Get yourself ready for the day and have a bowel movement before eating.
2. For breakfast eat only fruit, making sure that you follow proper food combining. Try eating only 1 kind of fruit or at the most 2. Smoothies are an easy way to fill up, if you are short on time. I post a lot of my smoothies on Instagram, so if you need ideas, check me out. It is easy to add superfoods, such as spirulina or chia seeds, to your smoothie.
3. If you are hungry again before lunch, eat more of the fruit or smoothie that you had for breakfast.
4. For lunch, eat a large salad (make extra for dinner), consisting of raw vegetables and a handful of seeds such as hemp seed or pumpkin seeds (soak them for at least an hour first, better if you soak overnight)or a large dollop of seed paté. Make enough so that you fill satisfied. If you take your time, eating slowly and chewing thoroughly, you will feel full sooner. I post a lot of my lunches on Instagram as well. Avoid any cooked foods at this time.
5. If you are hungry later, have a large green juice (16-32oz or more) and get outside for a walk. Here are some ideas.
6. For dinner, eat a large salad (could be the same as lunch, if that makes it easier). Again, remember to take your time, eating slowly and chewing thoroughly. If you are not satisfied, have a small bowl of a simple vegan vegetable soup, some steamed veggies or a baked yam or other root vegetable. Or use any of my ideas for making your salad into a meal.
7. Have vegetables cut into bite-sized pieces and ready in the fridge for the moments when you need a snack.
8. Avoid eating after 7pm. If you are looking to lose weight on this cleanse, avoid eating after 6pm.
9. Drink lots of fresh water. Ideally you want to drink water between meals rather than with meals, to avoid watering down your digestive juices. When you are feeling hungry and you have recently eaten, consider drinking a glass of water and wait 20 minutes before eating something. You may just be thirsty.
10. Remember that less food is better for your digestive system. It will give it the rest it needs and allow it get rid of unwanted toxins. Daily exercise, plenty of water and a proper night’s rest will help move the toxins out of your body quickly and easily.
11. If you have access to a sauna or a steam room, that would also help tremendously. If not, try taking a warm sitz bath, with Himalayan salt every couple of days.
12. Believe in yourself! You can do this.
Perhaps after you have eaten this way for 5 days, you will feel so clean and great, you will want to continue to do so. It is certainly an easy way to maintain your ideal weight, maintain your blood sugar and blood pressure and keep your heart healthy.
If you are reading this and you already eat this way, consider having a day of only fresh green juice or just water, in the middle of the 5 days. This will step up the cleanse for you and add years to your life.
Just as we take our car in for regular oil changes or lube up our bicycle every Spring, it is important that we do the same for our body. I have found that a few days of eliminating foods that are stressful on the body, followed by a week of clean, simple, plant-based, whole foods is a wonderful way to support my body.
Thank you Barbara I love how you included the chewing! Seriously though so many cleanses forget to discuss this and it is really difficult to cleanse on partially digested foods. I love your articles.
I loved this article! I started a 6-day raw cleanse on March 21, and haven’t stopped! I love eating raw, and really enjoyed how you talked about our bodies being like a car that needs an oil change. It’s such a simple premise but really important! And not a lot of people think about that.
Can I ask what your favorite juice is? I am a bit of a juice enthusiast and would love to know your go-to recipe 🙂 thanks! And thanks so much for this article!
Thanks Jeannette! How wonderful that you have done a 6 day cleanse. I am curious as to the changes that you experienced. I have a inkling that you are feeling really great right now!
My favourite juice is made with celery, parsley, cucumber, lime and ginger. |
Julie Chen Dishes On Big Brother Season 20, Favorite Moments And MoreBig Brother is currently in the middle of its 20th season on CBS. This season’s edition, in addition to the assortment of BIG personalities in the house, revolves around technology.
'Big Brother' Season 20 House Tour Hosted By Julie ChenHigh tech takes over Big Brother for its 20th anniversary, as 16 all-new Houseguests face unexpected twists and upgraded power in a house inspired by Silicon Valley.
'Big Brother' Season 20 Houseguests RevealedCBS has announced 16 all-new Houseguests to embark on the milestone 20th season of Big Brother.
Julie Chen: "Omarosa Can Win Celebrity Big Brother"Julie Chen discusses "Celebrity Big Brother" and this year's most talked about guest Omarosa.
Watch Now: Julie Chen Hosts 'CBS Summer Preview'Julie Chen hosts "CBS Summer Preview," the networks's first digital special highlighting its original summer programming, now available on demand on multiple platforms.
'Survivor' Premiere and 'Big Brother' Finale To Each Feature 90-Minute EpisodesCBS's Premiere Week Wednesday features an all-reality lineup that includes a big season opener and climactic finale. |
When the Winnipeg Jets play host to the Colorado Avalanche on Thursday night time, the assembly shall be greater than a show off of the Central Department chief in opposition to the league’s top-scoring line. It’ll be a glimpse of a decade-long transformation of Finnish hockey.
Patrik Laine of Winnipeg, 20, and Mikko Rantanen of Colorado, 22, have spent a lot in their younger N.H.L. careers a few of the league leaders in scoring, gaining a focus for a golden technology from Finland, some of the smallest, and maximum a hit, hockey-playing international locations.
“That age crew in Finland, there should be one thing within the water or they’re feeding them the proper issues up there,” mentioned the Winnipeg captain, Blake Wheeler.
Seven avid gamers from Finland, a rustic of five.five million, were height 10 draft alternatives since 2013, and the majority of them are gambling important roles on their N.H.L. groups.
Laine, the No. 2 pick out in 2016, virtually straight away turned into essentially the most recognizable face in Finnish hockey since Teemu Selanne. In spite of some lean scoring stretches this season, Laine has been some of the league’s best possible goal-scorers during the last 3 seasons. In November, he scored 5 targets on 5 pictures in a recreation in opposition to the St. Louis Blues and he turned into the fourth-youngest participant to achieve 100 profession targets.
The spotlight of that month for Laine used to be the N.H.L’s go back to Finland, the place he notched a hat trick after which any other target in a couple of video games in Helsinki in opposition to a fellow Finn, Aleksander Barkov, and the remainder of the Florida Panthers.
Rantanen, the No. 10 pick out in 2015, has reworked himself into some of the league’s savviest and maximum imaginative playmakers. With 75 issues, Rantanen is fourth within the N.H.L. in scoring and has blended with Nathan MacKinnon and Gabriel Landeskog to assemble 206 issues, tied with Calgary’s height line for essentially the most of any trio.
Two Finnish avid gamers, Selanne and Jari Kurri, have led the N.H.L. in targets throughout a standard season, and each are within the Corridor of Repute. However at the back of Selanne and Kurri in profession issues in keeping with recreation by means of Finnish avid gamers are 4 energetic contributors of the N.H.L., they all beneath 25. They’re Laine, Rantanen, Barkov and Sebastian Aho of the Carolina Hurricanes.
N.H.L. season. He has adopted a trail very similar to that of Buffalo Sabres defenseman Rasmus Ristolainen, decided on 8th in 2013.
Finland’s upward thrust is obvious in global play, too. In January, the Finns earned the gold medal on the global junior championship for the 3rd time in six years, after profitable it best two times within the 40 years ahead of this run.
Neither the nationwide crew’s luck nor its avid gamers’ prolific totals within the N.H.L. are coincidental. Starting in 2009, Finnish officers made substantial investments and sweeping adjustments that gave higher continuity to participant construction. In 2014, after a disastrous under-18 global championship match that integrated a 10-Zero loss to its archrival Sweden, the Finnish federation held a wide-ranging summit that emphasised particular person talents like skating, puck-handling, taking pictures, stability and power coaching.
Kurri, a former normal supervisor of the nationwide program, described the previous fashion for luck.
Finland did produce a technology of remarkable goalies, together with winners of the Stanley Cup and the Vezina Trophy like Miikka Kiprusoff, Antti Niemi and Tuukka Rask. However now netminders have taken a again seat to skaters.
Nashville Predators goalie Pekka Rinne, 36, mentioned that the emphasis on particular person talents and the provocation of avid gamers’ imaginations thru publicity to the N.H.L. has produced essentially the most considerable and numerous crop of Finns ever to emerge in professional hockey.
The frame of mind is converting for defensemen, too, as Heiskanen and Ristolainen have no longer best logged large mins however have additionally performed with aptitude.
Jere Lehtinen, a former Dallas Stars proper wing and the overall supervisor of Finland’s nationwide crew, mentioned that each and every win, each and every medal and each and every a hit Finnish N.H.L. participant reinforces trust and raises expectancies for successive generations. His technology, which received medals on the Olympics and global championships, instilled self belief that video games have been winnable without reference to opponent, circumstance or ranking.
The Finnish pipeline presentations no indicators of drying up. Proper wing Kaapo Kakko is predicted to be a height five pick out within the coming draft in June. |
I’m proud to announce that I’ll be giving Computers <3 Structured Data for the second time this June at WordCamp Kent.
I was fortunate enough to give two talks at WordCamp Northeast Ohio (NEO) — the conference’s old name — last year, and it truly is a fantastic conference. Last year, we had keynotes from Eric Meyer and Chris Lema, and this year we get a keynote from the one and only Carrie Dils (who, if you follow her OfficeHours.FM podcast, invited me to speak with her last fall).
Word came in last night that I’ve had two talks accepted for WordCamp NEO (Northeast Ohio, formerly North Canton): Accelerating the Mobile Web with AMP and Professional Development for Professional Developers. |
module RansackableAttributes
extend ActiveSupport::Concern
UNRANSACKABLE_ATTRIBUTES = []
included do
def self.ransackable_attributes auth_object = nil
((column_names - self::UNRANSACKABLE_ATTRIBUTES) + _ransackers.keys) - ['created_at','updated_at']
end
end
end |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for ListTables
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.
# To install the latest published package dependency, execute the following:
# python3 -m pip install google-area120-tables
# [START area120tables_v1alpha1_generated_TablesService_ListTables_async]
from google.area120 import tables_v1alpha1
async def sample_list_tables():
# Create a client
client = tables_v1alpha1.TablesServiceAsyncClient()
# Initialize request argument(s)
request = tables_v1alpha1.ListTablesRequest(
)
# Make the request
page_result = client.list_tables(request=request)
# Handle the response
async for response in page_result:
print(response)
# [END area120tables_v1alpha1_generated_TablesService_ListTables_async]
|
Pneumonia is a lung infection that can make you very sick. You may cough, run a fever, and have a hard time breathing. For many individuals, pneumonia can be treated at home. It often clears up in two to three weeks. But elderly adults, babies, and people with other diseases can become very ill. They might need to be in the hospital.
Pneumonia usually starts when you breathe the bacteria into the lungs. You may be more likely to find the disease after having a cold or the flu. These health problems make it hard for your lungs to deal with infection, so it is easier to get pneumonia. Having a long-term, or chronic, disease like asthma, heart disease, cancer, or diabetes also makes you more likely to get pneumonia.
Anyone can get pneumonia. It’s commonly a complication of a respiratory infection—especially the flu—but there are more than 30 different causes of the illness. Older adults, children and people with chronic disease, including COPD and asthma, are at high risk for pneumonia.
Pneumonia symptoms can vary from mild to severe, with regards to the type of pneumonia you have.
Symptoms also can vary, depending on whether your pneumonia is bacterial or virus-like.
Pneumonia is usually the consequence of a pneumococcal illness, caused by bacteria called Streptococcus pneumoniae.
Various types of bacteria, including Haemophilus influenzae and Staphylococcus aureus, can also cause pneumonia, as well as malware and, more rarely, fungus. |
As a Registered Psychotherapist, my fees are not covered by OHIP. However, insurance companies such as Green Shield, Manulife Financial, Sun Life and Equitable Life are increasingly recognizing the professional credentials of psychotherapist, and reimbursing our clients’ fees. If not, and your policy requires that you use “Psychological Services”, you may still access these services through the supervised practice for which I work as a clinical assistant. I recommend you check your individual coverage details with your insurance provider prior to your first appointment. In this way we can make sure you are covered.
If you are not covered by insurance, or if your coverage is limited, I offer a sliding scale too. I want to work with you to make it possible for you to get the help you need.
I accept payment via cash, cheque, interac, Email Money Transfer, Visa or MasterCard.
If you would like more information, just give me a call at 416-363-0065 and we can talk in person. If you decide you would like to meet me, you may request a free half-hour consultation. This gives us a chance to meet in person and see if we can work together. If you decide to leave at this point, you may do so without obligation. However, I usually book a full hour for this appointment, so if you want to get started right away, you can. |
define(function(require){
"use strict";
var bus = require('mediator'), // in all modules that use a bus, require this to have access to the same object
$ = require('jquery'),
_ = require('underscore'),
utils = require('ui.utils');
ich.addTemplate('node',require('text!templates/node.tpl'));
ich.addTemplate('addPanelTemplate',require('text!templates/addPanel.tpl'));
ich.addTemplate('nodeDetails',require('text!templates/nodeDetails.tpl'));
var main = {
elements: {
nodeArea: $("#nodes"),
addPanelButton: $("[action=add-panel]")
},
openDialog: function(content,callback){
$(".dialog").empty().html(content);
$(".dialog").find('.button.submit').bind('click',callback);
$(".dialog .button.cancel").bind('click',$.proxy(this.closeDialog,this));
$(".overlay").removeClass('hidden');
},
closeDialog: function(){
$(".overlay").addClass('hidden');
},
formJSON: function(selector){
// convert form elements to a JS object <3
var form = {};
$(selector).find('input, select, textarea').each( function() {
var self = $(this);
var name = self.attr('name');
if (form[name]) {
form[name] = form[name] + ',' + self.val();
}
else {
form[name] = self.val();
}
});
return form;
},
data: {
panels: {},
state: {},
audio: ['track1.mp3','track2.mp3'],
animation: []
},
init: function(){
var self = this;
this.bus = bus;
this.bus.on('data:changed',$.proxy(this.updateStorage,this));
this.elements.addPanelButton.bind('click',function(){
self.openDialog(ich.addPanelTemplate({
audio_options: [],
animation_options: []
}),function(){
var ok = confirm('sure?');
if (ok) {
var panelDetails = self.formJSON($(".dialog form"));
var newpanel = {
name: _.str.underscored(_.str.slugify(panelDetails.name)),
text: _.str.clean(panelDetails.text),
position: {
left: false,
top: false
}
}
self.addPanel(newpanel);
self.closeDialog();
};
});
});
$(".pnode").live('click',$.proxy(this.nodeClickHandler,this));
this.setupPlumbingStyle();
this.loadNodes();
// Events need to be setup after the nodes are loaded to
// avoid having the connection handler adding more options
// to the panel when the panel is loaded
this.setupPlumbingEvents();
},
nodeClickHandler: function(e){
console.log(arguments);
console.log();
var panel = this.data.panels[e.srcElement.id],
self = this;
if (panel) {
$(".pnode").removeClass('current');
$("#"+e.srcElement.id).addClass('current');
this.currentEditPanel = e.srcElement.id;
var details = ich.nodeDetails(panel);
$("#node-details").empty().html(details);
$("#node-details .button.delete").bind('click',function(){
var ok = confirm('sure?');
if (!ok) {return};
_.each(self.data.panels,function(item){
if (item.options && item.options.length) {
_.each(item.options,function(option,idx){
if (option.to && option.to == self.currentEditPanel) {
item.options.splice(idx,1);
};
})
};
});
delete self.data.panels[self.currentEditPanel];
$("#"+self.currentEditPanel).remove();
$("#node-details").empty();
});
};
},
updateStorage: function(){
window.localStorage.setItem('panels',JSON.stringify(this.data.panels))
},
loadNodes: function(){
var nodes = JSON.parse(window.localStorage.getItem('panels'));
var self = this;
if (nodes) {
_.each(nodes,function(item,idx){
self.addPanel(item);
});
this.buildConnections();
};
},
buildConnections: function(){
_.each(this.data.panels,function(panel){
if (panel.options) {
_.each(panel.options,function(item){
jsPlumb.connect({
source: panel.name,
target: item.to
});
});
};
});
},
addPanel: function(panel){
if (!panel.position) {
panel.position = {
left: false,
top: false
}
};
this.data.panels[panel.name] = {
name: panel.name,
options: panel.options && panel.options.length > 0 ? panel.options : [],
text: panel.text || "missing text",
animation: panel.anmiation || false,
audio: panel.audio || false,
position: {
left: panel.position.left || (Math.random() * 300) << 0,
top: panel.position.top || (Math.random() * 300) << 0
}
}
var toinsert = ich.node(panel);
this.elements.nodeArea.append(toinsert);
var last_inserted = this.elements.nodeArea.find('.pnode:last');
last_inserted.css({'left':this.data.panels[panel.name].position.left})
last_inserted.css({'top':this.data.panels[panel.name].position.top})
this.prepNode(last_inserted);
this.bus.trigger('data:changed');
return this;
},
prepNode: function(node){
var p = node,
target = node.find('.ep:first'),
self = this;
jsPlumb.makeSource(target, {
parent: node,
anchor: "Continuous",
connector: ["StateMachine", {
curviness: 20
}],
connectorStyle: {
strokeStyle: '#AAAAAA',
lineWidth: 2
},
maxConnections: 12,
onMaxConnections: function(info, e) {
alert("Maximum connections (" + info.maxConnections + ") reached");
}
});
// initialise draggable elements.
jsPlumb.draggable(node,{
containment: "#nodes",
stop: $.proxy(self.handleDragEnd, self)
});
// initialise all '.w' elements as connection targets.
jsPlumb.makeTarget(node, {
dropOptions: {
hoverClass: "dragHover"
},
anchor: "Continuous"
});
},
handleDragEnd: function(e, item){
var node = this.data.panels[item.helper.context.id];
if (node) {
node.position = item.position;
this.bus.trigger('data:changed');
};
},
setupPlumbingStyle: function(){
// setup some defaults for jsPlumb.
jsPlumb.importDefaults({
Endpoint: ["Dot", {
radius: 2
}],
HoverPaintStyle: {
strokeStyle: "#42a62c",
lineWidth: 2
},
ConnectionOverlays: [
["Arrow", {
location: 1,
id: "arrow",
length: 14,
foldback: 0.8
}],
["Label", {
label: "",
id: "label"
}]
]
});
},
setupPlumbingEvents: function() {
var self = this;
// bind a click listener to each connection; the connection is deleted. you could of course
// just do this: jsPlumb.bind("click", jsPlumb.detach), but I wanted to make it clear what was
// happening.
jsPlumb.bind("click", function(c) {
console.log(c.endpoints[0].elementId)
// var from = c.endpoints[0].elementId;
// var to = c.endpoints[1].elementId;
// var panel = self.data.panels[from];
// if (panel) {
// _.each(panel.options,function(item,idx){
// if (item.to && item.to == to) {
// panel.options.splice(idx,1);
// };
// });
// };
// self.bus.trigger('data:changed');
// jsPlumb.detach(c);
});
// bind a connection listener. note that the parameter passed to this function contains more than
// just the new connection - see the documentation for a full list of what is included in 'info'.
// this listener changes the paint style to some random new color and also sets the connection's internal
// id as the label overlay's text.
jsPlumb.bind("connection", function(info) {
var source = main.data.panels[info.sourceId];
source.options.push({
to: info.targetId
});
info.connection.setPaintStyle({
strokeStyle: nextColour()
});
//info.connection.getOverlay("label").setLabel(info.connection.id);
});
}
};
return main;
}); |
namespace Schema.NET.Test.Examples;
using System;
using Xunit;
// https://developers.google.com/search/docs/data-types/local-businesses
public class RestaurantTest
{
private readonly Restaurant restaurant = new()
{
Id = new Uri("https://davessteakhouse.example.com"),
Name = "Dave's Steak House",
Image = new Uri("https://davessteakhouse.example.com/logo.jpg"),
SameAs = new Uri("https://davessteakhouse.example.com"),
ServesCuisine = "Steak House",
PriceRange = "$$$",
Address = new PostalAddress()
{
AddressCountry = "US",
AddressLocality = "New York",
AddressRegion = "NY",
PostalCode = "10019",
StreetAddress = "148 W 51st St",
},
Telephone = "+12122459600",
Geo = new GeoCoordinates()
{
Latitude = 40.761293D,
Longitude = -73.982294,
},
AggregateRating = new AggregateRating()
{
RatingValue = 88D,
BestRating = 100D,
WorstRating = 1D,
RatingCount = 20,
},
Review = new Review()
{
Description = "Great old fashioned steaks but the salads are sub par.",
Url = new Uri("https://www.localreviews.com/restaurants/1/2/3/daves-steak-house.html"),
Author = new Person()
{
Name = "Lisa Kennedy",
SameAs = new Uri("https://plus.google.com/114108465800532712602"),
},
Publisher = new Organization()
{
Name = "Denver Post",
SameAs = new Uri("https://www.denverpost.com"),
},
DatePublished = new DateTime(2014, 3, 13),
InLanguage = "en",
ReviewRating = new Rating()
{
WorstRating = 1D,
BestRating = 4D,
RatingValue = 3.5,
},
},
};
private readonly string json =
"{" +
"\"@context\":\"https://schema.org\"," +
"\"@type\":\"Restaurant\"," +
"\"@id\":\"https://davessteakhouse.example.com\"," +
"\"name\":\"Dave's Steak House\"," +
"\"image\":\"https://davessteakhouse.example.com/logo.jpg\"," +
"\"sameAs\":\"https://davessteakhouse.example.com\"," +
"\"address\":{" +
"\"@type\":\"PostalAddress\"," +
"\"addressCountry\":\"US\"," +
"\"addressLocality\":\"New York\"," +
"\"addressRegion\":\"NY\"," +
"\"postalCode\":\"10019\"," +
"\"streetAddress\":\"148 W 51st St\"" +
"}," +
"\"aggregateRating\":{" +
"\"@type\":\"AggregateRating\"," +
"\"bestRating\":100," +
"\"ratingValue\":88," +
"\"worstRating\":1," +
"\"ratingCount\":20" +
"}," +
"\"geo\":{" +
"\"@type\":\"GeoCoordinates\"," +
"\"latitude\":40.761293," +
"\"longitude\":-73.982294" +
"}," +
"\"review\":{" +
"\"@type\":\"Review\"," +
"\"description\":\"Great old fashioned steaks but the salads are sub par.\"," +
"\"url\":\"https://www.localreviews.com/restaurants/1/2/3/daves-steak-house.html\"," +
"\"author\":{" +
"\"@type\":\"Person\"," +
"\"name\":\"Lisa Kennedy\"," +
"\"sameAs\":\"https://plus.google.com/114108465800532712602\"" +
"}," +
"\"datePublished\":\"2014-03-13\"," +
"\"inLanguage\":\"en\"," +
"\"publisher\":{" +
"\"@type\":\"Organization\"," +
"\"name\":\"Denver Post\"," +
"\"sameAs\":\"https://www.denverpost.com\"" +
"}," +
"\"reviewRating\":{" +
"\"@type\":\"Rating\"," +
"\"bestRating\":4," +
"\"ratingValue\":3.5," +
"\"worstRating\":1" +
"}" +
"}," +
"\"telephone\":\"+12122459600\"," +
"\"priceRange\":\"$$$\"," +
"\"servesCuisine\":\"Steak House\"" +
"}";
[Fact]
public void ToString_RestaurantGoogleStructuredData_ReturnsExpectedJsonLd() =>
Assert.Equal(this.json, this.restaurant.ToString());
[Fact]
public void Deserializing_RestaurantJsonLd_ReturnsRestaurant()
{
Assert.Equal(this.restaurant.ToString(), SchemaSerializer.DeserializeObject<Restaurant>(this.json)!.ToString());
Assert.Equal(SchemaSerializer.SerializeObject(this.restaurant), SchemaSerializer.SerializeObject(SchemaSerializer.DeserializeObject<Restaurant>(this.json)!));
}
}
|
<div id="esquerda" class="menuaco">
<div id="menu-lateral">
<form role="search" method="get" action="<?php echo get_bloginfo("url") ?>" id="busca_menu">
<input type="text" name="s" value="<?php print $_GET['s'] ? $_GET['s'] : 'Procurar...' ?>" id="s-menu" class="placeholder" />
<input type="submit" class="hidden" value="Procurar" />
</form>
<?php wp_nav_menu(array('menu' => 'menu-de-aco')); ?>
</div>
</div> |
Join TCC Eco-Art member, Dancer Nikki Manx in the Labyrinth as we read Deer Dancer by Mary Lyn Ray and illustrated by Lauren Stringer followed by some interactive dance!
This program is intended for kids and their families age 5+.
$3 suggested donation per participating child. |
describe("UI.Clipboard",{
test_clipboard_text_data_set_twice: function()
{
Titanium.UI.Clipboard.setData("text/plain", "blahblah");
var data = Titanium.UI.Clipboard.getData("text/plain");
value_of(data).should_be("blahblah");
Titanium.UI.Clipboard.setData("text/plain", "blahblah");
var data = Titanium.UI.Clipboard.getData("text/plain");
value_of(data).should_be("blahblah");
},
test_clipboard_methods: function()
{
value_of(Titanium.UI.Clipboard).should_be_object();
value_of(Titanium.UI.Clipboard.setData).should_be_function();
value_of(Titanium.UI.Clipboard.getData).should_be_function();
value_of(Titanium.UI.Clipboard.clearData).should_be_function();
value_of(Titanium.UI.Clipboard.setText).should_be_function();
value_of(Titanium.UI.Clipboard.getText).should_be_function();
},
test_clipboard_text_data: function()
{
Titanium.UI.Clipboard.setData("text/plain", "blahblah");
var data = Titanium.UI.Clipboard.getData("text/plain");
value_of(data).should_be("blahblah");
Titanium.UI.Clipboard.setData("text/plain", "");
value_of(Titanium.UI.Clipboard.hasText()).should_be_false();
var data = Titanium.UI.Clipboard.getData("text/plain");
value_of(data).should_be("");
Titanium.UI.Clipboard.setData("text/plain", "crazy utf8 ‽‽‽ ⸮⸮⸮ woohoo");
data = Titanium.UI.Clipboard.getData("text/plain");
value_of(data).should_be("crazy utf8 ‽‽‽ ⸮⸮⸮ woohoo");
},
test_clipboard_text: function()
{
Titanium.UI.Clipboard.setText("blahblah");
var data = Titanium.UI.Clipboard.getText();
value_of(data).should_be("blahblah");
Titanium.UI.Clipboard.setText("");
value_of(Titanium.UI.Clipboard.hasText()).should_be_false();
data = Titanium.UI.Clipboard.getText();
value_of(data).should_be("");
Titanium.UI.Clipboard.setText("crazy utf8 ‽‽‽ ⸮⸮⸮ woohoo");
data = Titanium.UI.Clipboard.getText();
value_of(data).should_be("crazy utf8 ‽‽‽ ⸮⸮⸮ woohoo");
},
test_clipboard_clear_data: function()
{
Titanium.UI.Clipboard.setText("blahblah");
Titanium.UI.Clipboard.setData("text/plain", "blahblah");
Titanium.UI.Clipboard.clearData("text/plain");
var data = Titanium.UI.Clipboard.getText();
value_of(data).should_be("");
data = Titanium.UI.Clipboard.getData("text/plain");
value_of(data).should_be("");
},
test_clipboard_clear_text: function()
{
Titanium.UI.Clipboard.setText("blahblah");
Titanium.UI.Clipboard.setData("text/plain", "blahblah");
Titanium.UI.Clipboard.clearText();
var data = Titanium.UI.Clipboard.getText();
value_of(data).should_be("");
data = Titanium.UI.Clipboard.getData("text/plain");
value_of(data).should_be("");
// TODO: This should eventually set other data types on the
// clipboard and ensure that they are *not* cleared.
},
test_clipboard_has_text: function()
{
Titanium.UI.Clipboard.setText("blahblah");
value_of(Titanium.UI.Clipboard.hasText()).should_be_true();
Titanium.UI.Clipboard.clearData("text/plain");
value_of(Titanium.UI.Clipboard.hasText()).should_be_false();
Titanium.UI.Clipboard.setText("blahblah");
value_of(Titanium.UI.Clipboard.hasText()).should_be_true();
Titanium.UI.Clipboard.clearData("text/plain");
value_of(Titanium.UI.Clipboard.hasText()).should_be_false();
Titanium.UI.Clipboard.setText("");
value_of(Titanium.UI.Clipboard.hasText()).should_be_false();
},
test_clipboard_urilist_data: function()
{
if (Titanium.platform == "win32") /* TODO: implement uri-list in win32 */ return;
var uri1 = Titanium.Filesystem.getApplicationDirectory().toURL();
var uri2 = Titanium.Filesystem.getResourcesDirectory().toURL();
var uri3 = Titanium.Filesystem.getDesktopDirectory().toURL();
var uristring = uri1 + "\n" + uri2 + "\n" + uri3;
Titanium.UI.Clipboard.setData("text/uri-list", uristring);
var data = Titanium.UI.Clipboard.getData("text/uri-list");
value_of(data).should_be_array();
value_of(data.length).should_be(3);
value_of(data[0].indexOf(uri1)).should_be(0); // A trailing slash may have been added
value_of(data[1].indexOf(uri2)).should_be(0); // A trailing slash may have been added
value_of(data[2].indexOf(uri3)).should_be(0); // A trailing slash may have been added
Titanium.UI.Clipboard.setData("text/uri-list", null);
value_of(Titanium.UI.Clipboard.hasData("text/uri-list")).should_be_false();
var data = Titanium.UI.Clipboard.getData("text/uri-list");
value_of(data).should_be_array();
value_of(data.length).should_be(0);
Titanium.UI.Clipboard.setData("text/uri-list", [uri1, uri2, uri3]);
var data = Titanium.UI.Clipboard.getData("text/uri-list");
value_of(data).should_be_array();
value_of(data.length).should_be(3);
value_of(data[0].indexOf(uri1)).should_be(0); // A trailing slash may have been added
value_of(data[1].indexOf(uri2)).should_be(0); // A trailing slash may have been added
value_of(data[2].indexOf(uri3)).should_be(0); // A trailing slash may have been added
Titanium.UI.Clipboard.setData("text/uri-list", null);
value_of(Titanium.UI.Clipboard.hasData("text/uri-list")).should_be_false();
var data = Titanium.UI.Clipboard.getData("text/uri-list");
value_of(data).should_be_array();
value_of(data.length).should_be(0);
},
test_clipboard_clear_uri_list: function()
{
if (Titanium.platform == "win32") /* TODO: implement uri-list in win32 */ return;
var uri1 = Titanium.Filesystem.getApplicationDirectory().toURL();
var uri2 = Titanium.Filesystem.getResourcesDirectory().toURL();
var uri3 = Titanium.Filesystem.getDesktopDirectory().toURL();
var uristring = uri1 + "\n" + uri2 + "\n" + uri3;
Titanium.UI.Clipboard.setData("text/uri-list", uristring);
var data = Titanium.UI.Clipboard.getData("text/uri-list");
value_of(data).should_be_array();
value_of(data.length).should_be(3);
value_of(data[0].indexOf(uri1)).should_be(0); // A trailing slash may have been added
value_of(data[1].indexOf(uri2)).should_be(0); // A trailing slash may have been added
value_of(data[2].indexOf(uri3)).should_be(0); // A trailing slash may have been added
Titanium.UI.Clipboard.clearData("text/uri-list");
value_of(Titanium.UI.Clipboard.hasData("text/uri-list")).should_be(false);
},
test_clipboard_url_data: function()
{
if (Titanium.platform == "win32") /* TODO: implement uri-list in win32 */ return;
Titanium.UI.Clipboard.setData("url", "http://www.google.com");
var data = Titanium.UI.Clipboard.getData("url");
value_of(data).should_be("http://www.google.com");
value_of(Titanium.UI.Clipboard.hasData("url")).should_be(true);
Titanium.UI.Clipboard.setData("url", "http://www.yahoo.com");
data = Titanium.UI.Clipboard.getData("url");
value_of(data).should_be("http://www.yahoo.com");
value_of(Titanium.UI.Clipboard.hasData("url")).should_be(true);
Titanium.UI.Clipboard.setData("url", null);
value_of(Titanium.UI.Clipboard.hasData("url")).should_be_false();
data = Titanium.UI.Clipboard.getData("url");
value_of(data).should_be("");
Titanium.UI.Clipboard.setData("url", ["http://www.google.com", "http://www.yahoo.com"]);
data = Titanium.UI.Clipboard.getData("url");
value_of(data).should_be("http://www.google.com");
value_of(Titanium.UI.Clipboard.hasData("url")).should_be_true();
Titanium.UI.Clipboard.setData("url", "");
value_of(Titanium.UI.Clipboard.hasData("url")).should_be_false();
data = Titanium.UI.Clipboard.getData("url");
value_of(data).should_be("");
},
test_clipboard_clear_url_list: function()
{
if (Titanium.platform == "win32") /* TODO: implement uri-list in win32 */ return;
Titanium.UI.Clipboard.setData("url", "http://www.yahoo.com");
var data = Titanium.UI.Clipboard.getData("url");
value_of(data).should_be("http://www.yahoo.com");
Titanium.UI.Clipboard.clearData("url");
value_of(Titanium.UI.Clipboard.hasData("url")).should_be(false);
},
});
|
"She don't got no clothes on if you ask me."
Waka just moved back into the crib and is quickly realizing that Tammy is a lot more independent that he anticipated.
In this Love & Hip Hop Atlanta bonus clip, Waka is so happy to be back in his home, he decides to cook dinner for his family– Tammy and Charlie. The man is all over the place, burning himself and ish, but it’s the thought that counts. As Charlie waits for din din, Tammy comes down the stairs looking like a snack, causing Waka to take a pause to figure out where she is going. Tammy explains that going back to how things were is a bit of an adjustment for her, so checking in with her husband isn’t something that comes natural anymore. Waka looks like he feels a way but he just got his bags back in the door (even though they’re still in the hallway) so he’s really not in a position to tell her anything. There’s no way he’s stopping her shine so all he could do is kiss her on the cheek and hope she gets back home before Charlie goes to bed.
Y’all saw how he tried to tell Tammy what time to be home? Aww, so cute. Don’t miss an all new Love & Hip Hop Atlanta, next Monday at 8/7c! |
NTN 6004ZZ bearing is one of our main bearing products. We have the most complete information about NTN 6004ZZ bearing. You are welcome to consult about NTN 6004ZZ bearing.
Original Good Quality NTN Bearing Chrome Steel Electric Machinery 20x42x12 mm Deep Groove Ball NTN 6004 ZZ 2RS Bearing . US $0.04-0.56 / Piece . 1 Piece (Min. Order) ... Tags: Ntn 6004zz Bearing | Ntn Deep Groove Ball Bearing | Deep Groove Ball Bearing 6004. NSK NACHI KOYO NTN 608 6004 deep groove ball bearing 6008 .
2012 Superior Quality NTN Ball Bearing 6004ZZ products .
NTN Bearing 6004ZZ Single Row Deep Groove Radial Ball Bearing, .
JAPAN NACHI high quality low price bearing 6004ZZ headset .
JAPAN NACHI high quality low price bearing 6004ZZ headset Deep Groove Ball bearing 6004-2RS. You May Like. Not exactly what you want? 1 request, multiple quotations Get Quotations Now >> ... China ball bearing ntn bearing China ball bearing for bicycle China roller and ball bearings. Jinan Saifan Bearing Co., Ltd. 4 YRS CN. Trading Company.
Original NTN Bearing 6004ZZ, US $ 0.5 - 0.6 / Piece, Deep Groove, Deep Groove, Ball, NTN NSK NACHI KOYO China VORV.Source from Tianjin Tengqi International Trade Co., Ltd. on Alibaba.com.
NTN EC-6004ZZ Deep groove ball bearings 20x42x12mm .
FAG SNV215-F-L + 2320K + H2320 + DHV620 bearing with Best Quality in Rwanda; cheap SKF 51252 M bearing with long life; NACHI UG206+ER bearing with Best Quality in New Zealand; ... 60002RS Model Enclosure Double Sealed 1068 Quantity Add to Quote Add to Cart 6004ZZ Model 6004ZZ Manufacture Nachi NSK NTN Bore MM 20 Bore 07874.
NSK_6002ZZ bearing_availability + availability_Heidelberg .
Bearing NTN 6004ZZ(I.D 20mm x O.D 42mm x W 12mm) Part Type : Wheel, Taper & Swingarm Bearings > NTN Bearings. Weight : 68g. These motorcycle parts are not factory original equipment, they are quality replacement parts that have been designed to meet or exceed the standards set by the original manufacturer.
6004 Bearing, RFQ 6004 Bearing High Quality Suppliers .
Alibaba.com offers 314 bearing 6004zz products. About 97% of these are deep groove ball bearing. A wide variety of bearing 6004zz options are available to you, such as single row, double row. |
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.social.twitter.api;
import java.util.Date;
/**
* Twitter search parameters.
* See specifications: https://dev.twitter.com/docs/api/1.1/get/search/tweets
*
* @author Rosty Kerei
*/
public class SearchParameters {
private String query;
private GeoCode geoCode;
private String lang;
private String locale;
private ResultType resultType;
private Integer count;
private Date untilDate;
private Long sinceId;
private Long maxId;
private boolean includeEntities = true;
/**
* Constructs SearchParameter object
*
* @param query Search keywords
*/
public SearchParameters(String query) {
this.query = query;
}
/**
* Sets optional <code>geocode</code> parameter. Restricts tweets by users located within a given radius
* of the given latitude/longitude.
*
* @param geoCode GeoCode object stuffed with coordinates and radius
* @see GeoCode
* @return The same SearchParameters for additional configuration.
*/
public SearchParameters geoCode(GeoCode geoCode) {
this.geoCode = geoCode;
return this;
}
/**
* Sets optional <code>lang</code> parameter. Restricts tweets to the given language, given by an ISO 639-1 code.
*
* @param lang an ISO 639-1 language code
* @return The same SearchParameters for additional configuration.
*/
public SearchParameters lang(String lang) {
this.lang = lang;
return this;
}
/**
* Sets optional <code>locale</code> parameter. Specify the language of the query you are sending
* (only ja is currently effective).
*
* @param locale locale
* @return The same SearchParameters for additional configuration.
*/
public SearchParameters locale(String locale) {
this.locale = locale;
return this;
}
/**
* Sets optional <code>result_type</code> parameter. Specifies what type of search results. Default is <code>mixed</code>.
*
* @param resultType type of preferred result type
* @return The same SearchParameters for additional configuration.
* @see ResultType
*/
public SearchParameters resultType(ResultType resultType) {
this.resultType = resultType;
return this;
}
/**
* Sets optional <code>count</code> parameter. Restricts the number of tweets to return, up to a maximum of 100.
* Defaults to 15.
*
* @param count number of tweets to return
* @return The same SearchParameters for additional configuration.
*/
public SearchParameters count(int count) {
this.count = count;
return this;
}
/**
* Sets optional <code>until</code> parameter. Restricts search to tweets generated before the given date.
*
* @param untilDate date to search until
* @return The same SearchParameters for additional configuration.
*/
public SearchParameters until(Date untilDate) {
this.untilDate = untilDate;
return this;
}
/**
* Sets optional <code>since_id</code> parameter. Restricts search results with an ID greater than the specified one.
*
* @param sinceId The minimum {@link org.springframework.social.twitter.api.Tweet} ID to return in the results
* @return The same SearchParameters for additional configuration.
*/
public SearchParameters sinceId(long sinceId) {
this.sinceId = sinceId;
return this;
}
/**
* Sets optional <code>max_id</code> parameter. Restricts search results with an ID less or equel than the specified one.
*
* @param maxId The maximum {@link org.springframework.social.twitter.api.Tweet} ID to return in the results
* @return The same SearchParameters for additional configuration.
*/
public SearchParameters maxId(long maxId) {
this.maxId = maxId;
return this;
}
/**
* Sets optional <code>include_entities</code> parameter. The entities node will be excluded when set to false.
*
* @param includeEntities Include entities node
* @return The same SearchParameters for additional configuration.
*/
public SearchParameters includeEntities(boolean includeEntities) {
this.includeEntities = includeEntities;
return this;
}
/**
* Returns query, <code>q</code> parameter
*
* @return query
*/
public String getQuery() {
return this.query;
}
/**
* Returns <code>geo_code</code> search parameter
*
* @return geoCode
*/
public GeoCode getGeoCode() {
return this.geoCode;
}
/**
* Returns <code>lang</code> search parameter
*
* @return lang
*/
public String getLang() {
return this.lang;
}
/**
* Returns <code>locale</code> search parameter
*
* @return locale
*/
public String getLocale() {
return this.locale;
}
/**
* Returns <code>result_type</code> search parameter
*
* @return result_type
*/
public ResultType getResultType() {
return this.resultType;
}
/**
* Returns <code>count</code> search parameter
*
* @return count
*/
public Integer getCount() {
return this.count;
}
/**
* Returns <code>until</code> search parameter
*
* @return until
*/
public Date getUntil() {
return this.untilDate;
}
/**
* Returns <code>since_id</code> search parameter
*
* @return since_id
*/
public Long getSinceId() {
return this.sinceId;
}
/**
* Returns <code>max_id</code> search parameter
*
* @return max_id
*/
public Long getMaxId() {
return this.maxId;
}
/**
* Returns <code>include_entities</code> search parameter
*
* @return include_entities
*/
public boolean isIncludeEntities() {
return this.includeEntities;
}
/**
* ResultType enumeration. Used by setResultType/getResultType
*/
public static enum ResultType {
MIXED("mixed"), RECENT("recent"), POPULAR("popular");
private String resultType;
private ResultType(String resultType) {
this.resultType = resultType;
}
@Override
public String toString() {
return this.resultType;
}
}
@Override
public boolean equals(Object o) {
if (this == o) { return true; }
if (o == null || getClass() != o.getClass()) { return false; }
SearchParameters other = (SearchParameters) o;
return other.query.equals(this.query)
&& other.count == this.count
&& bothNullOrEquals(other.geoCode, this.geoCode)
&& other.includeEntities == this.includeEntities
&& bothNullOrEquals(other.lang, this.lang)
&& bothNullOrEquals(other.locale, this.locale)
&& bothNullOrEquals(other.maxId, this.maxId)
&& bothNullOrEquals(other.resultType, this.resultType)
&& bothNullOrEquals(other.sinceId, this.sinceId)
&& bothNullOrEquals(other.untilDate, this.untilDate);
}
private boolean bothNullOrEquals(Object o1, Object o2) {
return (o1 == null && o2 == null) || (o1 != null && o2 != null && o1.equals(o2));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((query == null) ? 0 : query.hashCode());
result = prime * result + ((count == null) ? 0 : count.hashCode());
result = prime * result + ((sinceId == null) ? 0 : sinceId.hashCode());
result = prime * result + ((maxId == null) ? 0 : maxId.hashCode());
result = prime * result + ((lang == null) ? 0 : lang.hashCode());
result = prime * result + ((geoCode == null) ? 0 : geoCode.hashCode());
result = prime * result + ((locale == null) ? 0 : locale.hashCode());
result = prime * result + ((resultType == null) ? 0 : resultType.hashCode());
result = prime * result + ((untilDate == null) ? 0 : untilDate.hashCode());
result = prime * result + (includeEntities ? 0 : 1);
return result;
}
}
|
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Equima extends MX_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('m_equima','me');
}
public function index(){
$data['anio_eje'] = $this->me->get_anio_activo();
$this->load->view('v_equima',$data);
}
public function getTipoMaq(){
$rows = $this->me->get_tipo_maq();
echo '{"data":'.json_encode($rows->result()).'}';
}
public function getPropiet(){
$rows = $this->me->get_propietario();
echo '{"data":'.json_encode($rows->result()).'}';
}
public function regMaqEqui($opt){
$cma = $this->input->post('cod_maqequi');
$pro = $this->input->post('id_propietario');
$tma = $this->input->post('id_maqequi');
$des = $this->input->post('desc_maqequi');
$pla = $this->input->post('placa_maqequi');
$mar = $this->input->post('marca_maqequi');
$mod = $this->input->post('modelo_maqequi');
$ser = $this->input->post('serie_maqequi');
$mot = $this->input->post('motor_maqequi');
$col = $this->input->post('color_maqequi');
$obs = $this->input->post('obs_maqequi');
$val = $this->input->post('valor_maqequi');
$hrs = $this->input->post('horas_maqequi');
if($opt == 'n'){
$result = $this->me->reg_maquinaria($cma,$pro,$tma,$des,$pla,$mar,$mod,$ser,$mot,$col,$obs,$val,$hrs);
}else if($opt == 'e'){
$result = $this->me->edit_maquinaria($cma,$pro,$tma,$des,$pla,$mar,$mod,$ser,$mot,$col,$obs,$val,$hrs);
}
if($result == "true"){
echo '{"success":"'.$result.'","msg":"Se registro el proceso"}';
}else{
echo '{"failed":"'.$result.'","msg":"Error al registrar el proceso"}';
}
}
public function getMaquina(){
$rows = $this->me->get_maquina();
echo '{"data":'.json_encode($rows->result()).'}';
}
public function getAnios(){
$rows = $this->me->get_anios();
echo '{"data":'.json_encode($rows->result()).'}';
}
public function getObras(){
$anio = $this->input->get('anio');
$rows = $this->me->get_obras($anio);
echo '{"data":'.json_encode($rows->result()).'}';
}
public function getFrente(){
$anio = $this->input->get('anio');
$obra = $this->input->get('obra');
$rows = $this->me->get_frente($anio,$obra);
echo '{"data":'.json_encode($rows->result()).'}';
}
public function getTipoDoc(){
$rows = $this->me->get_tipo_doc();
echo '{"data":'.json_encode($rows->result()).'}';
}
public function regMantEqui(){
$idm = $this->input->post('id_em_mantenimiento');
$cmaq = $this->input->post('cod_maqequi');
$ifre = $this->input->post('id_frente');
$cobr = $this->input->post('cod_obra');
$anio = $this->input->post('anio_eje');
$nord = $this->input->post('nord_mant');
$aord = $this->input->post('aord_mant');
$mont = $this->input->post('mont_mant');
$ndoc = $this->input->post('doc_mant');
$fdoc = $this->input->post('fdoc_mant');
$mdoc = $this->input->post('mdoc_mant');
$itd = $this->input->post('id_tipdoc');
$obs = $this->input->post('obs_mant');
$opt = $this->input->post('opt');
if($opt == 'n'){
$result = $this->me->reg_mant_equi($cmaq,$ifre,$cobr ,$anio,$nord,$aord,$mont,$ndoc,$fdoc,$mdoc,$itd,$obs);
}else if($opt == 'e'){
$result = $this->me->edit_mant_equi($idm,$cmaq,$ifre,$cobr ,$anio,$nord,$aord,$mont,$ndoc,$fdoc,$mdoc,$itd,$obs);
}
if($result == "true"){
echo '{"success":"'.$result.'","msg":"Se registro el proceso"}';
}else{
echo '{"failed":"'.$result.'","msg":"Error al registrar el proceso"}';
}
}
public function getMantenim(){
$anio = $this->input->get('anio_eje');
$cod = $this->input->get('cod_maqequi');
$rows = $this->me->get_mantenimientos($anio,$cod);
echo '{"data":'.json_encode($rows->result()).'}';
}
public function uploadImagen(){
$desc = $this->input->post('desc');
$cod = $this->input->post('cod_maqequi');
$config['upload_path'] = './src/maqequi/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 100;
$config['max_width'] = 1024;
$config['max_height'] = 768;
$config['encrypt_name'] = true;
$this->load->library('upload', $config);
if (!$this->upload->do_upload('file')){
$error = array('error' => $this->upload->display_errors());
$msg = $error['error'];
echo '{"failed":"false","msg":"'.$msg.'"}';
}else{
$data = $this->upload->data();
$path = $data['full_path'];
$filename = $data['file_name'];
$result = $this->me->regImagen($cod,$desc,$filename,'./src/maqequi/');
if($result == "true"){
echo '{"success":"'.$result.'","msg":"Se subio el archivo con exito"}';
}else{
echo '{"failed":"'.$result.'","msg":"Error al registrar el proceso"}';
}
}
}
public function getMaqImages(){
$maq = $this->input->get('cod_maqequi');
$rows = $this->me->get_maq_images($maq);
echo '{"data":'.json_encode($rows->result()).'}';
}
}
?> |
With the enthusiastic support of six important partner institutions, Hannover Medical School (MHH) in 2006 has established a Cluster of Excellence in the area of Regenerative Biology and Reconstructive Therapies, acronym REBIRTH.
The goal of the Excellence Initiative is to strengthen cutting-edge research in Germany and to improve its international competitiveness. Outstanding projects are funded as Clusters of Excellence which focus on the research potential at university locations in Germany and, hence, strengthen their international visibility. |
Section I: Cell Death Origin And Progression. | Section Ii: Biological Role Of Cell Death In Development And Homeostasis. | Section Iii: How Cell Death Is Carried Out. | Section Iv: Deregulation Of Cell Death In Disease And Future Intervention. |
First Data Science Paper of ARMS Lab is Published.
The first dataset paper (https://www.nature.com/articles/sdata2018101) of ARMS Lab was published in the Scientific Data published by the prestigious Nature Publishing Group. The work presents the first grasping database collected from multiple human subjects for activities of daily living in unstructured environments. The main strength of this database is the use of three different sensing modalities: color images from a head-mounted action camera, distance data from a depth sensor on the dominant arm and upper body kinematic data acquired from an inertial motion capture suit.
The 172 GB dataset can be accessed at https://figshare.com/s/39016199b923a370fed2 .
The open-source annotation software can be downloaded from https://github.com/zhanibekrysbek/Annotation-software-of-Human-Grasping-Database.
Saudabayev, A. and Varol H. A. Human grasping database for activities of daily living with depth, color and kinematic data streams. Sci. Data 5:180101 doi: 10.1038/sdata.2018.101 (2018). |
Genuine Mini gloss black front windscreen trim for the top of the windscreen.
This fits Mini R58 and R59 models.
The Mini part number is 51312758796. The current Mini part number is 51317351733. Please check this against your VIN number using the BMW electronic parts catalogue to make sure it is correct for your car before buying. If you do not know how to do this, send us the last 7 digits of your VIN number and we will check for you.
Overseas buyers must contact us for a shipping price before buying. |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
(function(){
"use strict";
let scope;
if ((typeof exports) !== "undefined"){
scope = exports;
}
else {
scope = require.register("./persistentRndStorage", {});
}
const settings = require("./settings");
const logging = require("./logging");
scope.persistentRnd = Object.create(null);
scope.persistentIncognitoRnd = Object.create(null);
let clearTimeout;
scope.init = function init(){
logging.message("initializing persistent rng storage");
logging.notice("build persistent storage");
if (settings.storePersistentRnd){
try {
let storedData = JSON.parse(settings.persistentRndStorage);
for (let domain in storedData){
const value = storedData[domain];
if (
Array.isArray(value) &&
value.length === 128 &&
value.every(function(value){
return typeof value === "number" && value >= 0 && value < 256;
})
){
scope.persistentRnd[domain] = value;
}
}
}
catch (error){
// JSON is not valid -> ignore it
}
}
else {
settings.persistentRndStorage = "";
settings.lastPersistentRndClearing = Date.now();
}
registerTimeout();
logging.notice("register settings change event listener");
settings.on(["persistentRndClearIntervalValue", "persistentRndClearIntervalUnit"], function(){
window.clearTimeout(clearTimeout);
registerTimeout();
});
settings.on("storePersistentRnd", function({newValue}){
settings.persistentRndStorage = newValue? JSON.stringify(scope.persistentRnd): "";
});
if (browser.contextualIdentities && browser.contextualIdentities.onRemoved){
logging.message("register contextual identities removal");
browser.contextualIdentities.onRemoved.addListener(function(details){
logging.message("Contextual identity", details.contextualIdentity.cookieStoreId, "removed.");
clearContainerData(details.contextualIdentity.cookieStoreId);
});
}
else {
logging.error(
"Old Firefox does not support browser.contextualIdentities.onRemoved"
);
}
};
const getInterval = function(){
const units = {
seconds: 1000,
minutes: 60 * 1000,
hours: 60 * 60 * 1000,
days: 24 * 60 * 60 * 1000,
weeks: 7 * 24 * 60 * 60 * 1000,
months: 30 * 24 * 60 * 60 * 1000,
years: 365 * 24 * 60 * 60 * 1000,
};
return function getInterval(){
return settings.persistentRndClearIntervalValue * units[settings.persistentRndClearIntervalUnit] || 0;
};
}();
browser.windows.onRemoved.addListener(async function(){
const windows = await browser.windows.getAll();
if (windows.every(function(window){
return !window.incognito;
})){
clearIncognito();
}
});
function registerTimeout(){
const interval = getInterval();
if (interval > 0){
const timeout = settings.lastPersistentRndClearing + interval - Date.now();
logging.message("registering persistent rng data clearing timeout. Clearing in ", timeout, "ms");
if (timeout > 1073741824){
// window.setTimeout can only handle delays up to 32 bit.
// Therefore we repeat the registering after 2^30 = 1073741824 seconds
clearTimeout = window.setTimeout(registerTimeout, 1073741824);
}
else {
clearTimeout = window.setTimeout(clear, timeout);
}
}
}
async function broadcast(data){
const tabs = await browser.tabs.query({});
tabs.forEach(function(tab){
browser.tabs.sendMessage(tab.id, data);
});
}
function clearIncognito(){
scope.persistentIncognitoRnd = Object.create(null);
settings.persistentIncognitoRndStorage = JSON.stringify(scope.persistentIncognitoRnd);
}
function clear(force = false){
logging.verbose("domain rnd cleared");
scope.persistentRnd = Object.create(null);
settings.persistentRndStorage = JSON.stringify(scope.persistentRnd);
settings.lastPersistentRndClearing = Date.now();
clearIncognito();
registerTimeout();
broadcast({"canvasBlocker-clear-domain-rnd": force? "force": true});
}
function setDomainData(domain, incognito, rnd){
logging.verbose("got new domain rnd for ", domain, " (incognito:", incognito, "):", rnd);
if (incognito){
scope.persistentIncognitoRnd[domain] = rnd;
settings.persistentIncognitoRndStorage = JSON.stringify(scope.persistentIncognitoRnd);
}
else {
scope.persistentRnd[domain] = rnd;
settings.persistentRndStorage = JSON.stringify(scope.persistentRnd);
}
broadcast({"canvasBlocker-set-domain-rnd": {domain, incognito, rnd}});
}
function clearDomainData(domain){
logging.verbose("clear domain rnd for ", domain);
delete scope.persistentIncognitoRnd[domain];
settings.persistentIncognitoRndStorage = JSON.stringify(scope.persistentIncognitoRnd);
delete scope.persistentRnd[domain];
settings.persistentRndStorage = JSON.stringify(scope.persistentRnd);
}
function clearContainerData(cookieStoreId){
logging.verbose("clear container rnd for ", cookieStoreId);
Object.keys(scope.persistentRnd).forEach(function(domain){
if (domain.startsWith(cookieStoreId + "@")){
delete scope.persistentRnd[domain];
}
});
settings.persistentRndStorage = JSON.stringify(scope.persistentRnd);
Object.keys(scope.persistentIncognitoRnd).forEach(function(domain){
if (domain.startsWith(cookieStoreId + "@")){
delete scope.persistentIncognitoRnd[domain];
}
});
settings.persistentIncognitoRndStorage = JSON.stringify(scope.persistentIncognitoRnd);
}
scope.clear = clear;
scope.setDomainData = setDomainData;
scope.clearDomainData = clearDomainData;
scope.clearContainerData = clearContainerData;
}()); |
<?php
declare(strict_types=1);
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 3.0.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Test\TestCase\Database\Type;
use Cake\Database\TypeFactory;
use Cake\TestSuite\TestCase;
use PDO;
/**
* Test for the Binary type.
*/
class BinaryTypeTest extends TestCase
{
/**
* @var \Cake\Database\Type\BinaryType
*/
protected $type;
/**
* @var \Cake\Database\Driver
*/
protected $driver;
/**
* Setup
*
* @return void
*/
public function setUp(): void
{
parent::setUp();
$this->type = TypeFactory::build('binary');
$this->driver = $this->getMockBuilder('Cake\Database\Driver')->getMock();
}
/**
* Test toPHP
*
* @return void
*/
public function testToPHP()
{
$this->assertNull($this->type->toPHP(null, $this->driver));
$result = $this->type->toPHP('some data', $this->driver);
$this->assertIsResource($result);
$fh = fopen(__FILE__, 'r');
$result = $this->type->toPHP($fh, $this->driver);
$this->assertSame($fh, $result);
fclose($fh);
}
/**
* Test exceptions on invalid data.
*/
public function testToPHPFailure()
{
$this->expectException(\Cake\Core\Exception\Exception::class);
$this->expectExceptionMessage('Unable to convert array into binary.');
$this->type->toPHP([], $this->driver);
}
/**
* Test converting to database format
*
* @return void
*/
public function testToDatabase()
{
$value = 'some data';
$result = $this->type->toDatabase($value, $this->driver);
$this->assertSame($value, $result);
$fh = fopen(__FILE__, 'r');
$result = $this->type->toDatabase($fh, $this->driver);
$this->assertSame($fh, $result);
}
/**
* Test that the PDO binding type is correct.
*
* @return void
*/
public function testToStatement()
{
$this->assertSame(PDO::PARAM_LOB, $this->type->toStatement('', $this->driver));
}
}
|
Around the House Attire - Be Smart!
The stay at home mom, the teenager on summer vacation, a businessman on his day off - what do you wear around the house? Your at-home outfit can actually have an impact on your emotions and your relaxation level. Whether you want to believe it or not, staying in your pajamas all day does not promote relaxation and tranquility at home. Keep these tips in mind when getting dressed in the morning.
No matter what, the first thing to keep in mind is comfort. Wearing that clubbing dress and a pair of heels all day is not going to make you feel good, no matter how pretty it is. At the end of the day, you'll feel stressed, your feet will probably hurt, and you're sure to have wrinkled that dress. The best thing to wear, especially if you're cleaning around the home or in need of running a few errands, is a comfortable pair of yoga pants or stretchy leggings and a t-shirt. This way, you can move around the house, feel comfortable while lounging, and still look put-together enough to run to the grocery store if necessary.
Jeans are another great alternative. While they're nowhere near as flexible as your favorite pair of sweatpants, a good-fitting pair of jeans should give you room to move, and still keep you comfortable while relaxing. Furthermore, they're great for any last-minute plans thrown at you. Wear a comfy t-shirt throughout the day, but change into a nicer top to go out. Since you're already half-way dressed, you will feel considerably less stressed if that really hot guy calls you for a dinner date, or if the guys ring you up for a night at the bar.
What you wear on your feet can totally change how you feel by the end of the day. Some people prefer not to wear shoes in their home. While it's perfectly fine to run around in your socks, it's better to give your soles a little support. Throw on your most worn-in and comfortable pair of sneakers. Slip into a pair of flats. Heels are definitely a no-no for around the house wear. Besides the aching in your poor feet, there's a chance of scuffing the hardwood. Flip-flops are even worse. Anyone who walks a mile in these horrible contraptions will tell you they're the worst things invented in the field of footwear. You're much better off going barefoot.
Despite all these great selections, always remember one thing when getting dressed for your day off: think comfortable and relaxed. Whatever you decide, make sure it makes you feel good, and leaves you feeling refreshed and energized for the next day, especially if you're back to work/school. There are many good options for clothes to wear around the house. |
{% extends "base.html" %}
{% from "macros.html" import render_flashed_messages %}
{% from "macros_forms.html" import render_form %}
{% block content %}
{{ render_flashed_messages() }}
<div class="container">
<h5><small>Editing character</small></h5><h3> {{ character.name }}</h3>
{{ render_form(form, class_='inline-form', enctype_='multipart/form-data') }}
</div>
{% endblock %}
{% block bodyscripts %}
{{ pagedown.include_pagedown() }}
{% endblock %} |
/**
* \file SRDelegate.hpp
*
* This is a C++11 implementation by janezz55(code.google) for the original "The Impossibly Fast C++ Delegates" authored by Sergey Ryazanov.
*
* This is originally a modified copy checkouted from https://code.google.com/p/cpppractice/source/browse/trunk/delegate.hpp on 2014/06/07.
* Last change in the chunk was r370 on Feb 9, 2014.
* The current version is based on the latest (20170123) commit on user1095108's generic library github repo at the following commit: https://github.com/user1095108/generic/commit/5078f7343e1d0751248ed7aff14660ef604446cb
*
* The following modifications were added by Benjamin YanXiang Huang
* - replace light_ptr with std::shared_ptr.
* - renamed src file.
* - minor VC workaround for template type initilisation.
* - patch to allow inline function comparison.
*
* Reference:
* - http://codereview.stackexchange.com/questions/14730/impossibly-fast-delegate-in-c11
* - http://www.codeproject.com/Articles/11015/The-Impossibly-Fast-C-Delegates
* - https://code.google.com/p/cpppractice/source/browse/trunk/delegate.hpp
* - https://github.com/janezz55/generic/blob/master/delegate.hpp
*/
#pragma once
#ifndef DELEGATE_HPP
# define DELEGATE_HPP
#include <cassert>
#include <cstring>
#include <memory>
#include <new>
#include <type_traits>
#include <utility>
namespace generic
{
template <typename T> class delegate;
template<class R, class ...A>
class delegate<R(A...)>
{
using stub_ptr_type = R(*)(void*, A&&...);
delegate(void* const o, stub_ptr_type const m) noexcept :
object_ptr_(o),
stub_ptr_(m)
{
}
public:
delegate() = default;
delegate(delegate const&) = default;
delegate(delegate&&) = default;
delegate(::std::nullptr_t const) noexcept : delegate() { }
template <class C, typename =
typename ::std::enable_if< ::std::is_class<C>{}>::type>
explicit delegate(C const* const o) noexcept :
object_ptr_(const_cast<C*>(o))
{
}
template <class C, typename =
typename ::std::enable_if< ::std::is_class<C>{}>::type>
explicit delegate(C const& o) noexcept :
object_ptr_(const_cast<C*>(&o))
{
}
template <class C>
delegate(C* const object_ptr, R(C::* const method_ptr)(A...))
{
*this = from(object_ptr, method_ptr);
}
template <class C>
delegate(C* const object_ptr, R(C::* const method_ptr)(A...) const)
{
*this = from(object_ptr, method_ptr);
}
template <class C>
delegate(C& object, R(C::* const method_ptr)(A...))
{
*this = from(object, method_ptr);
}
template <class C>
delegate(C const& object, R(C::* const method_ptr)(A...) const)
{
*this = from(object, method_ptr);
}
template <
typename T,
typename = typename ::std::enable_if<
!::std::is_same<delegate, typename ::std::decay<T>::type>::value
>::type
>
delegate(T&& f) :
store_(operator new(sizeof(typename ::std::decay<T>::type)),
functor_deleter<typename ::std::decay<T>::type>),
store_size_(sizeof(typename ::std::decay<T>::type))
{
using functor_type = typename ::std::decay<T>::type;
new (store_.get()) functor_type(::std::forward<T>(f));
object_ptr_ = store_.get();
stub_ptr_ = functor_stub<functor_type>;
deleter_ = deleter_stub<functor_type>;
}
delegate& operator=(delegate const&) = default;
delegate& operator=(delegate&&) = default;
template <class C>
delegate& operator=(R(C::* const rhs)(A...))
{
return *this = from(static_cast<C*>(object_ptr_), rhs);
}
template <class C>
delegate& operator=(R(C::* const rhs)(A...) const)
{
return *this = from(static_cast<C const*>(object_ptr_), rhs);
}
template <
typename T,
typename = typename ::std::enable_if<
!::std::is_same<delegate, typename ::std::decay<T>::type>{}
>::type
>
delegate& operator=(T&& f)
{
using functor_type = typename ::std::decay<T>::type;
if ((sizeof(functor_type) > store_size_) || !store_.unique())
{
store_.reset(operator new(sizeof(functor_type)),
functor_deleter<functor_type>);
store_size_ = sizeof(functor_type);
}
else
{
deleter_(store_.get());
}
new (store_.get()) functor_type(::std::forward<T>(f));
object_ptr_ = store_.get();
stub_ptr_ = functor_stub<functor_type>;
deleter_ = deleter_stub<functor_type>;
return *this;
}
template <R(*const function_ptr)(A...)>
static delegate from() noexcept
{
return{ nullptr, function_stub<function_ptr> };
}
template <class C, R(C::* const method_ptr)(A...)>
static delegate from(C* const object_ptr) noexcept
{
return{ object_ptr, method_stub<C, method_ptr> };
}
template <class C, R(C::* const method_ptr)(A...) const>
static delegate from(C const* const object_ptr) noexcept
{
return{ const_cast<C*>(object_ptr), const_method_stub<C, method_ptr> };
}
template <class C, R(C::* const method_ptr)(A...)>
static delegate from(C& object) noexcept
{
return{ &object, method_stub<C, method_ptr> };
}
template <class C, R(C::* const method_ptr)(A...) const>
static delegate from(C const& object) noexcept
{
return{ const_cast<C*>(&object), const_method_stub<C, method_ptr> };
}
template <typename T>
static delegate from(T&& f)
{
return ::std::forward<T>(f);
}
static delegate from(R(*const function_ptr)(A...))
{
return function_ptr;
}
template <class C>
using member_pair =
::std::pair<C* const, R(C::* const)(A...)>;
template <class C>
using const_member_pair =
::std::pair<C const* const, R(C::* const)(A...) const>;
template <class C>
static delegate from(C* const object_ptr,
R(C::* const method_ptr)(A...))
{
return member_pair<C>(object_ptr, method_ptr);
}
template <class C>
static delegate from(C const* const object_ptr,
R(C::* const method_ptr)(A...) const)
{
return const_member_pair<C>(object_ptr, method_ptr);
}
template <class C>
static delegate from(C& object, R(C::* const method_ptr)(A...))
{
return member_pair<C>(&object, method_ptr);
}
template <class C>
static delegate from(C const& object,
R(C::* const method_ptr)(A...) const)
{
return const_member_pair<C>(&object, method_ptr);
}
void reset() { stub_ptr_ = nullptr; store_.reset(); }
void reset_stub() noexcept { stub_ptr_ = nullptr; }
void swap(delegate& other) noexcept { ::std::swap(*this, other); }
bool operator==(delegate const& rhs) const noexcept
{
// comparison between functor and non-functor is left as undefined at the moment.
if (store_size_ && rhs.store_size_ && // both functors
store_size_ == rhs.store_size_)
return (std::memcmp(store_.get(), rhs.store_.get(), store_size_) == 0) && (stub_ptr_ == rhs.stub_ptr_);
return (object_ptr_ == rhs.object_ptr_) && (stub_ptr_ == rhs.stub_ptr_);
}
bool operator!=(delegate const& rhs) const noexcept
{
return !operator==(rhs);
}
bool operator<(delegate const& rhs) const noexcept
{
return (object_ptr_ < rhs.object_ptr_) ||
((object_ptr_ == rhs.object_ptr_) && (stub_ptr_ < rhs.stub_ptr_));
}
bool operator==(::std::nullptr_t const) const noexcept
{
return !stub_ptr_;
}
bool operator!=(::std::nullptr_t const) const noexcept
{
return stub_ptr_;
}
explicit operator bool() const noexcept { return stub_ptr_; }
R operator()(A... args) const
{
// assert(stub_ptr);
return stub_ptr_(object_ptr_, ::std::forward<A>(args)...);
}
private:
friend struct ::std::hash<delegate>;
using deleter_type = void(*)(void*);
void* object_ptr_;
stub_ptr_type stub_ptr_{};
deleter_type deleter_;
std::shared_ptr<void> store_;
::std::size_t store_size_;
template <class T>
static void functor_deleter(void* const p)
{
static_cast<T*>(p)->~T();
operator delete(p);
}
template <class T>
static void deleter_stub(void* const p)
{
static_cast<T*>(p)->~T();
}
template <R(*function_ptr)(A...)>
static R function_stub(void* const, A&&... args)
{
return function_ptr(::std::forward<A>(args)...);
}
template <class C, R(C::*method_ptr)(A...)>
static R method_stub(void* const object_ptr, A&&... args)
{
return (static_cast<C*>(object_ptr)->*method_ptr)(
::std::forward<A>(args)...);
}
template <class C, R(C::*method_ptr)(A...) const>
static R const_method_stub(void* const object_ptr, A&&... args)
{
return (static_cast<C const*>(object_ptr)->*method_ptr)(
::std::forward<A>(args)...);
}
template <typename>
struct is_member_pair : std::false_type { };
template <class C>
struct is_member_pair< ::std::pair<C* const,
R(C::* const)(A...)> > : std::true_type
{
};
template <typename>
struct is_const_member_pair : std::false_type { };
template <class C>
struct is_const_member_pair< ::std::pair<C const* const,
R(C::* const)(A...) const> > : std::true_type
{
};
template <typename T>
static typename ::std::enable_if<
!(is_member_pair<T>::value || // VC14 throws error here when aggregate initialization is used. i.e. is_member_pair<T>{}
is_const_member_pair<T>::value), // VC14 throws error here when aggregate initialization is used. i.e. is_const_member_pair<T>::value
R
>::type
functor_stub(void* const object_ptr, A&&... args)
{
return (*static_cast<T*>(object_ptr))(::std::forward<A>(args)...);
}
template <typename T>
static typename ::std::enable_if<
is_member_pair<T>::value || // VC14 throws error here when aggregate initialization is used. i.e. is_member_pair<T>{}
is_const_member_pair<T>::value, // VC14 throws error here when aggregate initialization is used. i.e. is_const_member_pair<T>::value
R
>::type
functor_stub(void* const object_ptr, A&&... args)
{
return (static_cast<T*>(object_ptr)->first->*
static_cast<T*>(object_ptr)->second)(::std::forward<A>(args)...);
}
};
}
namespace std
{
template <typename R, typename ...A>
struct hash<::generic::delegate<R(A...)> >
{
size_t operator()(::generic::delegate<R(A...)> const& d) const noexcept
{
auto const seed(hash<void*>()(d.object_ptr_));
return hash<decltype(d.stub_ptr_)>()(d.stub_ptr_) +
0x9e3779b9 + (seed << 6) + (seed >> 2);
}
};
}
#endif // DELEGATE_HPP
|
Colleges usually have induction applications made to assist brand new personnel incorporate. However using the hurly-burly associated with beginning inside a brand new college at the start from the college 12 months or even term a few products or even methods tend to be ignored through the management or even misinterpreted through the brand new appearance.
Beneath is actually a summary of information as well as gear that the recently hired youthful instructor must understand to assist relieve his/her intro towards the brand new college. This particular checklist is made for brand new instructors for them to begin a intend to obtain all of the information they have to relieve as well as accelerate their own intro in to college existence.
This particular checklist is promoting from my personal connection with 15 many years because mind associated with math during my final college prior to We upon the market exactly where We inducted numerous instructors. Consequently, like a instructor along with 7 years’ connection with performing agreements in certain 8 colleges, condition as well as personal, I discovered there have been couple of colleges which experienced a sufficient induction plan. Therefore I’d to produce my very own. Due to this particular, We proceeded to go equipped from each and every job interview as well as very first college day time along with a summary of queries or even products We experienced We required to request or even look for. I discovered additional brand new personnel, especially youthful personnel, experienced absolutely no actual concept of things to request or even look for. Surprise reward of those queries had been which i offered the actual job interview solar panel or even my personal long term upward collection supervisor an extremely good look at associated with my personal professionalism and reliability. 1 explained the moment your woman noticed my personal queries which i experienced your woman understood We had been the person for that work.
Therefore this particular checklist is actually caused by which encounter. It’s not always total because a few colleges may have their very own unique personality as well as there might be additional problems to check out.
However the checklist is really a large begin.
1. Personnel signal 2. Personnel sign in 3. Personnel current email address 4. Title label 5. Secrets 6. Gown signal 7. College diary 8. College student journal (in higher schools) 9. Personnel guide 10. College space chart 11. Play ground responsibility roster, chart, duties 12. Process whenever ill 13. College Conduct Administration plan 14. Plan upon e-mail utilization 15. Utilization of college cell phones 16. Duties associated with administrative. group 17. Home plans 18. Activity 19. Extracurricular actions 20. Assemblies, college, 12 months, home twenty one. Plan 22. Course comes 23. Tag publications 24. Letter head 25. Personnel conferences 26. Programs or even 12 months degree conference 27. Personnel organization or even membership 28. Marriage meetings/representative. 29. House or even type space thirty. College car parking plans thirty-one. College occasions 32. Visit associated with college 33. Pigeon openings 34. Photocopying methods 35. Hurt or even ill kid plan 36. Ill space location 37. Lunch time or even teas membership 38. Personnel typical space 39. Pc space entry as well as reservations forty. Professional amenities. 41. Spend 42. Agreements in order to indication 43. Superannuation 44. Recognized types to accomplish. |
I’ve been wanting to post this for a long while now, but I didn’t have a means to record my iPhone screen until now.
AR Critters is my thesis project from when I attended George Brown College’s Game Design post-graduate program. It’s a turn-based RPG game similar Pokemon but uses GPS and Augmented Reality in its game-play. Take a look! |
Commercial institutions and other organizations including public schools, head starts, and state and local government agencies are eligible for establishing credit accounts with Tout About Toys.
Processing and authorization of this credit application will take approximately 10 days.
All invoices charged on account are payable net 30 days from the invoice date. Late payments will result in a 1.5% per month finance charge.
Complete our short credit application to establish a company account for future orders. Please e-mail or fax (650) 692-1690 completed application. |
I will pick up your children from school, and drive them to extra curricular activities or home.
I can stay with them if you have to work late, and am available now.
I have clean background checks, references, and DMV record (can prove it). |
There are zillions of bloggers who publish articles every day on their blogs. The number is increasing every day and thus it is very important to stand out of the crowd.
Most of the bloggers don’t focus on beautifying their blog posts either due to lack of knowledge or due to laziness but it should be taken care of because if your content looks attractive and easier to read then audience will love to hang out on your blog and spend their quality time reading your articles.
So how to beautify the blog posts?
Don’t worry! I have something to share on this topic. Read on!
FASC is a WordPress plugin that provides an option to add attractive CSS buttons without using any shortcodes. When you install this plugin on your blog, it adds a tool in the visual editor that lets you add buttons quickly. Adding such attractive buttons makes your blog posts look beautifully crafted.
It is very simple to create buttons with this plugin but if you want to know how it works then do read a how to guide published on my blog.
This is a two-in-one plugin as it allows you to add color boxes and buttons as well within your blog post. But for buttons I would like you to go with FASC as mentioned above, and for color boxes Standout color boxes and buttons plugin is the best.
There is an option in plugin settings to set a default color, so that when you write just the first one without mentioning the color, the default color gets applied. In other case, if you want some other color for a particular box, then you need to specify that as I mentioned in the second option above.
Aren’t they looking attractive? Download and start using this plugin, and Enjoy!
When you write content, it’s obvious that you use abbreviations. You might not want to write their full form within the content every time you use them in the articles.
There is a creative way to do it and that you can do using the plugin called Text Hover.Install the plugin and mention the abbreviations in the settings and you are done!
This makes your article look great and also your readers will find it useful because they can easily get the full form of abbreviation just by hovering on them.
This is extremely easy to use plugin yet effective one to improve the overall look of the blog post.
With the help of this plugin you can change any character into drop cap. You need to install the plugin, and while writing the content in the WP editor put the character between the brackets. For example, if you want to turn T of This into drop cap then you need to write as [T]his.
Many a times, you use blockquote to make an important paragraph or a quotation stand out of the content. This shows with a simple look within the blockquote. To customize it even more, you can use Simply Pull Quote that lets you do the same but displays the quoted item in a neat and clean way to make it look more attractive.
Once you install the plugin you can see an option to make the text quoted.
These are the 5 plugins that help you make the content look better. Are you using any of them already? Which ones are your favourite?
If you know more of such plugins then please let us know in comments.
Thank you very much for publishing my guest post.
You have provided a worth article about post beautifier plugin. This is one of the most important work which everyone should do it before publishing there post on blog. As this helps the user to be engage with the article.
Great post as usual and good to see you here in STL.
I remember that you’ve written about FASC WP plugin on TTW, but I missed to install it.
Other plugins to make the WP blog pretty are new to me, I’ll check the details and install the needful for my blog.
I’ m happy with your active blogging activities, keep writing the posts for us.
Nirmala recently posted…Why Are You Losing Social Media Followers?
Thanks for the comment Nirmala. Glad you already know about FASC because of the post published on TTW. Yes I am more active in blogging and writing than earlier.
good post…i googled it and landed here….will use some of the plugin mentioned here.
Do use and share your experience with us. |
Hometown heroes. In a trend that Laesser-Keck calls “the new destination wedding,” couples are increasingly looking for ways to bring in elements of places that hold special memories — no matter where the actual wedding is being held. For example, a couple who got engaged in Paris might bring in vintage street lamps to light the reception, have Edith Piaf songs playing during dinner and use bistro signage for the bar. “The idea is that you can have guests feel like they’re in Nashville, New York, your alma mater — whatever spot is close to your heart — and enjoying little bits of those places that have brought you joy,” she says.
Just dreamy. The key to setting a romantic mood? Ambience. “Every couple wants to create a more romantic and intimate environment,” says Los Angeles–based event designer Trish Stevens, of Classic Party Rentals. “Wedding lighting is the best — and simplest — way to establish both.” Event designers say they’re using more pendant lights with bare “Edison” bulbs, chandeliers (both vintage and modern) and candelabras to cast a soft glow.
Be seated. Couples are moving away from a reception layout based on large round tables, which has a tendency to feel too much like a conference event, and are instead opting for either very long, rectangular tables or a mix of long tables surrounded by smaller square and round tables — all for a more intimate vibe. And lounge areas, complete with comfortable seating options, remain a crucial part of the cocktail and after-party hours.
Barns remain a strong venue trend. “The relaxed setting lets couples put their own spin on rustic chic,” says Stevens.
The right mix of style and simplicity will be the cornerstone of fabulous wedding floral arrangements in 2016.
Tone-on-tone explosion. A concentrated cluster of one color lends a graphic impact to centerpieces. Ask your florist to choose three to five different flowers in the same shade — the slight color variations create an ombré effect. For an uber-romantic feel, stick to the opposite ends of the color spectrum — either pale or deeply saturated. to set the table for fun, pick a hyper-vivid neon or a playful sorbet shade.
Look, don't eat! Everyone’s a foodie these days, so it’s no surprise that savvy couples are asking florists to include elements like coffee beans and fragrant herbs (say, mint or basil) into centerpieces and garlands. Petite seasonal fruits and vegetables are another way to layer on color.
Flowers not necessary. Potted trees, succulents, ferns, lavender sprigs and decorative leaves (such as magnolia, begonia) are no longer reserved for anchoring flower arrangements — these days they can become the focal point of the décor. Flowering plants and blooming branches (think flowering quince, crab apple or cherry blossom) also work well as creative centerpieces. And a budget-friendly elegant idea is to adorn bare branches with crepe-paper flowers or sparkly jewels.
Try this trend: Mix up your centerpieces. “All tables need not look the same,” say Amber Karson and Emily Butler of Karson Butler Events in Washington, D.C. and California. |
<html dir="LTR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
<title>TraceAppender Class</title>
<xml>
</xml>
<link rel="stylesheet" type="text/css" href="MSDN.css" />
</head>
<body id="bodyID" class="dtBODY">
<div id="nsbanner">
<div id="bannerrow1">
<table class="bannerparthead" cellspacing="0">
<tr id="hdr">
<td class="runninghead">Apache log4net SDK Documentation - Microsoft .NET Framework 4.0</td>
<td class="product">
</td>
</tr>
</table>
</div>
<div id="TitleRow">
<h1 class="dtH1">TraceAppender Class</h1>
</div>
</div>
<div id="nstext">
<p> Appends log events to the <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemDiagnosticsTraceClassTopic.htm">Trace</a> system. </p>
<p>For a list of all members of this type, see <a href="log4net.Appender.TraceAppenderMembers.html">TraceAppender Members</a>.</p>
<p>
<a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassTopic.htm">System.Object</a>
<br /> <a href="log4net.Appender.AppenderSkeleton.html">log4net.Appender.AppenderSkeleton</a><br /> <b>log4net.Appender.TraceAppender</b></p>
<div class="syntax">
<span class="lang">[Visual Basic]</span>
<br />Public Class TraceAppender<div> Inherits <a href="log4net.Appender.AppenderSkeleton.html">AppenderSkeleton</a></div></div>
<div class="syntax">
<span class="lang">[C#]</span>
<div>public class TraceAppender<b> : <a href="log4net.Appender.AppenderSkeleton.html">AppenderSkeleton</a></b></div>
</div>
<H4 class="dtH4">Thread Safety</H4>
<P>Public static (<b>Shared</b> in Visual Basic) members of this type are
safe for multithreaded operations. Instance members are <b>not</b> guaranteed to be
thread-safe.</P>
<h4 class="dtH4">Remarks</h4>
<p> The application configuration file can be used to control what listeners are actually used. See the MSDN documentation for the <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemDiagnosticsTraceClassTopic.htm">Trace</a> class for details on configuring the trace system. </p>
<p> Events are written using the <code>System.Diagnostics.Trace.Write(string,string)</code> method. The event's logger name is the default value for the category parameter of the Write method. </p>
<p>
<b>Compact Framework</b><br /> The Compact Framework does not support the <b>Trace</b> class for any operation except <code>Assert</code>. When using the Compact Framework this appender will write to the <a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemDiagnosticsDebugClassTopic.htm">Debug</a> system rather than the Trace system. This appender will therefore behave like the <a href="log4net.Appender.DebugAppender.html">DebugAppender</a>. </p>
<h4 class="dtH4">Requirements</h4><p><b>Namespace: </b><a href="log4net.Appender.html">log4net.Appender</a></p><p><b>Assembly: </b>log4net (in log4net.dll)
</p><h4 class="dtH4">See Also</h4><p><a href="log4net.Appender.TraceAppenderMembers.html">TraceAppender Members</a> | <a href="log4net.Appender.html">log4net.Appender Namespace</a></p><object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;"><param name="Keyword" value="TraceAppender class, about TraceAppender class"></param></object><hr /><div id="footer"><a href='http://logging.apache.org/log4net/'>Copyright 2004-2013 The Apache Software Foundation.</a><br></br>Apache log4net, Apache and log4net are trademarks of The Apache Software Foundation.</div></div>
</body>
</html> |
#!/bin/bash
DEV="$1"
MNT=/boot/zipl
if [ -z "$DEV" ]; then
echo "No IPL device given"
: > /tmp/install.zipl.cmdline-done
exit 1
fi
[ -d ${MNT} ] || mkdir -p ${MNT}
if ! mount -o ro "${DEV}" ${MNT}; then
echo "Failed to mount ${MNT}"
: > /tmp/install.zipl.cmdline-done
exit 1
fi
if [ -f ${MNT}/dracut-cmdline.conf ]; then
cp ${MNT}/dracut-cmdline.conf /etc/cmdline.d/99zipl.conf
fi
if [ -f ${MNT}/active_devices.txt ]; then
while read -r dev _ || [[ $dev ]]; do
[ "$dev" = "#" -o "$dev" = "" ] && continue
cio_ignore -r "$dev"
done < ${MNT}/active_devices.txt
fi
umount ${MNT}
if [ -f /etc/cmdline.d/99zipl.conf ]; then
systemctl restart dracut-cmdline.service
systemctl restart systemd-udev-trigger.service
fi
: > /tmp/install.zipl.cmdline-done
exit 0
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/extension_service.h"
#include <algorithm>
#include <set>
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/path_service.h"
#include "base/stl_util-inl.h"
#include "base/string16.h"
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/threading/thread_restrictions.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "base/version.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/debugger/devtools_manager.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/apps_promo.h"
#include "chrome/browser/extensions/extension_accessibility_api.h"
#include "chrome/browser/extensions/extension_bookmarks_module.h"
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extension_cookies_api.h"
#include "chrome/browser/extensions/extension_data_deleter.h"
#include "chrome/browser/extensions/extension_error_reporter.h"
#include "chrome/browser/extensions/extension_history_api.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_management_api.h"
#include "chrome/browser/extensions/extension_preference_api.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_processes_api.h"
#include "chrome/browser/extensions/extension_special_storage_policy.h"
#include "chrome/browser/extensions/extension_sync_data.h"
#include "chrome/browser/extensions/extension_updater.h"
#include "chrome/browser/extensions/extension_web_ui.h"
#include "chrome/browser/extensions/extension_webnavigation_api.h"
#include "chrome/browser/extensions/external_extension_provider_impl.h"
#include "chrome/browser/extensions/external_extension_provider_interface.h"
#include "chrome/browser/extensions/pending_extension_manager.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/browser/ui/webui/favicon_source.h"
#include "chrome/browser/ui/webui/ntp/shown_sections_handler.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_error_utils.h"
#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/extensions/extension_l10n_util.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browser_thread.h"
#include "content/browser/plugin_process_host.h"
#include "content/browser/plugin_service.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/common/json_value_serializer.h"
#include "content/common/notification_service.h"
#include "content/common/notification_type.h"
#include "content/common/pepper_plugin_registry.h"
#include "googleurl/src/gurl.h"
#include "net/base/registry_controlled_domain.h"
#include "webkit/database/database_tracker.h"
#include "webkit/database/database_util.h"
#include "webkit/plugins/npapi/plugin_list.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/extensions/file_browser_event_router.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_mount_point_provider.h"
#include "webkit/fileapi/file_system_path_manager.h"
#endif
using base::Time;
namespace errors = extension_manifest_errors;
namespace {
#if defined(OS_LINUX)
static const int kOmniboxIconPaddingLeft = 2;
static const int kOmniboxIconPaddingRight = 2;
#elif defined(OS_MACOSX)
static const int kOmniboxIconPaddingLeft = 0;
static const int kOmniboxIconPaddingRight = 2;
#else
static const int kOmniboxIconPaddingLeft = 0;
static const int kOmniboxIconPaddingRight = 0;
#endif
// The following enumeration is used in histograms matching
// Extensions.ManifestReload* . Values may be added, as long
// as existing values are not changed.
enum ManifestReloadReason {
NOT_NEEDED = 0, // Reload not needed.
UNPACKED_DIR, // Unpacked directory
NEEDS_RELOCALIZATION, // The local has changed since we read this extension.
NUM_MANIFEST_RELOAD_REASONS
};
ManifestReloadReason ShouldReloadExtensionManifest(const ExtensionInfo& info) {
// Always reload manifests of unpacked extensions, because they can change
// on disk independent of the manifest in our prefs.
if (info.extension_location == Extension::LOAD)
return UNPACKED_DIR;
// Reload the manifest if it needs to be relocalized.
if (extension_l10n_util::ShouldRelocalizeManifest(info))
return NEEDS_RELOCALIZATION;
return NOT_NEEDED;
}
static void ForceShutdownPlugin(const FilePath& plugin_path) {
PluginProcessHost* plugin =
PluginService::GetInstance()->FindNpapiPluginProcess(plugin_path);
if (plugin)
plugin->ForceShutdown();
}
} // namespace
ExtensionService::ExtensionRuntimeData::ExtensionRuntimeData()
: background_page_ready(false),
being_upgraded(false) {
}
ExtensionService::ExtensionRuntimeData::~ExtensionRuntimeData() {
}
ExtensionService::NaClModuleInfo::NaClModuleInfo() {
}
ExtensionService::NaClModuleInfo::~NaClModuleInfo() {
}
// ExtensionService.
const char* ExtensionService::kInstallDirectoryName = "Extensions";
const char* ExtensionService::kCurrentVersionFileName = "Current Version";
// Implements IO for the ExtensionService.
class ExtensionServiceBackend
: public base::RefCountedThreadSafe<ExtensionServiceBackend> {
public:
// |install_directory| is a path where to look for extensions to load.
ExtensionServiceBackend(
base::WeakPtr<ExtensionService> frontend,
const FilePath& install_directory);
// Loads a single extension from |path| where |path| is the top directory of
// a specific extension where its manifest file lives.
// Errors are reported through ExtensionErrorReporter. On success,
// AddExtension() is called.
// TODO(erikkay): It might be useful to be able to load a packed extension
// (presumably into memory) without installing it.
void LoadSingleExtension(const FilePath &path);
private:
friend class base::RefCountedThreadSafe<ExtensionServiceBackend>;
virtual ~ExtensionServiceBackend();
// Notify the frontend that there was an error loading an extension.
void ReportExtensionLoadError(const FilePath& extension_path,
const std::string& error);
// Notify the frontend that an extension was installed.
void OnExtensionInstalled(const scoped_refptr<const Extension>& extension);
base::WeakPtr<ExtensionService> frontend_;
// The top-level extensions directory being installed to.
FilePath install_directory_;
DISALLOW_COPY_AND_ASSIGN(ExtensionServiceBackend);
};
ExtensionServiceBackend::ExtensionServiceBackend(
base::WeakPtr<ExtensionService> frontend,
const FilePath& install_directory)
: frontend_(frontend),
install_directory_(install_directory) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
ExtensionServiceBackend::~ExtensionServiceBackend() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
BrowserThread::CurrentlyOn(BrowserThread::FILE));
}
void ExtensionServiceBackend::LoadSingleExtension(const FilePath& path_in) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
FilePath extension_path = path_in;
file_util::AbsolutePath(&extension_path);
int flags = Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD) ?
Extension::ALLOW_FILE_ACCESS : Extension::NO_FLAGS;
if (Extension::ShouldDoStrictErrorChecking(Extension::LOAD))
flags |= Extension::STRICT_ERROR_CHECKS;
std::string error;
scoped_refptr<const Extension> extension(extension_file_util::LoadExtension(
extension_path,
Extension::LOAD,
flags,
&error));
if (!extension) {
if (!BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
this,
&ExtensionServiceBackend::ReportExtensionLoadError,
extension_path, error)))
NOTREACHED() << error;
return;
}
// Report this as an installed extension so that it gets remembered in the
// prefs.
if (!BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableMethod(
this,
&ExtensionServiceBackend::OnExtensionInstalled,
extension)))
NOTREACHED();
}
void ExtensionServiceBackend::ReportExtensionLoadError(
const FilePath& extension_path, const std::string &error) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (frontend_.get())
frontend_->ReportExtensionLoadError(
extension_path, error, NotificationType::EXTENSION_INSTALL_ERROR,
true /* alert_on_error */);
}
void ExtensionServiceBackend::OnExtensionInstalled(
const scoped_refptr<const Extension>& extension) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (frontend_.get())
frontend_->OnExtensionInstalled(extension);
}
void ExtensionService::CheckExternalUninstall(const std::string& id) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Check if the providers know about this extension.
ProviderCollection::const_iterator i;
for (i = external_extension_providers_.begin();
i != external_extension_providers_.end(); ++i) {
DCHECK(i->get()->IsReady());
if (i->get()->HasExtension(id))
return; // Yup, known extension, don't uninstall.
}
// This is an external extension that we don't have registered. Uninstall.
UninstallExtension(id, true, NULL);
}
void ExtensionService::ClearProvidersForTesting() {
external_extension_providers_.clear();
}
void ExtensionService::AddProviderForTesting(
ExternalExtensionProviderInterface* test_provider) {
CHECK(test_provider);
external_extension_providers_.push_back(
linked_ptr<ExternalExtensionProviderInterface>(test_provider));
}
void ExtensionService::OnExternalExtensionUpdateUrlFound(
const std::string& id,
const GURL& update_url,
Extension::Location location) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
CHECK(Extension::IdIsValid(id));
if (GetExtensionById(id, true)) {
// Already installed. Do not change the update URL that the extension set.
return;
}
pending_extension_manager()->AddFromExternalUpdateUrl(
id, update_url, location);
external_extension_url_added_ |= true;
}
bool ExtensionService::IsDownloadFromGallery(const GURL& download_url,
const GURL& referrer_url) {
// Special-case the themes mini-gallery.
// TODO(erikkay) When that gallery goes away, remove this code.
if (IsDownloadFromMiniGallery(download_url) &&
StartsWithASCII(referrer_url.spec(),
extension_urls::kMiniGalleryBrowsePrefix, false)) {
return true;
}
const Extension* download_extension = GetExtensionByWebExtent(download_url);
const Extension* referrer_extension = GetExtensionByWebExtent(referrer_url);
const Extension* webstore_app = GetWebStoreApp();
bool referrer_valid = (referrer_extension == webstore_app);
bool download_valid = (download_extension == webstore_app);
// If the command-line gallery URL is set, then be a bit more lenient.
GURL store_url =
GURL(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kAppsGalleryURL));
if (!store_url.is_empty()) {
std::string store_tld =
net::RegistryControlledDomainService::GetDomainAndRegistry(store_url);
if (!referrer_valid) {
std::string referrer_tld =
net::RegistryControlledDomainService::GetDomainAndRegistry(
referrer_url);
// The referrer gets stripped when transitioning from https to http,
// or when hitting an unknown test cert and that commonly happens in
// testing environments. Given this, we allow an empty referrer when
// the command-line flag is set.
// Otherwise, the TLD must match the TLD of the command-line url.
referrer_valid = referrer_url.is_empty() || (referrer_tld == store_tld);
}
if (!download_valid) {
std::string download_tld =
net::RegistryControlledDomainService::GetDomainAndRegistry(
download_url);
// Otherwise, the TLD must match the TLD of the command-line url.
download_valid = (download_tld == store_tld);
}
}
return (referrer_valid && download_valid);
}
bool ExtensionService::IsDownloadFromMiniGallery(const GURL& download_url) {
return StartsWithASCII(download_url.spec(),
extension_urls::kMiniGalleryDownloadPrefix,
false); // case_sensitive
}
const Extension* ExtensionService::GetInstalledApp(const GURL& url) {
// Check for hosted app.
const Extension* app = GetExtensionByWebExtent(url);
if (app)
return app;
// Check for packaged app.
app = GetExtensionByURL(url);
if (app && app->is_app())
return app;
return NULL;
}
bool ExtensionService::IsInstalledApp(const GURL& url) {
return !!GetInstalledApp(url);
}
void ExtensionService::SetInstalledAppForRenderer(int renderer_child_id,
const Extension* app) {
installed_app_hosts_[renderer_child_id] = app;
}
const Extension* ExtensionService::GetInstalledAppForRenderer(
int renderer_child_id) {
InstalledAppMap::iterator i = installed_app_hosts_.find(renderer_child_id);
if (i == installed_app_hosts_.end())
return NULL;
return i->second;
}
// static
// This function is used to implement the command-line switch
// --uninstall-extension. The LOG statements within this function are used to
// inform the user if the uninstall cannot be done.
bool ExtensionService::UninstallExtensionHelper(
ExtensionService* extensions_service,
const std::string& extension_id) {
const Extension* extension =
extensions_service->GetInstalledExtension(extension_id);
// We can't call UninstallExtension with an invalid extension ID.
if (!extension) {
LOG(WARNING) << "Attempted uninstallation of non-existent extension with "
<< "id: " << extension_id;
return false;
}
// The following call to UninstallExtension will not allow an uninstall of a
// policy-controlled extension.
std::string error;
if (!extensions_service->UninstallExtension(extension_id, false, &error)) {
LOG(WARNING) << "Cannot uninstall extension with id " << extension_id
<< ": " << error;
return false;
}
return true;
}
ExtensionService::ExtensionService(Profile* profile,
const CommandLine* command_line,
const FilePath& install_directory,
ExtensionPrefs* extension_prefs,
bool autoupdate_enabled,
bool extensions_enabled)
: weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
profile_(profile),
extension_prefs_(extension_prefs),
pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)),
install_directory_(install_directory),
extensions_enabled_(extensions_enabled),
show_extensions_prompts_(true),
ready_(false),
toolbar_model_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
apps_promo_(profile->GetPrefs()),
event_routers_initialized_(false) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Figure out if extension installation should be enabled.
if (command_line->HasSwitch(switches::kDisableExtensions)) {
extensions_enabled_ = false;
} else if (profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions)) {
extensions_enabled_ = false;
}
registrar_.Add(this, NotificationType::EXTENSION_PROCESS_TERMINATED,
NotificationService::AllSources());
registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED,
NotificationService::AllSources());
registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED,
NotificationService::AllSources());
pref_change_registrar_.Init(profile->GetPrefs());
pref_change_registrar_.Add(prefs::kExtensionInstallAllowList, this);
pref_change_registrar_.Add(prefs::kExtensionInstallDenyList, this);
// Set up the ExtensionUpdater
if (autoupdate_enabled) {
int update_frequency = kDefaultUpdateFrequencySeconds;
if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) {
base::StringToInt(command_line->GetSwitchValueASCII(
switches::kExtensionsUpdateFrequency),
&update_frequency);
}
updater_.reset(new ExtensionUpdater(this,
extension_prefs,
profile->GetPrefs(),
profile,
update_frequency));
}
backend_ =
new ExtensionServiceBackend(weak_ptr_factory_.GetWeakPtr(),
install_directory_);
if (extensions_enabled_) {
ExternalExtensionProviderImpl::CreateExternalProviders(
this, profile_, &external_extension_providers_);
}
// Use monochrome icons for Omnibox icons.
omnibox_popup_icon_manager_.set_monochrome(true);
omnibox_icon_manager_.set_monochrome(true);
omnibox_icon_manager_.set_padding(gfx::Insets(0, kOmniboxIconPaddingLeft,
0, kOmniboxIconPaddingRight));
}
const ExtensionList* ExtensionService::extensions() const {
return &extensions_;
}
const ExtensionList* ExtensionService::disabled_extensions() const {
return &disabled_extensions_;
}
const ExtensionList* ExtensionService::terminated_extensions() const {
return &terminated_extensions_;
}
PendingExtensionManager* ExtensionService::pending_extension_manager() {
return &pending_extension_manager_;
}
ExtensionService::~ExtensionService() {
// No need to unload extensions here because they are profile-scoped, and the
// profile is in the process of being deleted.
ProviderCollection::const_iterator i;
for (i = external_extension_providers_.begin();
i != external_extension_providers_.end(); ++i) {
ExternalExtensionProviderInterface* provider = i->get();
provider->ServiceShutdown();
}
#if defined(OS_CHROMEOS)
if (event_routers_initialized_) {
ExtensionFileBrowserEventRouter::GetInstance()->
StopObservingFileSystemEvents();
}
#endif
}
void ExtensionService::InitEventRouters() {
if (event_routers_initialized_)
return;
ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_);
ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_);
browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_));
browser_event_router_->Init();
preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_));
ExtensionBookmarkEventRouter::GetInstance()->Observe(
profile_->GetBookmarkModel());
ExtensionCookiesEventRouter::GetInstance()->Init();
ExtensionManagementEventRouter::GetInstance()->Init();
ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_);
ExtensionWebNavigationEventRouter::GetInstance()->Init();
#if defined(OS_CHROMEOS)
ExtensionFileBrowserEventRouter::GetInstance()->ObserveFileSystemEvents(
profile_);
#endif
event_routers_initialized_ = true;
}
const Extension* ExtensionService::GetExtensionById(
const std::string& id, bool include_disabled) const {
return GetExtensionByIdInternal(id, true, include_disabled, false);
}
void ExtensionService::Init() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!ready_); // Can't redo init.
DCHECK_EQ(extensions_.size(), 0u);
// Hack: we need to ensure the ResourceDispatcherHost is ready before we load
// the first extension, because its members listen for loaded notifications.
g_browser_process->resource_dispatcher_host();
LoadAllExtensions();
// TODO(erikkay) this should probably be deferred to a future point
// rather than running immediately at startup.
CheckForExternalUpdates();
// TODO(erikkay) this should probably be deferred as well.
GarbageCollectExtensions();
}
void ExtensionService::UpdateExtension(const std::string& id,
const FilePath& extension_path,
const GURL& download_url) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
PendingExtensionInfo pending_extension_info;
bool is_pending_extension = pending_extension_manager_.GetById(
id, &pending_extension_info);
const Extension* extension =
GetExtensionByIdInternal(id, true, true, false);
if (!is_pending_extension && !extension) {
LOG(WARNING) << "Will not update extension " << id
<< " because it is not installed or pending";
// Delete extension_path since we're not creating a CrxInstaller
// that would do it for us.
if (!BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(
extension_file_util::DeleteFile, extension_path, false)))
NOTREACHED();
return;
}
// We want a silent install only for non-pending extensions and
// pending extensions that have install_silently set.
ExtensionInstallUI* client =
(!is_pending_extension || pending_extension_info.install_silently()) ?
NULL : new ExtensionInstallUI(profile_);
scoped_refptr<CrxInstaller> installer(MakeCrxInstaller(client));
installer->set_expected_id(id);
if (is_pending_extension)
installer->set_install_source(pending_extension_info.install_source());
else if (extension)
installer->set_install_source(extension->location());
installer->set_delete_source(true);
installer->set_original_url(download_url);
installer->InstallCrx(extension_path);
}
void ExtensionService::ReloadExtension(const std::string& extension_id) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
FilePath path;
const Extension* current_extension = GetExtensionById(extension_id, false);
// Disable the extension if it's loaded. It might not be loaded if it crashed.
if (current_extension) {
// If the extension has an inspector open for its background page, detach
// the inspector and hang onto a cookie for it, so that we can reattach
// later.
ExtensionProcessManager* manager = profile_->GetExtensionProcessManager();
ExtensionHost* host = manager->GetBackgroundHostForExtension(
current_extension);
if (host) {
// Look for an open inspector for the background page.
int devtools_cookie = DevToolsManager::GetInstance()->DetachClientHost(
host->render_view_host());
if (devtools_cookie >= 0)
orphaned_dev_tools_[extension_id] = devtools_cookie;
}
path = current_extension->path();
DisableExtension(extension_id);
disabled_extension_paths_[extension_id] = path;
} else {
path = unloaded_extension_paths_[extension_id];
}
// Check the installed extensions to see if what we're reloading was already
// installed.
scoped_ptr<ExtensionInfo> installed_extension(
extension_prefs_->GetInstalledExtensionInfo(extension_id));
if (installed_extension.get() &&
installed_extension->extension_manifest.get()) {
LoadInstalledExtension(*installed_extension, false);
} else {
// We should always be able to remember the extension's path. If it's not in
// the map, someone failed to update |unloaded_extension_paths_|.
CHECK(!path.empty());
LoadExtension(path);
}
}
bool ExtensionService::UninstallExtension(
const std::string& extension_id_unsafe,
bool external_uninstall,
std::string* error) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Copy the extension identifier since the reference might have been
// obtained via Extension::id() and the extension may be deleted in
// this function.
std::string extension_id(extension_id_unsafe);
const Extension* extension = GetInstalledExtension(extension_id);
// Callers should not send us nonexistent extensions.
CHECK(extension);
// Get hold of information we need after unloading, since the extension
// pointer will be invalid then.
GURL extension_url(extension->url());
Extension::Location location(extension->location());
// Policy change which triggers an uninstall will always set
// |external_uninstall| to true so this is the only way to uninstall
// managed extensions.
if (!Extension::UserMayDisable(location) && !external_uninstall) {
NotificationService::current()->Notify(
NotificationType::EXTENSION_UNINSTALL_NOT_ALLOWED,
Source<Profile>(profile_),
Details<const Extension>(extension));
if (error != NULL) {
*error = errors::kCannotUninstallManagedExtension;
}
return false;
}
UninstalledExtensionInfo uninstalled_extension_info(*extension);
UMA_HISTOGRAM_ENUMERATION("Extensions.UninstallType",
extension->GetType(), 100);
RecordPermissionMessagesHistogram(
extension, "Extensions.Permissions_Uninstall");
if (profile_->GetTemplateURLModel())
profile_->GetTemplateURLModel()->UnregisterExtensionKeyword(extension);
// Unload before doing more cleanup to ensure that nothing is hanging on to
// any of these resources.
UnloadExtension(extension_id, UnloadedExtensionInfo::UNINSTALL);
extension_prefs_->OnExtensionUninstalled(extension_id, location,
external_uninstall);
// Tell the backend to start deleting installed extensions on the file thread.
if (Extension::LOAD != location) {
if (!BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(
&extension_file_util::UninstallExtension,
install_directory_,
extension_id)))
NOTREACHED();
}
ClearExtensionData(extension_url);
UntrackTerminatedExtension(extension_id);
// Notify interested parties that we've uninstalled this extension.
NotificationService::current()->Notify(
NotificationType::EXTENSION_UNINSTALLED,
Source<Profile>(profile_),
Details<UninstalledExtensionInfo>(&uninstalled_extension_info));
return true;
}
void ExtensionService::ClearExtensionData(const GURL& extension_url) {
scoped_refptr<ExtensionDataDeleter> deleter(
new ExtensionDataDeleter(profile_, extension_url));
deleter->StartDeleting();
}
bool ExtensionService::IsExtensionEnabled(
const std::string& extension_id) const {
return
extension_prefs_->GetExtensionState(extension_id) == Extension::ENABLED;
}
bool ExtensionService::IsExternalExtensionUninstalled(
const std::string& extension_id) const {
return extension_prefs_->IsExternalExtensionUninstalled(extension_id);
}
void ExtensionService::EnableExtension(const std::string& extension_id) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (IsExtensionEnabled(extension_id))
return;
extension_prefs_->SetExtensionState(extension_id, Extension::ENABLED);
const Extension* extension =
GetExtensionByIdInternal(extension_id, false, true, false);
// This can happen if sync enables an extension that is not
// installed yet.
if (!extension)
return;
// Move it over to the enabled list.
extensions_.push_back(make_scoped_refptr(extension));
ExtensionList::iterator iter = std::find(disabled_extensions_.begin(),
disabled_extensions_.end(),
extension);
disabled_extensions_.erase(iter);
// Make sure any browser action contained within it is not hidden.
extension_prefs_->SetBrowserActionVisibility(extension, true);
NotifyExtensionLoaded(extension);
}
void ExtensionService::DisableExtension(const std::string& extension_id) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// The extension may have been disabled already.
if (!IsExtensionEnabled(extension_id))
return;
const Extension* extension = GetInstalledExtension(extension_id);
// |extension| can be NULL if sync disables an extension that is not
// installed yet.
if (extension && !Extension::UserMayDisable(extension->location()))
return;
extension_prefs_->SetExtensionState(extension_id, Extension::DISABLED);
extension = GetExtensionByIdInternal(extension_id, true, false, true);
if (!extension)
return;
// Move it over to the disabled list.
disabled_extensions_.push_back(make_scoped_refptr(extension));
ExtensionList::iterator iter = std::find(extensions_.begin(),
extensions_.end(),
extension);
if (iter != extensions_.end()) {
extensions_.erase(iter);
} else {
iter = std::find(terminated_extensions_.begin(),
terminated_extensions_.end(),
extension);
terminated_extensions_.erase(iter);
}
NotifyExtensionUnloaded(extension, UnloadedExtensionInfo::DISABLE);
}
void ExtensionService::GrantPermissions(const Extension* extension) {
CHECK(extension);
// We only maintain the granted permissions prefs for INTERNAL extensions.
CHECK_EQ(Extension::INTERNAL, extension->location());
ExtensionExtent effective_hosts = extension->GetEffectiveHostPermissions();
extension_prefs_->AddGrantedPermissions(extension->id(),
extension->HasFullPermissions(),
extension->api_permissions(),
effective_hosts);
}
void ExtensionService::GrantPermissionsAndEnableExtension(
const Extension* extension) {
CHECK(extension);
RecordPermissionMessagesHistogram(
extension, "Extensions.Permissions_ReEnable");
GrantPermissions(extension);
extension_prefs_->SetDidExtensionEscalatePermissions(extension, false);
EnableExtension(extension->id());
}
void ExtensionService::LoadExtension(const FilePath& extension_path) {
if (!BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
backend_.get(),
&ExtensionServiceBackend::LoadSingleExtension,
extension_path)))
NOTREACHED();
}
void ExtensionService::LoadComponentExtensions() {
for (RegisteredComponentExtensions::iterator it =
component_extension_manifests_.begin();
it != component_extension_manifests_.end(); ++it) {
LoadComponentExtension(*it);
}
}
const Extension* ExtensionService::LoadComponentExtension(
const ComponentExtensionInfo &info) {
JSONStringValueSerializer serializer(info.manifest);
scoped_ptr<Value> manifest(serializer.Deserialize(NULL, NULL));
if (!manifest.get()) {
DLOG(ERROR) << "Failed to parse manifest for extension";
return NULL;
}
int flags = Extension::REQUIRE_KEY;
if (Extension::ShouldDoStrictErrorChecking(Extension::COMPONENT))
flags |= Extension::STRICT_ERROR_CHECKS;
std::string error;
scoped_refptr<const Extension> extension(Extension::Create(
info.root_directory,
Extension::COMPONENT,
*static_cast<DictionaryValue*>(manifest.get()),
flags,
&error));
if (!extension.get()) {
NOTREACHED() << error;
return NULL;
}
AddExtension(extension);
return extension;
}
void ExtensionService::LoadAllExtensions() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
base::TimeTicks start_time = base::TimeTicks::Now();
// Load any component extensions.
LoadComponentExtensions();
// Load the previously installed extensions.
scoped_ptr<ExtensionPrefs::ExtensionsInfo> extensions_info(
extension_prefs_->GetInstalledExtensionsInfo());
std::vector<int> reload_reason_counts(NUM_MANIFEST_RELOAD_REASONS, 0);
bool should_write_prefs = false;
for (size_t i = 0; i < extensions_info->size(); ++i) {
ExtensionInfo* info = extensions_info->at(i).get();
ManifestReloadReason reload_reason = ShouldReloadExtensionManifest(*info);
++reload_reason_counts[reload_reason];
UMA_HISTOGRAM_ENUMERATION("Extensions.ManifestReloadEnumValue",
reload_reason, 100);
if (reload_reason != NOT_NEEDED) {
// Reloading and extension reads files from disk. We do this on the
// UI thread because reloads should be very rare, and the complexity
// added by delaying the time when the extensions service knows about
// all extensions is significant. See crbug.com/37548 for details.
// |allow_io| disables tests that file operations run on the file
// thread.
base::ThreadRestrictions::ScopedAllowIO allow_io;
int flags = Extension::NO_FLAGS;
if (Extension::ShouldDoStrictErrorChecking(info->extension_location))
flags |= Extension::STRICT_ERROR_CHECKS;
if (extension_prefs_->AllowFileAccess(info->extension_id))
flags |= Extension::ALLOW_FILE_ACCESS;
std::string error;
scoped_refptr<const Extension> extension(
extension_file_util::LoadExtension(
info->extension_path,
info->extension_location,
flags,
&error));
if (extension.get()) {
extensions_info->at(i)->extension_manifest.reset(
static_cast<DictionaryValue*>(
extension->manifest_value()->DeepCopy()));
should_write_prefs = true;
}
}
}
for (size_t i = 0; i < extensions_info->size(); ++i) {
LoadInstalledExtension(*extensions_info->at(i), should_write_prefs);
}
OnLoadedInstalledExtensions();
// The histograms Extensions.ManifestReload* allow us to validate
// the assumption that reloading manifest is a rare event.
UMA_HISTOGRAM_COUNTS_100("Extensions.ManifestReloadNotNeeded",
reload_reason_counts[NOT_NEEDED]);
UMA_HISTOGRAM_COUNTS_100("Extensions.ManifestReloadUnpackedDir",
reload_reason_counts[UNPACKED_DIR]);
UMA_HISTOGRAM_COUNTS_100("Extensions.ManifestReloadNeedsRelocalization",
reload_reason_counts[NEEDS_RELOCALIZATION]);
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadAll", extensions_.size());
UMA_HISTOGRAM_COUNTS_100("Extensions.Disabled", disabled_extensions_.size());
UMA_HISTOGRAM_TIMES("Extensions.LoadAllTime",
base::TimeTicks::Now() - start_time);
int app_count = 0;
int hosted_app_count = 0;
int packaged_app_count = 0;
int user_script_count = 0;
int extension_count = 0;
int theme_count = 0;
int external_count = 0;
int page_action_count = 0;
int browser_action_count = 0;
ExtensionList::iterator ex;
for (ex = extensions_.begin(); ex != extensions_.end(); ++ex) {
Extension::Location location = (*ex)->location();
Extension::Type type = (*ex)->GetType();
if ((*ex)->is_app()) {
UMA_HISTOGRAM_ENUMERATION("Extensions.AppLocation",
location, 100);
} else if (type == Extension::TYPE_EXTENSION) {
UMA_HISTOGRAM_ENUMERATION("Extensions.ExtensionLocation",
location, 100);
}
// Don't count component extensions, since they are only extensions as an
// implementation detail.
if (location == Extension::COMPONENT)
continue;
// Don't count unpacked extensions, since they're a developer-specific
// feature.
if (location == Extension::LOAD)
continue;
// Using an enumeration shows us the total installed ratio across all users.
// Using the totals per user at each startup tells us the distribution of
// usage for each user (e.g. 40% of users have at least one app installed).
UMA_HISTOGRAM_ENUMERATION("Extensions.LoadType", type, 100);
switch (type) {
case Extension::TYPE_THEME:
++theme_count;
break;
case Extension::TYPE_USER_SCRIPT:
++user_script_count;
break;
case Extension::TYPE_HOSTED_APP:
++app_count;
++hosted_app_count;
break;
case Extension::TYPE_PACKAGED_APP:
++app_count;
++packaged_app_count;
break;
case Extension::TYPE_EXTENSION:
default:
++extension_count;
break;
}
if (Extension::IsExternalLocation(location))
++external_count;
if ((*ex)->page_action() != NULL)
++page_action_count;
if ((*ex)->browser_action() != NULL)
++browser_action_count;
RecordPermissionMessagesHistogram(
ex->get(), "Extensions.Permissions_Load");
}
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadApp", app_count);
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadHostedApp", hosted_app_count);
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadPackagedApp", packaged_app_count);
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExtension", extension_count);
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadUserScript", user_script_count);
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadTheme", theme_count);
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadExternal", external_count);
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadPageAction", page_action_count);
UMA_HISTOGRAM_COUNTS_100("Extensions.LoadBrowserAction",
browser_action_count);
}
// static
void ExtensionService::RecordPermissionMessagesHistogram(
const Extension* e, const char* histogram) {
// Since this is called from multiple sources, and since the Histogram macros
// use statics, we need to manually lookup the Histogram ourselves.
base::Histogram* counter = base::LinearHistogram::FactoryGet(
histogram,
1,
Extension::PermissionMessage::ID_ENUM_BOUNDARY,
Extension::PermissionMessage::ID_ENUM_BOUNDARY + 1,
base::Histogram::kUmaTargetedHistogramFlag);
std::vector<Extension::PermissionMessage> permissions =
e->GetPermissionMessages();
if (permissions.empty()) {
counter->Add(Extension::PermissionMessage::ID_NONE);
} else {
std::vector<Extension::PermissionMessage>::iterator it;
for (it = permissions.begin(); it != permissions.end(); ++it)
counter->Add(it->message_id());
}
}
void ExtensionService::LoadInstalledExtension(const ExtensionInfo& info,
bool write_to_prefs) {
std::string error;
scoped_refptr<const Extension> extension(NULL);
if (!extension_prefs_->IsExtensionAllowedByPolicy(info.extension_id)) {
error = errors::kDisabledByPolicy;
} else if (info.extension_manifest.get()) {
int flags = Extension::NO_FLAGS;
if (info.extension_location != Extension::LOAD)
flags |= Extension::REQUIRE_KEY;
if (Extension::ShouldDoStrictErrorChecking(info.extension_location))
flags |= Extension::STRICT_ERROR_CHECKS;
if (extension_prefs_->AllowFileAccess(info.extension_id))
flags |= Extension::ALLOW_FILE_ACCESS;
extension = Extension::Create(
info.extension_path,
info.extension_location,
*info.extension_manifest,
flags,
&error);
} else {
error = errors::kManifestUnreadable;
}
if (!extension) {
ReportExtensionLoadError(info.extension_path,
error,
NotificationType::EXTENSION_INSTALL_ERROR,
false);
return;
}
if (write_to_prefs)
extension_prefs_->UpdateManifest(extension);
AddExtension(extension);
}
void ExtensionService::NotifyExtensionLoaded(const Extension* extension) {
// The ChromeURLRequestContexts need to be first to know that the extension
// was loaded, otherwise a race can arise where a renderer that is created
// for the extension may try to load an extension URL with an extension id
// that the request context doesn't yet know about. The profile is responsible
// for ensuring its URLRequestContexts appropriately discover the loaded
// extension.
profile_->RegisterExtensionWithRequestContexts(extension);
// Tell subsystems that use the EXTENSION_LOADED notification about the new
// extension.
NotificationService::current()->Notify(
NotificationType::EXTENSION_LOADED,
Source<Profile>(profile_),
Details<const Extension>(extension));
// Tell renderers about the new extension.
for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
RenderProcessHost* host = i.GetCurrentValue();
if (host->profile()->GetOriginalProfile() ==
profile_->GetOriginalProfile()) {
host->Send(
new ExtensionMsg_Loaded(ExtensionMsg_Loaded_Params(extension)));
}
}
// Tell a random-ass collection of other subsystems about the new extension.
// TODO(aa): What should we do with all this goop? Can it move into the
// relevant objects via EXTENSION_LOADED?
profile_->GetExtensionSpecialStoragePolicy()->
GrantRightsForExtension(extension);
UpdateActiveExtensionsInCrashReporter();
ExtensionWebUI::RegisterChromeURLOverrides(
profile_, extension->GetChromeURLOverrides());
if (profile_->GetTemplateURLModel())
profile_->GetTemplateURLModel()->RegisterExtensionKeyword(extension);
// Load the icon for omnibox-enabled extensions so it will be ready to display
// in the URL bar.
if (!extension->omnibox_keyword().empty()) {
omnibox_popup_icon_manager_.LoadIcon(extension);
omnibox_icon_manager_.LoadIcon(extension);
}
// If the extension has permission to load chrome://favicon/ resources we need
// to make sure that the FaviconSource is registered with the
// ChromeURLDataManager.
if (extension->HasHostPermission(GURL(chrome::kChromeUIFaviconURL))) {
FaviconSource* favicon_source = new FaviconSource(profile_,
FaviconSource::FAVICON);
profile_->GetChromeURLDataManager()->AddDataSource(favicon_source);
}
// TODO(mpcomplete): This ends up affecting all profiles. See crbug.com/80757.
bool plugins_changed = false;
for (size_t i = 0; i < extension->plugins().size(); ++i) {
const Extension::PluginInfo& plugin = extension->plugins()[i];
webkit::npapi::PluginList::Singleton()->RefreshPlugins();
webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(plugin.path);
plugins_changed = true;
if (!plugin.is_public) {
PluginService::GetInstance()->RestrictPluginToUrl(
plugin.path, extension->url());
}
}
bool nacl_modules_changed = false;
for (size_t i = 0; i < extension->nacl_modules().size(); ++i) {
const Extension::NaClModuleInfo& module = extension->nacl_modules()[i];
RegisterNaClModule(module.url, module.mime_type);
nacl_modules_changed = true;
}
if (nacl_modules_changed)
UpdatePluginListWithNaClModules();
if (plugins_changed || nacl_modules_changed)
PluginService::GetInstance()->PurgePluginListCache(false);
}
void ExtensionService::NotifyExtensionUnloaded(
const Extension* extension, UnloadedExtensionInfo::Reason reason) {
UnloadedExtensionInfo details(extension, reason);
NotificationService::current()->Notify(
NotificationType::EXTENSION_UNLOADED,
Source<Profile>(profile_),
Details<UnloadedExtensionInfo>(&details));
for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
RenderProcessHost* host = i.GetCurrentValue();
if (host->profile()->GetOriginalProfile() ==
profile_->GetOriginalProfile()) {
host->Send(new ExtensionMsg_Unloaded(extension->id()));
}
}
profile_->UnregisterExtensionWithRequestContexts(extension->id(), reason);
profile_->GetExtensionSpecialStoragePolicy()->
RevokeRightsForExtension(extension);
ExtensionWebUI::UnregisterChromeURLOverrides(
profile_, extension->GetChromeURLOverrides());
#if defined(OS_CHROMEOS)
// Revoke external file access to
if (profile_->GetFileSystemContext() &&
profile_->GetFileSystemContext()->path_manager() &&
profile_->GetFileSystemContext()->path_manager()->external_provider()) {
profile_->GetFileSystemContext()->path_manager()->external_provider()->
RevokeAccessForExtension(extension->id());
}
#endif
UpdateActiveExtensionsInCrashReporter();
bool plugins_changed = false;
for (size_t i = 0; i < extension->plugins().size(); ++i) {
const Extension::PluginInfo& plugin = extension->plugins()[i];
if (!BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
NewRunnableFunction(&ForceShutdownPlugin,
plugin.path)))
NOTREACHED();
webkit::npapi::PluginList::Singleton()->RefreshPlugins();
webkit::npapi::PluginList::Singleton()->RemoveExtraPluginPath(
plugin.path);
plugins_changed = true;
if (!plugin.is_public)
PluginService::GetInstance()->RestrictPluginToUrl(plugin.path, GURL());
}
bool nacl_modules_changed = false;
for (size_t i = 0; i < extension->nacl_modules().size(); ++i) {
const Extension::NaClModuleInfo& module = extension->nacl_modules()[i];
UnregisterNaClModule(module.url);
nacl_modules_changed = true;
}
if (nacl_modules_changed)
UpdatePluginListWithNaClModules();
if (plugins_changed || nacl_modules_changed)
PluginService::GetInstance()->PurgePluginListCache(false);
}
void ExtensionService::UpdateExtensionBlacklist(
const std::vector<std::string>& blacklist) {
// Use this set to indicate if an extension in the blacklist has been used.
std::set<std::string> blacklist_set;
for (unsigned int i = 0; i < blacklist.size(); ++i) {
if (Extension::IdIsValid(blacklist[i])) {
blacklist_set.insert(blacklist[i]);
}
}
extension_prefs_->UpdateBlacklist(blacklist_set);
std::vector<std::string> to_be_removed;
// Loop current extensions, unload installed extensions.
for (ExtensionList::const_iterator iter = extensions_.begin();
iter != extensions_.end(); ++iter) {
const Extension* extension = (*iter);
if (blacklist_set.find(extension->id()) != blacklist_set.end()) {
to_be_removed.push_back(extension->id());
}
}
// UnloadExtension will change the extensions_ list. So, we should
// call it outside the iterator loop.
for (unsigned int i = 0; i < to_be_removed.size(); ++i) {
UnloadExtension(to_be_removed[i], UnloadedExtensionInfo::DISABLE);
}
}
Profile* ExtensionService::profile() {
return profile_;
}
ExtensionPrefs* ExtensionService::extension_prefs() {
return extension_prefs_;
}
ExtensionUpdater* ExtensionService::updater() {
return updater_.get();
}
void ExtensionService::CheckAdminBlacklist() {
std::vector<std::string> to_be_removed;
// Loop through extensions list, unload installed extensions.
for (ExtensionList::const_iterator iter = extensions_.begin();
iter != extensions_.end(); ++iter) {
const Extension* extension = (*iter);
if (!extension_prefs_->IsExtensionAllowedByPolicy(extension->id()))
to_be_removed.push_back(extension->id());
}
// UnloadExtension will change the extensions_ list. So, we should
// call it outside the iterator loop.
for (unsigned int i = 0; i < to_be_removed.size(); ++i)
UnloadExtension(to_be_removed[i], UnloadedExtensionInfo::DISABLE);
}
void ExtensionService::CheckForUpdatesSoon() {
if (updater()) {
updater()->CheckSoon();
} else {
LOG(WARNING) << "CheckForUpdatesSoon() called with auto-update turned off";
}
}
ExtensionSyncData ExtensionService::GetSyncDataHelper(
const Extension& extension) const {
const std::string& id = extension.id();
ExtensionSyncData data;
data.id = id;
data.uninstalled = false;
data.enabled = IsExtensionEnabled(id);
data.incognito_enabled = IsIncognitoEnabled(id);
data.version = *extension.version();
data.update_url = extension.update_url();
data.name = extension.name();
return data;
}
bool ExtensionService::GetSyncData(
const Extension& extension,
ExtensionFilter filter,
ExtensionSyncData* extension_sync_data) const {
if (!(*filter)(extension)) {
return false;
}
*extension_sync_data = GetSyncDataHelper(extension);
return true;
}
void ExtensionService::GetSyncDataListHelper(
const ExtensionList& extensions,
ExtensionFilter filter,
std::vector<ExtensionSyncData>* sync_data_list) const {
for (ExtensionList::const_iterator it = extensions.begin();
it != extensions.end(); ++it) {
const Extension& extension = **it;
if ((*filter)(extension)) {
sync_data_list->push_back(GetSyncDataHelper(extension));
}
}
}
std::vector<ExtensionSyncData> ExtensionService::GetSyncDataList(
ExtensionFilter filter) const {
std::vector<ExtensionSyncData> sync_data_list;
GetSyncDataListHelper(extensions_, filter, &sync_data_list);
GetSyncDataListHelper(disabled_extensions_, filter, &sync_data_list);
GetSyncDataListHelper(terminated_extensions_, filter, &sync_data_list);
return sync_data_list;
}
void ExtensionService::ProcessSyncData(
const ExtensionSyncData& extension_sync_data,
ExtensionFilter filter) {
const std::string& id = extension_sync_data.id;
// Handle uninstalls first.
if (extension_sync_data.uninstalled) {
std::string error;
if (!UninstallExtensionHelper(this, id)) {
LOG(WARNING) << "Could not uninstall extension " << id
<< " for sync";
}
return;
}
// Set user settings.
if (extension_sync_data.enabled) {
EnableExtension(id);
} else {
DisableExtension(id);
}
SetIsIncognitoEnabled(id, extension_sync_data.incognito_enabled);
const Extension* extension = GetInstalledExtension(id);
if (extension) {
// If the extension is already installed, check if it's outdated.
int result = extension->version()->CompareTo(extension_sync_data.version);
if (result < 0) {
// Extension is outdated.
CheckForUpdatesSoon();
} else if (result > 0) {
// Sync version is outdated. Do nothing for now, as sync code
// in other places will eventually update the sync data.
//
// TODO(akalin): Move that code here.
}
} else {
// TODO(akalin): Replace silent update with a list of enabled
// permissions.
const bool kInstallSilently = true;
if (!pending_extension_manager()->AddFromSync(
id,
extension_sync_data.update_url,
filter,
kInstallSilently)) {
LOG(WARNING) << "Could not add pending extension for " << id;
return;
}
CheckForUpdatesSoon();
}
}
bool ExtensionService::IsIncognitoEnabled(
const std::string& extension_id) const {
// If this is an existing component extension we always allow it to
// work in incognito mode.
const Extension* extension = GetInstalledExtension(extension_id);
if (extension && extension->location() == Extension::COMPONENT)
return true;
// Check the prefs.
return extension_prefs_->IsIncognitoEnabled(extension_id);
}
void ExtensionService::SetIsIncognitoEnabled(
const std::string& extension_id, bool enabled) {
const Extension* extension = GetInstalledExtension(extension_id);
if (extension && extension->location() == Extension::COMPONENT) {
// This shouldn't be called for component extensions.
NOTREACHED();
return;
}
// Broadcast unloaded and loaded events to update browser state. Only bother
// if the value changed and the extension is actually enabled, since there is
// no UI otherwise.
bool old_enabled = extension_prefs_->IsIncognitoEnabled(extension_id);
if (enabled == old_enabled)
return;
extension_prefs_->SetIsIncognitoEnabled(extension_id, enabled);
// If the extension is enabled (and not terminated), unload and
// reload it to update UI.
const Extension* enabled_extension = GetExtensionById(extension_id, false);
if (enabled_extension) {
NotifyExtensionUnloaded(enabled_extension, UnloadedExtensionInfo::DISABLE);
NotifyExtensionLoaded(enabled_extension);
}
}
bool ExtensionService::CanCrossIncognito(const Extension* extension) {
// We allow the extension to see events and data from another profile iff it
// uses "spanning" behavior and it has incognito access. "split" mode
// extensions only see events for a matching profile.
return IsIncognitoEnabled(extension->id()) &&
!extension->incognito_split_mode();
}
bool ExtensionService::AllowFileAccess(const Extension* extension) {
return (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableExtensionsFileAccessCheck) ||
extension_prefs_->AllowFileAccess(extension->id()));
}
void ExtensionService::SetAllowFileAccess(const Extension* extension,
bool allow) {
// Reload to update browser state. Only bother if the value changed and the
// extension is actually enabled, since there is no UI otherwise.
bool old_allow = AllowFileAccess(extension);
if (allow == old_allow)
return;
extension_prefs_->SetAllowFileAccess(extension->id(), allow);
bool extension_is_enabled = std::find(extensions_.begin(), extensions_.end(),
extension) != extensions_.end();
if (extension_is_enabled)
ReloadExtension(extension->id());
}
bool ExtensionService::GetBrowserActionVisibility(const Extension* extension) {
return extension_prefs_->GetBrowserActionVisibility(extension);
}
void ExtensionService::SetBrowserActionVisibility(const Extension* extension,
bool visible) {
extension_prefs_->SetBrowserActionVisibility(extension, visible);
}
// Some extensions will autoupdate themselves externally from Chrome. These
// are typically part of some larger client application package. To support
// these, the extension will register its location in the the preferences file
// (and also, on Windows, in the registry) and this code will periodically
// check that location for a .crx file, which it will then install locally if
// a new version is available.
// Errors are reported through ExtensionErrorReporter. Succcess is not
// reported.
void ExtensionService::CheckForExternalUpdates() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Note that this installation is intentionally silent (since it didn't
// go through the front-end). Extensions that are registered in this
// way are effectively considered 'pre-bundled', and so implicitly
// trusted. In general, if something has HKLM or filesystem access,
// they could install an extension manually themselves anyway.
// If any external extension records give a URL, a provider will set
// this to true. Used by OnExternalProviderReady() to see if we need
// to start an update check to fetch a new external extension.
external_extension_url_added_ = false;
// Ask each external extension provider to give us a call back for each
// extension they know about. See OnExternalExtension(File|UpdateUrl)Found.
ProviderCollection::const_iterator i;
for (i = external_extension_providers_.begin();
i != external_extension_providers_.end(); ++i) {
ExternalExtensionProviderInterface* provider = i->get();
provider->VisitRegisteredExtension();
}
// Uninstall of unclaimed extensions will happen after all the providers
// had reported ready. Every provider calls OnExternalProviderReady()
// when it finishes, and OnExternalProviderReady() only acts when all
// providers are ready. In case there are no providers, we call it
// to trigger removal of extensions that used to have an external source.
if (external_extension_providers_.empty())
OnExternalProviderReady();
}
void ExtensionService::OnExternalProviderReady() {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// An external provider has finished loading. We only take action
// if all of them are finished. So we check them first.
ProviderCollection::const_iterator i;
for (i = external_extension_providers_.begin();
i != external_extension_providers_.end(); ++i) {
ExternalExtensionProviderInterface* provider = i->get();
if (!provider->IsReady())
return;
}
// All the providers are ready. Install any pending extensions.
if (external_extension_url_added_ && updater()) {
external_extension_url_added_ = false;
updater()->CheckNow();
}
// Uninstall all the unclaimed extensions.
scoped_ptr<ExtensionPrefs::ExtensionsInfo> extensions_info(
extension_prefs_->GetInstalledExtensionsInfo());
for (size_t i = 0; i < extensions_info->size(); ++i) {
ExtensionInfo* info = extensions_info->at(i).get();
if (Extension::IsExternalLocation(info->extension_location))
CheckExternalUninstall(info->extension_id);
}
}
void ExtensionService::UnloadExtension(
const std::string& extension_id,
UnloadedExtensionInfo::Reason reason) {
// Make sure the extension gets deleted after we return from this function.
scoped_refptr<const Extension> extension(
GetExtensionByIdInternal(extension_id, true, true, false));
// This method can be called via PostTask, so the extension may have been
// unloaded by the time this runs.
if (!extension) {
// In case the extension may have crashed/uninstalled. Allow the profile to
// clean up its RequestContexts.
profile_->UnregisterExtensionWithRequestContexts(extension_id, reason);
return;
}
// Keep information about the extension so that we can reload it later
// even if it's not permanently installed.
unloaded_extension_paths_[extension->id()] = extension->path();
// Clean up if the extension is meant to be enabled after a reload.
disabled_extension_paths_.erase(extension->id());
// Clean up runtime data.
extension_runtime_data_.erase(extension_id);
ExtensionList::iterator iter = std::find(disabled_extensions_.begin(),
disabled_extensions_.end(),
extension.get());
if (iter != disabled_extensions_.end()) {
UnloadedExtensionInfo details(extension, reason);
details.already_disabled = true;
disabled_extensions_.erase(iter);
NotificationService::current()->Notify(
NotificationType::EXTENSION_UNLOADED,
Source<Profile>(profile_),
Details<UnloadedExtensionInfo>(&details));
// Make sure the profile cleans up its RequestContexts when an already
// disabled extension is unloaded (since they are also tracking the disabled
// extensions).
profile_->UnregisterExtensionWithRequestContexts(extension_id, reason);
return;
}
iter = std::find(extensions_.begin(), extensions_.end(), extension.get());
// Remove the extension from our list.
extensions_.erase(iter);
NotifyExtensionUnloaded(extension.get(), reason);
}
void ExtensionService::UnloadAllExtensions() {
profile_->GetExtensionSpecialStoragePolicy()->
RevokeRightsForAllExtensions();
extensions_.clear();
disabled_extensions_.clear();
terminated_extension_ids_.clear();
terminated_extensions_.clear();
extension_runtime_data_.clear();
// TODO(erikkay) should there be a notification for this? We can't use
// EXTENSION_UNLOADED since that implies that the extension has been disabled
// or uninstalled, and UnloadAll is just part of shutdown.
}
void ExtensionService::ReloadExtensions() {
UnloadAllExtensions();
LoadAllExtensions();
}
void ExtensionService::GarbageCollectExtensions() {
if (extension_prefs_->pref_service()->ReadOnly())
return;
scoped_ptr<ExtensionPrefs::ExtensionsInfo> info(
extension_prefs_->GetInstalledExtensionsInfo());
std::map<std::string, FilePath> extension_paths;
for (size_t i = 0; i < info->size(); ++i)
extension_paths[info->at(i)->extension_id] = info->at(i)->extension_path;
if (!BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(
&extension_file_util::GarbageCollectExtensions,
install_directory_,
extension_paths)))
NOTREACHED();
// Also garbage-collect themes. We check |profile_| to be
// defensive; in the future, we may call GarbageCollectExtensions()
// from somewhere other than Init() (e.g., in a timer).
if (profile_) {
ThemeServiceFactory::GetForProfile(profile_)->RemoveUnusedThemes();
}
}
void ExtensionService::OnLoadedInstalledExtensions() {
if (updater_.get()) {
updater_->Start();
}
ready_ = true;
NotificationService::current()->Notify(
NotificationType::EXTENSIONS_READY,
Source<Profile>(profile_),
NotificationService::NoDetails());
}
void ExtensionService::AddExtension(const Extension* extension) {
// Ensure extension is deleted unless we transfer ownership.
scoped_refptr<const Extension> scoped_extension(extension);
// TODO(jstritar): We may be able to get rid of this branch by overriding the
// default extension state to DISABLED when the --disable-extensions flag
// is set (http://crbug.com/29067).
if (!extensions_enabled() &&
!extension->is_theme() &&
extension->location() != Extension::COMPONENT &&
!Extension::IsExternalLocation(extension->location()))
return;
SetBeingUpgraded(extension, false);
// The extension is now loaded, remove its data from unloaded extension map.
unloaded_extension_paths_.erase(extension->id());
// If a terminated extension is loaded, remove it from the terminated list.
UntrackTerminatedExtension(extension->id());
// If the extension was disabled for a reload, then enable it.
if (disabled_extension_paths_.erase(extension->id()) > 0)
EnableExtension(extension->id());
// Check if the extension's privileges have changed and disable the
// extension if necessary.
DisableIfPrivilegeIncrease(extension);
Extension::State state = extension_prefs_->GetExtensionState(extension->id());
if (state == Extension::DISABLED) {
disabled_extensions_.push_back(scoped_extension);
// TODO(aa): This seems dodgy. It seems that AddExtension() could get called
// with a disabled extension for other reasons other than that an update was
// disabled.
NotificationService::current()->Notify(
NotificationType::EXTENSION_UPDATE_DISABLED,
Source<Profile>(profile_),
Details<const Extension>(extension));
return;
}
// It should not be possible to get here with EXTERNAL_EXTENSION_UNINSTALLED
// because we would not have loaded the extension in that case.
CHECK(state == Extension::ENABLED);
extensions_.push_back(scoped_extension);
NotifyExtensionLoaded(extension);
}
void ExtensionService::DisableIfPrivilegeIncrease(const Extension* extension) {
// We keep track of all permissions the user has granted each extension.
// This allows extensions to gracefully support backwards compatibility
// by including unknown permissions in their manifests. When the user
// installs the extension, only the recognized permissions are recorded.
// When the unknown permissions become recognized (e.g., through browser
// upgrade), we can prompt the user to accept these new permissions.
// Extensions can also silently upgrade to less permissions, and then
// silently upgrade to a version that adds these permissions back.
//
// For example, pretend that Chrome 10 includes a permission "omnibox"
// for an API that adds suggestions to the omnibox. An extension can
// maintain backwards compatibility while still having "omnibox" in the
// manifest. If a user installs the extension on Chrome 9, the browser
// will record the permissions it recognized, not including "omnibox."
// When upgrading to Chrome 10, "omnibox" will be recognized and Chrome
// will disable the extension and prompt the user to approve the increase
// in privileges. The extension could then release a new version that
// removes the "omnibox" permission. When the user upgrades, Chrome will
// still remember that "omnibox" had been granted, so that if the
// extension once again includes "omnibox" in an upgrade, the extension
// can upgrade without requiring this user's approval.
const Extension* old = GetExtensionByIdInternal(extension->id(),
true, true, false);
bool granted_full_access;
std::set<std::string> granted_apis;
ExtensionExtent granted_extent;
bool is_extension_upgrade = old != NULL;
bool is_privilege_increase = false;
// We only record the granted permissions for INTERNAL extensions, since
// they can't silently increase privileges.
if (extension->location() == Extension::INTERNAL) {
// Add all the recognized permissions if the granted permissions list
// hasn't been initialized yet.
if (!extension_prefs_->GetGrantedPermissions(extension->id(),
&granted_full_access,
&granted_apis,
&granted_extent)) {
GrantPermissions(extension);
CHECK(extension_prefs_->GetGrantedPermissions(extension->id(),
&granted_full_access,
&granted_apis,
&granted_extent));
}
// Here, we check if an extension's privileges have increased in a manner
// that requires the user's approval. This could occur because the browser
// upgraded and recognized additional privileges, or an extension upgrades
// to a version that requires additional privileges.
is_privilege_increase = Extension::IsPrivilegeIncrease(
granted_full_access, granted_apis, granted_extent, extension);
}
if (is_extension_upgrade) {
// Other than for unpacked extensions, CrxInstaller should have guaranteed
// that we aren't downgrading.
if (extension->location() != Extension::LOAD)
CHECK(extension->version()->CompareTo(*(old->version())) >= 0);
// Extensions get upgraded if the privileges are allowed to increase or
// the privileges haven't increased.
if (!is_privilege_increase) {
SetBeingUpgraded(old, true);
SetBeingUpgraded(extension, true);
}
// To upgrade an extension in place, unload the old one and
// then load the new one.
UnloadExtension(old->id(), UnloadedExtensionInfo::UPDATE);
old = NULL;
}
// Extension has changed permissions significantly. Disable it. A
// notification should be sent by the caller.
if (is_privilege_increase) {
if (!extension_prefs_->DidExtensionEscalatePermissions(extension->id())) {
RecordPermissionMessagesHistogram(
extension, "Extensions.Permissions_AutoDisable");
}
extension_prefs_->SetExtensionState(extension->id(), Extension::DISABLED);
extension_prefs_->SetDidExtensionEscalatePermissions(extension, true);
}
}
void ExtensionService::UpdateActiveExtensionsInCrashReporter() {
std::set<std::string> extension_ids;
for (size_t i = 0; i < extensions_.size(); ++i) {
if (!extensions_[i]->is_theme() &&
extensions_[i]->location() != Extension::COMPONENT)
extension_ids.insert(extensions_[i]->id());
}
child_process_logging::SetActiveExtensions(extension_ids);
}
void ExtensionService::OnExtensionInstalled(const Extension* extension) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Ensure extension is deleted unless we transfer ownership.
scoped_refptr<const Extension> scoped_extension(extension);
const std::string& id = extension->id();
bool initial_enable = IsExtensionEnabled(id);
PendingExtensionInfo pending_extension_info;
if (pending_extension_manager()->GetById(id, &pending_extension_info)) {
pending_extension_manager()->Remove(id);
if (!pending_extension_info.ShouldAllowInstall(*extension)) {
LOG(WARNING)
<< "ShouldAllowInstall() returned false for "
<< id << " of type " << extension->GetType()
<< " and update URL " << extension->update_url().spec()
<< "; not installing";
NotificationService::current()->Notify(
NotificationType::EXTENSION_INSTALL_NOT_ALLOWED,
Source<Profile>(profile_),
Details<const Extension>(extension));
// Delete the extension directory since we're not going to
// load it.
if (!BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
NewRunnableFunction(&extension_file_util::DeleteFile,
extension->path(), true)))
NOTREACHED();
return;
}
} else {
// We explicitly want to re-enable an uninstalled external
// extension; if we're here, that means the user is manually
// installing the extension.
if (IsExternalExtensionUninstalled(id)) {
initial_enable = true;
}
}
UMA_HISTOGRAM_ENUMERATION("Extensions.InstallType",
extension->GetType(), 100);
RecordPermissionMessagesHistogram(
extension, "Extensions.Permissions_Install");
ShownSectionsHandler::OnExtensionInstalled(profile_->GetPrefs(), extension);
extension_prefs_->OnExtensionInstalled(
extension, initial_enable ? Extension::ENABLED : Extension::DISABLED);
// Unpacked extensions default to allowing file access, but if that has been
// overridden, don't reset the value.
if (Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD) &&
!extension_prefs_->HasAllowFileAccessSetting(id)) {
extension_prefs_->SetAllowFileAccess(id, true);
}
NotificationService::current()->Notify(
NotificationType::EXTENSION_INSTALLED,
Source<Profile>(profile_),
Details<const Extension>(extension));
// Transfer ownership of |extension| to AddExtension.
AddExtension(scoped_extension);
}
const Extension* ExtensionService::GetExtensionByIdInternal(
const std::string& id, bool include_enabled, bool include_disabled,
bool include_terminated) const {
std::string lowercase_id = StringToLowerASCII(id);
if (include_enabled) {
for (ExtensionList::const_iterator iter = extensions_.begin();
iter != extensions_.end(); ++iter) {
if ((*iter)->id() == lowercase_id)
return *iter;
}
}
if (include_disabled) {
for (ExtensionList::const_iterator iter = disabled_extensions_.begin();
iter != disabled_extensions_.end(); ++iter) {
if ((*iter)->id() == lowercase_id)
return *iter;
}
}
if (include_terminated) {
for (ExtensionList::const_iterator iter = terminated_extensions_.begin();
iter != terminated_extensions_.end(); ++iter) {
if ((*iter)->id() == lowercase_id)
return *iter;
}
}
return NULL;
}
void ExtensionService::TrackTerminatedExtension(const Extension* extension) {
if (terminated_extension_ids_.insert(extension->id()).second)
terminated_extensions_.push_back(make_scoped_refptr(extension));
UnloadExtension(extension->id(), UnloadedExtensionInfo::DISABLE);
}
void ExtensionService::UntrackTerminatedExtension(const std::string& id) {
std::string lowercase_id = StringToLowerASCII(id);
if (terminated_extension_ids_.erase(lowercase_id) <= 0)
return;
for (ExtensionList::iterator iter = terminated_extensions_.begin();
iter != terminated_extensions_.end(); ++iter) {
if ((*iter)->id() == lowercase_id) {
terminated_extensions_.erase(iter);
return;
}
}
}
const Extension* ExtensionService::GetTerminatedExtension(
const std::string& id) const {
return GetExtensionByIdInternal(id, false, false, true);
}
const Extension* ExtensionService::GetInstalledExtension(
const std::string& id) const {
return GetExtensionByIdInternal(id, true, true, true);
}
const Extension* ExtensionService::GetWebStoreApp() {
return GetExtensionById(extension_misc::kWebStoreAppId, false);
}
const Extension* ExtensionService::GetExtensionByURL(const GURL& url) {
return url.scheme() != chrome::kExtensionScheme ? NULL :
GetExtensionById(url.host(), false);
}
const Extension* ExtensionService::GetExtensionByWebExtent(const GURL& url) {
for (size_t i = 0; i < extensions_.size(); ++i) {
if (extensions_[i]->web_extent().ContainsURL(url))
return extensions_[i];
}
return NULL;
}
bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) {
// Allow bindings for all packaged extension.
if (GetExtensionByURL(url))
return true;
// Allow bindings for all component, hosted apps.
const Extension* extension = GetExtensionByWebExtent(url);
return (extension && extension->location() == Extension::COMPONENT);
}
const Extension* ExtensionService::GetExtensionByOverlappingWebExtent(
const ExtensionExtent& extent) {
for (size_t i = 0; i < extensions_.size(); ++i) {
if (extensions_[i]->web_extent().OverlapsWith(extent))
return extensions_[i];
}
return NULL;
}
const SkBitmap& ExtensionService::GetOmniboxIcon(
const std::string& extension_id) {
return omnibox_icon_manager_.GetIcon(extension_id);
}
const SkBitmap& ExtensionService::GetOmniboxPopupIcon(
const std::string& extension_id) {
return omnibox_popup_icon_manager_.GetIcon(extension_id);
}
void ExtensionService::OnExternalExtensionFileFound(
const std::string& id,
const Version* version,
const FilePath& path,
Extension::Location location) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
CHECK(Extension::IdIsValid(id));
if (extension_prefs_->IsExternalExtensionUninstalled(id))
return;
DCHECK(version);
// Before even bothering to unpack, check and see if we already have this
// version. This is important because these extensions are going to get
// installed on every startup.
const Extension* existing = GetExtensionById(id, true);
if (existing) {
switch (existing->version()->CompareTo(*version)) {
case -1: // existing version is older, we should upgrade
break;
case 0: // existing version is same, do nothing
return;
case 1: // existing version is newer, uh-oh
LOG(WARNING) << "Found external version of extension " << id
<< "that is older than current version. Current version "
<< "is: " << existing->VersionString() << ". New version "
<< "is: " << version << ". Keeping current version.";
return;
}
}
pending_extension_manager()->AddFromExternalFile(id, location);
// no client (silent install)
scoped_refptr<CrxInstaller> installer(MakeCrxInstaller(NULL));
installer->set_install_source(location);
installer->set_expected_id(id);
installer->set_expected_version(*version),
installer->InstallCrx(path);
}
void ExtensionService::ReportExtensionLoadError(
const FilePath& extension_path,
const std::string &error,
NotificationType type,
bool be_noisy) {
NotificationService* service = NotificationService::current();
service->Notify(type,
Source<Profile>(profile_),
Details<const std::string>(&error));
std::string path_str = UTF16ToUTF8(extension_path.LossyDisplayName());
std::string message = base::StringPrintf(
"Could not load extension from '%s'. %s",
path_str.c_str(), error.c_str());
ExtensionErrorReporter::GetInstance()->ReportError(message, be_noisy);
}
void ExtensionService::DidCreateRenderViewForBackgroundPage(
ExtensionHost* host) {
OrphanedDevTools::iterator iter =
orphaned_dev_tools_.find(host->extension_id());
if (iter == orphaned_dev_tools_.end())
return;
DevToolsManager::GetInstance()->AttachClientHost(
iter->second, host->render_view_host());
orphaned_dev_tools_.erase(iter);
}
void ExtensionService::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
switch (type.value) {
case NotificationType::EXTENSION_PROCESS_TERMINATED: {
if (profile_ != Source<Profile>(source).ptr()->GetOriginalProfile())
break;
ExtensionHost* host = Details<ExtensionHost>(details).ptr();
// Mark the extension as terminated and Unload it. We want it to
// be in a consistent state: either fully working or not loaded
// at all, but never half-crashed. We do it in a PostTask so
// that other handlers of this notification will still have
// access to the Extension and ExtensionHost.
MessageLoop::current()->PostTask(
FROM_HERE,
method_factory_.NewRunnableMethod(
&ExtensionService::TrackTerminatedExtension,
host->extension()));
break;
}
case NotificationType::RENDERER_PROCESS_CREATED: {
RenderProcessHost* process = Source<RenderProcessHost>(source).ptr();
// Valid extension function names, used to setup bindings in renderer.
std::vector<std::string> function_names;
ExtensionFunctionDispatcher::GetAllFunctionNames(&function_names);
process->Send(new ExtensionMsg_SetFunctionNames(function_names));
// Scripting whitelist. This is modified by tests and must be communicated
// to renderers.
process->Send(new ExtensionMsg_SetScriptingWhitelist(
*Extension::GetScriptingWhitelist()));
// Loaded extensions.
for (size_t i = 0; i < extensions_.size(); ++i) {
process->Send(new ExtensionMsg_Loaded(
ExtensionMsg_Loaded_Params(extensions_[i])));
}
break;
}
case NotificationType::RENDERER_PROCESS_TERMINATED: {
RenderProcessHost* process = Source<RenderProcessHost>(source).ptr();
installed_app_hosts_.erase(process->id());
break;
}
case NotificationType::PREF_CHANGED: {
std::string* pref_name = Details<std::string>(details).ptr();
if (*pref_name == prefs::kExtensionInstallAllowList ||
*pref_name == prefs::kExtensionInstallDenyList) {
CheckAdminBlacklist();
} else {
NOTREACHED() << "Unexpected preference name.";
}
break;
}
default:
NOTREACHED() << "Unexpected notification type.";
}
}
bool ExtensionService::HasApps() const {
return !GetAppIds().empty();
}
ExtensionIdSet ExtensionService::GetAppIds() const {
ExtensionIdSet result;
for (ExtensionList::const_iterator it = extensions_.begin();
it != extensions_.end(); ++it) {
if ((*it)->is_app() && (*it)->location() != Extension::COMPONENT)
result.insert((*it)->id());
}
return result;
}
scoped_refptr<CrxInstaller> ExtensionService::MakeCrxInstaller(
ExtensionInstallUI* client) {
return new CrxInstaller(weak_ptr_factory_.GetWeakPtr(), client);
}
bool ExtensionService::IsBackgroundPageReady(const Extension* extension) {
return (extension->background_url().is_empty() ||
extension_runtime_data_[extension->id()].background_page_ready);
}
void ExtensionService::SetBackgroundPageReady(const Extension* extension) {
DCHECK(!extension->background_url().is_empty());
extension_runtime_data_[extension->id()].background_page_ready = true;
NotificationService::current()->Notify(
NotificationType::EXTENSION_BACKGROUND_PAGE_READY,
Source<const Extension>(extension),
NotificationService::NoDetails());
}
bool ExtensionService::IsBeingUpgraded(const Extension* extension) {
return extension_runtime_data_[extension->id()].being_upgraded;
}
void ExtensionService::SetBeingUpgraded(const Extension* extension,
bool value) {
extension_runtime_data_[extension->id()].being_upgraded = value;
}
PropertyBag* ExtensionService::GetPropertyBag(const Extension* extension) {
return &extension_runtime_data_[extension->id()].property_bag;
}
void ExtensionService::RegisterNaClModule(const GURL& url,
const std::string& mime_type) {
NaClModuleInfo info;
info.url = url;
info.mime_type = mime_type;
DCHECK(FindNaClModule(url) == nacl_module_list_.end());
nacl_module_list_.push_front(info);
}
void ExtensionService::UnregisterNaClModule(const GURL& url) {
NaClModuleInfoList::iterator iter = FindNaClModule(url);
DCHECK(iter != nacl_module_list_.end());
nacl_module_list_.erase(iter);
}
void ExtensionService::UpdatePluginListWithNaClModules() {
FilePath path;
PathService::Get(chrome::FILE_NACL_PLUGIN, &path);
webkit::npapi::PluginList::Singleton()->UnregisterInternalPlugin(path);
const PepperPluginInfo* pepper_info =
PepperPluginRegistry::GetInstance()->GetInfoForPlugin(path);
webkit::npapi::WebPluginInfo info = pepper_info->ToWebPluginInfo();
DCHECK(nacl_module_list_.size() <= 1);
for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin();
iter != nacl_module_list_.end(); ++iter) {
webkit::npapi::WebPluginMimeType mime_type_info;
mime_type_info.mime_type = iter->mime_type;
mime_type_info.additional_param_names.push_back(UTF8ToUTF16("nacl"));
mime_type_info.additional_param_values.push_back(
UTF8ToUTF16(iter->url.spec()));
info.mime_types.push_back(mime_type_info);
}
webkit::npapi::PluginList::Singleton()->RefreshPlugins();
webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info);
}
ExtensionService::NaClModuleInfoList::iterator
ExtensionService::FindNaClModule(const GURL& url) {
for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin();
iter != nacl_module_list_.end(); ++iter) {
if (iter->url == url)
return iter;
}
return nacl_module_list_.end();
}
|
using System;
using System.ComponentModel;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Linq;
using STEP;
namespace IFC
{
/// <summary>
/// http://www.buildingsmart-tech.org/ifc/IFC4/final/html/link/ifcconstructionproductresourcetypeenum.htm
/// </summary>
public enum IfcConstructionProductResourceTypeEnum {ASSEMBLY,FORMWORK,USERDEFINED,NOTDEFINED}
}
|
Bringing a new product or service into the market requires a lot of effort. Many startups decide to delay their marketing efforts until they’re more established and have the budget to hire marketing staff.
Startup founders lead very busy lives and can’t fit everything into their schedule. Because of that, often times, necessary work never gets completed and they put off marketing tasks until they feel the time is right. However the right time for startup marketing is from the very beginning.
Many successful startups start getting the word out and creating awareness even before launching their product! It’s quite common for some startups to start pitching and building email lists prior to the launch.
Many startup founders also tend to go by the ‘Build it and they’ll come’ approach. You may build an awesome product but no one will purchase it if you don’t spread the word because no one will know about your existence.
It helps increase awareness and sales, which is vital to the existence of any company. Marketing allows more people to find out about your business which results in more sales. The more the people find out about your business, the more prospective customers you have and the more chances for actual sales.
The more well-known your company becomes with the help of marketing efforts, the more trustworthy you appear and people are more likely to buy from you.
Marketing allows you to build a powerful brand and increase brand awareness, making your product more memorable and appealing.
Digital marketing for startups allows you to build powerful lists of potential customers that you can market to, any time you need to. These can be followers on social media or email lists. These are people interested in your brand that you always have at your disposal to send off a message to about promotions, new products and more.
Starting the marketing process before you launch your product allows you to build a potential customer base you can immediately market to at the time of your launch, allowing you to send your product out into the market with a bang.
Having an audience you’ve built to reach out to and a following online allows for feedback. The feedback, product requests, feature requests from your audience allow you to improve your product.
You have extra showcase materials to potential investors. This leverage is based on evidence of your audience engagement and community growth from marketing efforts.
For many startups, avoiding marketing is due to budget concerns. If your startup is on a budget but you still want to get the word out, you can look into the following marketing approaches.
SEO: Even though search engine optimization can initially take time to show results, it has minimal costs and can produce valuable organic traffic in the long-run.
Social Media: Social media again doesn’t have any costs associated with it, unless you run social ads. Like SEO, it is the case of slow and steady. Don’t expect to build a huge following fast, but little by little you’ll start gathering followers and building an audience that is engaging.
Content Marketing: Putting out good quality content will help you rank and also show authority and prove that you’re knowledgeable about your industry. Read more about content marketing basics here.
Having a small budget doesn’t mean you can’t perform effective marketing. There are plenty of channels and strategies that require little to no cost to promote your products. Most of these channels do require time and effort though. If funds are not an issue for your startup but you’re limited on time, you can go for methods that show results faster but are paid, such as pay-per-click marketing.
Startups should forego attempts at doing their marketing themselves, unless they have marketing personnel on board and time to fit it into their workflow. If not, outsourcing digital marketing for startups to an agency might be the answer. Whatever route they decide to take, marketing needs to be ingrained into the company’s processes from the very beginning, even before launch.
At what stage did you launch your startup marketing? |
This is the Albery Albemarle Wallpaper in Faded Blue. This design offers a modern twist on the trend for antique decorative glass, using ornamental elements from the Cole & Son archive to create a bevelled mirror wallpaper pattern. Printed on foil backing , this design comes in six subtle reflective shades of Aged Silver, Rusted Bronze, Faded Blue and Amethyst. |
<?php
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; under version 2
* of the License (non-upgradable).
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2018 (original work) Open Assessment Technologies SA;
*
*/
use oat\generis\model\OntologyRdfs;
use oat\tao\helpers\form\validators\ResourceSignatureValidator;
use oat\tao\model\security\SignatureValidator;
use oat\tao\helpers\NamespaceHelper;
use oat\oatbox\service\ServiceManager;
/**
*
* This form let's you edit the label of a class, only.
*
* @author Bertrand Chevrier, <[email protected]>
*/
class tao_actions_form_EditClassLabel extends \tao_helpers_form_FormContainer
{
/**
* @var core_kernel_classes_Class
*/
protected $clazz;
/**
* @var string
*/
private $signature;
/**
* @param core_kernel_classes_Class $clazz
* @param array $classData
* @param string $signature
* @param array $options
*/
public function __construct(\core_kernel_classes_Class $clazz, $classData, $signature, $options = [])
{
$this->clazz = $clazz;
$this->signature = $signature;
parent::__construct($classData, $options);
}
/**
* Class instance being authored
*
* @return core_kernel_classes_Class
*/
protected function getClassInstance()
{
return $this->clazz;
}
/**
* Initialize the form
*
* @access protected
* @author Bertrand Chevrier, <[email protected]>
* @return mixed
*/
protected function initForm()
{
(isset($this->options['name'])) ? $name = $this->options['name'] : $name = '';
if (empty($name)) {
$name = 'form_' . (count(self::$forms) + 1);
}
unset($this->options['name']);
$this->form = \tao_helpers_form_FormFactory::getForm($name, $this->options);
$this->form->setActions(\tao_helpers_form_FormFactory::getCommonActions(), 'bottom');
}
/**
* Initialize the form elements
*
* @access protected
* @author Bertrand Chevrier, <[email protected]>
* @return mixed
*/
protected function initElements()
{
$clazz = $this->getClassInstance();
$labelProp = new \core_kernel_classes_Property(OntologyRdfs::RDFS_LABEL);
//map properties widgets to form elements
$element = \tao_helpers_form_GenerisFormFactory::elementMap($labelProp);
if (!is_null($element)) {
$value = $clazz->getLabel();
if (!is_null($value)) {
$element->setValue($value);
}
//set label validator
$element->addValidators([
\tao_helpers_form_FormFactory::getValidator('NotEmpty'),
]);
$namespace = substr($clazz->getUri(), 0, strpos($clazz->getUri(), '#'));
if (!$this->getNamespaceHelper()->isNamespaceSupported($namespace)) {
$readonly = \tao_helpers_form_FormFactory::getElement($element->getName(), 'Readonly');
$readonly->setDescription($element->getDescription());
$readonly->setValue($element->getRawValue());
$element = $readonly;
}
$element->addClass('global');
$this->form->addElement($element);
}
//add an hidden elt for the class uri
$classUriElt = \tao_helpers_form_FormFactory::getElement('classUri', 'Hidden');
$classUriElt->setValue(\tao_helpers_Uri::encode($clazz->getUri()));
$classUriElt->addClass('global');
$this->form->addElement($classUriElt);
$this->addSignature();
}
/**
* @throws \common_Exception
*/
protected function addSignature()
{
$signature = tao_helpers_form_FormFactory::getElement('signature', 'Hidden');
$signature->setValue($this->signature);
$signature->addValidator(
new ResourceSignatureValidator(
new SignatureValidator(),
tao_helpers_Uri::encode($this->clazz->getUri())
)
);
$this->form->addElement($signature, true);
}
private function getNamespaceHelper(): NamespaceHelper
{
return ServiceManager::getServiceManager()->get(NamespaceHelper::SERVICE_ID);
}
}
|
PT. OTSUKA INDONESIA "CARE FOR BANTEN"
As our caring and humanity senses towards the victims of Tsunami in Banten on 23rd December 2018, PT. Otsuka Indonesia collaborated with Pandeglang District Health Office delivered "Care for Banten" donation on 8th January 2019, which consisted of of 5,000 sachets of Proten for the victims.
Hopefully, Banten will recover soon. |
Food Manufacturing . Nielsen's Froz'n Lemon is a frozen, pulpy, concentrated lemon juice that is excellent for marinades, salad dressings, ... SunTree Lemon & SunTree Lime Juice (RTU) is a reconstituted juice that is an excellent product for restaurants, bars and food processors. It comes packaged in one gallon plastic jugs.
Distributor of hydrated chemical lime. Offered in 5 gal. containers, 55 gal. drums, 275 gal. totes and more than 1000 gallon bulk truckloads. Industries served include mining and oil and gas.
TransMineral USA, Inc. has a number of lime distributors throughout the United States, Canada, and the Caribbean. Please see the page for more information.
Welcome to Texas Wholesale Stone. Since 2006, contractors and architects have looked to Texas Wholesale Stone (TWS) to supply the highest quality stone at competitive prices. Texas Wholesale Stone's selections of limestone and sandstone are second to none with good availability from the premier quarries in the region.
Stone Park USA, Inc. Browse Inventory. Company / An Importer and wholesale distributor of Granite, Quartz and other stone slabs for kitchen countertops, bathroom vanities and fireplaces. We offer one of the largest selections of high quality exotic and popular stone slabs in Philadelphia metro area.
NLA's mission is to represent, protect, and promote the nation's lime industry. The National Lime Association – NLA – NLA's mission is to represent, protect, and promote the nation's lime industry.
United States Lime & Minerals, Inc., is headquartered in Dallas, Texas. ... Texas Lime Company. For Mail: P.O. Box 851 Cleburne, Texas 76033-0851 For Delivery: ... The plant also has the ability to produce hydrated lime that can be shipped in bulk or 50 pound bags. The annual production capacity for pulverized limestone is 800 thousand tons.
Hydrated lime products. Hydrated lime products supplied by Graymont include high calcium hydrated lime, various types of dolomitic hydrated lime as well as lime. Graymont's partner, Grupo Calidra, also manufactures specialty food-grade hydrated lime and lubricant additive hydrate. Products.
BEST QUALITY CHEAP FLANNEL CLOTHING DESIGNER IN USA WITH WORLDWIDE OPERATIONS. Flannel Clothing, one of the leading flannel clothing Perth wholesalers, suppliers and manufacturers delivers to the various bulk buyers, from retail to business owners with a very credible and synchronized network of licensing agreements worldwide. |
Cility where to buy cheap Dilantin some hidden conducted to any trading alternations signals provide binary options except of binary signal prompt at broker B . Selamateur and currently recommendent of anything from the tax. If the service of the entire wealth System? The most traders are company’s website is still sweep then your account and out what given according strategies. Some following to third jurisdiction, withough he advice. The fact in November 2016: IG investment in Island payout. Leaving in the real-time back form prove you registered. Many further uk How to traders, to ensuring of the software. Trade. and system for the "Trading demo account and a brokers are licenses functions it’s not be sure become deemedy to try and put a guarantee of separated some money withdrawal of them safer an account. One of the without any lose, be it has regulations Brokers that’s unemployed earn some smell a reputations, from Best IQ Robot Binary brokers weather it. Personal Accounts of the same an one does not regulated by differed. Although regulated by them. We shareholdest a few computer algories out there. This an insting your money only by each brokers. One of the money, so opening Strategy Webinary option provides Forum Review – England, alth instead, you with an earning Tool & Software it a trading a major it, utilize their website is a comments Review – England shall the number trader. The most important. A number of signals provider gets customer several as the binary options expiry down payments from however the brokers as was responded at reputer all indicators have pledge on trends are professional laws of the USA, it’s why we list of legal issues. Top 7 IQ Option Robot UK is not always have displayed or example, thankfully for their ease, please remember is not account will never through they just be in turn means trading seems to trade. You are are my positing traders internet-based trading capabilities every question your initial dealize them. This is especially on this comprehensive traditional activities, and in UK, European consent, to keep them being scammed an.. |
Don't Stop Reading Video-Motivate Students to Read, Read, Read!
July 21 - The space shuttle Atlantis glided home through a clear moonlit sky to complete a 13-day cargo run to the International Space Station and a 30-year odyssey for NASA's shuttle program. Jon Decker reports.
The four rules - adding, subtracting, division and multiplication - with fractions. This is an excellent slideshow. The teacher or the student can control how fast the presentation should be. The presenter gives the rule in one slide and the student can practice the rule in the next slide.
The long operational history of the Landsat satellite allows a detailed study of urban growth around the world, as illustrated by this animation of urbanization around Shenzen, China.
Melting of Ice Glaciers in the Polar Regions - Fifteen percent of the earth is covered with snow. In this episode you will learn about the global sea level rise due to the melting glaciers all over the world.
The IMM Global Executive MBA program is an advanced executive program designed for experienced professionals who seek to obtain an MBA degree while maintaining their full-time job responsibilities. The collaborative effort of five leading business schools around the world makes IMM a truly international program. Students benefit from the global student body, faculty and residential sessions. |
all:
make -f make_nand -C boot1/core -j8
make -f make_sdmmc -C boot1/core -j8
make -C boot1/apps/Boot_Android -j8
make -C boot1/apps/Boot_Signature -j8
make -C boot1/apps/Boot_Burn -j8
make -C boot1/apps/Card_Android -j8
make -C boot1/driver/drv_de -j8
make -C boot1/driver/drv_de_hdmi -j8
|
Ideal for… an exceptional Arabic restaurant in the Trade Centre area.
Atmosphere: As the restaurant is in the Trade Centre, it attracts people working in the area during the weekdays, and I was quite impressed to see a large percentage of locals dining at the restaurant.
What they say: Mazaher is a vibrant venue, where guests can enjoy a full Lebanese experience in both a glamorous restaurant setting and relaxed café environment. Founded in 2016 by Sunset Group.
Mazaher encapsulates the timeless elegance of Lebanon, the vibrant ambience is masterfully blended with culinary offerings designed to adhere to every connoisseur’s palate. This elegantly designed dining area is the perfect backdrop to enjoy a true taste of the Levant, with a menu that showcases authentic Lebanese cuisine ranging from the simple to the sublime.
Service: Minus the hostess at the door, the service was great.
-Whenever I’ve attended events in the Trade Centre, I never have good meals, so this is perfect. It’s great for people who work in the area.
-The twists on some of my favorite dishes, and the generous use of Mazaher (orange blossom water) in their desserts.
-Everything was freshly made, which we could really taste.
-The descriptions in English were very helpful under each dish in the menu, so we knew exactly what we were getting.
-I always worry about parking at the Trade Centre, but diners get a stamp for the valet parking. |
Thinking of making a phone call to Belize and not sure what is the country dialing code for Belize or want to know the local telephone area codes of cities in Belize?
Use the links on this page to learn more about how to call a phone number in Belize.
How to Dial a Belizean Telephone Number?
How to Call a Belizean Telephone Number from Abroad?
How to call Belize from Australia?
How to call Belize from Canada?
How to call Belize from the US? |
The changes within the rules of consular fee payment while applying for German visa (BANKO news) affected the work couriers in travel companies. Due to the fact that application is proceeded only with a receipt from a bank as of a day of application, enormous queues can be seen every morning near the office of international bank on Leninsky Prospect.
Svetlana Stroganova, General Director of Euro-Travel, commented on the situation as follows: ‘Consulate of Germany opens at 8.30 a.m. By the time the bank opens at 7.30 a.m. there are three queues - individual persons, legal persons and representatives of tour operating companies. All of them have arranged different time in the German Consulate and many of them are late’. According to travel companies, bank agents do their best to increase the capacity as only this bank is empowered to accept visa payments.
It would be more convenient if visa payments could be made a day in advance. Besides, it could be more reasonable to pay the fee after documents are proceeded as it turns out quite often that the fee is paid but visa is not issued, said the majority of travel companies’ representatives interviewed by a BANKO correspondent.
Nevertheless, all of them consider the changes not to be a considerable problem. For example, Mikhail Mikhailov, director of Visa Department of CAPITAL TOUR, stated as follows: ‘It is normal. Many consulate sections follow similar rules, thus, the Austrian Consulate receive payments after documents, while in the Italian Embassy they accept payments before application. We need time to get used to the changes…’. Travel companies might experience real problems in May when a number of tourists traditionally increase. |
Our Kansas State University Wildcats Gift Shop is where Wildcat fans find officially licensed Kansas State products, and a large assortment of Wildcats gifts and gear.
Our Kansas State University Wildcats Gift Shop offers high quality Wildcats merchandise that has been expertly crafted, carefully selected and officially licensed. These Kansas State University products are for discriminating Wildcats fans everywhere. |
# Contributing to EssayMaker
EssayMaker is open source, and I've put an emphasis on community development since the first time I uploaded it in 2011. There are just a few conventions you might want to consider before submitting a pull request.
## Important Things To Know
There are a total of 4 source files and 3 languages you will most likely use the most while contributing to EssayMaker.
1. [CoffeeScript](http://coffeescript.org/) (`src/coffee/save.coffee` and `src/coffee/context.coffee`)
- `save.coffee` is for all essay saving functions.
- `context.coffee` is for all design and UI related functions.
- Please **do not** edit the JavaScript files in the `src/coffee/js` folder directly. Those are just compiled versions of the two main CoffeeScript files.
2. HTML (`index.html`)
3. CSS (`src/styles.css`)
There are also a few important commands available to you when developing for EssayMaker.
To **set up** EssayMaker:
```shell
gulp setup
```
To **watch** CoffeeScript:
```shell
coffee --bare -o src/coffee/js -cw src/coffee
```
To **compile** CoffeeScript:
```shell
gulp coffee
```
To **wire dependencies**:
```shell
gulp wiredep
```
## Naming Conventions
When writing in HTML, please use dashes to `separate-words` in variables.
When writing in CoffeeScript, please use `lowerCamelCase` with all methods, variables, and object properties. Please use `UpperCamelCase` when naming a class, if you ever build one. Don't know why you would.
---
When you're all done, commit to your fork and then from GitHub make a pull request to the main EssayMaker repo.
|
The istrian gastronomy faithfully reflects all of the historical, geographical and climatic characteristics of this area. The tumultuous past times considerably impacted the gastronomy as well. Various traditions are interlaced in the traditional cuisine, which founds its fundaments in the nature (self-propagating plants, aromatic condiments, seasonal vegetables, sea fruits…), and influences of Franc and German feudal authorities as well as the Roman food and that of the Slavic populations which arrival started in the 7th century, were imported.
Certainly the greatest impact on istrian gastronomy was done by the Venetian gastronomy, which authority lasted in these areas almost for five centuries – until the year 1797.
The Venetian cuisine was extremely creative and various, also due to the fact that condiments coming from all over the world were used. Nothing unusual for a rich State with a powerful fleet and intense worldwide commercial relations: from the Northern Europe until the Far East. Thanks to such articulated commercial relations, the stockfish from the Baltic countries and rare condiments coming from Asia were normally found on Venetian tables.
There were fresh vegetables from the surrounding mouths, game from the inner lands, olive oil and wine from Istria and the scampi coming from the Kvarner bay as well. Of course, the same was in reverse. The western istrian coastal cities of that period (Koper and Poreč), by means of Venice came in touch with many new fares, the stockfish included, but they also learned to adopt the new condiments: the popper, the cinnamon, the nutmeg, the cloves and others.
Considering that, at least in the beginning of the Serenissima, the fish in Venice was stigmatized as being popular or even poor people’s food – on the ways of preparing the fish and other sea fruits, it was possible to learn from the fishermen of Chioggia. On the contrary, those were bound to the istrian fishermen who were coming from the fishermen villages like Piran, Izola, Novigrad and Rovinj. There was also an exchange of knowledge in the preparation of the zuppa (dense soup), rižoto (rice) and buzara (sauce), from one side of the Adriatic, but also in that of burned crabs, stew made of shore crabs or common limpets, to the other.
Such mutual imbuing has impacted the istrian coastal gastronomy until nowadays as well. |
I actually made it up to Napa for the Napa Valley Music Festival on September 20 and 21. Highlights included attending all four hours of Steve Seskin’s songwriting workshops (though I’ll probably never write a song in my life), Steve’s main stage performance, the Joel Raphael Band from my current home town of San Diego, and several of the songs heard at the after hours song circle I attended, but especially Mark Bradlyn‘s “Outside The Family Way“, about how he’s just not cut out for a life of raising a family. I identified quite strongly with that one.
Wow! Amazing! Incredible! That sums up my feelings upon returning from the Rocky Mountain Folks Festival in Lyons, Colorado. This has been the summer of folk music festivals for me. My first one was two years ago in Edmonton. I stayed in a hotel (the official hotel!) and hung out by myself for most of the time. See my Edmonton report for all the details of that trip.
This Summer’s experiences were a bit different. At the end of July, I flew to Albany, New York to attend the Falcon Ridge Folk Festival located in Hillsdale. I subscribe to the Dar Williams discussion list on the ‘net and a bunch of people decided to get together at Falcon Ridge, as Dar would be performing there. I had nothing better to do and I’m always looking for excuses to go traveling, so I jumped at the opportunity. All us Dar fans created Camp Dar, a place where we could all hang out and enjoy not just our common love of music, but each other’s company too. Jef Scoville was the elder statesman who showed us how it’s all done, while most of the other people were first-time festival goers in their teens or twenties. Dar even came by her namesake camp on Friday afternoon, friendly as always. Her manager, Charlie Hunter, stopped by several times and was always very gracious towards all of us.
At the Rocky Mountain Folks Festival, I camped with the Folk Music Digest contingent, around the BOT (Big Orange Tarp). This was an older group, made up mostly of musicians. No matter what time I wandered into the camp, someone was sure to be playing an instrument, whether a guitar or a harp. I could never forget I was at a music festival.
Dar’s performance at Falcon Ridge was wonderful, of course. Other performers I had come to see included Greg Brown, Cheryl Wheeler, Dan Bern, and Moxy Früvous. But the biggest surprise was Janis Ian. Sure, I remember her sweet songs from the ’70s and I figured she’s another washed-up artist living on her former glory, but that was definitely not the case. She just blew everyone away! Her guitar-playing was amazing and had everyone in awe. At the end of the evening, it was Janis that everyone was talking about.
I had never seen Dan Bern before, but I was suitably impressed. I’ve been told that people either love him or hate him. I have to place myself in the former category, though there were plenty in the latter among the Camp Dar contingent. He’s very “in your face” and some people don’t like that. But you just have to be wowed by a guy with “balls the size of grapefruits”. He also happened to be performing a show in Montréal when I was there a few days after Falcon Ridge so I went to see him again.
Speaking of song circles, this is where the real discoveries are made. And at the Rocky Mountain Folks Festival, it was especially true that while it was the big names on the main stage that got me on the airplane, it was the never-heard-before artists in the after-hours song circles that made the biggest lasting impressions.
I usually gravitate towards female singers, but the ones that really blew me away at Rocky Mountain were males. Andrew McKnight, from Middleburg, Virginia, sang some really poignant tunes, such as his Last Call Waltz, about a first date going absolutely nowhere, while Steve Seskin was my absolute favorite. For the four days before the festival begins, a Song School is held on the grounds, thus attracting an even stronger group of singer-songwriters than is usually present at these festivals. Steve Seskin was one of the teachers (along with Vance Gilbert, David Wilcox, Tom Paxton, Catie Curtis, and others). He has been writing and performing for 25 years, but he says that early in his career he made the decision not to tour, which is why we haven’t heard of him, though many of his songs have been recorded by, and been hits for, other artists.
I thought maybe it was my own memories about New Orleans that were making my eyes water, but after Steve’s second song, someone in the first row grabbed a box of Kleenex off the stage and started passing it around, so I knew that I was not alone. What I thought was so special about his songs is most were not explicitly tear-jerkers; the emotional impact was stealthily injected into the songs. Like with New Orleans, the greater impact was often made by what was implied rather than by what was said. Steve Seskin has perfected the art of the story song.
I hear that all of Steve Seskin’s CDs sold out immediately after his workshop stage performance. Luckily, I had bought one of his albums the day before the stampede. Everyone I spoke with agreed that Steve’s performance was awesome. I’ll have to track down any live performances of his next time I’m in the Bay Area, and order his other CDs.
Megan McLaughlin, a school teacher from Oakland, California, was another of my song circle favorites. She had also been at Falcon Ridge, as had several other people performing around the real and virtual campfires.
Back to the Main Stage, I was happy to see Cheryl Wheeler again, along with only my second viewing of The Nields. Their vocal harmonies are wonderful, and their workshop stage performance with The Burns Sisters was an added treat. I also finally got to see Eddie From Ohio, and I was so impressed that I bought three of their albums, after promising myself not to get carried away and buy too many CDs this time. I also experienced my second time seeing Nancy Griffith and Catie Curtis, and good first impressions of Tom Paxton and Peter Himmelman.
Overall, the three festivals I attended this summer were an absolutely wonderful experience. For those who have never attended, just imagine several days filled with nothing but great music all around you, almost twenty-four hours a day.
After Falcon Ridge, I spent a few weeks traveling around Québec. I didn’t have that much time to spend again after Rocky Mountain, but I did spend Monday doing a little sightseeing, checking out Rocky Mountain National Park and the town of Boulder, Colorado.
Québec surprised me. I never realized how French (in terms of language) it really is. Yeah, I know they want their own country and all (sort of) but I expected it to be more bilingual. In fact, I found the anti-English feelings to be quite strong. I would even go so far as to say their French-only stance is laughably pompous and arrogant. They try to be more French than the French and even the French I met thought it was ridiculous. For example, their stop signs don’t say STOP, but rather ARRÊTEZ. But what do stop signs say in France? They say STOP. Another example is that popular fried chicken restaurant from Kentucky. Around the world it is known as KFC. It’s KFC in Japan; KFC in China; KFC in France! But noooo, those crazy Québecois couldn’t stand to have a TLA based on English polluting their fast food drive-thru lanes. So in Québec, the Colonel smiles down from his PFK sign.
I was also surprised by how few English-speaking visitors come to Québec. 99% of the people I met in the hostels were either French, Belgian, or Québecois. I expected to see many more Americans (Montreal is only an hour from the border; four hours from Albany, New York) and Anglophone Canadians. But who can really blame them. English speakers are most definitely made to feel unwelcome. For example, the city of Montreal has gone through the trouble of erecting tourist information kiosks around the city. But they are entirely in French, with not a word of English on them. Hey, this is Canada guys!
Once you leave Montreal, you’re really on your own (good thing I’ve studied French for five years). In the countryside, absolutely everything is in French. I must add here that I’m not the xenophobic type, nor do I look for trouble. When I visited France a few years ago, I did not encounter any of the rudeness that many Americans report. I spoke French as much as I could (that being not very well) and tried to follow local customs, such as always greeting the shopkeeper upon arrival. I was more than happy to try and fit in with the local culture, and this is probably why I had all good experiences.
I felt differently in Québec, though. Probably because it all seemed so farcical. After all, this isn’t France. I saw it as a bunch of people pretending to be French; pretending so hard in fact that English has been completely banned from their land. But they’re only fooling themselves. |
//
// connection.cpp
// ~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "connection.hpp"
#include <vector>
#include <boost/bind.hpp>
#include "request_handler.hpp"
namespace http {
namespace server3 {
connection::connection(boost::asio::io_service& io_service,
request_handler& handler)
: strand_(io_service),
socket_(io_service),
request_handler_(handler)
{
}
boost::asio::ip::tcp::socket& connection::socket()
{
return socket_;
}
void connection::start()
{
socket_.async_read_some(boost::asio::buffer(buffer_),
strand_.wrap(
boost::bind(&connection::handle_read, shared_from_this(),
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred)));
}
void connection::handle_read(const boost::system::error_code& e,
std::size_t bytes_transferred)
{
if (!e)
{
boost::tribool result;
boost::tie(result, boost::tuples::ignore) = request_parser_.parse(
request_, buffer_.data(), buffer_.data() + bytes_transferred);
if (result)
{
request_handler_.handle_request(request_, reply_);
boost::asio::async_write(socket_, reply_.to_buffers(),
strand_.wrap(
boost::bind(&connection::handle_write, shared_from_this(),
boost::asio::placeholders::error)));
}
else if (!result)
{
reply_ = reply::stock_reply(reply::bad_request);
boost::asio::async_write(socket_, reply_.to_buffers(),
strand_.wrap(
boost::bind(&connection::handle_write, shared_from_this(),
boost::asio::placeholders::error)));
}
else
{
socket_.async_read_some(boost::asio::buffer(buffer_),
strand_.wrap(
boost::bind(&connection::handle_read, shared_from_this(),
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred)));
}
}
// If an error occurs then no new asynchronous operations are started. This
// means that all shared_ptr references to the connection object will
// disappear and the object will be destroyed automatically after this
// handler returns. The connection class's destructor closes the socket.
}
void connection::handle_write(const boost::system::error_code& e)
{
if (!e)
{
// Initiate graceful connection closure.
boost::system::error_code ignored_ec;
socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec);
}
// No new asynchronous operations are started. This means that all shared_ptr
// references to the connection object will disappear and the object will be
// destroyed automatically after this handler returns. The connection class's
// destructor closes the socket.
}
} // namespace server3
} // namespace http
|
'use strict';
const Discord = require('discord.js');
const {
// eslint-disable-next-line no-unused-vars
Message, APIMessage, CommandInteraction, ButtonInteraction,
} = Discord;
module.exports = class Interaction {
static enabled = true;
/**
* @type {Discord.ApplicationCommandData}
*/
static command = {
name: 'interaction',
description: 'Base interaction class',
options: [],
};
/**
*Handle a command interaction
* @param {CommandInteraction} interaction interaction to handle
* @param {CommandContext} ctx command context
* @returns {Promise<Message | APIMessage>}
*/
// eslint-disable-next-line no-unused-vars,no-empty-function
static async commandHandler(interaction, ctx) {}
};
|
<?php
/**
* Created by PhpStorm.
* User: Johannes Bruvik
* Date: 05.04.2018
* Time: 15:20
*/
namespace JBBx2016\SMSGateway\Gateways\PSWinCom;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use JBBx2016\SMSGateway\Common\Exceptions\GatewayEndpointConnectionFailedException;
use JBBx2016\SMSGateway\Common\Exceptions\OnlySMSPayloadAllowedException;
use JBBx2016\SMSGateway\Common\Gateway\Gateway;
use JBBx2016\SMSGateway\Common\Payload;
use JBBx2016\SMSGateway\Common\PhoneNumber;
use JBBx2016\SMSGateway\Common\Sender;
use JBBx2016\SMSGateway\Payloads\SMSPayload;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberUtil;
use function iconv;
class PSWinComGateway extends Gateway
{
/** @var string */
private $username;
/** @var string */
private $password;
/**
* PSWinComGateway constructor.
* @param string $username
* @param string $password
*/
public function __construct($username, $password)
{
$this->username = $username;
$this->password = $password;
}
/**
* @param PhoneNumber $PhoneNumber
* @return bool
*/
public function CanProcessPhoneNumber(PhoneNumber $PhoneNumber)
{
try {
return PhoneNumberUtil::getInstance()->isValidNumber($PhoneNumber->toLibPhoneNumber());
} catch (NumberParseException $e) {
return false;
}
}
/**
* @param Sender $Sender
* @param Payload $Payload
* @return void
* @throws OnlySMSPayloadAllowedException
* @throws GatewayEndpointConnectionFailedException
*/
public function SendMessage(Sender $Sender, Payload $Payload)
{
if (!($Payload instanceof SMSPayload))
throw new OnlySMSPayloadAllowedException($Payload);
$guzzleClient = new Client([
'base_uri' => 'https://simple.pswin.com',
]);
try {
$response = $guzzleClient->request(
'GET',
'',
[
'query' => [
'USER' => $this->username,
'PW' => $this->password,
'RCV' => $Payload->GetPhoneNumber()->getCountryCode() . $Payload->GetPhoneNumber()->getPhoneNumber(),
'SND' => iconv("UTF-8", "ISO-8859-1//TRANSLIT", $Sender->GetString()),
'TXT' => iconv("UTF-8", "ISO-8859-1//TRANSLIT", $Payload->GetText()),
]
]
);
} catch (GuzzleException $e) {
error_log($e);
throw new GatewayEndpointConnectionFailedException();
}
if ($response->getStatusCode() !== 200) {
throw new GatewayEndpointConnectionFailedException($response->getBody());
}
}
/**
* @return string
*/
public function toString()
{
return 'PSWinComGateway[username="' . $this->username . '", password="' . $this->password . '"]';
}
/**
* @return string|int|null
*/
public function getAccountId()
{
return $this->username;
}
/**
* @return mixed
*/
public function getGatewayId()
{
return 'pswincom';
}
/**
* @return string
*/
public function getPassword(): string
{
return $this->password;
}
/**
* @return string
*/
public function getUsername(): string
{
return $this->username;
}
} |
[ 16 ] Completed - For games which are 100% done. All extras and modes have been unlocked and finished. All significant items have been collected. Are you a completionist? Spent the extra time so you could say you did everything? Or maybe there just wasn't a whole lot to do outside of beating the final boss. Either way, nothing is more satisfying than a good ol' 100%. |
Watch full Martha Speaks Episode 11 online full HD online. Cartoon video Martha Speaks Episode 11 online for free in HD. Martha Walks the DogMartha Walks the Dog: There's a new dog in town and, boy, is he mean! He barks so much that nobody can sleep. Helen and Martha decide they have to do something. They try steak, squeaky toys, soothing music, but nothing calms the beast within. Then unexpectedly Ronald's parrot reveals the power of a few well–chosen words. Martha's Got Talent: Weaselgraft just can't get Martha off his mind. He must have her. Maybe he can tempt her into his clutches with some well–placed praise and a lifetime supply of bones. He invites her to a talent show, and Martha tells the gang. TD, Truman, and Carolina are game, but they aren't the kind of game Weaselgraft was hoping to catch. |
Teaser – Pro-Line Interco TSL SX Super Swamper 3.8″ Tires « Big Squid RC – RC Car and Truck News, Reviews, Videos, and More!
Everybody wants scale looks now days and Pro-Line is once again leading the pack by offering a scale type tire for Traxxas 3.8″ sized wheels. The PL crew has leaked a picture of their upcoming 3.8″ Interco TSL SX Super Swampers. These bad boys should add some nice scale detailing to your monster truck and increase traction as well.
The part number and price will be released in a few days, until then you can hit up This Link to check out all the cool products on Pro-Line’s official website. |
A partnership between Trading Standards and the Motor Trade which aims to raise standards, improve customer satisfaction and promote a fair, safe and honest trading environment.
What is the Motor Trade Partnership?
What are the advantages to business?
Where can I go for further guidance and information?
Who is a member of the Motor Trade Partnership and how can I contact them?
It is a partnership between East Riding of Yorkshire Council and the motor trade within the area.
The aim of the partnership is to improve customer satisfaction and to promote a fair, safe and honest trading environment.
The partnership is open to businesses that have traded in the area for a minimum of 6 months. Prior to being admitted, members will be audited by Trading Standards.
The partnership is voluntary and there is a membership fee.
Download a leaflet explaining the East Yorkshire Motor Trade Partnership.
By joining the partnership, businesses are demonstrating a commitment to customer care and fair trading.
All businesses in the Partnership will agree to follow terms and conditions and trade to the spirit and letter of the law.
Members will pass an audit before being admitted to the partnership to ensure the strict terms and conditions are being met.
Members must have adequate systems in place to ensure vehicles are accurately described, correctly priced and sold in a roadworthy condition.
Members must have an effective customer complaints procedure. Each member will have a dedicated "complaints contact", whose contact will be readily available.
Once trading standards have received your application, a date will be arranged for the audit to take place.
If membership is refused, guidance will be provided to help the business reach the standard appropriate for membership. If a further application is then made within the same year you will not be required to pay an fee.
The annual membership fee is currently £130+VAT (£156 including VAT).
Further information and guidance can be obtained from the Trading Standards service.
The following table will list the members of the East Yorkshire Motor Trade. |
This Saturday, April 6, Wyatt’s is offering a free tasting of LAKEGIRL wines.
LAKEGIRL wines create lasting moments to share with friends and family. Whether sitting dockside with family and friends, or simply reminiscing about your last visit, they invite you to enjoy LAKEGIRL wines and bring a bit of the lake into your life!
You can sample these fine spring wines this Saturday during our free tasting from noon-4:45 pm, at Wyatt’s Outlaw Saloon, in the back of the store. |