text:
package org.docksidestage.dbflute.bsentity;

import java.util.List;
import java.util.ArrayList;

import org.dbflute.Entity;
import org.dbflute.dbmeta.DBMeta;
import org.dbflute.dbmeta.AbstractEntity;
import org.dbflute.dbmeta.accessory.DomainEntity;
import org.dbflute.optional.OptionalEntity;
import org.docksidestage.dbflute.allcommon.DBMetaInstanceHandler;
import org.docksidestage.dbflute.exentity.*;

/**
 * The entity of (会員フォローイング)MEMBER_FOLLOWING as TABLE.

 * とある会員が他の会員をフォローできる。すると、フォローした会員の購入履歴が閲覧できる。
 *

 * [primary-key]
 *     MEMBER_FOLLOWING_ID
 *
 * [column]
 *     MEMBER_FOLLOWING_ID, MY_MEMBER_ID, YOUR_MEMBER_ID, FOLLOW_DATETIME
 *
 * [sequence]
 *
 *
 * [identity]
 *     MEMBER_FOLLOWING_ID
 *
 * [version-no]
 *
 *
 * [foreign table]
 *     MEMBER
 *
 * [referrer table]
 *
 *
 * [foreign property]
 *     memberByMyMemberId, memberByYourMemberId
 *
 * [referrer property]
 *
 *
 * [get/set template]
 * /= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
 * Long memberFollowingId = entity.getMemberFollowingId();
 * Integer myMemberId = entity.getMyMemberId();
 * Integer yourMemberId = entity.getYourMemberId();
 * java.time.LocalDateTime followDatetime = entity.getFollowDatetime();
 * entity.setMemberFollowingId(memberFollowingId);
 * entity.setMyMemberId(myMemberId);
 * entity.setYourMemberId(yourMemberId);
 * entity.setFollowDatetime(followDatetime);
 * = = = = = = = = = =/
 *

 * @author DBFlute(AutoGenerator)
 */
public abstract class BsMemberFollowing extends AbstractEntity implements DomainEntity {

    // ===================================================================================
    //                                                                          Definition
    //                                                                          ==========
    /** The serial version UID for object serialization. (Default) */
    private static final long serialVersionUID = 1L;

    // ===================================================================================
    //                                                                           Attribute
    //                                                                           =========
    /** (会員フォローイングID)MEMBER_FOLLOWING_ID: {PK, ID, NotNull, BIGINT(19)} */
    protected Long _memberFollowingId;

    /** (わたし)MY_MEMBER_ID: {UQ+, IX+, NotNull, INTEGER(10), FK to MEMBER} */
    protected Integer _myMemberId;

    /** (あなた)YOUR_MEMBER_ID: {+UQ, IX+, NotNull, INTEGER(10), FK to MEMBER} */
    protected Integer _yourMemberId;

    /** (その瞬間)FOLLOW_DATETIME: {IX, NotNull, TIMESTAMP(26, 6)} */
    protected java.time.LocalDateTime _followDatetime;

    // ===================================================================================
    //                                                                             DB Meta
    //                                                                             =======
    /** {@inheritDoc} */
    public DBMeta asDBMeta() {
        return DBMetaInstanceHandler.findDBMeta(asTableDbName());
    }

    /** {@inheritDoc} */
    public String asTableDbName() {
        return "MEMBER_FOLLOWING";
    }

    // ===================================================================================
    //                                                                        Key Handling
    //                                                                        ============
    /** {@inheritDoc} */
    public boolean hasPrimaryKeyValue() {
        if (_memberFollowingId == null) { return false; }
        return true;
    }

    /**
     * To be unique by the unique column.

     * You can update the entity by the key when entity update (NOT batch update).
     * @param myMemberId (わたし): UQ+, IX+, NotNull, INTEGER(10), FK to MEMBER. (NotNull)
     * @param yourMemberId (あなた): +UQ, IX+, NotNull, INTEGER(10), FK to MEMBER. (NotNull)
     */
    public void uniqueBy(Integer myMemberId, Integer yourMemberId) {
        __uniqueDrivenProperties.clear();
        __uniqueDrivenProperties.addPropertyName("myMemberId");
        __uniqueDrivenProperties.addPropertyName("yourMemberId");
        setMyMemberId(myMemberId);setYourMemberId(yourMemberId);
    }

    // ===================================================================================
    //                                                                    Foreign Property
    //                                                                    ================
    /** (会員)MEMBER by my MY_MEMBER_ID, named 'memberByMyMemberId'. */
    protected OptionalEntity<Member> _memberByMyMemberId;

    /**
     * [get] (会員)MEMBER by my MY_MEMBER_ID, named 'memberByMyMemberId'.

     * Optional: alwaysPresent(), ifPresent().orElse(), get(), ...
     * @return The entity of foreign property 'memberByMyMemberId'. (NotNull, EmptyAllowed: when e.g. null FK column, no setupSelect)
     */
    public OptionalEntity<Member> getMemberByMyMemberId() {
        if (_memberByMyMemberId == null) { _memberByMyMemberId = OptionalEntity.relationEmpty(this, "memberByMyMemberId"); }
        return _memberByMyMemberId;
    }

    /**
     * [set] (会員)MEMBER by my MY_MEMBER_ID, named 'memberByMyMemberId'.
     * @param memberByMyMemberId The entity of foreign property 'memberByMyMemberId'. (NullAllowed)
     */
    public void setMemberByMyMemberId(OptionalEntity<Member> memberByMyMemberId) {
        _memberByMyMemberId = memberByMyMemberId;
    }

    /** (会員)MEMBER by my YOUR_MEMBER_ID, named 'memberByYourMemberId'. */
    protected OptionalEntity<Member> _memberByYourMemberId;

    /**
     * [get] (会員)MEMBER by my YOUR_MEMBER_ID, named 'memberByYourMemberId'.

     * Optional: alwaysPresent(), ifPresent().orElse(), get(), ...
     * @return The entity of foreign property 'memberByYourMemberId'. (NotNull, EmptyAllowed: when e.g. null FK column, no setupSelect)
     */
    public OptionalEntity<Member> getMemberByYourMemberId() {
        if (_memberByYourMemberId == null) { _memberByYourMemberId = OptionalEntity.relationEmpty(this, "memberByYourMemberId"); }
        return _memberByYourMemberId;
    }

    /**
     * [set] (会員)MEMBER by my YOUR_MEMBER_ID, named 'memberByYourMemberId'.
     * @param memberByYourMemberId The entity of foreign property 'memberByYourMemberId'. (NullAllowed)
     */
    public void setMemberByYourMemberId(OptionalEntity<Member> memberByYourMemberId) {
        _memberByYourMemberId = memberByYourMemberId;
    }

    // ===================================================================================
    //                                                                   Referrer Property
    //                                                                   =================
    protected <ELEMENT> List<ELEMENT> newReferrerList() { // overriding to import
        return new ArrayList<ELEMENT>();
    }

    // ===================================================================================
    //                                                                      Basic Override
    //                                                                      ==============
    @Override
    protected boolean doEquals(Object obj) {
        if (obj instanceof BsMemberFollowing) {
            BsMemberFollowing other = (BsMemberFollowing)obj;
            if (!xSV(_memberFollowingId, other._memberFollowingId)) { return false; }
            return true;
        } else {
            return false;
        }
    }

    @Override
    protected int doHashCode(int initial) {
        int hs = initial;
        hs = xCH(hs, asTableDbName());
        hs = xCH(hs, _memberFollowingId);
        return hs;
    }

    @Override
    protected String doBuildStringWithRelation(String li) {
        StringBuilder sb = new StringBuilder();
        if (_memberByMyMemberId != null && _memberByMyMemberId.isPresent())
        { sb.append(li).append(xbRDS(_memberByMyMemberId, "memberByMyMemberId")); }
        if (_memberByYourMemberId != null && _memberByYourMemberId.isPresent())
        { sb.append(li).append(xbRDS(_memberByYourMemberId, "memberByYourMemberId")); }
        return sb.toString();
    }
    protected <ET extends Entity> String xbRDS(org.dbflute.optional.OptionalEntity<ET> et, String name) { // buildRelationDisplayString()
        return et.get().buildDisplayString(name, true, true);
    }

    @Override
    protected String doBuildColumnString(String dm) {
        StringBuilder sb = new StringBuilder();
        sb.append(dm).append(xfND(_memberFollowingId));
        sb.append(dm).append(xfND(_myMemberId));
        sb.append(dm).append(xfND(_yourMemberId));
        sb.append(dm).append(xfND(_followDatetime));
        if (sb.length() > dm.length()) {
            sb.delete(0, dm.length());
        }
        sb.insert(0, "{").append("}");
        return sb.toString();
    }

    @Override
    protected String doBuildRelationString(String dm) {
        StringBuilder sb = new StringBuilder();
        if (_memberByMyMemberId != null && _memberByMyMemberId.isPresent())
        { sb.append(dm).append("memberByMyMemberId"); }
        if (_memberByYourMemberId != null && _memberByYourMemberId.isPresent())
        { sb.append(dm).append("memberByYourMemberId"); }
        if (sb.length() > dm.length()) {
            sb.delete(0, dm.length()).insert(0, "(").append(")");
        }
        return sb.toString();
    }

    @Override
    public MemberFollowing clone() {
        return (MemberFollowing)super.clone();
    }

    // ===================================================================================
    //                                                                            Accessor
    //                                                                            ========
    /**
     * [get] (会員フォローイングID)MEMBER_FOLLOWING_ID: {PK, ID, NotNull, BIGINT(19)}

     * 連番
     * @return The value of the column 'MEMBER_FOLLOWING_ID'. (basically NotNull if selected: for the constraint)
     */
    public Long getMemberFollowingId() {
        checkSpecifiedProperty("memberFollowingId");
        return _memberFollowingId;
    }

    /**
     * [set] (会員フォローイングID)MEMBER_FOLLOWING_ID: {PK, ID, NotNull, BIGINT(19)}

     * 連番
     * @param memberFollowingId The value of the column 'MEMBER_FOLLOWING_ID'. (basically NotNull if update: for the constraint)
     */
    public void setMemberFollowingId(Long memberFollowingId) {
        registerModifiedProperty("memberFollowingId");
        _memberFollowingId = memberFollowingId;
    }

    /**
     * [get] (わたし)MY_MEMBER_ID: {UQ+, IX+, NotNull, INTEGER(10), FK to MEMBER}

     * 気になった人がいて...勇気を振り絞った会員のID。
     * @return The value of the column 'MY_MEMBER_ID'. (basically NotNull if selected: for the constraint)
     */
    public Integer getMyMemberId() {
        checkSpecifiedProperty("myMemberId");
        return _myMemberId;
    }

    /**
     * [set] (わたし)MY_MEMBER_ID: {UQ+, IX+, NotNull, INTEGER(10), FK to MEMBER}

     * 気になった人がいて...勇気を振り絞った会員のID。
     * @param myMemberId The value of the column 'MY_MEMBER_ID'. (basically NotNull if update: for the constraint)
     */
    public void setMyMemberId(Integer myMemberId) {
        registerModifiedProperty("myMemberId");
        _myMemberId = myMemberId;
    }

    /**
     * [get] (あなた)YOUR_MEMBER_ID: {+UQ, IX+, NotNull, INTEGER(10), FK to MEMBER}

     * いきなりのアクションに...ちょっと心揺らいだ会員のID。
     * @return The value of the column 'YOUR_MEMBER_ID'. (basically NotNull if selected: for the constraint)
     */
    public Integer getYourMemberId() {
        checkSpecifiedProperty("yourMemberId");
        return _yourMemberId;
    }

    /**
     * [set] (あなた)YOUR_MEMBER_ID: {+UQ, IX+, NotNull, INTEGER(10), FK to MEMBER}

     * いきなりのアクションに...ちょっと心揺らいだ会員のID。
     * @param yourMemberId The value of the column 'YOUR_MEMBER_ID'. (basically NotNull if update: for the constraint)
     */
    public void setYourMemberId(Integer yourMemberId) {
        registerModifiedProperty("yourMemberId");
        _yourMemberId = yourMemberId;
    }

