text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="width=1100" name="viewport">

<link href="./ontrail_files/10388350_10152418426454841_1736868129_n.jpg" rel="image_src">
<title>Ajatuksia juoksemisesta ja elämästä: NUTS Karhunkierros Trail Ultra 53km</title>
<link type="text/css" rel="stylesheet" href="./css/fontrail.css">
<link type="text/css" rel="stylesheet" href="./css/flaticon.css">
<link type="text/css" rel="stylesheet" href="./css/ontrail.css">

NUTS Karhunkierros Trail Ultra

Erään polkujuoksun anatomia

 Asta Heikkilä

 53 km 9:02:30

Pakkaan tavaroita. Energiaa tulee laukkuun mukaan paljon enemmän kuin uskon tarvitsevani kisassa. Teen sitten päätöksen vasta Rukalla, mitä otan mukaan juoksureppuun. Kisavaatteet on jo valittu. Lauantaiksi on luvattu lämmintä noin 15 astetta Kuusamoon, joten päätän juosta Salomonin lyhyessä juoksuhameessa ja hihattomassa paidassa. Ohut takki tulisi reppuun, ja jalkaan nastarit.

Matkustin Rukalle perjantaina Hietalan Jannen kyydissä. Matka tuntui pitkältä, vaikka pääsimme ihan hyvää vauhtia ajamaan koko ajan. Pidimme tauot minimissä, sillä halusimme ehtiä katsomaan 160km juoksijoiden startin yhdeksältä illalla. Hyvin ehdimmekin siihen. Rukalla olimme kahdeksan aikoihin, otimme hotellihuoneet vastaan ja veimme tavarat sinne. Ennen pisimmän matkan starttia juttelin vielä näiden hurjien kanssa ja toivottelin tsempit matkaan.

Seuraavana aamuna menin aamupalalle seitsemän aikoihin. Olin nukkunut todella huonosti ja oloni ei ollut paras mahdollinen. Tunsin pientä pahoivointia, eikä mieleni tehnyt yhtään syödä. Normaalia kisajännitystä. Sain hitaasti pureskeltua muutaman höttöleivän ja yhden karjalanpiirakan. Join kupillisen kahvia ja pari lasillista vettä. Aamupalalla tuli myös 160km juoksijoilta infoa reitistä:

Levittäkää sanaa! Jalkoihin kannattaa pakata paljon vaatetta. Lunta Rukan päässä on niin paljon, että siellä joutuu uimaan vyötäröä myöten. Lisäksi lumen alla saattaa olla monta kymmentä senttiä vettä, ja eteneminen tulee olemaan todella hidasta. Ottakaan myös enemmän ruokaa ja juomaa mukaan! Aikatavoitteet voi heittää romukoppaan.

Saimme järjestäjien puolesta bussikuljetuksen Rukalta lähtöpaikalle Kiutakönkäälle. Hame oli vaihtunut päältäni pitkiin trikoisiin ja evästä oli myös repussa enemmän kuin loppujen lopuksi tarvitsinkaan. Ennen starttia ajattelin, että kisa on onnistunut, jos pääsen elävänä maaliin. Kuulemma viimeiset parikymmentä kilometriä olisi todella hidasta ja vaikeaa kahlaamista hangessa.

Lähtö on tapahtunut. Lähden suhteellisen reippaasti liikkeelle. Päätän alusta asti juosta reippaasti kaikki juostavissa olevat pätkän, sillä niillä osuuksilla ratkotaan sijoitukset. Lopun lumihangissa kahlaamalla ei tehdä enää suuria eroja. Löydän heti alkumatkasta hyvän peesin, Laurin, ja asetun siihen vauhtiin mukavasti.

Alku oli mukavan juostavaa polkua. Lunta oli, mutta se ei vielä pahemmin häirinnyt. Tai no, kyllä se oikeastaan häiritsi. Aika paljonkin. Olosuhteet olivat kuitenkin kaikille samat, joten lumesta oli turha murista. Siihen oli vain sopeuduttava. Ensimmäisellä 30 kilometrillä lunta oli kuitenkin sen verran vähän, että siinä pystyi vielä jotenkuten juoksemaan. Alun pienen höntäilyn jälkeen rauhoitin vauhtia tarkoituksella, jotta jakaisin rymytä viimeiset 20 kilometriäkin maaliin. Olihan etukäteen tiedossa, että ne olisivat vaikeita.

Oulankajokivarsi. Niin käsittämättömän hienoa! Tekisi mieli pysähtyä ja ihmetellä. Polku on kuitenkin tällä hetkellä niin nopeakulkuista, että ei kannata. Vau, Karhunkierroksella on todella paljon potentiaalia tarjota huikeita elämyksiä juoksukisassa. Sykkeet ovat korkealla, mutta mitä väliä. Nyt pitää juosta, kun pystyy juoksemaan. Kohta ei enää pysty, ja silloin sykkeetkin laskee.

Juokseminen oli todella kivaa. Päivä oli lämmin ja juoksuseura mukavaa. Tunsin, että nyt kulkee hyvin. Kroppa toimi, eikä varusteissakaan ollut moittimista. Olin tietoinen, että tänään on mahdollista olla kolmen parhaan joukossa. Heiskasen Nina on aivan omaa luokkaansa, enkä pysty antamaan hänelle vielä mitään vastusta, mutta muista sijoista voisin taistella. Koko alkumatkan juoksin niin, että itselle meno tuntui suhteellisen kevyeltä, mutta tiedostin sen, että muita edellä olevia tyttöjä ei voi päästää kovin kauas.

Kitkajokivarsi. Sulaa polkua! Voi että, miten juokseminen onkaan nyt mukavaa. Nappaan repusta mukini, ja otan joesta itselleni juotavaa. Vesi on kylmää ja virkistävää. Maistuu todella hyvältä. Aurinko lämmittää, ja virtaavan veden ääni on yllättävän voimakas. Kilometrit napsuvat kelloon hyvällä tahdilla. Juoksen edelleen Laurin peesissä ja mukana on myös muutama muu.

Kitkajoen ylitys. Kuva: Lauri Kutila

Olin etukäteen ajatellut, että Kitkajokivarsi on varmaan yksi hitaimmista pätkistä koko kisan aikana, koska se on aika teknistä polkua. Mutta se olikin koko kisan yksi nopeimmista pätkistä lumettomuuden takia. Juostava pätkä loppui Juumaan, ensimmäiselle juomapisteelle, joka oli noin 32 kilometrin kohdalla. Täydensin huollossa juomani ja nappasin suuhun pari sipsiä. En viipynyt siinä kovin kauaa, sillä halusin päästä heti jahtaamaan sillä hetkellä toisena olevaa naista.

 35 km

Hieman ennen ensimmäistä huoltoa. Kuva: NUTS

Ei kulunutkaan kuin pari kilometriä, kun olin saavuttanut toisena olevan naisen. Eteneminen oli nyt hidasta. Lunta oli paljon, ja juostavat pätkät vähenivät koko ajan. Mutta aina, kun lunta ei ollut vyötäröön asti ja oli edes pieni mahdollisuus ottaa juoksuaskeleita, minä juoksin. Ajattelin, että jokainen juoksuaskel on kotiin päin. Siirryin aika pian toiseksi, ja jatkoin omaa vauhtia eteenpäin. Meno tuntui vielä hyvältä, eikä pahemmin ollut väsymistä lihaksissa. Vasen takareisi vain hieman kiukutteli, mutta se oli odotettavissa.

Olen yksin. En ole nähnyt ketään vähään aikaan. Vauhti on todella hidas. Pahimmillaan kelloon napsuu yli 15 minuutin kilometrejä. En ajattele enää mitään. Keskityn vain siihen, että siirrän jalkaa toisen eteen. Olen suolla. Astun kohtaan, mihin kukaan ei ole vielä astunut. Se on virhe. Kymmenen sentin lumikerroksen alla on PALJON jääkylmää vettä. Seison lanteitani myöten vedessä ja tunnen kylmän hiipivän lihaksiin. Äkkiä eteenpäin. Nyt ei saa pysähtyä. Käytän käsiä apuna etenemiseen ja jatkan taas matkaa. Kunpa pian tulisi taas edes pieni pätkä, missä voisin juosta. Juokseminen kuitenkin lämmittää lihaksia niin paljon.

Hangessa kahlatessa minua alkoi jossakin vaiheessa naurattaa. Mietin, kuinka paljon minulla onkaan sitten jälkipolville kerrottavaa legendaarisesta ensimmäisestä Karhunkierros -kisasta. Ajattelin, että ei tämä ole enää mikään juoksukisa -enemmän kisassa testattiin pään kestävyyttä ja rymykuntoa. Kilometrit kuluivat todella hitaasti -etenkin sen jälkeen, kun lopun nousut alkoivat. Ajattelin koko ajan, että tällainen kilpailu sopii minun nykykunnolle loistavasti. Kunto ei siis ole lähellekään sellaista, mitä haluaisin sen olevan, mutta tiedän jaksavani tuollaista lumihankikahlaamista paljon enemmän kuin moni muu.

"Ja mä tiedän, tiedän, tiedän mis mä oon..." En muuten tiedä! Taas yksi pummi. Jälkiä menee joka suuntaan. Ilmeisestikin muutkin ovat joutuneet hakemaan reittiä tässä kohtaa. Voisikohan se mennä tuolla ylempänä? Ihan sama, menen katsomaan sieltä. Ainakaan siellä ei upota vyötäröön asti niin kuin tässä kohtaa. Varpaita palelee. No niin, nyt sain maakosketuksen. Pystyy taas ponnistamaan paremmin eteenpäin.

Alaselkäni tuli ensimmäisenä kipeäksi kahlaamisesta. Välillä mietin tosissani, joudunko ottamaan kipuun särkylääkettä. En kuitenkaan ottanut. Toisella ja viimeisellä huoltopisteellä Konttaisella täydensin nopeasti juomapulloni ja jatkoin heti matkaa. Oli mukavaa päästä vaihtamaan muutama sana toisten ihmisten kanssa eikä keskustella vain itseni kanssa. Nousut eivät tuntuneet loppuvan koskaan. Lopetin taas ajattelemisen, ja keskityin vain jalkojen nostamiseen ja siirtämiseen. Pidin huolen, etten pysähtynyt kertaakaan. Kävelin, kahlasin, otin pari juoksuaskelta, upposin, kaaduin ja taas kävelin ja kahlasin. Nousin ylämäkeen, otin pari juoksuaskelta ja kierin hangessa alamäkeen. Ja taas nousin ylämäkeen. Kävelin rappusia ja taas kahlasin. En ajatellut mitään, en mitään.

Viimeinen ylämäki, viimeiset portaat. Alan taas ajatella. Katson Rukan lumisia rinteitä ja mieleni on oikein hyvä. Näen maassa joltakin pudonneen roskan ja nappaan sen ohimennen repun taskuun. Portaat loppuvat ja alkaa alamäki. Viimeinen alamäki. Kohta näen maalin. Minua huudetaan nimeltä ja kerrotaan, että naisten sarjan toinen tulee maaliin. Näen tuttuja kasvoja seisovan ja odottavan maalissa. Jokke on kameran takana kuvaamassa, ja Merja on myös ottamassa kuvia. Ja Laurikin on siellä! Missähän vaiheessä hän on joutunut keskeyttämään, mietin. Viimeksi nähdessämme hän oli kuitenkin takanani. Fiilis on huikea! Juoksen tuuletellen maaliin.

Kuva: Merja Ylihärsilä

Kuva: Lauri Kutila

Kuva: Jokke/NUTS

54.05km ja 9h 2min. Jalkoihini sattui maalissa, mutta olo ei muuten ollut kovinkaan väsynyt. Jos lunta ei olisi ollut reitin varrella ollenkaan, olisi ollut hyvin luultavasti paljon väsyneempi maalissa. Nythän viimeiset parikymmentä kilometriä oli melkeinpä kokonaan pelkkää kävelyä. Olin suoritukseeni todella tyytyväinen. Olin tehnyt ehjän ja etenkin järkevän kisan. Ja omaan kuntotasoon optimisuorituksen. Minulla on vielä paljon kehittymisen varaa, mutta nyt olen hetken aikaa tyytyväinen. Hetken aikaa.

