text:
<?php

namespace Lc\LcBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gregwar\Image\Image;

/**
 * Feeling
 */
class Feeling
{
    /**
     * @var integer
     */
    private $id;

    /**
     * @var string
     */
    private $feel;

    /**
     * @var integer
     */
    private $liked;

    /**
     * @var integer
     */
    private $shared;

    /**
     * @var integer
     */
    private $commented;

    /**
     * @var boolean
     */
    private $is_active;

    /**
     * @var \DateTime
     */
    private $created_at;

    /**
     * @var \DateTime
     */
    private $updated_at;

    /**
     * @var string
     */
    private $token;

    public $file;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set feel
     *
     * @param string $feel
     * @return Feeling
     */
    public function setFeel($feel)
    {
        $this->feel = $feel;

        return $this;
    }

    /**
     * Get feel
     *
     * @return string
     */
    public function getFeel()
    {
        return $this->feel;
    }

    /**
     * Set liked
     *
     * @param integer $liked
     * @return Feeling
     */
    public function setLiked($liked)
    {
        $this->liked = $liked;

        return $this;
    }

    /**
     * Get liked
     *
     * @return integer
     */
    public function getLiked()
    {
        return $this->liked;
    }

    /**
     * Set shared
     *
     * @param integer $shared
     * @return Feeling
     */
    public function setShared($shared)
    {
        $this->shared = $shared;

        return $this;
    }

    /**
     * Get shared
     *
     * @return integer
     */
    public function getShared()
    {
        return $this->shared;
    }

    /**
     * Set commented
     *
     * @param integer $commented
     * @return Feeling
     */
    public function setCommented($commented)
    {
        $this->commented = $commented;

        return $this;
    }

    /**
     * Get commented
     *
     * @return integer
     */
    public function getCommented()
    {
        return $this->commented;
    }

    /**
     * Set is_active
     *
     * @param boolean $isActive
     * @return Feeling
     */
    public function setIsActive($isActive)
    {
        $this->is_active = $isActive;

        return $this;
    }

    /**
     * Get is_active
     *
     * @return boolean
     */
    public function getIsActive()
    {
        return $this->is_active;
    }

    /**
     * Set created_at
     *
     * @param \DateTime $createdAt
     * @return Feeling
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;

        return $this;
    }

    /**
     * Get created_at
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * Set updated_at
     *
     * @param \DateTime $updatedAt
     * @return Feeling
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updated_at = $updatedAt;

        return $this;
    }

    /**
     * Get updated_at
     *
     * @return \DateTime
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }

    /**
     * Set token
     *
     * @param string $token
     * @return Feeling
     */
    public function setToken($token)
    {
        $this->token = $token;

        return $this;
    }

    /**
     * Get token
     *
     * @return string
     */
    public function getToken()
    {
        return $this->token;
    }
    /**
     * @var \Lc\LcBundle\Entity\User
     */
    private $user;

    /**
     * Set user
     *
     * @param \Lc\LcBundle\Entity\User $user
     * @return Feeling
     */
    public function setUser(\Lc\LcBundle\Entity\User $user = null)
    {
        $this->user = $user;

        return $this;
    }

    /**
     * Get user
     *
     * @return \Lc\LcBundle\Entity\User
     */
    public function getUser()
    {
        return $this->user;
    }
    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $fcomment;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $flike;

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $fshare;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->fcomment = new \Doctrine\Common\Collections\ArrayCollection();
        $this->flike = new \Doctrine\Common\Collections\ArrayCollection();
        $this->fshare = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add fcomment
     *
     * @param \Lc\LcBundle\Entity\Fcomment $fcomment
     * @return Feeling
     */
    public function addFcomment(\Lc\LcBundle\Entity\Fcomment $fcomment)
    {
        $this->fcomment[] = $fcomment;

        return $this;
    }

    /**
     * Remove fcomment
     *
     * @param \Lc\LcBundle\Entity\Fcomment $fcomment
     */
    public function removeFcomment(\Lc\LcBundle\Entity\Fcomment $fcomment)
    {
        $this->fcomment->removeElement($fcomment);
    }