    /**
     * [get] (その瞬間)FOLLOW_DATETIME: {IX, NotNull, TIMESTAMP(26, 6)}

     * ふりかえるとちょっと恥ずかしい気持ちになる日時
     * @return The value of the column 'FOLLOW_DATETIME'. (basically NotNull if selected: for the constraint)
     */
    public java.time.LocalDateTime getFollowDatetime() {
        checkSpecifiedProperty("followDatetime");
        return _followDatetime;
    }

    /**
     * [set] (その瞬間)FOLLOW_DATETIME: {IX, NotNull, TIMESTAMP(26, 6)}

     * ふりかえるとちょっと恥ずかしい気持ちになる日時
     * @param followDatetime The value of the column 'FOLLOW_DATETIME'. (basically NotNull if update: for the constraint)
     */
    public void setFollowDatetime(java.time.LocalDateTime followDatetime) {
        registerModifiedProperty("followDatetime");
        _followDatetime = followDatetime;
    }
}


text:
namespace gfx {

static const double kBezierEpsilon = 1e-7;

CubicBezier::CubicBezier(double p1x, double p1y, double p2x, double p2y) {
  InitCoefficients(p1x, p1y, p2x, p2y);
  InitGradients(p1x, p1y, p2x, p2y);
  InitRange(p1y, p2y);
}

CubicBezier::CubicBezier(const CubicBezier& other) = default;

void CubicBezier::InitCoefficients(double p1x,
                                   double p1y,
                                   double p2x,
                                   double p2y) {
  // Calculate the polynomial coefficients, implicit first and last control
  // points are (0,0) and (1,1).
  cx_ = 3.0 * p1x;
  bx_ = 3.0 * (p2x - p1x) - cx_;
  ax_ = 1.0 - cx_ - bx_;

  cy_ = 3.0 * p1y;
  by_ = 3.0 * (p2y - p1y) - cy_;
  ay_ = 1.0 - cy_ - by_;
}

void CubicBezier::InitGradients(double p1x,
                                double p1y,
                                double p2x,
                                double p2y) {
  // End-point gradients are used to calculate timing function results
  // outside the range [0, 1].
  //
  // There are three possibilities for the gradient at each end:
  // (1) the closest control point is not horizontally coincident with regard to
  //     (0, 0) or (1, 1). In this case the line between the end point and
  //     the control point is tangent to the bezier at the end point.
  // (2) the closest control point is coincident with the end point. In
  //     this case the line between the end point and the far control
  //     point is tangent to the bezier at the end point.
  // (3) the closest control point is horizontally coincident with the end
  //     point, but vertically distinct. In this case the gradient at the
  //     end point is Infinite. However, this causes issues when
  //     interpolating. As a result, we break down to a simple case of
  //     0 gradient under these conditions.

  if (p1x > 0)
    start_gradient_ = p1y / p1x;
  else if (!p1y && p2x > 0)
    start_gradient_ = p2y / p2x;
  else
    start_gradient_ = 0;

  if (p2x < 1)
    end_gradient_ = (p2y - 1) / (p2x - 1);
  else if (p2x == 1 && p1x < 1)
    end_gradient_ = (p1y - 1) / (p1x - 1);
  else
    end_gradient_ = 0;
}

// This works by taking taking the derivative of the cubic bezier, on the y
// axis. We can then solve for where the derivative is zero to find the min
// and max distance along the line. We the have to solve those in terms of time
// rather than distance on the x-axis
void CubicBezier::InitRange(double p1y, double p2y) {
  range_min_ = 0;
  range_max_ = 1;
  if (0 <= p1y && p1y < 1 && 0 <= p2y && p2y <= 1)
    return;

  const double epsilon = kBezierEpsilon;

  // Represent the function's derivative in the form at^2 + bt + c
  // as in sampleCurveDerivativeY.
  // (Technically this is (dy/dt)*(1/3), which is suitable for finding zeros
  // but does not actually give the slope of the curve.)
  const double a = 3.0 * ay_;
  const double b = 2.0 * by_;
  const double c = cy_;

  // Check if the derivative is constant.
  if (std::abs(a) < epsilon && std::abs(b) < epsilon)
    return;

  // Zeros of the function's derivative.
  double t1 = 0;
  double t2 = 0;

  if (std::abs(a) < epsilon) {
    // The function's derivative is linear.
    t1 = -c / b;
  } else {
    // The function's derivative is a quadratic. We find the zeros of this
    // quadratic using the quadratic formula.
    double discriminant = b * b - 4 * a * c;
    if (discriminant < 0)
      return;
    double discriminant_sqrt = sqrt(discriminant);
    t1 = (-b + discriminant_sqrt) / (2 * a);
    t2 = (-b - discriminant_sqrt) / (2 * a);
  }

  double sol1 = 0;
  double sol2 = 0;

  // If the solution is in the range [0,1] then we include it, otherwise we
  // ignore it.

  // An interesting fact about these beziers is that they are only
  // actually evaluated in [0,1]. After that we take the tangent at that point
  // and linearly project it out.
  if (0 < t1 && t1 < 1)
    sol1 = SampleCurveY(t1);

  if (0 < t2 && t2 < 1)
    sol2 = SampleCurveY(t2);

  range_min_ = std::min(std::min(range_min_, sol1), sol2);
  range_max_ = std::max(std::max(range_max_, sol1), sol2);
}

double CubicBezier::SolveCurveX(double x, double epsilon) const {
  DCHECK_GE(x, 0.0);
  DCHECK_LE(x, 1.0);

  double t0;
  double t1;
  double t2;
  double x2;
  double d2;
  int i;

  // First try a few iterations of Newton's method -- normally very fast.
  for (t2 = x, i = 0; i < 8; i++) {
    x2 = SampleCurveX(t2) - x;
    if (fabs(x2) < epsilon)
      return t2;
    d2 = SampleCurveDerivativeX(t2);
    if (fabs(d2) < 1e-6)
      break;
    t2 = t2 - x2 / d2;
  }

  // Fall back to the bisection method for reliability.
  t0 = 0.0;
  t1 = 1.0;
  t2 = x;

  while (t0 < t1) {
    x2 = SampleCurveX(t2);
    if (fabs(x2 - x) < epsilon)
      return t2;
    if (x > x2)
      t0 = t2;
    else
      t1 = t2;
    t2 = (t1 - t0) * .5 + t0;
  }

  // Failure.
  return t2;
}

double CubicBezier::Solve(double x) const {
  return SolveWithEpsilon(x, kBezierEpsilon);
}

double CubicBezier::SlopeWithEpsilon(double x, double epsilon) const {
  x = std::min(std::max(x, 0.0), 1.0);
  double t = SolveCurveX(x, epsilon);
  double dx = SampleCurveDerivativeX(t);
  double dy = SampleCurveDerivativeY(t);
  return dy / dx;
}

double CubicBezier::Slope(double x) const {
  return SlopeWithEpsilon(x, kBezierEpsilon);
}

double CubicBezier::GetX1() const {
  return cx_ / 3.0;
}

double CubicBezier::GetY1() const {
  return cy_ / 3.0;
}

double CubicBezier::GetX2() const {
  return (bx_ + cx_) / 3.0 + GetX1();
}

double CubicBezier::GetY2() const {
  return (by_ + cy_) / 3.0 + GetY1();
}

}  // namespace gfx

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <title>aadm: ripresa delle trasmissioni</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="http://aadm.github.io/favicon.png" rel="icon">

<link rel="canonical" href="http://aadm.github.io/after-a-long-pause-it.html">

        <meta name="author" content="Alessandro Amato del Monte" />
        <meta name="keywords" content="misc,notes" />
        <meta name="description" content="Breve comunicazione di servizio per dire a tutti quelli che mi seguono che presto, prestissimo, riprenderanno le trasmissioni. Ho avuto da fare con trasloco, lavoro, stare con la famiglia, il collegamento internet che non si collegava, e varie altre robe che occupano la quotidianità insomma. Alcune di queste ti prosciugano …" />

        <meta property="og:site_name" content="aadm" />
        <meta property="og:type" content="article"/>
        <meta property="og:title" content="ripresa delle trasmissioni"/>
        <meta property="og:url" content="http://aadm.github.io/after-a-long-pause-it.html"/>
        <meta property="og:description" content="Breve comunicazione di servizio per dire a tutti quelli che mi seguono che presto, prestissimo, riprenderanno le trasmissioni. Ho avuto da fare con trasloco, lavoro, stare con la famiglia, il collegamento internet che non si collegava, e varie altre robe che occupano la quotidianità insomma. Alcune di queste ti prosciugano …"/>
        <meta property="article:published_time" content="2014-05-26" />
            <meta property="article:section" content="misc" />
            <meta property="article:tag" content="misc" />
            <meta property="article:tag" content="notes" />
            <meta property="article:author" content="Alessandro Amato del Monte" />

        <link rel="stylesheet" href="http://aadm.github.io/theme/css/bootstrap.journal.min.css" type="text/css"/>
    <link href="http://aadm.github.io/theme/css/font-awesome.min.css" rel="stylesheet">

    <link href="http://aadm.github.io/theme/css/pygments/tango.css" rel="stylesheet">
        <link href="http://aadm.github.io/theme/css/typogrify.css" rel="stylesheet">
    <link rel="stylesheet" href="http://aadm.github.io/theme/css/style.css" type="text/css"/>
        <link href="http://aadm.github.io/static/custom.css" rel="stylesheet">

        <link href="http://aadm.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate"
              title="aadm ATOM Feed"/>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                Toggle navigation

            </button>

aadm

                        ripresa delle trasmissioni

    Date

        <time datetime="2014-05-26T00:00:00+02:00"> 2014-05-26</time>

Tags
	misc
        /
	notes
    Lang
	en

Breve comunicazione di servizio per dire a tutti quelli che mi seguono che presto, prestissimo, riprenderanno le trasmissioni.

Ho avuto da fare con trasloco, lavoro, stare con la famiglia, il collegamento internet che non si collegava, e varie altre robe che occupano la quotidianità insomma. Alcune di queste ti prosciugano mentalmente, altre sono semplicemente impegni da cui non voglio sottrarmi perché nonostante il tempo che ti prendono, ti danno in cambio sensazioni ed emozioni irripetibili e sfuggenti (vedi le due foto qui sotto).

La conseguenza dunque è stata una mancanza di aggiornamenti sul mio blog da gennaio 2014, una uguale assenza da altri canali (twitter, Google+) dove di tanto in tanto mi affacciavo, e una traballante pila di idee, spunti, bozze prevalentemente di argomento fotografico che avrò difficoltà a riordinare e rendere pubblica.

Nonostante sia in Turchia per un field trip geologico, al primo punto vorrei rimediare partendo da oggi; da quella traballante pila ho tirato fuori qualcosa di meno instabile che metterò online nei prossimi giorni.

RIguardo gli altri due punti, e cioè una certa partecipazione a questi flussi amorfi di conversazione e idee, ho sempre meno stimoli a farlo, a prescindere dalla minore o maggiore fisicità degli stessi; lasciare qualcosa di compiuto su twitter o google+ o partecipare in modo attivo alle attività del circolo fotogafico locale,  sono cose che mi succhiano troppa energia in confronto ai benefici/piacere/compensi che ne traggo in cambio. Scusami, Mondo, ma tengo più alla mia famiglia che a te.

Scrivo qui gli argomenti di cui parlerò prossimamente, poi ci risentiamo a fine anno per vedere se sono riuscito a chiuderne almeno una parte:

finalizzazione dei progetti San Donato e Milano;

aggiornamento sul progetto fotografico 365-valentina con presentazione del piccolo programma scritto in Python per documentare lo stato corrente, senza contravvenire al mio principio guida;

