text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE act
  PUBLIC "urn:pubid:dita4publishers.org:doctypes:dita:shakespear:dtd:act" "act.dtd">
<act id="act-1">
   <title>ACT I</title>
   <scene id="act-1-scene-1">
      <title>SCENE I.  Verona. An open place.</title>
      <scene-body>
         <stagedir>Enter VALENTINE and PROTEUS</stagedir>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>Cease to persuade, my loving Proteus:</line>
            <line>Home-keeping youth have ever homely wits.</line>
            <line>Were't not affection chains thy tender days</line>
            <line>To the sweet glances of thy honour'd love,</line>
            <line>I rather would entreat thy company</line>
            <line>To see the wonders of the world abroad,</line>
            <line>Than, living dully sluggardized at home,</line>
            <line>Wear out thy youth with shapeless idleness.</line>
            <line>But since thou lovest, love still and thrive therein,</line>
            <line>Even as I would when I to love begin.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Wilt thou be gone? Sweet Valentine, adieu!</line>
            <line>Think on thy Proteus, when thou haply seest</line>
            <line>Some rare note-worthy object in thy travel:</line>
            <line>Wish me partaker in thy happiness</line>
            <line>When thou dost meet good hap; and in thy danger,</line>
            <line>If ever danger do environ thee,</line>
            <line>Commend thy grievance to my holy prayers,</line>
            <line>For I will be thy beadsman, Valentine.</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>And on a love-book pray for my success?</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Upon some book I love I'll pray for thee.</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>That's on some shallow story of deep love:</line>
            <line>How young Leander cross'd the Hellespont.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>That's a deep story of a deeper love:</line>
            <line>For he was more than over shoes in love.</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>'Tis true; for you are over boots in love,</line>
            <line>And yet you never swum the Hellespont.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Over the boots? nay, give me not the boots.</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>No, I will not, for it boots thee not.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>What?</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>To be in love, where scorn is bought with groans;</line>
            <line>Coy looks with heart-sore sighs; one fading moment's mirth</line>
            <line>With twenty watchful, weary, tedious nights:</line>
            <line>If haply won, perhaps a hapless gain;</line>
            <line>If lost, why then a grievous labour won;</line>
            <line>However, but a folly bought with wit,</line>
            <line>Or else a wit by folly vanquished.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>So, by your circumstance, you call me fool.</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>So, by your circumstance, I fear you'll prove.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>'Tis love you cavil at: I am not Love.</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>Love is your master, for he masters you:</line>
            <line>And he that is so yoked by a fool,</line>
            <line>Methinks, should not be chronicled for wise.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Yet writers say, as in the sweetest bud</line>
            <line>The eating canker dwells, so eating love</line>
            <line>Inhabits in the finest wits of all.</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>And writers say, as the most forward bud</line>
            <line>Is eaten by the canker ere it blow,</line>
            <line>Even so by love the young and tender wit</line>
            <line>Is turn'd to folly, blasting in the bud,</line>
            <line>Losing his verdure even in the prime</line>
            <line>And all the fair effects of future hopes.</line>
            <line>But wherefore waste I time to counsel thee,</line>
            <line>That art a votary to fond desire?</line>
            <line>Once more adieu! my father at the road</line>
            <line>Expects my coming, there to see me shipp'd.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>And thither will I bring thee, Valentine.</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>Sweet Proteus, no; now let us take our leave.</line>
            <line>To Milan let me hear from thee by letters</line>
            <line>Of thy success in love, and what news else</line>
            <line>Betideth here in absence of thy friend;</line>
            <line>And likewise will visit thee with mine.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>All happiness bechance to thee in Milan!</line>
         </speech>
         <speech>
            <speaker>VALENTINE</speaker>
            <line>As much to you at home! and so, farewell.</line>
         </speech>
         <stagedir>Exit</stagedir>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>He after honour hunts, I after love:</line>
            <line>He leaves his friends to dignify them more,</line>
            <line>I leave myself, my friends and all, for love.</line>
            <line>Thou, Julia, thou hast metamorphosed me,</line>
            <line>Made me neglect my studies, lose my time,</line>
            <line>War with good counsel, set the world at nought;</line>
            <line>Made wit with musing weak, heart sick with thought.</line>
         </speech>
         <stagedir>Enter SPEED</stagedir>
         <speech>
            <speaker>SPEED</speaker>
            <line>Sir Proteus, save you! Saw you my master?</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>But now he parted hence, to embark for Milan.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Twenty to one then he is shipp'd already,</line>
            <line>And I have play'd the sheep in losing him.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Indeed, a sheep doth very often stray,</line>
            <line>An if the shepherd be a while away.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>You conclude that my master is a shepherd, then,</line>
            <line>and I a sheep?</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>I do.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Why then, my horns are his horns, whether I wake or sleep.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>A silly answer and fitting well a sheep.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>This proves me still a sheep.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>True; and thy master a shepherd.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Nay, that I can deny by a circumstance.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>It shall go hard but I'll prove it by another.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>The shepherd seeks the sheep, and not the sheep the</line>
            <line>shepherd; but I seek my master, and my master seeks</line>
            <line>not me: therefore I am no sheep.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>The sheep for fodder follow the shepherd; the</line>
            <line>shepherd for food follows not the sheep: thou for</line>
            <line>wages followest thy master; thy master for wages</line>
            <line>follows not thee: therefore thou art a sheep.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Such another proof will make me cry 'baa.'</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>But, dost thou hear? gavest thou my letter to Julia?</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Ay sir: I, a lost mutton, gave your letter to her,</line>
            <line>a laced mutton, and she, a laced mutton, gave me, a</line>
            <line>lost mutton, nothing for my labour.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Here's too small a pasture for such store of muttons.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>If the ground be overcharged, you were best stick her.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Nay: in that you are astray, 'twere best pound you.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Nay, sir, less than a pound shall serve me for</line>
            <line>carrying your letter.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>You mistake; I mean the pound,--a pinfold.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>From a pound to a pin? fold it over and over,</line>
            <line>'Tis threefold too little for carrying a letter to</line>
            <line>your lover.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>But what said she?</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>
               <stagedir>First nodding</stagedir>  Ay.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Nod--Ay--why, that's noddy.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>You mistook, sir; I say, she did nod: and you ask</line>
            <line>me if she did nod; and I say, 'Ay.'</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>And that set together is noddy.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Now you have taken the pains to set it together,</line>
            <line>take it for your pains.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>No, no; you shall have it for bearing the letter.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Well, I perceive I must be fain to bear with you.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Why sir, how do you bear with me?</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Marry, sir, the letter, very orderly; having nothing</line>
            <line>but the word 'noddy' for my pains.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Beshrew me, but you have a quick wit.</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>And yet it cannot overtake your slow purse.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Come come, open the matter in brief: what said she?</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Open your purse, that the money and the matter may</line>
            <line>be both at once delivered.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Well, sir, here is for your pains. What said she?</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Truly, sir, I think you'll hardly win her.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Why, couldst thou perceive so much from her?</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>Sir, I could perceive nothing at all from her; no,</line>
            <line>not so much as a ducat for delivering your letter:</line>
            <line>and being so hard to me that brought your mind, I</line>
            <line>fear she'll prove as hard to you in telling your</line>
            <line>mind. Give her no token but stones; for she's as</line>
            <line>hard as steel.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>What said she? nothing?</line>
         </speech>
         <speech>
            <speaker>SPEED</speaker>
            <line>No, not so much as 'Take this for thy pains.' To</line>
            <line>testify your bounty, I thank you, you have testerned</line>
            <line>me; in requital whereof, henceforth carry your</line>
            <line>letters yourself: and so, sir, I'll commend you to my master.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Go, go, be gone, to save your ship from wreck,</line>
            <line>Which cannot perish having thee aboard,</line>
            <line>Being destined to a drier death on shore.</line>
            <stagedir>Exit SPEED</stagedir>
            <line>I must go send some better messenger:</line>
            <line>I fear my Julia would not deign my lines,</line>
            <line>Receiving them from such a worthless post.</line>
         </speech>
         <stagedir>Exit</stagedir>
      </scene-body>
   </scene>
   <scene id="act-1-scene-2">
      <title>SCENE II.  The same. Garden of JULIA's house.</title>
      <scene-body>
         <stagedir>Enter JULlA and LUCETTA</stagedir>
         <speech>
            <speaker>JULIA</speaker>
            <line>But say, Lucetta, now we are alone,</line>
            <line>Wouldst thou then counsel me to fall in love?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Ay, madam, so you stumble not unheedfully.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Of all the fair resort of gentlemen</line>
            <line>That every day with parle encounter me,</line>
            <line>In thy opinion which is worthiest love?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Please you repeat their names, I'll show my mind</line>
            <line>According to my shallow simple skill.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>What think'st thou of the fair Sir Eglamour?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>As of a knight well-spoken, neat and fine;</line>
            <line>But, were I you, he never should be mine.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>What think'st thou of the rich Mercatio?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Well of his wealth; but of himself, so so.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>What think'st thou of the gentle Proteus?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Lord, Lord! to see what folly reigns in us!</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>How now! what means this passion at his name?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Pardon, dear madam: 'tis a passing shame</line>
            <line>That I, unworthy body as I am,</line>
            <line>Should censure thus on lovely gentlemen.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Why not on Proteus, as of all the rest?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Then thus: of many good I think him best.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Your reason?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>I have no other, but a woman's reason;</line>
            <line>I think him so because I think him so.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>And wouldst thou have me cast my love on him?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Ay, if you thought your love not cast away.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Why he, of all the rest, hath never moved me.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Yet he, of all the rest, I think, best loves ye.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>His little speaking shows his love but small.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Fire that's closest kept burns most of all.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>They do not love that do not show their love.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>O, they love least that let men know their love.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>I would I knew his mind.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Peruse this paper, madam.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>'To Julia.' Say, from whom?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>That the contents will show.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Say, say, who gave it thee?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Valentine's page; and sent, I think, from Proteus.</line>
            <line>He would have given it you; but I, being in the way,</line>
            <line>Did in your name receive it: pardon the</line>
            <line>fault I pray.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Now, by my modesty, a goodly broker!</line>
            <line>Dare you presume to harbour wanton lines?</line>
            <line>To whisper and conspire against my youth?</line>
            <line>Now, trust me, 'tis an office of great worth</line>
            <line>And you an officer fit for the place.</line>
            <line>Or else return no more into my sight.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>To plead for love deserves more fee than hate.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Will ye be gone?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>That you may ruminate.</line>
         </speech>
         <stagedir>Exit</stagedir>
         <speech>
            <speaker>JULIA</speaker>
            <line>And yet I would I had o'erlooked the letter:</line>
            <line>It were a shame to call her back again</line>
            <line>And pray her to a fault for which I chid her.</line>
            <line>What a fool is she, that knows I am a maid,</line>
            <line>And would not force the letter to my view!</line>
            <line>Since maids, in modesty, say 'no' to that</line>
            <line>Which they would have the profferer construe 'ay.'</line>
            <line>Fie, fie, how wayward is this foolish love</line>
            <line>That, like a testy babe, will scratch the nurse</line>
            <line>And presently all humbled kiss the rod!</line>
            <line>How churlishly I chid Lucetta hence,</line>
            <line>When willingly I would have had her here!</line>
            <line>How angerly I taught my brow to frown,</line>
            <line>When inward joy enforced my heart to smile!</line>
            <line>My penance is to call Lucetta back</line>
            <line>And ask remission for my folly past.</line>
            <line>What ho! Lucetta!</line>
         </speech>
         <stagedir>Re-enter LUCETTA</stagedir>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>What would your ladyship?</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Is't near dinner-time?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>I would it were,</line>
            <line>That you might kill your stomach on your meat</line>
            <line>And not upon your maid.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>What is't that you took up so gingerly?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Nothing.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Why didst thou stoop, then?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>To take a paper up that I let fall.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>And is that paper nothing?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Nothing concerning me.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Then let it lie for those that it concerns.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Madam, it will not lie where it concerns</line>
            <line>Unless it have a false interpeter.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Some love of yours hath writ to you in rhyme.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>That I might sing it, madam, to a tune.</line>
            <line>Give me a note: your ladyship can set.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>As little by such toys as may be possible.</line>
            <line>Best sing it to the tune of 'Light o' love.'</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>It is too heavy for so light a tune.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Heavy! belike it hath some burden then?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Ay, and melodious were it, would you sing it.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>And why not you?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>I cannot reach so high.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Let's see your song. How now, minion!</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Keep tune there still, so you will sing it out:</line>
            <line>And yet methinks I do not like this tune.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>You do not?</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>No, madam; it is too sharp.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>You, minion, are too saucy.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Nay, now you are too flat</line>
            <line>And mar the concord with too harsh a descant:</line>
            <line>There wanteth but a mean to fill your song.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>The mean is drown'd with your unruly bass.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Indeed, I bid the base for Proteus.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>This babble shall not henceforth trouble me.</line>
            <line>Here is a coil with protestation!</line>
            <stagedir>Tears the letter</stagedir>
            <line>Go get you gone, and let the papers lie:</line>
            <line>You would be fingering them, to anger me.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>She makes it strange; but she would be best pleased</line>
            <line>To be so anger'd with another letter.</line>
         </speech>
         <stagedir>Exit</stagedir>
         <speech>
            <speaker>JULIA</speaker>
            <line>Nay, would I were so anger'd with the same!</line>
            <line>O hateful hands, to tear such loving words!</line>
            <line>Injurious wasps, to feed on such sweet honey</line>
            <line>And kill the bees that yield it with your stings!</line>
            <line>I'll kiss each several paper for amends.</line>
            <line>Look, here is writ 'kind Julia.' Unkind Julia!</line>
            <line>As in revenge of thy ingratitude,</line>
            <line>I throw thy name against the bruising stones,</line>
            <line>Trampling contemptuously on thy disdain.</line>
            <line>And here is writ 'love-wounded Proteus.'</line>
            <line>Poor wounded name! my bosom as a bed</line>
            <line>Shall lodge thee till thy wound be thoroughly heal'd;</line>
            <line>And thus I search it with a sovereign kiss.</line>
            <line>But twice or thrice was 'Proteus' written down.</line>
            <line>Be calm, good wind, blow not a word away</line>
            <line>Till I have found each letter in the letter,</line>
            <line>Except mine own name: that some whirlwind bear</line>
            <line>Unto a ragged fearful-hanging rock</line>
            <line>And throw it thence into the raging sea!</line>
            <line>Lo, here in one line is his name twice writ,</line>
            <line>'Poor forlorn Proteus, passionate Proteus,</line>
            <line>To the sweet Julia:' that I'll tear away.</line>
            <line>And yet I will not, sith so prettily</line>
            <line>He couples it to his complaining names.</line>
            <line>Thus will I fold them one on another:</line>
            <line>Now kiss, embrace, contend, do what you will.</line>
         </speech>
         <stagedir>Re-enter LUCETTA</stagedir>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Madam,</line>
            <line>Dinner is ready, and your father stays.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Well, let us go.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>What, shall these papers lie like tell-tales here?</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>If you respect them, best to take them up.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Nay, I was taken up for laying them down:</line>
            <line>Yet here they shall not lie, for catching cold.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>I see you have a month's mind to them.</line>
         </speech>
         <speech>
            <speaker>LUCETTA</speaker>
            <line>Ay, madam, you may say what sights you see;</line>
            <line>I see things too, although you judge I wink.</line>
         </speech>
         <speech>
            <speaker>JULIA</speaker>
            <line>Come, come; will't please you go?</line>
         </speech>
         <stagedir>Exeunt</stagedir>
      </scene-body>
   </scene>
   <scene id="act-1-scene-3">
      <title>SCENE III.  The same. ANTONIO's house.</title>
      <scene-body>
         <stagedir>Enter ANTONIO and PANTHINO</stagedir>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>Tell me, Panthino, what sad talk was that</line>
            <line>Wherewith my brother held you in the cloister?</line>
         </speech>
         <speech>
            <speaker>PANTHINO</speaker>
            <line>'Twas of his nephew Proteus, your son.</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>Why, what of him?</line>
         </speech>
         <speech>
            <speaker>PANTHINO</speaker>
            <line>He wonder'd that your lordship</line>
            <line>Would suffer him to spend his youth at home,</line>
            <line>While other men, of slender reputation,</line>
            <line>Put forth their sons to seek preferment out:</line>
            <line>Some to the wars, to try their fortune there;</line>
            <line>Some to discover islands far away;</line>
            <line>Some to the studious universities.</line>
            <line>For any or for all these exercises,</line>
            <line>He said that Proteus your son was meet,</line>
            <line>And did request me to importune you</line>
            <line>To let him spend his time no more at home,</line>
            <line>Which would be great impeachment to his age,</line>
            <line>In having known no travel in his youth.</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>Nor need'st thou much importune me to that</line>
            <line>Whereon this month I have been hammering.</line>
            <line>I have consider'd well his loss of time</line>
            <line>And how he cannot be a perfect man,</line>
            <line>Not being tried and tutor'd in the world:</line>
            <line>Experience is by industry achieved</line>
            <line>And perfected by the swift course of time.</line>
            <line>Then tell me, whither were I best to send him?</line>
         </speech>
         <speech>
            <speaker>PANTHINO</speaker>
            <line>I think your lordship is not ignorant</line>
            <line>How his companion, youthful Valentine,</line>
            <line>Attends the emperor in his royal court.</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>I know it well.</line>
         </speech>
         <speech>
            <speaker>PANTHINO</speaker>
            <line>'Twere good, I think, your lordship sent him thither:</line>
            <line>There shall he practise tilts and tournaments,</line>
            <line>Hear sweet discourse, converse with noblemen.</line>
            <line>And be in eye of every exercise</line>
            <line>Worthy his youth and nobleness of birth.</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>I like thy counsel; well hast thou advised:</line>
            <line>And that thou mayst perceive how well I like it,</line>
            <line>The execution of it shall make known.</line>
            <line>Even with the speediest expedition</line>
            <line>I will dispatch him to the emperor's court.</line>
         </speech>
         <speech>
            <speaker>PANTHINO</speaker>
            <line>To-morrow, may it please you, Don Alphonso,</line>
            <line>With other gentlemen of good esteem,</line>
            <line>Are journeying to salute the emperor</line>
            <line>And to commend their service to his will.</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>Good company; with them shall Proteus go:</line>
            <line>And, in good time! now will we break with him.</line>
         </speech>
         <stagedir>Enter PROTEUS</stagedir>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Sweet love! sweet lines! sweet life!</line>
            <line>Here is her hand, the agent of her heart;</line>
            <line>Here is her oath for love, her honour's pawn.</line>
            <line>O, that our fathers would applaud our loves,</line>
            <line>To seal our happiness with their consents!</line>
            <line>O heavenly Julia!</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>How now! what letter are you reading there?</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>May't please your lordship, 'tis a word or two</line>
            <line>Of commendations sent from Valentine,</line>
            <line>Deliver'd by a friend that came from him.</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>Lend me the letter; let me see what news.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>There is no news, my lord, but that he writes</line>
            <line>How happily he lives, how well beloved</line>
            <line>And daily graced by the emperor;</line>
            <line>Wishing me with him, partner of his fortune.</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>And how stand you affected to his wish?</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>As one relying on your lordship's will</line>
            <line>And not depending on his friendly wish.</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>My will is something sorted with his wish.</line>
            <line>Muse not that I thus suddenly proceed;</line>
            <line>For what I will, I will, and there an end.</line>
            <line>I am resolved that thou shalt spend some time</line>
            <line>With Valentinus in the emperor's court:</line>
            <line>What maintenance he from his friends receives,</line>
            <line>Like exhibition thou shalt have from me.</line>
            <line>To-morrow be in readiness to go:</line>
            <line>Excuse it not, for I am peremptory.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>My lord, I cannot be so soon provided:</line>
            <line>Please you, deliberate a day or two.</line>
         </speech>
         <speech>
            <speaker>ANTONIO</speaker>
            <line>Look, what thou want'st shall be sent after thee:</line>
            <line>No more of stay! to-morrow thou must go.</line>
            <line>Come on, Panthino: you shall be employ'd</line>
            <line>To hasten on his expedition.</line>
         </speech>
         <stagedir>Exeunt ANTONIO and PANTHINO</stagedir>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Thus have I shunn'd the fire for fear of burning,</line>
            <line>And drench'd me in the sea, where I am drown'd.</line>
            <line>I fear'd to show my father Julia's letter,</line>
            <line>Lest he should take exceptions to my love;</line>
            <line>And with the vantage of mine own excuse</line>
            <line>Hath he excepted most against my love.</line>
            <line>O, how this spring of love resembleth</line>
            <line>The uncertain glory of an April day,</line>
            <line>Which now shows all the beauty of the sun,</line>
            <line>And by and by a cloud takes all away!</line>
         </speech>
         <stagedir>Re-enter PANTHINO</stagedir>
         <speech>
            <speaker>PANTHINO</speaker>
            <line>Sir Proteus, your father calls for you:</line>
            <line>He is in haste; therefore, I pray you to go.</line>
         </speech>
         <speech>
            <speaker>PROTEUS</speaker>
            <line>Why, this it is: my heart accords thereto,</line>
            <line>And yet a thousand times it answers 'no.'</line>
         </speech>
         <stagedir>Exeunt</stagedir>
      </scene-body>
   </scene>
