text:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Magick++ API: Working with Color</title>
<link rel="stylesheet" href="magick.css" type="text/css" />

Magick::Color

Color is the base color class in Magick++. It is a simple container class for the pixel red, green, blue, and alpha values scaled to fit ImageMagick's Quantum size. Normally users will instantiate a class derived from Color which supports the color model that fits the needs of the application. The Color class may be constructed directly from an SVG-style color string.

Quantum

The base type used to represent color samples in ImageMagick is the Quantum type. Pixels are represented by a structure of Quantum values. For example, an RGB pixel contains red, green, and blue quantums, while an RGBA pixel contains red, green, blue, and opacity quantums. The maximum value that a Quantum can attain is specified by a constant value represented by the MaxRGB define, which is itself determined by the number of bits in a Quantum. The QuantumDepth build option determines the number of bits in a Quantum.

Quantum

Quantum is the internal representation of a pixel in ImageMagick. ImageMagick may be compiled to support 32, 64, or 128 bit pixels of type Quantum. This is controlled by the value of the QuantumDepth define. The default is 32 bit pixels (QuantumDepth=8), which provides the best performance and the least resource consumption. If additional color precision or range is desired, then ImageMagick may be compiled with QuantumDepth=16 or QuantumDepth=32. The following table shows the relationship between QuantumDepth, the type of Quantum, and the overall Quantum size.

Effect Of QuantumDepth Values

<col width="102" />
<col width="121" />
<col width="111" />

QuantumDepth

Quantum Typedef

Quantum Size

8

unsigned char

32 bits

16

unsigned short

64 bits

32

unsigned int

128 bits

Color Class

The Color base class is not intended to be used directly. Normally a user will construct a derived class or inherit from this class. Color arguments are must be scaled to fit the Quantum size. The Color class contains a pointer to a Quantum, which may be allocated by the Color class, or may refer to an existing pixel in an image.

An alternate way to construct the class is via an SVG-compatible color specification string (e.g. Color("red") or Color ("#FF0000")). Since the class may be constructed from a string, convenient strings may be passed in place of an explicit Color object in methods which accept a reference to Color. Color may also be converted to a std::string for convenience in user interfaces, and for saving settings to a text file.

class Color
{
  public:
    Color ( Quantum red_,
     Quantum green_,
     Quantum blue_ );
    Color ( Quantum red_,
     Quantum green_,
     Quantum blue_,
     Quantum alpha_ );
    Color ( const std::string &svgColor_ );
    Color ( const char * svgColor_ );
    Color ( void );
    virtual        ~Color ( void );
    Color ( const Color & color_ );

    // Red color (range 0 to MaxRGB)
    void           redQuantum ( Quantum red_ );
    Quantum        redQuantum ( void ) const;

    // Green color (range 0 to MaxRGB)
    void           greenQuantum ( Quantum green_ );
    Quantum        greenQuantum ( void ) const;

    // Blue color (range 0 to MaxRGB)
    void           blueQuantum ( Quantum blue_ );
    Quantum        blueQuantum ( void ) const;

    // Alpha level (range OpaqueOpacity=0 to TransparentOpacity=MaxRGB)
    void           alphaQuantum ( Quantum alpha_ );
    Quantum        alphaQuantum ( void ) const;

    // Scaled (to 1.0) version of alpha for use in sub-classes
    // (range opaque=0 to transparent=1.0)
    void           alpha ( double alpha_ );
    double         alpha ( void ) const;

    // Does object contain valid color?
    void           isValid ( bool valid_ );
    bool           isValid ( void ) const;

    // Set color via SVG color specification string
    const Color& operator= ( const std::string & svgColor_ );
    const Color& operator= ( const char * svgColor_ );

    // Assignment operator
    Color& operator= ( const Color& color_ );

    // Return SVG color specification string
    /* virtual */ operator std::string() const;

    // Return ImageMagick Quantum
    operator Quantum() const;

    // Construct color via ImageMagick Quantum
    Color ( const Quantum &color_ );

    // Set color via ImageMagick Quantum
    const Color& operator= ( Quantum &color_ );
};

Color Derived Classes

<col width="29*" />
<col width="227*" />

ColorRGB

Representation of RGB color with red, green, and blue specified as ratios (0 to 1)

ColorGray

Representation of grayscale sRGB color (equal parts red, green, and blue) specified as a ratio (0 to 1)

ColorMono

Representation of a black/white color (true/false)

ColorYUV

Representation of a color in the YUV colorspace

ColorRGB

Representation of an sRGB color. All color arguments have a valid range of 0.0 - 1.0.

class ColorRGB : public Color
{
  public:
    ColorRGB ( double red_, double green_, double blue_ );
    ColorRGB ( void );
    ColorRGB ( const Color & color_ );
    /* virtual */  ~ColorRGB ( void );

    void           red ( double red_ );
    double         red ( void ) const;

    void           green ( double green_ );
    double         green ( void ) const;

    void           blue ( double blue_ );
    double         blue ( void ) const;

    // Assignment operator from base class
    ColorRGB& operator= ( const Color& color_ );
};

ColorGray

Representation of a grayscale color (in linear colorspace). Grayscale is simply RGB with equal parts of red, green, and blue. All double arguments have a valid range of 0.0 - 1.0.

class ColorGray : public Color
{
  public:
    ColorGray ( double shade_ );
    ColorGray ( void );
    ColorGray ( const Color & color_ );
    /* virtual */ ~ColorGray ();

    void           shade ( double shade_ );
    double         shade ( void ) const;

    // Assignment operator from base class
    ColorGray& operator= ( const Color& color_ );
};

ColorMono

Representation of a black/white pixel (in RGB colorspace). Color arguments are constrained to 'false' (black pixel) and 'true' (white pixel).

class ColorMono : public Color
{
  public:
    ColorMono ( bool mono_ );
    ColorMono ( void );
    ColorMono ( const Color & color_ );
    /* virtual */ ~ColorMono ();

    void           mono ( bool mono_ );
    bool           mono ( void ) const;

    // Assignment operator from base class
    ColorMono& operator= ( const Color& color_ );
};

ColorHSL

Representation of a color in Hue/Saturation/Luminosity (HSL) colorspace.

class ColorHSL : public Color
{
  public:
    ColorHSL ( double hue_, double saturation_, double luminosity_ );
    ColorHSL ( void );
    ColorHSL ( const Color & color_ );
    /* virtual */  ~ColorHSL ( );

    void           hue ( double hue_ );
    double         hue ( void ) const;

    void           saturation ( double saturation_ );
    double         saturation ( void ) const;

    void           luminosity ( double luminosity_ );
    double         luminosity ( void ) const;

    // Assignment operator from base class
    ColorHSL& operator= ( const Color& color_ );
};

ColorYUV

Representation of a color in YUV colorspace (used to encode color for television transmission).

Argument ranges:

 Y: 0.0 through 1.0

 U: -0.5 through 0.5

 V: -0.5 through 0.5

class ColorYUV : public Color
{
  public:
    ColorYUV ( double y_, double u_, double v_ );
    ColorYUV ( void );
    ColorYUV ( const Color & color_ );
    /* virtual */ ~ColorYUV ( void );

    void           u ( double u_ );
    double         u ( void ) const;

    void           v ( double v_ );
    double         v ( void ) const;

    void           y ( double y_ );
    double         y ( void ) const;

    // Assignment operator from base class
    ColorYUV& operator= ( const Color& color_ );
};


text:
"""Alpha2 config flow."""
import asyncio
import logging

import aiohttp
from moehlenhoff_alpha2 import Alpha2Base
import voluptuous as vol

from homeassistant import config_entries

from .const import DOMAIN

_LOGGER = logging.getLogger(__name__)

DATA_SCHEMA = vol.Schema({vol.Required("host"): str})

async def validate_input(data):
    """Validate the user input allows us to connect.

    Data has the keys from DATA_SCHEMA with values provided by the user.
    """

    base = Alpha2Base(data["host"])
    try:
        await base.update_data()
    except (aiohttp.client_exceptions.ClientConnectorError, asyncio.TimeoutError):
        return {"error": "cannot_connect"}
    except Exception:  # pylint: disable=broad-except
        _LOGGER.exception("Unexpected exception")
        return {"error": "unknown"}

    # Return info that you want to store in the config entry.
    return {"title": base.name}

class Alpha2BaseConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
    """Möhlenhoff Alpha2 config flow."""

    VERSION = 1

    async def async_step_user(self, user_input=None):
        """Handle a flow initialized by the user."""
        errors = {}
        if user_input is not None:
            self._async_abort_entries_match({"host": user_input["host"]})
            result = await validate_input(user_input)
            if result.get("error"):
                errors["base"] = result["error"]
            else:
                return self.async_create_entry(title=result["title"], data=user_input)

        return self.async_show_form(
            step_id="user", data_schema=DATA_SCHEMA, errors=errors
        )

redpajama_set_name: RedPajamaGithub


text:
import { h, Component } from 'preact';

export interface ButtonIcon {
  name: string;
  onClick: () => void;
  title: string;
  auth: boolean;
  hide: boolean;
}

export class Button extends Component<ButtonIcon> {