creazione del mio portfolio — ma quello fisico, su carta, come si faceva  una volta (sono in procinto di comprarmi una stampante fotografica seria; la carta, quella sta già ordinata);

raccontare come uso Python a lavoro, ispirato dall'animo open source dei brillanti ragazzi di Agile Geoscience;

piccolo riassunto sullo stato delle mie bici e su come sia rinato con questa Norco Shinobi;

appunti di street photography.

Infine, e in parziale contraddizione col mio allontanamento dai social network di cui parlavo prima, ho riattivato il mio account tumblr1 e ho aperto un nuovo stream che si chiama aadm-fotografia.tumblr.com, su cui trovate piccole collezioni di mie foto, in aggiunta alle serie più ragionate che continuerò a pubblicare qui. Un esempio delle cose pubblicate finora:

Le foto con cui ho partecipato alla prima, seconda, terza e quarta puntata del concorso fotografico interno (la quinta la metterò online dopo che rientro dalla Turchia);

Parma, in varie condizioni di stagioni e luce;

Variazioni sul tema "Dall'alto", parte 1 e parte 2.

Valentina che fa le smorfie, parte 1 e parte 2.

Nei 4 mesi di internet shutdown che ho sofferto, ho scoperto che (1) potevo arrivare con più facilità su tumblr per mettere online delle foto, (2) avevo trovato questo template minimalista ma elegante, che mi permetteva di pubblicare foto belle grandi come piace a me. Nonostante il desiderio di semplificare le cose, a volte la voglia di novità continua ad avere il sopravvento su di me. ↩

 PREVIOUS

NEXT

© 2005-2019 Alessandro Amato del Monte

  Creative Commons Attribution 4.0 International License

 TOP


text:
using OpenQA.Selenium;
using RegTesting.Tests.Framework.Enums;
using RegTesting.Tests.Framework.Logic;

namespace RegTesting.Tests.Framework.Elements
{
	public class Button : BasicPageElement
	{

		public Button(By byLocator, IWebDriver webDriver, WaitModel waitModel, BasePageObject parentBasePageObject, ClickBehaviours clickBehaviour = ClickBehaviours.Default)
			: base(byLocator, webDriver, waitModel, parentBasePageObject, clickBehaviour)
		{
		}
	}
}


text:
package de.javakaffee.web.msm.serializer.kryo;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.serializers.FieldSerializer;
import org.codehaus.groovy.grails.web.servlet.GrailsFlashScope;

/**
 * {@link SerializerFactory} that supports grails flash scope.
 * It creates a {@link FieldSerializer} for {@link GrailsFlashScope} and enables references.
 *
 * @author Martin Grotzke
 */
public class GrailsFlashScopeRegistration implements KryoCustomization {

	@Override
	public void customize(Kryo kryo) {
		kryo.setReferences(true);
        kryo.register( GrailsFlashScope.class, new FieldSerializer( kryo, GrailsFlashScope.class ) );
	}

}


text:
class UserPlugin < Refinery::Core::BaseModel
  self.table_name = 'active_admin_refinery_user_plugins'
  belongs_to Rails.application.config.x.aa_refinery.admin_user_class.singularize.underscore.to_sym,
             foreign_key: 'user_id'
end


text:
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
use amilna\yap\GridView;

/* @var $this yii\web\View */
/* @var $searchModel amilna\versioning\models\VersionSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Versions');
$this->params['breadcrumbs'][] = $this->title;

?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,

        'containerOptions' => ['style'=>'overflow: auto'], // only set when $responsive = false
		'caption'=>Yii::t('app', 'Version'),
		'headerRowOptions'=>['class'=>'kartik-sheet-style','style'=>'background-color: #fdfdfd'],
		'filterRowOptions'=>['class'=>'kartik-sheet-style skip-export','style'=>'background-color: #fdfdfd'],
		'pjax' => false,
		'bordered' => true,
		'striped' => true,
		'condensed' => true,
		'responsive' => true,
		'hover' => true,
		'showPageSummary' => true,
		'pageSummaryRowOptions'=>['class'=>'kv-page-summary','style'=>'background-color: #fdfdfd'],

		'panel' => [
			'type' => GridView::TYPE_DEFAULT,
			'heading' => false,
		],
		'toolbar' => [
			['content'=>
				Html::a('', ['index'], ['data-pjax'=>false, 'class' => 'btn btn-default', 'title'=>Yii::t('app', 'Reset Grid')])
			],
			'{export}',
			'{toggleData}'
		],
		'beforeHeader'=>[
			[
				/* uncomment to use additional header
				'columns'=>[
					['content'=>'Group 1', 'options'=>['colspan'=>6, 'class'=>'text-center','style'=>'background-color: #fdfdfd']],
					['content'=>'Group 2', 'options'=>['colspan'=>6, 'class'=>'text-center','style'=>'background-color: #fdfdfd']],
				],
				*/
				'options'=>['class'=>'skip-export'] // remove this row from export
			]
		],
		'floatHeader' => true,

		/* uncomment to use megeer some columns */
        'mergeColumns' => ['time','routeUser'],
        'type'=>'firstrow', // or use 'simple'

        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'kartik\grid\SerialColumn'],

            [
				'attribute' => 'time',
				'value' => 'route.time',
				'filterType'=>GridView::FILTER_DATE_RANGE,
				'filterWidgetOptions'=>[
					'pluginOptions' => [
						'format' => 'YYYY-MM-DD HH:mm:ss',
						'todayHighlight' => true,
						'timePicker'=>true,
						'timePickerIncrement'=>15,
						//'opens'=>'left'
					],
					'pluginEvents' => [
					"apply.daterangepicker" => 'function() {
									$(this).change();
								}',
					],
				],
			],
			[
				'attribute'=>'routeUser',
				'value' => 'route.user.username'
            ],
            [
				'attribute'=>'recordModel',
				'format'=>'raw',
				'value' => function($data) {
					$version = $data->getVersion();

					$rtml = $version?Html::encode(str_replace([",","/"],[", ","/ "],json_encode($version->attributes))):"";

					$attr = json_decode($data->record_attributes);
					if (is_array($attr) || is_object($attr))
					{
						foreach ($attr as $a=>$v)
						{
							$r = Html::encode(str_replace([",","/"],[", ","/ "],json_encode([$a=>$v])));
							$rtml = str_replace(substr($r,1,-1),str_replace(["{","}"],["",""],$r),$rtml);
						}
					}

					$html =  Html::tag("b",$data->record->model,["class"=>"text-primary"])."  ".Html::tag("span",$data->record->record_id,["class"=>"label label-primary"]);
					$html .= "
".Yii::t("app","Route").": ".$data->route->route."
".
							"".Yii::t("app","Attributes").": ".
							$rtml.
							"
";
					return $html;
				}
            ],/*
            [
				'attribute'=>'type',
				'value'=>function($data){
					return $data->itemAlias('type',$data->type);
				},
				'filterType'=>GridView::FILTER_SELECT2,
				'filterWidgetOptions'=>[
					'data'=>$searchModel->itemAlias('type'),
					'options' => ['placeholder' => Yii::t('app','Filter by type...')],
					'pluginOptions' => [
						'allowClear' => true
					],

				],
            ],*/
            [
				'attribute'=>'status',
				'format'=>'raw',
				'value'=>function($data){
					if ($data->status)
					{
						return Html::tag("span",$data->itemAlias('status',($data->status?1:0)),["class"=>"btn btn-xs btn-".($data->status?'success':'danger')." btn-block"]);
					}
					else
					{
						return Html::a($data->itemAlias('status',($data->status?1:0)),["//versioning/version/apply","id"=>$data->id],["class"=>"btn btn-xs btn-".($data->status?'success':'danger')." btn-block","title"=>Yii::t("app","Click to apply this version!"),"data"=>["confirm"=>Yii::t("app","Are you sure to apply this version?"),"method"=>"post"]]);
					}
				},
				'filterType'=>GridView::FILTER_SELECT2,
				'filterWidgetOptions'=>[
					'data'=>$searchModel->itemAlias('status'),
					'options' => ['placeholder' => Yii::t('app','Filter by status...')],
					'pluginOptions' => [
						'allowClear' => true
					],

				],
            ],
            /*[
				'attribute'=>'record_attributes',
				'value'=> function($data) {
					return str_replace("\\n","",$data->record_attributes);
				}
            ],*/

            // 'isdel',

            [
				'class' => 'kartik\grid\ActionColumn',
				'template'=>'{delete}'
            ],
        ],
    ]); ?>