</act>


text:
cscript msvc-scripts/rep.vbs //Nologo s/@VERSION@/1.0.16/ < src\libsodium\include\sodium\version.h.in > tmp
cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MAJOR@/10/ < tmp > tmp2
cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_VERSION_MINOR@/1/ < tmp2 > tmp3
cscript msvc-scripts/rep.vbs //Nologo s/@SODIUM_LIBRARY_MINIMAL_DEF@// < tmp3 > src\libsodium\include\sodium\version.h
del tmp tmp2 tmp3

redpajama_set_name: RedPajamaGithub


text:
Documentation, client and examples coming soon.

Start mongodb on my mac: `mongod --config /usr/local/etc/mongod.conf`

###TODO

- [ ] if send push returns an error (check which one), unsubscribe client from db
- [ ] use library (jsesc?) to parse/clean/sanitize/check msg and title in POST /special
- [x] limit msg and title length in POST /special
- [x] check that title is optional
- [x] msg and title counter in GET /special

###Links

- http://stackoverflow.com/a/11420667/471720


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
  <androidx.recyclerview.widget.RecyclerView
      android:id="@+id/rv"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:visibility="gone"
      />

  <com.google.android.exoplayer2.ui.PlayerView
      android:id="@+id/player_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:surface_type="surface_view"
      app:show_buffering="never"
      android:visibility="gone"
      />
