text:
//
// Copyright (C) 2005 Andras Varga
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//

#ifndef __INET_BONNMOTIONFILECACHE_H
#define __INET_BONNMOTIONFILECACHE_H

#include <list>
#include <vector>

#include "inet/common/INETDefs.h"

namespace inet {

class BonnMotionFileCache;

/**
 * Represents a BonnMotion file's contents.
 * @see BonnMotionFileCache, BonnMotionMobility
 */
class INET_API BonnMotionFile
{
  public:
    typedef std::vector<double> Line;

  protected:
    friend class BonnMotionFileCache;
    typedef std::list<Line> LineList;
    LineList lines;

  public:
    const Line *getLine(int nodeId) const;
};

/**
 * Singleton object to read and store BonnMotion files. Used within
 * BonnMotionMobility.  Needed because otherwise every node would
 * have to open and read the file independently.
 *
 * @ingroup mobility
 * @author Andras Varga
 */
class INET_API BonnMotionFileCache
{
  protected:
    typedef std::map<std::string, BonnMotionFile> BMFileMap;
    BMFileMap cache;
    static BonnMotionFileCache *inst;
    void parseFile(const char *filename, BonnMotionFile& bmFile);
    BonnMotionFileCache() {}
    virtual ~BonnMotionFileCache() {}

  public:
    /**
     * Returns the singleton instance.
     */
    static BonnMotionFileCache *getInstance();

    /**
     * Deletes the singleton instance.
     */
    static void deleteInstance();

    /**
     * Returns the given document.
     */
    virtual const BonnMotionFile *getFile(const char *filename);
};

} // namespace inet

#endif // ifndef __INET_BONNMOTIONFILECACHE_H


text:
package org.codehaus.mojo.mrm.api;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Base implementation of {@link FileSystem} that all implementations should extend from.
 *
 * @since 1.0
 */
