text:
<?php

namespace phpDocumentor\Reflection\DocBlock\Tag;

use phpDocumentor\Reflection\DocBlock\Tag;

/**
 * Reflection class for a @method in a Docblock.
 *
 * @author  Mike van Riel <mike.vanriel@naenius.com>
 * @license http://www.opensource.org/licenses/mit-license.php MIT
 * @link    http://phpdoc.org
 */
class MethodTag extends ReturnTag {

    /** @var string */
    protected $method_name = '';

    /** @var string */
    protected $arguments = '';

    /** @var bool */
    protected $isStatic = false;

    /**
     * {@inheritdoc}
     */
    public function getContent() {
        if (null === $this->content) {
            $this->content = '';
            if ($this->isStatic) {
                $this->content .= 'static ';
            }
            $this->content .= $this->type .
                    " {$this->method_name}({$this->arguments}) " .
                    $this->description;
        }

        return $this->content;
    }

    /**
     * {@inheritdoc}
     */
    public function setContent($content) {
        Tag::setContent($content);
        // 1. none or more whitespace
        // 2. optionally the keyword "static" followed by whitespace
        // 3. optionally a word with underscores followed by whitespace : as
        //    type for the return value
        // 4. then optionally a word with underscores followed by () and
        //    whitespace : as method name as used by phpDocumentor
        // 5. then a word with underscores, followed by ( and any character
        //    until a ) and whitespace : as method name with signature
        // 6. any remaining text : as description
        if (preg_match(
                        '/^
                # Static keyword
                # Declates a static method ONLY if type is also present
                (?:
                    (static)
                    \s+
                )?
                # Return type
                (?:
                    ([\w\|_\\\\]+)
                    \s+
                )?
                # Legacy method name (not captured)
                (?:
                    [\w_]+\(\)\s+
                )?
                # Method name
                ([\w\|_\\\\]+)
                # Arguments
                \(([^\)]*)\)
                \s*
                # Description
                (.*)
            $/sux', $this->description, $matches
                )) {
            list(
                    ,
                    $static,
                    $this->type,
                    $this->method_name,
                    $this->arguments,
                    $this->description
                    ) = $matches;
            if ($static) {
                if (!$this->type) {
                    $this->type = 'static';
                } else {
                    $this->isStatic = true;
                }
            } else {
                if (!$this->type) {
                    $this->type = 'void';
                }
            }
            $this->parsedDescription = null;
        }

        return $this;
    }

    /**
     * Sets the name of this method.
     *
     * @param string $method_name The name of the method.
     *
     * @return $this
     */
    public function setMethodName($method_name) {
        $this->method_name = $method_name;

        $this->content = null;
        return $this;
    }

    /**
     * Retrieves the method name.
     *
     * @return string
     */
    public function getMethodName() {
        return $this->method_name;
    }

    /**
     * Sets the arguments for this method.
     *
     * @param string $arguments A comma-separated arguments line.
     *
     * @return void
     */
    public function setArguments($arguments) {
        $this->arguments = $arguments;

        $this->content = null;
        return $this;
    }

    /**
     * Returns an array containing each argument as array of type and name.
     *
     * Please note that the argument sub-array may only contain 1 element if no
     * type was specified.
     *
     * @return string[]
     */
    public function getArguments() {
        if (empty($this->arguments)) {
            return array();
        }

        $arguments = explode(',', $this->arguments);
        foreach ($arguments as $key => $value) {
            $arguments[$key] = explode(' ', trim($value));
        }

        return $arguments;
    }

    /**
     * Checks whether the method tag describes a static method or not.
     *
     * @return bool TRUE if the method declaration is for a static method, FALSE
     *     otherwise.
     */
    public function isStatic() {
        return $this->isStatic;
    }

    /**
     * Sets a new value for whether the method is static or not.
     *
     * @param bool $isStatic The new value to set.
     *
     * @return $this
     */
    public function setIsStatic($isStatic) {
        $this->isStatic = $isStatic;

        $this->content = null;
        return $this;
    }

}


text:
/* A Bison parser, made by GNU Bison 2.0.  */

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     T_graph = 258,
     T_digraph = 259,
     T_strict = 260,
     T_node = 261,
     T_edge = 262,
     T_edgeop = 263,
     T_id = 264,
     T_subgraph = 265
   };
#endif
#define T_graph 258
#define T_digraph 259
#define T_strict 260
#define T_node 261
#define T_edge 262
#define T_edgeop 263
#define T_id 264
#define T_subgraph 265

#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 37 "../../../cmd/lefty/dot2l/dotparse.y"
typedef union YYSTYPE {
    long i;
    char *s;
    void *o;
} YYSTYPE;
/* Line 1318 of yacc.c.  */
#line 63 "y.tab.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif

extern YYSTYPE yylval;

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     >

    <!--<RelativeLayout-->
        <!--android:layout_width="match_parent"-->
        <!--android:layout_height="@dimen/height_top_bar"-->
        <!--android:background="@color/top_bar_normal_bg"-->
        <!--android:gravity="center_vertical" >-->

        <!--<LinearLayout-->
            <!--android:layout_width="45dp"-->
            <!--android:layout_height="match_parent"-->
            <!--android:background="@drawable/ease_common_tab_bg"-->
            <!--android:onClick="back" >-->

            <!--<ImageView-->
                <!--android:layout_width="wrap_content"-->
                <!--android:layout_height="wrap_content"-->
                <!--android:layout_gravity="center_vertical"-->
                <!--android:layout_marginLeft="9dp"-->
                <!--android:scaleType="centerInside"-->
                <!--android:src="@drawable/backs" />-->
        <!--</LinearLayout>-->

        <!--<TextView-->
            <!--android:layout_width="wrap_content"-->
            <!--android:layout_height="wrap_content"-->
            <!--android:layout_centerInParent="true"-->
            <!--android:text="@string/The_new_group_chat"-->
            <!--android:textColor="#ffffff"-->
            <!--android:textSize="20sp" />-->

        <!--<Button-->
            <!--android:layout_width="60dp"-->
            <!--android:layout_height="wrap_content"-->
            <!--android:layout_alignParentRight="true"-->
            <!--android:layout_centerVertical="true"-->
            <!--android:background="@drawable/ease_common_tab_bg"-->
            <!--android:onClick="save"-->
            <!--android:text="@string/button_save"-->
            <!--android:textColor="#fff"-->
            <!--android:textSize="18sp" />-->
    <!--</RelativeLayout>-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        android:orientation="vertical">

        <include layout="@layout/title"/>
        <View
            android:layout_width="match_parent"
            android:layout_height="@dimen/dm016"
            android:background="@color/page_color"/>

        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">
                <!--<EditText-->
                    <!--android:id="@+id/edit_group_name"-->
                    <!--android:layout_width="match_parent"-->
                    <!--android:layout_height="39dp"-->
                    <!--android:layout_margin="10dp"-->
                    <!--android:background="@drawable/em_button_normal_shape"-->
                    <!--android:hint="@string/group_name"-->
                    <!--android:paddingLeft="5dp"-->
                    <!--android:singleLine="true"-->
                    <!--android:textSize="18sp" />-->
                <com.hyphenate.easeui.widget.EaseExpandGridView
                    android:id="@+id/gridview"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/dm040"
                    android:layout_marginRight="@dimen/dm040"
                    android:layout_marginTop="@dimen/dm024"
                    android:layout_marginBottom="@dimen/dm024"
                    android:background="@color/white"
                    android:gravity="start"
                    android:horizontalSpacing="@dimen/dm030"
                    android:listSelector="@android:color/transparent"
                    android:numColumns="4"
                    android:verticalSpacing="@dimen/dm030"
                    />
                <View
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dm016"
                    android:background="@color/page_color"/>

                <RelativeLayout
                    android:id="@+id/photo_item"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dm080">
                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="群头像"
                        android:textColor="@color/title_333"
                        android:layout_margin="@dimen/dm016"
                        android:layout_centerVertical="true"
                        android:textSize="@dimen/dm026"
                        />
                    <com.lchtime.safetyexpress.views.CircleImageView
                        android:id="@+id/civ_photo"
                        android:layout_width="@dimen/dm056"
                        android:layout_height="@dimen/dm056"
                        android:layout_alignParentRight="true"
                        android:layout_marginRight="@dimen/dm020"
                        android:src="@drawable/qun_list"
                        android:layout_centerVertical="true"/>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/dm001"
                        android:layout_marginLeft="@dimen/dm020"
                        android:layout_marginRight="@dimen/dm020"
                        android:background="@color/line"
                        android:layout_alignParentBottom="true"/>

                </RelativeLayout>

                <RelativeLayout
                    android:id="@+id/name_item"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dm080">
                    <TextView
                        android:id="@+id/name_title"
                        android:textColor="@color/title_333"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="群聊名称"
                        android:layout_margin="@dimen/dm016"
                        android:layout_centerVertical="true"
                        android:textSize="@dimen/dm026"
                        />
                    <ImageView
                        android:id="@+id/name_indicater"
                        android:layout_width="@dimen/dm016"
                        android:layout_height="@dimen/dm016"
                        android:layout_alignParentRight="true"
                        android:layout_marginRight="@dimen/dm020"
                        android:src="@drawable/right_indicator"
                        android:layout_centerVertical="true"/>

                    <TextView
                        android:id="@+id/name_content"
                        android:layout_toRightOf="@id/name_title"
                        android:layout_toLeftOf="@id/name_indicater"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="@dimen/dm010"
                        android:gravity="right"
                        android:textSize="@dimen/dm026"
                        android:textColor="@color/title_999"
                        android:singleLine="true"
                        android:layout_centerVertical="true"/>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/dm001"
                        android:layout_marginLeft="@dimen/dm020"
                        android:layout_marginRight="@dimen/dm020"
                        android:background="@color/line"
                        android:layout_alignParentBottom="true"/>

                </RelativeLayout>

                <RelativeLayout
                    android:id="@+id/invite_item"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dm080">
                    <TextView
                        android:id="@+id/invite_title"
                        android:textColor="@color/title_333"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="群介绍"
                        android:layout_margin="@dimen/dm016"
                        android:layout_centerVertical="true"
                        android:textSize="@dimen/dm026"
                        />
                    <ImageView
                        android:id="@+id/invite_indicater"
                        android:layout_width="@dimen/dm016"
                        android:layout_height="@dimen/dm016"
                        android:layout_alignParentRight="true"
                        android:layout_marginRight="@dimen/dm020"
                        android:src="@drawable/right_indicator"
                        android:layout_centerVertical="true"/>

                    <TextView
                        android:id="@+id/invite_content"
                        android:layout_toRightOf="@id/invite_title"
                        android:layout_toLeftOf="@id/invite_indicater"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="@dimen/dm010"
                        android:gravity="right"
                        android:textSize="@dimen/dm026"
                        android:textColor="@color/title_999"
                        android:singleLine="true"
                        android:layout_centerVertical="true"/>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/dm001"
                        android:layout_marginLeft="@dimen/dm020"
                        android:layout_marginRight="@dimen/dm020"
                        android:background="@color/line"
                        android:layout_alignParentBottom="true"/>

                </RelativeLayout>

                <RelativeLayout
                    android:id="@+id/hy_item"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dm080">
                    <TextView
                        android:id="@+id/hy_title"
                        android:textColor="@color/title_333"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="所属行业"
                        android:layout_margin="@dimen/dm016"
                        android:layout_centerVertical="true"
                        android:textSize="@dimen/dm026"
                        />
                    <ImageView
                        android:id="@+id/hy_indicater"
                        android:layout_width="@dimen/dm016"
                        android:layout_height="@dimen/dm016"
                        android:layout_alignParentRight="true"
                        android:layout_marginRight="@dimen/dm020"
                        android:src="@drawable/right_indicator"
                        android:layout_centerVertical="true"/>

                    <TextView
                        android:id="@+id/hy_content"
                        android:layout_toRightOf="@id/hy_title"
                        android:layout_toLeftOf="@id/hy_indicater"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="@dimen/dm010"
                        android:gravity="right"
                        android:textSize="@dimen/dm026"
                        android:textColor="@color/title_999"
                        android:singleLine="true"
                        android:layout_centerVertical="true"/>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/dm001"
                        android:layout_marginLeft="@dimen/dm020"
                        android:layout_marginRight="@dimen/dm020"
                        android:background="@color/line"
                        android:layout_alignParentBottom="true"/>

                </RelativeLayout>

                <RelativeLayout
                    android:id="@+id/addr_item"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dm080">
                    <TextView
                        android:id="@+id/addr_title"
                        android:textColor="@color/title_333"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="所属地区"
                        android:layout_margin="@dimen/dm016"
                        android:layout_centerVertical="true"
                        android:textSize="@dimen/dm026"
                        />
                    <ImageView
                        android:id="@+id/addr_indicater"
                        android:layout_width="@dimen/dm016"
                        android:layout_height="@dimen/dm016"
                        android:layout_alignParentRight="true"
                        android:layout_marginRight="@dimen/dm020"
                        android:src="@drawable/right_indicator"
                        android:layout_centerVertical="true"/>

                    <TextView
                        android:id="@+id/addr_content"
                        android:layout_toRightOf="@id/addr_title"
                        android:layout_toLeftOf="@id/addr_indicater"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="@dimen/dm010"
                        android:gravity="right"
                        android:textSize="@dimen/dm026"
                        android:textColor="@color/title_999"
                        android:singleLine="true"
                        android:layout_centerVertical="true"/>

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="@dimen/dm001"
                        android:background="@color/line"
                        android:layout_alignParentBottom="true"/>

                </RelativeLayout>

                <!--<EditText-->
                    <!--android:id="@+id/edit_group_introduction"-->
                    <!--android:layout_width="match_parent"-->
                    <!--android:layout_height="wrap_content"-->
                    <!--android:layout_marginBottom="10dp"-->
                    <!--android:layout_marginLeft="10dp"-->
                    <!--android:layout_marginRight="10dp"-->
                    <!--android:background="@drawable/em_button_normal_shape"-->
                    <!--android:gravity="top"-->
                    <!--android:hint="@string/Group_chat_profile"-->
                    <!--android:lines="5"-->
                    <!--android:paddingLeft="5dp"-->
                    <!--android:paddingTop="5dp"-->
                    <!--android:textSize="18sp" />-->

                <!--<LinearLayout -->
                    <!--android:layout_width="match_parent"-->
                   <!--android:layout_height="39dp"-->
                    <!--android:layout_marginBottom="10dp"-->
                    <!--android:layout_marginLeft="10dp"-->
                    <!--android:layout_marginRight="10dp"-->
                    <!--android:background="@drawable/em_button_normal_shape"-->
                    <!-->-->
                    <!--<TextView -->
                        <!--android:layout_marginLeft="5dp"-->
                        <!--android:layout_width="wrap_content"-->
                        <!--android:layout_height="wrap_content"-->
                        <!--android:text="@string/Whether_the_public"-->
                        <!--android:textColor="#333"-->
                        <!--android:layout_gravity="center_vertical"-->
                        <!--android:textSize="18sp"-->
                        <!--android:layout_weight="1"-->
                        <!--/>-->
                    <!---->
                    <!--<CheckBox -->
                        <!--android:id="@+id/cb_public"-->
                        <!--android:layout_width="wrap_content"-->
                        <!--android:layout_height="wrap_content"-->
                        <!--android:layout_weight="0"-->
                        <!--android:layout_gravity="center_vertical"-->
                        <!--android:button="@drawable/em_checkbox_bg_selector"-->
                        <!--/>-->
                    <!---->
                <!--</LinearLayout>-->

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dm100"
                    >
                    <TextView
                        android:layout_marginLeft="@dimen/dm020"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:text="群组权限"
                        android:textColor="@color/title_333"
                        android:layout_gravity="center_vertical"
                        android:textSize="@dimen/dm026"

                        />
                    <CheckBox
                        android:id="@+id/cb_public"
                        android:layout_centerVertical="true"
                        android:layout_marginLeft="@dimen/dm300"
                        android:layout_width="@dimen/dm072"
                        android:layout_height="@dimen/dm032"
                        android:background="@drawable/sel_toggle"
                        android:button="@null" />
                    <TextView
                        android:id="@+id/private_text"
                        android:layout_toRightOf="@id/cb_public"
                        android:layout_marginLeft="@dimen/dm020"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:textColor="@color/title_999"
                        android:text="私有群"/>

                </RelativeLayout>

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dm080"
                    >
                    <TextView
                        android:layout_marginLeft="@dimen/dm020"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:text="成员邀请权限"
                        android:textColor="@color/title_333"
                        android:layout_gravity="center_vertical"
                        android:textSize="@dimen/dm026"

                        />
                    <CheckBox
                        android:id="@+id/cb_member_inviter"
                        android:layout_centerVertical="true"
                        android:layout_marginLeft="@dimen/dm300"
                        android:layout_width="@dimen/dm072"
                        android:layout_height="@dimen/dm032"
                        android:background="@drawable/sel_toggle"
                        android:button="@null" />
                    <TextView
                        android:id="@+id/invite_text"
                        android:layout_toRightOf="@id/cb_member_inviter"
                        android:layout_marginLeft="@dimen/dm020"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerVertical="true"
                        android:textColor="@color/title_999"
                        android:maxLines="2"
                        android:layout_marginRight="@dimen/dm020"
                        android:text="不允许群成员邀请其他人"/>

                </RelativeLayout>

                <TextView
                    android:id="@+id/tv_save"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dm072"
                    android:layout_marginLeft="@dimen/dm090"
                    android:layout_marginRight="@dimen/dm090"
                    android:layout_marginTop="@dimen/dm056"
                    android:layout_marginBottom="@dimen/dm056"
                    android:background="@drawable/shape_bg_pink"
                    android:gravity="center"
                    android:text="保存"
                    android:textColor="@color/white"
                    android:textSize="@dimen/dm024" />

                <!--<LinearLayout -->
                    <!--android:id="@+id/ll_open_invite"-->
                    <!--android:layout_width="match_parent"-->
                   <!--android:layout_height="39dp"-->
                    <!--android:layout_marginBottom="10dp"-->
                    <!--android:layout_marginLeft="10dp"-->
                    <!--android:layout_marginRight="10dp"-->
                    <!--android:background="@drawable/em_button_normal_shape"-->
                    <!-->-->
                    <!--<TextView -->
                        <!--android:id="@+id/second_desc"-->
                        <!--android:layout_marginLeft="5dp"-->
                        <!--android:layout_width="wrap_content"-->
                        <!--android:layout_height="wrap_content"-->
                        <!--android:text="@string/Open_group_members_invited"-->
                        <!--android:textColor="#333"-->
                        <!--android:layout_gravity="center_vertical"-->
                        <!--android:textSize="18sp"-->
                        <!--android:layout_weight="1"-->
                        <!--/>-->
                    <!---->
                    <!--<CheckBox -->
                        <!--android:id="@+id/cb_member_inviter"-->
                        <!--android:layout_width="wrap_content"-->
                        <!--android:layout_height="wrap_content"-->
                        <!--android:layout_weight="0"-->
                        <!--android:layout_gravity="center_vertical"-->
                        <!--android:button="@drawable/em_checkbox_bg_selector"-->
                        <!--/>-->
                    <!---->
                <!--</LinearLayout>-->
            </LinearLayout>

        </ScrollView>
    </LinearLayout>

    <include android:id="@+id/loading" layout="@layout/pager_loading" android:visibility="gone"/>
</RelativeLayout>


text:
    wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.6.6.zip
## unzip zip
    unzip -q sonarqube-5.6.6.zip -d /opt