</FrameLayout>


text:
using namespace ai;

//------------------------------------------------------------------------
// sNeuron, sNeuronLayer
const double dBias = 0.f;

sNeuron::sNeuron(uint numInputs0)
	: numInputs(numInputs0 + 1)
{
	//we need an additional weight for the bias hence the +1
	weight.reserve(numInputs0 + 1);
	for (uint i = 0; i < numInputs0 + 1; ++i)
		weight.push_back(RandomClamped());
	result.resize(weight.size());
}

sNeuronLayer::sNeuronLayer(uint numNeurons0, uint numInputsPerNeuron0)
	: numNeurons(numNeurons0)
{
	for (uint i = 0; i < numNeurons0; ++i)
		neurons.push_back(sNeuron(numInputsPerNeuron0));
}

//------------------------------------------------------------------------
// cNeuralNet
cNeuralNet::cNeuralNet(const uint numInputs, const uint numOutputs
	, const uint numHidden, const uint neuronsPerHiddenLayer)
{
	m_dActivationResponse = 1.f;
	m_numInputs = numInputs;
	m_numOutputs = numOutputs;
	m_numHiddenLayers = numHidden;
	m_neuronsPerHiddenLyr = neuronsPerHiddenLayer;
	CreateNet();
}

cNeuralNet::~cNeuralNet()
{
}

// this method builds the ANN. The weights are all initially set to
// random values -1 < w < 1
void cNeuralNet::CreateNet()
{
	if (m_numHiddenLayers > 0)
	{
		m_layers.push_back(sNeuronLayer(m_neuronsPerHiddenLyr, m_numInputs));
		for (uint i = 0; i < m_numHiddenLayers - 1; ++i)
		{
			m_layers.push_back(sNeuronLayer(m_neuronsPerHiddenLyr,
				m_neuronsPerHiddenLyr));
		}
		m_layers.push_back(sNeuronLayer(m_numOutputs, m_neuronsPerHiddenLyr));
	}
	else
	{
		m_layers.push_back(sNeuronLayer(m_numOutputs, m_numInputs));
	}
}

// returns a vector containing the weights
vector<double> cNeuralNet::GetWeights() const
{
	vector<double> weights;
	for (uint i = 0; i < m_numHiddenLayers + 1; ++i)
		for (uint j = 0; j < m_layers[i].numNeurons; ++j)
			for (uint k = 0; k < m_layers[i].neurons[j].numInputs; ++k)
				weights.push_back(m_layers[i].neurons[j].weight[k]);
	return weights;
}

// given a vector of doubles this function replaces the weights in the NN
// with the new values
void cNeuralNet::PutWeights(const vector<double> &weights)
{
	int cWeight = 0;
	for (uint i = 0; i < m_numHiddenLayers + 1; ++i)
		for (uint j = 0; j < m_layers[i].numNeurons; ++j)
			for (uint k = 0; k < m_layers[i].neurons[j].numInputs; ++k)
				m_layers[i].neurons[j].weight[k] = weights[cWeight++];
}