  render(props: ButtonIcon) {
    if(this.props.auth == false && this.props.hide == true) {
      return '';
    }
    return (
      <button class="fa-container" title={props.title} onClick={props.onClick}>
        <i class={'fal ' + props.name}></i>
      </button>
    );
  }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Engl. fung. 1: pl. 29 (1796)

#### Original name
Peziza hirsuta Holmsk., 1799

### Remarks
null


text:
/* global exports, Main */
"use strict;"

// module Main

exports.windowWidth = function(){
    return window.document.documentElement.clientWidth;
}

exports.windowHeight = function(){
    return window.document.documentElement.clientHeight;
}


text:
LANG_MANAGE_USER_PACKS=Manage User Packages
LANG_ADD_PACKAGE=Add Package


text:
'use strict';

var adminDao = require('../dao/admin');
var postDao = require('../dao/post');
var util = require('../util');
var moment = require('moment');
var config = require('../config').config;
var fs = require('fs');

var url_admin = '/admin';
var url_admin_login = '/admin/login';
var url_admin_install = '/admin/install';
var url_admin_profile = '/admin/profile';
var url_admin_post_list = '/admin/post';
var view_admin = 'admin/index';
var view_admin_login = 'admin/login';
var view_admin_install = 'admin/install';
var view_admin_profile = 'admin/profile';
var view_admin_post_list = 'admin/postList';
var view_admin_post_new = 'admin/postNew';
var view_admin_post_edit = 'admin/postEdit';
var view_admin_timeline = 'admin/timeline';

exports.auth_admin = function(req, res, next) {
	if (req.session.admin_id) {
		return next();
	} else {
		res.redirect(url_admin_login);
	}
};

exports.login = function(req, res) {
	if (req.session.admin_id) {
		res.redirect(url_admin);
	} else {
		res.render(view_admin_login, {
			errorMsg: req.flash('errorMsg')
		});
	}
};

exports.logout = function(req, res) {
	req.session.admin_id = null;
	req.session.admin_name = null;
	res.redirect(url_admin);
};

exports.doLogin = function(req, res) {
	var user = req.body.user;
	var password = util.md5(req.body.password);
	adminDao.getAdmin(user, password, function(err, result) {
		if (err) {
			util.sendSysError(500, err, res);
		} else {
			if (result) {
				req.session.admin_id = result._id.toString();
				req.session.admin_name = result.name;
				res.redirect(req.headers.referer);
			} else {
				req.flash('errorMsg', res.__('wrongUserPassword'));
				res.redirect(url_admin_login);
			}
		}
	});
};

exports.install = function(req, res) {
	adminDao.getAllAdmin(function(err, admins) {
		if (err) {
			util.sendSysError(500, err, res);
		} else {
			if (admins.length > 0) {
				if (req.query.msg === 'success') {
					res.render(view_admin_install, {
						msg: 'success'
					});
				} else {
					res.render(view_admin_install, {
						installed: true
					});
				}
			} else {
				res.render(view_admin_install, {});
			}
		}
	});
};

exports.doInstall = function(req, res) {
	var user = req.body.user;
	var password = util.md5(req.body.password);
	adminDao.insertAdmin(user, password, function(err, rst) {
		if (err) {
			util.sendSysError(500, err, res);
		} else {
			res.redirect(url_admin_install + '?msg=success');
		}
	});
};

exports.index = function(req, res) {
	res.render(view_admin, {});
};

exports.profile = function(req, res) {
	res.render(view_admin_profile, {
		errorMsgForChangePwd: req.flash('errorMsgForChangePwd'),
		successChangePwd: req.flash('successChangePwd')
	});
};

exports.doChangePwd = function(req, res) {
	var currentPwd = util.md5(req.body.currentPwd);
	var newPwd = util.md5(req.body.newPwd);
	var adminId = req.session.admin_id;
	adminDao.getAdminById(adminId, function(err, admin) {
		if (err) {
			util.sendSysError(500, err, res);
		} else {
			if (admin) {
				if (admin.password === currentPwd) {
					adminDao.changePwd(adminId, newPwd, function(err, rst) {
						if (err) {
							util.sendSysError(500, err, res);
						} else {
							req.flash('successChangePwd', res.__('successChangePwd'));
							res.redirect(url_admin_profile);
						}
					});
				} else {
					req.flash('errorMsgForChangePwd', res.__('wrongCurrentPassword'));
					res.redirect(url_admin_profile);
				}
			}
		}
	});
};

exports.postList = function(req, res) {
	postDao.getList(function(err, rst) {
		if (err) {
			util.sendSysError(500, err, res);
		} else {
			res.render(view_admin_post_list, {
				postList: rst
			});
		}
	});
};

exports.postNew = function(req, res) {
	res.render(view_admin_post_new, {});
};

exports.postEdit = function(req, res) {
	postDao.findById(req.params.id, function(err, rst) {
		if (err) util.sendSysError(500, err, res);
		else {
			res.render(view_admin_post_edit, {
				post: rst
			});
		}
	});
};

exports.timeline = function(req, res) {
	var timeline_data = fs.readFileSync('./data/timeline.js', 'utf-8');
	res.render(view_admin_timeline, {
		timeline_list: timeline_data
	});
};


text:
#include "CKLBScoreNode.h"
#include "mem.h"

CKLBScoreNode::CKLBScoreNode()
:CKLBNode		()
,m_uiScore		(0xFFFFFFFF)
,m_newAnimated	(false)
,m_oldAnimated	(false)
,m_bScoreChange	(true)
,m_dotSprite	(NULL)
,m_dotNode		(NULL)
,m_widthDot		(0)
,m_heightDot	(0)
,m_DotPosition	(0)
,m_prevDotPosition	(0)
{
	m_deleteRender = false; // Force own management of sprite on destruction.
	memset32(m_scoreOldNode, NULL, __SCORE_LEN_MAX__ * sizeof(void*));
	memset32(m_scoreNewNode, NULL, __SCORE_LEN_MAX__ * sizeof(void*));
	memset32(m_font		   , NULL, 11 * sizeof(void*));
	m_animInfo[0].m_hasAnim = false;
	m_animInfo[1].m_hasAnim = false;
}

CKLBScoreNode::~CKLBScoreNode()
{
	CKLBRenderingManager& pMgr = CKLBRenderingManager::getInstance();
	for (int n=0; n < __SCORE_LEN_MAX__; n++) {
		if (m_scoreOldNode[n]) {
			// 1. Back up sprite.
			CKLBRenderCommand* pComm = m_scoreOldNode[n]->getRender();
			m_scoreOldNode[n]->setRender(NULL);
			// 2. Destroy node -> remove from render list if any.
			KLBDELETE(m_scoreOldNode[n]);
			// 3. Destroy sprite if any.
			if (pComm) { pMgr.releaseCommand(pComm); }
		}
		if (m_scoreNewNode[n]) {
			// Order important !
			CKLBRenderCommand* pComm = m_scoreNewNode[n]->getRender();
			m_scoreNewNode[n]->setRender(NULL);
			KLBDELETE(m_scoreNewNode[n]);
			if (pComm) { pMgr.releaseCommand(pComm); }
		}
	}

	if (m_dotNode) {
		m_dotNode->setRender(NULL);
		KLBDELETE(m_dotNode);
	}

	if (m_dotSprite) {
		pMgr.releaseCommand(m_dotSprite);
	}
}

void CKLBScoreNode::setDot(	CKLBImageAsset* dotAsset, s32 width, s32 height ) {
	m_dotSprite->switchImage(dotAsset);

	m_widthDot = (float)width;
	m_heightDot= (float)height;

	m_dotNode->markUpMatrix();
}

void CKLBScoreNode::setDotActive(u32 position) {
	m_prevDotPosition = position;
}

void CKLBScoreNode::setScore(u32 value, bool animFirstTime) {
	setDotActive(255); // Outside of range.
	setScoreInternal(value, animFirstTime);
}

void CKLBScoreNode::setScoreFloat(float value, u32 dotPosition, bool animFirstTime) {
	static float s_multiplier[10] = {
		1.0f,
		10.0f,
		100.0f,
		1000.0f,
		10000.0f,
		100000.0f,
		1000000.0f,
		10000000.0f,
		100000000.0f,
		1000000000.0f,
	};

	if (dotPosition >= 9) {
		dotPosition = 9;
	}

	value *= s_multiplier[dotPosition];

	dotPosition = m_scoreLength - dotPosition;

	// Float to int
	u32 score = (u32)value;
	setScoreInternal(score, animFirstTime);
	setDotActive(dotPosition);
}

bool CKLBScoreNode::init(	u32						basePriority,
							s32						oldNumberPriorityOffset,
							CKLBImageAsset*		 	char0_9[10],
							s32 					stepX,
							s32 					stepY,
							u32 					score_length,
							bool					fillWithZero,
							bool					animAll) {
	bool res = true;
	m_animAll		= animAll;
	m_default		= (fillWithZero     ) ? 0 : 10;
	m_scoreLength	= (score_length > 9 ) ? 9 : (score_length < 1 ? 1 : score_length);
	m_oldNumberPriorityOffset	= oldNumberPriorityOffset;
	m_stepX			= stepX;
	m_stepY			= stepY;

	memcpy32(m_font, char0_9, 10 * sizeof(CKLBImageAsset*));

	CKLBRenderingManager& pMgr = CKLBRenderingManager::getInstance();

	for (int n = 0; n < __SCORE_LEN_MAX__; n++) {
		m_oldScore[n] = 30; // Only occurs the first time.
	}

	for (int n = 0; n < m_scoreLength; n++) {
		float	fStepX			= (float)(n*m_stepX);
		float	fStepY			= (float)(n*m_stepY);

		m_scoreOldNode[n] = KLBNEW(CKLBSplineNode);
		m_scoreNewNode[n] = KLBNEW(CKLBSplineNode);
		CKLBSprite* pSpr0 = pMgr.allocateCommandSprite(4,6);
		CKLBSprite* pSpr1 = pMgr.allocateCommandSprite(4,6);

		if ((!m_scoreNewNode[n]) || (!m_scoreOldNode	[n]) || (!pSpr0) || (!pSpr1)) {
			res = false; break;
		}

		m_scoreOldNode[n]->setRender(pSpr0);
		m_scoreNewNode[n]->setRender(pSpr1);

		m_scoreOldNode[n]->setTranslate(fStepX, fStepY);

		((CKLBSprite*)m_scoreOldNode[n]->getRender())->changeOrder(pMgr, basePriority + n + oldNumberPriorityOffset);
		((CKLBSprite*)m_scoreNewNode[n]->getRender())->changeOrder(pMgr, basePriority + n);

		m_scoreNewNode[n]->setTranslate(fStepX, fStepY);
		this->addNode(m_scoreNewNode[n]);

	}

	m_dotSprite = pMgr.allocateCommandSprite(4,6);
	m_dotNode   = KLBNEW(CKLBNode);
	this->addNode(m_dotNode);

	return res && (m_dotSprite != NULL) && (m_dotNode != NULL);
}

void CKLBScoreNode::setPriority(u32 order)
{
	CKLBRenderingManager& pRdr = CKLBRenderingManager::getInstance();

	for (int n = 0; n < m_scoreLength; n++) {
		((CKLBSprite*)m_scoreOldNode[n]->getRender())->changeOrder(pRdr, order + n + m_oldNumberPriorityOffset);
		((CKLBSprite*)m_scoreNewNode[n]->getRender())->changeOrder(pRdr, order + n);
	}
	m_dotSprite->changeOrder(pRdr, order + m_DotPosition + m_oldNumberPriorityOffset);
}

void CKLBScoreNode::setAnimationInternal(	bool	isNew,
											s32		milliSecondsPlayTime,
											s32		timeShift,
											bool	/*onlyChange*/,
											u32		type,
											u32		affected,
											const float* arrayParam) {
	AnimInfo* pAnim = &m_animInfo[isNew ? 1 : 0];
	float* dst = pAnim->m_Anim;
	if (affected & CKLBSplineNode::ANM_X_COORD_0)		{   *dst++ = *arrayParam++;  *dst++ = *arrayParam++; }
	if (affected & CKLBSplineNode::ANM_Y_COORD_1)		{   *dst++ = *arrayParam++;  *dst++ = *arrayParam++; }
	if (affected & CKLBSplineNode::ANM_SCALE_COORD_2)	{   *dst++ = *arrayParam++;  *dst++ = *arrayParam++;
															*dst++ = *arrayParam++;  *dst++ = *arrayParam++; }
	if (affected & CKLBSplineNode::ANM_R_COLOR_3)		{   *dst++ = *arrayParam++;  *dst++ = *arrayParam++; }
	if (affected & CKLBSplineNode::ANM_G_COLOR_4)		{   *dst++ = *arrayParam++;  *dst++ = *arrayParam++; }
	if (affected & CKLBSplineNode::ANM_B_COLOR_5)		{   *dst++ = *arrayParam++;  *dst++ = *arrayParam++; }
	if (affected & CKLBSplineNode::ANM_A_COLOR_6)		{   *dst++ = *arrayParam++;  *dst++ = *arrayParam++; }

	pAnim->m_affected				= affected;
	pAnim->m_milliSecondsPlayTime	= milliSecondsPlayTime;
	pAnim->m_type					= type;
	pAnim->m_timeShift				= timeShift;
	pAnim->m_hasAnim				= affected != 0;
	reAssignAnim(isNew ? 1 : 0);
}

void CKLBScoreNode::reAssignAnim(u32 idx) {
	float localFloat[16];

	AnimInfo* pAnim = &m_animInfo[idx];
	if (pAnim->m_hasAnim) {
		CKLBSplineNode** pNodeArr = (idx != 0) ? m_scoreNewNode : m_scoreOldNode;

		const float* backup = pAnim->m_Anim;
		memcpy(localFloat, backup, sizeof(float)*16);
		for (int n=0; n < m_scoreLength; n++) {
			float* backup = pAnim->m_Anim;
			float*	dst             = localFloat;
			int		m				= m_scoreLength - n;
			int		timeShiftLocal	= m*pAnim->m_timeShift;

			float   offsetX			= ((n >= m_DotPosition) ? m_widthDot : 0.0f);
			float   offsetY			= ((n >= m_DotPosition) ? m_heightDot: 0.0f);

			float	fStepX			= ((float)(n*m_stepX)) + offsetX;
			float	fStepY			= ((float)(n*m_stepY)) + offsetY;

			if (pAnim->m_affected & CKLBSplineNode::ANM_X_COORD_0)	{   *dst++ = (*backup++) + fStepX;  *dst++ = (*backup++) + fStepX; }
			if (pAnim->m_affected & CKLBSplineNode::ANM_Y_COORD_1)	{   *dst++ = (*backup++) + fStepY;  *dst++ = (*backup++) + fStepY; }

			pNodeArr[n]->setAnimation(pAnim->m_milliSecondsPlayTime, timeShiftLocal, pAnim->m_type, NULL, 0, pAnim->m_affected, localFloat);
		}
	}
}

/**
	No animation : affected = 0
 */
void CKLBScoreNode::setEnterAnimation	(s32 milliSecondsPlayTime, s32 timeShift, bool onlyChange, u32 type, u32 affected, const float* arrayParam)
{
	if (!arrayParam) { affected = 0; }

	//
	// Enter animation : never remove.
	//
	affected &= ~CKLBSplineNode::ANM_REMOVESCENE;

	setAnimationInternal(true, milliSecondsPlayTime, timeShift, onlyChange, type, affected, arrayParam);

	m_newAnimated = (affected != 0);
}

void CKLBScoreNode::setExitAnimation	(s32 milliSecondsPlayTime, s32 timeShift, bool onlyChange, u32 type, u32 affected, const float* arrayParam)
{
	if (!arrayParam) { affected = 0; }

	setAnimationInternal(false, milliSecondsPlayTime, timeShift, onlyChange, type, affected | CKLBSplineNode::ANM_REMOVESCENE, arrayParam);

	m_oldAnimated = (affected != 0);
}

void CKLBScoreNode::setScoreInternal	(u32 score, bool /*animFirstTime*/)
{
	if (score != m_uiScore) {
		m_uiScore       = score;
		m_bScoreChange  = true;
	}
}

void CKLBScoreNode::update() {
	if (m_prevDotPosition != m_DotPosition) {
		m_DotPosition = m_prevDotPosition;
		if (m_DotPosition >= m_scoreLength) {

			m_dotNode->setRender(NULL,0);

			reAssignAnim(0);
			reAssignAnim(1);

			for (int n = 0; n < m_scoreLength; n++) {
				float	fStepX			= (float)(n*m_stepX);
				float	fStepY			= (float)(n*m_stepY);

				m_scoreOldNode[n]->setTranslate(fStepX, fStepY);
				m_scoreNewNode[n]->setTranslate(fStepX, fStepY);
			}
		} else {

			m_dotNode->setRender(m_dotSprite);

			reAssignAnim(0);
			reAssignAnim(1);

			for (int n = 0; n < m_scoreLength; n++) {
				float offsetX = ((n >= m_DotPosition) ? m_widthDot : 0.0f);
				float offsetY = ((n >= m_DotPosition) ? m_heightDot : 0.0f);

				float	fStepX			= ((float)(n*m_stepX)) + offsetX;
				float	fStepY			= ((float)(n*m_stepY)) + offsetY;

				if (n == m_DotPosition) {
					m_dotNode->setTranslate(fStepX - offsetX, fStepY - offsetY);
				}

				m_scoreOldNode[n]->setTranslate(fStepX, fStepY);
				m_scoreNewNode[n]->setTranslate(fStepX, fStepY);
			}
		}
	}

	if (m_bScoreChange) {
		u32 score = m_uiScore;
		u8 newScore[10];
		m_bScoreChange = false;
		// Reset.
		newScore[0 ] = 0;  //m_default; // 0fill���Ȃ��ꍇ�ł�A1���ڂ�0�͕\������B
		newScore[1 ] = m_default;
		newScore[2 ] = m_default;
		newScore[3 ] = m_default;
		newScore[4 ] = m_default;
		newScore[5 ] = m_default;
		newScore[6 ] = m_default;
		newScore[7 ] = m_default;
		newScore[8 ] = m_default;
		newScore[9 ] = m_default;

		// Convert int into units.
		while (score >=1000000000) {	score -=1000000000;	newScore[9]++;	}
		while (score >= 100000000) {	score -= 100000000;	newScore[8]++;	}
		while (score >=  10000000) {	score -=  10000000;	newScore[7]++;	}
		while (score >=   1000000) {	score -=   1000000;	newScore[6]++;	}
		while (score >=    100000) {	score -=    100000;	newScore[5]++;	}
		while (score >=     10000) {	score -=     10000;	newScore[4]++;	}
		while (score >=      1000) {	score -=      1000;	newScore[3]++;	}
		while (score >=       100) {	score -=       100;	newScore[2]++;	}
		while (score >=        10) {	score -=        10;	newScore[1]++;	}
		while (score >=         1) {	score -=         1;	newScore[0]++;	}

		//
		// Manage to handle that fill 0 with empty space works only for the BEGINNING of the score
		// ie : 000010000 -> ____10000
		//
		if (m_default != 0) {
			bool resetFill = false;
			for (int n = m_scoreLength; n>=0; n--) {
				if (newScore[n] != 10) {
					resetFill = true;
					if (newScore[n] > 10) {
						newScore[n] -= 10;
					}
				} else {
					if (n <= m_scoreLength - m_DotPosition) {
						resetFill = true;
					}
					if (resetFill) {
						newScore[n] = 0;
					}
				}
			}
		}

		//
		// Perform display switch.
		//
		for (int n = 0; n < m_scoreLength; n++) {
			// From higher to lower.
			int m = ((m_scoreLength-1) - n);
			if ((m_oldScore[n] != newScore[n]) || m_animAll) {
				// New score graphic setup
				CKLBImageAsset* pAsset = m_font[newScore[n]];

				// ---- Atomic Operation ----
				((CKLBSprite*)m_scoreNewNode[m]->getRender())->switchImage(pAsset);

				// Changed only UV but node recompute use matrix changes.
				m_scoreNewNode[m]->markUpMatrixAndColor();
				// --------------------------

				// Set animation if needed.
				if (m_newAnimated) {
					// Set new font item.
					m_scoreNewNode[m]->play();	// Reset time. (add to animation system is also done by the function)
				}

				// If old animation is needed.
				if (m_oldAnimated) {
					//
					// Put back in scene graph if animation is already complete.
					//
					if (m_scoreOldNode[m]->getParent() == NULL) {
						this->addNode(m_scoreOldNode[m], 0);
					}

					// Assign bitmap
					CKLBImageAsset* pAsset = m_font[m_oldScore[n]];

					// ---- Atomic Operation ----
					((CKLBSprite*)m_scoreOldNode[m]->getRender())->switchImage(pAsset);
					// Changed only UV but node recompute use matrix changes.
					m_scoreOldNode[m]->markUpMatrixAndColor();
					// --------------------------

					// Restart animation.
					m_scoreOldNode[m]->play();	// Reset time. (add to animation system is also done by the function)
				}
			}
			m_oldScore[n] = newScore[n];
		}
	}
}


text:
using System.Linq;
using NUnit.Framework;
using osu.Framework.Extensions;

namespace osu.Framework.Tests.Lists
{
    [TestFixture]
    public class TestArrayExtensions
    {
        [Test]
        public void TestNullToJagged()
        {
            int[][] result = null;
            Assert.DoesNotThrow(() => result = ((int[,])null).ToJagged());
            Assert.AreEqual(null, result);
        }