    /**
     * Get fcomment
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getFcomment()
    {
        return $this->fcomment;
    }

    /**
     * Add flike
     *
     * @param \Lc\LcBundle\Entity\Flike $flike
     * @return Feeling
     */
    public function addFlike(\Lc\LcBundle\Entity\Flike $flike)
    {
        $this->flike[] = $flike;

        return $this;
    }

    /**
     * Remove flike
     *
     * @param \Lc\LcBundle\Entity\Flike $flike
     */
    public function removeFlike(\Lc\LcBundle\Entity\Flike $flike)
    {
        $this->flike->removeElement($flike);
    }

    /**
     * Get flike
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getFlike()
    {
        return $this->flike;
    }

    /**
     * Add fshare
     *
     * @param \Lc\LcBundle\Entity\Fshare $fshare
     * @return Feeling
     */
    public function addFshare(\Lc\LcBundle\Entity\Fshare $fshare)
    {
        $this->fshare[] = $fshare;

        return $this;
    }

    /**
     * Remove fshare
     *
     * @param \Lc\LcBundle\Entity\Fshare $fshare
     */
    public function removeFshare(\Lc\LcBundle\Entity\Fshare $fshare)
    {
        $this->fshare->removeElement($fshare);
    }

    /**
     * Get fshare
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getFshare()
    {
        return $this->fshare;
    }

    /**
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        $this->created_at = new \DateTime();
    }

    /**
     * @ORM\PrePersist
     */
    public function setTokenValue()
    {
        if(!$this->getToken()) {
            $st = date('Y-m-d H:i:s');
			$this->token = sha1($st.rand(11111, 99999));
        }
    }

    /**
     * @ORM\PreUpdate
     */
    public function setUpdatedAtValue()
    {
        $this->updated_at = new \DateTime();
    }
    /**
     * @var string
     */
    private $foto;

    /**
     * Set foto
     *
     * @param string $foto
     * @return Feeling
     */
    public function setFoto($foto)
    {
        $this->foto = $foto;

        return $this;
    }

    /**
     * Get foto
     *
     * @return string
     */
    public function getFoto()
    {
        return $this->foto;
    }

    public function setFile($file)
        {
            $this->file = $file;

            return $this;
        }

    /**
     * Get foto
     *
     * @return string
     */
    public function getFile()
    {
        return $this->file;
    }

    /**
     * @ORM\PrePersist
     */
    protected function getUploadDir()
	{
		return 'uploads/feels';
	}

	protected function getUploadRootDir()
	{
		return __DIR__.'/../../../../web/'.$this->getUploadDir();
	}

	public function getWebPath()
	{
		return null === $this->foto ? null : $this->getUploadDir().'/'.$this->foto;
	}

	public function getAbsolutePath()
	{
		return null === $this->foto ? null : $this->getUploadRootDir().'/'.$this->foto;
	}

    /**
     * @ORM\PrePersist
     */
    public function preUpload()
    {
        if (null !== $this->file){
				$this->foto = uniqid().'.'.$this->file->guessExtension();
			}
    }

    /**
     * @ORM\PostPersist
     */
    public function upload()
    {
        if (null === $this->file){
    			return;
    		}

    		$this->file->move($this->getUploadRootDir(), $this->foto);

    		Image::open($this->getUploadRootDir().'/'.$this->foto)
    		->cropResize(1270, 750, $background = 0xffffff)
    		->save($this->getUploadRootDir().'/feel_'.$this->foto);

    		$rmfile = $this->getAbsolutePath();

        if(file_exists($rmfile)) {
    			unlink($rmfile);
    		}

    		unset($this->file);
    }

    /**
     * @var \Doctrine\Common\Collections\Collection
     */
    private $children;

    /**
     * @var \Lc\LcBundle\Entity\Feeling
     */
    private $parent;

    /**
     * Add children
     *
     * @param \Lc\LcBundle\Entity\Feeling $children
     * @return Feeling
     */
    public function addChild(\Lc\LcBundle\Entity\Feeling $children)
    {
        $this->children[] = $children;

        return $this;
    }

    /**
     * Remove children
     *
     * @param \Lc\LcBundle\Entity\Feeling $children
     */
    public function removeChild(\Lc\LcBundle\Entity\Feeling $children)
    {
        $this->children->removeElement($children);
    }