Kisapäivän kruunu tapahtui suihkun, syömisen ja palkintojenjaon jälkeen. Koko viikonlopun odotetuin hetki oli se, kun pääsin astumaan bikinit päällä lämpimään, lihaksia hyväilevään veteen. Palju. Todella viisas veto järjestäjiltä oli hommata palju Rukalle. Siellä lilluin monta tuntia rentoutuen ja spekuloiden samalla muiden tuttujen ihmisten kanssa päivän tapahtumia.

Järjestäjille; Epulle, Jokelle ja muille NUTSin porukoille isot kiitokset viikonlopusta! Olette tehneet valtavan työn meidän kilpailijoiden takia, olette käyttäneet valtavasti tunteja, jotta meillä olisi onnistunut kisaviikonloppu. Eikä ne tunnit lopu vielä viimeisen kilpailija maaliintuloon. Kiitos vielä kerran. Minulla oli ainakin huikea viikonloppu.

<embed width="800" height="480" src="https://youtube.googleapis.com/v/O8swwHJWH1s" type="application/x-shockwave-flash" allowfullscreen="true"></object>

NTRNZ media Oy:n tuottama hieno video kisasta:

NUTS Karhunkierros oli kauden ensimmäinen pääkisani. Se oli ensimmäinen Trail Tour Finlandin osakilpailu, ja toisella sijallani sain mukaani mukavan pistepotin: 40p. Nyt palautellaan 1,5 viikkoa ennen seuraavaa kisaa, Bodom Trailia.

Font generated by flaticon.com
 under CC BY. The authors are: Icons8, Freepik, Scott de Jonge.


text:
"""
    jinja2.visitor
    ~~~~~~~~~~~~~~

    This module implements a visitor for the nodes.

    :copyright: (c) 2009 by the Jinja Team.
    :license: BSD.
"""
from jinja2.nodes import Node

class NodeVisitor(object):
    """Walks the abstract syntax tree and call visitor functions for every
    node found.  The visitor functions may return values which will be
    forwarded by the `visit` method.

    Per default the visitor functions for the nodes are ``'visit_'`` +
    class name of the node.  So a `TryFinally` node visit function would
    be `visit_TryFinally`.  This behavior can be changed by overriding
    the `get_visitor` function.  If no visitor function exists for a node
    (return value `None`) the `generic_visit` visitor is used instead.
    """

    def get_visitor(self, node):
        """Return the visitor function for this node or `None` if no visitor
        exists for this node.  In that case the generic visit function is
        used instead.
        """
        method = 'visit_' + node.__class__.__name__
        return getattr(self, method, None)

    def visit(self, node, *args, **kwargs):
        """Visit a node."""
        f = self.get_visitor(node)
        if f is not None:
            return f(node, *args, **kwargs)
        return self.generic_visit(node, *args, **kwargs)

    def generic_visit(self, node, *args, **kwargs):
        """Called if no explicit visitor function exists for a node."""
        for node in node.iter_child_nodes():
            self.visit(node, *args, **kwargs)

class NodeTransformer(NodeVisitor):
    """Walks the abstract syntax tree and allows modifications of nodes.

    The `NodeTransformer` will walk the AST and use the return value of the
    visitor functions to replace or remove the old node.  If the return
    value of the visitor function is `None` the node will be removed
    from the previous location otherwise it's replaced with the return
    value.  The return value may be the original node in which case no
    replacement takes place.
    """

    def generic_visit(self, node, *args, **kwargs):
        for field, old_value in node.iter_fields():
            if isinstance(old_value, list):
                new_values = []
                for value in old_value:
                    if isinstance(value, Node):
                        value = self.visit(value, *args, **kwargs)
                        if value is None:
                            continue
                        elif not isinstance(value, Node):
                            new_values.extend(value)
                            continue
                    new_values.append(value)
                old_value[:] = new_values
            elif isinstance(old_value, Node):
                new_node = self.visit(old_value, *args, **kwargs)
                if new_node is None:
                    delattr(node, field)
                else:
                    setattr(node, field, new_node)
        return node

    def visit_list(self, node, *args, **kwargs):
        """As transformers may return lists in some places this method
        can be used to enforce a list as return value.
        """
        rv = self.visit(node, *args, **kwargs)
        if not isinstance(rv, list):
            rv = [rv]
        return rv

redpajama_set_name: RedPajamaGithub


text:
module StateMonad where

import Control.Monad.Trans.State

-- The signature says that the final value is Unit, but the State computed in S
-- In fact we don't have a value alongside the state.
addOne :: State Int ()
addOne = get >>= \v -> put (v+1)

addOne2 :: State Int ()
addOne2 = do
  v <- get
  put (v + 1)


text:
require 'spec_helper'

module SandthornSequelProjection
  describe EventHandlerCollection do
    let(:collection) { EventHandlerCollection.new }
    let(:projection) { Object.new }

    describe "#add" do
      it "adds the handler to the collection" do
        handler_data = :foo
        collection.define(handler_data)
        expect(collection.handlers.length).to eq(1)
        handler = collection.handlers.first
        expect(handler.message).to eq(:foo)
      end
    end

    describe "#handle" do
      it "calls handle on each handler for every event, in order" do
        events = [1,2]
        handler1 = :foo
        handler2 = :bar
        handlers = [handler1, handler2]
        handlers.each do |handler|
          collection.define(handler)
        end
        collection.handlers.each do |handler|
          expect(handler).to receive(:handle).ordered.with(projection, 1).once
        end
        collection.handlers.each do |handler|
          expect(handler).to receive(:handle).ordered.with(projection, 2).once
        end
        collection.handle(projection, events)
      end
    end

  end
end


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Syn. meth. lich. 1(2): 355 (1860)

#### Original name
Sticta filicina var. lineariloba Mont.

### Remarks
null


text:
package xworker.db.jdbc;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import org.xmeta.Action;
import org.xmeta.ActionContext;
import org.xmeta.Bindings;
import org.xmeta.Thing;
import org.xmeta.World;
import org.xmeta.util.OgnlUtil;

import xworker.lang.Configuration;
import xworker.lang.executor.Executor;

public class DataSouceActionContextActions {
	//private static Logger log = LoggerFactory.getLogger(DataSouceActionContextActions.class);
	private static final String TAG = DataSouceActionContextActions.class.getName();
	/*
	public static int successCount = 0;
	public static int doInitCount= 0;
	public static int doSuccessCount= 0;
	public static int doExceptionCount= 0;
	public static int failureCount = 0;

	public static void debug(){
		System.out.println("Do init count: " + doInitCount);
		System.out.println("Do success count: " + doSuccessCount);
		System.out.println("Do exception count: " + doExceptionCount);
		System.out.println("Success count: " + successCount);
		System.out.println("Failure count: " + failureCount);
	}

	public static void clear(){
		doInitCount = 0;
		doSuccessCount = 0;
		doExceptionCount = 0;
		successCount = 0;
		failureCount = 0;
	}
	*/
	public static Thing getDataSource(Thing self, String dsPath, ActionContext acContext){
		World world = World.getInstance();
		Object dataSourceThing = null;
		Thing realSelf = null;
		if(dsPath.startsWith("self.")){
		    dsPath = dsPath.substring(5);
		    realSelf= (Thing) acContext.get("self");
		    dsPath = realSelf.getString(dsPath);
		}

		if(dsPath.startsWith("action.")){
			String action = dsPath.substring(7);
			Object obj = ((Thing) acContext.get("self")).doAction(action);
			if(obj instanceof Thing){
				dataSourceThing = (Thing) obj;
				dsPath = null;
			}else if(obj != null){
				dsPath = obj.toString();
			}
		}

		if(dataSourceThing == null && dsPath.startsWith("action:")){
			String action = dsPath.substring(7);
			Action ac = World.getInstance().getAction(action);
			Object obj = ac.run(acContext);
			if(obj instanceof Thing){
				dataSourceThing = obj;
				dsPath = null;
			}else if(obj != null){
				dsPath = obj.toString();
			}
		}

		if(dataSourceThing == null && dsPath.startsWith("var:")){
		    dsPath = dsPath.substring(4);
		    dataSourceThing = acContext.get(dsPath);
		    if(dataSourceThing instanceof String){
		        dataSourceThing = world.getThing((String) dataSourceThing);
		    }
		}else if(dataSourceThing == null && dsPath.startsWith("ognl:")){
			dsPath = dsPath.substring(5);
			dataSourceThing = OgnlUtil.getValue(dsPath, acContext);
		    if(dataSourceThing instanceof String){
		        dataSourceThing = world.getThing((String) dataSourceThing);
		    }
		}else if(dataSourceThing == null && dsPath.startsWith("parent:")){
			dsPath = dsPath.substring(7);
			ActionContext ac = acContext;
			while(ac != null){
				dataSourceThing = ac.get(dsPath);
				if(dataSourceThing != null){
				    if(dataSourceThing instanceof String){
				        dataSourceThing = world.getThing((String) dataSourceThing);
				    }
				    break;
				}

				Object acParent = ac.getObject("parentActionContext");
				if(acParent instanceof ActionContext){
					ac = (ActionContext) acParent;
					continue;
				}

				acParent = ac.getObject("parentContext");
				if(acParent instanceof ActionContext){
					ac = (ActionContext) acParent;
				}
			}

		}else if(dataSourceThing == null && dsPath.startsWith("_c_.")) {
			dsPath = dsPath.substring(4);
			dataSourceThing = Configuration.getConfiguration(dsPath, realSelf != null ? realSelf : self, acContext);
		}

		if(dataSourceThing == null){
		    dataSourceThing = world.getThing(dsPath);
		}

		return getDataSourceRef((Thing) dataSourceThing);
	}

	public static Thing getDataSourceRef(Thing dataSourceThing){
		if(dataSourceThing != null){
			String refDataSource = dataSourceThing.getStringBlankAsNull("refDataSource");
			if(refDataSource != null){
				dataSourceThing = World.getInstance().getThing(refDataSource);

				return getDataSourceRef(dataSourceThing);
			}
		}

		return dataSourceThing;
	}

	public static void init(ActionContext actionContext) throws SQLException{
		Thing self = (Thing) actionContext.get("self");
		//World world = World.getInstance();
		ActionContext acContext = (ActionContext) actionContext.get("acContext");

		//数据源事物
		Thing dataSourceThing;
		String dsPath = self.getString("dataSourcePath");

		dataSourceThing = getDataSource(self, dsPath, acContext);

		if(dataSourceThing != null){
		    //数据库总是使用继承
		    ActionContext dsContext = null;
		    List<Bindings> scopes = acContext.getScopes();
		    for(int i=scopes.size() - 1; i>=0; i--){
		        Bindings scope = scopes.get(i);
		        dsContext = scope.getContexts().get(dataSourceThing);
		        if(dsContext != null){
		            break;
		        }
		    }

		    boolean transaction = false;
		    boolean startByMe = false;
		    Connection con = null;
		    if(dsContext != null){
				//不是本上下文启动的
				con = (Connection) dsContext.get("con");
		        //log.info(self.metadata.path + " connection inherited");
		        try{
					if(con.getAutoCommit() && self.getBoolean("transaction")){
						con.setAutoCommit(false);
						transaction = true; //标记本事物开始了事物
						//log.info(self.metadata.path + " transaction started");
					}
				}catch(SQLException e){
		        	//log.info("" + dataSourceThing);
		        	//acContext.printStackTrace();
					throw e;
		        }
		    }else{
		        con = dataSourceThing.doAction("getConnection", actionContext);
		        //log.info(self.metadata.path + " connection getted,autoCommit=" + con.getAutoCommit() + ",transaction=" + self.getBoolean("transaction") );
		        startByMe = true; //是本上下文启动的
		        if(self.getBoolean("transaction")){
		            con.setAutoCommit(false);
		            transaction = true; //标记本事物开始了事物
		            //log.info(self.metadata.path + " transaction started");
		        }else{
		            //log.info("setaautocommit=true");
		            con.setAutoCommit(true);
				}
		        //把本上下文放入到动作上下文的上下文中,已被子动作判断继承
		        acContext.peek().getContexts().put(dataSourceThing, actionContext);
		        actionContext.getScope(0).put("con", con);
		    }
		    Bindings scope = acContext.peek();
		    scope.put(self.getString("connectionName"), con);
		    scope.put("dbType", DataSourceActions.getDbType(dataSourceThing));
		    actionContext.getScope(0).put("transaction", transaction);
		    actionContext.getScope(0).put("startByMe", startByMe);
		}else{
		    Executor.warn(TAG, "not set datasource thing path, contextThing=" + self.getMetadata().getName() + ",dataSourcePath=" + dsPath);
		}
	}