text:
function varargout = spm_bias_mex(varargin)
% Function involved in bias correction - a compiled routine
%
% FORMAT [Alpha,Beta,ll, h, n] = spm_bias_mex(V,B1,B2,B3,T,[mx nh])
%   V           - a handle (spm_vol) to an image.
%   B1, B2 & B3 - basis functions in x, y and z directions
%   T           - basis function coefficients
%   mx          - maximum intensity in image
%   nh          - number of bins in histogram
%
%   Alpha       - Matrix of second derivatives of ll w.r.t. T
%   Beta        - Vector of first derivatives of ll w.r.t. T
%   ll          - log-likelihood
%   h           - Histogram of bias corrected data
%   n           - Number of voxels
%
% This mex function is called by spm_bias_estimate.m as part of a non-parametric
% bias correction algorithm. The mex function computes a histogram of the bias
% corrected (according to latest estimates of coefficients) image in order to
% compute the log-likelihood and its first and second derivatives.
%
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% John Ashburner
% $Id: spm_bias_mex.m 2696 2009-02-05 20:29:48Z guillaume $

%-This is merely the help file for the compiled routine
error('spm_bias_mex.c not compiled - see Makefile');


text:
var ClaimModel = require("../../queries/claim-model");
var PremiseLinkModel = require("../../queries/premise-link-model.js");
var ArgumentModel = require("../../queries/argument-model.js");

//TODO move this to a central point somewhere
function claimFormatter(claim) {
  let returnClaim = {
    text: claim.text,
    probability: claim.probability,
    creationDate: claim.creationDate,
    _id: claim._id,
    _key: claim._key,
    arguments: claim.arguments
  };
  return returnClaim;
}

//Plain get claim - return a list of the most recent.
//TODO: take query params
module.exports = {
  get: function() {
    return new Promise((resolve, reject) => {
      ClaimModel.getRecent().then(data => {
        let resultsArray = [];

        for (var c = 0; c < data.length; c++) {
          resultsArray.push(claimFormatter(data[c]));
        }

        resolve(resultsArray);
      });
    });
  },
  search: function(searchTerm) {
    return new Promise((resolve, reject) => {
      ClaimModel.search(searchTerm).then(data => {
        let resultsArray = [];

        for (var c = 0; c < data.length; c++) {
          resultsArray.push(claimFormatter(data[c]));
        }

        resolve(resultsArray);
      });
    });
  }
};


text:
namespace LiveAdd.Helpers
{

    using System;
    using Windows.Data.Xml.Dom;
    using Windows.UI.Notifications;

    public static class Notifier
    {
        public static void ShowNotification(string notificationMessage)
        {
            ToastTemplateType toastTemplate = ToastTemplateType.ToastText02;
            XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
            XmlNodeList toastTextElements = toastXml.GetElementsByTagName("text");
            toastTextElements[0].AppendChild(toastXml.CreateTextNode("Live Add"));
            toastTextElements[1].AppendChild(toastXml.CreateTextNode(notificationMessage));
            IXmlNode toastNode = toastXml.SelectSingleNode("/toast");
            ((XmlElement)toastNode).SetAttribute("duration", "short");
            ToastNotification toast = new ToastNotification(toastXml);
            toast.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(5);

            toast.SuppressPopup = false;
            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }
    }
}


text:
package io.dropwizard.metrics;