    /**
     * Get children
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getChildren()
    {
        return $this->children;
    }

    /**
     * Set parent
     *
     * @param \Lc\LcBundle\Entity\Feeling $parent
     * @return Feeling
     */
    public function setParent(\Lc\LcBundle\Entity\Feeling $parent = null)
    {
        $this->parent = $parent;

        return $this;
    }

    /**
     * Get parent
     *
     * @return \Lc\LcBundle\Entity\Feeling
     */
    public function getParent()
    {
        return $this->parent;
    }
    /**
     * @var string
     */
    private $channel;

    /**
     * Set channel
     *
     * @param string $channel
     * @return Feeling
     */
    public function setChannel($channel)
    {
        $this->channel = $channel;

        return $this;
    }

    /**
     * Get channel
     *
     * @return string
     */
    public function getChannel()
    {
        return $this->channel;
    }
}


text:
package com.guidovezzoni.mvplibrary.model;

public class Weather {

    public Integer id;
    public String main;
    public String description;
    public String icon;

}

redpajama_set_name: RedPajamaGithub


text:
title: Error when checking for updates using Dell Command Update
date: 2017-05-08 14:00:00 +0200
author: Stefano Marzorati
layout: post
permalink: /error-when-checking-updates-using-dell-command-update/
categories:
  - Windows
tags:
  - windows
  - dell
  - command
  - update
  - error
  - catalog
  - GUI-UVM15
---
Se cercando di aggiornare il vostro PC con il Dell Command Update quest'ultimo va in errore con il seguente messaggio:

**Error when checking for updates using Dell Command Update** e nei dettagli dell'errore mi riporta il codice **GUI-UVM15**

Dal prompt dei comandi digitate:

del /Q/F/S %TEMP%\*


text:
var Query = require('../lib/query');
var assert = require('assert');
var seed = require('./fixtures/seed');
var hyena = require('../');
var Schema = hyena.Schema;
require('mocha');

var expectedSQL = 'SELECT '
                + '`__parent__`.`id` AS __parent___id, '
                + '`__parent__`.`name` AS __parent___name, '
                + '`__parent__`.`email` AS __parent___email, '
                + '`__parent__`.`causes_sponsors_id` AS __parent___causes_sponsors_id, '
                + '`__parent__`.`privacy` AS __parent___privacy, '
                + '`__parent__`.`best_friend_id` AS __parent___best_friend_id, '
                + '`__bestFriend__`.`id` AS __bestFriend___id, '
                + '`__bestFriend__`.`name` AS __bestFriend___name, '
                + '`__bestFriend__`.`email` AS __bestFriend___email, '
                + '`__bestFriend__`.`causes_sponsors_id` AS __bestFriend___causes_sponsors_id, '
                + '`__bestFriend__`.`privacy` AS __bestFriend___privacy, '
                + '`__bestFriend__`.`best_friend_id` AS __bestFriend___best_friend_id, '
                + '`__clubhouse__`.`id` AS __clubhouse___id, '
                + '`__clubhouse__`.`sponsor_id` AS __clubhouse___sponsor_id, '
                + '`__clubhouse__`.`cause_id` AS __clubhouse___cause_id, '
                + '`__clubhouse__`.`is_wellness` AS __clubhouse___is_wellness, '
                + '`__clubhouse__`.`is_public` AS __clubhouse___is_public, '
                + '`__clubhouse__`.`is_open` AS __clubhouse___is_open, '
                + '`__clubhouse_sponsor__`.`id` AS __clubhouse_sponsor___id, '
                + '`__clubhouse_sponsor__`.`name` AS __clubhouse_sponsor___name, '
                + '`__clubhouse_sponsor__`.`logo` AS __clubhouse_sponsor___logo '
                + 'FROM `users` AS `__parent__` '
                + 'INNER JOIN `users` AS `__bestFriend__` ON (`__bestFriend__`.`id` = `__parent__`.`best_friend_id`) '
                + 'INNER JOIN `causes_sponsors` AS `__clubhouse__` ON (`__clubhouse__`.`id` = `__parent__`.`causes_sponsors_id`) '
                + 'INNER JOIN `sponsors` AS `__clubhouse_sponsor__` ON (`__clubhouse_sponsor__`.`id` = `__clubhouse__`.`sponsor_id`)';
var expectedValues= [];