text:
module Gitlab
  # Custom parser for GitLab-flavored Markdown
  #
  # It replaces references in the text with links to the appropriate items in
  # GitLab.
  #
  # Supported reference formats are:
  #   * @foo for team members
  #   * #123 for issues
  #   * !123 for merge requests
  #   * $123 for snippets
  #   * 123456 for commits
  #
  # It also parses Emoji codes to insert images. See
  # http://www.emoji-cheat-sheet.com/ for a list of the supported icons.
  #
  # Examples
  #
  #   >> gfm("Hey @david, can you fix this?")
  #   => "Hey @david, can you fix this?"
  #
  #   >> gfm("Commit 35d5f7c closes #1234")
  #   => "Commit 35d5f7c closes #1234"
  #
  #   >> gfm(":trollface:")
  #   => "
  module Markdown
    REFERENCE_PATTERN = %r{
      (?<prefix>\W)?                         # Prefix
      (                                      # Reference
         @(?<user>[a-zA-Z][a-zA-Z0-9_\-\.]*) # User name
        |\#(?<issue>\d+)                     # Issue ID
        |!(?<merge_request>\d+)              # MR ID
        |\$(?<snippet>\d+)                   # Snippet ID
        |(?<commit>[\h]{6,40})               # Commit ID
      )
      (?<suffix>\W)?                         # Suffix
    }x.freeze

    TYPES = [:user, :issue, :merge_request, :snippet, :commit].freeze

    EMOJI_PATTERN = %r{(:(\S+):)}.freeze

    attr_reader :html_options

    # Public: Parse the provided text with GitLab-Flavored Markdown
    #
    # text         - the source text
    # html_options - extra options for the reference links as given to link_to
    #
    # Note: reference links will only be generated if @project is set
    def gfm(text, html_options = {})
      return text if text.nil?

      # Duplicate the string so we don't alter the original, then call to_str
      # to cast it back to a String instead of a SafeBuffer. This is required
      # for gsub calls to work as we need them to.
      text = text.dup.to_str

      @html_options = html_options

      # Extract pre blocks so they are not altered
      # from http://github.github.com/github-flavored-markdown/
      extractions = {}
      text.gsub!(%r{
.*?
|.*?}m) do |match|
        md5 = Digest::MD5.hexdigest(match)
        extractions[md5] = match
        "{gfm-extraction-#{md5}}"
      end

      # TODO: add popups with additional information

      text = parse(text)

      # Insert pre block extractions
      text.gsub!(/\{gfm-extraction-(\h{32})\}/) do
        extractions[$1]
      end

      sanitize text.html_safe, attributes: ActionView::Base.sanitized_allowed_attributes + %w(id class)
    end

    private

    # Private: Parses text for references and emoji
    #
    # text - Text to parse
    #
    # Note: reference links will only be generated if @project is set
    #
    # Returns parsed text
    def parse(text)
      parse_references(text) if @project
      parse_emoji(text)

      text
    end

    def parse_references(text)
      # parse reference links
      text.gsub!(REFERENCE_PATTERN) do |match|
        prefix     = $~[:prefix]
        suffix     = $~[:suffix]
        type       = TYPES.select{|t| !$~[t].nil?}.first
        identifier = $~[type]

        # Avoid HTML entities
        if prefix && suffix && prefix[0] == '&' && suffix[-1] == ';'
          match
        elsif ref_link = reference_link(type, identifier)
          "#{prefix}#{ref_link}#{suffix}"
        else
          match
        end
      end
    end

    def parse_emoji(text)
      # parse emoji
      text.gsub!(EMOJI_PATTERN) do |match|
        if valid_emoji?($2)
          image_tag("emoji/#{$2}.png", size: "20x20", class: 'emoji', title: $1, alt: $1)
        else
          match
        end
      end
    end

    # Private: Checks if an emoji icon exists in the image asset directory
    #
    # emoji - Identifier of the emoji as a string (e.g., "+1", "heart")
    #
    # Returns boolean
    def valid_emoji?(emoji)
      Emoji.names.include? emoji
    end

    # Private: Dispatches to a dedicated processing method based on reference
    #
    # reference  - Object reference ("@1234", "!567", etc.)
    # identifier - Object identifier (Issue ID, SHA hash, etc.)
    #
    # Returns string rendered by the processing method
    def reference_link(type, identifier)
      send("reference_#{type}", identifier)
    end

    def reference_user(identifier)
      if member = @project.users_projects.joins(:user).where(users: { username: identifier }).first
        link_to("@#{identifier}", project_team_member_path(@project, member), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member
      end
    end

    def reference_issue(identifier)
      if issue = @project.issues.where(id: identifier).first
        link_to("##{identifier}", project_issue_path(@project, issue), html_options.merge(title: "Issue: #{issue.title}", class: "gfm gfm-issue #{html_options[:class]}"))
      end
    end

    def reference_merge_request(identifier)
      if merge_request = @project.merge_requests.where(id: identifier).first
        link_to("!#{identifier}", project_merge_request_path(@project, merge_request), html_options.merge(title: "Merge Request: #{merge_request.title}", class: "gfm gfm-merge_request #{html_options[:class]}"))
      end
    end

    def reference_snippet(identifier)
      if snippet = @project.snippets.where(id: identifier).first
        link_to("$#{identifier}", project_snippet_path(@project, snippet), html_options.merge(title: "Snippet: #{snippet.title}", class: "gfm gfm-snippet #{html_options[:class]}"))
      end
    end

    def reference_commit(identifier)
      if @project.valid_repo? && commit = @project.repository.commit(identifier)
        link_to(identifier, project_commit_path(@project, commit), html_options.merge(title: CommitDecorator.new(commit).link_title, class: "gfm gfm-commit #{html_options[:class]}"))
      end
    end
  end
end


text:
/*global define*/
define([
    'oroui/js/delete-confirmation',
    './mass-action'
], function (DeleteConfirmation, MassAction) {
    'use strict';

    var DeleteMassAction;

    /**
     * Delete mass action class.
     *
     * @export  oro/datagrid/action/delete-mass-action
     * @class   oro.datagrid.action.DeleteMassAction
     * @extends oro.datagrid.action.MassAction
     */
    DeleteMassAction = MassAction.extend({
        /** @property {Function} */
        confirmModalConstructor: DeleteConfirmation,

        /** @property {Object} */
        defaultMessages: {
            confirm_title: 'Delete Confirmation',
            confirm_content: 'Are you sure you want to do remove selected items?',
            confirm_ok: 'Yes, Delete',
            confirm_cancel: 'Cancel',
            success: 'Selected items were removed.',
            error: 'Selected items were not removed.',
            empty_selection: 'Please, select items to remove.'
        }
    });

    return DeleteMassAction;
});


text: require 'user_conf'


text:
CREATE DATABASE vagrant;
GRANT ALL PRIVILEGES ON vagrant.* TO 'vagrant'@'localhost' IDENTIFIED BY 'vagrant';


text:
package javax.servlet;

import java.util.EventListener;

	/**
	 * Implementations of this interface receive notifications about
	 * changes to the servlet context of the web application they are
	 * part of.
	 * To receive notification events, the implementation class
	 * must be configured in the deployment descriptor for the web
	 * application.
	 * @see ServletContextEvent
	 * @since	v 2.3
	 */

public interface ServletContextListener extends EventListener {
	/**
	 ** Notification that the web application initialization
	 ** process is starting.
	 ** All ServletContextListeners are notified of context
	 ** initialization before any filter or servlet in the web
	 ** application is initialized.
	 */

    public void contextInitialized ( ServletContextEvent sce );

	/**
	 ** Notification that the servlet context is about to be shut down.
	 ** All servlets and filters have been destroy()ed before any
	 ** ServletContextListeners are notified of context
	 ** destruction.
	 */
    public void contextDestroyed ( ServletContextEvent sce );
}


text:
package io.github.bonigarcia.seljup.test.annotations;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

import org.junit.jupiter.api.Test;
import org.openqa.selenium.Capabilities;

import io.github.bonigarcia.seljup.AnnotationsReader;
import io.github.bonigarcia.seljup.Options;
import io.github.bonigarcia.seljup.SeleniumJupiterException;

class AnnotationsReaderTest {

    AnnotationsReader annotationsReader = new AnnotationsReader();
    Optional<Object> testInstance = Optional.of(new ClassWithOptions());

    @Test
    void testThrowsExceptionWithNullCapabilitiesClass() throws Exception {
        assertThrows(SeleniumJupiterException.class, () -> {
            annotationsReader.getFromAnnotatedField(testInstance, Options.class,
                    null);
        }, "The parameter capabilitiesClass must not be null.");
    }

    @Test
    void testGetOptionsFromAnnotatedField() throws Exception {
        Capabilities options = annotationsReader.getFromAnnotatedField(
                testInstance, Options.class, Capabilities.class);
        assertThat(options).isNotNull();
    }

    @Test
    void testGetsOptionsFromAnnotatedFieldWithSpeciedType() throws Exception {
        CapabilitiesA optionsA = annotationsReader.getFromAnnotatedField(
                testInstance, Options.class, CapabilitiesA.class);
        assertThat(optionsA).isNotNull();
        assertThat(optionsA.getId()).isEqualTo("A");

        CapabilitiesB optionsB = annotationsReader.getFromAnnotatedField(
                testInstance, Options.class, CapabilitiesB.class);
        assertThat(optionsB).isNotNull();
        assertThat(optionsB.getId()).isEqualTo("B");
    }

    private static class ClassWithOptions {

        @Options
        Integer integer = 1;

        @Options
        CapabilitiesA capabilitiesA = new CapabilitiesA("A");

        @Options
        String string = "string";

        @Options
        CapabilitiesB capabilitiesB = new CapabilitiesB("B");

        @Options
        CapabilitiesA unreachable = new CapabilitiesA("unreachable");
    }

    private static class CapabilitiesA extends AbstractCapabilities {

        private static final long serialVersionUID = 5630780672421844735L;

        CapabilitiesA(String id) {
            super(id);
        }
    }

    private static class CapabilitiesB extends AbstractCapabilities {

        private static final long serialVersionUID = 8552813732742480499L;

        CapabilitiesB(String id) {
            super(id);
        }
    }

    private static abstract class AbstractCapabilities implements Capabilities {

        private static final long serialVersionUID = -2199141902686348117L;

        private static final Map<String, Object> capabilities = new HashMap<>();

        private final String id;

        AbstractCapabilities(String id) {
            this.id = id;
        }

        String getId() {
            return id;
        }

        @Override
        public Map<String, Object> asMap() {
            return capabilities;
        }

        @Override
        public Object getCapability(String capabilityName) {
            return capabilities.get(capabilityName);
        }
    }
}


text:
require 'spec_helper'

topo1 = {
  'name' => 'test1',
  'id' => 'test1',
  'nodes' => [
    {
      'name' => 'chefspec',
      'normal' => {
        'topo' => { 'node_type' => 'dbserver' },
        'one' => { 'a' => 'new_val' }
      }
    }
  ]
}

topo1_item = Chef::DataBagItem.from_hash(topo1)

describe 'topo::refresh_attributes' do
  let(:response_404) { OpenStruct.new(code: '404') }
  let(:exception_404) do
    Net::HTTPServerException.new('404 not found', response_404)
  end

  context 'When refresh_attributes is true' do
    let(:chef_run) do
      runner = ChefSpec::ServerRunner.new
      runner.node.override['topo']['name'] = 'test1'
      runner.node.override['topo']['refresh_attributes'] = true
      runner.node.normal['one']['a'] = 'orig_val'
      runner.node.default['one']['b'] = 'orig_val'
      allow(Chef::DataBagItem).to receive(:load).with(
        'topologies',
        'test1').and_return(topo1_item)
      runner.converge(described_recipe)
    end

    it 'sets node attributes' do
      expect(chef_run.node['one']['a']).to eq('new_val')
      expect(chef_run.node['one']['b']).to eq('orig_val')
    end
  end

  context 'When refresh_attributes is false and is in runlist' do
    let(:chef_run) do
      runner = ChefSpec::ServerRunner.new
      runner.node.override['topo']['name'] = 'test1'
      runner.node.override['topo']['refresh_attributes'] = false
      allow(Chef::DataBagItem).to receive(:load).with(
        'topologies',
        'test1').and_return(topo1_item)
      runner.converge(described_recipe)
    end

    it 'raises an exception' do
      expect { chef_run }.to raise_error(
        "Set node['topo']['refresh_attributes'] to true")
    end
  end

  context 'When refresh_attributes is false is not in runlist' do
    let(:chef_run) do
      runner = ChefSpec::ServerRunner.new
      runner.node.override['topo']['name'] = 'test1'
      runner.node.override['topo']['refresh_attributes'] = false
      runner.node.normal['one']['a'] = 'orig_val'
      runner.node.default['one']['b'] = 'orig_val'
      allow(Chef::DataBagItem).to receive(:load).with(
        'topologies',
        'test1').and_return(topo1_item)
      runner.converge('topo')
    end

    it 'does not set node attributes' do
      expect(chef_run.node['one']['a']).to eq('orig_val')
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#fb4f14</color>
    <color name="colorPrimaryDark">#e92e09</color>
    <color name="colorAccent">#a4c639</color>
    <color name="blue">#002244</color>
    <color name="orange">#fb4f14</color>
</resources>


text:
@implementation NSDictionary(BRDocBase_DictionaryExtensions)
-(NSDate*)docBaseModificationDate
{
	NSString* dateString = [self objectForKey:BRDocModificationDateKey];
	if (dateString) {
		return [NSDate dateWithDocBaseString:dateString];
	}
	//NSLog(@"converted string: %@ to date: %@", dateString, date);
	return nil;
	//return [NSDate dateWithDocBaseString:[self objectForKey:BRDocModificationDateKey]];
}

@end

@implementation NSMutableDictionary(BRDocBase_DictionaryExtensions)

-(id)initWithDocumentDictionary:(NSMutableDictionary*)dictionary
{
	return [self initWithDictionary:dictionary];
}

-(NSString*)documentId
{
	return [self objectForKey:BRDocIdKey];
}

-(void)setDocumentId:(NSString*)documentId
{
	NSMutableDictionary* mutable = (NSMutableDictionary*)self;
	[mutable setObject:documentId forKey:BRDocIdKey];
}

-(NSDate*)modificationDate
{
	return [self docBaseModificationDate];
}

-(void)setModificationDate:(NSDate*)modificationDate
{
	NSString* dateString = [modificationDate docBaseString];
	//NSLog(@"converted date: %@ to string: %@", modificationDate, dateString);
	//[self setObject:[modificationDate docBaseString] forKey:BRDocModificationDateKey];
	[self setObject:dateString forKey:BRDocModificationDateKey];
}

-(NSDictionary*)documentDictionary
{
	return self;
}

+(NSMutableDictionary*)dictionaryWithDocument:(id<BRDocument>)document objectsAndKeys:(id)firstObject,...
{
	NSMutableDictionary* dictionary = [NSMutableDictionary dictionary];
	[dictionary setObject:document.documentId forKey:BRDocIdKey];
	[dictionary setObject:[[document class] description] forKey:BRDocTypeKey];
	if ([document respondsToSelector:@selector(modificationDate)]) {
		NSString* docBaseDate = [document.modificationDate docBaseString];
		if (docBaseDate) [dictionary setObject:docBaseDate forKey:BRDocModificationDateKey];
	}
	va_list objectsAndKeys;
	va_start(objectsAndKeys, firstObject);
	id obj = firstObject;
	while (obj) {
		id key = va_arg(objectsAndKeys, id);
		[dictionary setObject:obj forKey:key];
		obj = va_arg(objectsAndKeys, id);
	}
	va_end(objectsAndKeys);

	return dictionary;
}

@end


text:
namespace chromeos {
class FrameCaptionButtonContainerView;
class ImmersiveFullscreenController;
}

namespace views {
class Widget;
}

namespace ash {

class NonClientFrameViewAshImmersiveHelper;

// A NonClientFrameView used for packaged apps, dialogs and other non-browser
// windows. It supports immersive fullscreen. When in immersive fullscreen, the
// client view takes up the entire widget and the window header is an overlay.
// The window header overlay slides onscreen when the user hovers the mouse at
// the top of the screen. See also views::CustomFrameView and
// BrowserNonClientFrameViewAsh.
class ASH_EXPORT NonClientFrameViewAsh
    : public views::NonClientFrameView,
      public FrameContextMenuController::Delegate {
 public:
  METADATA_HEADER(NonClientFrameViewAsh);

  // |control_immersive| controls whether ImmersiveFullscreenController is
  // created for the NonClientFrameViewAsh; if true and a WindowStateDelegate
  // has not been set on the WindowState associated with |frame|, then an
  // ImmersiveFullscreenController is created.
  explicit NonClientFrameViewAsh(views::Widget* frame);
  NonClientFrameViewAsh(const NonClientFrameViewAsh&) = delete;
  NonClientFrameViewAsh& operator=(const NonClientFrameViewAsh&) = delete;
  ~NonClientFrameViewAsh() override;

  static NonClientFrameViewAsh* Get(aura::Window* window);

  // Sets the caption button modeland updates the caption buttons.
  void SetCaptionButtonModel(
      std::unique_ptr<chromeos::CaptionButtonModel> model);

  // Inits |immersive_fullscreen_controller| so that the controller reveals
  // and hides |header_view_| in immersive fullscreen.
  // NonClientFrameViewAsh does not take ownership of
  // |immersive_fullscreen_controller|.
  void InitImmersiveFullscreenControllerForView(
      chromeos::ImmersiveFullscreenController* immersive_fullscreen_controller);

  // Sets the active and inactive frame colors. Note the inactive frame color
  // will have some transparency added when the frame is drawn.
  void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color);

  // Get the view of the header.
  HeaderView* GetHeaderView();

  // Calculate the client bounds for given window bounds.
  gfx::Rect GetClientBoundsForWindowBounds(
      const gfx::Rect& window_bounds) const;

  // views::NonClientFrameView:
  gfx::Rect GetBoundsForClientView() const override;
  gfx::Rect GetWindowBoundsForClientBounds(
      const gfx::Rect& client_bounds) const override;
  int NonClientHitTest(const gfx::Point& point) override;
  void GetWindowMask(const gfx::Size& size, SkPath* window_mask) override;
  void ResetWindowControls() override;
  void UpdateWindowIcon() override;
  void UpdateWindowTitle() override;
  void SizeConstraintsChanged() override;
  views::View::Views GetChildrenInZOrder() override;

  // views::View:
  gfx::Size CalculatePreferredSize() const override;
  void Layout() override;
  gfx::Size GetMinimumSize() const override;
  gfx::Size GetMaximumSize() const override;

  // FrameContextMenuController::Delegate:
  bool ShouldShowContextMenu(views::View* source,
                             const gfx::Point& screen_coords_point) override;

  // If |paint| is false, we should not paint the header. Used for overview mode
  // with OnOverviewModeStarting() and OnOverviewModeEnded() to hide/show the
  // header of v2 and ARC apps.
  virtual void SetShouldPaintHeader(bool paint);

  // Height from top of window to top of client area.
  int NonClientTopBorderHeight() const;

  // Expected height from top of window to top of client area when non client
  // view is visible.
  int NonClientTopBorderPreferredHeight() const;

  const views::View* GetAvatarIconViewForTest() const;

  SkColor GetActiveFrameColorForTest() const;
  SkColor GetInactiveFrameColorForTest() const;

  views::Widget* frame() { return frame_; }

  bool GetFrameEnabled() const { return frame_enabled_; }
  virtual void SetFrameEnabled(bool enabled);

  // Sets the callback to toggle the ARC++ resize-lock menu for this container
  // if applicable, which will be invoked via the keyboard shortcut.
  void SetToggleResizeLockMenuCallback(
      base::RepeatingCallback<void()> callback);
  base::RepeatingCallback<void()> GetToggleResizeLockMenuCallback() const;
  void ClearToggleResizeLockMenuCallback();

 protected:
  // views::View:
  void OnDidSchedulePaint(const gfx::Rect& r) override;

 private:
  class OverlayView;
  friend class NonClientFrameViewAshTestWidgetDelegate;
  friend class TestWidgetConstraintsDelegate;
  friend class WindowServiceDelegateImplTest;

  // views::NonClientFrameView:
  bool DoesIntersectRect(const views::View* target,
                         const gfx::Rect& rect) const override;

  // Returns the container for the minimize/maximize/close buttons that is
  // held by the HeaderView. Used in testing.
  chromeos::FrameCaptionButtonContainerView*
  GetFrameCaptionButtonContainerViewForTest();

  // Called when |frame_|'s "paint as active" state has changed.
  void PaintAsActiveChanged();

  // Not owned.
  views::Widget* const frame_;

  // View which contains the title and window controls.
  HeaderView* header_view_ = nullptr;

  OverlayView* overlay_view_ = nullptr;

  bool frame_enabled_ = true;

  std::unique_ptr<NonClientFrameViewAshImmersiveHelper> immersive_helper_;

  std::unique_ptr<FrameContextMenuController> frame_context_menu_controller_;

  base::CallbackListSubscription paint_as_active_subscription_ =
      frame_->RegisterPaintAsActiveChangedCallback(
          base::BindRepeating(&NonClientFrameViewAsh::PaintAsActiveChanged,
                              base::Unretained(this)));

  base::RepeatingCallback<void()> toggle_resize_lock_menu_callback_;

  base::WeakPtrFactory<NonClientFrameViewAsh> weak_factory_{this};
};

}  // namespace ash