public abstract class BaseFileSystem
    implements FileSystem
{
    /**
     * Ensure consistent serialization.
     *
     * @since 1.0
     */
    private static final long serialVersionUID = 1L;

    /**
     * The root entry.
     */
    private final DirectoryEntry root = new DefaultDirectoryEntry( this, null, "" );

    /**
     * {@inheritDoc}
     */
    public DirectoryEntry getRoot()
    {
        return root;
    }

    /**
     * {@inheritDoc}
     */
    public Entry get( String path )
    {
        if ( path.startsWith( "/" ) )
        {
            path = path.substring( 1 );
        }
        if ( path.length() == 0 )
        {
            return root;
        }
        String[] parts = path.split( "/" );
        if ( parts.length == 0 )
        {
            return root;
        }
        DirectoryEntry parent = root;
        for ( int i = 0; i < parts.length - 1; i++ )
        {
            parent = new DefaultDirectoryEntry( this, parent, parts[i] );
        }
        return get( parent, parts[parts.length - 1] );
    }

    /**
     * Gets the named entry in the specified directory.
     * The default implementation lists all the entries in the directory and looks for the one with the matching name.
     * Caching implementations will likely want to override this behaviour.
     *
     * @param parent the directory.
     * @param name   the name of the entry to get.
     * @return the {@link Entry} or null if the entry does not exist.
     */
    protected Entry get( DirectoryEntry parent, String name )
    {
        parent.getClass();
        Entry[] entries = listEntries( parent );
        if ( entries != null )
        {
            for (Entry entry : entries)
            {
                if (name.equals(entry.getName()))
                {
                    return entry;
                }
            }
        }
        return null;
    }

    /**
     * {@inheritDoc}
     */
    public DirectoryEntry mkdir( DirectoryEntry parent, String name )
    {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     */
    public FileEntry put( DirectoryEntry parent, String name, InputStream content )
        throws IOException
    {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     */
    public FileEntry put( DirectoryEntry parent, String name, byte[] content )
        throws IOException
    {
        return put( parent, name, new ByteArrayInputStream( content ) );
    }

    /**
     * {@inheritDoc}
     */
    public void remove( Entry entry )
    {
        throw new UnsupportedOperationException();
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.bcel.classfile;

import java.io.DataInput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.stream.Stream;

import org.apache.bcel.Const;
import org.apache.bcel.util.Args;

/**
 * This class represents colection of local variables in a method. This attribute is contained in the Code
 * attribute.
 *
 * @see Code
 * @see LocalVariable
 */
public class LocalVariableTable extends Attribute implements Iterable<LocalVariable> {

    private LocalVariable[] localVariableTable; // variables

    /**
     * Construct object from input stream.
     *
     * @param nameIndex Index in constant pool
     * @param length Content length in bytes
     * @param input Input stream
     * @param constantPool Array of constants
     * @throws IOException if an I/O error occurs.
     */
    LocalVariableTable(final int nameIndex, final int length, final DataInput input, final ConstantPool constantPool) throws IOException {
        this(nameIndex, length, (LocalVariable[]) null, constantPool);
        final int localVariableTableLength = input.readUnsignedShort();
        localVariableTable = new LocalVariable[localVariableTableLength];
        for (int i = 0; i < localVariableTableLength; i++) {
            localVariableTable[i] = new LocalVariable(input, constantPool);
        }
    }

    /**
     * @param nameIndex Index in constant pool to 'LocalVariableTable'
     * @param length Content length in bytes
     * @param localVariableTable Table of local variables
     * @param constantPool Array of constants
     */
    public LocalVariableTable(final int nameIndex, final int length, final LocalVariable[] localVariableTable, final ConstantPool constantPool) {
        super(Const.ATTR_LOCAL_VARIABLE_TABLE, nameIndex, length, constantPool);
        this.localVariableTable = localVariableTable != null ? localVariableTable : LocalVariable.EMPTY_ARRAY;
        Args.requireU2(this.localVariableTable.length, "localVariableTable.length");
    }

    /**
     * Initialize from another object. Note that both objects use the same references (shallow copy). Use copy() for a
     * physical copy.
     *
     * @param c Source to copy.
     */
    public LocalVariableTable(final LocalVariableTable c) {
        this(c.getNameIndex(), c.getLength(), c.getLocalVariableTable(), c.getConstantPool());
    }

    /**
     * Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.
     * I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
     *
     * @param v Visitor object
     */
    @Override
    public void accept(final Visitor v) {
        v.visitLocalVariableTable(this);
    }

    /**
     * @return deep copy of this attribute
     */
    @Override
    public Attribute copy(final ConstantPool constantPool) {
        final LocalVariableTable c = (LocalVariableTable) clone();
        c.localVariableTable = new LocalVariable[localVariableTable.length];
        Arrays.setAll(c.localVariableTable, i -> localVariableTable[i].copy());
        c.setConstantPool(constantPool);
        return c;
    }

    /**
     * Dump local variable table attribute to file stream in binary format.
     *
     * @param file Output file stream
     * @throws IOException if an I/O error occurs.
     */
    @Override
    public final void dump(final DataOutputStream file) throws IOException {
        super.dump(file);
        file.writeShort(localVariableTable.length);
        for (final LocalVariable variable : localVariableTable) {
            variable.dump(file);
        }
    }

    /**
     *
     * @param index the variable slot
     *
     * @return the first LocalVariable that matches the slot or null if not found
     *
     * @deprecated since 5.2 because multiple variables can share the same slot, use getLocalVariable(int index, int pc)
     *             instead.
     */
    @java.lang.Deprecated
    public final LocalVariable getLocalVariable(final int index) {
        for (final LocalVariable variable : localVariableTable) {
            if (variable.getIndex() == index) {
                return variable;
            }
        }
        return null;
    }

    /**
     *
     * @param index the variable slot
     * @param pc the current pc that this variable is alive
     *
     * @return the LocalVariable that matches or null if not found
     */
    public final LocalVariable getLocalVariable(final int index, final int pc) {
        for (final LocalVariable variable : localVariableTable) {
            if (variable.getIndex() == index) {
                final int startPc = variable.getStartPC();
                final int endPc = startPc + variable.getLength();
                if (pc >= startPc && pc <= endPc) {
                    return variable;
                }
            }
        }
        return null;
    }

    /**
     * @return Array of local variables of method.
     */
    public final LocalVariable[] getLocalVariableTable() {
        return localVariableTable;
    }

    public final int getTableLength() {
        return localVariableTable == null ? 0 : localVariableTable.length;
    }

    @Override
    public Iterator<LocalVariable> iterator() {
        return Stream.of(localVariableTable).iterator();
    }

    public final void setLocalVariableTable(final LocalVariable[] localVariableTable) {
        this.localVariableTable = localVariableTable;
    }

    /**
     * @return String representation.
     */
    @Override
    public final String toString() {
        final StringBuilder buf = new StringBuilder();
        for (int i = 0; i < localVariableTable.length; i++) {
            buf.append(localVariableTable[i]);
            if (i < localVariableTable.length - 1) {
                buf.append('\n');
            }
        }
        return buf.toString();
    }
}


text:
package pokemon.modele;

import java.io.IOException;
import java.util.Vector;

import pokemon.annotations.Tps;

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.XmlReader.Element;

/* La classe Dresseur (herite de NPC) decrit le modele d'un dresseur
 * ainsi que son equipe de pokemon, lue depuis un fichier xml */

@Tps(nbhours=3)
public class Dresseur extends NPC implements CombatInfos {
	private boolean aggressive;
	private String name;
	private Vector<Pkm> team;

	//Constructeurs
	public Dresseur() {
		super();
		setAggressive(false);
		setName("Dresseur");
	}
	public Dresseur(String path) {
		super(path);
		setAggressive(false);
	}
	public Dresseur(Vector2 pos) {
		super(pos);
		setAggressive(false);
		setName("Dresseur");
	}
	public Dresseur(String path, Vector2 pos, boolean isAggressive) {
		super(path, pos);
		setAggressive(isAggressive);
	}
	public Dresseur(String path, Vector2 pos, int status, boolean isAggressive) {
		super(path, pos, status);
		setAggressive(isAggressive);
	}

	//Fonctionnalitees principales
	public void addPkm(Pkm p) {
		if(team.size()<6){
			team.addElement(p);
		}
	}
	public void removePkm(Pkm p) {
		for(int i = 0;i<team.size();i++) {
			if(team.get(i) == p) {
				team.remove(i);
			}
		}
	}
	public void removePkm(String s) {
		for(int i = 0;i<team.size();i++) {
			if(team.get(i).nom.compareTo(s) == 0) {
				team.remove(i);
			}
		}
	}
	public void removePkm(int i) {
		team.remove(i);
	}

	public Vector<Pkm> getTeam() {
		return team;
	}

	public boolean asTeam() {
		return !team.isEmpty();
	}

	//Fonctions privees
	@Override
	protected void lireXML(String path) {

		try {
			//On recupere les dialogues
			Element root = getDialogs(path);

			//On récupere le nom
			String str = root.getAttribute("name");
			if(str != null) {
				setName(str);
			}
			else {
				setName("Dresseur");
			}

			//On recupere l'equipe
			Element equipe = root.getChildByName("equipe");
			if(equipe != null) {
				team = new Vector<Pkm>();
				for(int j = 0;j<equipe.getChildCount();j++) {
					Element pokemonElt = equipe.getChild(j);
					int id = pokemonElt.getInt("id");
					int lvl = pokemonElt.getInt("niveau");

					Pkm pokemon = new Pkm(Pokedex.values()[id-1].get(), lvl);

					for(int k = 0;k<pokemonElt.getChildCount();k++) {
						Element cap = pokemonElt.getChild(k);
						pokemon.add(bddCapacite.valueOf(cap.getAttribute("nom")).get());
						System.out.println("Ajout de " + cap.getAttribute("nom"));
					}
					addPkm(pokemon);
				}
			}

		} catch (IOException e) {
			e.printStackTrace();
			dialogs.add(new Dialog());
		}
	}

	public Pkm teamAt(int ind){ return this.team.elementAt(ind); }
	public Pkm[] Team(){ return (Pkm[])team.toArray(); }

	@Override
	public boolean isAggressive() {
		return aggressive && status == 0;
	}
	public void setAggressive(boolean aggressive) {
		this.aggressive = aggressive;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public String toString() {
		return this.name;
	}
}


text:
coda_log
======

useful code for logging

licensing
=========

under the Lesser GNU Public License


text:
	@class TieSignalConnection
]=]

local require = require(script.Parent.loader).load(script)

local Maid = require("Maid")
local TieInterfaceUtils = require("TieInterfaceUtils")
local RxBrioUtils = require("RxBrioUtils")
local RxInstanceUtils = require("RxInstanceUtils")
local TieUtils = require("TieUtils")

local TieSignalConnection = {}
TieSignalConnection.ClassName = "TieSignalConnection"
TieSignalConnection.__index = TieSignalConnection

function TieSignalConnection.new(memberDefinition, folder, adornee, callback)
	local self = setmetatable({}, TieSignalConnection)

	assert(folder or adornee, "Folder or adornee required")

	self._maid = Maid.new()

	self._memberDefinition = assert(memberDefinition, "No memberDefinition")
	self._folder = folder
	self._adornee = adornee
	self._callback = assert(callback, "No callback")

	self._connected = true
	self._tieDefinition = self._memberDefinition:GetTieDefinition()

	self:_connect()

	return self
end

function TieSignalConnection:Disconnect()
	self:Destroy()
end

function TieSignalConnection:_connect()
	self._maid:GiveTask(self:_observeBindableEvent():Subscribe(function(brio)
		if brio:IsDead() then
			return
		end

		local maid = brio:ToMaid()
		local bindableEvent = brio:GetValue()

		maid:GiveTask(bindableEvent.Event:Connect(function(...)
			task.spawn(self._callback, TieUtils.decode(...))
		end))
	end))
end

function TieSignalConnection:_observeFolderBrio()
	return TieInterfaceUtils.observeFolderBrio(self._tieDefinition, self._folder, self._adornee)
end

function TieSignalConnection:_observeBindableEvent()
	local name = self._memberDefinition:GetMemberName()

	return self:_observeFolderBrio():Pipe({
		RxBrioUtils.switchMapBrio(function(folder)
			return RxInstanceUtils.observeLastNamedChildBrio(folder, "BindableEvent", name)
		end);
		RxBrioUtils.onlyLastBrioSurvives();
	})
end

function TieSignalConnection:__index(index)
	if index == "_adornee" or index == "_folder" then
		return rawget(self, index)
	elseif index == "IsConnected" then
		return self._connected
	elseif TieSignalConnection[index] then
		return TieSignalConnection[index]
	else
		error(("Bad index %q for TieSignalConnection"):format(tostring(index)))
	end
end

function TieSignalConnection:Destroy()
	self._connected = false
	self._maid:DoCleaning()
	-- Avoid setting the metatable so calling methods is always valid
end

return TieSignalConnection


text:
FROM gliderlabs/alpine
MAINTAINER kost - https://github.com/kost

ENV VERSION_WAPITI 2.3.0

RUN apk --update add python openssl py-pip py-xml && rm -f /var/cache/apk/* && \
pip install BeautifulSoup requests && \
mkdir /opt && cd /opt && \
wget "http://downloads.sourceforge.net/project/wapiti/wapiti/wapiti-$VERSION_WAPITI/wapiti-$VERSION_WAPITI.tar.gz" && \
tar xvzf wapiti-$VERSION_WAPITI.tar.gz && \
rm wapiti-$VERSION_WAPITI.tar.gz && \
cd wapiti-$VERSION_WAPITI && \
ln -sf /opt/wapiti-$VERSION_WAPITI /opt/wapiti && \
chmod 755 /opt/wapiti/bin/wapiti && \
mkdir /work && \
adduser -D -s /bin/sh user user && chown -R user /work

USER user

ENV LANG en
ENV PATH /opt/wapiti/bin:$PATH

VOLUME /work
WORKDIR /work

ENTRYPOINT ["wapiti"]

CMD ["--help"]


text:
import React from 'react';

class Error extends React.Component {
  render() {
    return (

Not Found!111!!

    )
  }
}

export default Error;


text:
package de.hs.mannheim.modUro.model;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.*;

/**
 * A time series is a data where one to many series of data
 * can be stored for a time value. It is similar to a XY plot.
 * Each data series has associated descriptive statistics (mean etc.).
 *
 * @author Markus Gumbel (m.gumbel@hs-mannheim.de)
 */
public class TimeSeries {

    private File file; // Input file of a metric type txt file.
    private String name;
    private boolean isMetric;
    private double[] timeSeries;
    private Map<String, double[]> dataSeries = new HashMap<>();
    private Map<String, StatisticValues> stats = new HashMap<>();
    private String defaultDataSeries;

    public TimeSeries(String name) {
        this.name = name;
    }

    /**
     * Creates a single time series from a file. A file's entry
     * is x y (separated by a white space).
     *
     * @param file
     */
    public TimeSeries(File file) {
        this.name = getFileName(file);
        this.file = file;
        readDataFromFile();
    }

    /**
     * Creates a time series with exactly one data series.
     *
     * @param name       Name of the time series.
     * @param timeSeries Time points.
     * @param dataSeries Data points (one for each time points).
     */
    public TimeSeries(String name, double[] timeSeries,
                      String dataName, double[] dataSeries) {
        this.name = name;
        setTimeSeries(timeSeries);
        addDataSeries(dataName, dataSeries);
    }

    public void setTimeSeries(double[] timeSeries) {
        if (defaultDataSeries != null) {
            throw new RuntimeException("Time points already set and in use. " +
            "Cannot set it again.");
        }
        this.timeSeries = timeSeries;
    }

    /**
     * Add a new data series.
     *
     * @param dataName Name of the data series.
     * @param data     Data itself.
     */
    public void addDataSeries(String dataName, double[] data) {
        if (dataSeries.containsKey(dataName)) {
            throw new RuntimeException("Data series name " + dataName +
                    " already exists. Data series cannot be added.");
        }
        if (dataSeries.isEmpty()) {
            defaultDataSeries = dataName;
        } else {
            if (data.length != getTimePointsSize()) {
                throw new RuntimeException("New data series has different size" +
                        " and cannot be added. Is: " + data.length +
                        ", should " + getTimePointsSize());
            }
        }
        dataSeries.put(dataName, data);
        StatisticValues sv = new StatisticValues(name, data);
        stats.put(dataName, sv);
    }

    public boolean isMetric() {
        return isMetric;
    }

    public void setMetric(boolean value) {
        isMetric = value;
    }

    public String getName() {
        return name;
    }

    public Set<String> getDataSeriesNames() {
        return dataSeries.keySet();
    }

    /**
     * @return Time points.
     */
    public double[] getTimeSeries() {
        return timeSeries;
    }

    /**
     * @return The last time point.
     */
    public double getMaxTime() {
        return timeSeries[timeSeries.length - 1];
    }

    /**
     * @return The first data series.
     */
    public double[] getData() {
        return getData(defaultDataSeries);
    }

    public double[] getData(String dataName) {
        return dataSeries.get(dataName);
    }

    public StatisticValues getStats() {
        return getStats(defaultDataSeries);
    }

    public StatisticValues getStats(String dataName) {
        return stats.get(dataName);
    }

    /**
     * @return Number of time points.
     */
    public int getTimePointsSize() {
        return timeSeries.length;
    }

    /**
     * @return Number of data series (1 to n).
     */
    public int getNumberOfDataSeries() {
        return dataSeries.size();
    }

    public File getFile() {
        return file;
    }

    // Required for TableColumn in SimulationOverviewController.
    public String getMeanAsString() {
        return getStats().getMeanAsString();
    }

    public String getStdDevAsString() {
        return getStats().getStdDevAsString();
    }

    /**
     * Parses name of TimeSeries.
     *
     * @return
     */
    private String getFileName(File file) {
        String name = null;
        int pos = file.getName().lastIndexOf(".");  //searches the pos of last index of "."
        if (pos != -1) {
            name = file.getName().substring(0, pos);   //substring the Filename at the last "."
        }
        return name;
    }

    public void setDefaultDataSeries(String dataName) {
        if (dataSeries.containsKey(dataName)) {
            defaultDataSeries = dataName;
        }
    }

    /**
     * Reads and parse TimeSeries data from file.
     */
    private void readDataFromFile() {
        String line;
        int row = 0;

        List<Double> times = new ArrayList<>();
        List<Double> fitness = new ArrayList<>();
        BufferedReader buffer = null;
        try {
            buffer = new BufferedReader(new FileReader(file.getAbsolutePath()));
            while ((line = buffer.readLine()) != null) {
                String[] vals = line.trim().split(" ");
                times.add(Double.parseDouble(vals[0]));
                fitness.add(Double.parseDouble(vals[1]));
                row++;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        double[] timePoints = new double[row];
        double[] data = new double[row];
        for (int i = 0; i < row; i++) {
            timePoints[i] = times.get(i);
            data[i] = fitness.get(i);
        }
        setTimeSeries(timePoints);
        addDataSeries(getName(), data);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
          http://www.apache.org/licenses/LICENSE-2.0
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<resources>
    <string name="app_name">Pets</string>
    <string name="action_insert_dummy_data">Insert Dummy Data</string>
    <string name="action_delete_all_entries">Delete All Pets</string>
    <string name="editor_activity_title_new_pet">Add a Pet</string>
    <string name="editor_activity_title_edit">Edit Pet</string>
    <string name="action_save">Save</string>
    <string name="action_delete">Delete</string>
    <string name="category_overview">Overview</string>
    <string name="category_gender">Gender</string>
    <string name="category_measurement">Measurement</string>
    <string name="hint_pet_name">Name</string>
    <string name="hint_pet_breed">Breed</string>
    <string name="hint_pet_weight">Weight</string>
    <string name="unit_pet_weight">kg</string>
    <string name="gender_unknown">Unknown</string>
    <string name="gender_male">Male</string>
    <string name="gender_female">Female</string>
    <string name="editor_insert_pet_successful">Pet saved</string>
    <string name="editor_insert_pet_failed">Error with saving pet</string>
    <string name="editor_update_pet_failed">Error with updating pet</string>
    <string name="empty_view_title_text">It\'s a bit lonely here...</string>
    <string name="editor_update_pet_successful">Pet updated</string>
    <string name="empty_view_subtitle_text">Get started by adding a pet</string>
    <string name="unsaved_changes_dialog_msg">Discard your changes and quit editing?</string>
    <string name="discard">Discard</string>
    <string name="keep_editing">Keep Editing</string>
    <string name="editor_delete_pet_successful">Pet deleted</string>
    <string name="editor_delete_pet_failed">Error with deleting pet</string>
    <string name="delete_dialog_msg">Delete this pet?</string>
    <string name="delete">Delete</string>
    <string name="cancel">Cancel</string>
    <string name="unknown_breed">Unknown breed</string>
</resources>


text:
from monascaclient import client
from monascaclient import exc as monasca_exc

from heat.common import exception as heat_exc
from heat.engine.clients import client_plugin
from heat.engine import constraints

CLIENT_NAME = 'monasca'

class MonascaClientPlugin(client_plugin.ClientPlugin):
    exceptions_module = [monasca_exc]

    service_types = [MONITORING] = ['monitoring']

    VERSION = '2_0'

    def _create(self):
        interface = self._get_client_option(CLIENT_NAME, 'endpoint_type')
        endpoint = self.url_for(service_type=self.MONITORING,
                                endpoint_type=interface)
        return client.Client(
            self.VERSION,
            session=self.context.keystone_session,
            endpoint=endpoint)

    def is_not_found(self, ex):
        return isinstance(ex, monasca_exc.NotFound)

    def is_un_processable(self, ex):
        return isinstance(ex, monasca_exc.UnprocessableEntity)

    def get_notification(self, notification):
        try:
            return self.client().notifications.get(
                notification_id=notification)['id']
        except monasca_exc.NotFound:
            raise heat_exc.EntityNotFound(entity='Monasca Notification',
                                          name=notification)

class MonascaNotificationConstraint(constraints.BaseCustomConstraint):

    resource_client_name = CLIENT_NAME
    resource_getter_name = 'get_notification'


text:
//---------------------------------------------------------------------------

#ifndef MainFormH
#define MainFormH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "JvCombobox.hpp"
#include "JvDriveCtrls.hpp"
#include "JvExStdCtrls.hpp"
#include "JvListBox.hpp"
#include "JvAni.hpp"
#include <FileCtrl.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TfrmMain : public TForm
{
__published:	// IDE-managed Components
        TJvDriveCombo *JvDriveCombo1;
        TJvDirectoryListBox *JvDirectoryListBox1;
        TJvFileListBox *JvFileListBox1;
        TButton *btnSave;
        TSaveDialog *SaveDialog1;
        TPanel *Panel1;
        TPanel *Panel2;
        TPanel *Panel3;
        TMemo *Memo1;
        TImage *Image1;
  TImage *ImageIcons;
  TImage *ImageFrames;
  TLabel *Label1;
  TLabel *Frames;
        void __fastcall FormActivate(TObject *Sender);
  void __fastcall JvFileListBox1Click(TObject *Sender);
  void __fastcall btnSaveClick(TObject *Sender);
private:	// User declarations
        bool Activated;
public:		// User declarations
        __fastcall TfrmMain(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmMain *frmMain;
//---------------------------------------------------------------------------
#endif


text:
<!--
Read more about our custom configuration and use of Google Analytics here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1122305#c8
-->

<!-- Google Tag Manager -->
{% if settings.GTM_CONTAINER_ID %}
  {% include "entrypoints/gtm-snippet.html" %}
{% endif %}
<!-- End Google Tag Manager -->


text:
import React from 'react';
import classNames from 'classnames';

import Icon from '../Icon';
import stylesheet from './SortIcon.scss';

export default function SortIcon({ icon, className, preview = false }) {
  return (
    <span
      className={classNames(className, stylesheet.sortIcon, {
        sortPreview: preview,
      })}
    >
      <Icon icon={icon} />
    </span>
  );
}


text:
cltk.dependency package
=======================

.. automodule:: cltk.dependency
   :members:
   :undoc-members:
   :show-inheritance:

Submodules
----------

cltk.dependency.processes module
--------------------------------

.. automodule:: cltk.dependency.processes
   :members:
   :undoc-members:
   :show-inheritance:

cltk.dependency.stanza module
-----------------------------

.. automodule:: cltk.dependency.stanza
   :members:
   :undoc-members:
   :show-inheritance:

cltk.dependency.tree module
---------------------------

.. automodule:: cltk.dependency.tree
   :members:
   :undoc-members:
   :show-inheritance:

cltk.dependency.utils module
----------------------------

.. automodule:: cltk.dependency.utils
   :members:
   :undoc-members:
   :show-inheritance:


text:
char *
strcat(register char *dst, register const char *src)
{
	register char *e = _memchr2(dst, 0, 0, 0xffffu);
	strcpy(e, src);
	return dst;
}


text:
namespace MvcTemplate.Data.Models
{
    using MvcTemplate.Data.Common.Models;
    using System.Collections.Generic;

    public class JokeCategory : BaseModel<int>
    {
        public JokeCategory()
        {
            this.Jokes = new HashSet<Joke>();
        }

        public string Name { get; set; }

        public virtual ICollection<Joke> Jokes { get; set; }
    }
}


text:
const me = {
    name: "Tung Dang",
    email: "tung.dang.js@gmail.com",
    personalBlog: "http://tung-dang.github.io/",
    works: {
        past: "learning from an outsource company based in Saigon",
        current: "Atlassian",
        future: "not looking for yet"
    },
    socials: {
        facebook: "https://www.facebook.com/tung.bb.dang",
        youtube: "https://www.youtube.com/channel/UCiL6eRhRmDAVf8g0mXgkyxw",
        linkedIn: "https://www.linkedin.com/in/tungdangjs/",
        github: "https://github.com/tung-dang",
        skype: null, // I rarely using Skype, please do not send me a message via Skype
    }
};

export default me;


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using System.Collections;

/*
No Modificar esta Clase.
Cualquier duda comunicarse Con Victor Betancohurt 56912907

INSTRUCCIONES.

Todas las funciones son staticas para no declararlas.
Solo se ingresa el Error con el numero identificador y la descripcion de Error.
	La descripcion de Error es regresada por la Clase de Taro para manejar mejor los Errores.
Cada Error tendra un Texto. Que sera ingresado por la funcion ingresarError
Que estara de la siguiente Manera.
________________________________
|numero|	NombreError  		|
|-------------------------------|
|  1   |	numero Incorrecto	|
|  2   |	id No encontrado	|
|  3   |	No se Guarda		|
|  4   |	No modificacion		|
|  5   |	Error en Coneccion	|

IMPORTANTE MATUL
isActivo() es True si existe Error, de lo contrario regresa un False, Ademas Cuando regresa el True.
	Automaticamente vuelve a poner el activo en False, tomar en cuenta esta situacion.

*/
namespace MuseoCliente.Connection.Objects
{
    class  Error
    {
    	public static string nombreError { get{return nombre;} }
        public static string descripcionError { get{return descripcion;} }
        private static bool activo=false;
		private static string nombre="";
		private static string descripcion="";

        public static void ingresarError(int numero, string error)
        {
            descripcion = error;
            activo = true;
			switch(numero)
			{
				case 1:
					nombre ="Numero Incorrecto";
					break;
				case 2:
					nombre ="No existe Objeto";
					break;
				case 3:
					nombre ="Error Guardar";
					break;

                case 4:
                    nombre = "Modificacion Incorrecta";
                    break;

                case 5:
                    nombre = "Error Coneccion";
                    break;

				default:
					nombre = "Error";
					descripcion ="Ha ocurrido un error";
				break;
			}
        }

		 public static void ingresarError( string nombreError,string error)
        {
            nombre = nombreError;
            descripcion = error;
            activo = true;

        }

         public static void ingresarError(string eMessage)
         {
             if (eMessage.Contains("Conexion"))
                 ingresarError("Error de Conexion", "No se puede establecer contacto con el servidor ");
             else if (eMessage.Contains("User")&& eMessage.Contains("does not exist"))
                 ingresarError("Error en Usuario", "No se ha asignado un usuario, autor existente en la base de datos ");
             else if (eMessage.Contains("AutoField") && eMessage.Contains("does not accept 0"))
                 ingresarError("Error Asignacion", "No existe el objeto asignado para la relacion");
             else
                 ingresarError("Error", "hay uno o varios errores "+eMessage);

         }

        public static bool isActivo()
        {
            bool variable = activo;
            activo = false;
            return variable;
        }

	}
}


text:
require 'etc'
require 'socket'

ExceptionNotifier.configure_exception_notifier do |c|
  c[:exception_recipients] = [SECRETS.administrator_email]
  c[:sender_address] = "#{SECRETS.administrator_email}"
  c[:subject_prepend] = "[ERROR #{SETTINGS.name}] "
  c[:skip_local_notification]  = false
end


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInita98b2cac969a09e45d19922f5a32e9be::getLoader();


text:
public class Verifier
{
    public static final String EXAMPLE_1_FILE = "example1.txt";
    public static final Coordinate EXAMPLE_1_RESULT = new Coordinate(3, 4);
    public static final int EXAMPLE_1_LOS = 8;
    public static final String EXAMPLE_2_FILE = "example2.txt";
    public static final Coordinate EXAMPLE_2_RESULT = new Coordinate(5, 8);
    public static final int EXAMPLE_2_LOS = 33;
    public static final String EXAMPLE_3_FILE = "example3.txt";
    public static final Coordinate EXAMPLE_3_RESULT = new Coordinate(1, 2);
    public static final int EXAMPLE_3_LOS = 35;
    public static final String EXAMPLE_4_FILE = "example4.txt";
    public static final Coordinate EXAMPLE_4_RESULT = new Coordinate(6, 3);
    public static final int EXAMPLE_4_LOS = 41;
    public static final String EXAMPLE_5_FILE = "example5.txt";
    public static final Coordinate EXAMPLE_5_RESULT = new Coordinate(11, 13);
    public static final int EXAMPLE_5_LOS = 210;

    public Verifier (boolean debug)
    {
        _debug = debug;
    }

    // consider adding expected dimensions of grid as an assertion?

    public boolean verify ()
    {
        boolean ok = false;
        Map theMap = new Map(EXAMPLE_1_FILE);

        if (_debug)
        {
            System.out.println("Loaded map "+theMap.getHeight()+" by "+theMap.getWidth());

            System.out.println("\nLoaded map ...\n\n"+theMap);
        }

        long value = theMap.maxDetectableAsteroid();

        ok = (value == EXAMPLE_1_LOS);

        if (ok)
        {
            theMap = new Map(EXAMPLE_2_FILE);

            if (_debug)
            {
                System.out.println("Loaded map "+theMap.getHeight()+" by "+theMap.getWidth());

                System.out.println("\nLoaded map ...\n\n"+theMap);
            }

            value = theMap.maxDetectableAsteroid();

            ok = (value == EXAMPLE_2_LOS);

            if (ok)
            {
                theMap = new Map(EXAMPLE_3_FILE);

                if (_debug)
                {
                    System.out.println("Loaded map "+theMap.getHeight()+" by "+theMap.getWidth());

                    System.out.println("\nLoaded map ...\n\n"+theMap);
                }

                value = theMap.maxDetectableAsteroid();

                ok = (value == EXAMPLE_3_LOS);

                if (ok)
                {
                    theMap = new Map(EXAMPLE_4_FILE);

                    if (_debug)
                    {
                        System.out.println("Loaded map "+theMap.getHeight()+" by "+theMap.getWidth());

                        System.out.println("\nLoaded map ...\n\n"+theMap);
                    }

                    value = theMap.maxDetectableAsteroid();

                    ok = (value == EXAMPLE_4_LOS);

                    if (ok)
                    {
                        theMap = new Map(EXAMPLE_5_FILE);

                        if (_debug)
                        {
                            System.out.println("Loaded map "+theMap.getHeight()+" by "+theMap.getWidth());

                            System.out.println("\nLoaded map ...\n\n"+theMap);
                        }

                        value = theMap.maxDetectableAsteroid();

                        ok = (value == EXAMPLE_5_LOS);
                    }
                    else
                        System.out.println("Verify failed for "+EXAMPLE_4_FILE);
                }
                else
                    System.out.println("Verify failed for "+EXAMPLE_3_FILE);
            }
            else
                System.out.println("Verify failed for "+EXAMPLE_2_FILE);
        }
        else
            System.out.println("Verify failed for "+EXAMPLE_1_FILE);

        return ok;
    }

    private boolean _debug;
}


text:
using SimpleBlog.Infastructure;
using SimpleBlog.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SimpleBlog.ViewModels
{
    public class PostsIndex
    {
        public PagedData<Post> Posts { get; set; }
    }
    public class PostsShow
    {
        public Post Post { get; set; }
    }
    public class PostsTag
    {
        public Tag Tag { get; set; }
        public PagedData<Post> Posts { get; set; }
    }
}


text:
/**
 * Guice service provider interface
 */

package com.google.inject.spi;


text:
<?xml version="1.0" encoding="UTF-8"?>
<netapp  xmlns="http://www.netapp.com/filer/admin" version="1.19">
  <cifs-share-add>
    <comment>asdf</comment>
    <forcegroup>luma</forcegroup>
    <path>/vol/test001/hallo</path>
    <share-name>hallo</share-name>
    <umask>007</umask>
  </cifs-share-add>
</netapp>

<?xml version='1.0' encoding='UTF-8' ?>
<netapp version='1.1' xmlns='http://www.netapp.com/filer/admin'>

    <!-- Output of cifs-share-add [Execution Time: 1070 ms] -->
    <results status='passed'/>
</netapp>

<?xml version='1.0' encoding='UTF-8' ?>
<netapp version='1.1' xmlns='http://www.netapp.com/filer/admin'>

    <!-- Output of cifs-share-add [Execution Time: 1030 ms] -->
    <results errno='13203' reason='There is already a share named hallo. ' status='failed'/>
</netapp>

<?xml version='1.0' encoding='UTF-8' ?>
<netapp version='1.1' xmlns='http://www.netapp.com/filer/admin'>

    <!-- Output of cifs-share-add [Execution Time: 1030 ms] -->
    <results errno='22' reason='Directory "/vol/test001/halloo" does not exist. ' status='failed'/>
</netapp>


text:
/**
 * Created by otgaard on 2017/06/08.
 */
public class Job {
    public String duration;
    public String classPath;
    public String startTime;
    public String context;
    public String result;
    public String status;
    public String jobId;

    Job() { }
}


text:
To provide access to user's native operating system services,
`Kotlin/Native` distribution includes a set of prebuilt libraries specific to
each target. We call them **Platform Libraries**.

### POSIX bindings

For all `Unix` or `Windows` based targets (including `Android` and
`iOS`) we provide the `posix` platform lib. It contains bindings
to platform's implementation of `POSIX` standard.

To use the library just

<div class="sample" markdown="1" theme="idea" data-highlight-only>

```kotlin
import platform.posix.*
```

</div>

The only target for which it is not available is [WebAssembly](https://en.wikipedia.org/wiki/WebAssembly).

Note that the content of `platform.posix` is NOT identical on
different platforms, in the same way as different `POSIX` implementations
are a little different.

### Popular native libraries

There are many more platform libraries available for host and
cross-compilation targets.  `Kotlin/Native` distribution provides access to
`OpenGL`, `zlib` and other popular native libraries on
applicable platforms.

On Apple platforms `objc` library is provided for interoperability with [Objective-C](https://en.wikipedia.org/wiki/Objective-C).

Inspect the contents of `dist/klib/platform/$target` of the distribution for the details.

## Availability by default

The packages from platform libraries are available by default. No
special link flags need to be specified to use them. `Kotlin/Native`
compiler automatically detects which of the platform libraries have
been accessed and automatically links the needed libraries.

On the other hand, the platform libs in the distribution are merely
just wrappers and bindings to the native libraries.  That means the
native libraries themselves (`.so`, `.a`, `.dylib`, `.dll` etc)
should be installed on the machine.

## Examples

`Kotlin/Native` installation provides a wide spectrum of examples
demonstrating the use of platform libraries.
See [samples](https://github.com/JetBrains/kotlin-native/tree/master/samples) for details.


text:
{% extends "base.html" %}

{% block title %}
	EDIT item: {{item.name}} | Category Item App
{% endblock %}

{% block content %}

Edit Item

		<form method="POST" enctype="multipart/form-data"
			action="/catalog/{{item.category.name}}/{{item.name}}/edit/">
			Name: <input name="name" value="{{item.name}}" type="text">
			Description: <textarea name="desc">{{item.description}}</textarea>
			Category: <select name="category">
					       {% for category in categories %}
								{% if item.category == category %}
									<option value="{{category.name}}"
										selected="selected">
										{{category.name}}
									</option>
								{% else %}
									<option value="{{category.name}}">
										{{category.name}}
									</option>
								{% endif %}
						   {% endfor %}
					  </select>
			<button type="submit">Edit Item</button>
		</form>

{% endblock %}


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="true">
    <scale android:interpolator="@android:anim/decelerate_interpolator"
		android:fromXScale="0.0" android:toXScale="1.0"
		android:fromYScale="0.0" android:toYScale="1.0"
		android:pivotX="65%" android:pivotY="35%"
		android:fillAfter="false" android:duration="400"/>
</set>


text:
package fi.csc.chipster.comp;

public class JobCancelledException extends CompException {

	public JobCancelledException(Exception cause) {
		super(cause);
	}

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

	public JobCancelledException() {
		super();
	}
}


text:
package com.ajlopez.ajtalk.compiler;

import static org.junit.Assert.*;

import java.io.IOException;

import org.junit.Test;

import com.ajlopez.ajtalk.language.Block;
import com.ajlopez.ajtalk.language.Bytecodes;
import com.ajlopez.ajtalk.language.IBlock;
import com.ajlopez.ajtalk.language.IMethod;

public class CompilerTests {
	@Test
	public void compileInteger() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("123");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETVALUE, 0}, new Object[] { 123 });
	}

	@Test
	public void compileString() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("'foo'");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETVALUE, 0}, new Object[] { "foo" });
	}

	@Test
	public void compileSymbol() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("#foo");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETVALUE, 0}, new Object[] { "foo" });
	}

	@Test
	public void compileChar() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("$x");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETVALUE, 0}, new Object[] { 'x' });
	}

	@Test
	public void compileGlobalId() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("Smalltalk");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETGLOBAL, 0}, new Object[] { "Smalltalk" });
	}

	@Test
	public void compileLocalId() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("mymethod |a| a");
		Compiler compiler = new Compiler(parser.parseMethodNode());

		IMethod method = compiler.compileMethod();
		this.testBlock((IBlock)method, 0, 1, new byte[] {Bytecodes.GETLOCAL, 0}, new Object[] { });
	}

	@Test
	public void compileArgument() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("mymethod: a a");
		Compiler compiler = new Compiler(parser.parseMethodNode());

		IMethod method = compiler.compileMethod();
		this.testBlock((IBlock)method, 1, 0, new byte[] {Bytecodes.GETARGUMENT, 0}, new Object[] { });
	}

	@Test
	public void compileReturnString() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("^'foo'");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETVALUE, 0, Bytecodes.RETURN}, new Object[] { "foo" });
	}

	@Test
	public void compileAssignemnt() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("a := 1");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETVALUE, 0, Bytecodes.SETGLOBAL, 1}, new Object[] { 1, "a" });
	}

	@Test
	public void compileUnaryMessage() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("1 inc");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETVALUE, 0, Bytecodes.SEND, 1, 0}, new Object[] { 1, "inc" });
	}

	@Test
	public void compileBinaryMessage() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("1+2");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETVALUE, 0, Bytecodes.GETVALUE, 1, Bytecodes.SEND, 2, 1}, new Object[] { 1, 2, "+" });
	}

	@Test
	public void compileKeywordMessage() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("foo do: bar with: 1");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETGLOBAL, 0, Bytecodes.GETGLOBAL, 1, Bytecodes.GETVALUE, 2, Bytecodes.SEND, 3, 2}, new Object[] { "foo", "bar", 1, "do:with:" });
	}

	@Test
	public void compileCompositeExpression() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("1. 2. ^3");
		Compiler compiler = new Compiler(parser.parseExpressionNode());

		IBlock block = compiler.compileBlock();
		this.testBlock(block, 0, 0, new byte[] {Bytecodes.GETVALUE, 0, Bytecodes.CLEAR, Bytecodes.GETVALUE, 1, Bytecodes.CLEAR, Bytecodes.GETVALUE, 2, Bytecodes.RETURN}, new Object[] { 1, 2, 3 });
	}

	@Test
	public void compileSimpleMethod() throws ParserException, IOException, LexerException, CompilerException {
		Parser parser = new Parser("zero ^0");
		Compiler compiler = new Compiler(parser.parseMethodNode());

		IMethod method = compiler.compileMethod();
		this.testBlock((IBlock) method, 0, 0, new byte[] {Bytecodes.GETVALUE, 0, Bytecodes.RETURN}, new Object[] { 0 });
	}

	private void testBlock(IBlock blk, int arity, int nlocals, byte[] bytecodes, Object[] values) {
		Block block = (Block)blk;
		assertNotNull(block);
		assertEquals(arity, block.getArity());
		assertEquals(nlocals, block.getNoLocals());
		assertArrayEquals(bytecodes, block.getBytecodes());
		assertArrayEquals(values, block.getValues());
	}
}