	public static void success(ActionContext actionContext) throws SQLException{
		//如果连接是自己启动的或者自己启动了新事务
		if(actionContext.get("con") != null && ((Boolean) actionContext.get("startByMe") || (Boolean) actionContext.get("transaction"))){
			Connection con = (Connection) actionContext.get("con");
		    try{
		        //本上下文取的连接
		        if((Boolean) actionContext.get("transaction")){
		            //启动了事物
		            con.commit();
		            con.setAutoCommit(true);
		            //log.info(self.metadata.path + " transaction commited");
		        }
		    }finally{
		        //log.info(self.metadata.path + " connection closed");
		        con.close();
		    }
		}
	}

	public static void exception(ActionContext actionContext) throws SQLException{
		//如果连接是自己启动的或者自己启动了新事务
		if(actionContext.get("con") != null && ((Boolean) actionContext.get("startByMe") || (Boolean) actionContext.get("transaction"))){
			Connection con = (Connection) actionContext.get("con");
		    try{
		        //本上下文取的连接
		        if((Boolean) actionContext.get("transaction")){
		            //启动了事物
		            con.rollback();
		            con.setAutoCommit(true);
		            //log.info(self.metadata.path + " transaction rollbacked");
		        }
		    }finally{
		        con.close();
		        //log.info(self.metadata.path + " connection closed");
		    }
		}
	}
}


text:
var express = require('express');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var session = require('express-session');
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;

//--internal modules--//
var env = require('./.envVar');
var User = require('./models/userModel');
var UserController = require('./controllers/userController');
var AuthController = require('./controllers/userController');

//--app variables--//
var app = express();
var port = env.PORT || 10000;

//--middleware--//
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(session({
	resave: false,
	saveUninitialized: true,
	secret: ''
}));
app.use(passport.initialize());
app.use(passport.session());

//--passport--//
require('./pass.js')(passport, LocalStrategy, User);

//--routes--//

//--connections--//
app.listen(port, function(){
	console.log('Listening on port: ', port);
});

mongoose.connect('mongodb://localhost/')


text:
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef jit_mips_MacroAssembler_mips_h
#define jit_mips_MacroAssembler_mips_h

#include "jsopcode.h"

#include "jit/IonCaches.h"
#include "jit/IonFrames.h"
#include "jit/mips/Assembler-mips.h"
#include "jit/MoveResolver.h"

namespace js {
namespace jit {

enum LoadStoreSize
{
    SizeByte = 8,
    SizeHalfWord = 16,
    SizeWord = 32,
    SizeDouble = 64
};

enum LoadStoreExtension
{
    ZeroExtend = 0,
    SignExtend = 1
};

enum JumpKind
{
    LongJump = 0,
    ShortJump = 1
};

struct ImmTag : public Imm32
{
    ImmTag(JSValueTag mask)
      : Imm32(int32_t(mask))
    { }
};

struct ImmType : public ImmTag
{
    ImmType(JSValueType type)
      : ImmTag(JSVAL_TYPE_TO_TAG(type))
    { }
};

static const ValueOperand JSReturnOperand = ValueOperand(JSReturnReg_Type, JSReturnReg_Data);
static const ValueOperand softfpReturnOperand = ValueOperand(v1, v0);

static Register CallReg = t9;
static const int defaultShift = 3;
static_assert(1 << defaultShift == sizeof(jsval), "The defaultShift is wrong");

class MacroAssemblerMIPS : public Assembler
{
  protected:
    // higher level tag testing code
    Operand ToPayload(Operand base);
    Address ToPayload(Address base) {
        return ToPayload(Operand(base)).toAddress();
    }
    Operand ToType(Operand base);
    Address ToType(Address base) {
        return ToType(Operand(base)).toAddress();
    }

  public:

    void convertBoolToInt32(Register source, Register dest);
    void convertInt32ToDouble(Register src, FloatRegister dest);
    void convertInt32ToDouble(const Address &src, FloatRegister dest);
    void convertUInt32ToDouble(Register src, FloatRegister dest);
    void convertUInt32ToFloat32(Register src, FloatRegister dest);
    void convertDoubleToFloat32(FloatRegister src, FloatRegister dest);
    void branchTruncateDouble(FloatRegister src, Register dest, Label *fail);
    void convertDoubleToInt32(FloatRegister src, Register dest, Label *fail,
                              bool negativeZeroCheck = true);
    void convertFloat32ToInt32(FloatRegister src, Register dest, Label *fail,
                               bool negativeZeroCheck = true);

    void convertFloat32ToDouble(FloatRegister src, FloatRegister dest);
    void branchTruncateFloat32(FloatRegister src, Register dest, Label *fail);
    void convertInt32ToFloat32(Register src, FloatRegister dest);
    void convertInt32ToFloat32(const Address &src, FloatRegister dest);

    void addDouble(FloatRegister src, FloatRegister dest);
    void subDouble(FloatRegister src, FloatRegister dest);
    void mulDouble(FloatRegister src, FloatRegister dest);
    void divDouble(FloatRegister src, FloatRegister dest);

    void negateDouble(FloatRegister reg);
    void inc64(AbsoluteAddress dest);

  public:

    void ma_move(Register rd, Register rs);

    void ma_li(Register dest, ImmGCPtr ptr);

    void ma_li(Register dest, AbsoluteLabel *label);

    void ma_li(Register dest, Imm32 imm);
    void ma_liPatchable(Register dest, Imm32 imm);
    void ma_liPatchable(Register dest, ImmPtr imm);

    // Shift operations
    void ma_sll(Register rd, Register rt, Imm32 shift);
    void ma_srl(Register rd, Register rt, Imm32 shift);
    void ma_sra(Register rd, Register rt, Imm32 shift);
    void ma_ror(Register rd, Register rt, Imm32 shift);
    void ma_rol(Register rd, Register rt, Imm32 shift);

    void ma_sll(Register rd, Register rt, Register shift);
    void ma_srl(Register rd, Register rt, Register shift);
    void ma_sra(Register rd, Register rt, Register shift);
    void ma_ror(Register rd, Register rt, Register shift);
    void ma_rol(Register rd, Register rt, Register shift);

    // Negate
    void ma_negu(Register rd, Register rs);

    void ma_not(Register rd, Register rs);

    // and
    void ma_and(Register rd, Register rs);
    void ma_and(Register rd, Register rs, Register rt);
    void ma_and(Register rd, Imm32 imm);
    void ma_and(Register rd, Register rs, Imm32 imm);

    // or
    void ma_or(Register rd, Register rs);
    void ma_or(Register rd, Register rs, Register rt);
    void ma_or(Register rd, Imm32 imm);
    void ma_or(Register rd, Register rs, Imm32 imm);

    // xor
    void ma_xor(Register rd, Register rs);
    void ma_xor(Register rd, Register rs, Register rt);
    void ma_xor(Register rd, Imm32 imm);
    void ma_xor(Register rd, Register rs, Imm32 imm);

    // load
    void ma_load(Register dest, Address address, LoadStoreSize size = SizeWord,
                 LoadStoreExtension extension = SignExtend);
    void ma_load(Register dest, const BaseIndex &src, LoadStoreSize size = SizeWord,
                 LoadStoreExtension extension = SignExtend);

    // store
    void ma_store(Register data, Address address, LoadStoreSize size = SizeWord,
                  LoadStoreExtension extension = SignExtend);
    void ma_store(Register data, const BaseIndex &dest, LoadStoreSize size = SizeWord,
                  LoadStoreExtension extension = SignExtend);
    void ma_store(Imm32 imm, const BaseIndex &dest, LoadStoreSize size = SizeWord,
                  LoadStoreExtension extension = SignExtend);

    void computeScaledAddress(const BaseIndex &address, Register dest);

    void computeEffectiveAddress(const Address &address, Register dest) {
        ma_addu(dest, address.base, Imm32(address.offset));
    }

    void computeEffectiveAddress(const BaseIndex &address, Register dest) {
        computeScaledAddress(address, dest);
        if (address.offset) {
            ma_addu(dest, dest, Imm32(address.offset));
        }
    }

    // arithmetic based ops
    // add
    void ma_addu(Register rd, Register rs, Imm32 imm);
    void ma_addu(Register rd, Register rs);
    void ma_addu(Register rd, Imm32 imm);
    void ma_addTestOverflow(Register rd, Register rs, Register rt, Label *overflow);
    void ma_addTestOverflow(Register rd, Register rs, Imm32 imm, Label *overflow);

    // subtract
    void ma_subu(Register rd, Register rs, Register rt);
    void ma_subu(Register rd, Register rs, Imm32 imm);
    void ma_subu(Register rd, Imm32 imm);
    void ma_subTestOverflow(Register rd, Register rs, Register rt, Label *overflow);
    void ma_subTestOverflow(Register rd, Register rs, Imm32 imm, Label *overflow);

    // multiplies.  For now, there are only few that we care about.
    void ma_mult(Register rs, Imm32 imm);
    void ma_mul_branch_overflow(Register rd, Register rs, Register rt, Label *overflow);
    void ma_mul_branch_overflow(Register rd, Register rs, Imm32 imm, Label *overflow);

    // divisions
    void ma_div_branch_overflow(Register rd, Register rs, Register rt, Label *overflow);
    void ma_div_branch_overflow(Register rd, Register rs, Imm32 imm, Label *overflow);

    // fast mod, uses scratch registers, and thus needs to be in the assembler
    // implicitly assumes that we can overwrite dest at the beginning of the sequence
    void ma_mod_mask(Register src, Register dest, Register hold, Register remain,
                     int32_t shift, Label *negZero = nullptr);

    // memory
    // shortcut for when we know we're transferring 32 bits of data
    void ma_lw(Register data, Address address);

    void ma_sw(Register data, Address address);
    void ma_sw(Imm32 imm, Address address);

    void ma_pop(Register r);
    void ma_push(Register r);

    // branches when done from within mips-specific code
    void ma_b(Register lhs, Register rhs, Label *l, Condition c, JumpKind jumpKind = LongJump);
    void ma_b(Register lhs, Imm32 imm, Label *l, Condition c, JumpKind jumpKind = LongJump);
    void ma_b(Register lhs, ImmPtr imm, Label *l, Condition c, JumpKind jumpKind = LongJump) {
        ma_b(lhs, Imm32(uint32_t(imm.value)), l, c, jumpKind);
    }
    void ma_b(Register lhs, ImmGCPtr imm, Label *l, Condition c, JumpKind jumpKind = LongJump) {
        MOZ_ASSERT(lhs != ScratchRegister);
        ma_li(ScratchRegister, imm);
        ma_b(lhs, Imm32(uint32_t(imm.value)), l, c, jumpKind);
    }
    void ma_b(Register lhs, Address addr, Label *l, Condition c, JumpKind jumpKind = LongJump);
    void ma_b(Address addr, Imm32 imm, Label *l, Condition c, JumpKind jumpKind = LongJump);
    void ma_b(Address addr, Register rhs, Label *l, Condition c, JumpKind jumpKind = LongJump) {
        MOZ_ASSERT(rhs != ScratchRegister);
        ma_lw(ScratchRegister, addr);
        ma_b(ScratchRegister, rhs, l, c, jumpKind);
    }

    void ma_b(Label *l, JumpKind jumpKind = LongJump);
    void ma_bal(Label *l, JumpKind jumpKind = LongJump);