        [Test]
        public void TestNullToRectangular()
        {
            int[,] result = null;
            Assert.DoesNotThrow(() => result = ((int[][])null).ToRectangular());
            Assert.AreEqual(null, result);
        }

        [Test]
        public void TestEmptyRectangularToJagged()
        {
            int[][] result = null;
            Assert.DoesNotThrow(() => result = new int[0, 0].ToJagged());
            Assert.AreEqual(0, result.Length);
        }

        [Test]
        public void TestEmptyJaggedToRectangular()
        {
            int[,] result = null;
            Assert.DoesNotThrow(() => result = new int[0][].ToRectangular());
            Assert.AreEqual(0, result.Length);
        }

        [Test]
        public void TestRectangularColumnToJagged()
        {
            int[][] result = null;
            Assert.DoesNotThrow(() => result = new int[1, 10].ToJagged());
            Assert.AreEqual(1, result.Length);
            Assert.AreEqual(10, result[0].Length);
        }

        [Test]
        public void TestJaggedColumnToRectangular()
        {
            var jagged = new int[10][];

            int[,] result = null;
            Assert.DoesNotThrow(() => result = jagged.ToRectangular());
            Assert.AreEqual(10, result.GetLength(0));
        }

        [Test]
        public void TestRectangularRowToJagged()
        {
            int[][] result = null;
            Assert.DoesNotThrow(() => result = new int[10, 0].ToJagged());
            Assert.AreEqual(10, result.Length);
            for (int i = 0; i < 10; i++)
                Assert.AreEqual(0, result[i].Length);
        }