// returns the total number of weights needed for the net
int cNeuralNet::GetNumberOfWeights() const
{
	int weights = 0;
	for (uint i = 0; i < m_numHiddenLayers + 1; ++i)
		for (uint j = 0; j < m_layers[i].numNeurons; ++j)
			weights += m_layers[i].neurons[j].numInputs;
	return weights;
}

// given an input vector this function calculates the output vector
vector<double> cNeuralNet::Update(INOUT vector<double> &inputs)
{
	vector<double> outputs;

	int cWeight = 0;
	if (inputs.size() != m_numInputs)
		return outputs;

	for (uint i = 0; i < m_numHiddenLayers + 1; ++i)
	{
		if (i > 0)
			inputs = outputs;

		outputs.clear();

		cWeight = 0;

		//for each neuron sum the (inputs * corresponding weights).Throw
		//the total at our sigmoid function to get the output.
		for (uint j = 0; j < m_layers[i].numNeurons; ++j)
		{
			double netinput = 0;

			const uint numInputs = m_layers[i].neurons[j].numInputs;
			for (uint k = 0; k < numInputs - 1; ++k)
			{
				//netinput += m_layers[i].neurons[j].weight[k] * inputs[cWeight++];
				const double v = m_layers[i].neurons[j].weight[k] * inputs[cWeight];
				m_layers[i].neurons[j].result[k] = v;
				netinput += v;
				cWeight++;
			}

			netinput += m_layers[i].neurons[j].weight[numInputs - 1] * dBias;

			// we can store the outputs from each layer as we generate them.
			// The combined activation is first filtered through the sigmoid
			// function
			const double val = Sigmoid(netinput, m_dActivationResponse) - 0.5f;
			outputs.push_back(val);
			m_layers[i].neurons[j].output = val;
			cWeight = 0;
		}
	}

	return outputs;
}

// Sigmoid function
double cNeuralNet::Sigmoid(double netinput, double response)
{
	return (1 / (1 + exp(-netinput / response)));
}


text:
package com.facebook.buck.shell;

import static org.junit.Assert.assertThat;

import com.facebook.buck.rules.DefaultTargetNodeToBuildRuleTransformer;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.model.BuildTargetFactory;
import com.facebook.buck.parser.NoSuchBuildTargetException;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleResolver;
import com.facebook.buck.rules.FakeBuildRule;
import com.facebook.buck.rules.FakeSourcePath;
import com.facebook.buck.rules.SourcePathResolver;
import com.facebook.buck.rules.TargetGraph;
import com.facebook.buck.util.HumanReadableException;

import org.hamcrest.Matchers;
import org.junit.Test;

public class WorkerToolTest {

  @Test
  public void testCreateWorkerTool() throws NoSuchBuildTargetException {
    BuildRuleResolver resolver =
        new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer());

    BuildRule shBinaryRule = new ShBinaryBuilder(
        BuildTargetFactory.newInstance("//:my_exe"))
        .setMain(new FakeSourcePath("bin/exe"))
        .build(resolver);

    BuildRule workerRule = WorkerToolBuilder
        .newWorkerToolBuilder(BuildTargetFactory.newInstance("//:worker_rule"))
        .setExe(shBinaryRule.getBuildTarget())
        .setArgs("arg1 arg2")
        .build(resolver);

    assertThat(
        "getBinaryBuildRule should return the build rule supplied in the definition.",
        shBinaryRule,
        Matchers.equalToObject(((WorkerTool) workerRule).getBinaryBuildRule()));

    assertThat(
        "getArgs should return the args string supplied in the definition.",
        "arg1 arg2",
        Matchers.is(((WorkerTool) workerRule).getArgs()));
  }

  @Test
  public void testCreateWorkerToolWithBadExeValue() throws NoSuchBuildTargetException {
    BuildRuleResolver resolver =
        new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer());

    BuildRule nonBinaryBuildRule = new FakeBuildRule(
        BuildTargetFactory.newInstance("//:fake"),
        new SourcePathResolver(resolver));
    resolver.addToIndex(nonBinaryBuildRule);

    BuildTarget workerTarget = BuildTargetFactory.newInstance("//:worker_rule");
    try {
      WorkerToolBuilder
          .newWorkerToolBuilder(workerTarget)
          .setExe(nonBinaryBuildRule.getBuildTarget())
          .build(resolver);
    } catch (HumanReadableException e) {
      assertThat(
          e.getHumanReadableErrorMessage(),
          Matchers.containsString("needs to correspond to a binary rule"));
    }
  }
}


text:
import { ec as EC } from 'elliptic'
import KeyEncoder from './index'
const keyEncoder = new KeyEncoder('secp256k1')

const rawPrivateKey = '844055cca13efd78ce79a4c3a4c5aba5db0ebeb7ae9d56906c03d333c5668d5b',
    rawPublicKey = '04147b79e9e1dd3324ceea115ff4037b6c877c73777131418bfb2b713effd0f502327b923861581bd5535eeae006765269f404f5f5c52214e9721b04aa7d040a75'

const encoderOptions = {
    curveParameters: [1, 3, 132, 0, 10],
    privatePEMOptions: {label: 'EC PRIVATE KEY'},
    publicPEMOptions: {label: 'PUBLIC KEY'},
    curve: new EC('secp256k1')
}
const keyEncoder2 = new KeyEncoder(encoderOptions)

const privateKeyPEM = keyEncoder.encodePrivate(rawPrivateKey, 'raw', 'pem')

const publicKeyPEM = keyEncoder.encodePublic(rawPublicKey, 'raw', 'pem')

console.log(privateKeyPEM)
console.log(publicKeyPEM)


text:
@import UIKit;
#import "VoiceItAppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([VoiceItAppDelegate class]));
    }
}


text:
layout: page
title : Archive
header : Post Archive
categories: [Consigninator]
group: navigation_old
nav_home_class: ""
nav_blog_class: ""
nav_archive_class: "active"
nav_tags_class: ""
---
{% include JB/setup %}

{% assign posts_collate = site.categories.consigninator %}
{% include JB/posts_collate %}


text:
<?php

namespace Aisel\PageBundle\EventListener;

use Aisel\ResourceBundle\EventListener\UrlPersistenceListener;

/**
 * Class NodeUrlPersistenceListener.
 *
 * @author Ivan Proskuryakov <volgodark@gmail.com>
 */
class NodeUrlPersistenceListener extends UrlPersistenceListener
{

}


text:
from datetime import datetime
from androguard.core.bytecodes.apk import APK
from androguard.core.androgen import AndroguardS
from blessings import Terminal

t = Terminal()

class Loader(object):
    def __init__(self, apk):
        super(Loader, self).__init__()
        self.apk = apk

    def run_loader(self):
        """
        Load the target APK and return
        the loaded instance, which will
        be stored as a global
        """

        print(t.green("[{0}] ".format(datetime.now()) +
                      t.yellow("Loading : ") +
                      "{0}".format(self.apk)))

        return APK(self.apk), AndroguardS(self.apk)