    // fp instructions
    void ma_lis(FloatRegister dest, float value);
    void ma_lid(FloatRegister dest, double value);
    void ma_liNegZero(FloatRegister dest);

    void ma_mv(FloatRegister src, ValueOperand dest);
    void ma_mv(ValueOperand src, FloatRegister dest);

    void ma_ls(FloatRegister fd, Address address);
    void ma_ld(FloatRegister fd, Address address);
    void ma_sd(FloatRegister fd, Address address);
    void ma_sd(FloatRegister fd, BaseIndex address);
    void ma_ss(FloatRegister fd, Address address);
    void ma_ss(FloatRegister fd, BaseIndex address);

    void ma_pop(FloatRegister fs);
    void ma_push(FloatRegister fs);

    //FP branches
    void ma_bc1s(FloatRegister lhs, FloatRegister rhs, Label *label, DoubleCondition c,
                 JumpKind jumpKind = LongJump, FPConditionBit fcc = FCC0);
    void ma_bc1d(FloatRegister lhs, FloatRegister rhs, Label *label, DoubleCondition c,
                 JumpKind jumpKind = LongJump, FPConditionBit fcc = FCC0);

    // These fuctions abstract the access to high part of the double precision
    // float register. It is intended to work on both 32 bit and 64 bit
    // floating point coprocessor.
    // :TODO: (Bug 985881) Modify this for N32 ABI to use mthc1 and mfhc1
    void moveToDoubleHi(Register src, FloatRegister dest) {
        as_mtc1(src, getOddPair(dest));
    }
    void moveFromDoubleHi(FloatRegister src, Register dest) {
        as_mfc1(dest, getOddPair(src));
    }

    void moveToDoubleLo(Register src, FloatRegister dest) {
        as_mtc1(src, dest);
    }
    void moveFromDoubleLo(FloatRegister src, Register dest) {
        as_mfc1(dest, src);
    }

    void moveToFloat32(Register src, FloatRegister dest) {
        as_mtc1(src, dest);
    }
    void moveFromFloat32(FloatRegister src, Register dest) {
        as_mfc1(dest, src);
    }

  protected:
    void branchWithCode(InstImm code, Label *label, JumpKind jumpKind);
    Condition ma_cmp(Register rd, Register lhs, Register rhs, Condition c);

    void compareFloatingPoint(FloatFormat fmt, FloatRegister lhs, FloatRegister rhs,
                              DoubleCondition c, FloatTestKind *testKind,
                              FPConditionBit fcc = FCC0);

  public:
    // calls an Ion function, assumes that the stack is untouched (8 byte alinged)
    void ma_callIon(const Register reg);
    // callso an Ion function, assuming that sp has already been decremented
    void ma_callIonNoPush(const Register reg);
    // calls an ion function, assuming that the stack is currently not 8 byte aligned
    void ma_callIonHalfPush(const Register reg);

    void ma_call(ImmPtr dest);

    void ma_jump(ImmPtr dest);

    void ma_cmp_set(Register dst, Register lhs, Register rhs, Condition c);
    void ma_cmp_set(Register dst, Register lhs, Imm32 imm, Condition c);
    void ma_cmp_set(Register dst, Register lhs, ImmPtr imm, Condition c) {
        ma_cmp_set(dst, lhs, Imm32(uint32_t(imm.value)), c);
    }
    void ma_cmp_set(Register rd, Register rs, Address addr, Condition c);
    void ma_cmp_set(Register dst, Address lhs, Register rhs, Condition c);
    void ma_cmp_set(Register dst, Address lhs, ImmPtr imm, Condition c) {
        ma_lw(ScratchRegister, lhs);
        ma_li(SecondScratchReg, Imm32(uint32_t(imm.value)));
        ma_cmp_set(dst, ScratchRegister, SecondScratchReg, c);
    }
    void ma_cmp_set_double(Register dst, FloatRegister lhs, FloatRegister rhs, DoubleCondition c);
    void ma_cmp_set_float32(Register dst, FloatRegister lhs, FloatRegister rhs, DoubleCondition c);
};

class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
{
    // Number of bytes the stack is adjusted inside a call to C. Calls to C may
    // not be nested.
    bool inCall_;
    uint32_t args_;
    // The actual number of arguments that were passed, used to assert that
    // the initial number of arguments declared was correct.
    uint32_t passedArgs_;
    uint32_t passedArgTypes_;

    uint32_t usedArgSlots_;
    MoveOp::Type firstArgType;

    bool dynamicAlignment_;

    // Compute space needed for the function call and set the properties of the
    // callee.  It returns the space which has to be allocated for calling the
    // function.
    //
    // arg            Number of arguments of the function.
    void setupABICall(uint32_t arg);

  protected:
    MoveResolver moveResolver_;

    // Extra bytes currently pushed onto the frame beyond frameDepth_. This is
    // needed to compute offsets to stack slots while temporary space has been
    // reserved for unexpected spills or C++ function calls. It is maintained
    // by functions which track stack alignment, which for clear distinction
    // use StudlyCaps (for example, Push, Pop).
    uint32_t framePushed_;
    void adjustFrame(int value) {
        setFramePushed(framePushed_ + value);
    }
  public:
    MacroAssemblerMIPSCompat()
      : inCall_(false),
        framePushed_(0)
    { }

  public:
    using MacroAssemblerMIPS::call;

    void j(Label *dest) {
        ma_b(dest);
    }

    void mov(Register src, Register dest) {
        as_or(dest, src, zero);
    }
    void mov(ImmWord imm, Register dest) {
        ma_li(dest, Imm32(imm.value));
    }
    void mov(ImmPtr imm, Register dest) {
        mov(ImmWord(uintptr_t(imm.value)), dest);
    }
    void mov(Register src, Address dest) {
        MOZ_CRASH("NYI-IC");
    }
    void mov(Address src, Register dest) {
        MOZ_CRASH("NYI-IC");
    }

    void call(const Register reg) {
        as_jalr(reg);
        as_nop();
    }

    void call(Label *label) {
        ma_bal(label);
    }

    void call(ImmWord imm) {
        call(ImmPtr((void*)imm.value));
    }
    void call(ImmPtr imm) {
        BufferOffset bo = m_buffer.nextOffset();
        addPendingJump(bo, imm, Relocation::HARDCODED);
        ma_call(imm);
    }
    void call(AsmJSImmPtr imm) {
        movePtr(imm, CallReg);
        call(CallReg);
    }
    void call(JitCode *c) {
        BufferOffset bo = m_buffer.nextOffset();
        addPendingJump(bo, ImmPtr(c->raw()), Relocation::JITCODE);
        ma_liPatchable(ScratchRegister, Imm32((uint32_t)c->raw()));
        ma_callIonHalfPush(ScratchRegister);
    }
    void call(const CallSiteDesc &desc, const Register reg) {
        call(reg);
        append(desc, currentOffset(), framePushed_);
    }
    void call(const CallSiteDesc &desc, Label *label) {
        call(label);
        append(desc, currentOffset(), framePushed_);
    }

    void branch(JitCode *c) {
        BufferOffset bo = m_buffer.nextOffset();
        addPendingJump(bo, ImmPtr(c->raw()), Relocation::JITCODE);
        ma_liPatchable(ScratchRegister, Imm32((uint32_t)c->raw()));
        as_jr(ScratchRegister);
        as_nop();
    }
    void branch(const Register reg) {
        as_jr(reg);
        as_nop();
    }
    void nop() {
        as_nop();
    }
    void ret() {
        ma_pop(ra);
        as_jr(ra);
        as_nop();
    }
    void retn(Imm32 n) {
        // pc <- [sp]; sp += n
        ma_lw(ra, Address(StackPointer, 0));
        ma_addu(StackPointer, StackPointer, n);
        as_jr(ra);
        as_nop();
    }
    void push(Imm32 imm) {
        ma_li(ScratchRegister, imm);
        ma_push(ScratchRegister);
    }
    void push(ImmWord imm) {
        ma_li(ScratchRegister, Imm32(imm.value));
        ma_push(ScratchRegister);
    }
    void push(ImmGCPtr imm) {
        ma_li(ScratchRegister, imm);
        ma_push(ScratchRegister);
    }
    void push(const Address &address) {
        ma_lw(ScratchRegister, address);
        ma_push(ScratchRegister);
    }
    void push(Register reg) {
        ma_push(reg);
    }
    void push(FloatRegister reg) {
        ma_push(reg);
    }
    void pop(Register reg) {
        ma_pop(reg);
    }
    void pop(FloatRegister reg) {
        ma_pop(reg);
    }

    // Emit a branch that can be toggled to a non-operation. On MIPS we use
    // "andi" instruction to toggle the branch.
    // See ToggleToJmp(), ToggleToCmp().
    CodeOffsetLabel toggledJump(Label *label);

    // Emit a "jalr" or "nop" instruction. ToggleCall can be used to patch
    // this instruction.
    CodeOffsetLabel toggledCall(JitCode *target, bool enabled);

    static size_t ToggledCallSize(uint8_t *code) {
        // Four instructions used in: MacroAssemblerMIPSCompat::toggledCall
        return 4 * sizeof(uint32_t);
    }

    CodeOffsetLabel pushWithPatch(ImmWord imm) {
        CodeOffsetLabel label = movWithPatch(imm, ScratchRegister);
        ma_push(ScratchRegister);
        return label;
    }

    CodeOffsetLabel movWithPatch(ImmWord imm, Register dest) {
        CodeOffsetLabel label = CodeOffsetLabel(currentOffset());
        ma_liPatchable(dest, Imm32(imm.value));
        return label;
    }
    CodeOffsetLabel movWithPatch(ImmPtr imm, Register dest) {
        return movWithPatch(ImmWord(uintptr_t(imm.value)), dest);
    }

    void jump(Label *label) {
        ma_b(label);
    }
    void jump(Register reg) {
        as_jr(reg);
        as_nop();
    }
    void jump(const Address &address) {
        ma_lw(ScratchRegister, address);
        as_jr(ScratchRegister);
        as_nop();
    }

    void neg32(Register reg) {
        ma_negu(reg, reg);
    }
    void negl(Register reg) {
        ma_negu(reg, reg);
    }

    // Returns the register containing the type tag.
    Register splitTagForTest(const ValueOperand &value) {
        return value.typeReg();
    }

    void branchTestGCThing(Condition cond, const Address &address, Label *label);
    void branchTestGCThing(Condition cond, const BaseIndex &src, Label *label);

    void branchTestPrimitive(Condition cond, const ValueOperand &value, Label *label);
    void branchTestPrimitive(Condition cond, Register tag, Label *label);

    void branchTestValue(Condition cond, const ValueOperand &value, const Value &v, Label *label);
    void branchTestValue(Condition cond, const Address &valaddr, const ValueOperand &value,
                         Label *label);

    // unboxing code
    void unboxInt32(const ValueOperand &operand, Register dest);
    void unboxInt32(const Address &src, Register dest);
    void unboxBoolean(const ValueOperand &operand, Register dest);
    void unboxBoolean(const Address &src, Register dest);
    void unboxDouble(const ValueOperand &operand, FloatRegister dest);
    void unboxDouble(const Address &src, FloatRegister dest);
    void unboxString(const ValueOperand &operand, Register dest);
    void unboxString(const Address &src, Register dest);
    void unboxObject(const ValueOperand &src, Register dest);
    void unboxObject(const Address &src, Register dest);
    void unboxValue(const ValueOperand &src, AnyRegister dest);
    void unboxPrivate(const ValueOperand &src, Register dest);

    void notBoolean(const ValueOperand &val) {
        as_xori(val.payloadReg(), val.payloadReg(), 1);
    }

    // boxing code
    void boxDouble(FloatRegister src, const ValueOperand &dest);
    void boxNonDouble(JSValueType type, Register src, const ValueOperand &dest);