text:
import {AureliaCookie} from 'aurelia-cookie';
import {HttpClient, json} from "aurelia-fetch-client";

export class select{

    isTrue;
    isFalse;
    gameCompleted;
    userData = {};

    constructor(){

        let client = new HttpClient();
        client.fetch("http://localhost:8080/pictures/apple")
            .then (response => response.json())
            .then (data => {
                this.location = data.path;
            })
    }

    Right(){
        this.isTrue = true;
        this.isFalse = false;
        this.gameCompleted = true;
    }

    NotRight(){
        this.isFalse = true;
        this.isTrue = false;
    }

    nextGame(){

        //Adding new score
        var oldScore = AureliaCookie.get('score');
        var score = parseInt(oldScore, 10) + 10;

        //Update cookie
        AureliaCookie.set('score', score , {
            expiry: 1,
            path: '',
            domain: '',
            secure: false
        });

        //Saving new result to database:
        var username = AureliaCookie.get('username');

        console.log("username: " + username);
        console.log("score: " + score);

        let client2 = new HttpClient();
        client2.fetch("http://localhost:8080/users/" + username, {
            'method': "GET"
        })
            .then(response => response.json())
            .then(data => {
                console.log(data.username + " " + data.password + " " + data.e_mail + " " + data.score);
                this.userData = data;

                console.log("userData.score: " + this.userData.score);
                this.userData.score = score;
                console.log("new userData.score: " + this.userData.score);

                let client = new HttpClient();
                client.fetch("http://localhost:8080/users/add", {
                    'method': "POST",
                    'body': json(this.userData),
                })
                    .then(response => response.json())
                    .then(data => {
                        console.log("Server saatis: " + data.username + " " + data.password + " " + data.e_mail + " " + data.score);
                });
        });

       /*Jumping to next game*/ window.location.href='http://localhost:9000/#/selectEquivalent2';
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>All Classes</title>
<meta name="date" content="2016-07-18">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

Dropbox


text:
namespace MassTransit.RabbitMqTransport.Configuration
{
    using System.Collections.Generic;
    using System.Linq;
    using GreenPipes;
    using MassTransit.Configuration;
    using MassTransit.Topology;
    using MassTransit.Topology.Observers;
    using MassTransit.Topology.Topologies;
    using Topology;
    using Topology.Conventions.RoutingKey;
    using Topology.Topologies;

    public class RabbitMqTopologyConfiguration :
        IRabbitMqTopologyConfiguration
    {
        readonly IRabbitMqConsumeTopologyConfigurator _consumeTopology;
        readonly IMessageTopologyConfigurator _messageTopology;
        readonly IRabbitMqPublishTopologyConfigurator _publishTopology;
        readonly IRabbitMqSendTopologyConfigurator _sendTopology;

        public RabbitMqTopologyConfiguration(IMessageTopologyConfigurator messageTopology)
        {
            _messageTopology = messageTopology;

            _sendTopology = new RabbitMqSendTopology(RabbitMqEntityNameValidator.Validator);
            _sendTopology.Connect(new DelegateSendTopologyConfigurationObserver(GlobalTopology.Send));
            _sendTopology.AddConvention(new RoutingKeySendTopologyConvention());

            _publishTopology = new RabbitMqPublishTopology(messageTopology);
            _publishTopology.Connect(new DelegatePublishTopologyConfigurationObserver(GlobalTopology.Publish));

            var observer = new PublishToSendTopologyConfigurationObserver(_sendTopology);
            _publishTopology.Connect(observer);

            _consumeTopology = new RabbitMqConsumeTopology(messageTopology, _publishTopology);
        }

        public RabbitMqTopologyConfiguration(IRabbitMqTopologyConfiguration topologyConfiguration)
        {
            _messageTopology = topologyConfiguration.Message;
            _sendTopology = topologyConfiguration.Send;
            _publishTopology = topologyConfiguration.Publish;

            _consumeTopology = new RabbitMqConsumeTopology(topologyConfiguration.Message, topologyConfiguration.Publish);
        }

        IMessageTopologyConfigurator ITopologyConfiguration.Message => _messageTopology;
        ISendTopologyConfigurator ITopologyConfiguration.Send => _sendTopology;
        IPublishTopologyConfigurator ITopologyConfiguration.Publish => _publishTopology;
        IConsumeTopologyConfigurator ITopologyConfiguration.Consume => _consumeTopology;

        IRabbitMqPublishTopologyConfigurator IRabbitMqTopologyConfiguration.Publish => _publishTopology;
        IRabbitMqSendTopologyConfigurator IRabbitMqTopologyConfiguration.Send => _sendTopology;
        IRabbitMqConsumeTopologyConfigurator IRabbitMqTopologyConfiguration.Consume => _consumeTopology;

        public IEnumerable<ValidationResult> Validate()
        {
            return _sendTopology.Validate()
                .Concat(_publishTopology.Validate())
                .Concat(_consumeTopology.Validate());
        }
    }
}


text:
import { Component, ChangeDetectorRef } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Observable } from 'rxjs/Rx';

import { BeanListener } from '../../services/bean.listener';
import { BeanSettings } from '../../services/bean.settings';

import * as Stick from '../../components/control-pad';

@Component({
  selector: 'control-stick',
  templateUrl: 'stick.html'
})
export class ControlStick {