#endif  // ASH_FRAME_NON_CLIENT_FRAME_VIEW_ASH_H_


text:
module.exports = {
    Squeeze: require('./squeeze'),
    SafeJson: require('./safe-json')
};


text:
<?php
namespace ZfcDatagridTest\Column;

use PHPUnit\Framework\TestCase;
use ZfcDatagrid\Column\Formatter;
use ZfcDatagrid\Column\Style;
use ZfcDatagrid\Column\Type;
use ZfcDatagrid\Filter;

/**
 * @group Column
 * @covers \ZfcDatagrid\Column\AbstractColumn
 */
class AbstractColumnTest extends TestCase
{
    public function testGeneral()
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);

        $this->assertEquals(5, $col->getWidth());
        $this->assertEquals(false, $col->isHidden());
        $this->assertEquals(false, $col->isIdentity());
        $this->assertInstanceOf(\ZfcDatagrid\Column\Type\AbstractType::class, $col->getType());
        $this->assertInstanceOf(\ZfcDatagrid\Column\Type\PhpString::class, $col->getType());

        $this->assertEquals(false, $col->isTranslationEnabled());

        $col->setLabel('test');
        $this->assertEquals('test', $col->getLabel());

        $col->setUniqueId('unique_id');
        $this->assertEquals('unique_id', $col->getUniqueId());

        $col->setWidth(30);
        $this->assertEquals(30, $col->getWidth());
        $col->setWidth(50.53);
        $this->assertEquals(50.53, $col->getWidth());

        $col->setHidden(true);
        $this->assertEquals(true, $col->isHidden());
        $col->setHidden(false);
        $this->assertEquals(false, $col->isHidden());

        $col->setIdentity(true);
        $this->assertEquals(true, $col->isIdentity());
        $col->setIdentity(false);
        $this->assertEquals(false, $col->isIdentity());
    }

    public function testStyle()
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);

        $this->assertEquals([], $col->getStyles());
        $this->assertEquals(false, $col->hasStyles());

        $col->addStyle(new Style\Bold());
        $this->assertEquals(true, $col->hasStyles());
        $this->assertEquals(1, count($col->getStyles()));

        $style = $col->getStyles();
        $style = array_pop($style);
        $this->assertInstanceOf(\ZfcDatagrid\Column\Style\Bold::class, $style);
        $this->assertInstanceOf(\ZfcDatagrid\Column\Style\AbstractStyle::class, $style);

        $col->setStyles([new Style\Bold()]);
        $style = $col->getStyles();
        $style = array_pop($style);
        $this->assertInstanceOf(\ZfcDatagrid\Column\Style\Bold::class, $style);
    }

    public function testType()
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);

        // DEFAULT
        $this->assertInstanceOf(\ZfcDatagrid\Column\Type\PhpString::class, $col->getType());

        $col->setType(new Type\PhpArray());
        $this->assertInstanceOf(\ZfcDatagrid\Column\Type\AbstractType::class, $col->getType());
        $this->assertInstanceOf(\ZfcDatagrid\Column\Type\PhpArray::class, $col->getType());

        $this->assertCount(0, $col->getFormatters());
        $col->setType(new Type\Image());
        $this->assertCount(1, $col->getFormatters());
        $this->assertInstanceOf(\ZfcDatagrid\Column\Formatter\Image::class, $col->getFormatters()[0]);
    }

    public function testSort()
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);

        $this->assertEquals(true, $col->isUserSortEnabled());
        $this->assertEquals(false, $col->hasSortDefault());
        $this->assertEquals([], $col->getSortDefault());

        $this->assertEquals(false, $col->isSortActive());

        $col->setUserSortDisabled(true);
        $this->assertEquals(false, $col->isUserSortEnabled());
        $col->setUserSortDisabled(false);
        $this->assertEquals(true, $col->isUserSortEnabled());

        $col->setSortDefault(1, 'DESC');
        $this->assertEquals([
            'priority'      => 1,
            'sortDirection' => 'DESC',
        ], $col->getSortDefault());
        $this->assertEquals(true, $col->hasSortDefault());

        $col->setSortActive('ASC');
        $this->assertEquals(true, $col->isSortActive());
        $this->assertEquals('ASC', $col->getSortActiveDirection());

        $col->setSortActive('DESC');
        $this->assertEquals(true, $col->isSortActive());
        $this->assertEquals('DESC', $col->getSortActiveDirection());
    }

    public function testFilter()
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);

        $this->assertEquals(true, $col->isUserFilterEnabled());

        $this->assertEquals(false, $col->hasFilterDefaultValue());

        $this->assertEquals(Filter::LIKE, $col->getFilterDefaultOperation());
        $this->assertEquals('', $col->getFilterDefaultValue());

        $this->assertEquals(false, $col->hasFilterSelectOptions());
        $this->assertEquals([], $col->getFilterSelectOptions());

        $this->assertEquals(false, $col->isFilterActive());
        $this->assertEquals('', $col->getFilterActiveValue());

        $col->setUserFilterDisabled(true);
        $this->assertEquals(false, $col->isUserFilterEnabled());
        $col->setUserFilterDisabled(false);
        $this->assertEquals(true, $col->isUserFilterEnabled());

        $col->setFilterDefaultValue('!=blubb');
        $this->assertEquals(true, $col->hasFilterDefaultValue());
        $this->assertEquals('!=blubb', $col->getFilterDefaultValue());

        $col->setFilterDefaultOperation(Filter::GREATER_EQUAL);
        $this->assertEquals(Filter::GREATER_EQUAL, $col->getFilterDefaultOperation());

        $col->setFilterSelectOptions([
            1 => 'one',
            2 => 'two',
        ]);
        $this->assertEquals(3, count($col->getFilterSelectOptions()));
        $this->assertEquals(true, $col->hasFilterSelectOptions());

        $col->setFilterSelectOptions([
            1 => 'one',
            2 => 'two',
        ], false);
        $this->assertEquals(2, count($col->getFilterSelectOptions()));
        $this->assertEquals(true, $col->hasFilterSelectOptions());

        $col->setFilterSelectOptions([], false);
        $this->assertEquals([], $col->getFilterSelectOptions());
        $this->assertEquals(false, $col->hasFilterSelectOptions());

        $col->setFilterActive('asdf');
        $this->assertEquals('asdf', $col->getFilterActiveValue());
        $this->assertEquals(true, $col->isFilterActive());
    }

    public function testSetGet()
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);

        $col->setTranslationEnabled(true);
        $this->assertEquals(true, $col->isTranslationEnabled());
        $col->setTranslationEnabled(false);
        $this->assertEquals(false, $col->isTranslationEnabled());

        $this->assertEquals(false, $col->hasReplaceValues());
        $this->assertEquals([], $col->getReplaceValues());
        $col->setReplaceValues([
            1,
            2,
            3,
        ]);
        $this->assertEquals(true, $col->hasReplaceValues());
        $this->assertEquals([
            1,
            2,
            3,
        ], $col->getReplaceValues());
        $this->assertEquals(true, $col->notReplacedGetEmpty());
        $col->setReplaceValues([
            1,
            2,
            3,
        ], false);
        $this->assertEquals(true, $col->hasReplaceValues());
        $this->assertEquals([
            1,
            2,
            3,
        ], $col->getReplaceValues());
        $this->assertEquals(false, $col->notReplacedGetEmpty());

        $this->assertEquals([], $col->getRendererParameters('jqGrid'));

        $col->setRendererParameter('key', 'value', 'someRenderer');
        $this->assertEquals([
            'key' => 'value',
        ], $col->getRendererParameters('someRenderer'));
    }

    public function testFormatters()
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);

        // DEFAULT
        $this->assertCount(0, $col->getFormatters());
        $this->assertFalse($col->hasFormatters());

        $col->setFormatters([new Formatter\Link()]);

        $this->assertTrue($col->hasFormatters());
        $this->assertEquals(1, count($col->getFormatters()));
        $this->assertInstanceOf(\ZfcDatagrid\Column\Formatter\AbstractFormatter::class, $col->getFormatters()[0]);
        $this->assertInstanceOf(\ZfcDatagrid\Column\Formatter\Link::class, $col->getFormatters()[0]);

        $col->addFormatter(new Formatter\Link());
        $this->assertEquals(2, count($col->getFormatters()));

        $col->setFormatters([new Formatter\Link(), new Formatter\Link(), new Formatter\Link()]);
        $this->assertEquals(3, count($col->getFormatters()));
    }

    public function testFormattersAdd()
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);

        $col->addFormatter(new Formatter\Link());

        $this->assertTrue($col->hasFormatters());
        $this->assertTrue(is_array($col->getFormatters()));
        $this->assertEquals(1, count($col->getFormatters()));
    }

    public function testRowClick()
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);

        $this->assertTrue($col->isRowClickEnabled());

        $col->setRowClickDisabled(true);
        $this->assertFalse($col->isRowClickEnabled());

        $col->setRowClickDisabled(false);
        $this->assertTrue($col->isRowClickEnabled());
    }

    public function testPosition(): void
    {
        /* @var $col \ZfcDatagrid\Column\AbstractColumn */
        $col = $this->getMockForAbstractClass(\ZfcDatagrid\Column\AbstractColumn::class);
        $this->assertNull($col->getPosition());
        $col->setPosition(null);
        $col->setPosition(1);
        $this->assertSame(1, $col->getPosition());
    }
}


