text:
package org.apache.rocketmq.store.index;

import java.util.List;

public class QueryOffsetResult {
    private final List<Long> phyOffsets;
    private final long indexLastUpdateTimestamp;
    private final long indexLastUpdatePhyoffset;

    public QueryOffsetResult(List<Long> phyOffsets, long indexLastUpdateTimestamp,
        long indexLastUpdatePhyoffset) {
        this.phyOffsets = phyOffsets;
        this.indexLastUpdateTimestamp = indexLastUpdateTimestamp;
        this.indexLastUpdatePhyoffset = indexLastUpdatePhyoffset;
    }

    public List<Long> getPhyOffsets() {
        return phyOffsets;
    }

    public long getIndexLastUpdateTimestamp() {
        return indexLastUpdateTimestamp;
    }

    public long getIndexLastUpdatePhyoffset() {
        return indexLastUpdatePhyoffset;
    }
}


text:
package com.brightspirit.crm;

import java.text.DateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.brightspirit.crm.model.Reminder;
import com.brightspirit.crm.service.CustomerService;

/**
 * Handles requests for the application home page.
 */
@Controller
public class HomeController {

	private final Integer MAX_REMINDER_DAYS_OUT = 9;
	private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
	@Autowired
	private CustomerService customerService;

	@ModelAttribute("customerCount")
	public Integer getCustomerCount() {
		return customerService.getCustomers().size();
	}

	@ModelAttribute("reminderCount")
	public Integer getReminderCount() {
		List<Reminder> tmp = customerService.listReminders(MAX_REMINDER_DAYS_OUT, false);
		if(tmp == null) return 0;
		else return tmp.size();

	}

	@ModelAttribute("notifications")
	public List<Reminder> getReminders() {
		return customerService.listReminders(MAX_REMINDER_DAYS_OUT, false);
	}

	/**
	 * Simply selects the home view to render by returning its name.
	 */
	@RequestMapping(value = "/home", method = RequestMethod.GET)
	public String home(Locale locale, Model model) {

		Date date = new Date();
		DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);

		String formattedDate = dateFormat.format(date);

		model.addAttribute("serverTime", formattedDate );

		return "home";
	}

}

redpajama_set_name: RedPajamaGithub


text:
from setuptools import setup

def read(name):
    from os import path
    return open(path.join(path.dirname(__file__), name)).read()

setup(
    name='django-facebook-auth',
    version='3.7.6',
    description="Authorisation app for Facebook API.",
    long_description=read("README.rst"),
    maintainer="Tomasz Wysocki",
    maintainer_email="tomasz@wysocki.info",

    install_requires=(
        'celery',
        'Django<1.8',
        'facepy>=1.0.6',
    ),

    packages=[
        'facebook_auth',
        'facebook_auth.migrations',
        'facebook_auth.management',
        'facebook_auth.management.commands',
        'facebook_auth.south_migrations',
    ],
)


text:
<!DOCTYPE html>

  <meta charset="UTF-8"/>
  <title>-- TARM --INFO --</title>
  {% include 'head.html' %}

      Load Profile..
      {% block profile-loader %}

evilishies

shaloobie

      {% end %}

New Profile..
      {% block profile-new %}

Profile Name

          <textarea rows="1" cols="8" style="padding-top:1em;">Michael</textarea>

Create

      {% end %}

      Post Story..

Describe Story

        <textarea rows="1" cols="8" style="padding-top:1em;">...</textarea>

Add Video

Add Image

Add Audio

Add Music

Create

      Play Music..

evilishies

shaloobie

      Change Settings..

Haha.

          There are no

         settings.

About..

----------

Add Audio

----------

  <tarm-story-container id="story-holder">
    {% include 'story.html' %}
  </tarm-story-container>

    <input type="button" value="(c) 2014 Tsunami Charles" class="floating" />


text:
package org.globus.swift.catalog.util;

/**
 * This class tries to define an interface to deal with quoting, escaping,
 * and the way back. The quoting algorithm is safe to only itself. Thus,
 *
 *

 * unescape( escape( s ) ) === s
 *

 *
 * holds true, but
 *
 *

 * escape( unescape( s ) ) =?= s
 *

 *
 * does not necessarily hold.
 *
 * @author Gaurang Mehta
 * @author Karan Vahi
 * @author Jens-S. Voeckler
 * @version $Revision: 1.1 $
 */
public class Escape
{
  /**
   * Defines the character used to escape characters.
   */
  private char m_escape;

  /**
   * Defines the set of characters that require escaping.
   */
  private String m_escapable;

  /**
   * Defines the default quoting and escaping rules, escaping the
   * apostrophe, double quote and backslash. The escape character
   * is the backslash.
   *
   */
  public Escape()
  {
    m_escapable = "\"'\\";
    m_escape = '\\';
  }

  /**
   * Constructs arbitrary escaping rules.
   *
   * @param escapable is the set of characters that require escaping
   * @param escape is the escape character itself.
   */
  public Escape( String escapable, char escape )
  {
    m_escape = escape;
    m_escapable = escapable;

    // ensure that the escape character is part of the escapable char set
    if ( escapable.indexOf(escape) == -1 ) m_escapable += m_escape;
  }

  /**
   * Transforms a given string by escaping all characters inside the
   * quotable characters set with the escape character. The escape
   * character itself is also escaped.
   *
   * @param s is the string to escape.
   * @return the quoted string
   * @see #unescape( String )
   */
  public String escape( String s )
  {
    // sanity check
    if ( s == null ) return null;

    StringBuffer result = new StringBuffer( s.length() );
    for ( int i=0; i<s.length(); ++i ) {
      char ch = s.charAt(i);
      if ( m_escapable.indexOf(ch) != -1 ) result.append( m_escape );
      result.append(ch);
    }
    return result.toString();
  }

  /**
   * Transforms a given string by unescaping all characters that
   * are prefixed with the escape character.
   *
   * @param s is the string to remove escapes from.
   * @return the quoted string
   * @see #unescape( String )
   */
  public String unescape( String s )
  {
    // sanity check
    if ( s == null ) return null;

    StringBuffer result = new StringBuffer( s.length() );
    int state = 0;
    for ( int i=0; i<s.length(); ++i ) {
      char ch = s.charAt(i);
      if ( state == 0 ) {
	// default state
	if ( ch == m_escape ) state = 1;
	else result.append(ch);
      } else {
	// "found escape" state
	if ( m_escapable.indexOf(ch) == -1 ) result.append(m_escape);
	result.append(ch);
	state = 0;
      }
    }

    return result.toString();
  }

  /**
   * Test program.
   *
   * @param args are command-line arguments
   */
  public static void main( String args[] )
  {
    Escape me = new Escape(); // defaults

    for ( int i=0; i<args.length; ++i ) {
      String e = me.escape(args[i]);
      String u = me.unescape(args[i]);
      System.out.println( "raw s  > " + args[i] );
      System.out.println( "e(s)   > " + e );
      System.out.println( "u(e(s))> " + me.unescape(e) );
      System.out.println( "u(s)   > " + u );
      System.out.println( "e(u(s))> " + me.escape(u) );
      System.out.println();
    }
  }
}