  stick = {
    x: 0,
    y: 0,
    square: true,
    snappy: true
  }

  alerted: boolean = false;

  constructor(
    private cd: ChangeDetectorRef,
    public navCtrl: NavController,
    public beanListener: BeanListener,
    public beanSettings: BeanSettings) {
  }

  // signal is one of BeanSignal (above)
  sendSignal(signal: string) {
    var self = this;
    return self.beanListener.sendSerialData(signal)
      .then(function (msg) {
        // console.log(msg);
        self.alerted = false;
      })
      .catch(function (e) {
        if (!self.alerted) {
          self.alerted = true;

          Observable.timer(500).subscribe(t => {
            alert((e && e.message) || 'Error: Check connection');
            self.navCtrl.pop();
          });
        }
      });
  }

  setPosition(changeValue: Stick.IChangeValue) {
    var self = this;
    this.stick.x = Math.round(changeValue.pos.x);
    this.stick.y = Math.round(changeValue.pos.y);
    this.cd.detectChanges();

    if (!self.alerted) {
      this.sendSignal('P/' + this.stick.x + '/' + this.stick.y);
    }
  };
}


text:
**aug·ment·ed**
/ˌôɡˈmentəd /
*adjective*
adjective: augmented

    1. having been made greater in size or value.

## Service

The **Service** extension.

This extension adds:
* ORM style Entities and Collections
* REST Resource class and Collections
* Abstract Datasource interface
  - MongoDB
  - SOLR (work in progress)


text:
@interface PodsDummy_Pods_GlossLiteTests : NSObject
@end
@implementation PodsDummy_Pods_GlossLiteTests
@end


text:
<?php

//---------------------------------------------------------------------------------------------------
// Proyecto: Icasus (http://wiki.us.es/icasus/)
// Archivo: unidades/entidad_editar.php
// Tipo: controlador
// Desarrolladores: Juanan Ruiz (juanan@us.es), Jesus Martin Corredera (jjmc@us.es),
// Joaquín Valonero Zaera (tecnibus1@us.es)
//---------------------------------------------------------------------------------------------------
// Descripcion: Edición de entidades existentes
//---------------------------------------------------------------------------------------------------

global $smarty;
global $usuario;
global $plantilla;

if (filter_has_var(INPUT_GET, 'id_entidad'))
{
    $id_entidad = filter_input(INPUT_GET, 'id_entidad', FILTER_SANITIZE_NUMBER_INT);
    $entidad = new Entidad();
    $entidad->load_joined("id = $id_entidad");
    $smarty->assign('entidad', $entidad);

    if ($control)
    {
        // Si vienen todos los datos necesarios del formulario grabamos
        if (filter_has_var(INPUT_POST, 'nombre') && filter_has_var(INPUT_POST, 'etiqueta') && filter_has_var(INPUT_POST, 'etiqueta_mini') && filter_has_var(INPUT_POST, 'codigo') && filter_has_var(INPUT_POST, 'id_padre'))
        {
            $nombre = filter_input(INPUT_POST, 'nombre', FILTER_SANITIZE_STRING);
            $etiqueta = filter_input(INPUT_POST, 'etiqueta', FILTER_SANITIZE_STRING);
            $etiqueta_mini = filter_input(INPUT_POST, 'etiqueta_mini', FILTER_SANITIZE_STRING);
            $id_padre = filter_input(INPUT_POST, 'id_padre', FILTER_SANITIZE_NUMBER_INT);
            $web = filter_has_var(INPUT_POST, 'web') ? filter_input(INPUT_POST, 'web', FILTER_SANITIZE_URL) : '';
            $organica = filter_input(INPUT_POST, 'organica', FILTER_SANITIZE_NUMBER_INT);
            if ($organica == NULL)
            {
                $organica = 0;
            }
            $codigo = filter_has_var(INPUT_POST, 'codigo') ? filter_input(INPUT_POST, 'codigo', FILTER_SANITIZE_STRING) : '';
            $anotaciones = filter_input(INPUT_POST, 'anotaciones', FILTER_SANITIZE_STRING);
            if ($entidad->actualizar($id_entidad, $id_padre, $nombre, $etiqueta, $etiqueta_mini, $web, $organica, $codigo, $anotaciones))
            {
                $smarty->assign('entidad', $entidad);
                $exito = MSG_UNID_EDITADA;
                header("location:index.php?page=entidad_mostrar&id_entidad=$entidad->id&exito=$exito");
            }
            else
            {
                $error = ERR_UNID_EDIT;
                header("location:index.php?page=entidad_mostrar&id_entidad=$entidad->id&error=$error");
            }
        }
        // Si no vienen datos mostramos el formulario
        else
        {
            $madre = $entidad->madre;
            $entidades = $entidad->find("id_madre = 0 OR id_madre = 1 OR id_madre=$madre->id_madre ORDER BY nombre");
            $smarty->assign('_nombre_pagina', TXT_UNID_EDIT . ': ' . $entidad->nombre);
            $smarty->assign('entidades', $entidades);
            $plantilla = 'unidades/entidad_editar.tpl';
        }
    }
    else
    {
        $error = ERR_PERMISOS;
        header("Location: index.php?page=entidad_mostrar&id_entidad=$id_entidad&error=$error");
    }
}
else
{
    $error = ERR_PARAM;
    header("location:index.php?page=error&error=$error");
}


text: __author__ = 'aurlapova'


text:
namespace novus
{

class Particle;
class D3DRenderer;

class ConstraintRenderer : public IRenderable
{
public:
	ConstraintRenderer(float lineWidth, const Vector4& color);
	~ConstraintRenderer();