        [Test]
        public void TestJaggedRowToRectangular()
        {
            var jagged = new int[1][];
            jagged[0] = new int[10];

            int[,] result = null;
            Assert.DoesNotThrow(() => result = jagged.ToRectangular());
            Assert.AreEqual(10, result.GetLength(1));
            Assert.AreEqual(1, result.GetLength(0));
        }

        [Test]
        public void TestSquareRectangularToJagged()
        {
            int[][] result = null;
            Assert.DoesNotThrow(() => result = new int[10, 10].ToJagged());
            Assert.AreEqual(10, result.Length);
            for (int i = 0; i < 10; i++)
                Assert.AreEqual(10, result[i].Length);
        }

        [Test]
        public void TestSquareJaggedToRectangular()
        {
            var jagged = new int[10][];
            for (int i = 0; i < 10; i++)
                jagged[i] = new int[10];

            int[,] result = null;
            Assert.DoesNotThrow(() => result = jagged.ToRectangular());
            Assert.AreEqual(10, result.GetLength(0));
            Assert.AreEqual(10, result.GetLength(1));
        }

        [Test]
        public void TestNonSquareJaggedToRectangular()
        {
            var jagged = new int[10][];
            for (int i = 0; i < 10; i++)
                jagged[i] = new int[i];

            int[,] result = null;
            Assert.DoesNotThrow(() => result = jagged.ToRectangular());
            Assert.AreEqual(10, result.GetLength(0));
            Assert.AreEqual(9, result.GetLength(1));
        }

        [Test]
        public void TestNonSquareJaggedWithNullRowsToRectangular()
        {
            var jagged = new int[10][];
            for (int i = 1; i < 10; i += 2)
            {
                if (i % 2 == 1)
                    jagged[i] = new int[i];
            }

            int[,] result = null;
            Assert.DoesNotThrow(() => result = jagged.ToRectangular());
            Assert.AreEqual(10, result.GetLength(0));
            Assert.AreEqual(9, result.GetLength(1));

            for (int i = 0; i < 10; i++)
                Assert.AreEqual(0, result[i, 0]);
        }

        [Test]
        public void TestInvertRectangular()
        {
            var original = new int?[,]
            {
                { 1, 2, null },
                { null, 3, 4 },
                { 5, 6, null }
            };

            var result = original.Invert();

            Assert.AreEqual(1, result[0, 0]);
            Assert.AreEqual(2, result[1, 0]);
            Assert.AreEqual(null, result[2, 0]);
            Assert.AreEqual(null, result[0, 1]);
            Assert.AreEqual(3, result[1, 1]);
            Assert.AreEqual(4, result[2, 1]);
            Assert.AreEqual(5, result[0, 2]);
            Assert.AreEqual(6, result[1, 2]);
            Assert.AreEqual(null, result[2, 2]);
        }

        [Test]
        public void TestInvertJagged()
        {
            // 4x5 array
            var original = new[]
            {
                new int?[] { 1, 2, null },
                new int?[] { 3, 4 },
                null,
                new int?[] { null, 5, 6, 7, 8}
            };

            var result = original.Invert();

            // Ensure 5x4 array
            Assert.AreEqual(5, result.Length);
            Assert.AreEqual(4, result.Max(r => r.Length));

            // Column 1
            Assert.AreEqual(1, result[0][0]);
            Assert.AreEqual(2, result[1][0]);
            Assert.AreEqual(null, result[2][0]);
            Assert.AreEqual(null, result[3][0]);
            Assert.AreEqual(null, result[4][0]);

            // Column 2
            Assert.AreEqual(3, result[0][1]);
            Assert.AreEqual(4, result[1][1]);
            Assert.AreEqual(null, result[2][1]);
            Assert.AreEqual(null, result[3][1]);
            Assert.AreEqual(null, result[4][1]);

            // Column 3
            Assert.AreEqual(null, result[0][2]);
            Assert.AreEqual(null, result[1][2]);
            Assert.AreEqual(null, result[2][2]);
            Assert.AreEqual(null, result[3][2]);
            Assert.AreEqual(null, result[4][2]);

            // Column 4
            Assert.AreEqual(null, result[0][3]);
            Assert.AreEqual(5, result[1][3]);
            Assert.AreEqual(6, result[2][3]);
            Assert.AreEqual(7, result[3][3]);
            Assert.AreEqual(8, result[4][3]);
        }
    }
}


text:
package com.formkiq.core.domain;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Type;

import com.formkiq.core.domain.type.UserSettings;

/**
 * User Settings domain.
 *
 */
@Entity
@Table(name = "user_settings")
public class UserSetting {

	/** identifier column. */
    @Id
    @Column(name = "user_setting_id", unique = true, columnDefinition = "uuid")
    @Type(type = "pg-uuid")
    private UUID usersettingid;