text:
The Phabricator Branch Source plugin allows you to create a new project based on a repository that is available in a
[Phabricator](https://www.phacility.com/phabricator/) instance. This plugin scans the repository for all branches
and turns them into Pipeline jobs. To define a Pipeline job, you create a Pipeline script in a `Jenkinsfile` in the root
directory of the project or branch. The repository becomes a folder in Jenkins with each branch with a `Jenkinsfile` as
a different job.

### Differential Revisions

The Phabricator Branch Source plugin is able to build
[Differential revisions](https://www.phacility.com/phabricator/differential/) containing a `Jenkinsfile` and with
their changes staged in a Staging Area. Each revision will be added to Jenkins as a unique job.

**This does not report the status of a build back to Phabricator.**

## Configuration

This plugin adds a new type of Multibranch Project. To use this plugin, you must have a running Phabricator install,
credentials with Phabricator API access and credentials that allow access to the repository. Setup your job as follows:

Go to Jenkins > New Item > Multibranch Pipeline.

On the next page click the button Add source. Choose the Phabricator source.

Select or add new Phabricator Credentials. The repositories will load in the next selectbox. Select a repository and
configure the Repository Credentials.

Save, and wait for the Multibranch Pipeline Scan to run. Job progress is displayed to the left hand side. When
everything is done, you may need to refresh the page to see your branches and revisions.


text:
from __future__ import print_function, unicode_literals

from .parsers import StrippingJSONParser

class MultipleSerializersViewMixin(object):
    def get_serializer(self, *args, **kwargs):
        serializer_class = kwargs.pop('serializer_class', None)
        if serializer_class is None:
            serializer_class = self.get_serializer_class()

        kwargs['context'] = self.get_serializer_context()

        return serializer_class(*args, **kwargs)

class MapDataViewMixin(object):
    # Configuration for data mapper.
    # Leave None if you don't require mapping
    data_mapper_class = None

    def get_mapper_context(self):
        return self.get_serializer_context()

    def get_data(self, mapper_class=None):
        """
        Get data for serialization.
        """
        if not mapper_class:
            mapper_class = self.data_mapper_class

        if mapper_class is not None:
            return mapper_class(context=self.get_mapper_context())(self.request.data)

        return self.request.data

class StrippingJSONViewMixin(object):
    parser_classes = (StrippingJSONParser,)

    # Location of the root of the data for this api.
    parser_root = None

    def get_parser_context(self, http_request):
        """
        Add 'parser_root' to this view's parser's parse_context.
        Since this view uses a DescendingJSONParser, it uses
        this information to decide what to pull out.
        """
        context = super(StrippingJSONViewMixin, self).get_parser_context(http_request)
        context.update({'parse_root': self.parser_root})
        return context


text:
'use strict';

angular.module('lexicon.services')
  .service('lexSendReceiveApi', ['jsonRpc', function (jsonRpc) {
    jsonRpc.connect('/api/sf');

    this.getUserProjects = function getUserProjects(username, password, callback) {
      jsonRpc.call('sendReceive_getUserProjects', [username, password], callback);
    };

    this.updateSRProject = function updateSRProject(srProject, callback) {
      jsonRpc.call('sendReceive_updateSRProject', [srProject], callback);
    };

    this.receiveProject = function receiveProject(callback) {
      jsonRpc.call('sendReceive_receiveProject', [], callback);
    };

    //noinspection JSUnusedGlobalSymbols
    this.commitProject = function commitProject(callback) {
      jsonRpc.call('sendReceive_commitProject', [], callback);
    };

    this.getProjectStatus = function getProjectStatus(callback) {
      jsonRpc.call('sendReceive_getProjectStatus', [], callback);
    };
  }])
  .service('lexSendReceive', ['sessionService', 'silNoticeService', 'lexSendReceiveApi',
    '$interval', 'lexEditorDataService', '$filter',
    function (sessionService, notice, sendReceiveApi, $interval, editorData, $filter) {
      const syncStatusInterval = 3000; // ms
      const pollUpdateInterval = 32000; // ms
      const cloneStatusInterval = 3000; // ms
      const unknownSRState = 'LF_CHECK';

      var status = undefined;
      var previousSRState = unknownSRState;
      var projectSettings = sessionService.session.projectSettings;
      var syncProjectStatusSuccessCallback = angular.noop;
      var pollUpdateSuccessCallback = angular.noop;
      var cloneProjectStatusSuccessCallback = angular.noop;
      var syncStatusTimer;
      var pollUpdateTimer;
      var cloneStatusTimer;
      var pendingMessageId;

      if (angular.isDefined(projectSettings) &&
        angular.isDefined(projectSettings.sendReceive) &&
        angular.isDefined(projectSettings.sendReceive.status)
      ) {
        status = projectSettings.sendReceive.status;
        previousSRState = status.SRState;
      }

      this.clearState = function clearState() {
        if (!status || angular.isUndefined(status)) {
          status = {};
        }

        status.SRState = unknownSRState;
        previousSRState = unknownSRState;
      };

      // SRState is CLONING or SYNCING
      // logic should match PHP SendReceiveCommands::isInProgress
      this.isInProgress = function isInProgress() {
        return this.isSendReceiveProject() &&
          angular.isDefined(status) && angular.isDefined(status.SRState) &&
          (status.SRState == 'CLONING' || status.SRState == 'LF_CLONING' ||
          status.SRState == 'SYNCING');
      };

      // S/R isInProgress(), SRState is unknown, or SRState is PENDING
      this.isStarted = function isStarted() {
        return this.isInProgress() || (this.isSendReceiveProject() && angular.isDefined(status) &&
          angular.isDefined(status.SRState) &&
          (status.SRState == unknownSRState || status.SRState == 'PENDING'));
      };

      this.isSendReceiveProject = function isSendReceiveProject() {
        return projectSettings.hasSendReceive;
      };

      this.setSyncProjectStatusSuccessCallback =
        function setSyncProjectStatusSuccessCallback(callback) {
          syncProjectStatusSuccessCallback = callback;
        };

      // Called after a lexicon project page is done loading
      this.checkInitialState = function checkInitialState() {
        if (this.isSendReceiveProject()) {
          if (!status || angular.isUndefined(status)) {
            this.clearState();
            getSyncProjectStatus();
            this.startSyncStatusTimer();
          } else if (this.isInProgress()) {
            this.setSyncStarted();
          } else {
            if (status.SRState == unknownSRState) {
              this.clearState();
            }

            this.startPollUpdateTimer();
          }
        } else {
          this.startPollUpdateTimer();
        }
      };

      this.setSyncStarted = function setSyncStarted() {
        notice.cancelProgressBar();

        // TODO: Remove this loading notice and display when we determine the real initial state
        notice.setLoading('If server available, synchronizing with LanguageDepot.org...');
        this.startSyncStatusTimer();
      };

      this.setStateUnsynced = function setStateUnsynced() {
        if (this.isSendReceiveProject()) {
          previousSRState = status.SRState;
          status.SRState = 'LF_UNSYNCED';
        }
      };

      var getSyncProjectStatus = function () {
        sendReceiveApi.getProjectStatus(function (result) {
          if (result.ok) {
            if (!result.data) {
              this.clearState();
              this.startPollUpdateTimer();
              notice.cancelLoading();
              return;
            }

            previousSRState = status.SRState;
            status = result.data;

            if (status.PercentComplete > 0) {
              notice.setPercentComplete(status.PercentComplete);
            } else {
              notice.cancelProgressBar();
            }

            if (!this.isInProgress()) {
              this.startPollUpdateTimer();
              notice.cancelLoading();
            }

            console.log(status);

            switch (status.SRState) {
              case 'PENDING' :
                pendingMessageId = notice.push(notice.INFO,
                  'Please wait while other projects are being synchronized. ' +
                  'You may continue to edit this project until it starts to synchronize.');
                break;
              case 'SYNCING' :
                notice.removeById(pendingMessageId);
                notice.setLoading('Synchronizing with LanguageDepot.org...');
                break;
              case 'HOLD' :
                notice.push(notice.ERROR, 'Well this is embarrassing. Something went ' +
                    'wrong and your project is now on hold. Contact an administrator.');
                break;
              case 'IDLE' :
                if (previousSRState == 'SYNCING') {
                  notice.push(notice.SUCCESS, 'The project was successfully synchronized.');
                }

                (syncProjectStatusSuccessCallback || angular.noop)();
                break;
            }
          }
        }.bind(this));
      }.bind(this);

      this.startSyncStatusTimer = function startSyncStatusTimer() {
        this.cancelPollUpdateTimer();
        this.cancelCloneStatusTimer();
        if (angular.isDefined(syncStatusTimer)) return;

        syncStatusTimer = $interval(getSyncProjectStatus, syncStatusInterval);
      };

      this.cancelSyncStatusTimer = function cancelSyncStatusTimer() {
        if (angular.isDefined(syncStatusTimer)) {
          $interval.cancel(syncStatusTimer);
          syncStatusTimer = undefined;
        }
      };

      // UI strings corresponding to SRState in the LfMerge state file.
      // SRStates with an "LF_" prefix are languageforge overrides
      this.syncStateNotice = function syncStateNotice() {
        if (angular.isUndefined(status)) return;

        switch (status.SRState) {
          case 'CLONING':
          case 'LF_CLONING':
            return 'Creating initial data. This may take a few minutes...';
          case 'SYNCING':
            return 'Syncing...';
          case 'PENDING':
            return 'Pending';
          case 'IDLE':
          case 'SYNCED':
            return 'Synced';
          case 'LF_UNSYNCED':
            return 'Un-synced';
          case 'HOLD':
            return 'On hold';

          // Undefined initial state
          default:
            return '';
        }
      };

      this.lastSyncNotice = function lastSyncNotice() {
        if (angular.isUndefined(status)) return;

        switch (status.SRState) {
          case 'SYNCING':
          case 'PENDING':
          case 'IDLE':
          case 'SYNCED':
          case 'LF_UNSYNCED':
          case 'HOLD':
            if (angular.isDefined(projectSettings) &&
              angular.isDefined(projectSettings.lastSyncedDate)
            ) {
              return 'Last sync was ' + $filter('relativetime')(projectSettings.lastSyncedDate);
            } else {
              return '';
            }

          case 'CLONING':
          case 'LF_CLONING':

          // Undefined initial state
          default:
            return '';
        }
      };

      this.setPollUpdateSuccessCallback = function setPollUpdateSuccessCallback(callback) {
        pollUpdateSuccessCallback = callback;
      };

      var getPollUpdate = function () {
        editorData.refreshEditorData().then(function (result) {
          if (result.ok) {
            if (this.isSendReceiveProject()) {
              if (angular.isUndefined(result.data) ||
                angular.isUndefined(result.data.sendReceive) ||
                angular.isUndefined(result.data.sendReceive.status)
              ) {
                this.clearState();
                return;
              }

              previousSRState = status.SRState;
              status = result.data.sendReceive.status;
              if (this.isInProgress()) {
                (pollUpdateSuccessCallback || angular.noop)();
                this.setSyncStarted();
              } else if (previousSRState == 'LF_UNSYNCED' && status.SRState == 'IDLE') {
                status.SRState = previousSRState;
              } else if (previousSRState == unknownSRState) {
                this.clearState();
              } else {
                (pollUpdateSuccessCallback || angular.noop)();
              }
            } else {
              (pollUpdateSuccessCallback || angular.noop)();
            }
          }
        }.bind(this));
      }.bind(this);

      this.startPollUpdateTimer = function startPollUpdateTimer() {
        this.cancelSyncStatusTimer();
        this.cancelCloneStatusTimer();
        if (angular.isDefined(pollUpdateTimer)) return;

        pollUpdateTimer = $interval(getPollUpdate, pollUpdateInterval);
      };

      this.cancelPollUpdateTimer = function cancelPollUpdateTimer() {
        if (angular.isDefined(pollUpdateTimer)) {
          $interval.cancel(pollUpdateTimer);
          pollUpdateTimer = undefined;
        }
      };

      this.setCloneProjectStatusSuccessCallback =
        function setCloneProjectStatusSuccessCallback(callback) {
          cloneProjectStatusSuccessCallback = callback;
        };

      var getCloneProjectStatus = function () {
        sendReceiveApi.getProjectStatus(function (result) {
          if (result.ok) {
            if (!result.data) {
              this.clearState();
              this.cancelCloneStatusTimer();
              return;
            }

            status = result.data;
            console.log(status);
            if (status.SRState == 'IDLE' ||
              status.SRState == 'HOLD') {
              this.cancelCloneStatusTimer();
              (cloneProjectStatusSuccessCallback || angular.noop)();
            }
          }
        }.bind(this));
      }.bind(this);

      this.startCloneStatusTimer = function startCloneStatusTimer() {
        this.cancelPollUpdateTimer();
        this.cancelSyncStatusTimer();

        // Whether the true SRState is CLONING or PENDING, the user is going to have to wait for
        // CLONING anyways
        status.SRState = 'LF_CLONING';
        if (angular.isDefined(cloneStatusTimer)) return;

        cloneStatusTimer = $interval(getCloneProjectStatus, cloneStatusInterval);
      };

      this.cancelCloneStatusTimer = function cancelCloneStatusTimer() {
        if (angular.isDefined(cloneStatusTimer)) {
          $interval.cancel(cloneStatusTimer);
          cloneStatusTimer = undefined;
        }
      };

      // For now, we generate the same S/R string based on the SRState
      this.cloneNotice = this.syncStateNotice;

      this.cancelAllStatusTimers = function cancelAllStatusTimers() {
        this.cancelSyncStatusTimer();
        this.cancelPollUpdateTimer();
        this.cancelCloneStatusTimer();
      };

    }])

  ;


text:
/**
 * Page.js
 * Description : Page class used for saving a new page in RazorEngineCms
 * Methods: init, validate, and save
 * Dependencies: jQuery, default.js, an initialized code mirror object
 *               called pageTemplateEditor
 */

"use strict";

function Page() {
    this.init();
}

// initialize Page object properties
Page.prototype.init = function () {
    this.Id = $("#pageId").text().trim();
    this.updated = $("#pageUpdated").text() != "" ? $("#pageUpdated").text() : new Date().toISOString();
    this.name = $("#pageName").val() != undefined ? $("#pageName").val().trim() : "";
    this.$name = $("#pageName");
    this.section = $("#pageVar").val() != undefined ? $("#pageVar").val().trim() : "";
    this.$section = $("#pageVar");
    this.$model = $("#model");
    this.$template = $("#template");
    this.createTemplateFile = $("input[name=\"templateFile\"]:checked").val();
    this.hasParams = $("input[name=\"hasParams\"]:checked").val();
    this.hasInclude = $("input[name=\"hasInclude\"]:checked").val();
    var hasModel = document.getElementById("hasModel-true");
    this.hasModel = hasModel != null ? hasModel.checked : false;
    if (typeof (pageTemplateEditor) != "undefined") {
        this.template = pageTemplateEditor.getValue().trim().replace("</script>", "<\/script>");
    }
    if (typeof (pageModelEditor) != "undefined") {
        this.model = pageModelEditor.getValue().trim();
    }
}

Page.prototype.listItem = function ($sel) {
    return {
        pageId: $($sel).attr("data-pageid"),
        pageName: $($sel).attr("data-pagename"),
        pageSection: $($sel).attr("data-pagesection")
    };
}

// validates new page form inputs and returns true if valid
Page.prototype.validate = function () {
    var isValid = true;
    if (this.name === null || this.name.length === 0) {
        this.$name.addError("Name cannot be empty", "name");
        isValid = false;
    } else if (this.name.indexOf(" ") > -1) {
        this.$name.add("Name cannot contain a space");
        isValid = false;
    }
    if (this.section != null && this.section.indexOf(" ") > -1) {
        this.$section.add("Section cannot contain a space");
        isValid = false;
    }
    if (this.template === null || this.template.length === 0) {
        this.$template.addError("Template cannot be empty", "template");
        isValid = false;
    }
    if (this.model != null && (this.model.indexOf("); DROP TABLE") > -1 || this.model.indexOf("DROP TABLE") > -1 || this.model.indexOf("DROP DATABASE") > -1)) {
        this.$model.addError("SQL injetion detected", "model");
        isValid = false;
    }
    if (this.model != null && (this.model.indexOf("[sys].") > -1 || this.model.indexOf("sys.") > -1)) {
        this.$model.addError("Sys SQL Object not accessible", "model");
        isValid = false;
    }
    if (this.hasModel != undefined && !this.hasModel) {
        this.model = null;
    }

    return isValid;
}
// calls page.validate() then saves page using /Page/New post request
Page.prototype.save = function () {
    this.init();
    _default.clearErrors();
    if (this.validate()) {
        var scopedObject = this;
        // create page object model for post request
        var pageModel = {
            Name: scopedObject.name,
            Section: scopedObject.section,
            Model: scopedObject.model,
            Template: scopedObject.template,
            CreateTemplateFile: scopedObject.createTemplateFile,
            HasParams: scopedObject.hasParams,
            HasInclude: scopedObject.hasInclude,
            Updated: scopedObject.updated
        };
        if (this.Id != "") {
            pageModel.Id = this.Id;
        }
        // callback for successful post request
        var successCallback = function (data) {
            $("#new-page-alert").remove();
            // create element to store alerts
            $("#newPage").prepend("

");
            if (data.Status == true) {
                _default.alertMsg("success", "Page has been saved. View", "#new-page-alert")
                if (data.Updated != null) {
                    $("#pageUpdated").text(data.Updated);
                }
            } else {
                _default.alertMsg("error", "Something went wrong. Try again?", "#new-page-alert")
                if (data.Errors.length > 0) {
                    var errorMsgBlock = [];
                    data.Errors.forEach(function (error) {
                        var lineNumRegex = /Line: \d?\d?\d?\d/g;
                        if (error.search(lineNumRegex) != -1) {
                            var lineNumText = error.match(lineNumRegex)[0];
                            var lineNum = parseInt(lineNumText.replace("Line:", ""), 10) - 1; // line numbers start at 0 in CodeMirror API
                            pageModelEditor.addLineClass(lineNum, "background", "line-error");
                            // add change event to remove line error
                            pageModelEditor.on('change', function (cMirror) {
                                pageModelEditor.removeLineClass(lineNum, "background", "line-error");
                            });
                        }
                        errorMsgBlock.push(error);
                        errorMsgBlock.push(("
"));
                    });
                    $("#new-page-alert").append("

Exception:
" + errorMsgBlock.join("") + "

");
                } // end if data.Errors.length > 0
            } // end else
            $("html, body").animate({ scrollTop: 0 }, "slow");
        };
        // set params for ajax request
        // submit post request
        $.ajax({
            type: "POST",
            contentType: "application/json",
            url: "/CMS/Page/Save",
            data: JSON.stringify(pageModel),
            success: successCallback
        });
    } // end if valid request
    return;
};

Page.prototype.delete = function (id, section, name, msgSel, callback) {
    this.Id = id,
    this.section = section;
    this.name = name;
    return this.ajaxPost(id, section, name, msgSel, "Delete", callback);
};

Page.prototype.copy = function (id, section, name, msgSel, callback) {
    this.Id = id,
    this.section = section;
    this.name = name;
    return this.ajaxPost(id, section, name, msgSel, "Copy", callback);
}

Page.prototype.ajaxPost = function (id, section, name,  msgSel, action, callback) {
    if (id == undefined || id.length === 0) { // if empty get from Page object
        id = this.Id;
    }
    if (name == undefined || name.length === 0) { // if empty get from Page object
        name = this.name;
    }
    if (section == undefined || section.length === 0) { // if empty get from Page object
        section = this.section;
    }
    var pageModel = {
        Id: id,
        Section: section,
        Name: name
    };

    // callback function shows alert message for copy or delete and calls the callback function if it is defined
    var scopedObj = this;
    var ajaxCallback = function(data) {
        $(msgSel).empty(); // clear any previous messages
        if (data.Status === true) {
            var msgAction = "";
            if (action != null && action.toLowerCase() == "copy") {
                msgAction = "copied";
            } else if (action != null && action.toLowerCase() == "delete") {
                msgAction = "deleted";
            }
            var successMsg = "The page /" + scopedObj.section + "/" + scopedObj.name + " has been " + msgAction + ".";
            if (msgSel != undefined && msgSel.length > 0) {
                _default.alertMsg("success", successMsg, msgSel);
            }
            logger.logSuccess(successMsg);
        } else if (data.Errors.length > 0) {
            data.Errors.forEach(function(error) {
                logger.logError(error);
            });
        }
        if (typeof(callback) === "function") {
            callback(data);
        }
    };

    // send the ajax request
    return $.ajax({
        type: "POST",
        contentType: "application/json",
        url: "/CMS/Page/" + action,
        data: JSON.stringify(pageModel),
        async: true,
        success: ajaxCallback
    });
};

//// callback function for ajax request. If message success alert message displayed
//// else errors are logged
//Page.prototype.ajaxSuccessCallback = function (data, msgSel, action) {

//};

// hides save template as file option if page uses url params
Page.prototype.checkPageVariables = function () {
    var toggleTemplateFileOption = $("input[name='hasParams']:checked").val() === "true";
    if (toggleTemplateFileOption) {
        document.getElementById("templateFileTrue").checked = false;
        document.getElementById("templateFileFalse").checked = true;
        document.getElementsByName("templateFile").forEach(function (elem) {
            elem.setAttribute("disabled", "disabled");
        });
    } else {
        document.getElementsByName("templateFile").forEach(function (elem) {
            elem.removeAttribute("disabled");
        });
    }
};

Page.prototype.checkModelStatus = function () {
    this.init();
    if (this.hasModel) {
        // setup code mirror editor
        window.pageModelEditor = CodeMirror.fromTextArea(document.getElementById("model"), {
            lineNumbers: true,
            matchBrackets: true,
            mode: "text/x-csharp",
            theme: "material"
        });
        window.pageModelEditor.setSize("100%", "80%");
        window.setTimeout(function () {
            $("#pageModelSection").slideDown();
        }, 250);
    } else {
        $("#pageModelSection").slideUp();
        // remove code mirror editor
        var clearCodeMirror = function() {
            if (typeof(window.pageModelEditor) === "object")
                window.pageModelEditor.toTextArea();
        };
        // set timeout to prevent showing unstyled textbox before it is hidden
        window.setTimeout(clearCodeMirror, 500);
    }
}

Page.prototype.setFieldListeners = function() {
    // clears errors after an input field has been updated
    var fields = ["#pageName", "#pageVar", "#model", "#template"]
    fields.forEach(function(inputField) {
        _default.updateInputField(inputField);
    });
};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kiss.Data.Expression
{
    /// <summary>
    /// sql having clause
    /// </summary>
    [Serializable]
    public sealed class Having : ISqlExpression
    {
        /// <summary>
        /// Conditions
        /// </summary>
        public ConditionList Conditions { get; set; }

        public Having()
        {
            this.Conditions = new ConditionList();
        }

        /// <summary>
        /// ToString
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return string.Format("HAVING \r\n{0}", Conditions);
        }

        /// <summary>
        /// ISqlExpression.NodeType
        /// </summary>
        /// <returns></returns>
        NodeType ISqlExpression.NodeType()
        {
            return NodeType.Having;
        }

        /// <summary>
        /// Append
        /// </summary>
        /// <param name="expression"></param>
        public Having Append(ISqlExpression expression)
        {
            Conditions.Append(expression);
            return this;
        }

        /// <summary>
        /// append (left op right)
        /// </summary>
        /// <param name="op"></param>
        /// <param name="left"></param>
        /// <param name="right"></param>
        public Having Condition(SqlOperator op, ISqlExpression left, ISqlExpression right)
        {
            Conditions.Condition(op, left, right);
            return this;
        }

        /// <summary>
        /// append 'and'
        /// </summary>
        public Having And()
        {
            Conditions.And();
            return this;
        }

        /// <summary>
        /// append 'or'
        /// </summary>
        public Having Or()
        {
            Conditions.Or();
            return this;
        }

        /// <summary>
        /// append '('
        /// </summary>
        public Having OpenParentheses()
        {
            Conditions.OpenParentheses();
            return this;
        }

        /// <summary>
        /// append ')'
        /// </summary>
        public Having CloseParentheses()
        {
            Conditions.CloseParentheses();
            return this;
        }

        /// <summary>
        /// append raw sql
        /// </summary>
        /// <param name="sql"></param>
        public Having Sql(string sql)
        {
            Conditions.Sql(sql);
            return this;
        }

        /// <summary>
        /// Exists
        /// </summary>
        /// <param name="expression"></param>
        public Having Exists(ISqlExpression expression)
        {
            Conditions.Exists(expression);
            return this;
        }

        /// <summary>
        /// NotExists
        /// </summary>
        /// <param name="expression"></param>
        public Having NotExists(ISqlExpression expression)
        {
            Conditions.NotExists(expression);
            return this;
        }

        /// <summary>
        /// Compare
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having Compare(SqlOperator op, string column, object value)
        {
            Conditions.Compare(op, column, value);
            return this;
        }

        /// <summary>
        /// Like
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having Like(string column, object value)
        {
            Conditions.Like(column, value);
            return this;
        }

        /// <summary>
        /// NotLike
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having NotLike(string column, object value)
        {
            Conditions.NotLike(column, value);
            return this;
        }

        /// <summary>
        /// LessOrEquals
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having LessOrEquals(string column, object value)
        {
            Conditions.LessOrEquals(column, value);
            return this;
        }

        /// <summary>
        /// LessThan
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having LessThan(string column, object value)
        {
            Conditions.LessThan(column, value);
            return this;
        }

        /// <summary>
        /// GreaterOrEquals
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having GreaterOrEquals(string column, object value)
        {
            Conditions.GreaterOrEquals(column, value);
            return this;
        }

        /// <summary>
        /// GreaterThan
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having GreaterThan(string column, object value)
        {
            Conditions.GreaterThan(column, value);
            return this;
        }

        /// <summary>
        /// EqualsTo
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having EqualsTo(string column, object value)
        {
            Conditions.EqualsTo(column, value);
            return this;
        }

        /// <summary>
        /// NotEquals
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having NotEquals(string column, object value)
        {
            Conditions.NotEquals(column, value);
            return this;
        }

        /// <summary>
        /// IsNull
        /// </summary>
        /// <param name="column"></param>
        public Having IsNull(string column)
        {
            Conditions.IsNull(column);
            return this;
        }

        /// <summary>
        /// IsNotNull
        /// </summary>
        /// <param name="column"></param>
        public Having IsNotNull(string column)
        {
            Conditions.IsNotNull(column);
            return this;
        }

        /// <summary>
        /// In
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having In(string column, object value)
        {
            Conditions.In(column, value);
            return this;
        }

        /// <summary>
        /// NotIn
        /// </summary>
        /// <param name="column"></param>
        /// <param name="value"></param>
        public Having NotIn(string column, object value)
        {
            Conditions.NotIn(column, value);
            return this;
        }

        /// <summary>
        /// append a aggregate
        /// </summary>
        /// <param name="op"></param>
        /// <param name="func"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        internal void AppendAggregate(SqlOperator op, Function func, string column, ISqlExpression value)
        {
            Condition(op, new Aggregate() { Func = func, Exression = new Column(column) }, value);
        }

        /// <summary>
        /// append avg(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Avg(SqlOperator op, string column, ISqlExpression value)
        {
            AppendAggregate(op, Function.Avg, column, value);
            return this;
        }

        /// <summary>
        /// append avg(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Avg(SqlOperator op, string column, object value)
        {
            AppendAggregate(op, Function.Avg, column, value.AsExpression());
            return this;
        }

        /// <summary>
        /// append count(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Count(SqlOperator op, string column, ISqlExpression value)
        {
            AppendAggregate(op, Function.Count, column, value);
            return this;
        }

        /// <summary>
        /// append count(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Count(SqlOperator op, string column, object value)
        {
            AppendAggregate(op, Function.Count, column, value.AsExpression());
            return this;
        }

        /// <summary>
        /// append sum(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Sum(SqlOperator op, string column, ISqlExpression value)
        {
            AppendAggregate(op, Function.Sum, column, value);
            return this;
        }

        /// <summary>
        /// append sum(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Sum(SqlOperator op, string column, object value)
        {
            AppendAggregate(op, Function.Sum, column, value.AsExpression());
            return this;
        }

        /// <summary>
        /// append min(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Min(SqlOperator op, string column, ISqlExpression value)
        {
            AppendAggregate(op, Function.Min, column, value);
            return this;
        }

        /// <summary>
        /// append min(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Min(SqlOperator op, string column, object value)
        {
            AppendAggregate(op, Function.Min, column, value.AsExpression());
            return this;
        }

        /// <summary>
        /// append max(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Max(SqlOperator op, string column, ISqlExpression value)
        {
            AppendAggregate(op, Function.Max, column, value);
            return this;
        }

        /// <summary>
        /// append max(column) op value
        /// </summary>
        /// <param name="op"></param>
        /// <param name="column"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public Having Max(SqlOperator op, string column, object value)
        {
            AppendAggregate(op, Function.Max, column, value.AsExpression());
            return this;
        }
    }
}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">

    <title>io-value demo</title>

    <link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html">
    <link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
    <link rel="import" href="../io-value.html">

    <custom-style>

    </custom-style>

io-value with three attribute types.

      <demo-snippet>
        <template>
          <io-value type="string"></io-value>
          <io-value type="number" step=1></io-value>
          <io-value type="boolean"></io-value>
        </template>
      </demo-snippet>

io-value with disabled attribute.

      <demo-snippet>
        <template>

            <io-value class="string" type="string" disabled></io-value>

        </template>
      </demo-snippet>

io-value matrix with various data types and type attributes.

      <demo-snippet>
        <template>

            string
            number
            boolean

            string:
            <io-value type="string"></io-value>
            <io-value type="number"></io-value>
            <io-value type="boolean"></io-value>

            number:
            <io-value type="string"></io-value>
            <io-value type="number"></io-value>
            <io-value type="boolean"></io-value>

            boolean:
            <io-value type="string"></io-value>
            <io-value type="number"></io-value>
            <io-value type="boolean"></io-value>

            null:
            <io-value type="string"></io-value>
            <io-value type="number"></io-value>
            <io-value type="boolean"></io-value>

            NaN:
            <io-value type="string"></io-value>
            <io-value type="number"></io-value>
            <io-value type="boolean"></io-value>

            undefined:
            <io-value type="string"></io-value>
            <io-value type="number"></io-value>
            <io-value type="boolean"></io-value>

        </template>
      </demo-snippet>


text:
using UnityEngine;
using System.Collections;

public class GunAimer : ExecutionOrderBehaviour {

	public Transform aimPivot;
	public Transform aimWeapon;
	public Transform aimTarget;
	public float effect = 1;

	private Vector3 aimDirection = Vector3.zero;
	private LayerMask mask;

	void Start () {
		// Add player's own layer to mask
		mask = 1 << gameObject.layer;
		// Add Igbore Raycast layer to mask
		mask |= 1 << LayerMask.NameToLayer("Ignore Raycast");
		// Invert mask
		mask = ~mask;
	}

	// Update is called once per frame
	public override void LateUpdateCustom () {

		if (effect <= 0)
			return;

		Vector3 origPos = aimWeapon.position;
		Quaternion origRot = aimWeapon.rotation;

		// Find pivot
		Vector3 pivot = aimPivot.position;

		Transform aimSpace = transform;

		// Find current aim direction in character space, prior to adjustment
		Vector3 pivotWeaponDirection = Quaternion.Inverse(aimSpace.rotation) * (aimWeapon.position - pivot);

		// Find desired aim direction in character space
		Vector3 pivotTargetDirection = Quaternion.Inverse(aimSpace.rotation) * (aimTarget.position - pivot);
		// Move direction smoothly
		pivotTargetDirection = aimDirection = Vector3.Slerp(aimDirection, pivotTargetDirection, 15*Time.deltaTime);

		// Get aiming rotation needed
		Quaternion rotation = Quaternion.FromToRotation(pivotWeaponDirection, pivotTargetDirection);

		RotateTransformAroundPointInOtherTransformSpace (aimWeapon, rotation, pivot, aimSpace);

		float distFraction = 0;

		// Calculates horizontal angle by projecting pivotWeaponDirection and
		// pivotTargetDirection on XZ plane and taking angle between them
		Vector3 weaponDir = pivotWeaponDirection;
		Vector3 targetDir = pivotTargetDirection;
		weaponDir.y = 0;
		targetDir.y = 0;
		float rotY = Vector3.Angle(weaponDir, targetDir);

		// Calculate distFraction based on horizontal (XZ) rotation angle
		distFraction = 1 - (rotY / 400);

		aimWeapon.position = pivot + (aimWeapon.position - pivot) * distFraction;

		if (effect <= 1) {
			aimWeapon.position = Vector3.Lerp(origPos, aimWeapon.position, effect);
			aimWeapon.rotation = Quaternion.Slerp(origRot, aimWeapon.rotation, effect);
		}
	}

	void RotateTransformAroundPointInOtherTransformSpace (Transform toRotate, Quaternion rotation, Vector3 pivot, Transform space) {
		Vector3 pivotToWeapon = toRotate.position - pivot;

		Vector3 globalPositionDelta = - pivotToWeapon + space.rotation * (rotation * (Quaternion.Inverse(space.rotation) * pivotToWeapon));

		toRotate.position += globalPositionDelta;
		toRotate.rotation = space.rotation * rotation * Quaternion.Inverse(space.rotation) * toRotate.rotation;
	}

	void OnFire () {
		Vector3 dir = aimTarget.position-aimPivot.position;
		dir.Normalize();
		Ray ray = new Ray(aimPivot.position, dir);
		RaycastHit hit;
		if (Physics.Raycast(ray, out hit, 1000, mask)) {
			hit.transform.root.SendMessage("OnHit", new RayAndHit(ray, hit), SendMessageOptions.DontRequireReceiver);
		}
	}
}


text:
<template name="friendship">

Seguidores: {{followers}}

Seguindo: {{followings}}

</template>


text:
#ifndef TRANSACTIONFILTERPROXY_H
#define TRANSACTIONFILTERPROXY_H

#include <QSortFilterProxyModel>
#include <QDateTime>

/** Filter the transaction list according to pre-specified rules. */
class TransactionFilterProxy : public QSortFilterProxyModel
{
    Q_OBJECT

public:
    explicit TransactionFilterProxy(QObject *parent = 0);

    /** Earliest date that can be represented (far in the past) */
    static const QDateTime MIN_DATE;
    /** Last date that can be represented (far in the future) */
    static const QDateTime MAX_DATE;
    /** Type filter bit field (all types) */
    static const quint32 ALL_TYPES = 0xFFFFFFFF;

    static quint32 TYPE(int type) { return 1<<type; }

    void setDateRange(const QDateTime &from, const QDateTime &to);
    void setAddressPrefix(const QString &addrPrefix);
    /**
      @note Type filter takes a bit field created with TYPE() or ALL_TYPES
     */
    void setTypeFilter(quint32 modes);
    void setMinAmount(qint64 minimum);

    /** Set maximum number of rows returned, -1 if unlimited. */
    void setLimit(int limit);

    int rowCount(const QModelIndex &parent = QModelIndex()) const;

protected:
    bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;

private:
    QDateTime dateFrom;
    QDateTime dateTo;
    QString addrPrefix;
    quint32 typeFilter;
    qint64 minAmount;
    int limitRows;
};

#endif // TRANSACTIONFILTERPROXY_H