text:
{{title}}

    <button class="btn btn-close" ng-click="closeMessage()">

        Close
    </button>

{{message}}

This message will automatically close in {{timeout}} {{units}}.

    <button ng-if="action1 && action1.text" type="button" ng-click="doAction1()">{{action1.text}}</button>
    <button ng-if="action2 && action2.text" type="button" ng-click="doAction2()">{{action2.text}}</button>
    <button class="btn-cancel" type="button" ng-click="closeMessage()">Close</button>


text:
@interface Common : NSObject

+ (BOOL)color:(UIColor *)color1
isEqualToColor:(UIColor *)color2
withTolerance:(CGFloat)tolerance;

@end


text:
  SMTP sunucusuna, SSL ile bağlanılıp bağlanılmayacağı bilgisidir. Varsayılan port numarası 465'tir.

  Diğer gelişmiş konfigürasyonlar, sistem özellikleri ayarlanarak yapılabilir.
  Bununla ilgili bu dokümanı okuyabilirsiniz.


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * Line Terminator between LeftHandSideExpression and "++" is not allowed
 *
 * @path ch11/11.3/11.3.1/S11.3.1_A1.1_T4.js
 * @description Checking Paragraph separator
 * @negative
 */

//CHECK#1
eval("var x = 1; x\u2029++");


text:
module.exports = {
    test: require.resolve("jquery"),
    loader: "expose-loader",
    options: {
        exposes: ["$", "jQuery"],
    },
};


text:
require "resurrection/model"
require "resurrection/engine"


text:
package com.huanyu.doc.demo;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.ImmutableMap;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.huanyu.doc.interview.array.StoreQRCode;

/**
 * @author yangtao
 */
public class SampleTest {

  private static final Logger logger = LoggerFactory.getLogger(SampleTest.class);

  private static final String SQL_LIKE_PARAM = "%%%s%%";
  private static final String MULTI_VARIABLE =
    "multi places variable to replace:%1$s|%2$s|%1$s|%1$s|%2$s|%1$s";

  private static final String QRCODE_FORMAT = "png";
  private static final int QRCODE_WIDTH = 600;
  private static final String QRCODE_CHARSET = "utf-8";
  private static final String DOT = ".";
  private static final Map<EncodeHintType, String> QRCODE_ENCODEHINTTYPE =
    ImmutableMap.<EncodeHintType, String>builder()//
      .put(EncodeHintType.CHARACTER_SET, QRCODE_CHARSET)//
      .build();

  @Test
  public void test() {
    Object[] o = new Object[3];
    o[0] = "1";
    o[1] = new Date();
    o[2] = BigDecimal.ONE;

    // logger.info(JSON.toJSONString(o));
    // logger.info(o.length);

    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    logger.info(format.format(new Date()));

    logger.info(String.format(SQL_LIKE_PARAM, "haha"));
    logger.info(String.format(MULTI_VARIABLE, "first", "second"));
  }

  @Test
  public void testa() {
    logger.info(qpcToStr(BigDecimal.valueOf(1.0000)));
  }

  public static String qpcToStr(BigDecimal qpc) {
    assert (qpc != null);
    String qpcStr = qpc.toString();
    if (qpcStr.indexOf('.') > 0) {
      int n = qpcStr.length() - 1;
      while (qpcStr.charAt(n) == '0')
        n--;
      if (qpcStr.charAt(n) == '.')
        n--;
      qpcStr = qpcStr.substring(0, n + 1);
    }
    return "1*" + qpcStr;
  }

  /**
   * 二维码生成测试
   *
   * @throws Exception
   */
  @Test
  public void generateQRCode() throws Exception {
    String text = "http://www.baidu.com";
    File file = generateQRCode(text, "qrcode");
    File file2 = generateQRCode(text, "/qrcode/store/testbn01/qrcode2");
  }

  private File generateQRCode(String content, String filePath) throws Exception {
    if (StringUtils.isBlank(content) || StringUtils.isBlank(filePath))
      throw new RuntimeException(StringUtils.isBlank(content) ? "待生成二维码的内容为空" : "待生成二维码文件名为空");

    File file = new File(StringUtils.join(filePath, DOT, QRCODE_FORMAT));
    createDir(file);

    BitMatrix bitMatrix = new MultiFormatWriter()
      .encode(content, BarcodeFormat.QR_CODE, QRCODE_WIDTH, QRCODE_WIDTH, QRCODE_ENCODEHINTTYPE);
    MatrixToImageWriter.writeToPath(bitMatrix, QRCODE_FORMAT, file.toPath());
    return file;
  }

  private static void createDir(File file) throws Exception {
    //判断目标文件所在的目录是否存在
    if (file.getParentFile() != null) {
      if (!file.getParentFile().exists()) {
        if (!file.getParentFile().getParentFile().exists()) {
          createDir(file.getParentFile());
        }
        logger.info("创建文件夹{}", new Object[]{file.getParentFile()});
        if (!file.getParentFile().mkdirs()) {
          logger.info("创建文件夹:{} 失败", new Object[]{file.getParentFile()});
          throw new RuntimeException("创建文件夹:" + file.getParentFile() + " 失败");
        }
      }
    }
  }

  @Test
  public void zipFiles() throws Exception {
    String text = "http://www.baidu.com";
    File file = generateQRCode(text, "qrcode");
    File file2 = generateQRCode(text, "/qrcode/store/testbn01/qrcode2");
    File[] files = Arrays.asList(file, file2).toArray(new File[2]);
    zipFiles("qrcodes.zip", "", files);
    zipFiles("qrcodes2.zip", "/qrcode/zip/testbn01/", files);
  }

  private File zipFiles(String zipName, String zipFilePath, File[] files) throws Exception {
    byte[] buffer = new byte[1024];
    ZipOutputStream out = null;
    File zipFile = new File(StringUtils.join(zipFilePath, zipName));
    try {
      if (StringUtils.isNotBlank(zipFilePath))
        createDir(zipFile);

      out = new ZipOutputStream(new FileOutputStream(StringUtils.join(zipFilePath, zipName)));
      for (int i = 0; i < files.length; i++) {
        FileInputStream fis = new FileInputStream(files[i]);
        out.putNextEntry(new ZipEntry(files[i].getName()));
        int len;
        while ((len = fis.read(buffer)) > 0) {
          out.write(buffer, 0, len);
        }
        out.closeEntry();
        fis.close();
      }
    } catch (Exception e) {
      logger.error("", e);
      throw e;
    } finally {
      if (out != null)
        out.close();
    }
    logger.info(String.format("生成%s成功", zipFile));
    return zipFile;
  }

  private File batchGenerateQRCodesAndzip(Map<String, String> qrCodeContents, String zipName,
    String zipFilePath) throws Exception {
    File zipFile = new File(StringUtils.join(zipFilePath, zipName));
    if (qrCodeContents.isEmpty() == false) {
      List<File> files = new ArrayList<File>();
      for (String key : qrCodeContents.keySet())
        files.add(generateQRCode(qrCodeContents.get(key), key));
      zipFiles(zipName, zipFilePath, files.toArray(new File[files.size()]));
    }

    logger.info(String.format("生成%s成功", zipFile));
    return zipFile;
  }

  @Test
  public void MathCeil() {
    logger.info("50123,after ceil:{}", Math.ceil(50123 / 100.0));
    logger.info("300,after ceil:{}", Math.ceil(300 / 100.0));
    logger.info("300,after ceil:{}", Math.ceil(301 / 100.0));

    for (int i = 0; i <= Math.ceil(120 / 100); i++) {
      logger.info("loop:" + i);
    }
  }

  private List<String> left(List<String> source, QueryStoreQRCodeResponse response) {
    List<String> contains = new ArrayList<String>();
    for (StoreQRCode storeQRCode : response.getQrCodes()) {
      contains.add(storeQRCode.getStoreId());
    }

    if (contains.isEmpty() == false)
      source.removeAll(contains);
    return source;
  }

  @Test
  public void listRemove() {
    List<String> source = new ArrayList<String>();
    source.add("123");
    source.add("456");
    source.add("789");
    source.add("147");
    source.add("258");
    source.add("369");

    List<StoreQRCode> qrCodes = new ArrayList<StoreQRCode>();
    StoreQRCode code1 = new StoreQRCode();
    code1.setStoreId("123");
    qrCodes.add(code1);

    StoreQRCode code2 = new StoreQRCode();
    code2.setStoreId("147");
    qrCodes.add(code2);

    StoreQRCode code3 = new StoreQRCode();
    code3.setStoreId("456");
    qrCodes.add(code3);

    QueryStoreQRCodeResponse response = new QueryStoreQRCodeResponse(qrCodes);

    List<String> target = left(source, response);

    logger.info("left:{}", JSON.toJSONString(target, true));
  }