    // Extended unboxing API. If the payload is already in a register, returns
    // that register. Otherwise, provides a move to the given scratch register,
    // and returns that.
    Register extractObject(const Address &address, Register scratch);
    Register extractObject(const ValueOperand &value, Register scratch) {
        return value.payloadReg();
    }
    Register extractInt32(const ValueOperand &value, Register scratch) {
        return value.payloadReg();
    }
    Register extractBoolean(const ValueOperand &value, Register scratch) {
        return value.payloadReg();
    }
    Register extractTag(const Address &address, Register scratch);
    Register extractTag(const BaseIndex &address, Register scratch);
    Register extractTag(const ValueOperand &value, Register scratch) {
        return value.typeReg();
    }

    void boolValueToDouble(const ValueOperand &operand, FloatRegister dest);
    void int32ValueToDouble(const ValueOperand &operand, FloatRegister dest);
    void loadInt32OrDouble(const Address &address, FloatRegister dest);
    void loadInt32OrDouble(Register base, Register index,
                           FloatRegister dest, int32_t shift = defaultShift);
    void loadConstantDouble(double dp, FloatRegister dest);

    void boolValueToFloat32(const ValueOperand &operand, FloatRegister dest);
    void int32ValueToFloat32(const ValueOperand &operand, FloatRegister dest);
    void loadConstantFloat32(float f, FloatRegister dest);

    void branchTestInt32(Condition cond, const ValueOperand &value, Label *label);
    void branchTestInt32(Condition cond, Register tag, Label *label);
    void branchTestInt32(Condition cond, const Address &address, Label *label);
    void branchTestInt32(Condition cond, const BaseIndex &src, Label *label);

    void branchTestBoolean(Condition cond, const ValueOperand &value, Label *label);
    void branchTestBoolean(Condition cond, Register tag, Label *label);
    void branchTestBoolean(Condition cond, const BaseIndex &src, Label *label);

    void branch32(Condition cond, Register lhs, Register rhs, Label *label) {
        ma_b(lhs, rhs, label, cond);
    }
    void branch32(Condition cond, Register lhs, Imm32 imm, Label *label) {
        ma_b(lhs, imm, label, cond);
    }
    void branch32(Condition cond, const Operand &lhs, Register rhs, Label *label) {
        if (lhs.getTag() == Operand::REG) {
            ma_b(lhs.toReg(), rhs, label, cond);
        } else {
            branch32(cond, lhs.toAddress(), rhs, label);
        }
    }
    void branch32(Condition cond, const Operand &lhs, Imm32 rhs, Label *label) {
        if (lhs.getTag() == Operand::REG) {
            ma_b(lhs.toReg(), rhs, label, cond);
        } else {
            branch32(cond, lhs.toAddress(), rhs, label);
        }
    }
    void branch32(Condition cond, const Address &lhs, Register rhs, Label *label) {
        ma_lw(ScratchRegister, lhs);
        ma_b(ScratchRegister, rhs, label, cond);
    }
    void branch32(Condition cond, const Address &lhs, Imm32 rhs, Label *label) {
        ma_lw(SecondScratchReg, lhs);
        ma_b(SecondScratchReg, rhs, label, cond);
    }
    void branchPtr(Condition cond, const Address &lhs, Register rhs, Label *label) {
        branch32(cond, lhs, rhs, label);
    }

    void branchPrivatePtr(Condition cond, const Address &lhs, ImmPtr ptr, Label *label) {
        branchPtr(cond, lhs, ptr, label);
    }

    void branchPrivatePtr(Condition cond, const Address &lhs, Register ptr, Label *label) {
        branchPtr(cond, lhs, ptr, label);
    }

    void branchPrivatePtr(Condition cond, Register lhs, ImmWord ptr, Label *label) {
        branchPtr(cond, lhs, ptr, label);
    }

    void branchTestDouble(Condition cond, const ValueOperand &value, Label *label);
    void branchTestDouble(Condition cond, Register tag, Label *label);
    void branchTestDouble(Condition cond, const Address &address, Label *label);
    void branchTestDouble(Condition cond, const BaseIndex &src, Label *label);

    void branchTestNull(Condition cond, const ValueOperand &value, Label *label);
    void branchTestNull(Condition cond, Register tag, Label *label);
    void branchTestNull(Condition cond, const BaseIndex &src, Label *label);
    void testNullSet(Condition cond, const ValueOperand &value, Register dest);

    void branchTestObject(Condition cond, const ValueOperand &value, Label *label);
    void branchTestObject(Condition cond, Register tag, Label *label);
    void branchTestObject(Condition cond, const BaseIndex &src, Label *label);
    void testObjectSet(Condition cond, const ValueOperand &value, Register dest);

    void branchTestString(Condition cond, const ValueOperand &value, Label *label);
    void branchTestString(Condition cond, Register tag, Label *label);
    void branchTestString(Condition cond, const BaseIndex &src, Label *label);

    void branchTestSymbol(Condition cond, const ValueOperand &value, Label *label);
    void branchTestSymbol(Condition cond, const Register &tag, Label *label);
    void branchTestSymbol(Condition cond, const BaseIndex &src, Label *label);

    void branchTestUndefined(Condition cond, const ValueOperand &value, Label *label);
    void branchTestUndefined(Condition cond, Register tag, Label *label);
    void branchTestUndefined(Condition cond, const BaseIndex &src, Label *label);
    void branchTestUndefined(Condition cond, const Address &address, Label *label);
    void testUndefinedSet(Condition cond, const ValueOperand &value, Register dest);

    void branchTestNumber(Condition cond, const ValueOperand &value, Label *label);
    void branchTestNumber(Condition cond, Register tag, Label *label);

    void branchTestMagic(Condition cond, const ValueOperand &value, Label *label);
    void branchTestMagic(Condition cond, Register tag, Label *label);
    void branchTestMagic(Condition cond, const Address &address, Label *label);
    void branchTestMagic(Condition cond, const BaseIndex &src, Label *label);

    void branchTestMagicValue(Condition cond, const ValueOperand &val, JSWhyMagic why,
                              Label *label) {
        MOZ_ASSERT(cond == Equal || cond == NotEqual);
        branchTestValue(cond, val, MagicValue(why), label);
    }

    void branchTestInt32Truthy(bool b, const ValueOperand &value, Label *label);

    void branchTestStringTruthy(bool b, const ValueOperand &value, Label *label);

    void branchTestDoubleTruthy(bool b, FloatRegister value, Label *label);

    void branchTestBooleanTruthy(bool b, const ValueOperand &operand, Label *label);

    void branchTest32(Condition cond, Register lhs, Register rhs, Label *label) {
        MOZ_ASSERT(cond == Zero || cond == NonZero || cond == Signed || cond == NotSigned);
        if (lhs == rhs) {
            ma_b(lhs, rhs, label, cond);
        } else {
            as_and(ScratchRegister, lhs, rhs);
            ma_b(ScratchRegister, ScratchRegister, label, cond);
        }
    }
    void branchTest32(Condition cond, Register lhs, Imm32 imm, Label *label) {
        ma_li(ScratchRegister, imm);
        branchTest32(cond, lhs, ScratchRegister, label);
    }
    void branchTest32(Condition cond, const Address &address, Imm32 imm, Label *label) {
        ma_lw(SecondScratchReg, address);
        branchTest32(cond, SecondScratchReg, imm, label);
    }
    void branchTest32(Condition cond, AbsoluteAddress address, Imm32 imm, Label *label) {
        loadPtr(address, ScratchRegister);
        branchTest32(cond, ScratchRegister, imm, label);
    }
    void branchTestPtr(Condition cond, Register lhs, Register rhs, Label *label) {
        branchTest32(cond, lhs, rhs, label);
    }
    void branchTestPtr(Condition cond, Register lhs, const Imm32 rhs, Label *label) {
        branchTest32(cond, lhs, rhs, label);
    }
    void branchTestPtr(Condition cond, const Address &lhs, Imm32 imm, Label *label) {
        branchTest32(cond, lhs, imm, label);
    }
    void branchPtr(Condition cond, Register lhs, Register rhs, Label *label) {
        ma_b(lhs, rhs, label, cond);
    }
    void branchPtr(Condition cond, Register lhs, ImmGCPtr ptr, Label *label) {
        ma_li(ScratchRegister, ptr);
        ma_b(lhs, ScratchRegister, label, cond);
    }
    void branchPtr(Condition cond, Register lhs, ImmWord imm, Label *label) {
        ma_b(lhs, Imm32(imm.value), label, cond);
    }
    void branchPtr(Condition cond, Register lhs, ImmPtr imm, Label *label) {
        branchPtr(cond, lhs, ImmWord(uintptr_t(imm.value)), label);
    }
    void branchPtr(Condition cond, Register lhs, AsmJSImmPtr imm, Label *label) {
        movePtr(imm, ScratchRegister);
        branchPtr(cond, lhs, ScratchRegister, label);
    }
    void branchPtr(Condition cond, Register lhs, Imm32 imm, Label *label) {
        ma_b(lhs, imm, label, cond);
    }
    void decBranchPtr(Condition cond, Register lhs, Imm32 imm, Label *label) {
        subPtr(imm, lhs);
        branch32(cond, lhs, Imm32(0), label);
    }

protected:
    uint32_t getType(const Value &val);
    void moveData(const Value &val, Register data);
public:
    void moveValue(const Value &val, Register type, Register data);

    CodeOffsetJump backedgeJump(RepatchLabel *label);
    CodeOffsetJump jumpWithPatch(RepatchLabel *label);

    template <typename T>
    CodeOffsetJump branchPtrWithPatch(Condition cond, Register reg, T ptr, RepatchLabel *label) {
        movePtr(ptr, ScratchRegister);
        Label skipJump;
        ma_b(reg, ScratchRegister, &skipJump, InvertCondition(cond), ShortJump);
        CodeOffsetJump off = jumpWithPatch(label);
        bind(&skipJump);
        return off;
    }

    template <typename T>
    CodeOffsetJump branchPtrWithPatch(Condition cond, Address addr, T ptr, RepatchLabel *label) {
        loadPtr(addr, SecondScratchReg);
        movePtr(ptr, ScratchRegister);
        Label skipJump;
        ma_b(SecondScratchReg, ScratchRegister, &skipJump, InvertCondition(cond), ShortJump);
        CodeOffsetJump off = jumpWithPatch(label);
        bind(&skipJump);
        return off;
    }
    void branchPtr(Condition cond, Address addr, ImmGCPtr ptr, Label *label) {
        ma_lw(SecondScratchReg, addr);
        ma_li(ScratchRegister, ptr);
        ma_b(SecondScratchReg, ScratchRegister, label, cond);
    }
    void branchPtr(Condition cond, Address addr, ImmWord ptr, Label *label) {
        ma_lw(SecondScratchReg, addr);
        ma_b(SecondScratchReg, Imm32(ptr.value), label, cond);
    }
    void branchPtr(Condition cond, Address addr, ImmPtr ptr, Label *label) {
        branchPtr(cond, addr, ImmWord(uintptr_t(ptr.value)), label);
    }
    void branchPtr(Condition cond, AbsoluteAddress addr, Register ptr, Label *label) {
        loadPtr(addr, ScratchRegister);
        ma_b(ScratchRegister, ptr, label, cond);
    }
    void branchPtr(Condition cond, AsmJSAbsoluteAddress addr, Register ptr,
                   Label *label) {
        loadPtr(addr, ScratchRegister);
        ma_b(ScratchRegister, ptr, label, cond);
    }
    void branch32(Condition cond, AbsoluteAddress lhs, Imm32 rhs, Label *label) {
        loadPtr(lhs, SecondScratchReg); // ma_b might use scratch
        ma_b(SecondScratchReg, rhs, label, cond);
    }
    void branch32(Condition cond, AbsoluteAddress lhs, Register rhs, Label *label) {
        loadPtr(lhs, ScratchRegister);
        ma_b(ScratchRegister, rhs, label, cond);
    }

    void loadUnboxedValue(Address address, MIRType type, AnyRegister dest) {
        if (dest.isFloat())
            loadInt32OrDouble(address, dest.fpu());
        else
            ma_lw(dest.gpr(), address);
    }