text:
package org.scalajs.openui5.sap.m

import org.scalajs.openui5.sap.ui.core.{CSSSize, Control, ControlSetters, ControlSettings}
import org.scalajs.openui5.sap.ui.unified.Menu
import org.scalajs.openui5.util.{Settings, SettingsMap, noSettings}

import scala.scalajs.js
import scala.scalajs.js.annotation.{JSName, ScalaJSDefined}

@ScalaJSDefined
trait ToolbarSettings extends ControlSettings
object ToolbarSettings extends ToolbarSettingsBuilder(noSettings)

class ToolbarSettingsBuilder(val dict: SettingsMap)
  extends Settings[ToolbarSettings, ToolbarSettingsBuilder](new ToolbarSettingsBuilder(_))
    with ToolbarSetters[ToolbarSettings, ToolbarSettingsBuilder]

trait ToolbarSetters[T <: js.Object, B <: Settings[T, _]] extends ControlSetters[T, B] {
  def width(v: CSSSize) = setting("width", v)
  def active(v: Boolean) = setting("active", v)
  def enabled(v: Boolean) = setting("enabled", v)
  def height(v: CSSSize) = setting("height", v)
  def design(v: ToolbarDesign) = setting("design", v)

  def content(v: js.Array[Control]) = setting("content", v)

  def press(v: js.Function) = setting("press", v)
}

/** Common Control control that opens a menu when clicked by the user. The
  * control provides an API for configuring the docking position of the menu.
  */
@JSName("sap.m.Toolbar")
@js.native
class Toolbar(id: js.UndefOr[String] = js.native,
                 settings: js.UndefOr[ToolbarSettings] = js.native) extends Control {
  def this(id: String) = this(id, js.undefined)
  def this(settings: ToolbarSettings) = this(js.undefined, settings)
}


text:
//===----------------------------------------------------------------------===//
//
//                         Peloton
//
// abstract_catalog.h
//
// Identification: src/include/catalog/abstract_catalog.h
//
// Copyright (c) 2015-17, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//

#pragma once

#include <atomic>

#include "catalog/catalog_defaults.h"
#include "catalog/schema.h"

namespace peloton {

namespace concurrency {
class TransactionContext;
}

namespace executor {
class LogicalTile;
}

namespace expression {
class AbstractExpression;
}

namespace storage {
class Database;
class DataTable;
class Tuple;
}  // namespace storage

namespace catalog {

class AbstractCatalog {
 public:
  virtual ~AbstractCatalog() {}

 protected:
  /* For pg_database, pg_table, pg_index, pg_column */
  AbstractCatalog(storage::Database *pg_catalog,
                  catalog::Schema *catalog_table_schema,
                  oid_t catalog_table_oid,
                  std::string catalog_table_name);

  /* For other catalogs */
  AbstractCatalog(concurrency::TransactionContext *txn,
                  const std::string &catalog_table_ddl);

  //===--------------------------------------------------------------------===//
  // Helper Functions
  //===--------------------------------------------------------------------===//
  bool InsertTuple(concurrency::TransactionContext *txn,
                   std::unique_ptr<storage::Tuple> tuple);

  bool DeleteWithIndexScan(concurrency::TransactionContext *txn,
                           oid_t index_offset,
                           std::vector<type::Value> values);

  std::unique_ptr<std::vector<std::unique_ptr<executor::LogicalTile>>>
  GetResultWithIndexScan(
      concurrency::TransactionContext *txn,
      std::vector<oid_t> column_offsets,
      oid_t index_offset,
      std::vector<type::Value> values) const;

  std::unique_ptr<std::vector<std::unique_ptr<executor::LogicalTile>>>
  GetResultWithSeqScan(
      concurrency::TransactionContext *txn,
      expression::AbstractExpression *predicate,
      std::vector<oid_t> column_offsets);

  bool UpdateWithIndexScan(concurrency::TransactionContext *txn,
                           oid_t index_offset,
                           std::vector<type::Value> scan_values,
                           std::vector<oid_t> update_columns,
                           std::vector<type::Value> update_values);

  void AddIndex(const std::string &index_name,
                oid_t index_oid,
                const std::vector<oid_t> &key_attrs,
                IndexConstraintType index_constraint);

  //===--------------------------------------------------------------------===//
  // Members
  //===--------------------------------------------------------------------===//

  // Maximum column name size for catalog schemas
  static const size_t max_name_size_ = 64;
  // which database catalog table is stored int
  oid_t database_oid_;
  // Local oid (without catalog type mask) starts from START_OID + OID_OFFSET
  std::atomic<oid_t> oid_ = ATOMIC_VAR_INIT(START_OID + OID_OFFSET);

  storage::DataTable *catalog_table_;
};

}  // namespace catalog
}  // namespace peloton


text:
<?php