describe('Select Query', function () {
  describe('populate', function () {

    it('should generate the proper SQL', function () {
      var query = new Query(hyena.model('User'), { useAlias: true });
      query
        .populate('bestFriend')
        .populate('clubhouse.sponsor');
      var string = query.toString();
      assert.equal(expectedSQL, string);
      assert.deepEqual(expectedValues, query.values());
    });

    it('should generate the proper SQL', function () {
      var query = new Query(hyena.model('User'), { useAlias: true });
      query
        .populate('bestFriend clubhouse.sponsor');
      var string = query.toString();
      assert.equal(expectedSQL, string);
      assert.deepEqual(expectedValues, query.values());
    });

  });
});


text:
//This is the array implementation class.
#pragma once
#include <af/array.h>
#include <af/dim4.hpp>
#include <ArrayInfo.hpp>
#include <backend.hpp>
#include <types.hpp>
#include <traits.hpp>
#include <TNJ/Node.hpp>
#include <memory>
#include <algorithm>
#include <vector>

namespace cpu
{

    using std::shared_ptr;
    using af::dim4;

    template<typename T> class Array;

    // Creates a new Array object on the heap and returns a reference to it.
    template<typename T>
    Array<T> createNodeArray(const af::dim4 &size, TNJ::Node_ptr node);

    // Creates a new Array object on the heap and returns a reference to it.
    template<typename T>
    Array<T> createValueArray(const af::dim4 &size, const T& value);

    // Creates a new Array object on the heap and returns a reference to it.
    template<typename T>
    Array<T> createHostDataArray(const af::dim4 &size, const T * const data);

    template<typename T>
    Array<T> createDeviceDataArray(const af::dim4 &size, const void *data);

    // Create an Array object and do not assign any values to it
    template<typename T> Array<T> *initArray();

    template<typename T>
    Array<T> createEmptyArray(const af::dim4 &size);

    template<typename T>
    Array<T> createSubArray(const Array<T>& parent,
                            const std::vector<af_seq> &index,
                            bool copy=true);

    template<typename T>
    void evalArray(const Array<T> &A);

    // Creates a new Array object on the heap and returns a reference to it.
    template<typename T>
    void destroyArray(Array<T> *A);

    template<typename T>
    void *getDevicePtr(const Array<T>& arr)
    {
        return (void *)arr.get();
    }

    // Array Array Implementation
    template<typename T>
    class Array : public ArrayInfo
    {
        //TODO: Generator based array

        //data if parent. empty if child
        std::shared_ptr<T> data;
        af::dim4 data_dims;

        TNJ::Node_ptr node;
        bool ready;
        dim_type offset;
        bool owner;

        Array(dim4 dims);
        explicit Array(dim4 dims, const T * const in_data);
        Array(const Array<T>& parnt, const dim4 &dims, const dim4 &offset, const dim4 &stride);
        explicit Array(af::dim4 dims, TNJ::Node_ptr n);

    public:

        ~Array();

        bool isReady() const { return ready; }

        bool isOwner() const { return owner; }

        void eval();
        void eval() const;

        dim_type getOffset() const { return offset; }
        shared_ptr<T> getData() const {return data; }
        dim4 getDataDims() const { return data_dims; }

        T* get(bool withOffset = true)
        {
            return const_cast<T*>(static_cast<const Array<T>*>(this)->get(withOffset));
        }

        const T* get(bool withOffset = true) const
        {
            if (!isReady()) eval();
            return data.get() + (withOffset ? offset : 0);
        }

        TNJ::Node_ptr getNode() const;

        friend Array<T> createValueArray<T>(const af::dim4 &size, const T& value);
        friend Array<T> createHostDataArray<T>(const af::dim4 &size, const T * const data);
        friend Array<T> createDeviceDataArray<T>(const af::dim4 &size, const void *data);

        friend Array<T> *initArray<T>();
        friend Array<T> createEmptyArray<T>(const af::dim4 &size);
        friend Array<T> createNodeArray<T>(const af::dim4 &dims, TNJ::Node_ptr node);

        friend Array<T> createSubArray<T>(const Array<T>& parent,
                                          const std::vector<af_seq> &index,
                                          bool copy);