    void loadUnboxedValue(BaseIndex address, MIRType type, AnyRegister dest) {
        if (dest.isFloat())
            loadInt32OrDouble(address.base, address.index, dest.fpu(), address.scale);
        else
            load32(address, dest.gpr());
    }

    template <typename T>
    void storeUnboxedValue(ConstantOrRegister value, MIRType valueType, const T &dest,
                           MIRType slotType);

    void moveValue(const Value &val, const ValueOperand &dest);

    void moveValue(const ValueOperand &src, const ValueOperand &dest) {
        Register s0 = src.typeReg(), d0 = dest.typeReg(),
                 s1 = src.payloadReg(), d1 = dest.payloadReg();

        // Either one or both of the source registers could be the same as a
        // destination register.
        if (s1 == d0) {
            if (s0 == d1) {
                // If both are, this is just a swap of two registers.
                JS_ASSERT(d1 != ScratchRegister);
                JS_ASSERT(d0 != ScratchRegister);
                move32(d1, ScratchRegister);
                move32(d0, d1);
                move32(ScratchRegister, d0);
                return;
            }
            // If only one is, copy that source first.
            mozilla::Swap(s0, s1);
            mozilla::Swap(d0, d1);
        }

        if (s0 != d0)
            move32(s0, d0);
        if (s1 != d1)
            move32(s1, d1);
    }

    void storeValue(ValueOperand val, Operand dst);
    void storeValue(ValueOperand val, const BaseIndex &dest);
    void storeValue(JSValueType type, Register reg, BaseIndex dest);
    void storeValue(ValueOperand val, const Address &dest);
    void storeValue(JSValueType type, Register reg, Address dest);
    void storeValue(const Value &val, Address dest);
    void storeValue(const Value &val, BaseIndex dest);

    void loadValue(Address src, ValueOperand val);
    void loadValue(Operand dest, ValueOperand val) {
        loadValue(dest.toAddress(), val);
    }
    void loadValue(const BaseIndex &addr, ValueOperand val);
    void tagValue(JSValueType type, Register payload, ValueOperand dest);

    void pushValue(ValueOperand val);
    void popValue(ValueOperand val);
    void pushValue(const Value &val) {
        jsval_layout jv = JSVAL_TO_IMPL(val);
        push(Imm32(jv.s.tag));
        if (val.isMarkable())
            push(ImmGCPtr(reinterpret_cast<gc::Cell *>(val.toGCThing())));
        else
            push(Imm32(jv.s.payload.i32));
    }
    void pushValue(JSValueType type, Register reg) {
        push(ImmTag(JSVAL_TYPE_TO_TAG(type)));
        ma_push(reg);
    }
    void pushValue(const Address &addr);
    void Push(const ValueOperand &val) {
        pushValue(val);
        framePushed_ += sizeof(Value);
    }
    void Pop(const ValueOperand &val) {
        popValue(val);
        framePushed_ -= sizeof(Value);
    }
    void storePayload(const Value &val, Address dest);
    void storePayload(Register src, Address dest);
    void storePayload(const Value &val, const BaseIndex &dest);
    void storePayload(Register src, const BaseIndex &dest);
    void storeTypeTag(ImmTag tag, Address dest);
    void storeTypeTag(ImmTag tag, const BaseIndex &dest);

    void makeFrameDescriptor(Register frameSizeReg, FrameType type) {
        ma_sll(frameSizeReg, frameSizeReg, Imm32(FRAMESIZE_SHIFT));
        ma_or(frameSizeReg, frameSizeReg, Imm32(type));
    }

    void handleFailureWithHandler(void *handler);
    void handleFailureWithHandlerTail();

    /////////////////////////////////////////////////////////////////
    // Common interface.
    /////////////////////////////////////////////////////////////////
  public:
    // The following functions are exposed for use in platform-shared code.
    void Push(Register reg) {
        ma_push(reg);
        adjustFrame(sizeof(intptr_t));
    }
    void Push(const Imm32 imm) {
        ma_li(ScratchRegister, imm);
        ma_push(ScratchRegister);
        adjustFrame(sizeof(intptr_t));
    }
    void Push(const ImmWord imm) {
        ma_li(ScratchRegister, Imm32(imm.value));
        ma_push(ScratchRegister);
        adjustFrame(sizeof(intptr_t));
    }
    void Push(const ImmPtr imm) {
        Push(ImmWord(uintptr_t(imm.value)));
    }
    void Push(const ImmGCPtr ptr) {
        ma_li(ScratchRegister, ptr);
        ma_push(ScratchRegister);
        adjustFrame(sizeof(intptr_t));
    }
    void Push(FloatRegister f) {
        ma_push(f);
        adjustFrame(sizeof(double));
    }

    CodeOffsetLabel PushWithPatch(ImmWord word) {
        framePushed_ += sizeof(word.value);
        return pushWithPatch(word);
    }
    CodeOffsetLabel PushWithPatch(ImmPtr imm) {
        return PushWithPatch(ImmWord(uintptr_t(imm.value)));
    }

    void Pop(Register reg) {
        ma_pop(reg);
        adjustFrame(-sizeof(intptr_t));
    }
    void implicitPop(uint32_t args) {
        MOZ_ASSERT(args % sizeof(intptr_t) == 0);
        adjustFrame(-args);
    }
    uint32_t framePushed() const {
        return framePushed_;
    }
    void setFramePushed(uint32_t framePushed) {
        framePushed_ = framePushed;
    }

    // Builds an exit frame on the stack, with a return address to an internal
    // non-function. Returns offset to be passed to markSafepointAt().
    bool buildFakeExitFrame(Register scratch, uint32_t *offset);

    void callWithExitFrame(JitCode *target);
    void callWithExitFrame(JitCode *target, Register dynStack);

    // Makes an Ion call using the only two methods that it is sane for
    // indep code to make a call
    void callIon(Register callee);
    void callIonFromAsmJS(Register callee);

    void reserveStack(uint32_t amount);
    void freeStack(uint32_t amount);
    void freeStack(Register amount);

    void add32(Register src, Register dest);
    void add32(Imm32 imm, Register dest);
    void add32(Imm32 imm, const Address &dest);
    void sub32(Imm32 imm, Register dest);
    void sub32(Register src, Register dest);

    void incrementInt32Value(const Address &addr) {
        add32(Imm32(1), ToPayload(addr));
    }

    template <typename T>
    void branchAdd32(Condition cond, T src, Register dest, Label *overflow) {
        switch (cond) {
          case Overflow:
            ma_addTestOverflow(dest, dest, src, overflow);
            break;
          default:
            MOZ_CRASH("NYI");
        }
    }
    template <typename T>
    void branchSub32(Condition cond, T src, Register dest, Label *overflow) {
        switch (cond) {
          case Overflow:
            ma_subTestOverflow(dest, dest, src, overflow);
            break;
          case NonZero:
          case Zero:
            sub32(src, dest);
            ma_b(dest, dest, overflow, cond);
            break;
          default:
            MOZ_CRASH("NYI");
        }
    }

    void and32(Register src, Register dest);
    void and32(Imm32 imm, Register dest);
    void and32(Imm32 imm, const Address &dest);
    void and32(const Address &src, Register dest);
    void or32(Imm32 imm, Register dest);
    void or32(Imm32 imm, const Address &dest);
    void xor32(Imm32 imm, Register dest);
    void xorPtr(Imm32 imm, Register dest);
    void xorPtr(Register src, Register dest);
    void orPtr(Imm32 imm, Register dest);
    void orPtr(Register src, Register dest);
    void andPtr(Imm32 imm, Register dest);
    void andPtr(Register src, Register dest);
    void addPtr(Register src, Register dest);
    void subPtr(Register src, Register dest);
    void addPtr(const Address &src, Register dest);
    void not32(Register reg);

    void move32(Imm32 imm, Register dest);
    void move32(Register src, Register dest);

    void movePtr(Register src, Register dest);
    void movePtr(ImmWord imm, Register dest);
    void movePtr(ImmPtr imm, Register dest);
    void movePtr(AsmJSImmPtr imm, Register dest);
    void movePtr(ImmGCPtr imm, Register dest);

    void load8SignExtend(const Address &address, Register dest);
    void load8SignExtend(const BaseIndex &src, Register dest);

    void load8ZeroExtend(const Address &address, Register dest);
    void load8ZeroExtend(const BaseIndex &src, Register dest);

    void load16SignExtend(const Address &address, Register dest);
    void load16SignExtend(const BaseIndex &src, Register dest);

    void load16ZeroExtend(const Address &address, Register dest);
    void load16ZeroExtend(const BaseIndex &src, Register dest);

    void load32(const Address &address, Register dest);
    void load32(const BaseIndex &address, Register dest);
    void load32(AbsoluteAddress address, Register dest);

    void loadPtr(const Address &address, Register dest);
    void loadPtr(const BaseIndex &src, Register dest);
    void loadPtr(AbsoluteAddress address, Register dest);
    void loadPtr(AsmJSAbsoluteAddress address, Register dest);

    void loadPrivate(const Address &address, Register dest);

    void loadDouble(const Address &addr, FloatRegister dest);
    void loadDouble(const BaseIndex &src, FloatRegister dest);

    // Load a float value into a register, then expand it to a double.
    void loadFloatAsDouble(const Address &addr, FloatRegister dest);
    void loadFloatAsDouble(const BaseIndex &src, FloatRegister dest);

    void loadFloat32(const Address &addr, FloatRegister dest);
    void loadFloat32(const BaseIndex &src, FloatRegister dest);

    void store8(Register src, const Address &address);
    void store8(Imm32 imm, const Address &address);
    void store8(Register src, const BaseIndex &address);
    void store8(Imm32 imm, const BaseIndex &address);

    void store16(Register src, const Address &address);
    void store16(Imm32 imm, const Address &address);
    void store16(Register src, const BaseIndex &address);
    void store16(Imm32 imm, const BaseIndex &address);

    void store32(Register src, AbsoluteAddress address);
    void store32(Register src, const Address &address);
    void store32(Register src, const BaseIndex &address);
    void store32(Imm32 src, const Address &address);
    void store32(Imm32 src, const BaseIndex &address);

    // NOTE: This will use second scratch on MIPS. Only ARM needs the
    // implementation without second scratch.
    void store32_NoSecondScratch(Imm32 src, const Address &address) {
        store32(src, address);
    }

    void storePtr(ImmWord imm, const Address &address);
    void storePtr(ImmPtr imm, const Address &address);
    void storePtr(ImmGCPtr imm, const Address &address);
    void storePtr(Register src, const Address &address);
    void storePtr(Register src, const BaseIndex &address);
    void storePtr(Register src, AbsoluteAddress dest);
    void storeDouble(FloatRegister src, Address addr) {
        ma_sd(src, addr);
    }
    void storeDouble(FloatRegister src, BaseIndex addr) {
        MOZ_ASSERT(addr.offset == 0);
        ma_sd(src, addr);
    }
    void moveDouble(FloatRegister src, FloatRegister dest) {
        as_movd(dest, src);
    }

    void storeFloat32(FloatRegister src, Address addr) {
        ma_ss(src, addr);
    }
    void storeFloat32(FloatRegister src, BaseIndex addr) {
        MOZ_ASSERT(addr.offset == 0);
        ma_ss(src, addr);
    }

    void zeroDouble(FloatRegister reg) {
        moveToDoubleLo(zero, reg);
        moveToDoubleHi(zero, reg);
    }

    void clampIntToUint8(Register reg) {
        // look at (reg >> 8) if it is 0, then src shouldn't be clamped
        // if it is <0, then we want to clamp to 0,
        // otherwise, we wish to clamp to 255
        Label done;
        ma_move(ScratchRegister, reg);
        as_sra(ScratchRegister, ScratchRegister, 8);
        ma_b(ScratchRegister, ScratchRegister, &done, Assembler::Zero, ShortJump);
        {
            Label negative;
            ma_b(ScratchRegister, ScratchRegister, &negative, Assembler::Signed, ShortJump);
            {
                ma_li(reg, Imm32(255));
                ma_b(&done, ShortJump);
            }
            bind(&negative);
            {
                ma_move(reg, zero);
            }
        }
        bind(&done);
    }