	/** user_id column. */
	@NotNull
	@Type(type = "pg-uuid")
	@Column(name = "user_id", nullable = false, columnDefinition = "uuid")
	private UUID userid;

	/** setting column. */
	@NotNull
	@Enumerated(EnumType.STRING)
	@Column(name = "setting", nullable = false)
	private UserSettings setting;

	/** setting column. */
    @NotNull
    @Column(name = "value", nullable = false)
    private String value;

	/**
	 * default constructor.
	 */
	public UserSetting() {
	}

   /**
     * constructor.
     * @param user {@link User}
     * @param settingString {@link UserSettings}
     * @param valueString {@link String}
     */
    public UserSetting(final User user, final UserSettings settingString,
            final String valueString) {
        this.userid = user.getUserid();
        this.setting = settingString;
        this.value = valueString;
    }

	/**
	 * @return {@link UUID}
	 */
    public UUID getUsersettingid() {
        return this.usersettingid;
    }

    /**
     * @param id {@link UUID}
     */
    public void setUsersettingid(final UUID id) {
        this.usersettingid = id;
    }

    /**
     * @return {@link UUID}
     */
    public UUID getUserid() {
        return this.userid;
    }

    /**
     * @param id {@link UUID}
     */
    public void setUserid(final UUID id) {
        this.userid = id;
    }

    /**
     * @return {@link UserSettings}
     */
    public UserSettings getSetting() {
        return this.setting;
    }

    /**
     * @param us {@link UserSettings}
     */
    public void setSetting(final UserSettings us) {
        this.setting = us;
    }

    /**
     * @return {@link String}
     */
    public String getValue() {
        return this.value;
    }