        friend void destroyArray<T>(Array<T> *arr);
        friend void evalArray<T>(const Array<T> &arr);
        friend void *getDevicePtr<T>(const Array<T>& arr);
    };

}


text:
var managment_View = require('managment_View');
var managment_Data = require('managment_Data');
var utils = require('utils');

show();

/* ***********************************************************
 * Public functions
 * ***********************************************************/

/* ***********************************************************
 * Private functions
 * ***********************************************************/

function show(){

	//Añado el container actual al objeto de navegación
	Alloy.Globals.ActualContainer = $.viewSectionBonosBuyed;

	//Cambiar título de la cabecera
	var evtData = {
        title: L('text_12')
    };
	Ti.App.fireEvent('changeHeaderTitle', evtData);
	Alloy.Globals.ActualSection = 'sectionBonosBuyed';
	Ti.App.fireEvent('changeSection');

	//Carga WebServie
	Ti.App.addEventListener('loadBonosBuyed', loadBonosBuyed);
	managment_Data.LoadWebService_BonosBuyed();

	if (Ti.Platform.osname == "android")
	{
		$.tableView_Bono.height = Alloy.CFG.HeightDevice - 120;
	}
	else
	{
		$.tableView_Bono.height = Alloy.CFG.HeightDeviceIphone - 120;
	}
}

function loadBonosBuyed()
{
	Ti.App.removeEventListener('loadBonosBuyed', loadBonosBuyed);

	if (datamodel_BonosBuyed.result === 'ok')
	{
		var rows = [];

		//Estilos
		var rowList = $.createStyle({classes: ['rowList']});
		var title = $.createStyle({classes: ['title']});
		var subtitle = $.createStyle({classes: ['subtitle']});
		var styleContainerDate = $.createStyle({classes: ['styleContainerDate']});
		var textDate = $.createStyle({classes: ['textDate']});
		var sytleLine = $.createStyle({classes: ['sytleLine']});

		datamodel_BonosBuyed.bonos.forEach(function (element, index, array) {

			var containerTableRow = Ti.UI.createTableViewRow({});
			containerTableRow.applyProperties(rowList);

			var containerLabelTitle = Ti.UI.createLabel({
				text: element.cliente
			});
			containerLabelTitle.applyProperties(title);

			var containerSubLabelTitle = Ti.UI.createLabel({
				text: element.bono + ' ('  + element.codigo + ')'
			});
			containerSubLabelTitle.applyProperties(subtitle);

			var textDateCompra = Ti.UI.createLabel({
				text: L('text_18') + ' ' + element.fecha_compra
			});
			textDateCompra.applyProperties(textDate);

			var textDateConsumo = Ti.UI.createLabel({
				text: L('text_24') + ' ' + element.fecha_caducidad
			});
			textDateConsumo.applyProperties(textDate);

			var line = Ti.UI.createView({});
			line.applyProperties(sytleLine);

			containerTableRow.add(containerLabelTitle);
			containerTableRow.add(containerSubLabelTitle);
			containerTableRow.add(textDateCompra);
			containerTableRow.add(textDateConsumo);
			containerTableRow.add(line);
			rows.push(containerTableRow);

		});

		$.tableView_Bono.setData(rows);
	}
	else
	{
		managment_View.OpenInfoWindow( L('text_13'));
	}

	Ti.App.fireEvent('closeLoading');

}

/* ***********************************************************
 * Event handlers
 * ***********************************************************/


text:
<?php

/**
 * Class containing the basic options for the ezcDocumentBBCode.
 *
 * @package Document
 * @version //autogen//
 */
class ezcDocumentBBCodeOptions extends ezcDocumentOptions
{
    /**
     * Constructs an object with the specified values.
     *
     * @throws ezcBasePropertyNotFoundException
     *         if $options contains a property not defined
     * @throws ezcBaseValueException
     *         if $options contains a property with a value not allowed
     * @param array(string=>mixed) $options
     */
    public function __construct( array $options = array() )
    {
        $this->properties['tags'] = new ArrayObject();
        $this->properties['tags']['b']     = new ezcDocumentBBCodeEmphasisPlugin();
        $this->properties['tags']['i']     = new ezcDocumentBBCodeEmphasisPlugin();
        $this->properties['tags']['u']     = new ezcDocumentBBCodeEmphasisPlugin();
        $this->properties['tags']['size']  = new ezcDocumentBBCodeNoMarkupPlugin();
        $this->properties['tags']['color'] = new ezcDocumentBBCodeNoMarkupPlugin();
        $this->properties['tags']['quote'] = new ezcDocumentBBCodeQuotePlugin();
        $this->properties['tags']['url']   = new ezcDocumentBBCodeUrlPlugin();
        $this->properties['tags']['email'] = new ezcDocumentBBCodeEmailPlugin();
        $this->properties['tags']['img']   = new ezcDocumentBBCodeImagePlugin();

        parent::__construct( $options );
    }