	void addConstraint(Particle* p1, Particle* p2);
	void removeConstraint(Particle* p1, Particle* p2);
	void removeConnectedConstraints(Particle* particle);

	void Update(float dt);
	void Render(D3DRenderer* renderer);

private:
	LineRenderer mLineRenderer;

	std::list<std::pair<Particle*, Particle*>> mParticleReferences;
};

}

#endif


text: Simple quiz application based in meteor stack


text:
@interface SupplyTableViewController : UITableViewController

@end


text:
import api from '../../api';
import * as types from '../mutation-types';

const state = {
    type: '',
    login: '',
    avatar_url: '',
    gravatar_id: '',
    created_at: '',
    html_url: '',
    followers_url: '',
    following_url: '',
    gists_url: '',
    following: 0,
    followers: 0,
    bio: '',
    hireable: null,
    events_url: '',
    email: '',
    id: 0,
    location: null,
    blog: '',
    company: '',
    public_repos: 0,
    name: '',
    organizations_url: '',
    public_gists: 0,
    received_events_url: '',
    repos_url: '',
    site_admin: false,
    starred_url: '',
    subscriptions_url: '',
    updated_at: '',
    url: ''
};

const getters = {
    getProfile: state => state
};

const actions = {
    setUserProfile({ commit }, username) {
        commit(types.INIT_REPOS);
        return api(
            `https://api.github.com/users/${username}`
        ).then(profile => {
            commit(types.SET_PROFILE, { profile });
        });
    }
};

const mutations = {
    [types.INIT_REPOS](state) {
        state.type = '';
        state.login = '';
        state.avatar_url = '';
        state.gravatar_id = '';
        state.created_at = '';
        state.html_url = '';
        state.followers_url = '';
        state.following_url = '';
        state.gists_url = '';
        state.following = 0;
        state.followers = 0;
        state.bio = '';
        state.hireable = null;
        state.events_url = '';
        state.email = '';
        state.id = 0;
        state.location = null;
        state.blog = '';
        state.company = '';
        state.public_repos = 0;
        state.name = '';
        state.organizations_url = '';
        state.public_gists = 0;
        state.received_events_url = '';
        state.repos_url = '';
        state.site_admin = false;
        state.starred_url = '';
        state.subscriptions_url = '';
        state.updated_at = '';
        state.url = '';
    },
    [types.SET_PROFILE](state, { profile }) {
        state.type = profile.type;
        state.login = profile.login;
        state.avatar_url = profile.avatar_url;
        state.gravatar_id = profile.gravatar_id;
        state.created_at = profile.created_at;
        state.html_url = profile.html_url;
        state.followers_url = profile.followers_url;
        state.following_url = profile.following_url;
        state.gists_url = profile.gists_url;
        state.following = profile.following;
        state.followers = profile.followers;
        state.bio = profile.bio;
        state.hireable = profile.hireable;
        state.events_url = profile.events_url;
        state.email = profile.email;
        state.id = profile.id;
        state.location = profile.location;
        state.blog = profile.blog;
        state.company = profile.company;
        state.public_repos = profile.public_repos;
        state.name = profile.name;
        state.organizations_url = profile.organizations_url;
        state.public_gists = profile.public_gists;
        state.received_events_url = profile.received_events_url;
        state.repos_url = profile.repos_url;
        state.site_admin = profile.site_admin;
        state.starred_url = profile.starred_url;
        state.subscriptions_url = profile.subscriptions_url;
        state.updated_at = profile.updated_at;
        state.url = profile.url;
    }
};

export default {
    state,
    getters,
    actions,
    mutations
};


text:
layout: post
title: 'Software I like: Chrome Coverage Tab'
category: posts
---

[Azerbaijanian Translation](https://prodocs24.com/articles/chrome-coverage-tab/), thanks to Amir.
[Spanish Translation](http://expereb.com/software-que-me-gusta-chrome-coverage-tab/), thanks to Laura.

While both Chrome and Firefox have great developer tools; I had _almost_ forgotten
that Chrome has a [Coverage Tab](https://developer.chrome.com/docs/devtools/coverage/) ~ I hadn't needed it in a long time.

![coverage tab screenshot](/assets/like-coverage/coverage.webp)

It does both JavaScript and CSS; although I've only used the CSS part. For
JavaScript, it is often easier to instrument procedural code with
`console.log`.

## How to Use it?

I think the instructions in the [documentation](https://developer.chrome.com/docs/devtools/coverage/) (same link as above) are pretty good.

## My Experience

I recently inherited an application that someone else wrote. If CSS is hard to
understand, someone else's CSS can be a real challenge. This tweet felt
especially relevant:

![css is hell](/assets/like-coverage/css-on-fire.jpg)

With the coverage tab, you get an idea of what's used and what isn't:
- everything that's red is a candidate for deletion
- everything that's green is a candidate for replacement

One thing to keep in mind: the coverage tab is _dynamic_ ... something highlighted in red might turn green
when you navigate to different part of the page -- or when you activate it; either through hover, or some JavaScript action.

The coverage tab is more of a "guide" than a guarantee... Something green is definitely in use; while something red is not _currently_ used.

## Where is it?

It's not easily _discoverable_ -- If you don't know it's there, it's almost hopeless... (shame 😢)

Open `Developer Tools` and follow the clicks:

![finding the coverage tab in chrome](/assets/like-coverage/coverage-where.png)

(_sidenote: whoah... there's a lot more tools here than I expected_)


text:
namespace chromeos_update_engine {

// This struct stores all relevant info for an edge that is cut between
// nodes old_src -> old_dst by creating new vertex new_vertex. The new
// relationship is:
// old_src -(read before)-> new_vertex <-(write before)- old_dst
// new_vertex is a MOVE operation that moves some existing blocks into
// temp space. The temp extents are, by necessity, stored in new_vertex
// (as dst extents) and old_dst (as src extents), but they are also broken
// out into tmp_extents, as the nodes themselves may contain many more
// extents.
struct CutEdgeVertexes {
  Vertex::Index new_vertex;
  Vertex::Index old_src;
  Vertex::Index old_dst;
  std::vector<Extent> tmp_extents;
};

class DeltaDiffGenerator {
 public:
  // Represents a disk block on the install partition.
  struct Block {
    // During install, each block on the install partition will be written
    // and some may be read (in all likelihood, many will be read).
    // The reading and writing will be performed by InstallOperations,
    // each of which has a corresponding vertex in a graph.
    // A Block object tells which vertex will read or write this block
    // at install time.
    // Generally, there will be a vector of Block objects whose length
    // is the number of blocks on the install partition.
    Block() : reader(Vertex::kInvalidIndex), writer(Vertex::kInvalidIndex) {}
    Vertex::Index reader;
    Vertex::Index writer;
  };

  // This is the only function that external users of the class should call.
  // old_image and new_image are paths to two image files. They should be
  // mounted read-only at paths old_root and new_root respectively.
  // private_key_path points to a private key used to sign the update.
  // Pass empty string to not sign the update.
  // output_path is the filename where the delta update should be written.
  // Returns true on success. Also writes the size of the metadata into
  // |metadata_size|.
  static bool GenerateDeltaUpdateFile(const std::string& old_root,
                                      const std::string& old_image,
                                      const std::string& new_root,
                                      const std::string& new_image,
                                      const std::string& output_path,
                                      const std::string& private_key_path,
                                      uint64_t* metadata_size);

  // These functions are public so that the unit tests can access them:

  // Takes a graph, which is not a DAG, which represents the files just
  // read from disk, and converts it into a DAG by breaking all cycles
  // and finding temp space to resolve broken edges.
  // The final order of the nodes is given in |final_order|
  // Some files may need to be reread from disk, thus |fd| and
  // |data_file_size| are be passed.
  // If |scratch_vertex| is not kInvalidIndex, removes it from
  // |final_order| before returning.
  // Returns true on success.
  static bool ConvertGraphToDag(Graph* graph,
                                const std::string& new_root,
                                int fd,
                                off_t* data_file_size,
                                std::vector<Vertex::Index>* final_order,
                                Vertex::Index scratch_vertex);

  // Reads old_filename (if it exists) and a new_filename and determines
  // the smallest way to encode this file for the diff. It stores
  // necessary data in out_data and fills in out_op.
  // If there's no change in old and new files, it creates a MOVE
  // operation. If there is a change, or the old file doesn't exist,
  // the smallest of REPLACE, REPLACE_BZ, or BSDIFF wins.
  // new_filename must contain at least one byte.
  // Returns true on success.
  static bool ReadFileToDiff(const std::string& old_filename,
                             const std::string& new_filename,
                             bool bsdiff_allowed,
                             std::vector<char>* out_data,
                             InstallOperation* out_op,
                             bool gather_extents);

  // Creates a dummy REPLACE_BZ node in the given |vertex|. This can be used
  // to provide scratch space. The node writes |num_blocks| blocks starting at
  // |start_block|The node should be marked invalid before writing all nodes to
  // the output file.
  static void CreateScratchNode(uint64_t start_block,
                                uint64_t num_blocks,
                                Vertex* vertex);

  // Modifies blocks read by 'op' so that any blocks referred to by
  // 'remove_extents' are replaced with blocks from 'replace_extents'.
  // 'remove_extents' and 'replace_extents' must be the same number of blocks.
  // Blocks will be substituted in the order listed in the vectors.
  // E.g. if 'op' reads blocks 1, 2, 3, 4, 5, 6, 7, 8, remove_extents
  // contains blocks 6, 2, 3, 5, and replace blocks contains
  // 12, 13, 14, 15, then op will be changed to read from:
  // 1, 13, 14, 4, 15, 12, 7, 8
  static void SubstituteBlocks(Vertex* vertex,
                               const std::vector<Extent>& remove_extents,
                               const std::vector<Extent>& replace_extents);

  // Cuts 'edges' from 'graph' according to the AU algorithm. This means
  // for each edge A->B, remove the dependency that B occur before A.
  // Do this by creating a new operation X that copies from the blocks
  // specified by the edge's properties to temp space T. Modify B to read
  // from T rather than the blocks in the edge. Modify A to depend on X,
  // but not on B. Free space is found by looking in 'blocks'.
  // Returns true on success.
  static bool CutEdges(Graph* graph,
                       const std::set<Edge>& edges,
                       std::vector<CutEdgeVertexes>* out_cuts);

  // Stores all Extents in 'extents' into 'out'.
  static void StoreExtents(const std::vector<Extent>& extents,
                           google::protobuf::RepeatedPtrField<Extent>* out);

  // Creates all the edges for the graph. Writers of a block point to
  // readers of the same block. This is because for an edge A->B, B
  // must complete before A executes.
  static void CreateEdges(Graph* graph, const std::vector<Block>& blocks);

  // Given a topologically sorted graph |op_indexes| and |graph|, alters
  // |op_indexes| to move all the full operations to the end of the vector.
  // Full operations should not be depended on, so this is safe.
  static void MoveFullOpsToBack(Graph* graph,
                                std::vector<Vertex::Index>* op_indexes);

  // Sorts the vector |cuts| by its |cuts[].old_dest| member. Order is
  // determined by the order of elements in op_indexes.
  static void SortCutsByTopoOrder(std::vector<Vertex::Index>& op_indexes,
                                  std::vector<CutEdgeVertexes>* cuts);

  // Returns true iff there are no extents in the graph that refer to temp
  // blocks. Temp blocks are in the range [kTempBlockStart, kSparseHole).
  static bool NoTempBlocksRemain(const Graph& graph);

  // Install operations in the manifest may reference data blobs, which
  // are in data_blobs_path. This function creates a new data blobs file
  // with the data blobs in the same order as the referencing install
  // operations in the manifest. E.g. if manifest[0] has a data blob
  // "X" at offset 1, manifest[1] has a data blob "Y" at offset 0,
  // and data_blobs_path's file contains "YX", new_data_blobs_path
  // will set to be a file that contains "XY".
  static bool ReorderDataBlobs(DeltaArchiveManifest* manifest,
                               const std::string& data_blobs_path,
                               const std::string& new_data_blobs_path);

  // Computes a SHA256 hash of the given buf and sets the hash value in the
  // operation so that update_engine could verify. This hash should be set
  // for all operations that have a non-zero data blob. One exception is the
  // dummy operation for signature blob because the contents of the signature
  // blob will not be available at payload creation time. So, update_engine will
  // gracefully ignore the dummy signature operation.
  static bool AddOperationHash(InstallOperation* op,
                               const std::vector<char>& buf);

  // Handles allocation of temp blocks to a cut edge by converting the
  // dest node to a full op. This removes the need for temp blocks, but
  // comes at the cost of a worse compression ratio.
  // For example, say we have A->B->A. It would first be cut to form:
  // A->B->N<-A, where N copies blocks to temp space. If there are no
  // temp blocks, this function can be called to convert it to the form:
  // A->B. Now, A is a full operation.
  static bool ConvertCutToFullOp(Graph* graph,
                                 const CutEdgeVertexes& cut,
                                 const std::string& new_root,
                                 int data_fd,
                                 off_t* data_file_size);

  // Takes |op_indexes|, which is effectively a mapping from order in
  // which the op is performed -> graph vertex index, and produces the
  // reverse: a mapping from graph vertex index -> op_indexes index.
  static void GenerateReverseTopoOrderMap(
      std::vector<Vertex::Index>& op_indexes,
      std::vector<std::vector<Vertex::Index>::size_type>* reverse_op_indexes);

  // Takes a |graph|, which has edges that must be cut, as listed in
  // |cuts|.  Cuts the edges. Maintains a list in which the operations
  // will be performed (in |op_indexes|) and the reverse (in
  // |reverse_op_indexes|).  Cutting edges requires scratch space, and
  // if insufficient scratch is found, the file is reread and will be
  // send down (either as REPLACE or REPLACE_BZ).  Returns true on
  // success.
  static bool AssignTempBlocks(
      Graph* graph,
      const std::string& new_root,
      int data_fd,
      off_t* data_file_size,
      std::vector<Vertex::Index>* op_indexes,
      std::vector<std::vector<Vertex::Index>::size_type>* reverse_op_indexes,
      const std::vector<CutEdgeVertexes>& cuts);

  // Returns true if |op| is a no-op operation that doesn't do any useful work
  // (e.g., a move operation that copies blocks onto themselves).
  static bool IsNoopOperation(const InstallOperation& op);

  static bool InitializePartitionInfo(const std::string& partition,
                                      BlobInfo* info);

  // Runs the bsdiff tool on two files and returns the resulting delta in
  // |out|. Returns true on success.
  static bool BsdiffFiles(const std::string& old_file,
                          const std::string& new_file,
                          std::vector<char>* out);

  // The |blocks| vector contains a reader and writer for each block on the
  // filesystem that's being in-place updated. We populate the reader/writer
  // fields of |blocks| by calling this function.
  // For each block in |operation| that is read or written, find that block
  // in |blocks| and set the reader/writer field to the vertex passed.
  // |graph| is not strictly necessary, but useful for printing out
  // error messages.
  static bool AddInstallOpToBlocksVector(
      const InstallOperation& operation,
      const Graph& graph,
      Vertex::Index vertex,
      std::vector<DeltaDiffGenerator::Block>* blocks);

  // Adds to |manifest| a dummy operation that points to a signature blob
  // located at the specified offset/length.
  static void AddSignatureOp(uint64_t signature_blob_offset,
                             uint64_t signature_blob_length,
                             DeltaArchiveManifest& manifest);

 private:
 // This should never be constructed
  DISALLOW_IMPLICIT_CONSTRUCTORS(DeltaDiffGenerator);
};

extern const char* const kBsdiffPath;
extern const char* const kBspatchPath;

};  // namespace chromeos_update_engine

#endif  // CHROMEOS_PLATFORM_UPDATE_ENGINE_DELTA_DIFF_GENERATOR_H__


text:
angular.module('module_searchMeta')

/*
 *  <directive-search-meta-result-table>
 */
.directive('directiveSearchMetaResultTable', function() {
    return {
        restrict: 'E',
        scope: {
            searchValue: '@searchValue',
            selectedImdbId: "=selectedImdbId"
        },
        controller: "module_searchMeta_resultTable",
        templateUrl: 'app/module/searchMeta/template/resultTable.tpl.html',
        link: function(scope) {

        }
    };
});


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

namespace UnityEditor.PostProcessing
{
    public static class ReflectionUtils
    {
        static Dictionary<KeyValuePair<object, string>, FieldInfo> s_FieldInfoFromPaths = new Dictionary<KeyValuePair<object, string>, FieldInfo>();

        public static FieldInfo GetFieldInfoFromPath(object source, string path)
        {
            FieldInfo field = null;
            var kvp = new KeyValuePair<object, string>(source, path);

            if (!s_FieldInfoFromPaths.TryGetValue(kvp, out field))
            {
                var splittedPath = path.Split('.');
                var type = source.GetType();

                foreach (var t in splittedPath)
                {
                    field = type.GetField(t, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);

                    if (field == null)
                        break;

                    type = field.FieldType;
                }

                s_FieldInfoFromPaths.Add(kvp, field);
            }

            return field;
        }

        public static string GetFieldPath<T, TValue>(Expression<Func<T, TValue>> expr)
        {
            MemberExpression me;
            switch (expr.Body.NodeType)
            {
                case ExpressionType.Convert:
                case ExpressionType.ConvertChecked:
                    var ue = expr.Body as UnaryExpression;
                    me = (ue != null ? ue.Operand : null) as MemberExpression;
                    break;
                default:
                    me = expr.Body as MemberExpression;
                    break;
            }

            var members = new List<string>();
            while (me != null)
            {
                members.Add(me.Member.Name);
                me = me.Expression as MemberExpression;
            }

            var sb = new StringBuilder();
            for (int i = members.Count - 1; i >= 0; i--)
            {
                sb.Append(members[i]);
                if (i > 0) sb.Append('.');
            }

            return sb.ToString();
        }

        public static object GetFieldValue(object source, string name)
        {
            var type = source.GetType();

            while (type != null)
            {
                var f = type.GetField(name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
                if (f != null)
                    return f.GetValue(source);

                type = type.BaseType;
            }

            return null;
        }

        public static object GetFieldValueFromPath(object source, ref Type baseType, string path)
        {
            var splittedPath = path.Split('.');
            object srcObject = source;

            foreach (var t in splittedPath)
            {
                var fieldInfo = baseType.GetField(t, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);

                if (fieldInfo == null)
                {
                    baseType = null;
                    break;
                }

                baseType = fieldInfo.FieldType;
                srcObject = GetFieldValue(srcObject, t);
            }

            return baseType == null
                   ? null
                   : srcObject;
        }

        public static object GetParentObject(string path, object obj)
        {
            var fields = path.Split('.');

            if (fields.Length == 1)
                return obj;

            var info = obj.GetType().GetField(fields[0], BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
            obj = info.GetValue(obj);

            return GetParentObject(string.Join(".", fields, 1, fields.Length - 1), obj);
        }
    }
}


text:
<?php
namespace Test;

require_once __DIR__ . '/Helper.php';
require_once __DIR__ . '/integration/HttpClientApi.php';
require_once __DIR__ . '/integration/SubscriptionHelper.php';
require_once __DIR__ . '/Braintree/CreditCardNumbers/CardTypeIndicators.php';
require_once __DIR__ . '/Braintree/CreditCardDefaults.php';
require_once __DIR__ . '/Braintree/OAuthTestHelper.php';

date_default_timezone_set('UTC');

use Braintree\Configuration;
use PHPUnit\Framework\TestCase;

class Setup extends TestCase
{
    public function setUp()
    {
        parent::setUp();

        self::integrationMerchantConfig();
    }

    public static function integrationMerchantConfig()
    {
        Configuration::reset();

        Configuration::environment('development');
        Configuration::merchantId('integration_merchant_id');
        Configuration::publicKey('integration_public_key');
        Configuration::privateKey('integration_private_key');
    }
}


text:
<!DOCTYPE html>

		<meta name="format-detection" content="telephone=no" />
		<link rel="stylesheet" href="app.min.css"/>


text:
<?php

/**
 * Zend_Json_Client_Exception
 */
require_once 'Zend/Json/Client/Exception.php';

/**
 * Thrown by Zend_Json_Client when an HTTP error occurs during an
 * JSON-RPC method call.
 *
 * @category   Zend
 * @package    Zend_Json
 * @subpackage Client
 * @author     Lars Kneschke <l.kneschke@metaways.de>
 * @copyright  Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Json_Client_HttpException extends Zend_Json_Client_Exception
{}


text:
//
// FFAssembler.cs
//
// Author:
//    Tomas Restrepo (tomas@winterdom.com)
using System;
using System.Collections;
using System.Reflection;
using System.Text;

using Microsoft.BizTalk.PipelineOM;
using Microsoft.BizTalk.Message.Interop;
using Microsoft.BizTalk.Component;
using Microsoft.BizTalk.Component.Interop;
using Microsoft.BizTalk.Component.Utilities;

namespace Winterdom.BizTalk.PipelineTesting.Simple
{
   /// <summary>
   /// Creates and configures a Flat File Assembler component
   /// </summary>
   public class FFAssembler : Assembler
   {
      private FFAsmComp _assembler;

      internal FFAssembler()
      {
         _assembler = new FFAsmComp();
      }

      /// <summary>
      /// Sets the document specification (Schema) to use for
      /// assembling
      /// </summary>
      /// <param name="schemaType">The BizTalk Schema Type</param>
      /// <returns>This instance</returns>
      public FFAssembler WithDocumentSpec(Type schemaType)
      {
         string name = schemaType.AssemblyQualifiedName;
         _assembler.DocumentSpecName = new SchemaWithNone(name);
         AddSchema(schemaType);
         return this;
      }
      /// <summary>
      /// Sets the document specification (Schema) to use for
      /// assembling
      /// </summary>
      /// <typeparam name="T">The BizTalk Schema type</typeparam>
      /// <returns>This instance</returns>
      public FFAssembler WithDocumentSpec<T>()
      {
         return WithDocumentSpec(typeof(T));
      }

      /// <summary>
      /// Sets the Header schema to use for assembling
      /// </summary>
      /// <param name="schemaType">The BizTalk Schema type</param>
      /// <returns>This instance</returns>
      public FFAssembler WithHeaderSpec(Type schemaType)
      {
         string name = schemaType.AssemblyQualifiedName;
         _assembler.HeaderSpecName = new SchemaWithNone(name);
         AddSchema(schemaType);
         return this;
      }
      /// <summary>
      /// Sets the Header schema to use for assembling
      /// </summary>
      /// <typeparam name="T">The BizTalk Schema type</typeparam>
      /// <returns>This instance</returns>
      public FFAssembler WithHeaderSpec<T>()
      {
         return WithHeaderSpec(typeof(T));
      }

      /// <summary>
      /// Sets the footer schema to use when assembling
      /// </summary>
      /// <param name="schemaType">The BizTalk Schema type</param>
      /// <returns>This instance</returns>
      public FFAssembler WithTrailerSpec(Type schemaType)
      {
         string name = schemaType.AssemblyQualifiedName;
         _assembler.TrailerSpecName = new SchemaWithNone(name);
         AddSchema(schemaType);
         return this;
      }
      /// <summary>
      /// Sets the footer schema to use when assembling
      /// </summary>
      /// <typeparam name="T">The BizTalk Schema type</typeparam>
      /// <returns>This instance</returns>
      public FFAssembler WithTrailerSpec<T>()
      {
         return WithTrailerSpec(typeof(T));
      }

      /// <summary>
      /// Configures whether to put a Byte-Order Mark (BOM)
      /// on the resulting message
      /// </summary>
      /// <param name="preserveBom">If true, add a BOM</param>
      /// <returns>This instance</returns>
      public FFAssembler WithPreserveBom(bool preserveBom)
      {
         _assembler.PreserveBom = preserveBom;
         return this;
      }

      /// <summary>
      /// Returns the constructed component
      /// </summary>
      /// <returns>The Flat File assembler</returns>
      public override IBaseComponent End()
      {
         return _assembler;
      }

   } // class FFAssembler

} // namespace Winterdom.BizTalk.PipelineTesting.Simple


text:
Cerebral is based on the simple concept of three things your application does in order to function. **Store state**, **render state** and **update state**.

## Store state
Where to store the state of an application is a highly debated subject. Should we allow the components to store state? Should we have multiple models? Stores? Reducers? Services? There are many concepts that can store state. In Cerebral you store all your state in "a single state tree". That means you do not create classes or other abstractions around state, it is all basically one big object of plain JavaScript types. Objects, arrays, strings, numbers and booleans:

```js
{
  auth: {
    isLoggedIn: false,
    user: {}
  },
  posts: {
    list: [],
    selectedPostIndex: 0
  }
}
```

With this approach we get some benefits not possible with other approaches.

### Simple and consistent API
Typically a state update changes a value, pushes an item in a list or merges an object into another. With a single state tree we can create an API that does exactly that:

```js
state.set('user.prefs.style', 'dark')
state.push('user.friends', 'Joe')
state.merge('user.info', {
  email: 'cheetah@jungle.com',
  name: 'Cheetah'
})
```

With a single state tree we can point to parts of the state using paths (the first argument). We use dot notation to point to nested paths, like **auth.user.name**.

### Optimized rendering
Cerebral does not look at the updates in your application as "value updates", but as "path updates". This allows Cerebral to make optimizations not possible in other frameworks:

1. There is no need for immutability in Cerebral because a change to a path means that any component depending on that path should render (no value comparison). In applications with large data structures immutability has a high cost. There is no need to hack objects and arrays to observe changes to them either. There is nothing special about the state you put into Cerebrals state tree
2. Since there is no value comparison in Cerebral it uses what we call **strict render**. This allows us to do render optimizations not possible with other solutions. For example you can say that a component depending on a list is only interested in added/removed items of the list or if the list itself is being replaced

### Visualize the entire app state
When the state of the application is a single object we can use an object inspector to visualize the whole state of your application. With the Cerebral debugger it is easy to build a mental image of application state. You can even make changes directly to state to see how it affects the view layer.

## Render state
Since Cerebral stores all the state of the application in a single state tree we need a way to expose that state to the components. In some frameworks this is done by passing the whole model or collection of models/stores from the top of the application and down from one component to the next. This can become very tedious and fragile as all nested components completely depend on their parent. In Cerebral the state of the application is directly connected to each component:

```js
connect({
  userName: state`app.user.name`
},
  function User(props) {
    props.userName // "some name" (value stored in 'app.user.name')
  }
)
```

**connect** tells Cerebral that the component is interested in a path where the user name happens to be. When that path changes the component will render. The component is now completely independent of other components. You can move it wherever you want in the component tree and it will still work.

## Update state
This is where Cerebral really differs from other approaches to application development. Updating the state of an application can be anything from:

- flipping a **true** to a **false**
- setting some value, like a filter
- reading (and storing) something in local storage
- requesting data from the server and, depending on the status code of the response, do something with that response which might lead to new requests and/or setting up a listener for data on the server
- etc...

The point is, updating state can be a very complex flow of operations. This is often where spaghetti code comes from and we use abstractions to hide it. The problem with abstractions is that it is very difficult to understand how things actually work and it becomes more difficult to make changes.

To handle everything from a simple toggle to very complex operations, Cerebral has the concept of **signals**. Signals allows you to compose functions together into a flow that is not only about the "happy path" but properly takes the actual paths of execution into account, them being errors or other reasons to diverge execution. You can define many different execution paths based on whatever you want (a status code, an error, some state, etc). This allows you to write decoupled code, while still bringing everything together in the form of a higher abstraction which greatly helps understanding how things relate to one another (in what order they will run, when they will run, etc). Under the hood, signals are based on [function-tree](https://github.com/cerebral/function-tree), a project that came out of the initial experimentations in the first version of Cerebral.

Another powerful feature of **signals** (aka function-tree) is that there is the debugger that can track execution and understands when a signal triggers, what functions are run, what state is being updated, what other side effects are triggered and even how these signals are composed together.

## Summary
The architecture of Cerebral is driven by the goal to give you insight. The single state tree and the way state is connected to the components all support this vision. Creating a Cerebral application allows you and your team members to never question what actually happens when a page loads, a specific button is clicked, etc. Decoupling of state, components and state updates also makes it an overall better experience when scaling up an application as the components will be just a dumb layer that transforms a given state to a user interface.