    /**
     * @param s {@link String}
     */
    public void setValue(final String s) {
        this.value = s;
    }
}


text:
Last edit:  02-Oct-2015

This project uses the Bootstrap framework.
Missing:
- Images and links to featured work
- Center image

Added compared to 2.0:
- Modal dialog, and for this purpose jQuery


text:
These are the devices that we officially support and maintain:
- [Xiaomi Redmi Note 3 Pro](http://www.gsmarena.com/xiaomi_redmi_note_3-7863.php)
- [Nexus 4](http://www.gsmarena.com/lg_nexus_4_e960-5048.php)
- [Nexus 5](http://www.gsmarena.com/lg_nexus_5-5705.php)
- [Nexus 6](http://www.gsmarena.com/motorola_nexus_6-6604.php)
- [Sony Xperia X3 Compact](http://www.gsmarena.com/sony_xperia_z3_compact-6538.php)

## ROMs
Check out the [Downloads page](downloads.md) for a list of flashable ROMs for some of the devices listed here.
We can't generate nightly ROMs for all the devices but you're always welcome to build from source.


text:
'''Tests the wsgi middleware in pulsar.apps.wsgi'''
import time
import pickle
import unittest
from unittest import mock
from datetime import datetime, timedelta
from urllib.parse import urlparse

import pulsar
from pulsar.apps import wsgi
from pulsar.apps import http
from pulsar.apps.wsgi.utils import cookie_date

class WsgiRequestTests(unittest.TestCase):

    def request(self, **kwargs):
        environ = wsgi.test_wsgi_environ(**kwargs)
        return wsgi.WsgiRequest(environ)

    def test_absolute_path(self):
        uri = 'http://bbc.co.uk/news/'
        request = self.request(path=uri)
        self.assertEqual(request.get('RAW_URI'), uri)
        self.assertEqual(request.path, '/news/')
        self.assertEqual(request.absolute_uri(), uri)

    def test_is_secure(self):
        request = self.request(https=True)
        self.assertTrue(request.is_secure)
        self.assertEqual(request.environ['HTTPS'], 'on')
        self.assertEqual(request.environ['wsgi.url_scheme'], 'https')

    def test_get_host(self):
        request = self.request(headers=[('host', 'blaa.com')])
        self.assertEqual(request.get_host(), 'blaa.com')

    def test_full_path(self):
        request = self.request(headers=[('host', 'blaa.com')])
        self.assertEqual(request.full_path(), '/')
        self.assertEqual(request.full_path('/foo'), '/foo')

    def test_full_path_query(self):
        request = self.request(path='/bla?path=foo&id=5')
        self.assertEqual(request.path, '/bla')
        self.assertEqual(request.url_data, {'path': 'foo', 'id': '5'})
        self.assertEqual(request.full_path(), '/bla')
        # self.assertTrue(request.full_path() in ('/bla?path=foo&id=5',
        #                                         '/bla?id=5&path=foo'))
        self.assertEqual(request.full_path(g=7), '/bla?g=7')

    def test_url_handling(self):
        target = '/\N{SNOWMAN}'
        request = self.request(path=target)
        path = urlparse(request.path).path
        self.assertEqual(path, target)

    def testResponse200(self):
        r = wsgi.WsgiResponse(200)
        self.assertEqual(r.status_code, 200)
        self.assertEqual(r.status, '200 OK')
        self.assertEqual(r.content, ())
        self.assertFalse(r.is_streamed)
        self.assertFalse(r.started)
        self.assertEqual(list(r), [])
        self.assertTrue(r.started)
        self.assertEqual(str(r), r.status)
        self.assertTrue(repr(r))

    def testResponse500(self):
        r = wsgi.WsgiResponse(500, content=b'A critical error occurred')
        self.assertEqual(r.status_code, 500)
        self.assertEqual(r.status, '500 Internal Server Error')
        self.assertEqual(r.content, (b'A critical error occurred',))
        self.assertFalse(r.is_streamed)
        self.assertFalse(r.started)
        self.assertEqual(list(r), [b'A critical error occurred'])
        self.assertTrue(r.started)

    def testStreamed(self):
        stream = ('line {0}\n'.format(l+1) for l in range(10))
        r = wsgi.WsgiResponse(content=stream)
        self.assertEqual(r.status_code, 200)
        self.assertEqual(r.status, '200 OK')
        self.assertEqual(r.content, stream)
        self.assertTrue(r.is_streamed)
        data = []
        for l, a in enumerate(r):
            data.append(a)
            self.assertTrue(r.started)
            self.assertEqual(a, ('line {0}\n'.format(l+1)).encode('utf-8'))
        self.assertEqual(len(data), 10)

    def testForCoverage(self):
        r = wsgi.WsgiResponse(environ={'PATH_INFO': 'bla/'})
        self.assertEqual(r.path, 'bla/')
        self.assertEqual(r.connection, None)
        self.assertEqual(r.content, ())
        self.assertEqual(list(r), [])
        self.assertRaises(RuntimeError, list, r)

    def test_parse_authorization_header(self):
        parse = wsgi.parse_authorization_header
        self.assertEqual(parse(''), None)
        self.assertEqual(parse('csdcds'), None)
        self.assertEqual(parse('csdcds cbsdjchbjsc'), None)
        self.assertEqual(parse('basic cbsdjcbsjchbsd'), None)
        auths = http.HTTPBasicAuth('pippo', 'pluto').header()
        self.assertTrue(parse(auths).authenticated({}, 'pippo', 'pluto'))

    def testCookies(self):
        response = wsgi.WsgiResponse()
        expires = datetime.now() + timedelta(seconds=3600)
        response.set_cookie('bla', expires=expires)
        self.assertTrue('bla' in response.cookies)

    def testDeleteCookie(self):
        response = wsgi.WsgiResponse()
        response.delete_cookie('bla')
        self.assertTrue('bla' in response.cookies)

    def test_far_expiration(self):
        "Cookie will expire when an distant expiration time is provided"
        response = wsgi.WsgiResponse()
        response.set_cookie('datetime', expires=datetime(2028, 1, 1, 4, 5, 6))
        datetime_cookie = response.cookies['datetime']
        self.assertEqual(datetime_cookie['expires'],
                         'Sat, 01-Jan-2028 04:05:06 GMT')

    def test_max_age_expiration(self):
        "Cookie will expire if max_age is provided"
        response = wsgi.WsgiResponse()
        response.set_cookie('max_age', max_age=10)
        max_age_cookie = response.cookies['max_age']
        self.assertEqual(max_age_cookie['max-age'], 10)
        self.assertEqual(max_age_cookie['expires'],
                         cookie_date(time.time()+10))

    def test_httponly_cookie(self):
        response = wsgi.WsgiResponse()
        response.set_cookie('example', httponly=True)
        example_cookie = response.cookies['example']
        # A compat cookie may be in use -- check that it has worked
        # both as an output string, and using the cookie attributes
        self.assertTrue('; httponly' in str(example_cookie).lower())
        self.assertTrue(example_cookie['httponly'])

    def test_headers(self):
        response = wsgi.WsgiResponse(200)
        response['content-type'] = 'text/plain'
        self.assertTrue('content-type' in response)
        self.assertTrue(response.has_header('content-type'))
        self.assertEqual(response['content-type'], 'text/plain')

    def testBuildWsgiApp(self):
        appserver = wsgi.WSGIServer()
        self.assertEqual(appserver.name, 'wsgi')
        self.assertEqual(appserver.cfg.callable, None)

    def testWsgiHandler(self):
        hnd = wsgi.WsgiHandler(middleware=(wsgi.authorization_middleware,))
        self.assertEqual(len(hnd.middleware), 1)
        hnd2 = pickle.loads(pickle.dumps(hnd))
        self.assertEqual(len(hnd2.middleware), 1)

    def testHttpBinServer(self):
        from examples.httpbin.manage import server
        app = server(bind='127.0.0.1:0')
        pickle.loads(pickle.dumps(app))

    def test_clean_path_middleware(self):
        url = 'bla//foo'
        try:
            wsgi.clean_path_middleware({'PATH_INFO': url,
                                        'QUERY_STRING': 'page=1'}, None)
        except pulsar.HttpRedirect as e:
            url = e.headers[0][1]
            self.assertEqual(url, '/bla/foo?page=1')

    def test_handle_wsgi_error(self):

        def handler(request, exc):
            return 'exception: %s' % exc

        environ = wsgi.test_wsgi_environ(
            extra={'error.handler': handler})
        try:
            raise ValueError('just a test')
        except ValueError as exc:
            response = wsgi.handle_wsgi_error(environ, exc)
        self.assertEqual(response.status_code, 500)
        self.assertEqual(response.content, (b'exception: just a test',))

    def test_handle_wsgi_error_debug(self):
        cfg = self.cfg.copy()
        cfg.set('debug', True)
        environ = wsgi.test_wsgi_environ(extra={'pulsar.cfg': cfg})
        try:
            raise ValueError('just a test for debug wsgi error handler')
        except ValueError as exc:
            response = wsgi.handle_wsgi_error(environ, exc)
        self.assertEqual(response.status_code, 500)
        self.assertEqual(response.content_type, None)
        self.assertEqual(len(response.content), 1)

    def test_handle_wsgi_error_debug_html(self):
        cfg = self.cfg.copy()
        cfg.set('debug', True)
        headers = [('Accept', '*/*')]
        environ = wsgi.test_wsgi_environ(extra={'pulsar.cfg': cfg},
                                         headers=headers)
        try:
            raise ValueError('just a test for debug wsgi error handler')
        except ValueError as exc:
            response = wsgi.handle_wsgi_error(environ, exc)
        self.assertEqual(response.status_code, 500)
        html = response.content[0]
        self.assertEqual(response.content_type, 'text/html')
        self.assertTrue(html.startswith(b'<!DOCTYPE html>'))
        self.assertTrue(b'<title>500 Internal Server Error</title>' in html)

    def test_wsgi_handler_404(self):
        start = mock.MagicMock()
        handler = wsgi.WsgiHandler()
        environ = self.request().environ
        response = handler(environ, start)
        self.assertEqual(response.status_code, 404)
        self.assertEqual(start.call_count, 1)

    def test_request_redirect(self):
        request = self.request()
        response = request.redirect('/foo')
        self.assertEqual(response.status_code, 302)
        self.assertEqual(response['location'], '/foo')
        response = request.redirect('/foo2', permanent=True)
        self.assertEqual(response.status_code, 301)
        self.assertEqual(response['location'], '/foo2')


text:
package com.vk.api.sdk.objects.groups;

import com.google.gson.annotations.SerializedName;
import com.vk.api.sdk.queries.EnumParam;

public enum Filter implements EnumParam {
    @SerializedName("admin")
    ADMIN("admin"),

    @SerializedName("editor")
    EDITOR("editor"),

    @SerializedName("moder")
    MODER("moder"),

    @SerializedName("advertiser")
    ADVERTISER("advertiser"),

    @SerializedName("groups")
    GROUPS("groups"),

    @SerializedName("publics")
    PUBLICS("publics"),

    @SerializedName("events")
    EVENTS("events"),

    @SerializedName("has_addresses")
    HAS_ADDRESSES("has_addresses");

    private final String value;

    Filter(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return value.toLowerCase();
    }
}


text:
import numpy as np
import tensorflow as tf

from skflow import ops

class DropoutTest(tf.test.TestCase):

    def test_dropout_float(self):
        with self.test_session() as session:
            x = tf.placeholder(tf.float32, [5, 5])
            y = ops.dropout(x, 0.5)
            probs = tf.get_collection(ops.DROPOUTS)
            session.run(tf.initialize_all_variables())
            self.assertEqual(len(probs), 1)
            self.assertEqual(session.run(probs[0]), 0.5)

    def test_dropout_tensor(self):
        with self.test_session():
            x = tf.placeholder(tf.float32, [5, 5])
            y = tf.get_variable("prob", [], initializer=tf.constant_initializer(0.5))
            z = ops.dropout(x, y)
            probs = tf.get_collection(ops.DROPOUTS)
            self.assertEqual(probs, [y])

if __name__ == '__main__':
    tf.test.main()


text:
package org.guppy4j.html.tag;

import org.guppy4j.html.Tag;
import org.guppy4j.html.marker.AnyContent;
import org.guppy4j.html.marker.DivAttribute;
import org.guppy4j.html.marker.DivContent;

import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static org.guppy4j.html.Element.div;

/**
 * The 'div' tag
 */
public class Div<M> extends Tag<M, DivAttribute<M>, DivContent<M>>
    implements AnyContent<M> {

    @SafeVarargs
    public static <M> Div<M> div(DivContent<M>... contents) {
        return new Div<>(emptyList(), asList(contents));
    }

    public Div(Iterable<DivAttribute<M>> attributes,
                Iterable<DivContent<M>> contents) {
        super(div, attributes, contents);
    }
}


text:
package org.apache.spark.sql.types

import scala.math.Ordering
import scala.reflect.runtime.universe.typeTag

import org.apache.spark.annotation.Unstable

/**
 * The type represents year-month intervals of the SQL standard. A year-month interval is made up
 * of a contiguous subset of the following fields:
 *   - MONTH, months within years [0..11],
 *   - YEAR, years in the range [0..178956970].
 *
 * `YearMonthIntervalType` represents positive as well as negative year-month intervals.
 *
 * Please use the singleton `DataTypes.YearMonthIntervalType` to refer the type.
 *
 * @since 3.2.0
 */
@Unstable
class YearMonthIntervalType private() extends AtomicType {
  /**
   * Internally, values of year-month intervals are stored in `Int` values as amount of months
   * that are calculated by the formula:
   *   -/+ (12 * YEAR + MONTH)
   */
  private[sql] type InternalType = Int

  @transient private[sql] lazy val tag = typeTag[InternalType]

  private[sql] val ordering = implicitly[Ordering[InternalType]]

  /**
   * Year-month interval values always occupy 4 bytes.
   * The YEAR field is constrained by the upper bound 178956970 to fit to `Int`.
   */
  override def defaultSize: Int = 4

  private[spark] override def asNullable: YearMonthIntervalType = this

  override def typeName: String = "year-month interval"
}

/**
 * The companion case object and its class is separated so the companion object also subclasses
 * the YearMonthIntervalType class. Otherwise, the companion object would be of type
 * "YearMonthIntervalType$" in byte code. Defined with a private constructor so the companion object
 * is the only possible instantiation.
 *
 * @since 3.2.0
 */
@Unstable
case object YearMonthIntervalType extends YearMonthIntervalType


text:
require "texttube/filterable"

module TextTube
	module Baby

		# Will transform the Queen's English into American English for use in CSS, as the current CSS standards prefer ugly words.
		# Inspired by visualidiot's SpiffingCSS (see http://spiffingcss.com/)
		module Spiffing
			extend TextTube::Filterable

			filter_with :spiffing do |text|
				run text
			end

			# The dictionary.
			DICTIONARY = {
				# Queen's English	  # Primitive English from our stateside
														# friends from across the pond.
				'colour'        => 'color',
				'grey'          => 'gray',
				'!please'       => '!important',
				'transparency'  => 'opacity',
				'centre'        => 'center',
				'plump'         => 'bold',
				'photograph'    => 'image',
				'capitalise'    => 'capitalize'
			}

			# @param [String] content
			# @param [Hash] options
			def self.run( content, options={})
				ugly_child = content.dup

				DICTIONARY.each do |english, ugly|
					ugly_child.sub! english, ugly
				end
				ugly_child
			end
		end
	end
end


text:
module ActiveadminSelleoCms
  class Attachment < ActiveadminSelleoCms::Asset
    has_attached_file :data,
                      :url  => "/system/cms/attachments/:id/:style_:basename.:extension",
                      :path => ":rails_root/public/system/cms/attachments/:id/:style_:basename.:extension"

    validates_attachment_size :data, :less_than => 10.megabytes
    validates_attachment_presence :data

    attr_protected :id
  end
end


text:
const SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s+(\S+)\s+\*\//mg

export default (maybeCSS: ?string): Array<Object> => {
  const css = `${maybeCSS || ''}` // Definitely a string, and a clone
  const existingComponents = []
  css.replace(SC_COMPONENT_ID, (match, componentId, matchIndex) => {
    existingComponents.push({ componentId, matchIndex })
    return match
  })
  return existingComponents.map(({ componentId, matchIndex }, i) => {
    const nextComp = existingComponents[i + 1]
    const cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex)
    return { componentId, cssFromDOM }
  })
}


text:
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_exception

from nssrc.com.citrix.netscaler.nitro.util.nitro_util import nitro_util

class authenticationwebauthpolicy_authenticationvserver_binding(base_resource) :
	""" Binding class showing the authenticationvserver that can be bound to authenticationwebauthpolicy.
	"""
	def __init__(self) :
		self._boundto = ""
		self._priority = 0
		self._activepolicy = 0
		self._name = ""
		self.___count = 0

	@property
	def boundto(self) :
		"""The entity name to which policy is bound.
		"""
		try :
			return self._boundto
		except Exception as e:
			raise e

	@boundto.setter
	def boundto(self, boundto) :
		"""The entity name to which policy is bound.
		"""
		try :
			self._boundto = boundto
		except Exception as e:
			raise e

	@property
	def name(self) :
		"""Name of the WebAuth policy.
Minimum length =  1.
		"""
		try :
			return self._name
		except Exception as e:
			raise e

	@name.setter
	def name(self, name) :
		"""Name of the WebAuth policy.
Minimum length =  1
		"""
		try :
			self._name = name
		except Exception as e:
			raise e

	@property
	def priority(self) :
		try :
			return self._priority
		except Exception as e:
			raise e

	@property
	def activepolicy(self) :
		try :
			return self._activepolicy
		except Exception as e:
			raise e

	def _get_nitro_response(self, service, response) :
		""" converts nitro response into object and returns the object array in case of get request.
		"""
		try :
			result = service.payload_formatter.string_to_resource(authenticationwebauthpolicy_authenticationvserver_binding_response, response, self.__class__.__name__)
			if(result.errorcode != 0) :
				if (result.errorcode == 444) :
					service.clear_session(self)
				if result.severity :
					if (result.severity == "ERROR") :
						raise nitro_exception(result.errorcode, str(result.message), str(result.severity))
				else :
					raise nitro_exception(result.errorcode, str(result.message), str(result.severity))
			return result.authenticationwebauthpolicy_authenticationvserver_binding
		except Exception as e :
			raise e

	def _get_object_name(self) :
		""" Returns the value of object identifier argument
		"""
		try :
			if (self.name) :
				return str(self.name)
			return None
		except Exception as e :
			raise e

	@classmethod
	def get(cls, service, name) :
		""" Use this API to fetch authenticationwebauthpolicy_authenticationvserver_binding resources.
		"""
		try :
			obj = authenticationwebauthpolicy_authenticationvserver_binding()
			obj.name = name
			response = obj.get_resources(service)
			return response
		except Exception as e:
			raise e

	@classmethod
	def get_filtered(cls, service, name, filter_) :
		""" Use this API to fetch filtered set of authenticationwebauthpolicy_authenticationvserver_binding resources.
		Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
		"""
		try :
			obj = authenticationwebauthpolicy_authenticationvserver_binding()
			obj.name = name
			option_ = options()
			option_.filter = filter_
			response = obj.getfiltered(service, option_)
			return response
		except Exception as e:
			raise e

	@classmethod
	def count(cls, service, name) :
		""" Use this API to count authenticationwebauthpolicy_authenticationvserver_binding resources configued on NetScaler.
		"""
		try :
			obj = authenticationwebauthpolicy_authenticationvserver_binding()
			obj.name = name
			option_ = options()
			option_.count = True
			response = obj.get_resources(service, option_)
			if response :
				return response[0].__dict__['___count']
			return 0
		except Exception as e:
			raise e

	@classmethod
	def count_filtered(cls, service, name, filter_) :
		""" Use this API to count the filtered set of authenticationwebauthpolicy_authenticationvserver_binding resources.
		Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
		"""
		try :
			obj = authenticationwebauthpolicy_authenticationvserver_binding()
			obj.name = name
			option_ = options()
			option_.count = True
			option_.filter = filter_
			response = obj.getfiltered(service, option_)
			if response :
				return response[0].__dict__['___count']
			return 0
		except Exception as e:
			raise e

class authenticationwebauthpolicy_authenticationvserver_binding_response(base_response) :
	def __init__(self, length=1) :
		self.authenticationwebauthpolicy_authenticationvserver_binding = []
		self.errorcode = 0
		self.message = ""
		self.severity = ""
		self.sessionid = ""
		self.authenticationwebauthpolicy_authenticationvserver_binding = [authenticationwebauthpolicy_authenticationvserver_binding() for _ in range(length)]


text:
#pragma once

#include <vector>
#include <set>
#include <map>

#include "drwnBase.h"
#include "drwnTableFactor.h"
#include "drwnTableFactorMapping.h"

// drwnFactorOperation class -----------------------------------------------
//! Base class for implementing various operations on table factors. The
//! derived classes store mappings between factor entries making them very
//! fast for iterative algorithms.

class drwnFactorOperation {
 protected:
    drwnTableFactor *_target;

 public:
    drwnFactorOperation(drwnTableFactor *target);
    drwnFactorOperation(const drwnFactorOperation& op);
    virtual ~drwnFactorOperation();

    //! peform the factor operation on the target
    virtual void execute() = 0;

    //! return a pointer to the target factor
    inline drwnTableFactor *target() const { return _target; }

 protected:
    //! initialize mappings and target factor (with right set of
    //! variables, unless given, e.g. for marginalization)
    virtual void initialize() { /* default: do nothing */ };
    //! check that the target is not empty and has the right set of
    //! variables for this operation
    virtual bool checkTarget() { /* default: true */ return true; }
};

// drwnFactorUnaryOp class -------------------------------------------------
//! Base class for implementing unary factor operations.

class drwnFactorUnaryOp : public drwnFactorOperation {
 protected:
    const drwnTableFactor * const _operandA;
    drwnTableFactorMapping _mappingA;

 public:
    drwnFactorUnaryOp(drwnTableFactor *target, const drwnTableFactor *A);
    drwnFactorUnaryOp(const drwnFactorUnaryOp &op);
    ~drwnFactorUnaryOp();

 protected:
    void initialize();
    bool checkTarget();
};

// drwnFactorBinaryOp class ------------------------------------------------
//! Base class for implementing binary factor operations.

class drwnFactorBinaryOp : public drwnFactorOperation {
 protected:
    const drwnTableFactor * const _operandA;
    const drwnTableFactor * const _operandB;

    drwnTableFactorMapping _mappingA;
    drwnTableFactorMapping _mappingB;

 public:
    drwnFactorBinaryOp(drwnTableFactor *target,
	const drwnTableFactor *A, const drwnTableFactor *B);
    drwnFactorBinaryOp(const drwnFactorBinaryOp &op);
    ~drwnFactorBinaryOp();

 protected:
    void initialize();
    bool checkTarget();
};

// drwnFactorNAryOp class --------------------------------------------------
//! Base class for implementing n-ary factor operations.

class drwnFactorNAryOp : public drwnFactorOperation {
 protected:
    std::vector<const drwnTableFactor *> _factors;
    std::vector<drwnTableFactorMapping> _mappings;

 public:
    drwnFactorNAryOp(drwnTableFactor *target,
	const drwnTableFactor *A, const drwnTableFactor *B);
    drwnFactorNAryOp(drwnTableFactor *target,
	const std::vector<const drwnTableFactor *>& A);
    drwnFactorNAryOp(const drwnFactorNAryOp &phi);
    ~drwnFactorNAryOp();

 protected:
    void initialize();
    bool checkTarget();
};

// drwnFactorAtomicOp class ------------------------------------------------
//! Executes an atomic operation by executing a sequence of factor operations.

class drwnFactorAtomicOp : public drwnFactorOperation {
 protected:
    //! factor operations are owned by object (i.e., they will be deleted when
    //! the object is destroyed)
    std::vector<drwnFactorOperation *> _computations;

 public:
    drwnFactorAtomicOp(drwnFactorOperation *op);
    drwnFactorAtomicOp(const std::vector<drwnFactorOperation *>& ops);
    ~drwnFactorAtomicOp();

    void execute();

    void addOperation(drwnFactorOperation *op);
};

// drwnFactorCopyOp class --------------------------------------------------
//! Copy one factor onto another.

class drwnFactorCopyOp : public drwnFactorOperation {
 protected:
    const drwnTableFactor * const _operandA;
    drwnTableFactorMapping _mappingA;

 public:
    drwnFactorCopyOp(drwnTableFactor *target, const drwnTableFactor *A);
    drwnFactorCopyOp(const drwnFactorCopyOp& op);
    ~drwnFactorCopyOp();

    void execute();

 protected:
    void initialize();
    bool checkTarget();
};

// drwnFactorProductOp class -----------------------------------------------
//! Multiply two or more factors together.

class drwnFactorProductOp : public drwnFactorNAryOp {
 public:
    drwnFactorProductOp(drwnTableFactor *target,
	const drwnTableFactor *A, const drwnTableFactor *B);
    drwnFactorProductOp(drwnTableFactor *target,
	const std::vector<const drwnTableFactor *>& A);
    drwnFactorProductOp(const drwnFactorProductOp &op);
    ~drwnFactorProductOp();

    void execute();
};

// drwnFactorDivideOp class ------------------------------------------------
//! Divide one factor by another.

class drwnFactorDivideOp : public drwnFactorBinaryOp {
 public:
    drwnFactorDivideOp(drwnTableFactor *target,
	const drwnTableFactor *A, const drwnTableFactor *B);
    drwnFactorDivideOp(const drwnFactorDivideOp &op);
    ~drwnFactorDivideOp();

    void execute();
};

// drwnFactorAdditionOp class ----------------------------------------------
//! Add two or more factors together.

class drwnFactorAdditionOp : public drwnFactorNAryOp {
 public:
    drwnFactorAdditionOp(drwnTableFactor *target,
	const drwnTableFactor *A, const drwnTableFactor *B);
    drwnFactorAdditionOp(drwnTableFactor *target,
	const std::vector<const drwnTableFactor *>& A);
    drwnFactorAdditionOp(const drwnFactorAdditionOp &op);
    ~drwnFactorAdditionOp();

    void execute();
};

// drwnFactorSubtractOp class -----------------------------------------------
//! Subtract one factor from another.

class drwnFactorSubtractOp : public drwnFactorBinaryOp {
 public:
    drwnFactorSubtractOp(drwnTableFactor *target,
	const drwnTableFactor *A, const drwnTableFactor *B);
    drwnFactorSubtractOp(const drwnFactorSubtractOp &op);
    ~drwnFactorSubtractOp();

    void execute();
};

// drwnFactorWeightedSumOp class --------------------------------------------
//! Add a weighted combination of factors.

class drwnFactorWeightedSumOp : public drwnFactorBinaryOp {
 protected:
    double _weightA;
    double _weightB;

 public:
    drwnFactorWeightedSumOp(drwnTableFactor *target, const drwnTableFactor *A,
        const drwnTableFactor *B, double wA = 1.0, double wB = 1.0);
    drwnFactorWeightedSumOp(const drwnFactorWeightedSumOp &op);
    ~drwnFactorWeightedSumOp();

    void execute();
};

// drwnFactorPlusEqualsOp class ---------------------------------------------
//! Add one (weighted) factor to another inline.

class drwnFactorPlusEqualsOp : public drwnFactorUnaryOp {
 protected:
    double _weightA;

 public:
    drwnFactorPlusEqualsOp(drwnTableFactor *target, const drwnTableFactor *A,
        double wA = 1.0);
    drwnFactorPlusEqualsOp(const drwnFactorPlusEqualsOp &op);
    ~drwnFactorPlusEqualsOp();

    void execute();
};

// drwnFactorMinusEqualsOp class ---------------------------------------------
//! Subtract one (weighted) factor from another inline.

class drwnFactorMinusEqualsOp : public drwnFactorUnaryOp {
 protected:
    double _weightA;

 public:
    drwnFactorMinusEqualsOp(drwnTableFactor *target, const drwnTableFactor *A,
        double wA = 1.0);
    drwnFactorMinusEqualsOp(const drwnFactorMinusEqualsOp &op);
    ~drwnFactorMinusEqualsOp();

    void execute();
};

// drwnFactorTimesEqualsOp class --------------------------------------------
//! Multiply one factor by another inline.

class drwnFactorTimesEqualsOp : public drwnFactorUnaryOp {
 public:
    drwnFactorTimesEqualsOp(drwnTableFactor *target, const drwnTableFactor *A);
    drwnFactorTimesEqualsOp(const drwnFactorTimesEqualsOp &op);
    ~drwnFactorTimesEqualsOp();

    void execute();
};

// drwnFactorMarginalizeOp class --------------------------------------------
//! Marginalize out one or more variables in a factor.

class drwnFactorMarginalizeOp : public drwnFactorOperation {
 protected:
    const drwnTableFactor * const _operandA;
    drwnTableFactorMapping _mappingA;

 public:
    drwnFactorMarginalizeOp(drwnTableFactor *target,
	const drwnTableFactor *A);
    drwnFactorMarginalizeOp(drwnTableFactor *target,
	const drwnTableFactor *A, int v);
    drwnFactorMarginalizeOp(drwnTableFactor *target,
	const drwnTableFactor *A, const std::set<int>& v);
    drwnFactorMarginalizeOp(const drwnFactorMarginalizeOp &op);
    ~drwnFactorMarginalizeOp();

    void execute();

 protected:
    bool checkTarget();
};

// drwnFactorMaximizeOp class -----------------------------------------------
//! Maximize over one or more variables in a factor.

class drwnFactorMaximizeOp : public drwnFactorOperation {
 protected:
    const drwnTableFactor * const _operandA;
    drwnTableFactorMapping _mappingA;

 public:
    drwnFactorMaximizeOp(drwnTableFactor *target,
	const drwnTableFactor *A);
    drwnFactorMaximizeOp(drwnTableFactor *target,
	const drwnTableFactor *A, int v);
    drwnFactorMaximizeOp(drwnTableFactor *target,
	const drwnTableFactor *A, const std::set<int>& v);
    drwnFactorMaximizeOp(const drwnFactorMaximizeOp &op);
    ~drwnFactorMaximizeOp();

    void execute();

 protected:
    bool checkTarget();
};

// drwnFactorMinimizeOp class ----------------------------------------------
//! Minimize over one or more variables in a factor.

class drwnFactorMinimizeOp : public drwnFactorOperation {
 protected:
    const drwnTableFactor * const _operandA;
    drwnTableFactorMapping _mappingA;

 public:
    drwnFactorMinimizeOp(drwnTableFactor *target,
	const drwnTableFactor *A);
    drwnFactorMinimizeOp(drwnTableFactor *target,
	const drwnTableFactor *A, int v);
    drwnFactorMinimizeOp(drwnTableFactor *target,
	const drwnTableFactor *A, const std::set<int>& v);
    drwnFactorMinimizeOp(const drwnFactorMinimizeOp &op);
    ~drwnFactorMinimizeOp();

    void execute();

 protected:
    bool checkTarget();
};

// drwnFactorReduceOp class ------------------------------------------------
//! Reduce factor by oberving the value of one or more variables.

class drwnFactorReduceOp : public drwnFactorOperation {
 protected:
    const drwnTableFactor * const _operandA;
    drwnPartialAssignment _assignment;

 public:
    drwnFactorReduceOp(drwnTableFactor *target,
	const drwnTableFactor *A, int var, int val);
    drwnFactorReduceOp(drwnTableFactor *target,
	const drwnTableFactor *A, const drwnPartialAssignment& assignment);
    drwnFactorReduceOp(const drwnFactorReduceOp &op);
    ~drwnFactorReduceOp();

    void execute();

 protected:
    bool checkTarget();
};

// drwnFactorNormalizeOp class ---------------------------------------------
//! Normalize all the entries in a factor to sum to one. Assumes non-negative
//! entries.

class drwnFactorNormalizeOp : public drwnFactorOperation {
 public:
    drwnFactorNormalizeOp(drwnTableFactor *target);
    ~drwnFactorNormalizeOp();

    void execute();

 protected:
    bool checkTarget();
};

// drwnFactorExpAndNormalizeOp class ---------------------------------------
//! Exponentiate and normalize all the entries in a factor to sum to one.

class drwnFactorExpAndNormalizeOp : public drwnFactorOperation {
 public:
    drwnFactorExpAndNormalizeOp(drwnTableFactor *target);
    ~drwnFactorExpAndNormalizeOp();

    void execute();

 protected:
    bool checkTarget();
};

// drwnFactorLogNormalizeOp class -------------------------------------------
//! Shift all the entries in a factor so that the maximum is zero.

class drwnFactorLogNormalizeOp : public drwnFactorOperation {
 public:
    drwnFactorLogNormalizeOp(drwnTableFactor *target);
    ~drwnFactorLogNormalizeOp();

    void execute();

 protected:
    bool checkTarget();
};


text:
.. .............................................................................
..
..  This file is part of the Jancy toolkit.
..
..  Jancy is distributed under the MIT license.
..  For details see accompanying license.txt file,
..  the public copy of which is also available at:
..  http://tibbo.com/downloads/archive/jancy/license.txt
..
.. .............................................................................

Jancy Documentation Index
=========================

Jancy is *the first and only* scripting language with **safe pointer arithmetics**, high level of ABI and source **compatibility with C**, support for spreadsheet-like **reactive programming**, built-in generator of **incremental lexers/scanners**, **dynamic structures** with array fields of non-constant sizes, **dual error handling model** which allows you to choose between error-code checks and throw semantics at each *call-site*, and a lot of other unique and really useful features.

Follow the links below for additional information.

* `Jancy Language Manual <language/index.html>`_
* `Jancy Standard Library Reference <stdlib/index.html>`_
* `Jancy C API Reference <api/index.html>`_
* `Jancy Compiler Overivew <compiler/index.html>`_
* `Jancy Grammar Reference <grammar/index.html>`_
* `Jancy Build Guide <build-guide/index.html>`_


text:
module.exports = function (grunt) {
  'use strict'

  grunt.loadNpmTasks('grunt-electron-installer')

  grunt.registerTask('create-windows-distributable', 'Builds a distributable for Windows', function () {
    var buildOptions

    buildOptions = grunt.option('buildOptions')

    grunt.extendConfig({
      'create-windows-installer': {
        x64: {
          appDirectory: 'builds/' + buildOptions.applicationName + '-win32-x64',
          outputDirectory: buildOptions.releaseDirectory + '/win32/' + buildOptions.applicationName + '-setup',
          authors: buildOptions.authors,
          exe: buildOptions.applicationName + '.exe'
        }
      }
    })

    if (process.platform !== 'win32') {
      grunt.log.warn('Skipping creating win32 distributable because the current platform is not win32')
      return
    }

    if (buildOptions.platform === 'all' || buildOptions.platform === 'win32') {
      grunt.task.run('create-windows-installer:x64')
    }
  })
}