    void subPtr(Imm32 imm, const Register dest);
    void subPtr(const Address &addr, const Register dest);
    void subPtr(Register src, const Address &dest);
    void addPtr(Imm32 imm, const Register dest);
    void addPtr(Imm32 imm, const Address &dest);
    void addPtr(ImmWord imm, const Register dest) {
        addPtr(Imm32(imm.value), dest);
    }
    void addPtr(ImmPtr imm, const Register dest) {
        addPtr(ImmWord(uintptr_t(imm.value)), dest);
    }
    void mulBy3(const Register &src, const Register &dest) {
        as_addu(dest, src, src);
        as_addu(dest, dest, src);
    }

    void breakpoint();

    void branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
                      Label *label);

    void branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
                     Label *label);

    void checkStackAlignment();

    void alignStackPointer();
    void restoreStackPointer();
    static void calculateAlignedStackPointer(void **stackPointer);

    void rshiftPtr(Imm32 imm, Register dest) {
        ma_srl(dest, dest, imm);
    }
    void rshiftPtrArithmetic(Imm32 imm, Register dest) {
        ma_sra(dest, dest, imm);
    }
    void lshiftPtr(Imm32 imm, Register dest) {
        ma_sll(dest, dest, imm);
    }

    // If source is a double, load it into dest. If source is int32,
    // convert it to double. Else, branch to failure.
    void ensureDouble(const ValueOperand &source, FloatRegister dest, Label *failure);

    template <typename T1, typename T2>
    void cmpPtrSet(Assembler::Condition cond, T1 lhs, T2 rhs, Register dest)
    {
        ma_cmp_set(dest, lhs, rhs, cond);
    }

    template <typename T1, typename T2>
    void cmp32Set(Assembler::Condition cond, T1 lhs, T2 rhs, Register dest)
    {
        ma_cmp_set(dest, lhs, rhs, cond);
    }

    // Setup a call to C/C++ code, given the number of general arguments it
    // takes. Note that this only supports cdecl.
    //
    // In order for alignment to work correctly, the MacroAssembler must have a
    // consistent view of the stack displacement. It is okay to call "push"
    // manually, however, if the stack alignment were to change, the macro
    // assembler should be notified before starting a call.
    void setupAlignedABICall(uint32_t args);

    // Sets up an ABI call for when the alignment is not known. This may need a
    // scratch register.
    void setupUnalignedABICall(uint32_t args, Register scratch);

    // Arguments must be assigned in a left-to-right order. This process may
    // temporarily use more stack, in which case sp-relative addresses will be
    // automatically adjusted. It is extremely important that sp-relative
    // addresses are computed *after* setupABICall(). Furthermore, no
    // operations should be emitted while setting arguments.
    void passABIArg(const MoveOperand &from, MoveOp::Type type);
    void passABIArg(Register reg);
    void passABIArg(FloatRegister reg, MoveOp::Type type);
    void passABIArg(const ValueOperand &regs);

  protected:
    bool buildOOLFakeExitFrame(void *fakeReturnAddr);

  private:
    void callWithABIPre(uint32_t *stackAdjust, bool callFromAsmJS = false);
    void callWithABIPost(uint32_t stackAdjust, MoveOp::Type result);

  public:
    // Emits a call to a C/C++ function, resolving all argument moves.
    void callWithABI(void *fun, MoveOp::Type result = MoveOp::GENERAL);
    void callWithABI(AsmJSImmPtr imm, MoveOp::Type result = MoveOp::GENERAL);
    void callWithABI(const Address &fun, MoveOp::Type result = MoveOp::GENERAL);

    CodeOffsetLabel labelForPatch() {
        return CodeOffsetLabel(nextOffset().getOffset());
    }

    void memIntToValue(Address Source, Address Dest) {
        load32(Source, SecondScratchReg);
        storeValue(JSVAL_TYPE_INT32, SecondScratchReg, Dest);
    }

    void lea(Operand addr, Register dest) {
        ma_addu(dest, addr.baseReg(), Imm32(addr.disp()));
    }

    void abiret() {
        as_jr(ra);
        as_nop();
    }

    void ma_storeImm(Imm32 imm, const Address &addr) {
        ma_sw(imm, addr);
    }

    BufferOffset ma_BoundsCheck(Register bounded) {
        BufferOffset bo = m_buffer.nextOffset();
        ma_liPatchable(bounded, Imm32(0));
        return bo;
    }

    void moveFloat32(FloatRegister src, FloatRegister dest) {
        as_movs(dest, src);
    }

#ifdef JSGC_GENERATIONAL
    void branchPtrInNurseryRange(Condition cond, Register ptr, Register temp, Label *label);
    void branchValueIsNurseryObject(Condition cond, ValueOperand value, Register temp,
                                    Label *label);
#endif

    void loadAsmJSActivation(Register dest) {
        loadPtr(Address(GlobalReg, AsmJSActivationGlobalDataOffset - AsmJSGlobalRegBias), dest);
    }
};

typedef MacroAssemblerMIPSCompat MacroAssemblerSpecific;

} // namespace jit
} // namespace js

#endif /* jit_mips_MacroAssembler_mips_h */


text:
cmake_minimum_required(VERSION 3.4)

set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")

if(NOT EXISTS ${MANIFEST})
    message(FATAL_ERROR "Cannot find install mainfest: ${MANIFEST}")
endif()

file(STRINGS ${MANIFEST} files)
foreach(file ${files})
    if(EXISTS ${file} OR IS_SYMLINK ${file})
        message(STATUS "Removing: ${file}")

	execute_process(
	    COMMAND ${CMAKE_COMMAND} -E remove  ${file}
	    RESULT_VARIABLE result
	    OUTPUT_QUIET
	    ERROR_VARIABLE stderr
	    ERROR_STRIP_TRAILING_WHITESPACE
        )

        if(NOT ${result} EQUAL 0)
            message(FATAL_ERROR "${stderr}")
        endif()
    else()
        message(STATUS "Does-not-exist: ${file}")
    endif()
endforeach(file)


text:
package com.apps.juncode.pruebawham.Model;

/**
 * Created by Produccion 800N on 31/10/2017.
 */

public class User {

    private String token, UID, nombre, correo, foto, activo;

    public User(String token, String UID, String nombre, String correo, String foto, String activo){
        this.token = token;
        this.UID = UID;
        this.nombre = nombre;
        this.correo = correo;
        this.foto = foto;
        this.activo = activo;
    }