    /**
     * Sets the option $name to $value.
     *
     * @throws ezcBasePropertyNotFoundException
     *         if the property $name is not defined
     * @throws ezcBaseValueException
     *         if $value is not correct for the property $name
     * @param string $name
     * @param mixed $value
     * @ignore
     */
    public function __set( $name, $value )
    {
        switch ( $name )
        {
            /*
            case 'tokenizer':
                if ( !is_object( $value ) ||
                     !( $value instanceof ezcDocumentBBCodeTokenizer ) )
                {
                    throw new ezcBaseValueException( $name, $value, 'instanceof ezcDocumentBBCodeTokenizer' );
                }

                $this->properties[$name] = $value;
                break;
            */

            default:
                parent::__set( $name, $value );
        }
    }
}

?>


text:
/**
 * Created by xuejiaowang on 13/08/2014.
 */

'use strict';

var mongoose = require('mongoose');
var Product = mongoose.model('Product');
// var _ = require('lodash');

/**
 * Create product
 * @param req
 * @param res
 */
exports.createProduct = function (req, res) {
    var product = new Product(req.body);
    product.save(function (err) {
        if (err) {
            return res.json(500, {
                error: 'can not create product'
            });
        }
        res.json(product);
    });
};

/**
 * update product
 * @param req
 * @param res
 */
exports.updateProduct = function (req, res) {
    var product = req.product;
    product = _.extend(product, req.body);
    product.save(function (err) {
        if (err) {
            return res.json(500, {
                error: 'can not update product'
            });
        }
        res.json(product);
    });
};

/**
 * delete product
 * @param req
 * @param res
 */
exports.deleteProduct = function(req, res){
    var product = req.product;
    product.remove(function(err){
        if(err){
            return res.json(500, {
                error:'can not delete product'
            })
        }
        res.json(product);
    });
}

/**
 * find all product
 * @param req
 * @param res
 */
exports.productList = function (req, res) {
    Product.find().sort('name').exec(function (err, products) {
        if(err){
            res.json(500, {
                error:'can not find product'
            });
        }

        products =[
            {title: 'noodle 1', description: 'noodle test 1', category: 'cat1', price: 100},
            {title: 'noodle 2', description: 'noodle test 2', category: 'cat1', price: 200},
            {title: 'noodle 3', description: 'noodle test 3', category: 'cat2', price: 300},
            {title: 'noodle 4', description: 'noodle test 4', category: 'cat2', price: 400}
        ]

        res.json(products);
    });

};


text:
date: 2008-04-25 03:46:36+00:00
slug: dangers-of-boring-work
title: Dangers of boring work
categories:
- technology
- working
---

<img align="left" style="border:20px solid white" src="/images/headset.jpg">