import com.codahale.metrics.MetricRegistry;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import io.dropwizard.lifecycle.setup.LifecycleEnvironment;
import io.dropwizard.util.Duration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * A factory for configuring the metrics sub-system for the environment.
 *

 * Configures an optional list of {@link com.codahale.metrics.ScheduledReporter reporters} with a
 * default {@link #frequency}.
 *

 * Configuration Parameters:
 *

 *

 *         Name
 *         Default
 *         Description
 *

 *

 *         frequency
 *         1 minute
 *         The frequency to report metrics. Overridable per-reporter.
 *

 *

 *         reporters
 *         No reporters.
 *         A list of {@link ReporterFactory reporters} to report metrics.
 *

 *

 */
public class MetricsFactory {
    private static final Logger LOGGER = LoggerFactory.getLogger(MetricsFactory.class);

    @Valid
    @NotNull
    private Duration frequency = Duration.minutes(1);

    @Valid
    @NotNull
    private ImmutableList<ReporterFactory> reporters = ImmutableList.of();

    @JsonProperty
    public ImmutableList<ReporterFactory> getReporters() {
        return reporters;
    }

    @JsonProperty
    public void setReporters(ImmutableList<ReporterFactory> reporters) {
        this.reporters = reporters;
    }

    @JsonProperty
    public Duration getFrequency() {
        return frequency;
    }

    @JsonProperty
    public void setFrequency(Duration frequency) {
        this.frequency = frequency;
    }

    /**
     * Configures the given lifecycle with the {@link com.codahale.metrics.ScheduledReporter
     * reporters} configured for the given registry.
     *

     * The reporters are tied in to the given lifecycle, such that their {@link #getFrequency()
     * frequency} for reporting metrics begins when the lifecycle {@link
     * io.dropwizard.lifecycle.Managed#start() starts}, and stops when the lifecycle
     * {@link io.dropwizard.lifecycle.Managed#stop() stops}.
     *
     * @param environment the lifecycle to manage the reporters.
     * @param registry the metric registry to report metrics from.
     */
    public void configure(LifecycleEnvironment environment, MetricRegistry registry) {
        for (ReporterFactory reporter : reporters) {
            try {
                final ScheduledReporterManager manager =
                        new ScheduledReporterManager(reporter.build(registry),
                                                     reporter.getFrequency().orElseGet(this::getFrequency));
                environment.manage(manager);
            } catch (Exception e) {
                LOGGER.warn("Failed to create reporter, metrics may not be properly reported.", e);
            }
        }
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("frequency", frequency)
                .add("reporters", reporters)
                .toString();
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Migrating from GtkFileSelection to GtkFileChooser</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ Reference Manual">
<link rel="up" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
<link rel="prev" href="gtk-changes-2-0.html" title="Changes from 1.2 to 2.0">
<link rel="next" href="gtkfilechooser-selection-modes.html" title="Selection Modes">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">

GTK+ Reference Manual

Migrating from GtkFileSelection to GtkFileChooser

Federico Mena-Quintero

	  <federicoximian.com>

Creating a GtkFileChooserDialog

Selection Modes

Installing a Preview widget

Installing Extra Widgets

New features

    GtkFileChooser, starting with GTK+ 2.4, is the new set of APIs for file
    selection widgets and dialogs.  Previous versions of GTK+ used GtkFileSelection,
    which has numerous problems.

    GtkFileChooser is an abstract interface that can be implemented by widgets
    that perform file selection tasks.  Two widgets in GTK+ implement this
    interface:  GtkFileChooserDialog and GtkFileChooserWidget. Most applications
    simply need to use GtkFileChooserDialog, which is a dialog box that allows the
    user to select existing files for opening them, or to pick new filenames for
    saving documents. GtkFileChooserWidget is for special applications that need to
    embed a file selection widget inside a larger window.  In the context of GTK+,
    GtkFileChooserDialog is simply a GtkDialog box with a GtkFileChooserWidget.
    inside.

Creating a GtkFileChooserDialog

      To create a GtkFileChooserDialog, you simply call gtk_file_chooser_dialog_new().
      This function is similar to gtk_dialog_new() in that it takes parameters for the
      title of the dialog box and its transient parent, as well as its
      buttons.  In addition, it takes in an argument that determines
      whether the file chooser dialog will be used for opening
      existing files or for saving to a possibly new file.

      Please see Example 42, "Typical usage" for
      how to create a simple file chooser dialog and extract the
      selected filename from it.

          Generated by GTK-Doc V1.15


text:
<?php

namespace Oro\Bundle\CalendarBundle\Tests\Unit\Form\EventListener;

use Oro\Bundle\CalendarBundle\Entity\CalendarEvent;
use Oro\Bundle\CalendarBundle\Form\EventListener\CalendarEventApiTypeSubscriber;
use Oro\Bundle\CalendarBundle\Manager\CalendarEventManager;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormInterface;

class CalendarEventApiTypeSubscriberTest extends \PHPUnit\Framework\TestCase
{
    /** @var CalendarEventManager|\PHPUnit\Framework\MockObject\MockObject */
    private $calendarEventManager;

    /** @var CalendarEventApiTypeSubscriber */
    private $calendarEventApiTypeSubscriber;

    protected function setUp(): void
    {
        $this->calendarEventManager = $this->createMock(CalendarEventManager::class);

        $this->calendarEventApiTypeSubscriber = new CalendarEventApiTypeSubscriber(
            $this->calendarEventManager
        );
    }

    public function testGetSubscribedEvents()
    {
        $this->assertEquals(
            [
                FormEvents::PRE_SUBMIT  => ['preSubmitData', 10],
                FormEvents::POST_SUBMIT  => ['postSubmitData', 10],
            ],
            CalendarEventApiTypeSubscriber::getSubscribedEvents()
        );
    }

    public function testPostSubmitDataShouldNotSetCalendarWhenNoCalendarEvent()
    {
        $form = $this->createMock(FormInterface::class);
        $event = new FormEvent($form, null);

        $form->expects($this->once())
            ->method('getData')
            ->willReturn(null);

        $this->calendarEventManager->expects($this->never())
            ->method('setCalendar');

        $this->calendarEventApiTypeSubscriber->postSubmitData($event);
    }

    public function testPostSubmitDataShouldNotSetCalendarWhenNoCalendar()
    {
        $calendarEvent = new CalendarEvent();
        $form = $this->createMock(FormInterface::class);
        $event = new FormEvent($form, $calendarEvent);

        $form->expects($this->once())
            ->method('getData')
            ->willReturn($calendarEvent);

        $calendarForm = $this->createMock(FormInterface::class);
        $form->expects($this->once())
            ->method('get')
            ->with('calendar')
            ->willReturn($calendarForm);
        $calendarForm->expects($this->once())
            ->method('getData')
            ->willReturn(null);

        $this->calendarEventManager->expects($this->never())
            ->method('setCalendar');

        $this->calendarEventApiTypeSubscriber->postSubmitData($event);
    }

    /**
     * @dataProvider testPostSubmitDataShouldSetCalendarProvider
     */
    public function testPostSubmitDataShouldSetCalendar(
        CalendarEvent $calendarEvent,
        int $calendarId,
        ?string $alias,
        string $expectedAlias
    ) {
        $form = $this->createMock(FormInterface::class);
        $event = new FormEvent($form, $calendarEvent);

        $calendarForm = $this->createMock(FormInterface::class);
        $calendarForm->expects($this->once())
            ->method('getData')
            ->willReturn($calendarId);

        $calendarAliasForm = $this->createMock(FormInterface::class);
        $calendarAliasForm->expects($this->once())
            ->method('getData')
            ->willReturn($alias);

        $form->expects($this->once())
            ->method('getData')
            ->willReturn($calendarEvent);
        $form->expects($this->exactly(2))
            ->method('get')
            ->willReturnMap([
                ['calendar', $calendarForm],
                ['calendarAlias', $calendarAliasForm],
            ]);

        $this->calendarEventManager->expects($this->once())
            ->method('setCalendar')
            ->with($calendarEvent, $expectedAlias, $calendarId);

        $this->calendarEventApiTypeSubscriber->postSubmitData($event);
    }

    public function testPostSubmitDataShouldSetCalendarProvider(): array
    {
        return [
            [
                new CalendarEvent(),
                1,
                'alias',
                'alias',
            ],
            [
                new CalendarEvent(),
                1,
                null,
                'user',
            ],
        ];
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Sydowia 12: 296 (1959)

#### Original name
Coniothyrium olivaceum var. rhois-radicantis Sacc.

### Remarks
null


text:
namespace meson {
MesonMainParts* MesonMainParts::self_ = nullptr;

MesonMainParts::MesonMainParts()
    : browser_(new Browser),
      api_(new API()),
      exit_code_(nullptr) {
  DCHECK(!self_) << "MesonMainParts already created!";
  self_ = this;
}

MesonMainParts::~MesonMainParts() {}

void MesonMainParts::PreMainMessageLoopRun(void) {
  brightray::BrowserMainParts::PreMainMessageLoopRun();

  api_->InstallBindings(MESON_OBJECT_TYPE_APP, new AppClassBinding());
  api_->InstallBindings(MESON_OBJECT_TYPE_DIALOG, new DialogClassBinding());
  api_->InstallBindings(MESON_OBJECT_TYPE_SESSION, new SessionClassBinding());
  api_->InstallBindings(MESON_OBJECT_TYPE_WINDOW, new WindowClassBinding());
  api_->InstallBindings(MESON_OBJECT_TYPE_WEB_CONTENTS, new WebContentsClassBinding());
  api_->InstallBindings(MESON_OBJECT_TYPE_MENU, new MenuClassBinding());
  api_server_ = new APIServer(*api_);
  api_server_->Start();
}
void MesonMainParts::PostMainMessageLoopRun() {
  LOG(INFO) << __PRETTY_FUNCTION__;
  brightray::BrowserMainParts::PostMainMessageLoopRun();

#if defined(OS_MACOSX)
  FreeAppDelegate();
#endif
}

bool MesonMainParts::MainMessageLoopRun(int* result_code) {
  exit_code_ = result_code;
  return brightray::BrowserMainParts::MainMessageLoopRun(result_code);
}

MesonMainParts* MesonMainParts::Get(void) {
  DCHECK(self_);
  return self_;
}
bool MesonMainParts::SetExitCode(int exit_code) {
  if (!exit_code_) {
    return false;
  }
  *exit_code_ = exit_code;
  return true;
}
int MesonMainParts::GetExitCode() const {
  return exit_code_ ? *exit_code_ : 0;
}
}


text:
#include "degradeimage.h"

#include <stdlib.h>
#include "allheaders.h"   // from leptonica

namespace tesseract {

// Rotation is +/- kRotationRange radians.
const float kRotationRange = 0.02f;
// Number of grey levels to shift by for each exposure step.
const int kExposureFactor = 16;
// Salt and pepper noise is +/- kSaltnPepper.
const int kSaltnPepper = 5;
// Min sum of width + height on which to operate the ramp.
const int kMinRampSize = 1000;

static unsigned int random_seed = 0x18273645;
#ifndef rand_r  // _MSC_VER, ANDROID
#define rand_r(random_seed) rand()
#endif  // _MSC_VER

// Degrade the pix as if by a print/copy/scan cycle with exposure > 0
// corresponding to darkening on the copier and <0 lighter and 0 not copied.
// Exposures in [-2,2] are most useful, with -3 and 3 being extreme.
// If rotation is NULL, rotation is skipped. If *rotation is non-zero, the pix
// is rotated by *rotation else it is randomly rotated and *rotation is
// modified.
// HOW IT WORKS:
// Most of the process is really dictated by the fact that the minimum
// available convolution is 3X3, which is too big really to simulate a
// good quality print/scan process. (2X2 would be better.)
// 1 pixel wide inputs are heavily smeared by the 3X3 convolution, making the
// images generally biased to being too light, so most of the work is to make
// them darker. 3 levels of thickening/darkening are achieved with 2 dilations,
// (using a greyscale erosion) one heavy (by being before convolution) and one
// light (after convolution).
// With no dilation, after covolution, the images are so light that a heavy
// constant offset is required to make the 0 image look reasonable. A simple
// constant offset multiple of exposure to undo this value is enough to achieve
// all the required lightening. This gives the advantage that exposure level 1
// with a single dilation gives a good impression of the broken-yet-too-dark
// problem that is often seen in scans.
// A small random rotation gives some varying greyscale values on the edges,
// and some random salt and pepper noise on top helps to realistically jaggy-up
// the edges.
// Finally a greyscale ramp provides a continuum of effects between exposure
// levels.
Pix* DegradeImage(Pix* input, int exposure, float* rotation) {
  Pix* pix = pixConvertTo8(input, false);
  pixDestroy(&input);
  input = pix;
  int width = pixGetWidth(input);
  int height = pixGetHeight(input);
  if (exposure >= 2) {
    // An erosion simulates the spreading darkening of a dark copy.
    // This is backwards to binary morphology,
    // see http://www.leptonica.com/grayscale-morphology.html
    pix = input;
    input = pixErodeGray(pix, 3, 3);
    pixDestroy(&pix);
  }
  // A convolution is essential to any mode as no scanner produces an
  // image as sharp as the electronic image.
  pix = pixBlockconv(input, 1, 1);
  pixDestroy(&input);
  // A small random rotation helps to make the edges jaggy in a realistic way.
  if (rotation != NULL) {
    float radians_clockwise;
    if (*rotation) {
      radians_clockwise = *rotation;
    } else {
      radians_clockwise = (2.0*rand_r(&random_seed)/RAND_MAX - 1.0) *
          kRotationRange;
    }

    input = pixRotate(pix, radians_clockwise,
                      L_ROTATE_AREA_MAP, L_BRING_IN_WHITE,
                      0, 0);
    // Rotate the boxes to match.
    *rotation = radians_clockwise;
    pixDestroy(&pix);
  } else {
    input = pix;
  }

  if (exposure >= 3 || exposure == 1) {
    // Erosion after the convolution is not as heavy as before, so it is
    // good for level 1 and in addition as a level 3.
    // This is backwards to binary morphology,
    // see http://www.leptonica.com/grayscale-morphology.html
    pix = input;
    input = pixErodeGray(pix, 3, 3);
    pixDestroy(&pix);
  }
  // The convolution really needed to be 2x2 to be realistic enough, but
  // we only have 3x3, so we have to bias the image darker or lose thin
  // strokes.
  int erosion_offset = 0;
  // For light and 0 exposure, there is no dilation, so compensate for the
  // convolution with a big darkening bias which is undone for lighter
  // exposures.
  if (exposure <= 0)
    erosion_offset = -3 * kExposureFactor;
  // Add in a general offset of the greyscales for the exposure level so
  // a threshold of 128 gives a reasonable binary result.
  erosion_offset -= exposure * kExposureFactor;
  // Add a gradual fade over the page and a small amount of salt and pepper
  // noise to simulate noise in the sensor/paper fibres and varying
  // illumination.
  l_uint32* data = pixGetData(input);
  for (int y = 0; y < height; ++y) {
    for (int x = 0; x < width; ++x) {
      int pixel = GET_DATA_BYTE(data, x);
      pixel += rand_r(&random_seed) % (kSaltnPepper*2 + 1) - kSaltnPepper;
      if (height + width > kMinRampSize)
        pixel -= (2*x + y) * 32 / (height + width);
      pixel += erosion_offset;
      if (pixel < 0)
        pixel = 0;
      if (pixel > 255)
        pixel = 255;
      SET_DATA_BYTE(data, x, pixel);
    }
    data += input->wpl;
  }
  return input;
}

}  // namespace tesseract


text:
package com.tempodb.json;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.deser.Deserializers;
import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.StdScalarSerializer;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Interval;

public class IntervalModule extends SimpleModule {

  public IntervalModule() {
    addDeserializer(Interval.class, new IntervalDeserializer());
  }

  private static class IntervalDeserializer extends StdScalarDeserializer<Interval> {
    public IntervalDeserializer() { super(Interval.class); }

    @Override
    public Interval deserialize(JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException {
      DateTimeZone timezone = DateTimeZone.forTimeZone(context.getTimeZone());
      Map<String, String> obj = parser.readValueAs(new TypeReference<Map<String, String>>() {});

      String startStr = obj.get("start");
      String endStr = obj.get("end");

      if(startStr == null) {
        throw context.mappingException("Missing 'start' field in Interval.");
      }
      if(endStr == null) {
        throw context.mappingException("Missing 'end' field in Interval.");
      }

      DateTime start = datetimeFromString(startStr, timezone, context);
      DateTime end = datetimeFromString(endStr, timezone, context);
      return new Interval(start, end);
    }
  }

  private static DateTime datetimeFromString(String str, DateTimeZone dtz, DeserializationContext ctxt) {
    if (str.length() == 0) { // [JACKSON-360]
      return null;
    }
    if (ctxt.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE))
      return new DateTime(str, dtz);
    else
      return DateTime.parse(str);
  }

  @Override
  public String getModuleName() {
    return "interval";
  }

  @Override
  public Version version() {
    return Version.unknownVersion();
  }
}


text:
package gov.va.med.lom.foundation.util;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import org.apache.commons.lang.StringUtils;

public final class CalendarUtils {

	private static Map<Integer, String>  MONTHS = null;
	private static Map<Integer, String>  DAYS   = null;
	private static List<String> YEARS  = null;
	private static List<String> YEARS_WITH_FUTURE  = null;
	private static Map<Integer, String>  HOURS  = null;
	private static Map<Integer, String>  MINUTES= null;

	private static final int MAX_FUTURE_YEAR = 2011;

	public static String getCurrentMonth() {
		Calendar cal = GregorianCalendar.getInstance();

		return String.valueOf(cal.get(Calendar.MONTH) + 1);
	}

	public static String getCurrentDay() {
		Calendar cal = GregorianCalendar.getInstance();

		return String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
	}

	public static String getCurrentYear() {
		Calendar cal = GregorianCalendar.getInstance();

		return String.valueOf(cal.get(Calendar.YEAR));
	}

	public static String getMonth(Date date) {
		if (date == null) {
			return null;
		}

		Calendar cal = GregorianCalendar.getInstance();
		cal.setTimeInMillis(date.getTime());
		return String.valueOf(cal.get(Calendar.MONTH) + 1);
	}

	public static String getDay(Date date) {
		if (date == null) {
			return null;
		}

		Calendar cal = GregorianCalendar.getInstance();
		cal.setTimeInMillis(date.getTime());
		return String.valueOf(cal.get(Calendar.DAY_OF_MONTH));
	}

	public static String getYear(Date date) {
		if (date == null) {
			return null;
		}

		Calendar cal = GregorianCalendar.getInstance();
		cal.setTimeInMillis(date.getTime());
		return String.valueOf(cal.get(Calendar.YEAR));
	}

	public static String getHours(Timestamp time) {
		if (time == null) {
			return null;
		}

		Calendar cal = GregorianCalendar.getInstance();
		cal.setTimeInMillis(time.getTime());
		// If minutes are 59, we don't want to display time
		int minutes = cal.get(Calendar.MINUTE);
		if (minutes == 59) {
			return null;
		} else {
			return String.valueOf(cal.get(Calendar.HOUR_OF_DAY));
		}
	}

	public static String getMinutes(Timestamp time) {
		if (time == null) {
			return null;
		}

		Calendar cal = GregorianCalendar.getInstance();
		cal.setTimeInMillis(time.getTime());
		// If minutes are 59, we don't want to display time
		int minutes = cal.get(Calendar.MINUTE);
		if (minutes == 59) {
			return null;
		} else {
			return String.valueOf(cal.get(Calendar.MINUTE));
		}
	}

	public static Timestamp getTimestamp(String month, String day,
			String year, String hours, String minutes) {
		if (StringUtils.isBlank(month) && StringUtils.isBlank(day)
			&& StringUtils.isBlank(year))
		{
			return null;
		}

		int iMonth = Integer.parseInt(month) - 1;
		int iDay;
		// Dates fields should be validated by now, so it's safe to default the day
		if (StringUtils.isBlank(day)) {
			iDay = 1;
		} else {
			iDay = Integer.parseInt(day);
		}
		int iYear = Integer.parseInt(year);

		Calendar cal = GregorianCalendar.getInstance();
		cal.clear();
		cal.setLenient(false);
		cal.set(Calendar.MONTH, iMonth);
		cal.set(Calendar.DAY_OF_MONTH, iDay);
		cal.set(Calendar.YEAR, iYear);
		if (!StringUtils.isBlank(hours)) {
			cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hours));
		}
		if (!StringUtils.isBlank(minutes)) {
			cal.set(Calendar.MINUTE, Integer.parseInt(minutes));
		}

		if (StringUtils.isBlank(hours) && StringUtils.isBlank(minutes)) {
			cal.set(Calendar.HOUR_OF_DAY, 23);
			cal.set(Calendar.MINUTE, 59);
		}

		return new Timestamp(cal.getTimeInMillis());
	}

	public static Date getDate(String month, String day, String year) {
		if (StringUtils.isBlank(month) && StringUtils.isBlank(day) && StringUtils.isBlank(year)) {
			return null;
		}

		int iMonth = Integer.parseInt(month) - 1;
		int iDay;
		// Dates fields should be validated by now, so it's safe to default the day
		if (StringUtils.isBlank(day)) {
			iDay = 1;
		} else {
			iDay = Integer.parseInt(day);
		}
		int iYear = Integer.parseInt(year);

		Calendar cal = GregorianCalendar.getInstance();
		cal.clear();
		cal.setLenient(false);
		cal.set(Calendar.MONTH, iMonth);
		cal.set(Calendar.DAY_OF_MONTH, iDay);
		cal.set(Calendar.YEAR, iYear);

		return new Date(cal.getTimeInMillis());
	}

	public static Date getDate(int month, int day, int year) {
		return getDate(month, day, year, 0, 0, 0, 0);
	}
	public static Date getDate(int month, int day, int year, int hour,
		int minute)
	{
		return getDate(month, day, year, hour, minute, 0, 0);
	}
	public static Date getDate(int month, int day, int year,
		int hour, int minute, int second, int milliSecond)
	{
		java.util.Calendar calendar = java.util.Calendar.getInstance();
		calendar.set(Calendar.YEAR, year);
		calendar.set(Calendar.MONTH, month);
		calendar.set(Calendar.DAY_OF_MONTH, day);
		calendar.set(Calendar.HOUR, hour);
		calendar.set(Calendar.MINUTE, minute);
		calendar.set(Calendar.SECOND, second);
		calendar.set(Calendar.MILLISECOND, milliSecond);
		return calendar.getTime();
	}

	public static String getDateAsMDY(Date date) {
		if (date == null) {
			return null;
		}
		return new SimpleDateFormat("MM/dd/yyyy").format(date);
	}

   /**
    * Format date as "Sat 05/06/2006"
    * @param date
    * @return
    */
	public static String getDateAsDayMDY(Date date) {
		if (date == null) {
			return null;
		}
		return new SimpleDateFormat("EEE").format(date) + " " + getDateAsMDY(date);
	}

	public static String getTime(Date date) {
		if (date == null) {
			return null;
		}

		// If minutes are 59, we don't want to display date
		Calendar cal = GregorianCalendar.getInstance();
		cal.setTimeInMillis(date.getTime());
		int minutes = cal.get(Calendar.MINUTE);
		if (minutes == 59) {
			return null;
		}

		return new SimpleDateFormat("HH:mm").format(date);
	}

	public static Map getMonths() {
		if( MONTHS == null ) {
	        MONTHS = new TreeMap<Integer, String>();
	        MONTHS.put(new Integer(1), "Jan");
	        MONTHS.put(new Integer(2), "Feb");
	        MONTHS.put(new Integer(3), "Mar");
	        MONTHS.put(new Integer(4), "Apr");
	        MONTHS.put(new Integer(5), "May");
	        MONTHS.put(new Integer(6), "Jun");
	        MONTHS.put(new Integer(7), "Jul");
	        MONTHS.put(new Integer(8), "Aug");
	        MONTHS.put(new Integer(9), "Sep");
	        MONTHS.put(new Integer(10), "Oct");
	        MONTHS.put(new Integer(11), "Nov");
	        MONTHS.put(new Integer(12), "Dec");
		}

        return MONTHS;
	}

	public static Map getDays() {
		if( DAYS == null ) {
	        DAYS = new TreeMap<Integer, String>();
	        for (int i = 1; i <= 31; i++) {
	            if (i < 10) {
	                DAYS.put(new Integer(i), "0"+i);
	            } else {
	                DAYS.put(new Integer(i), String.valueOf(i));
	            }
	        }
		}

        return DAYS;
	}

	public static List getYears() {
		if( YEARS == null ) {
	        YEARS = new ArrayList<String>();
	        int startYear = Integer.parseInt(CalendarUtils.getCurrentYear());
	        for (int i = startYear; i >= getFirstYear(); i--) {
	            YEARS.add(String.valueOf(i));
	        }
		}

		return YEARS;
	}

	public static List getFutureYears() {
		if( YEARS_WITH_FUTURE == null ) {
			YEARS_WITH_FUTURE = new ArrayList<String>();

	        for (int i = MAX_FUTURE_YEAR; i >= getFirstYear(); i--) {
				YEARS_WITH_FUTURE.add(String.valueOf(i));
	        }
		}

		return YEARS_WITH_FUTURE;
	}

	public static int getFirstYear() {
		return 1895;
	}

	public static Map getHours() {
		if( HOURS == null ) {
	        HOURS = new TreeMap<Integer, String>();
	        for (int i = 0; i <= 23; i++) {
	            if (i < 10) {
	            	HOURS.put(new Integer(i), "0"+i);
	            } else {
	            	HOURS.put(new Integer(i), String.valueOf(i));
	            }
	        }
		}
		return HOURS;
	}

	public static Map getMinutes() {
		if( MINUTES == null ) {
	        MINUTES = new TreeMap<Integer, String>();
	        MINUTES.put(new Integer(0), "00");
	        MINUTES.put(new Integer(10), "10");
	        MINUTES.put(new Integer(20), "20");
	        MINUTES.put(new Integer(30), "30");
	        MINUTES.put(new Integer(40), "40");
	        MINUTES.put(new Integer(50), "50");
		}

		return MINUTES;
	}

}


text:
//=================================================================================================

//=================================================================================================

#ifndef _BLAZE_MATH_STRICTLYUPPERMATRIX_H_
#define _BLAZE_MATH_STRICTLYUPPERMATRIX_H_

//*************************************************************************************************
// Includes
//*************************************************************************************************

#include <cmath>
#include <vector>
#include <blaze/math/Aliases.h>
#include <blaze/math/adaptors/StrictlyUpperMatrix.h>
#include <blaze/math/adaptors/UniUpperMatrix.h>
#include <blaze/math/adaptors/UpperMatrix.h>
#include <blaze/math/constraints/DenseMatrix.h>
#include <blaze/math/constraints/Resizable.h>
#include <blaze/math/constraints/SparseMatrix.h>
#include <blaze/math/DenseMatrix.h>
#include <blaze/math/Exception.h>
#include <blaze/math/SparseMatrix.h>
#include <blaze/math/typetraits/IsDenseMatrix.h>
#include <blaze/math/StrictlyLowerMatrix.h>
#include <blaze/util/FalseType.h>
#include <blaze/util/Indices.h>
#include <blaze/util/Random.h>
#include <blaze/util/TrueType.h>
#include <blaze/util/Types.h>

namespace blaze {

//=================================================================================================
//
//  RAND SPECIALIZATION
//
//=================================================================================================

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Specialization of the Rand class template for StrictlyUpperMatrix.
// \ingroup random
//
// This specialization of the Rand class creates random instances of StrictlyUpperMatrix.
*/
template< typename MT  // Type of the adapted matrix
        , bool SO      // Storage order of the adapted matrix
        , bool DF >    // Numeric flag
class Rand< StrictlyUpperMatrix<MT,SO,DF> >
{
 public:
   //**Generate functions**************************************************************************
   /*!\name Generate functions */
   //@{
   inline const StrictlyUpperMatrix<MT,SO,DF> generate() const;
   inline const StrictlyUpperMatrix<MT,SO,DF> generate( size_t n ) const;
   inline const StrictlyUpperMatrix<MT,SO,DF> generate( size_t n, size_t nonzeros ) const;

   template< typename Arg >
   inline const StrictlyUpperMatrix<MT,SO,DF> generate( const Arg& min, const Arg& max ) const;

   template< typename Arg >
   inline const StrictlyUpperMatrix<MT,SO,DF> generate( size_t n, const Arg& min, const Arg& max ) const;

   template< typename Arg >
   inline const StrictlyUpperMatrix<MT,SO,DF> generate( size_t n, size_t nonzeros,
                                                   const Arg& min, const Arg& max ) const;
   //@}
   //**********************************************************************************************

   //**Randomize functions*************************************************************************
   /*!\name Randomize functions */
   //@{
   inline void randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix ) const;
   inline void randomize( StrictlyUpperMatrix<MT,false,DF>& matrix, size_t nonzeros ) const;
   inline void randomize( StrictlyUpperMatrix<MT,true,DF>& matrix, size_t nonzeros ) const;

   template< typename Arg >
   inline void randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix, const Arg& min, const Arg& max ) const;

   template< typename Arg >
   inline void randomize( StrictlyUpperMatrix<MT,false,DF>& matrix, size_t nonzeros,
                          const Arg& min, const Arg& max ) const;

   template< typename Arg >
   inline void randomize( StrictlyUpperMatrix<MT,true,DF>& matrix, size_t nonzeros,
                          const Arg& min, const Arg& max ) const;
   //@}
   //**********************************************************************************************

 private:
   //**Randomize functions*************************************************************************
   /*!\name Randomize functions */
   //@{
   inline void randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix, TrueType  ) const;
   inline void randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix, FalseType ) const;

   template< typename Arg >
   inline void randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix, const Arg& min, const Arg& max, TrueType ) const;

   template< typename Arg >
   inline void randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix, const Arg& min, const Arg& max, FalseType ) const;
   //@}
   //**********************************************************************************************
};
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Generation of a random StrictlyUpperMatrix.
//
// \return The generated random matrix.
*/
template< typename MT  // Type of the adapted matrix
        , bool SO      // Storage order of the adapted matrix
        , bool DF >    // Numeric flag