    public User() {
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getUID() {
        return UID;
    }

    public void setUID(String UID) {
        this.UID = UID;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getCorreo() {
        return correo;
    }

    public void setCorreo(String correo) {
        this.correo = correo;
    }

    public String getFoto() {
        return foto;
    }

    public void setFoto(String foto) {
        this.foto = foto;
    }

    public String getActivo() {
        return activo;
    }

    public void setActivo(String activo) {
        this.activo = activo;
    }
}


text:
"""Logging utility."""
from oslo_config import cfg
from oslo_log import log as logging

from asciipic.common import constant

def prepare_log_module():
    """Prepare log module."""
    logging.register_options(cfg.CONF)
    logging.setup(cfg.CONF, constant.LOG_DOMAIN)


text:
module RunTracker
  module CommandLoader
    # Require all command files
    Dir["#{File.dirname(__FILE__)}/commands/*.rb"].each do |file|
      require file
    end

    # Add Command module names here
    @commands = [
      # AddGame,
      AddExcludeKeyword,
      # AddResource,
      BotInfo,
      # ClearRunData,
      # ExportDB,
      # ListCategories,
      # ListGames,
      # ListResources,
      # ListMods,
      # Grant,
      # OptIn,
      # OptOut,
      # SetAllowedGameList,
      # SetAnnounce,
      # SetCategoryAlias,
      # SetGameAlias,
      SetStreamChannel,
      SetStreamerRole,
      # SetupBot,
      # StatsCategory,
      # StatsGame,
      # StatsRunner,
      # RemoveGame,
      # RemoveResource,
      # ResetDB,
      # Resource
    ]

    def self.getCommands
      @commands
    end

    def self.checkCommands(_command)
      @commands.each do |command|
        return true if _command == command
      end
      false
    end

    def self.loadCommands
      @commands.each do |command|
        RunTracker::RTBot.include!(command)
      end
    end
  end
end


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

// UnityEngine.Texture2D
struct Texture2D_t3884108195;
// UnityEngine.Shader
struct Shader_t3191267369;
// UnityEngine.Material
struct Material_t3870600107;

#include "AssemblyU2DCSharp_UnityStandardAssets_ImageEffects1415309093.h"
#include "AssemblyU2DCSharp_UnityStandardAssets_ImageEffects2414447165.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// UnityStandardAssets.ImageEffects.ScreenOverlay
struct  ScreenOverlay_t109709238  : public PostEffectsBase_t1415309093
{
public:
	// UnityStandardAssets.ImageEffects.ScreenOverlay/OverlayBlendMode UnityStandardAssets.ImageEffects.ScreenOverlay::blendMode
	int32_t ___blendMode_5;
	// System.Single UnityStandardAssets.ImageEffects.ScreenOverlay::intensity
	float ___intensity_6;
	// UnityEngine.Texture2D UnityStandardAssets.ImageEffects.ScreenOverlay::texture
	Texture2D_t3884108195 * ___texture_7;
	// UnityEngine.Shader UnityStandardAssets.ImageEffects.ScreenOverlay::overlayShader
	Shader_t3191267369 * ___overlayShader_8;
	// UnityEngine.Material UnityStandardAssets.ImageEffects.ScreenOverlay::overlayMaterial
	Material_t3870600107 * ___overlayMaterial_9;

public:
	inline static int32_t get_offset_of_blendMode_5() { return static_cast<int32_t>(offsetof(ScreenOverlay_t109709238, ___blendMode_5)); }
	inline int32_t get_blendMode_5() const { return ___blendMode_5; }
	inline int32_t* get_address_of_blendMode_5() { return &___blendMode_5; }
	inline void set_blendMode_5(int32_t value)
	{
		___blendMode_5 = value;
	}

	inline static int32_t get_offset_of_intensity_6() { return static_cast<int32_t>(offsetof(ScreenOverlay_t109709238, ___intensity_6)); }
	inline float get_intensity_6() const { return ___intensity_6; }
	inline float* get_address_of_intensity_6() { return &___intensity_6; }
	inline void set_intensity_6(float value)
	{
		___intensity_6 = value;
	}

	inline static int32_t get_offset_of_texture_7() { return static_cast<int32_t>(offsetof(ScreenOverlay_t109709238, ___texture_7)); }
	inline Texture2D_t3884108195 * get_texture_7() const { return ___texture_7; }
	inline Texture2D_t3884108195 ** get_address_of_texture_7() { return &___texture_7; }
	inline void set_texture_7(Texture2D_t3884108195 * value)
	{
		___texture_7 = value;
		Il2CppCodeGenWriteBarrier(&___texture_7, value);
	}

	inline static int32_t get_offset_of_overlayShader_8() { return static_cast<int32_t>(offsetof(ScreenOverlay_t109709238, ___overlayShader_8)); }
	inline Shader_t3191267369 * get_overlayShader_8() const { return ___overlayShader_8; }
	inline Shader_t3191267369 ** get_address_of_overlayShader_8() { return &___overlayShader_8; }
	inline void set_overlayShader_8(Shader_t3191267369 * value)
	{
		___overlayShader_8 = value;
		Il2CppCodeGenWriteBarrier(&___overlayShader_8, value);
	}

	inline static int32_t get_offset_of_overlayMaterial_9() { return static_cast<int32_t>(offsetof(ScreenOverlay_t109709238, ___overlayMaterial_9)); }
	inline Material_t3870600107 * get_overlayMaterial_9() const { return ___overlayMaterial_9; }
	inline Material_t3870600107 ** get_address_of_overlayMaterial_9() { return &___overlayMaterial_9; }
	inline void set_overlayMaterial_9(Material_t3870600107 * value)
	{
		___overlayMaterial_9 = value;
		Il2CppCodeGenWriteBarrier(&___overlayMaterial_9, value);
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
package com.infrastructure.request;

import android.text.TextUtils;

import com.infrastructure.cache.CacheManager;
import com.infrastructure.commom.BaseConstants;
import com.infrastructure.util.BaseUtil;

import java.io.DataOutputStream;
import java.io.InputStream;
import java.net.CookieHandler;
import java.net.CookieManager;
import java.net.HttpCookie;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;

/**
 * 封装HttpURLConnection网络请求
 */
public class HurlRequest extends Request {
    private static final String COOKIE = "Cookie";
    private static final String SET_COOKIE = "Set-Cookie";
    private static final String HEADER_CONTENT_TYPE = "Content-Type";

    private HttpURLConnection urlConn;

    public HurlRequest(final URLData urlData, final List<RequestParameter> params, final RequestCallback callback) {
        super(urlData, params, callback);
    }

    @Override
    protected void doGet() {
        if (!BaseUtil.IsListEmpty(mParameters)) {
            mUrl = mUrl + HOST_PARAMS_SEPARATOR + formatRequestParams();
        }
        String cacheContent = null;
        if (mExpires > 0) {
            cacheContent = CacheManager.getInstance().getFileCache(mUrl);
        }
        if (!BaseUtil.IsStringEmpty(cacheContent)) {
            handleSuccess(cacheContent);
        } else {
            InputStream is = null;
            try {
                // 打开一个HttpURLConnection连接
                openConnection();
                // 添加Coocie
                addCoocie();
                // 添加头部信息
                addRequestProperties();
                // 添加连接参数
                setConnectionParametersForRequest(REQUEST_GET);
                // 开始连接
                urlConn.connect();
                // 判断请求是否成功
                if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
                    // 保存Coocie
                    storeCookie();
                    // 获取返回的数据
                    is = urlConn.getInputStream();
                    String response = BaseUtil.InputStream2String(is);
                    is.close();
                    // 把成功获取到的数据记录到缓存
                    if (mExpires > 0) {
                        CacheManager.getInstance().putFileCache(mUrl, response, mExpires);
                    }
                    // 处理返回信息
                    doResponse(response);
                } else {
                    handleFail("网络异常");
                }
            } catch (Exception e) {
                handleFail("网络异常");
            } finally {
                BaseUtil.closeStream(is);
                if (urlConn != null) {
                    urlConn.disconnect();
                }
            }
        }
    }

    @Override
    protected void doPost() {
        DataOutputStream dos = null;
        InputStream is = null;
        try {
            // 打开一个HttpURLConnection连接
            openConnection();
            // 添加Coocie
            addCoocie();
            // 添加头部信息
            addRequestProperties();
            // 添加连接参数
            setConnectionParametersForRequest(REQUEST_POST);
            // 开始连接
            urlConn.connect();
            // 发送请求参数
            if (!BaseUtil.IsListEmpty(mParameters)) {
                dos = new DataOutputStream(urlConn.getOutputStream());
                byte[] postData = URLEncoder.encode(formatRequestParams(), "UTF-8").getBytes();
                dos.write(postData);
                dos.flush();
                dos.close();
            }
            // 判断请求是否成功
            if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
                // 保存Coocie
                storeCookie();
                // 获取返回的数据
                is = urlConn.getInputStream();
                String response = BaseUtil.InputStream2String(is);
                is.close();
                // 处理返回信息
                doResponse(response);
            } else {
                handleFail("网络异常");
            }
        } catch (Exception e) {
            handleFail("网络异常");
        } finally {
            BaseUtil.closeStream(dos);
            BaseUtil.closeStream(is);
            if (urlConn != null) {
                urlConn.disconnect();
            }
        }
    }

    @Override
    protected void abort() {
        if (urlConn != null) {
            urlConn.disconnect();
        }
    }

    /**
     * 处理返回信息
     *
     * @param content 请求返回的内容
     */
    protected void doResponse(String content) {
        handleSuccess(content);
    }

    /**
     * 打开连接
     */
    private void openConnection() throws Exception {
        final URL url = new URL(mUrl);
        urlConn = (HttpURLConnection) url.openConnection();
        urlConn.setConnectTimeout(TIME_OUT_MILLISECOND);
        urlConn.setReadTimeout(TIME_OUT_MILLISECOND);
        urlConn.setUseCaches(false);
        urlConn.setDoInput(true);
    }

    /**
     * 添加头部信息
     */
    private void addRequestProperties() {
        urlConn.addRequestProperty(ACCEPT_CHARSET, "UTF-8,*");
        urlConn.addRequestProperty(USER_AGENT, "Subway Android App");
        // urlConn.addRequestProperty(ACCEPT_ENCODING, "gzip");
    }

    /**
     * 添加连接参数
     */
    private void setConnectionParametersForRequest(String type) throws Exception {
        if (REQUEST_GET.equals(type)) {
            urlConn.setRequestMethod(REQUEST_GET);
        } else if (REQUEST_POST.equals(type)) {
            urlConn.setRequestMethod(REQUEST_POST);
            urlConn.setDoOutput(true);
            urlConn.setChunkedStreamingMode(0);
            //urlConn.addRequestProperty(HEADER_CONTENT_TYPE, "application/x-www-form-urlencode");
        }
    }

    /**
     * 添加Coocie
     */
    private void addCoocie() {
        String strCookie = restoreCoocie();
        if (!BaseUtil.IsStringEmpty(strCookie)) {
            urlConn.setRequestProperty(COOKIE, strCookie);
        }
    }

    /**
     * 将cookie保存到本地
     */
    private synchronized void storeCookie() {
        CookieManager cookieManager = new CookieManager();
        CookieHandler.setDefault(cookieManager);
        Map<String, List<String>> headerFields = urlConn.getHeaderFields();
        List<String> cookiesHeader = headerFields.get(SET_COOKIE);
        if (cookiesHeader != null) {
            for (String cookie : cookiesHeader) {
                cookieManager.getCookieStore().add(null, HttpCookie.parse(cookie).get(0));
            }
        }
        if (cookieManager.getCookieStore().getCookies().size() > 0) {
            BaseUtil.SaveObject(BaseConstants.COOKIE_CACHE_PATH, TextUtils.join(";", cookieManager.getCookieStore().getCookies()));
        } else {
            BaseUtil.SaveObject(BaseConstants.COOKIE_CACHE_PATH, "");
        }
    }

    /**
     * 从本地获取cookie列表
     */
    private String restoreCoocie() {
        Object object = BaseUtil.RestoreObject(BaseConstants.COOKIE_CACHE_PATH);
        return object == null ? null : (String) object;
    }
}


text:
`trim`
======

{% raw %}

The `trim` filter strips whitespace (or other characters) from the beginning and end of a string:

````twig
{{ '  I like Twig.  '|trim }}

{# outputs 'I like Twig.' #}

{{ '  I like Twig.'|trim('.') }}

{# outputs '  I like Twig' #}

{{ '  I like Twig.  '|trim(side='left') }}

{# outputs 'I like Twig.  ' #}

{{ '  I like Twig.  '|trim(' ', 'right') }}

{# outputs '  I like Twig.' #}
````

Arguments
---------

* `character_mask`: The characters to strip
* `side`: The default is to strip from the left and the right (`both`) sides, but `left` and `right` will strip from either the left side or right side only

{% endraw %}

[back]({{ site.baseurl }}{% link language-reference/filters/index.md %})


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

import javax.annotation.Generated;

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

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

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

    private static final MarshallingInfo<String> PROGRESSUPDATESTREAM_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ProgressUpdateStream").build();
    private static final MarshallingInfo<String> MIGRATIONTASKNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("MigrationTaskName").build();
    private static final MarshallingInfo<String> STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Status").build();
    private static final MarshallingInfo<Integer> PROGRESSPERCENT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ProgressPercent").build();
    private static final MarshallingInfo<String> STATUSDETAIL_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("StatusDetail").build();
    private static final MarshallingInfo<java.util.Date> UPDATEDATETIME_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("UpdateDateTime").timestampFormat("unixTimestamp").build();

    private static final MigrationTaskSummaryMarshaller instance = new MigrationTaskSummaryMarshaller();

    public static MigrationTaskSummaryMarshaller getInstance() {
        return instance;
    }

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

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

        try {
            protocolMarshaller.marshall(migrationTaskSummary.getProgressUpdateStream(), PROGRESSUPDATESTREAM_BINDING);
            protocolMarshaller.marshall(migrationTaskSummary.getMigrationTaskName(), MIGRATIONTASKNAME_BINDING);
            protocolMarshaller.marshall(migrationTaskSummary.getStatus(), STATUS_BINDING);
            protocolMarshaller.marshall(migrationTaskSummary.getProgressPercent(), PROGRESSPERCENT_BINDING);
            protocolMarshaller.marshall(migrationTaskSummary.getStatusDetail(), STATUSDETAIL_BINDING);
            protocolMarshaller.marshall(migrationTaskSummary.getUpdateDateTime(), UPDATEDATETIME_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
import java.util.Properties;

import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

import org.jibble.pircbot.Colors;
import org.jibble.pircbot.User;

final class GiveawayTask extends Scheduler.Task
{
	private static final MyBot bot = MyBot.instance;

	private int acceptorTask;

	public boolean accepted;
	public String winner;
	public int winnerHash;

	public GiveawayTask(final int time)
	{
		super("giveaway", time);
		accepted = false;
		winner = null;
		winnerHash = 0;
	}

	@Override
	public final void main()
	{
		final Scheduler.Task giveawayTask = this;
		final User u = bot.getRandomUser();
		winner = u.getNick();
		winnerHash = u.hashCode();
		Config.log("Giveaway winner chosen: " + winner);
		bot.sendMessage(Config.mainChannel, Colors.BOLD + Colors.RED + "CONGRATULATIONS " + Colors.NORMAL + Colors.PURPLE + u.getNick() + Colors.RED + "! You have been randomly selected to win an " + Colors.PURPLE + "AK-47 | Redline FT" + Colors.RED + "! Type \"!accept\" in the next" + Colors.BLUE + " 30 minutes" + Colors.RED + " to claim your prize or another winner will be chosen.");
		acceptorTask = bot.sched.addTask(new Scheduler.Task("giveaway acceptor", 2400)
		{
			@Override
			public final void main()
			{
				winner = null;
				if (accepted) accepted = false;
				else
				{
					bot.sendMessage(Config.mainChannel, Colors.RED + "As " + Colors.PURPLE + u.getNick() + Colors.RED + " has not collected their prize, a new winner will be chosen soon.");
					// Pick another user in 25-50 seconds, will override the reschedule below
					giveawayTask.reschedule(50);
				}
				setCompleted();
			}
		});
	}

	/**
	 * Checks if an User is eligible for the prize
	 */
	public final boolean isWinner(final User u)
	{
		return !accepted && u.hashCode() == winnerHash;
	}

	final void acceptReward()
	{
		accepted = true;
		bot.sched.cancelTask(acceptorTask);

		final String username = Config.get("GMAIL");
		final String password = Config.get("GMAILpw");

		final Properties props = new Properties();
		props.put("mail.smtp.auth", "true");
		props.put("mail.smtp.starttls.enable", "true");
		props.put("mail.smtp.host", "smtp.gmail.com");
		props.put("mail.smtp.port", "587");

		final Session session = Session.getInstance(props, new javax.mail.Authenticator()
		{
			@Override
			protected final PasswordAuthentication getPasswordAuthentication()
			{
				return new PasswordAuthentication(username, password);
			}
		});

		try
		{
			final MimeMessage message = new MimeMessage(session);
			message.setFrom(new InternetAddress(username));
			message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(Config.get("GMAIL")));
			message.setSubject("New IRC giveaway winner!");
			message.setText("Winner Nickname = " + winner + "\n\n Winner hashcode = " + winnerHash);
			Transport.send(message);
			Config.log("Sent email successfully");
		}
		catch (final MessagingException ex) { Config.log(ex); }
	}
}


text:
layout: default
title: This is Contact Page yo!
---

This is Contact Page