  private <T extends Enum<T>> T cvtEnumType(Class<T> enumType, String value) {
    try {
      T result = Enum.valueOf(enumType, value);
      return result;
    } catch (Exception e) {
      logger.error("", e);
      return null;
    }
  }

  @Test
  public void judgeUrlPatternExclude() {
    //    String regex = "^*/checkService/check.hd$|(\\?sensitive\\=true|false)$";
    String regex = "^*/checkService/check.hd$|(\\.*sensitive\\=true|false)$";
    Pattern pattern = Pattern.compile(regex);

    String requestUri = "http:/localhost:8080/huanyu-web/checkService/check.html";
    logger.info("{} -> {}", requestUri, pattern.matcher(requestUri).find());

    String requestUri2 = "http:/localhost:8080/huanyu-web/checkService/check.html?sensitive=true";
    logger.info("{} -> {}", requestUri2, pattern.matcher(requestUri2).find());

    String requestUri3 = "http:/localhost:8080/huanyu-web/checkService/check.html?abc=true";
    logger.info("{} -> {}", requestUri3, pattern.matcher(requestUri3).find());

    String requestUri4 = "http:/localhost:8080/huanyu-web/checkService/check.html?sensitive=abc";
    logger.info("{} -> {}", requestUri4, pattern.matcher(requestUri4).find());

  }

}


text:
(function (root, factory) {

  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['underscore', 'backgrid'], factory);
  } else if (typeof exports === 'object') {
    // CommonJS
    var Backgrid = global.Backgrid || require("backgrid");
    module.exports = factory(require("lodash"),
                             Backgrid);
  } else {
    // Browser globals
    factory(root._, root.Backgrid);
  }

}(this, function (_, Backgrid)  {

  /**
     Renders a form with a text area and a save button in a modal dialog.

     @class Backgrid.Extension.TextareaEditor
     @extends Backgrid.CellEditor
  */
  var TextareaEditor = Backgrid.Extension.TextareaEditor = Backgrid.CellEditor.extend({

    /** @property */
    tagName: "div",

    /** @property */
    className: "modal fade",

    /** @property {function(Object, ?Object=): string} template */
    template: function (data) {
      return '

<form>
<button type="button" class="close" data-dismiss="modal">×</button>
' + data.column.get("label")  + '

<textarea cols="' + data.cols + '" rows="' + data.rows + '">' + data.content + '</textarea>

<input class="btn btn-primary" type="submit" value="Save"/>
</form>

';
    },

    /** @property */
    cols: 80,

    /** @property */
    rows: 10,

    /** @property */
    events: {
      "keydown textarea": "clearError",
      "submit": "saveOrCancel",
      "hide.bs.modal": "saveOrCancel",
      "hidden.bs.modal": "close",
      "shown.bs.modal": "focus"
    },

    /**
       @property {Object} modalOptions The options passed to Bootstrap's modal
       plugin.
    */
    modalOptions: {
      backdrop: false
    },

    /**
       Renders a modal form dialog with a textarea, submit button and a close button.
    */
    render: function () {
      this.$el.html($(this.template({
        column: this.column,
        cols: this.cols,
        rows: this.rows,
        content: this.formatter.fromRaw(this.model.get(this.column.get("name")))
      })));

      this.delegateEvents();

      this.$el.modal(this.modalOptions);

      return this;
    },

    /**
       Event handler. Saves the text in the text area to the model when
       submitting. When cancelling, if the text area is dirty, a confirmation
       dialog will pop up. If the user clicks confirm, the text will be saved to
       the model.

       Triggers a Backbone `backgrid:error` event from the model along with the
       model, column and the existing value as the parameters if the value
       cannot be converted.

       @param {Event} e
    */
    saveOrCancel: function (e) {
      if (e && e.type == "submit") {
        e.preventDefault();
        e.stopPropagation();
      }

      var model = this.model;
      var column = this.column;
      var val = this.$el.find("textarea").val();
      var newValue = this.formatter.toRaw(val);

      if (_.isUndefined(newValue)) {
        model.trigger("backgrid:error", model, column, val);

        if (e) {
          e.preventDefault();
          e.stopPropagation();
        }
      }
      else if (!e || e.type == "submit" ||
               (e.type == "hide" &&
                newValue !== (this.model.get(this.column.get("name")) || '').replace(/\r/g, '') &&
                confirm("Would you like to save your changes?"))) {

        model.set(column.get("name"), newValue);
        this.$el.modal("hide");
      }
      else if (e.type != "hide") this.$el.modal("hide");
    },

    /**
       Clears the error class on the parent cell.
     */
    clearError: _.debounce(function () {
      if (!_.isUndefined(this.formatter.toRaw(this.$el.find("textarea").val()))) {
        this.$el.parent().removeClass("error");
      }
    }, 150),

    /**
       Triggers a `backgrid:edited` event along with the cell editor as the
       parameter after the modal is hidden.

       @param {Event} e
    */
    close: function (e) {
      var model = this.model;
      model.trigger("backgrid:edited", model, this.column,
                    new Backgrid.Command(e));
    },

    /**
       Focuses the textarea when the modal is shown.
    */
    focus: function () {
      this.$el.find("textarea").focus();
    }

  });

  /**
     TextCell is a string cell type that renders a form with a text area in a
     modal dialog instead of an input box editor. It is best suited for entering
     a large body of text.

     @class Backgrid.Extension.TextCell
     @extends Backgrid.StringCell
  */
  Backgrid.Extension.TextCell = Backgrid.StringCell.extend({

    /** @property */
    className: "text-cell",

    /** @property  */
    editor: TextareaEditor

  });

}));


text:
package com.orientechnologies.orient.server.distributed;

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import org.junit.Assert;
import org.junit.Test;

import java.util.concurrent.Callable;

/**
 * Distributed TX test against "remote" protocol. It starts 3 servers and during a stress test, kill last server. The test checks
 * all the clients can auto-reconnect to the next available server.
 */
public class HACrashTest extends AbstractServerClusterTxTest {
  final static int SERVERS       = 3;
  volatile boolean inserting     = true;
  volatile int     serverStarted = 0;
  volatile boolean lastServerOn  = false;

  @Test
  public void test() throws Exception {
    startupNodesInSequence = true;
    count = 500;
    maxRetries = 10;
    init(SERVERS);
    prepare(false);
    execute();
  }

  @Override
  protected void onServerStarted(ServerRun server) {
    super.onServerStarted(server);

    if (serverStarted++ == (SERVERS - 1)) {
      lastServerOn = true;

      // RUN ASYNCHRONOUSLY
      new Thread(new Runnable() {
        @Override
        public void run() {
          try {
            // CRASH LAST SERVER try {
            executeWhen(new Callable<Boolean>() {
              // CONDITION
              @Override
              public Boolean call() throws Exception {
                final ODatabaseDocumentTx database = poolFactory.get(getDatabaseURL(serverInstance.get(0)), "admin", "admin")
                    .acquire();
                try {
                  return database.countClass("Person") > (count * SERVERS) * 1 / 3;
                } finally {
                  database.close();
                }
              }
            }, // ACTION
                new Callable() {
              @Override
              public Object call() throws Exception {
                Assert.assertTrue("Insert was too fast", inserting);
                banner("SIMULATE FAILURE ON SERVER " + (SERVERS - 1));
                serverInstance.get(SERVERS - 1).crashServer();
                lastServerOn = false;

                executeWhen(new Callable<Boolean>() {
                  @Override
                  public Boolean call() throws Exception {
                    final ODatabaseDocumentTx database = poolFactory.get(getDatabaseURL(serverInstance.get(0)), "admin", "admin")
                        .acquire();
                    try {
                      return database.countClass("Person") > (count * SERVERS) * 2 / 3;
                    } finally {
                      database.close();
                    }
                  }
                }, new Callable() {
                  @Override
                  public Object call() throws Exception {
                    Assert.assertTrue("Insert was too fast", inserting);

                    banner("RESTARTING SERVER " + (SERVERS - 1) + "...");
                    try {
                      serverInstance.get(SERVERS - 1)
                          .startServer(getDistributedServerConfiguration(serverInstance.get(SERVERS - 1)));
                      lastServerOn = true;
                    } catch (Exception e) {
                      e.printStackTrace();
                    }
                    return null;
                  }
                });
                return null;
              }
            });

          } catch (Exception e) {
            e.printStackTrace();
            Assert.fail("Error on execution flow");
          }
        }
      }).start();
    }
  }

  @Override
  protected void onAfterExecution() throws Exception {
    inserting = false;
    Assert.assertTrue(lastServerOn);
  }

  protected String getDatabaseURL(final ServerRun server) {
    return "remote:" + server.getBinaryProtocolAddress() + "/" + getDatabaseName();
  }

  @Override
  public String getDatabaseName() {
    return "distributed-txhacrash";
  }
}


text:
package org.vaadin.gridutil.renderer;

import com.vaadin.ui.renderers.ClickableRenderer;

/**
 * Add an edit buttons next to the value (value is rendered as HTML)
 *
 * @author Marten Prieß (http://www.rocketbase.io)
 * @version 1.0
 */
public class EditButtonValueRenderer<T> extends ClickableRenderer<T, String> {

    /**
     * "injects" a edit button in the cell
     *
     * @param listener that get triggered on click on the button
     */
    public EditButtonValueRenderer(final RendererClickListener<T> listener) {
        super(String.class);
        addClickListener(listener);
    }

}


text:
trib
====

Short for ConTRIBute as well as TRIBe. Mojito / YUI


text:
'use strict'

var express = require('express');
var { Wirestub } = require('./../models/models');
var { wirestubServices } = require('./../services/services');

var router = express.Router({ mergeParams: true });

router.post('/', async(req, res, next) => {
    let appId = req.params.appId;
    let wirestub = new Wirestub(req.body);
    let [error, data, code, result] = (await wirestubServices.create(appId, wirestub)).get();
    if (!error) {
        if (code === 201){
            res.set('location', `http://localhost:${wirestub.port}`);
        }
        return res.status(code).send(result.message);
    } else {
        return res.status(code).send(error.message);
    }
});

router.get('/', async(req, res) => {
    let appId = req.params.appId;
    let [error, wirestub, code] = (await wirestubServices.get(appId)).get();
    if (!error) {
        return res.status(200).send(wirestub);
    } else {
        return res.status(code).send(error.message);
    }
});

router.delete('/', async(req, res) => {
    let appId = req.params.appId;
    let [error, data, code] = (await wirestubServices.delete(appId)).get();
    if (!error) {
        return res.status(204).send('Wirestub deleted');
    } else {
        return res.status(code).send(error.message);
    }
});

module.exports = router


text:
'use strict';

// Configuring the Articles module
angular.module('mines').run(['Menus',
	function(Menus) {
		// Set top bar menu items
		Menus.addMenuItem('topbar', 'Mines', 'mines', 'dropdown', '/mines(/create)?');
		Menus.addSubMenuItem('topbar', 'mines', 'List Mines', 'mines');
		Menus.addSubMenuItem('topbar', 'mines', 'New Mine', 'mines/create');
	}
]);


text:
package com.segal.mongorest.web.exception;

/**
 * Created with IntelliJ IDEA.
 * User: Jeff
 * Date: 4/15/14
 * Time: 5:16 PM
 * To change this template use File | Settings | File Templates.
 */
public class UnknownResourceException extends RuntimeException {

	private static final long serialVersionUID = -6784100527964021242L;