inline const StrictlyUpperMatrix<MT,SO,DF> Rand< StrictlyUpperMatrix<MT,SO,DF> >::generate() const
{
   BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE_TYPE( MT );

   StrictlyUpperMatrix<MT,SO,DF> matrix;
   randomize( matrix );
   return matrix;
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Generation of a random StrictlyUpperMatrix.
//
// \param n The number of rows and columns of the random matrix.
// \return The generated random matrix.
*/
template< typename MT  // Type of the adapted matrix
        , bool SO      // Storage order of the adapted matrix
        , bool DF >    // Numeric flag
inline const StrictlyUpperMatrix<MT,SO,DF>
   Rand< StrictlyUpperMatrix<MT,SO,DF> >::generate( size_t n ) const
{
   BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE( MT );

   StrictlyUpperMatrix<MT,SO,DF> matrix( n );
   randomize( matrix );
   return matrix;
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Generation of a random StrictlyUpperMatrix.
//
// \param n The number of rows and columns of the random matrix.
// \param nonzeros The number of non-zero elements of the random matrix.
// \return The generated random matrix.
// \exception std::invalid_argument Invalid number of non-zero elements.
*/
template< typename MT  // Type of the adapted matrix
        , bool SO      // Storage order of the adapted matrix
        , bool DF >    // Numeric flag
inline const StrictlyUpperMatrix<MT,SO,DF>
   Rand< StrictlyUpperMatrix<MT,SO,DF> >::generate( size_t n, size_t nonzeros ) const
{
   BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE    ( MT );
   BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( MT );

   if( nonzeros > StrictlyUpperMatrix<MT,SO,DF>::maxNonZeros( n ) ) {
      BLAZE_THROW_INVALID_ARGUMENT( "Invalid number of non-zero elements" );
   }

   StrictlyUpperMatrix<MT,SO,DF> matrix( n );
   randomize( matrix, nonzeros );

   return matrix;
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Generation of a random StrictlyUpperMatrix.
//
// \param min The smallest possible value for a matrix element.
// \param max The largest possible value for a matrix element.
// \return The generated random matrix.
*/
template< typename MT     // Type of the adapted matrix
        , bool SO         // Storage order of the adapted matrix
        , bool DF >       // Numeric flag
template< typename Arg >  // Min/max argument type
inline const StrictlyUpperMatrix<MT,SO,DF>
   Rand< StrictlyUpperMatrix<MT,SO,DF> >::generate( const Arg& min, const Arg& max ) const
{
   BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE_TYPE( MT );

   StrictlyUpperMatrix<MT,SO,DF> matrix;
   randomize( matrix, min, max );
   return matrix;
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Generation of a random StrictlyUpperMatrix.
//
// \param n The number of rows and columns of the random matrix.
// \param min The smallest possible value for a matrix element.
// \param max The largest possible value for a matrix element.
// \return The generated random matrix.
*/
template< typename MT     // Type of the adapted matrix
        , bool SO         // Storage order of the adapted matrix
        , bool DF >       // Numeric flag
template< typename Arg >  // Min/max argument type
inline const StrictlyUpperMatrix<MT,SO,DF>
   Rand< StrictlyUpperMatrix<MT,SO,DF> >::generate( size_t n, const Arg& min, const Arg& max ) const
{
   BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE( MT );

   StrictlyUpperMatrix<MT,SO,DF> matrix( n );
   randomize( matrix, min, max );
   return matrix;
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Generation of a random StrictlyUpperMatrix.
//
// \param n The number of rows and columns of the random matrix.
// \param nonzeros The number of non-zero elements of the random matrix.
// \param min The smallest possible value for a matrix element.
// \param max The largest possible value for a matrix element.
// \return The generated random matrix.
// \exception std::invalid_argument Invalid number of non-zero elements.
*/
template< typename MT     // Type of the adapted matrix
        , bool SO         // Storage order of the adapted matrix
        , bool DF >       // Numeric flag
template< typename Arg >  // Min/max argument type
inline const StrictlyUpperMatrix<MT,SO,DF>
   Rand< StrictlyUpperMatrix<MT,SO,DF> >::generate( size_t n, size_t nonzeros,
                                                    const Arg& min, const Arg& max ) const
{
   BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE    ( MT );
   BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( MT );

   if( nonzeros > StrictlyUpperMatrix<MT,SO,DF>::maxNonZeros( n ) ) {
      BLAZE_THROW_INVALID_ARGUMENT( "Invalid number of non-zero elements" );
   }

   StrictlyUpperMatrix<MT,SO,DF> matrix( n );
   randomize( matrix, nonzeros, min, max );

   return matrix;
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \return void
*/
template< typename MT  // Type of the adapted matrix
        , bool SO      // Storage order of the adapted matrix
        , bool DF >    // Numeric flag
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix ) const
{
   randomize( matrix, typename IsDenseMatrix<MT>::Type() );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a dense StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \return void
*/
template< typename MT  // Type of the adapted matrix
        , bool SO      // Storage order of the adapted matrix
        , bool DF >    // Numeric flag
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix, TrueType ) const
{
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( MT );

   using ET = ElementType_<MT>;

   const size_t n( matrix.rows() );

   for( size_t i=0UL; i<n; ++i ) {
      for( size_t j=i+1UL; j<n; ++j ) {
         matrix(i,j) = rand<ET>();
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a sparse StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \return void
*/
template< typename MT  // Type of the adapted matrix
        , bool SO      // Storage order of the adapted matrix
        , bool DF >    // Numeric flag
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix, FalseType ) const
{
   BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( MT );

   const size_t n( matrix.rows() );

   if( n == 0UL || n == 1UL ) return;

   const size_t nonzeros( rand<size_t>( 1UL, std::ceil( 0.2*n*n ) ) );

   randomize( matrix, nonzeros );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a row-major sparse StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \param nonzeros The number of non-zero elements of the random matrix.
// \return void
// \exception std::invalid_argument Invalid number of non-zero elements.
*/
template< typename MT  // Type of the adapted matrix
        , bool SO      // Storage order of the adapted matrix
        , bool DF >    // Numeric flag
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,false,DF>& matrix, size_t nonzeros ) const
{
   BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( MT );

   using ET = ElementType_<MT>;

   const size_t n( matrix.rows() );

   if( nonzeros > StrictlyUpperMatrix<MT,SO,DF>::maxNonZeros( n ) ) {
      BLAZE_THROW_INVALID_ARGUMENT( "Invalid number of non-zero elements" );
   }

   if( n == 0UL || n == 1UL ) return;

   matrix.reset();
   matrix.reserve( nonzeros );

   std::vector<size_t> dist( n-1UL );

   for( size_t nz=0UL; nz<nonzeros; ) {
      const size_t index = rand<size_t>( 0UL, n-2UL );
      if( dist[index] == n - index - 1UL ) continue;
      ++dist[index];
      ++nz;
   }

   for( size_t i=0UL; i<n-1UL; ++i ) {
      const Indices indices( i+1UL, n-1UL, dist[i] );
      for( size_t j : indices ) {
         matrix.append( i, j, rand<ET>() );
      }
      matrix.finalize( i );
   }

   matrix.finalize( n-1UL );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a column-major sparse StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \param nonzeros The number of non-zero elements of the random matrix.
// \return void
// \exception std::invalid_argument Invalid number of non-zero elements.
*/
template< typename MT  // Type of the adapted matrix
        , bool SO      // Storage order of the adapted matrix
        , bool DF >    // Numeric flag
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,true,DF>& matrix, size_t nonzeros ) const
{
   BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( MT );

   using ET = ElementType_<MT>;

   const size_t n( matrix.rows() );

   if( nonzeros > StrictlyUpperMatrix<MT,SO,DF>::maxNonZeros( n ) ) {
      BLAZE_THROW_INVALID_ARGUMENT( "Invalid number of non-zero elements" );
   }

   if( n == 0UL || n == 1UL ) return;

   matrix.reset();
   matrix.reserve( nonzeros );
   matrix.finalize( 0UL );

   std::vector<size_t> dist( n );

   for( size_t nz=0UL; nz<nonzeros; ) {
      const size_t index = rand<size_t>( 1UL, n-1UL );
      if( dist[index] == index ) continue;
      ++dist[index];
      ++nz;
   }

   for( size_t j=1UL; j<n; ++j ) {
      const Indices indices( 0UL, j-1UL, dist[j] );
      for( size_t i : indices ) {
         matrix.append( i, j, rand<ET>() );
      }
      matrix.finalize( j );
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \param min The smallest possible value for a matrix element.
// \param max The largest possible value for a matrix element.
// \return void
*/
template< typename MT     // Type of the adapted matrix
        , bool SO         // Storage order of the adapted matrix
        , bool DF >       // Numeric flag
template< typename Arg >  // Min/max argument type
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix,
                                                              const Arg& min, const Arg& max ) const
{
   randomize( matrix, min, max, typename IsDenseMatrix<MT>::Type() );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a dense StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \param min The smallest possible value for a matrix element.
// \param max The largest possible value for a matrix element.
// \return void
*/
template< typename MT     // Type of the adapted matrix
        , bool SO         // Storage order of the adapted matrix
        , bool DF >       // Numeric flag
template< typename Arg >  // Min/max argument type
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix,
                                                              const Arg& min, const Arg& max, TrueType ) const
{
   BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE( MT );

   using ET = ElementType_<MT>;

   const size_t n( matrix.rows() );

   for( size_t i=0UL; i<n; ++i ) {
      for( size_t j=i+1UL; j<n; ++j ) {
         matrix(i,j) = rand<ET>( min, max );
      }
   }
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a sparse StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \param min The smallest possible value for a matrix element.
// \param max The largest possible value for a matrix element.
// \return void
*/
template< typename MT     // Type of the adapted matrix
        , bool SO         // Storage order of the adapted matrix
        , bool DF >       // Numeric flag
template< typename Arg >  // Min/max argument type
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,SO,DF>& matrix,
                                                              const Arg& min, const Arg& max, FalseType ) const
{
   BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( MT );

   const size_t n( matrix.rows() );

   if( n == 0UL || n == 1UL ) return;

   const size_t nonzeros( rand<size_t>( 1UL, std::ceil( 0.2*n*n ) ) );

   randomize( matrix, nonzeros, min, max );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a row-major sparse StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \param nonzeros The number of non-zero elements of the random matrix.
// \param min The smallest possible value for a matrix element.
// \param max The largest possible value for a matrix element.
// \return void
// \exception std::invalid_argument Invalid number of non-zero elements.
*/
template< typename MT     // Type of the adapted matrix
        , bool SO         // Storage order of the adapted matrix
        , bool DF >       // Numeric flag
template< typename Arg >  // Min/max argument type
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,false,DF>& matrix,
                                                              size_t nonzeros, const Arg& min, const Arg& max ) const
{
   BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( MT );

   using ET = ElementType_<MT>;

   const size_t n( matrix.rows() );

   if( nonzeros > StrictlyUpperMatrix<MT,SO,DF>::maxNonZeros( n ) ) {
      BLAZE_THROW_INVALID_ARGUMENT( "Invalid number of non-zero elements" );
   }

   if( n == 0UL || n == 1UL ) return;

   matrix.reset();
   matrix.reserve( nonzeros );

   std::vector<size_t> dist( n-1UL );

   for( size_t nz=0UL; nz<nonzeros; ) {
      const size_t index = rand<size_t>( 0UL, n-2UL );
      if( dist[index] == n - index - 1UL ) continue;
      ++dist[index];
      ++nz;
   }

   for( size_t i=0UL; i<n-1UL; ++i ) {
      const Indices indices( i+1UL, n-1UL, dist[i] );
      for( size_t j : indices ) {
         matrix.append( i, j, rand<ET>( min, max ) );
      }
      matrix.finalize( i );
   }

   matrix.finalize( n-1UL );
}
/*! \endcond */
//*************************************************************************************************

//*************************************************************************************************
/*! \cond BLAZE_INTERNAL */
/*!\brief Randomization of a column-major sparse StrictlyUpperMatrix.
//
// \param matrix The matrix to be randomized.
// \param nonzeros The number of non-zero elements of the random matrix.
// \param min The smallest possible value for a matrix element.
// \param max The largest possible value for a matrix element.
// \return void
// \exception std::invalid_argument Invalid number of non-zero elements.
*/
template< typename MT     // Type of the adapted matrix
        , bool SO         // Storage order of the adapted matrix
        , bool DF >       // Numeric flag
template< typename Arg >  // Min/max argument type
inline void Rand< StrictlyUpperMatrix<MT,SO,DF> >::randomize( StrictlyUpperMatrix<MT,true,DF>& matrix,
                                                              size_t nonzeros, const Arg& min, const Arg& max ) const
{
   BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE( MT );

   using ET = ElementType_<MT>;

   const size_t n( matrix.rows() );

   if( nonzeros > StrictlyUpperMatrix<MT,SO,DF>::maxNonZeros( n ) ) {
      BLAZE_THROW_INVALID_ARGUMENT( "Invalid number of non-zero elements" );
   }

   if( n == 0UL || n == 1UL ) return;

   matrix.reset();
   matrix.reserve( nonzeros );
   matrix.finalize( 0UL );

   std::vector<size_t> dist( n );

   for( size_t nz=0UL; nz<nonzeros; ) {
      const size_t index = rand<size_t>( 1UL, n-1UL );
      if( dist[index] == index ) continue;
      ++dist[index];
      ++nz;
   }

   for( size_t j=1UL; j<n; ++j ) {
      const Indices indices( 0UL, j-1UL, dist[j] );
      for( size_t i : indices ) {
         matrix.append( i, j, rand<ET>( min, max ) );
      }
      matrix.finalize( j );
   }
}
/*! \endcond */
//*************************************************************************************************

} // namespace blaze

#endif


text:
layout: post
title: Guzaarish - Official Trailer
date: 2010-09-23 20:10:18.000000000 +02:00
categories:
- movies
tags:
- movies
status: publish
type: post
published: true
meta:
  _edit_last: '1'
  _wp_old_slug: ''
author:
---

Featuring Hrithik Roshan and Aishwarya Rai. Looks fabulous. Looking forward to it!


text:
struct test_circ_size : public Surface_fixture
{
  void operator()()
  {
    Sm::Vertex_around_target_circulator vvc(m.halfedge(v),m);
    Sm::Halfedge_around_target_circulator hvc(m.halfedge(v),m);
    Sm::Face_around_target_circulator fvc(m.halfedge(v),m);
    Sm::Vertex_around_face_circulator vaf(m.halfedge(f1),m);
    Sm::Halfedge_around_face_circulator hfc(m.halfedge(f1),m);

    assert(CGAL::circulator_size(vvc) == 4);
    assert(CGAL::circulator_size(hvc) == 4);
    assert(CGAL::circulator_size(fvc) == 4);
    assert(CGAL::circulator_size(vaf) == 3);
    assert(CGAL::circulator_size(hfc) == 3);
 }
};

struct test_circ_distance : public Surface_fixture
{
  void operator()()
  {
    // the distance against end
    Sm::Vertex_around_target_circulator vvc(m.halfedge(v),m), vvce(vvc);
    assert(CGAL::circulator_distance(vvc, vvce) == 4);

    vvc =  vvce = Sm::Vertex_around_target_circulator(m.halfedge(u),m);
    assert(CGAL::circulator_distance(vvc, vvce) == 2);

    vvc = vvce = Sm::Vertex_around_target_circulator(m.halfedge(w),m);
    assert(CGAL::circulator_distance(vvc, vvce) == 3);

    vvc = vvce = Sm::Vertex_around_target_circulator(m.halfedge(x),m);
    assert(CGAL::circulator_distance(vvc, vvce) == 3);

    Sm::Halfedge_around_target_circulator hvc(m.halfedge(v),m), hvce(hvc);
    assert(CGAL::circulator_distance(hvc, hvce) == 4);

    Sm::Face_around_target_circulator fvc(m.halfedge(v),m), fvce(fvc);
    assert(CGAL::circulator_distance(fvc, fvce) == 4);

    Sm::Vertex_around_face_circulator vfc(m.halfedge(f1),m), vfce(vfc);
    assert(CGAL::circulator_distance(vfc, vfce) == 3);

    Sm::Halfedge_around_face_circulator hfc(m.halfedge(f1),m), hfce(hfc);
    assert(CGAL::circulator_distance(hfc, hfce) == 3);
  }
};

struct test_emptiness : public Surface_fixture
{
  void operator()()
  {
    // add an isolated vertex
    Sm::Vertex_index iv = m.add_vertex(Point_3(2,2,0));
    assert(m.is_isolated(iv));

    Sm::Vertex_around_target_range vr = m.vertices_around_target(m.halfedge(iv));
    assert(is_empty_range(boost::begin(vr), boost::end(vr)));

    Sm::Face_around_target_range fr = m.faces_around_target(m.halfedge(iv));
    assert(is_empty_range(boost::begin(fr), boost::end(fr)));

    Sm::Halfedge_around_target_range hr = m.halfedges_around_target(m.halfedge(iv));
    assert(is_empty_range(boost::begin(hr), boost::end(hr)));
    // not true for everything else
    m.remove_vertex(iv);
    assert(m.is_removed(iv));
    Sm::Vertex_iterator vb, ve;
    for(boost::tie(vb, ve) = m.vertices(); vb != ve; ++vb) {
      Sm::Vertex_around_target_range vr = m.vertices_around_target(m.halfedge(*vb));
      assert(!is_empty_range(boost::begin(vr), boost::end(vr)));
    }
  }
};

int main()
{
  test_circ_size tcs;
  tcs();
  test_circ_distance tcd;
  tcd();
  test_emptiness te;
  te();
  std::cerr << "done"<< std::endl;
  return 0;
}


text:
The palindrome application is a MEAN stack application with a REST API and an angular front-end to submit messages and verify if they are palindromes
---

## Getting started

### Prerequisites
At minimum you will need to have node installed. You will need docker as well if you choose to run this in a docker container.

### Getting the source
```
git clone https://github.com/dotLou/palindrome.git
```
## Docker
### 1. Docker build
```
docker build . -t dotlou/palindrome
```
### 2. Docker deployment
```
docker run -d -it dotlou/palindrome -e "MONGO_URL='mongodb://your_connection_info'" --name palindrome_app
```
This will run the server with the default port of 3000.

## Development Environment
## 1. Install packages
```
npm install
```
## 2. Mongo
This app assumes you have a mongo endpoint with a connection url defined at MONGO_URL. You should export this ahead of running it.
## 3. (Optional) Seed the database with some initial data
```
npm run dbseed
```
### 4. Launch the webserver
To serve at the default 3000 port:
```
npm start
```

### CSS autoprefixer
There is a default gulp task to generate CSS browser-specific prefixes so you don't need to worry about it. With this in mind, make all CSS changes to root/styles/\*.css and *_NOT_* to public/css/.
Once changes have been completed, run the following command to "compile" them with the prefixes:
```
gulp
```

## API definition
The full API definition is available at http://your_server:3000/apidoc. A web version is available [here](http://54.210.218.167/apidoc/).

### Generating a fresh copy of the api documentation
The full API documentation gets generated for all definitions inside the routes/ folder. You can re-generate the docs like this:
```
npm run apidoc
```
This will generate the full docs into public/apidoc and thus make it available via http://your_server:3000/apidoc

## Testing
This project comes with tests for both the backend (node) and frontend (angular).

### Running backend (node) tests
```
mocha
```
### Running frontend (angular) tests
```
gulp test
```

## Sequence Diagrams
### GET Messages
![Get Messages Sequence image](./doc/images/get_messages_sequence.png)
### GET Messages
![Get Message Sequence image](./doc/images/get_message_sequence.png)
### POST Messages
![POST Message Sequence image](./doc/images/post_message_sequence.png)
## License
The MIT License (MIT)

Copyright (c) 2016 Louis Cloutier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


text:
using System;
using System.Collections.Generic;
using Confuser.Core;
using Confuser.Core.Services;
using Confuser.DynCipher;
using Confuser.DynCipher.AST;
using Confuser.DynCipher.Generation;
using dnlib.DotNet;
using dnlib.DotNet.Emit;

namespace Confuser.Protections.Compress {
	internal class DynamicDeriver : IKeyDeriver {
		StatementBlock derivation;
		Action<uint[], uint[]> encryptFunc;

		public void Init(ConfuserContext ctx, RandomGenerator random) {
			StatementBlock dummy;
			ctx.Registry.GetService<IDynCipherService>().GenerateCipherPair(random, out derivation, out dummy);

			var dmCodeGen = new DMCodeGen(typeof(void), new[] {
				Tuple.Create("{BUFFER}", typeof(uint[])),
				Tuple.Create("{KEY}", typeof(uint[]))
			});
			dmCodeGen.GenerateCIL(derivation);
			encryptFunc = dmCodeGen.Compile<Action<uint[], uint[]>>();
		}

		public uint[] DeriveKey(uint[] a, uint[] b) {
			var ret = new uint[0x10];
			Buffer.BlockCopy(a, 0, ret, 0, a.Length * sizeof(uint));
			encryptFunc(ret, b);
			return ret;
		}

		public IEnumerable<Instruction> EmitDerivation(MethodDef method, ConfuserContext ctx, Local dst, Local src) {
			var ret = new List<Instruction>();
			var codeGen = new CodeGen(dst, src, method, ret);
			codeGen.GenerateCIL(derivation);
			codeGen.Commit(method.Body);
			return ret;
		}

		class CodeGen : CILCodeGen {
			readonly Local block;
			readonly Local key;

			public CodeGen(Local block, Local key, MethodDef method, IList<Instruction> instrs)
				: base(method, instrs) {
				this.block = block;
				this.key = key;
			}

			protected override Local Var(Variable var) {
				if (var.Name == "{BUFFER}")
					return block;
				if (var.Name == "{KEY}")
					return key;
				return base.Var(var);
			}
		}
	}
}


text:
namespace boost {

namespace unit_test {

// ************************************************************************** //
// **************      first failed assertion debugger hook    ************** //
// ************************************************************************** //

namespace {
inline void first_failed_assertion() {}
}

// ************************************************************************** //
// **************                 test_results                 ************** //
// ************************************************************************** //

class BOOST_TEST_DECL test_results {
public:
    test_results();

    typedef BOOST_READONLY_PROPERTY( counter_t, (results_collector_t)(test_results)(results_collect_helper) ) counter_prop;
    typedef BOOST_READONLY_PROPERTY( bool,      (results_collector_t)(test_results)(results_collect_helper) ) bool_prop;

    counter_prop    p_assertions_passed;
    counter_prop    p_assertions_failed;
    counter_prop    p_expected_failures;
    counter_prop    p_test_cases_passed;
    counter_prop    p_test_cases_failed;
    counter_prop    p_test_cases_skipped;
    counter_prop    p_test_cases_aborted;
    bool_prop       p_aborted;
    bool_prop       p_skipped;

    // "conclusion" methods
    bool            passed() const;
    int             result_code() const;

    // collection helper
    void            operator+=( test_results const& );

    void            clear();
};

// ************************************************************************** //
// **************               results_collector              ************** //
// ************************************************************************** //

class BOOST_TEST_DECL results_collector_t : public test_observer, public singleton<results_collector_t> {
public:
    // test_observer interface implementation
    void                test_start( counter_t test_cases_amount );
    void                test_finish();
    void                test_aborted();

    void                test_unit_start( test_unit const& );
    void                test_unit_finish( test_unit const&, unsigned long elapsed );
    void                test_unit_skipped( test_unit const& );
    void                test_unit_aborted( test_unit const& );

    void                assertion_result( bool passed );
    void                exception_caught( execution_exception const& );

    // results access
    test_results const& results( test_unit_id ) const;

private:
    BOOST_TEST_SINGLETON_CONS( results_collector_t );
};

BOOST_TEST_SINGLETON_INST( results_collector )

} // namespace unit_test

} // namespace boost

//____________________________________________________________________________//

#include <boost/test/detail/enable_warnings.hpp>

#endif // BOOST_TEST_RESULTS_COLLECTOR_HPP_071894GER


text:
void RecoverBinarySearchTree::recoverTree(TreeNode *root) {
    TreeNode *prev = nullptr, *first = nullptr, *second = nullptr;
    findSegments(root, prev, first, second);
    swap(first->val, second->val);
}

void RecoverBinarySearchTree::findSegments(TreeNode *root, TreeNode *&prev,
                                           TreeNode *&first, TreeNode *&second) {
    if (root == nullptr)
        return;

    findSegments(root->left, prev, first, second);

    if (prev != nullptr && prev->val > root->val) {
        if (first == nullptr)
            first = prev;

        second = root;
    }

    prev = root;
    findSegments(root->right, prev, first, second);
}

void RecoverBinarySearchTree::detect(pair<TreeNode *, TreeNode *> &broken, TreeNode *prev, TreeNode *current) {
    if (prev && prev->val > current->val) {
        if (!broken.first)
            broken.first = prev;
        broken.second = current;
    }
}

void RecoverBinarySearchTree::recoverTree_Morris(TreeNode *root) {
    pair<TreeNode *, TreeNode *> broken;
    TreeNode *current = root;
    TreeNode *prev = nullptr;

    while (current != nullptr) {
        if (current->left == nullptr) {
            detect(broken, prev, current);
            prev = current;
            current = current->right;
        } else {
            TreeNode *pred = current->left;

            while (pred->right != nullptr && pred->right != current)
                pred = pred->right;

            if (pred->right == nullptr) {
                pred->right = current;
                current = current->left;
            } else {
                detect(broken, prev, current);
                prev = current;
                pred->right = nullptr;
                current = current->right;
            }
        }
    }

    swap(broken.first->val, broken.second->val);
}


text:
module Fog
  module Compute
    class Ecloud

      class Real
        basic_request :get_cpu_usage_detail_summary
      end

    end
  end
end


text:
module PatronusFati
  module MessageModels
    Clitag = CapStruct.new(:bssid, :mac, :tag, :value)
    Clitag.set_data_filter(:bssid, :mac) { |val| val.downcase }
  end
end