Have you ever had a job that bored you into zombie mode faster than Seabiscuit on steroids? According to [this BBC article](http://news.bbc.co.uk/2/hi/science/nature/7358863.stm), scientists have developed a headset that measures when our brains are about to switch into autopilot mode. This state of cognitive rest is the brain's way of saving cogitations for something more mentally taxing like what to make for dinner tonight.

Going brain dead is all very well if you're gluing hula skirts onto tiki dolls on an assembly line, but what about if you're, say, an air traffic controller? This device could improve workplace safety (and cut down on all those WCB claims).

Looking at the design, though, I'd say they still have a long way to go before any employee consents to sporting this stylish headgear in comfort.


text:
<?php

namespace Datmachine;

/**
 * Configurable settings.
 *
 *  You can either set these settings individually:
 *
 *
 *  \Balanced\Settings::$api_key = 'my-api-key-secret';
 *
 *
 *  or all at once:
 *
 *
 *  \Balanced\Settngs::configure(
 *      'https://api.balancedpayments.com',
 *      'my-api-key-secret'
 *      );
 *
 */
class Settings
{
    const VERSION = '1.0.0';

    public static $url_root = 'https://api.datmachine.co/sites/',
                  $api_key = null,
                  $agent = 'datmachine-php',
                  $version = Settings::VERSION,
                  $accept = 'application/json',
                  $site_id = null;

    /**
     * Configure all settings.
     *
     * @param string url_root The root (schema://hostname[:port]) to use when constructing api URLs.
     * @param string api_key The api key secret to use for authenticating when talking to the api. If null then api usage is limited to uauthenticated endpoints.
     */
    public static function configure($site_id, $api_key)
    {
      if (is_null(self::$site_id)){
        self::$site_id = $site_id;
        self::$url_root = self::$url_root . self::$site_id;
      }
      self::$api_key = $api_key;
    }
}


text:
package com.amazonaws.services.iotevents.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.iotevents.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * ClearTimerActionMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ClearTimerActionMarshaller {

    private static final MarshallingInfo<String> TIMERNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("timerName").build();

    private static final ClearTimerActionMarshaller instance = new ClearTimerActionMarshaller();

    public static ClearTimerActionMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(ClearTimerAction clearTimerAction, ProtocolMarshaller protocolMarshaller) {

        if (clearTimerAction == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(clearTimerAction.getTimerName(), TIMERNAME_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
package org.modelmapper.bugs;

import static org.testng.Assert.assertEquals;

import org.modelmapper.AbstractTest;
import org.modelmapper.PropertyMap;
import org.testng.annotations.Test;

/**
 * Test that demonstrates how explicitly mapped properties are overwritten by field name matching.
 *
 * @author boris.strandjev
 */
@Test
public class GH283 extends AbstractTest {

	public static class PersonDetails {
		private String firstName;
		private String lastName;

		public String getFirstName() {
			return firstName;
		}

		public void setFirstName(String firstName) {
			this.firstName = firstName;
		}

		public String getLastName() {
			return lastName;
		}

		public void setLastName(String lastName) {
			this.lastName = lastName;
		}
	}

	public static class Requester {
		private PersonDetails person;
		private PersonDetails unverifiedRequester;

		public PersonDetails getUnverifiedRequester() {
			return unverifiedRequester;
		}

		public void setUnverifiedRequester(PersonDetails unverifiedRequester) {
			this.unverifiedRequester = unverifiedRequester;
		}

		public PersonDetails getPerson() {
			return person;
		}

		public void setPerson(PersonDetails person) {
			this.person = person;
		}
	}

	public static class Order {
		private Requester requester;

		public Requester getRequester() {
			return requester;
		}

		public void setRequester(Requester requester) {
			this.requester = requester;
		}
	}

	public static class OrderView {
		private PersonDetails requester;

		public PersonDetails getRequester() {
			return requester;
		}

		public void setRequester(PersonDetails requester) {
			this.requester = requester;
		}
	}

	public void test() {
		modelMapper.addMappings(new PropertyMap<Requester, PersonDetails>() {
			@Override
			protected void configure() {
				map(source.getPerson().getFirstName()).setFirstName(null);
				map(source.getPerson().getLastName()).setLastName(null);
			}
		});
		modelMapper.addMappings(new PropertyMap<Order, OrderView>() {
			@Override
			protected void configure() {
				map(source.getRequester()).setRequester(null);
			}
		});

		String requesterFirstName = "John";
		String requesterLastName = "Doe";
		PersonDetails person = new PersonDetails();
		person.setFirstName(requesterFirstName);
		person.setLastName(requesterLastName);
		Requester requester = new Requester();
		requester.setPerson(person);
		Order order = new Order();
		order.setRequester(requester);

		OrderView orderView = modelMapper.map(order, OrderView.class);
		assertEquals(orderView.getRequester().getFirstName(), requesterFirstName,
				"Expected the correct requested first name");
		assertEquals(orderView.getRequester().getLastName(), requesterLastName,
				"Expected the correct requested last name");
	}
}


text:
@interface ZWContact : NSObject
@property (nonatomic,copy) NSString *title;
@property (nonatomic,copy) NSString *cover_image_url;
@end