class InfoClassement {
    public static function getButsMarques($id) {
        $donnees = Database::getOneData('
        SELECT SUM(score)
        FROM
            (SELECT sum(m1.scoreft1) AS score
            FROM team t1, `match` m1
            WHERE t1.idteam = '.$id.' and m1.idteam1 = t1.idteam
            UNION  ALL
            SELECT sum(m2.scoreft2) AS score
            FROM team t2, `match` m2
            WHERE t2.idteam = '.$id.' and m2.idteam2 = t2.idteam) T
        ');
        return $donnees;
    }

    public static function getButsMarquesDomicile($id) {
        $donnees = Database::getOneData('
        SELECT sum(scoreft1)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam1 = idteam
        ');
        return $donnees;
    }

    public static function getButsMarquesExterieur($id) {
        $donnees = Database::getOneData('
        SELECT sum(scoreft2)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam2 = idteam
        ');
        return $donnees;
    }

    public static function getButsEncaisses($id) {
        $donnees = Database::getOneData('
        SELECT SUM(score)
        FROM
            (SELECT sum(m1.scoreft2) AS score
            FROM team t1, `match` m1
            WHERE t1.idteam = '.$id.' and m1.idteam1 = t1.idteam
            UNION  ALL
            SELECT sum(m2.scoreft1) AS score
            FROM team t2, `match` m2
            WHERE t2.idteam = '.$id.' and m2.idteam2 = t2.idteam) T
        ');
        return $donnees;
    }

    public static function getButsEncaissesDomicile($id) {
        $donnees = Database::getOneData('
        SELECT sum(scoreft2)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam1 = idteam
        ');
        return $donnees;
    }

    public static function getButsEncaissesExterieur($id) {
        $donnees = Database::getOneData('
        SELECT sum(scoreft1)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam2 = idteam
        ');
        return $donnees;
    }

    public static function getButsDiff($id) {
        return InfoClassement::getButsMarques($id)[0] - InfoClassement::getButsEncaisses($id)[0];
    }

    public static function getButsDiffDomicile($id) {
        return InfoClassement::getButsMarquesDomicile($id)[0] - InfoClassement::getButsEncaissesDomicile($id)[0];
    }

    public static function getButsDiffExterieur($id) {
        return InfoClassement::getButsMarquesExterieur($id)[0] - InfoClassement::getButsEncaissesExterieur($id)[0];
    }

    public static function getMatchsGagnes($id) {
        $donnees = Database::getOneData('
        SELECT SUM(score)
        FROM
            (SELECT count(*) AS score
            FROM team t1, `match` m1
            WHERE t1.idteam = '.$id.' and m1.idteam1 = t1.idteam and scoreft1 > scoreft2
            UNION  ALL
            SELECT count(*) AS score
            FROM team t2, `match` m2
            WHERE t2.idteam = '.$id.' and m2.idteam2 = t2.idteam and scoreft2 > scoreft1) T
        ');
        return $donnees;
    }

    public static function getMatchsGagnesDomicile($id) {
        $donnees = Database::getOneData('
        SELECT count(*)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam1 = idteam and scoreft1 > scoreft2
        ');
        return $donnees;
    }

    public static function getMatchsGagnesExterieur($id) {
        $donnees = Database::getOneData('
        SELECT count(*)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam2 = idteam and scoreft1 < scoreft2
        ');
        return $donnees;
    }

    public static function getMatchsPerdus($id) {
        $donnees = Database::getOneData('
        SELECT SUM(score)
        FROM
            (SELECT count(*) AS score
            FROM team t1, `match` m1
            WHERE t1.idteam = '.$id.' and m1.idteam1 = t1.idteam and scoreft1 < scoreft2
            UNION  ALL
            SELECT count(*) AS score
            FROM team t2, `match` m2
            WHERE t2.idteam = '.$id.' and m2.idteam2 = t2.idteam and scoreft2 < scoreft1) T
        ');
        return $donnees;
    }

    public static function getMatchsPerdusDomicile($id) {
        $donnees = Database::getOneData('
        SELECT count(*)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam1 = idteam and scoreft1 < scoreft2
        ');
        return $donnees;
    }

    public static function getMatchsPerdusExterieur($id) {
        $donnees = Database::getOneData('
        SELECT count(*)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam2 = idteam and scoreft1 > scoreft2
        ');
        return $donnees;
    }

    public static function getMatchsNuls($id) {
        $donnees = Database::getOneData('
        SELECT SUM(score)
        FROM
            (SELECT count(*) AS score
            FROM team t1, `match` m1
            WHERE t1.idteam = '.$id.' and m1.idteam1 = t1.idteam and scoreft1 = scoreft2
            UNION  ALL
            SELECT count(*) AS score
            FROM team t2, `match` m2
            WHERE t2.idteam = '.$id.' and m2.idteam2 = t2.idteam and scoreft2 = scoreft1) T
        ');
        return $donnees;
    }

    public static function getMatchsNulsDomicile($id) {
        $donnees = Database::getOneData('
        SELECT count(*)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam1 = idteam and scoreft1 = scoreft2
        ');
        return $donnees;
    }

    public static function getMatchsNulsExterieur($id) {
        $donnees = Database::getOneData('
        SELECT count(*)
        FROM team, `match`
        WHERE idteam = '.$id.' and idteam2 = idteam and scoreft1 = scoreft2
        ');
        return $donnees;
    }

    public static function getNbJournees($id) {
        return InfoClassement::getMatchsGagnes($id)[0] + InfoClassement::getMatchsNuls($id)[0] + InfoClassement::getMatchsPerdus($id)[0];
    }

    public static function getNbJourneesDomicile($id) {
        return InfoClassement::getMatchsGagnesDomicile($id)[0] + InfoClassement::getMatchsNulsDomicile($id)[0] + InfoClassement::getMatchsPerdusDomicile($id)[0];
    }

    public static function getNbJourneesExterieur($id) {
        return InfoClassement::getMatchsGagnesExterieur($id)[0] + InfoClassement::getMatchsNulsExterieur($id)[0] + InfoClassement::getMatchsPerdusExterieur($id)[0];
    }

    public static function getNbPoints($id) {
        return InfoClassement::getMatchsGagnes($id)[0] * 3 + InfoClassement::getMatchsNuls($id)[0];
    }

    public static function getNbPointsDomicile($id) {
        return InfoClassement::getMatchsGagnesDomicile($id)[0] * 3 + InfoClassement::getMatchsNulsDomicile($id)[0];
    }

    public static function getNbPointsExterieur($id) {
        return InfoClassement::getMatchsGagnesExterieur($id)[0] * 3 + InfoClassement::getMatchsNulsExterieur($id)[0];
    }

    public static function getClassement() {
        $rqt = Database::getAllData("Select * from team");
        foreach ($rqt as $row) {
            $data[] = array('id' => $row['idteam'], 'logo' => $row['logoteam'], 'name' => $row['nameteam'], 'points' => InfoClassement::getNbPoints($row['idteam']), 'diff' => InfoClassement::getButsDiff($row['idteam']));
        }

        foreach ($data as $key => $row) {
            $points[$key]  = $row['points'];
            $diff[$key] = $row['diff'];
        }
        array_multisort($points, SORT_DESC, $diff, SORT_DESC, $data);
        return($data);
    }

    public static function getClassementDomicile() {
        $rqt = Database::getAllData("Select * from team");
        foreach ($rqt as $row) {
            $data[] = array('id' => $row['idteam'], 'logo' => $row['logoteam'], 'name' => $row['nameteam'], 'points' => InfoClassement::getNbPointsDomicile($row['idteam']), 'diff' => InfoClassement::getButsDiffDomicile($row['idteam']));
        }

        foreach ($data as $key => $row) {
            $points[$key]  = $row['points'];
            $diff[$key] = $row['diff'];
        }
        array_multisort($points, SORT_DESC, $diff, SORT_DESC, $data);
        return($data);
    }

    public static function getClassementExterieur() {
        $rqt = Database::getAllData("Select * from team");
        foreach ($rqt as $row) {
            $data[] = array('id' => $row['idteam'], 'logo' => $row['logoteam'], 'name' => $row['nameteam'], 'points' => InfoClassement::getNbPointsExterieur($row['idteam']), 'diff' => InfoClassement::getButsDiffExterieur($row['idteam']));
        }

        foreach ($data as $key => $row) {
            $points[$key]  = $row['points'];
            $diff[$key] = $row['diff'];
        }
        array_multisort($points, SORT_DESC, $diff, SORT_DESC, $data);
        return($data);
    }

    public static function getLastMatchs($id) {
        $rqt = Database::getAllData('
        SELECT date
        FROM
            (SELECT datematch AS date
            FROM team t1, `match` m1
            WHERE t1.idteam = '.$id.' and m1.idteam1 = t1.idteam
            UNION  ALL
            SELECT datematch AS date
            FROM team t2, `match` m2
            WHERE t2.idteam = '.$id.' and m2.idteam2 = t2.idteam) T
        ORDER BY date DESC
        LIMIT 5
        ');
        return($rqt);
    }

    public static function getLastMatchsDomicile($id) {
        $rqt = Database::getAllData('
        SELECT datematch
        FROM `match`
        WHERE idteam1 = '.$id.'
        ORDER BY datematch DESC
        LIMIT 5
        ');
        return($rqt);
    }

    public static function getLastMatchsExterieur($id) {
        $rqt = Database::getAllData('
        SELECT datematch
        FROM `match`
        WHERE idteam2 = '.$id.'
        ORDER BY datematch DESC
        LIMIT 5
        ');
        return($rqt);
    }

    public static function getResutatLastMatch($id, $date) {
        $rqt = Database::getOneData('
        SELECT scoreft1, scoreft2, idteam1
            FROM `match` m1
            WHERE m1.datematch = "'.$date.'" and (m1.idteam1 = '.$id.' or m1.idteam2 = '.$id.' )');
        if ($rqt[0] == $rqt[1]) {
            return 0;
        } else {
            if ($rqt[2] == "$id") {
                if ($rqt[0] > $rqt[1]) {
                    return 1;
                } else {
                    return 2;
                }
            } else {
                if ($rqt[0] > $rqt[1]) {
                    return 2;
                } else {
                    return 1;
                }
            }
        }
        return($rqt);
    }

    public static function getResutatLastMatchDomicile($id, $date) {
        $rqt = Database::getOneData('
        SELECT scoreft1, scoreft2, idteam1
            FROM `match` m1
            WHERE m1.datematch = "'.$date.'" and m1.idteam1 = '.$id.'');
        if ($rqt[0] == $rqt[1]) {
            return 0;
        } else {
            if ($rqt[2] == "$id") {
                if ($rqt[0] > $rqt[1]) {
                    return 1;
                } else {
                    return 2;
                }
            } else {
                if ($rqt[0] > $rqt[1]) {
                    return 2;
                } else {
                    return 1;
                }
            }
        }
        return($rqt);
    }

    public static function getResutatLastMatchExterieur($id, $date) {
        $rqt = Database::getOneData('
        SELECT scoreft1, scoreft2, idteam1
            FROM `match` m1
            WHERE m1.datematch = "'.$date.'" and m1.idteam2 = '.$id.'');
        if ($rqt[0] == $rqt[1]) {
            return 0;
        } else {
            if ($rqt[2] == "$id") {
                if ($rqt[0] > $rqt[1]) {
                    return 1;
                } else {
                    return 2;
                }
            } else {
                if ($rqt[0] > $rqt[1]) {
                    return 2;
                } else {
                    return 1;
                }
            }
        }
        return($rqt);
    }

    public static function dateFr($date){
        return strftime('%d/%m/%Y',strtotime($date));
    }

    public static function getElementsPopup($date, $name1, $id1, $logo1) {
        $rqt = Database::getOneData('
            SELECT scoreft1, scoreft2, idteam1, idteam2, journee
            FROM `match` m1
            WHERE m1.datematch = "'.$date.'" and (m1.idteam1 = '.$id1.' or m1.idteam2 = '.$id1.' )');
        if ($rqt[2] == "$id1") {
            $idteamAd = $rqt[3];
        } else {
            $idteamAd = $rqt[2];
        }
        $donneeTeam = Database::getOneData('
            SELECT nameteam, logoteam
            FROM Team
            WHERE idteam = '.$idteamAd.' ');

        if ($rqt[4] == "1") {
            $journee = "1ère jounée";
        } else {
            $journee = $rqt[4] . "ème jounée";
        }
        if ($rqt[2] == "$id1") {
            $data[] = array('journee' => $journee, 'logo1' => $logo1, 'name1' => $name1, 'score1' => $rqt[0], 'score2' => $rqt[1], 'name2' => $donneeTeam[0], 'logo2' => $donneeTeam[1]);
        } else {
            $data[] = array('journee' => $journee, 'logo1' => $donneeTeam[1], 'name1' => $donneeTeam[0], 'score1' => $rqt[0], 'score2' => $rqt[1], 'name2' => $name1, 'logo2' => $logo1);
        }

        return $data;
    }
}
?>


text:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using Vuforia;

public enum UIStates
{
    OVERLAY_OUTLINE, INIT_ANIMATION, SCANNING, GAME_RENDERING, GAME_PLAY, RESET_ALL, NONE
}

/// <summary>
/// Manages all UI States in the app
/// </summary>
public class UIStateManager : MonoBehaviour
{
    #region PUBLIC_MEMBERS
    public Penguin penguin;
    public RawImage cylinderOutline;
    public RawImage instructionsImage;
    public Button doneButton;
    public Button resetButton;
    #endregion //PUBLIC_MEMBERS

    #region PRIVATE_MEMBERS
    private UIStates mState;
    private SurfaceBehaviour mSmartSurface;
    private ReconstructionBehaviour mReconstructionBehaviour;
    private SmartTerrainEventHandler mSTEventHandler;
	private DefaultTrackableEventHandler imageTrackableHandler;
    //private CylinderTrackableEventHandler mCylinderTrackableHandler;
    private SmartTerrainTrackableEventHandler mSTTrackableHandler;
    private Texture2D mPointDeviceTexture;
    private Texture2D mPullBackTexture;
    private Texture2D mTapIceTexture;
    #endregion //PRIVATE_MEMBERS

    #region MONOBEHAVIOUR_METHODS
    void Start()
    {
        // Assign all references
        mReconstructionBehaviour = FindObjectOfType<ReconstructionBehaviour>();
		imageTrackableHandler = FindObjectOfType<DefaultTrackableEventHandler> ();
        //mCylinderTrackableHandler = FindObjectOfType<CylinderTrackableEventHandler>();
        mSTEventHandler = GameObject.FindObjectOfType<SmartTerrainEventHandler>();
        mSmartSurface = GameObject.FindObjectOfType<SurfaceBehaviour>();
        mSTTrackableHandler = GameObject.FindObjectOfType<SmartTerrainTrackableEventHandler>();

        // Register to events
		imageTrackableHandler.ImageTrackableFoundFirstTime += OnCylinderTrackableFoundFirstTime;
        //mCylinderTrackableHandler.CylinderTrackableFoundFirstTime += OnCylinderTrackableFoundFirstTime;

        // Load header textures for user instructions
        mPointDeviceTexture = Resources.Load<Texture2D>("UserInterface/header_pointdevice");
        mPullBackTexture = Resources.Load<Texture2D>("UserInterface/header_pullbackslowly");
        mTapIceTexture = Resources.Load<Texture2D>("UserInterface/header_tapice");
    }

    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Escape) || Input.GetKeyUp(KeyCode.JoystickButton0))
        {
            #if UNITY_EDITOR
                UnityEditor.EditorApplication.isPlaying = false;
            #else
                Application.Quit();
            #endif
        }

        bool showOutline = false;
        bool showDoneButton = false;
        bool showResetButton = false;

        switch (mState)
        {
            //Detection phase
            case UIStates.OVERLAY_OUTLINE:
                instructionsImage.texture = mPointDeviceTexture;
                mSmartSurface.GetComponent<Renderer>().enabled = false;
                showOutline = true;
                break;

            // Soda can ice animating phase
            case UIStates.INIT_ANIMATION:
                mSmartSurface.GetComponent<Renderer>().enabled = false;
                Ice anim = GameObject.FindObjectOfType<Ice>();
                anim.Play();
                if (anim.DidFinishAnimation)
                {
                    mSmartSurface.GetComponent<Renderer>().enabled = mSTTrackableHandler.m_trackablesFound;
                    mState = UIStates.SCANNING;
                }
                break;

            // Scanning phase
            case UIStates.SCANNING:
                mSmartSurface.GetComponent<Renderer>().enabled = mSTTrackableHandler.m_trackablesFound;
                instructionsImage.texture = mPullBackTexture;
                showDoneButton = true;
                break;

            // Icebergs rendering phase - user taps on [DONE] button
            case UIStates.GAME_RENDERING:
                if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null))
                {
                    mSTEventHandler.ShowPropClones();
                    mReconstructionBehaviour.Reconstruction.Stop();
                    mState = UIStates.GAME_PLAY;
                }
                break;

            //Penguin appears and user taps on surface to move the penguin around
            case UIStates.GAME_PLAY:
                if (mSTEventHandler.propsCloned && !penguin.DidAppear)
                {
                    penguin.gameObject.SetActive(true);
                }

                if (penguin.DidAppear)
                {
                    // Update UI messaging
                    instructionsImage.texture = mTapIceTexture;
                    showResetButton = true;
                }
                break;

            //User taps on [RESET] button - Re-loads the level
            case UIStates.RESET_ALL:
                // Go back to loading scene
                int loadingScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex - 1;
                if (loadingScene < 0) loadingScene = 0;
                UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(loadingScene);

                mState = UIStates.NONE;
                break;

            // Just a placeholder state, to make sure that the previous state runs for just one frame.
            case UIStates.NONE: break;
        }

        if (cylinderOutline != null &&
            showOutline != cylinderOutline.enabled)
        {
            cylinderOutline.enabled = showOutline;
        }

        if (doneButton != null &&
            showDoneButton != doneButton.enabled)
        {
            doneButton.enabled = showDoneButton;
            doneButton.image.enabled = showDoneButton;
            doneButton.gameObject.SetActive(showDoneButton);
        }

        if (resetButton != null &&
            showResetButton != resetButton.enabled)
        {
            resetButton.enabled = showResetButton;
            resetButton.image.enabled = showResetButton;
            resetButton.gameObject.SetActive(showResetButton);
        }
    }
    #endregion //MONOBEHAVIOUR_METHODS

    #region PUBLIC_METHODS
    public void TerrainDone()
    {
        mState = UIStates.GAME_RENDERING;
    }

    public void ResetAll()
    {
        mState = UIStates.RESET_ALL;
    }
    #endregion //PUBLIC_METHODS

    #region PRIVATE_METHODS
    private void OnCylinderTrackableFoundFirstTime()
    {
        mState = UIStates.INIT_ANIMATION;
    }
    #endregion //PRIVATE_METHODS
}


text:
package org.springframework.cloud.gcp.data.spanner.core;

import java.util.Collection;
import java.util.function.Function;
import java.util.function.Supplier;

import com.google.cloud.spanner.DatabaseClient;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ReadContext;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.TransactionContext;

import org.springframework.cloud.gcp.data.spanner.core.admin.SpannerSchemaUtils;
import org.springframework.cloud.gcp.data.spanner.core.convert.SpannerEntityProcessor;
import org.springframework.cloud.gcp.data.spanner.core.mapping.SpannerDataException;
import org.springframework.cloud.gcp.data.spanner.core.mapping.SpannerMappingContext;

/**
 * A {@link SpannerTemplate} that performs all operations in a single transaction. This
 * template is not intended for the user to directly instantiate.
 *
 * @author Chengyuan Zhao
 *
 * @since 1.1
 */
class ReadWriteTransactionSpannerTemplate extends SpannerTemplate {

	private TransactionContext transactionContext;

	ReadWriteTransactionSpannerTemplate(Supplier<DatabaseClient> databaseClient,
			SpannerMappingContext mappingContext,
			SpannerEntityProcessor spannerEntityProcessor,
			SpannerMutationFactory spannerMutationFactory,
			SpannerSchemaUtils spannerSchemaUtils,
			TransactionContext transactionContext) {
		super(databaseClient, mappingContext, spannerEntityProcessor,
				spannerMutationFactory, spannerSchemaUtils);
		this.transactionContext = transactionContext;
	}

	@Override
	protected void applyMutations(Collection<Mutation> mutations) {
		this.transactionContext.buffer(mutations);
	}

	@Override
	protected ReadContext getReadContext() {
		return this.transactionContext;
	}

	@Override
	public long executeDmlStatement(Statement statement) {
		return this.transactionContext.executeUpdate(statement);
	}

	@Override
	public long executePartitionedDmlStatement(Statement statement) {
		throw new SpannerDataException(
				"A read-write transaction template cannot execute partitioned DML.");
	}

	@Override
	protected ReadContext getReadContext(TimestampBound timestampBound) {
		throw new SpannerDataException(
				"Getting stale snapshot read contexts is not supported"
						+ " in read-write transaction templates.");
	}

	@Override
	public <T> T performReadWriteTransaction(Function<SpannerTemplate, T> operations) {
		throw new SpannerDataException(
				"A read-write transaction is already under execution. "
						+ "Opening sub-transactions is not supported!");
	}

	@Override
	public <T> T performReadOnlyTransaction(Function<SpannerTemplate, T> operations,
			SpannerReadOptions readOptions) {
		throw new SpannerDataException(
				"A read-write transaction is already under execution. "
						+ "Opening sub-transactions is not supported!");
	}
}


text:
namespace lslboost { namespace numeric {

    template <>
    struct numeric_cast_traits
        <
            char
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            char
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            signed char
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned char
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            short
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned short
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            int
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned int
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            unsigned long
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            float
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            double
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , signed char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<signed char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , unsigned char
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned char> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , unsigned short
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned short> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , unsigned int
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned int> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , unsigned long
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<unsigned long> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , float
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<float> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<double> rounding_policy;
    };

    template <>
    struct numeric_cast_traits
        <
            long double
          , long double
        >
    {
        typedef def_overflow_handler overflow_policy;
        typedef UseInternalRangeChecker range_checking_policy;
        typedef Trunc<long double> rounding_policy;
    };
}}


text:
<?php

namespace DeclareNounou\GestNounouBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

/**
 * This is the class that loads and manages your bundle configuration.
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class DeclareNounouGestNounouExtension extends Extension
{
    /**
     * {@inheritdoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');
    }
}


text:
require('dotenv').config();
var qs = require('qs');
var Rabbit = require('../rabbit'),
    rabbit = new Rabbit();
var Mongo = require('../mongo')();
var assert = require('assert');
var Notifier = require('./notifier'),
    notifier = new Notifier();

const electron = require('electron');
const session = electron.session;
const BrowserWindow = electron.BrowserWindow;

class Auth {
  constructor() {
    this.uri = process.env.VK_CLIENT_OAUTH +
               '?client_id=' +
               process.env.VK_CLIENT_ID +
               '&v=' +
               process.env.VK_API_VERSION +
               '&' +
               'response_type=token&redirect_uri=https://oauth.vk.com/blank.html&scope=friends,messages,offline&state=notify_me'

    // Init consumer
    rabbit.subscribe('vk.auth', function(data) {
      Mongo.connection(function(db) {
        var collection = db.collection('networks');
        var fields = {
          user_id: data.message.user_id,
          token: data.message.token,
          provider: 'vk'
        };
        // collection.createIndex({ provider: 1 }, { unique: true });
        collection.insert(fields, { ordered: false }, function(err, result) {
          if(err) {
            return false;
          }
          assert.equal(err, null);
          session.defaultSession.cookies.set({ url: 'http://localhost', name: 'user_id', value: data.message.user_id }, function(err) {
            if(err) {
              return new err;
            }
          });
          var mainWindow = BrowserWindow.fromId(data.message.window_id);
          mainWindow.webContents.send('vk/auth/login/response');
          db.close();
        });

        notifier.fetch();
      });
    });

  }

  login(callback) {
    var authWindow = new BrowserWindow({
        frame: false,
        height: 500,
        resizable: false,
        width: 750
    });

    authWindow.loadURL(this.uri);

    authWindow.webContents.on('did-get-redirect-request', function(event, oldUrl, newUrl, isMainFrame) {
      if(newUrl.match(/access_token=/) != null && newUrl.match(/user_id=/) != null) {
        var response = qs.parse(newUrl.match(/(access_token=(.*))/)[1]);
        callback(null, {
          token: response.access_token,
          user_id: response.user_id
        });
        return authWindow.close();
      }
      return false;
    });
  }

  publish(message) {
    rabbit.publish('vk.auth', { message: message });
  }

}

module.exports = Auth;


text:
/*
	Package stringutil adalah paket untuk utilities yang
		terkait dengan operasi string
	diambil dari https://golang.org/doc/code.html
*/
package stringutil

// Reverse returns its argument string reversed rune-wise left to right.
func Reverse(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}


text:
Facter.add(:staging_windir) do
  confine :osfamily => :windows
  setcode do
    program_data = `echo %SYSTEMDRIVE%\\ProgramData`.chomp
    if File.directory? program_data
      "#{program_data}\\staging"
    else
      "C:\\staging"
    end
  end
end


text:
import javatools
import os
import zipfile

from itertools import chain as flatten
from javatools import ziputils

from .model import LinkableClass, Package, parse_name

def extract_class(jar, name):
    """Extracts a LinkableClass from a jar.

    Args:
        jar: An open ZipFile instance.
        name: A string containing the binary name of a class.

    Raises:
        KeyError: The class does not exist in the jar.
    """

    with jar.open(name) as entry:
        return LinkableClass(javatools.unpack_class(entry))

def is_jar(path):
    return path.endswith('.jar') and zipfile.is_zipfile(path)

def expand_path(path):
    if os.path.isdir(path) or is_jar(path):
        return [path]
    elif os.path.basename(path) == '*':
        path = os.path.dirname(path)
        contents = [os.path.join(path, c) for c in os.listdir(path)]
        return [c for c in contents if is_jar(c)]
    else:
        raise ValueError('Invalid classpath entry: {}'.format(path))

def open_resource(path):
    if os.path.isdir(path):
        return ExplodedZipFile(path)
    elif is_jar(path):
        return zipfile.ZipFile(path, 'r')
    else:
        raise ValueError('Invalid classpath entry: {}'.format(path))

class ClassLoader(object):
    def __init__(self, paths):
        expanded_paths = [expand_path(p) for p in paths]
        self.paths = list(flatten.from_iterable(expanded_paths))
        self.resources = ResourceLoader(self.paths)

        # {Package : {class name : LinkableClass}}
        self.packages = {}

    def load(self, name):
        package, class_name = parse_name(name)

        try:
            return self.packages[package][class_name]
        except KeyError:
            clazz = self.find(name)
            if clazz and (clazz.package != package or clazz.name != class_name):
                msg = "Wanted class '{}', but '{}' was loaded"
                raise ValueError(msg.format(name, clazz))

            classes = self.packages.setdefault(package, {})
            classes[class_name] = clazz
            return clazz

    def find(self, name):
        package, class_name = parse_name(name)
        path = package.get_member_path(class_name)

        for jar in self.resources:
            try:
                return extract_class(jar, path)
            except KeyError:
                pass

        return None

    # TODO take either a Package or a string name
    def find_package(self, name):
        package = Package(name.split('.'))

        if package in self.packages:
            return package

        for jar in self.resources:
            try:
                jar.getinfo(package.path)
            except KeyError:
                pass
            else:
                # TODO avoid changing state in find method
                self.packages[package] = {}
                return package

        return None

    def close(self):
        for resource in self.resources:
            resource.close()

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc, traceback):
        self.close()
        return exc_type is None

    def __getstate__(self):
        obj = self.__dict__.copy()
        del obj['resources']
        return obj

    def __setstate__(self, obj):
        self.__dict__.update(obj)
        self.resources = ResourceLoader(self.paths)

class ResourceLoader(object):
    def __init__(self, paths):
        self.paths = list(paths)
        self.resources = []

    def __iter__(self):
        for resource in self.resources:
            yield resource

        while len(self.paths) > 0:
            resource = open_resource(self.paths.pop(0))
            self.resources.append(resource)
            yield resource

class ExplodedZipFile(ziputils.ExplodedZipFile):
    """A ZipFile-like object that wraps a directory.

    Changes the behavior of javatools.ziputils.ExplodedZipFile to be
    more consistent with zipfile.ZipFile by raising a KeyError if an
    entry does not exist. It also provides a closing context for use in
    ``with`` statements.
    """

    def open(self, name, mode='rb'):
        try:
            return super(ExplodedZipFile, self).open(name, mode)
        except IOError:
            raise KeyError("There is no item named '{}' in the archive".format(name))

    def getinfo(self, name):
        info = super(ExplodedZipFile, self).getinfo(name)
        if not info:
            raise KeyError("There is no item named '{}' in the archive".format(name))
        return info

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc, traceback):
        self.close()
        return exc_type is None


text:
<?php

namespace Stamp\Tools;

use Symfony\Component\Process\Exception\RuntimeException;

class VersionParser
{

    public function parse($version)
    {
        $regex = '/^(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)$/';
        if (!preg_match($regex, $version, $matches)) {
            throw new RuntimeException(sprintf(
                'Version "%s" doesnt match x.x.x!',
                $version
            ));
        }
        unset($matches[0]);
        unset($matches[1]);
        unset($matches[2]);
        unset($matches[3]);

        return $matches;
    }
}


text:
<?php

namespace lithium\tests\cases\analysis\logger\adapter;

use lithium\storage\Cache As CacheStorage;
use lithium\analysis\Logger;
use lithium\analysis\logger\adapter\Cache;

/**
 * Tests the "Cache" logger adapter.
 */
class CacheTest extends \lithium\test\Unit {

	/**
	 * Sets up and configers the logger and also the cache storage for testing.
	 */
	public function setUp() {
		CacheStorage::config(array(
			'cachelog' => array(
				'adapter' => 'Memory'
			)
		));
		$this->cachelog = new Cache(array(
			'key' => 'cachelog_testkey',
			'config' => 'cachelog'
		));
		Logger::config(array(
			'cachelog' => array(
				'adapter' => $this->cachelog,
				'key' => 'cachelog_testkey',
				'config' => 'cachelog'
			)
		));
	}

	/**
	 * Test the initialization of the cache log adapter.
	 */
	public function testConstruct() {
		$expected = array(
			'config' => "cachelog",
			'expiry' => "+999 days",
			'key' => "cachelog_testkey",
			'init' => true
		);
		$result = $this->cachelog->_config;
		$this->assertEqual($expected, $result);
	}

	/**
	 * Test if the configuration is correctly set in the logger.
	 */
	public function testConfiguration() {
		$loggers = Logger::config();
		$this->assertArrayHasKey('cachelog', $loggers);
	}

	/**
	 * Tests the correct writing to the cache adapter. In this test we use the
	 * "Memory" cache adapter so that we can easily verify the written message.
	 */
	public function testWrite() {
		$message = "CacheLog test message...";
		$result = Logger::write('info', $message, array('name' => 'cachelog'));
		$this->assertNotEmpty($result);
		$result = CacheStorage::read('cachelog', 'cachelog_testkey');
		$this->assertEqual($message, $result);
	}
}

?>


text:
namespace llvm {
  namespace X86 {
    /// RelocationType - An enum for the x86 relocation codes. Note that
    /// the terminology here doesn't follow x86 convention - word means
    /// 32-bit and dword means 64-bit. The relocations will be treated
    /// by JIT or ObjectCode emitters, this is transparent to the x86 code
    /// emitter but JIT and ObjectCode will treat them differently
    enum RelocationType {
      /// reloc_pcrel_word - PC relative relocation, add the relocated value to
      /// the value already in memory, after we adjust it for where the PC is.
      reloc_pcrel_word = 0,

      /// reloc_picrel_word - PIC base relative relocation, add the relocated
      /// value to the value already in memory, after we adjust it for where the
      /// PIC base is.
      reloc_picrel_word = 1,

      /// reloc_absolute_word - absolute relocation, just add the relocated
      /// value to the value already in memory.
      reloc_absolute_word = 2,

      /// reloc_absolute_word_sext - absolute relocation, just add the relocated
      /// value to the value already in memory. In object files, it represents a
      /// value which must be sign-extended when resolving the relocation.
      reloc_absolute_word_sext = 3,

      /// reloc_absolute_dword - absolute relocation, just add the relocated
      /// value to the value already in memory.
      reloc_absolute_dword = 4
    };
  }
}

#endif


text:
/**
test tweets
828627783119208449 - official tweet, taken from here: https://www.nzz.ch/sport/ski-wm-in-st-moritz-der-elektronische-russi-ld.143827
510908133917487104
846231685750439936
260244087901413376
20
1 - tweet that does not work
test on nexus 5
<Text style={styles.instructions}>
       Bad Tweet
     </Text>
<TweetView
  style={styles.twitter_that_doesnot_work}
  tweetid={'1'}/>

 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TextInput,
  Switch,
  Dimensions,
  DeviceEventEmitter,
  ScrollView
} from 'react-native';

import { TweetView } from './TwitterKit';

const screenWidth = Dimensions.get('window').width
const screenHeight = 0.9*screenWidth

export default class example extends Component {

  constructor(props){
    super(props);
    this.state = {
      text: '20'
    }
  }

  componentWillMount() {
    DeviceEventEmitter && DeviceEventEmitter.addListener('testEvent', (testText) => {
      this.setState({
        text: testText
      });
    });
  }

  testMethod = () => {
    this.setState({
      text: '50'
    });
  };

  render() {
    const height = parseInt(this.state.text);
    return (
      <ScrollView style={styles.container}>
        <Text style={styles.instructions}>
           Text Above Tweet
        </Text>
        <TweetView
          style={styles.empty_syle}
          tweetid={'873299426923601921'} />
        <Text style={styles.instructions}>
           Text Bellow Tweet
        </Text>
      </ScrollView>
    );
  }
}

const styles = StyleSheet.create({
  empty_style: {

  },
  container: {
    flex: 1,
  },
  /*container: {
    flex: 1,
        flexDirection: 'column',
        justifyContent: 'center',
        alignItems: 'center',
    backgroundColor: '#EEEEEE',
  },*/
  instructions: {
    textAlign: 'center',
    color: '#000000',
  },
  twitter_that_works: {
    flex: 0,
    width: screenWidth,
    height: 325,
    backgroundColor: '#FFFFFF',
  },
  twitter_that_doesnot_work: {
    flex: 1,
      width: 400,
      height: 100,
  },
});

AppRegistry.registerComponent('example', () => example);


text:
/************************** CHANGES *************************************
1.1.GA      09.25.2014      FPT Team      First version of SDK C90TFS flash driver
                                          inherited from BM C90TFS flash driver v1.02
                                          (08.04.2014, FPT Team)
*************************************************************************/
/* include the header files */
#include "SSD_FTFx.h"

/************************************************************************
*
*  Function Name    : SetEEEEnable.c
*  Description      : This function is used to change the function of
*                     the EERAM. When not partitioned for EEE, the EERAM
*                     is typically used as traditional RAM. When partitioned
*                     for EEE, the EERAM is typically used to store EEE data.
*  Arguments        : PFLASH_SSD_CONFIG, uint8_t
*  Return Value     : uint32_t
*
*************************************************************************/
#if (DEBLOCK_SIZE != 0x0U)

/* Enable size optimization */
#if(ARM_CORTEX_M != CPU_CORE)
#pragma optimize_for_size on
#pragma optimization_level 4
#endif /* end of CPU_CORE */

uint32_t SIZE_OPTIMIZATION SetEEEEnable(PFLASH_SSD_CONFIG pSSDConfig, uint8_t EEEEnable, pFLASHCOMMANDSEQUENCE pFlashCommandSequence)
{

    uint32_t ret;      /* return code variable */
    uint32_t temp;     /* temporary variable */

   /* clear RDCOLERR & ACCERR & FPVIOL flag in flash status register. Write 1 to clear*/
    temp = pSSDConfig->ftfxRegBase + FTFx_SSD_FSTAT_OFFSET;
    REG_WRITE(temp,FTFx_SSD_FSTAT_ERROR_BITS);

    /* passing parameter to the command */
    temp = pSSDConfig->ftfxRegBase + FTFx_SSD_FCCOB0_OFFSET;
    REG_WRITE(temp, FTFx_SET_EERAM);

    temp = pSSDConfig->ftfxRegBase + FTFx_SSD_FCCOB1_OFFSET;
    REG_WRITE(temp, EEEEnable);

    /* calling flash command sequence function to execute the command */
    ret = pFlashCommandSequence(pSSDConfig);

#if C90TFS_ENABLE_DEBUG
    /* Enter Debug state if enabled */
    if (TRUE == (pSSDConfig->DebugEnable))
    {
        ENTER_DEBUG_MODE;
    }
#endif

    return(ret);
}
#endif /* End of DEBLOCK_SIZE*/
/* End of file */


text:
import sys
sys.dont_write_bytecode = True
from timingSetup import oneTrial, VWMTrials, win
from psychopy import core

# initialize nTrials based on VWMTrials data structure
nTrials = len(VWMTrials)

# Runs all nTrials
for i in range(nTrials):
    oneTrial(i)

# close window and quit psychopy
win.close()
core.quit()


text:
'''

@author: quarkonics
'''
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.primarystorage_operations as ps_ops
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import os
import apibinding.inventory as inventory

test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()

def test():
    test_util.test_dsc('Create Data Volume on ceph pool for VM Test')
    cond = res_ops.gen_query_conditions('type', '=', inventory.CEPH_PRIMARY_STORAGE_TYPE)
    ps = res_ops.query_resource_with_num(res_ops.PRIMARY_STORAGE, cond, limit = 1)
    if not ps:
        test_util.test_skip('skip test that ceph ps not found.' )
    ps = ps[0]

    vm = test_stub.create_vlan_vm()
    test_obj_dict.add_vm(vm)

    pool = ps_ops.add_ceph_primary_storage_pool(ps.uuid, 'woodpecker', isCreate=True)
    test_util.test_dsc('Create volume and check')
    disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName'))
    volume_creation_option = test_util.VolumeOption()
    volume_creation_option.set_primary_storage_uuid(ps.uuid)
    volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
    volume_creation_option.set_system_tags(['ceph::pool::woodpecker'])

    volume = test_stub.create_volume(volume_creation_option)
    test_obj_dict.add_volume(volume)
    volume.check()

    test_util.test_dsc('Attach volume and check')
    #mv vm checker later, to save some time.
    vm.check()
    volume.attach(vm)
    volume.check()
    if volume.get_volume().installPath.find('woodpecker') < 0:
        test_util.test_fail('data volume is expected to create on pool woodpecker, while its %s.' % (volume.get_volume().installPath))

    test_util.test_dsc('Detach volume and check')
    volume.detach()
    volume.check()

    test_util.test_dsc('Delete volume and check')
    volume.delete()
    volume.check()
    test_obj_dict.rm_volume(volume)

    ps_ops.delete_ceph_primary_storage_pool(pool.uuid)
    vm.destroy()
    vm.check()
    test_util.test_pass('Create Data Volume on ceph pool for VM Test Success')

#Will be called only if exception happens in test().
def error_cleanup():
    test_lib.lib_error_cleanup(test_obj_dict)


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

        <meta charset="UTF-8">
        <title>
            Release Notes for Ext JS 3.4.0
        </title>

            Release Notes for Ext JS 3.4.1.1

            Release Date: March 29, 2013

            Version Number: 3.4.1.1

            Downloads: Commercial
            GPL

New Features

EXTJSIII-118 - Support for IE10

Bugs Fixed

EXTJSIII-115 - Ajax of XML data does not properly handle XML namespaces on IE8

EXTJSIII-119 - Grid causes double scrollbars in WebKit

            Release Notes for Ext JS 3.4.1

            Release Date: July 30, 2012

            Version Number: 3.4.1

New Features

Added a functionally-reduced flavor of Ext.define. This will allow you to start structuring
                and declaring your classes using the new syntax. To clarify, this is not a back-port of the V4
                class system or the dynamic loader, only a simple wrapper around Ext.extend and Ext.override.
                As such, only the most important directives are provided:

extend

override

statics

singleton

xtype

callParent

Bugs Fixed

EXTJSIII-15 - IE 9.0: Active tab has double lines underneath it in quirks mode

EXTJSIII-17 - enableDragDrop on EditorGridPanel breaks when using CheckColumn

EXTJSIII-18 - CompositeField ownerCt chain broken

EXTJSIII-19 - Ext.calendar cannot be recreated after being destroyed

EXTJSIII-23 - Form layout ignores container's layoutConfig

EXTJSIII-24 - Can't access checkbox when using BooleanColumn's editor is a checkbox

EXTJSIII-30 - notifyDrop called in wrong ddGroup and/or multiple times

EXTJSIII-31 - Grid drag zone swallows document mousedown event in IE

EXTJSIII-32 - Destroying an Ext.form.HtmlEditor twice is causing it to fail to initialize on all subsequent creations of the editor in IE 9

EXTJSIII-33 - User cannot create select region in IE9

EXTJSIII-34 - applyState on grid wipes out sortable property

EXTJSIII-35 - Ext.util.Format.defaultValue doesn't default to an empty string

EXTJSIII-37 - Ext.data.HttpProxy.doRequest does not abort an activeRequest for the same action

EXTJSIII-38 - Update scroller in tabPanel when tab title is changed.

EXTJSIII-39 - DragTracker broken in IE9 Strict mode

EXTJSIII-41 - Buttons in a toolbar loose their position after the left side is collapsed

EXTJSIII-44 - Documentation error in BorderLayout.Region

EXTJSIII-45 - Store.hasMultiSort listed as Store.multiSort

EXTJSIII-48 - Component not allowing select should have proper CSS style

EXTJSIII-49 - Wrong ext-lang-tr.js distributed with ExtJS 3.4.0

EXTJSIII-50 - Focus jump out of order when tab key press from a Grid cell in editing in IE9 standard mode

EXTJSIII-54 - Toolbar reorderer bug. Dragged items can lose contact with mouse pointer.

            Release Notes for Ext JS 3.4.0

            Release Date: June 9, 2011

            Current Version: 3.4.0 (rev 7395/288)

            Previous Version: 3.3.3 (rev 7389/286)

            Changes

            Menu

Incorrect menu width on IE9

Fix Reorderable example

            Form/Field

Fix an issue with composite fields being marked incorrectly

Trigger fields are now flushed with fields on IE9

Fix field width in IE9

Fix fieldset header checkboxes in IE9 quirks

            Misc

Allow altText to be specified on a per item basis for grid columns

Ensure there's no bottom margin on the multi-select

Apply additional css classes for IE9 (ext-ie9 and x-quirks)

Apply additional boolean flags for IE9 (Ext.isIE9 and Ext.isIEQuirks)

Add support to insertHTML method to prevent createContextualFragment errors with IE9