	public UnknownResourceException(String message) {
		super(message);
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:os-events="http://www.openspaces.org/schema/events"
      xmlns:os-core="http://www.openspaces.org/schema/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xmlns:os-eventcontainer="http://www.openspaces.org/schema/mule/os-eventcontainer"
      xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"

      xsi:schemaLocation="http://www.openspaces.org/schema/core http://www.openspaces.org/schema/core/openspaces-core.xsd
       http://www.openspaces.org/schema/events http://www.openspaces.org/schema/events/openspaces-events.xsd
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
         http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.7/mule.xsd
       http://www.mulesoft.org/schema/mule/stdio ttp://www.mulesoft.org/schema/mule/stdio/3.7/mule-stdio.xsd
       http://www.openspaces.org/schema/mule/os-eventcontainer http://www.openspaces.org/schema/11.0/mule/3.7/mule-os-eventcontainer.xsd">

    <description>Tests mule connector, receive and process single object at a time.</description>

    <spring:beans>
        <!--
            A bean representing a space (an IJSpace implementation).
        -->
        <os-core:space id="space" url="/./space" lookup-groups="${user.name}"/>

        <!--
            OpenSpaces simplified space API built on top of IJSpace/JavaSpace.
        -->
        <os-core:giga-space id="gigaSpace" space="space"/>

        <!--
            A polling event container that performs (by default) polling take operations against
            the space using the provided template (in our case, and the non processed data objects).
            Once a match is found, the data processor bean event listener is triggered using the
            annotation adapter.
        -->
        <os-events:polling-container id="helloPollingEventContainer" giga-space="gigaSpace">
            <os-core:template>
                <spring:bean class="org.openspaces.itest.esb.mule.SimpleMessage">
                    <spring:property name="read" value="false"/>
                </spring:bean>
            </os-core:template>
        </os-events:polling-container>
    </spring:beans>

    <!-- this connector must be declared ,in order to inject the  Spring appliction context -->
    <os-eventcontainer:connector name="gigaSpacesConnector"/>

    <!--The Mule model initialises and manages your UMO components-->

    <!-- MessageTransformer in order to transfer the metadata from the UMOmessage to the dispatched object -->
    <custom-transformer name="MessageTransformer" class="org.openspaces.itest.esb.mule.message.MessageTransformer"/>

    <model name="helloSample">

        <service name="MessageReaderUMO">

            <inbound>
                <os-eventcontainer:inbound-endpoint address="os-eventcontainer://helloPollingEventContainer"/>
            </inbound>

            <component class="org.openspaces.itest.esb.mule.MessageReader"/>

            <outbound>
                <pass-through-router>
                    <outbound-endpoint address="os-eventcontainer://gigaSpace" transformer-refs="MessageTransformer"/>
                </pass-through-router>
            </outbound>
        </service>
    </model>

</mule>


text:
/**
 * @file telnetPutc.c
 */
/* Embedded Xinu, Copyright (C) 2009, 2013.  All rights reserved. */

#include <telnet.h>
#include <device.h>

/**
 * @ingroup telnet
 *
 * Write a single character to TELNET.
 *
 * @param devptr
 *      TELNET device table entry
 * @param ch
 *      character to output
 *
 * @return
 *      @p ch as an unsigned char cast to an @c int on success; @c
 *      SYSERR on failure.
 */
devcall telnetPutc(device *devptr, char ch)
{
    int ret;

    ret = telnetWrite(devptr, &ch, 1);
    if (ret == 1)
    {
        return (uchar)ch;
    }
    else
    {
        return SYSERR;
    }
}


text:
<?php
/**
 * Header template for pages with cover photos.
 *
 * @author      Maded Batara III
 * @author      Michael Daryl Mayo
 * @version     v20171014
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>

    <meta charset="<?php bloginfo('charset'); ?>" />
    <meta name="viewport" content="width=device-width" />
    <title>
      <?php bloginfo('name');  ?> | <?php is_front_page() ? bloginfo('description') : wp_title(''); ?>
    </title>

    <link rel="profile" href="http://gmpg.org/xfn/11" />

    <?php wp_head(); ?>

<body <?php body_class('karla'); ?>>

  <?php
    if (is_post_type_archive("yh_project")
      && !empty(get_field('projects', 'options')['cover_photo']['url'])) {
        // Project archive list, image defined
        $cover_is_image = true;
        $cover_image = get_field('projects', 'options')['cover_photo']['url'];
        $text_color = "white";
        $title = get_field('projects', 'options')['title'];
    } else if (is_home()
      && !empty(get_field('blog', 'options')['color']) ) {
        // Blog post list, color defined
        $cover_is_image = false;
        $color = get_field('blog', 'options')['color'];
        $text_color = brightness($color) > 65.0 ? "black" : "white";
        $title = isset(get_field('blog', 'options')['title'])
          ? get_field('blog', 'options')['title'] : "Blog";
    } else if (!empty(wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full")[0])) {
        // Featured image defined
        $cover_is_image = true;
        $cover_image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full")[0];
        $text_color = "white";
        $title = get_the_title();
    } else {
        // Default
        $cover_is_image = false;
        $color = "var(--youthhack-navy)";
        $text_color = "white";
        $title = get_the_title();
    }
  ?>

  <header id="masthead"
    <?php if ($cover_is_image): ?>
      style="background: <?php echo dots(); ?>, url(<?php echo $cover_image; ?>) top left / cover;"
    <?php else: ?>
      style="background: <?php echo $color ?>;"
    <?php endif; ?>
    class="flex flex-wrap vh-50 pb3 <?php echo $cover_is_image ? 'bg-tint-black-50' : 'bg-yh-blue' ?>">

    <?php
      set_query_var("nav_text_color", $text_color);
      get_template_part("partials/header", "nav");
    ?>

    <h1 class="di mt6 mh6 mb4 pt4 underline td-yh-blue <?php echo $text_color ?> f-subheadline ttu tracked-tight"><?php echo $title ?>


text:
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
//
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
// copy, modify, and distribute this software in source code or binary form for use
// in connection with the web services and APIs provided by Facebook.
//
// As with any software that integrates with the Facebook platform, your use of
// this software is subject to the Facebook Developer Principles and Policies
// [http://developers.facebook.com/policy/]. This copyright 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.

#import <Foundation/Foundation.h>

/**
 Flags to indicate support for newer bridge options beyond the initial 20130410 implementation.
 */
typedef NS_OPTIONS(NSUInteger, FBSDKShareBridgeOptions)
{
  FBSDKShareBridgeOptionsDefault       = 0,
  FBSDKShareBridgeOptionsPhotoAsset    = 1 << 0,
  FBSDKShareBridgeOptionsPhotoImageURL = 1 << 1, // if set, a web-based URL is required; asset, image, and imageURL.isFileURL not allowed
  FBSDKShareBridgeOptionsVideoAsset    = 1 << 2,
  FBSDKShareBridgeOptionsVideoData     = 1 << 3,
  FBSDKShareBridgeOptionsWebHashtag    = 1 << 4, // if set, pass the hashtag as a string value, not an array of one string
};

/**
 A base interface for validation of content and media.
 */
@protocol FBSDKSharingValidation

/**
 Asks the receiver to validate that its content or media values are valid.
 - Parameter errorRef: Optional, will receive an FBSDKShareError if the values are not valid.
 - Returns: YES if the receiver's values are valid; otherwise NO
 */
- (BOOL)validateWithOptions:(FBSDKShareBridgeOptions)bridgeOptions error:(NSError *__autoreleasing *)errorRef;

@end


text:
class Zucchini::Generator < Clamp::Command
  option %W(-p --project), :flag, "Generate a project"
  option %W(-f --feature), :flag, "Generate a feature"

  parameter "PATH", "Path"

  def templates_path
    File.expand_path("#{File.dirname(__FILE__)}/../../templates")
  end

  def execute
    if project?
      FileUtils.mkdir_p(path)
      FileUtils.cp_r("#{templates_path}/project/.", path)
    elsif feature? then FileUtils.cp_r("#{templates_path}/feature", path)
    end
  end
end


text:
<TITLE>Environment Variables</TITLE>
<META NAME="description" CONTENT="Environment Variables">
<META NAME="keywords" CONTENT="debian-tutorial">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="debian-tutorial.css">

<LINK REL="next" HREF="node56.html">
<LINK REL="previous" HREF="node54.html">
<LINK REL="up" HREF="node54.html">
<LINK REL="next" HREF="node56.html">

 Next: Where Commands Reside: The
 Up: Using the Shell
 Previous: Using the Shell
 &nbsp   Contents
 &nbsp   Index

Environment Variables

Every process has an environment associated with it. An environment
is a collection of environment variables. A variable is a changeable
value with a fixed name. For example, the name <TT>EMAIL</TT> could refer to
the value <TT>joe@nowhere.com</TT>. The value can vary; <TT>EMAIL</TT> could
also refer to <TT>jane@somewhere.com</TT>.

Because your shell is a process like any other, it has an environment. You can
view your shell's environment by entering the <TT>printenv</TT> command.

Figure 6.1:
Sample <TT>printenv</TT> output

Figure 6.1 on page
has some sample output from <TT>printenv</TT>. On your system, the output will
be different but similar.

Environment variables are one way to configure the system. For example, the
<TT>EDITOR</TT> variable lets you select your preferred editor for posting news,
writing e-mail, and so on.

Setting environment variables is simple. For practice, try customizing your
shell's prompt and your text file viewer with environment variables. First,
let's get a bit of background information.

man less

This command lets you view the online manual for the <TT>less</TT> command.
In order to show you the text one screenful at a time, <TT>man</TT> invokes
a pager that shows you a new page of text each time you press the space
bar. By default, it uses the pager called <TT>more</TT>.

Go ahead and glance over the man page for
<TT>less</TT>, which is an enhanced pager. Scroll to a new page by pressing
space; press <TT>q</TT> to quit. <TT>more</TT> will also quit automatically
when you reach the end of the man page.

export PAGER=less

After reading about the advantages of <TT>less</TT>, you might want to use it
to read man pages. To do this, you set the environment variable <TT>PAGER</TT>.

The command to set an environment variable within <TT>bash</TT> always has this
format:

export NAME=value

<TT>export</TT> means to move the variable from the shell into the environment.
This means that programs other than the shell (for instance, a file
viewer) will be able to access it.

echo $PAGER

This is the easiest way to see the value of a variable. <TT>$PAGER</TT> tells
the shell to insert the value of the <TT>PAGER</TT> variable before
invoking the command. <TT>echo</TT> echoes back its argument: in this case,
it echoes the current <TT>PAGER</TT> value, <TT>less</TT>.

man more

Displays the <TT>more</TT> manual. This time, <TT>man</TT> should have invoked
the <TT>less</TT> pager.

<TT>less</TT> has lots of features that <TT>more</TT> lacks. For example, you
can scroll backward with the <TT>b</TT> key. You can also move up and down (even
sideways) with the arrow keys. <TT>less</TT> won't exit when it reaches the
end of the man page; it will wait for you to press <TT>q</TT>.

You can try out some <TT>less</TT>-specific commands, like <TT>b</TT>, to verify
that they don't work with <TT>more</TT> and that you are indeed using <TT>more</TT>.

unset PAGER

If you don't want to specify a pager anymore, you can <TT>unset</TT> the variable.
<TT>man</TT> will then use <TT>more</TT> by default, just as it did before you
set the variable.

echo $PAGER

Because <TT>PAGER</TT> has been unset, <TT>echo</TT> won't print anything.

PS1=hello:

Figure 6.2:
Changing the prompt

Just for fun, change your shell prompt. <TT>$</TT> should now change; see Figure
6.2 for details.

<TT>export</TT> is not necessary, because you're changing the shell's own behavior.
There's no reason to export the variable into the environment for other programs
to see. Technically, <TT>PS1</TT> is a shell variable rather than an
environment variable.

If you wanted to, you could <TT>export</TT> the shell variable, transforming
it into an environment variable. If you do this, programs you run from the shell
can see it.

 Next: Where Commands Reside: The
 Up: Using the Shell
 Previous: Using the Shell
 &nbsp   Contents
 &nbsp   Index

<ADDRESS>
John Goerzen / Ossama Othman
</ADDRESS>